lightdrift-libraw 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +374 -0
- package/LICENSE +21 -0
- package/README.md +757 -0
- package/binding.gyp +38 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/.clang-format +4 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/COPYRIGHT +27 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Changelog.txt +2802 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/DEVELOPER-NOTES +20 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/GoPro/dng-sdk-1_4-allow-VC5-validate.diff +21 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/GoPro/dng-sdk-1_6-hide-ccVc5-definitiion.diff +15 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/GoPro/dng-sdk-allow-VC5-validate.diff +21 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/GoPro/gpr_read_image.cpp.diff +29 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/GoPro/gpr_read_image.h.diff +12 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/INSTALL +51 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/LICENSE.CDDL +340 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/LICENSE.LGPL +458 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/LibRaw.pro +19 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/LibRaw.sln +123 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.am +140 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.devel.nopp +230 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.devel.noppr2i +227 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.dist +501 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.in +1849 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.mingw +297 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/Makefile.msvc +628 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.DNGSDK.txt +43 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.GoPro.txt +112 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.RawSpeed.txt +62 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.cmake +9 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.demosaic-packs +17 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/README.md +106 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed.cpucount-unix.patch +15 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed.qmake-pro-files.patch +84 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed.samsung-decoder.patch +39 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed.uncompressed-color-dng.patch +13 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed.win32-dll.patch +186 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed/rawspeed_xmldata.cpp +4115 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/README.md +69 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/patches/01.CameraMeta-extensibility.patch +13 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/patches/02.Makernotes-processing.patch +36 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/patches/03.remove-limits-and-logging.patch +245 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/patches/04.clang-cl-compatibility.patch +37 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi.cpp +251 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi.h +83 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi_test.cpp +71 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rsxml2c.sh +5 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/aclocal.m4 +1446 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/output.0 +19332 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/output.1 +19332 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/output.2 +19332 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/requests +544 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/traces.0 +3028 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/traces.1 +665 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/autom4te.cache/traces.2 +3028 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/bin/.keep_me +2 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/4channels.pro +5 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/4channels.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/4channels.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_emu.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_emu.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_emu.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_half.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_half.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/dcraw_half.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/half_mt.pro +10 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/libraw-common-lib.pro +28 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/libraw-common.pro +8 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/libraw.pro +70 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/libraw.vcxproj +234 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/libraw.vcxproj.filters +295 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/mem_image.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/mem_image.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/mem_image.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/multirender_test.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/multirender_test.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/multirender_test.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/openbayer_sample.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/openbayer_sample.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/openbayer_sample.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.pro +4 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/raw-identify.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/raw-identify.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/raw-identify.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/rawtextdump.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/rawtextdump.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/rawtextdump.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/simple_dcraw.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/simple_dcraw.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/simple_dcraw.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/unprocessed_raw.pro +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/unprocessed_raw.vcxproj +145 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/buildfiles/unprocessed_raw.vcxproj.filters +18 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/compile +347 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/config.guess +1433 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/config.sub +1804 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/configure +19332 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/configure.ac +153 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/depcomp +791 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/API-C.html +187 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/API-CXX.html +881 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/API-datastruct.html +1341 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/API-notes.html +305 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/API-overview.html +66 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/Install-LibRaw.html +124 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/Samples-LibRaw.html +213 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/Why-LibRaw.html +65 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/doc/index.html +38 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/install-sh +501 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/dcraw_defs.h +66 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/dcraw_fileio_defs.h +25 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/defines.h +193 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/dmp_include.h +27 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/libraw_cameraids.h +320 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/libraw_cxx_defs.h +133 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/libraw_internal_funcs.h +412 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/var_defines.h +215 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/internal/x3f_tools.h +539 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/lib/Makefile +3 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw.h +534 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_alloc.h +148 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_const.h +814 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_datastream.h +410 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_internal.h +341 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_types.h +1175 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw/libraw_version.h +63 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw.pc.in +12 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/libraw_r.pc.in +12 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/ltmain.sh +11147 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/ax_openmp.m4 +99 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/libtool.m4 +8369 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/ltoptions.m4 +437 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/ltsugar.m4 +124 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/ltversion.m4 +23 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/m4/lt~obsolete.m4 +99 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/missing +215 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/object/.keep_me +0 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/rsxml2c.sh +6 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/4channels.cpp +174 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/Makefile +2 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/dcraw_emu.cpp +670 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/dcraw_half.c +78 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/half_mt.c +178 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/half_mt_win32.c +212 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/mem_image_sample.cpp +282 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/multirender_test.cpp +107 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/openbayer_sample.cpp +65 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/postprocessing_benchmark.cpp +223 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/raw-identify.cpp +743 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/rawtextdump.cpp +144 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/simple_dcraw.cpp +217 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/samples/unprocessed_raw.cpp +319 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/shlib-version.sh +11 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/Makefile +2 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/canon_600.cpp +225 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/crx.cpp +2781 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/decoders_dcraw.cpp +1816 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/decoders_libraw.cpp +873 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/decoders_libraw_dcrdefs.cpp +411 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/dng.cpp +284 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/fp_dng.cpp +689 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/fuji_compressed.cpp +1210 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/generic.cpp +101 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/kodak_decoders.cpp +524 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/load_mfbacks.cpp +936 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/smal.cpp +181 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/unpack.cpp +508 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/decoders/unpack_thumb.cpp +405 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/aahd_demosaic.cpp +781 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/ahd_demosaic.cpp +355 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/dcb_demosaic.cpp +900 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/dht_demosaic.cpp +1033 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/misc_demosaic.cpp +420 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/demosaic/xtrans_demosaic.cpp +434 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/integration/dngsdk_glue.cpp +416 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/integration/rawspeed_glue.cpp +286 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/libraw_c_api.cpp +457 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/libraw_datastream.cpp +1046 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/adobepano.cpp +154 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/canon.cpp +1335 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/ciff.cpp +411 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/cr3_parser.cpp +896 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/epson.cpp +96 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/exif_gps.cpp +430 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/fuji.cpp +1427 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/hasselblad_model.cpp +538 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/identify.cpp +3167 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/identify_tools.cpp +140 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/kodak.cpp +363 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/leica.cpp +375 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/makernotes.cpp +786 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/mediumformat.cpp +521 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/minolta.cpp +110 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/misc_parsers.cpp +694 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/nikon.cpp +1051 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/normalize_model.cpp +1451 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/olympus.cpp +685 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/p1.cpp +192 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/pentax.cpp +675 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/samsung.cpp +182 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/sony.cpp +2320 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/metadata/tiff.cpp +2198 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/aspect_ratio.cpp +113 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/dcraw_process.cpp +259 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/mem_image.cpp +292 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/postprocessing_aux.cpp +413 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/postprocessing_ph.cpp +31 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/postprocessing_utils.cpp +190 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/postprocessing/postprocessing_utils_dcrdefs.cpp +308 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/preprocessing/ext_preprocess.cpp +127 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/preprocessing/preprocessing_ph.cpp +24 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/preprocessing/raw2image.cpp +560 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/preprocessing/subtract_black.cpp +91 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/tables/cameralist.cpp +1268 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/tables/colorconst.cpp +57 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/tables/colordata.cpp +1841 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/tables/wblists.cpp +217 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/curves.cpp +154 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/decoder_info.cpp +413 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/init_close_utils.cpp +340 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/open.cpp +1269 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/phaseone_processing.cpp +101 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/read_utils.cpp +176 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/thumb_utils.cpp +338 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/utils_dcraw.cpp +330 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/utils/utils_libraw.cpp +673 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/write/apply_profile.cpp +76 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/write/file_write.cpp +338 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/write/tiff_writer.cpp +73 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/write/write_ph.cpp +39 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/x3f/x3f_parse_process.cpp +708 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/src/x3f/x3f_utils_patched.cpp +2119 -0
- package/deps/LibRaw-Source/LibRaw-0.21.4/version.sh +16 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/.clang-format +4 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/COPYRIGHT +27 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Changelog.txt +2802 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/DEVELOPER-NOTES +20 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/GoPro/dng-sdk-1_4-allow-VC5-validate.diff +21 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/GoPro/dng-sdk-1_6-hide-ccVc5-definitiion.diff +15 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/GoPro/dng-sdk-allow-VC5-validate.diff +21 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/GoPro/gpr_read_image.cpp.diff +29 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/GoPro/gpr_read_image.h.diff +12 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/INSTALL +51 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/LICENSE.CDDL +340 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/LICENSE.LGPL +458 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/LibRaw.pro +19 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/LibRaw.sln +123 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.am +140 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.devel.nopp +230 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.devel.noppr2i +227 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.dist +501 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.in +1849 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.mingw +297 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/Makefile.msvc +628 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.DNGSDK.txt +43 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.GoPro.txt +112 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.RawSpeed.txt +62 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.cmake +9 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.demosaic-packs +17 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/README.md +106 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed.cpucount-unix.patch +15 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed.qmake-pro-files.patch +84 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed.samsung-decoder.patch +39 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed.uncompressed-color-dng.patch +13 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed.win32-dll.patch +186 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed/rawspeed_xmldata.cpp +4115 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/README.md +69 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/patches/01.CameraMeta-extensibility.patch +13 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/patches/02.Makernotes-processing.patch +36 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/patches/03.remove-limits-and-logging.patch +245 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/patches/04.clang-cl-compatibility.patch +37 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi.cpp +251 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi.h +83 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rawspeed3_capi_test.cpp +71 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/RawSpeed3/rawspeed3_c_api/rsxml2c.sh +5 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/aclocal.m4 +1446 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/output.0 +19332 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/output.1 +19332 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/output.2 +19332 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/requests +544 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/traces.0 +3028 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/traces.1 +665 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/autom4te.cache/traces.2 +3028 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/.keep_me +2 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/4channels.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/dcraw_emu.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/dcraw_half.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/half_mt.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/libraw.dll +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/mem_image.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/multirender_test.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/openbayer_sample.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/postprocessing_benchmark.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/raw-identify.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/rawtextdump.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/simple_dcraw.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/bin/unprocessed_raw.exe +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/4channels.pro +5 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/4channels.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/4channels.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_emu.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_emu.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_emu.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_half.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_half.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/dcraw_half.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/half_mt.pro +10 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/libraw-common-lib.pro +28 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/libraw-common.pro +8 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/libraw.pro +70 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/libraw.vcxproj +234 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/libraw.vcxproj.filters +295 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/mem_image.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/mem_image.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/mem_image.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/multirender_test.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/multirender_test.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/multirender_test.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/openbayer_sample.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/openbayer_sample.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/openbayer_sample.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.pro +4 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/postprocessing_benchmark.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/raw-identify.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/raw-identify.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/raw-identify.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/rawtextdump.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/rawtextdump.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/rawtextdump.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/simple_dcraw.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/simple_dcraw.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/simple_dcraw.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/unprocessed_raw.pro +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/unprocessed_raw.vcxproj +145 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/buildfiles/unprocessed_raw.vcxproj.filters +18 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/compile +347 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/config.guess +1433 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/config.sub +1804 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/configure +19332 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/configure.ac +153 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/depcomp +791 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/API-C.html +187 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/API-CXX.html +881 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/API-datastruct.html +1341 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/API-notes.html +305 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/API-overview.html +66 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/Install-LibRaw.html +124 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/Samples-LibRaw.html +213 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/Why-LibRaw.html +65 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/doc/index.html +38 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/install-sh +501 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/dcraw_defs.h +66 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/dcraw_fileio_defs.h +25 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/defines.h +193 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/dmp_include.h +27 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/libraw_cameraids.h +320 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/libraw_cxx_defs.h +133 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/libraw_internal_funcs.h +412 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/var_defines.h +215 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/internal/x3f_tools.h +539 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/lib/Makefile +3 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/lib/libraw.exp +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/lib/libraw.lib +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/lib/libraw_static.lib +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw.h +534 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_alloc.h +148 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_const.h +814 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_datastream.h +410 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_internal.h +341 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_types.h +1175 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw/libraw_version.h +63 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw.pc.in +12 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/libraw_r.pc.in +12 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/ltmain.sh +11147 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/ax_openmp.m4 +99 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/libtool.m4 +8369 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/ltoptions.m4 +437 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/ltsugar.m4 +124 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/ltversion.m4 +23 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/m4/lt~obsolete.m4 +99 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/missing +215 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/object/.keep_me +0 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/rsxml2c.sh +6 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/4channels.cpp +174 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/Makefile +2 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/dcraw_emu.cpp +670 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/dcraw_half.c +78 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/half_mt.c +178 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/half_mt_win32.c +212 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/mem_image_sample.cpp +282 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/multirender_test.cpp +107 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/openbayer_sample.cpp +65 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/postprocessing_benchmark.cpp +223 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/raw-identify.cpp +743 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/rawtextdump.cpp +144 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/simple_dcraw.cpp +217 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/samples/unprocessed_raw.cpp +319 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/shlib-version.sh +11 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/Makefile +2 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/canon_600.cpp +225 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/crx.cpp +2781 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/decoders_dcraw.cpp +1816 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/decoders_libraw.cpp +873 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/decoders_libraw_dcrdefs.cpp +411 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/dng.cpp +284 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/fp_dng.cpp +689 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/fuji_compressed.cpp +1210 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/generic.cpp +101 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/kodak_decoders.cpp +524 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/load_mfbacks.cpp +936 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/smal.cpp +181 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/unpack.cpp +508 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/decoders/unpack_thumb.cpp +405 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/aahd_demosaic.cpp +781 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/ahd_demosaic.cpp +355 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/dcb_demosaic.cpp +900 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/dht_demosaic.cpp +1033 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/misc_demosaic.cpp +420 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/demosaic/xtrans_demosaic.cpp +434 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/integration/dngsdk_glue.cpp +416 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/integration/rawspeed_glue.cpp +286 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/libraw_c_api.cpp +457 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/libraw_datastream.cpp +1046 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/adobepano.cpp +154 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/canon.cpp +1335 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/ciff.cpp +411 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/cr3_parser.cpp +896 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/epson.cpp +96 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/exif_gps.cpp +430 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/fuji.cpp +1427 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/hasselblad_model.cpp +538 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/identify.cpp +3167 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/identify_tools.cpp +140 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/kodak.cpp +363 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/leica.cpp +375 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/makernotes.cpp +786 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/mediumformat.cpp +521 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/minolta.cpp +110 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/misc_parsers.cpp +694 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/nikon.cpp +1051 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/normalize_model.cpp +1451 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/olympus.cpp +685 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/p1.cpp +192 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/pentax.cpp +675 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/samsung.cpp +182 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/sony.cpp +2320 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/metadata/tiff.cpp +2198 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/aspect_ratio.cpp +113 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/dcraw_process.cpp +259 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/mem_image.cpp +292 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/postprocessing_aux.cpp +413 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/postprocessing_ph.cpp +31 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/postprocessing_utils.cpp +190 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/postprocessing/postprocessing_utils_dcrdefs.cpp +308 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/preprocessing/ext_preprocess.cpp +127 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/preprocessing/preprocessing_ph.cpp +24 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/preprocessing/raw2image.cpp +560 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/preprocessing/subtract_black.cpp +91 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/tables/cameralist.cpp +1268 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/tables/colorconst.cpp +57 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/tables/colordata.cpp +1841 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/tables/wblists.cpp +217 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/curves.cpp +154 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/decoder_info.cpp +413 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/init_close_utils.cpp +340 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/open.cpp +1269 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/phaseone_processing.cpp +101 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/read_utils.cpp +176 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/thumb_utils.cpp +338 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/utils_dcraw.cpp +330 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/utils/utils_libraw.cpp +673 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/write/apply_profile.cpp +76 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/write/file_write.cpp +338 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/write/tiff_writer.cpp +73 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/write/write_ph.cpp +39 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/x3f/x3f_parse_process.cpp +708 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/src/x3f/x3f_utils_patched.cpp +2119 -0
- package/deps/LibRaw-Win64/LibRaw-0.21.4/version.sh +16 -0
- package/lib/index.d.ts +324 -0
- package/lib/index.js +761 -0
- package/package.json +97 -0
- package/src/addon.cpp +8 -0
- package/src/libraw_wrapper.cpp +1223 -0
- package/src/libraw_wrapper.h +109 -0
- package/src/libraw_wrapper_new.cpp +853 -0
|
@@ -0,0 +1,3167 @@
|
|
|
1
|
+
/* -*- C++ -*-
|
|
2
|
+
* Copyright 2019-2021 LibRaw LLC (info@libraw.org)
|
|
3
|
+
*
|
|
4
|
+
LibRaw uses code from dcraw.c -- Dave Coffin's raw photo decoder,
|
|
5
|
+
dcraw.c is copyright 1997-2018 by Dave Coffin, dcoffin a cybercom o net.
|
|
6
|
+
LibRaw do not use RESTRICTED code from dcraw.c
|
|
7
|
+
|
|
8
|
+
LibRaw is free software; you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the one of two licenses as you choose:
|
|
10
|
+
|
|
11
|
+
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
|
|
12
|
+
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
|
|
13
|
+
|
|
14
|
+
2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
|
15
|
+
(See file LICENSE.CDDL provided in LibRaw distribution archive for details).
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#include "../../internal/dcraw_defs.h"
|
|
20
|
+
#include "../../internal/libraw_cameraids.h"
|
|
21
|
+
|
|
22
|
+
// clang-format on
|
|
23
|
+
static const struct
|
|
24
|
+
{
|
|
25
|
+
const int CorpId;
|
|
26
|
+
const char *CorpName;
|
|
27
|
+
} CorpTable[] = {
|
|
28
|
+
{LIBRAW_CAMERAMAKER_Agfa, "AgfaPhoto"},
|
|
29
|
+
{LIBRAW_CAMERAMAKER_Apple, "Apple"},
|
|
30
|
+
{LIBRAW_CAMERAMAKER_Broadcom, "Broadcom"},
|
|
31
|
+
{LIBRAW_CAMERAMAKER_Canon, "Canon"},
|
|
32
|
+
{LIBRAW_CAMERAMAKER_Casio, "Casio"},
|
|
33
|
+
{LIBRAW_CAMERAMAKER_CINE, "CINE"},
|
|
34
|
+
{LIBRAW_CAMERAMAKER_Epson, "Epson"},
|
|
35
|
+
{LIBRAW_CAMERAMAKER_Fujifilm, "Fujifilm"},
|
|
36
|
+
{LIBRAW_CAMERAMAKER_Mamiya, "Mamiya"},
|
|
37
|
+
{LIBRAW_CAMERAMAKER_Motorola, "Motorola"},
|
|
38
|
+
{LIBRAW_CAMERAMAKER_Kodak, "Kodak"},
|
|
39
|
+
{LIBRAW_CAMERAMAKER_Konica, "Konica"},
|
|
40
|
+
{LIBRAW_CAMERAMAKER_Minolta, "Minolta"},
|
|
41
|
+
{LIBRAW_CAMERAMAKER_Leica, "Leica"},
|
|
42
|
+
{LIBRAW_CAMERAMAKER_Nikon, "Nikon"},
|
|
43
|
+
{LIBRAW_CAMERAMAKER_Nokia, "Nokia"},
|
|
44
|
+
{LIBRAW_CAMERAMAKER_Olympus, "Olympus"},
|
|
45
|
+
{LIBRAW_CAMERAMAKER_OmDigital, "OM Digital"},
|
|
46
|
+
{LIBRAW_CAMERAMAKER_Ricoh, "Ricoh"},
|
|
47
|
+
{LIBRAW_CAMERAMAKER_Pentax, "Pentax"},
|
|
48
|
+
{LIBRAW_CAMERAMAKER_PhaseOne, "Phase One"},
|
|
49
|
+
{LIBRAW_CAMERAMAKER_PhaseOne, "PhaseOne"},
|
|
50
|
+
{LIBRAW_CAMERAMAKER_Samsung, "Samsung"},
|
|
51
|
+
{LIBRAW_CAMERAMAKER_Sigma, "Sigma"},
|
|
52
|
+
{LIBRAW_CAMERAMAKER_Sinar, "Sinar"},
|
|
53
|
+
{LIBRAW_CAMERAMAKER_Sony, "Sony"},
|
|
54
|
+
{LIBRAW_CAMERAMAKER_YI, "YI"},
|
|
55
|
+
// add corp. names below
|
|
56
|
+
{LIBRAW_CAMERAMAKER_Alcatel, "Alcatel"},
|
|
57
|
+
{LIBRAW_CAMERAMAKER_Aptina, "Aptina"},
|
|
58
|
+
{LIBRAW_CAMERAMAKER_AVT, "AVT"},
|
|
59
|
+
{LIBRAW_CAMERAMAKER_Baumer, "Baumer"},
|
|
60
|
+
{LIBRAW_CAMERAMAKER_Clauss, "Clauss"},
|
|
61
|
+
{LIBRAW_CAMERAMAKER_Contax, "Contax"},
|
|
62
|
+
{LIBRAW_CAMERAMAKER_Creative, "Creative"},
|
|
63
|
+
{LIBRAW_CAMERAMAKER_DJI, "DJI"},
|
|
64
|
+
{LIBRAW_CAMERAMAKER_Foculus, "Foculus"},
|
|
65
|
+
{LIBRAW_CAMERAMAKER_Generic, "Generic"},
|
|
66
|
+
{LIBRAW_CAMERAMAKER_Gione, "Gione"},
|
|
67
|
+
{LIBRAW_CAMERAMAKER_GITUP, "GITUP"},
|
|
68
|
+
{LIBRAW_CAMERAMAKER_Hasselblad, "Hasselblad"},
|
|
69
|
+
{LIBRAW_CAMERAMAKER_HTC, "HTC"},
|
|
70
|
+
{LIBRAW_CAMERAMAKER_I_Mobile, "I_Mobile"},
|
|
71
|
+
{LIBRAW_CAMERAMAKER_Imacon, "Imacon"},
|
|
72
|
+
{LIBRAW_CAMERAMAKER_ISG, "ISG"},
|
|
73
|
+
{LIBRAW_CAMERAMAKER_JK_Imaging, "JK Imaging"}, // Kodak
|
|
74
|
+
{LIBRAW_CAMERAMAKER_Leaf, "Leaf"},
|
|
75
|
+
{LIBRAW_CAMERAMAKER_Lenovo, "Lenovo"},
|
|
76
|
+
{LIBRAW_CAMERAMAKER_LG, "LG"},
|
|
77
|
+
{LIBRAW_CAMERAMAKER_Logitech, "Logitech"},
|
|
78
|
+
{LIBRAW_CAMERAMAKER_Matrix, "Matrix"},
|
|
79
|
+
{LIBRAW_CAMERAMAKER_Meizu, "Meizu"},
|
|
80
|
+
{LIBRAW_CAMERAMAKER_Micron, "Micron"},
|
|
81
|
+
{LIBRAW_CAMERAMAKER_NGM, "NGM"},
|
|
82
|
+
{LIBRAW_CAMERAMAKER_OmniVison, "OmniVison"},
|
|
83
|
+
{LIBRAW_CAMERAMAKER_Panasonic, "Panasonic"},
|
|
84
|
+
{LIBRAW_CAMERAMAKER_Photron, "Photron"},
|
|
85
|
+
{LIBRAW_CAMERAMAKER_Pixelink, "Pixelink"},
|
|
86
|
+
{LIBRAW_CAMERAMAKER_Polaroid, "Polaroid"},
|
|
87
|
+
{LIBRAW_CAMERAMAKER_Rollei, "Rollei"},
|
|
88
|
+
{LIBRAW_CAMERAMAKER_RoverShot, "RoverShot"},
|
|
89
|
+
{LIBRAW_CAMERAMAKER_SMaL, "SMaL"},
|
|
90
|
+
{LIBRAW_CAMERAMAKER_ST_Micro, "ST Micro"},
|
|
91
|
+
{LIBRAW_CAMERAMAKER_THL, "THL"},
|
|
92
|
+
{LIBRAW_CAMERAMAKER_Xiaomi, "Xiaomi"},
|
|
93
|
+
{LIBRAW_CAMERAMAKER_XIAOYI, "Xiayi"},
|
|
94
|
+
{LIBRAW_CAMERAMAKER_Yuneec, "Yuneec"},
|
|
95
|
+
{LIBRAW_CAMERAMAKER_DXO, "DxO"},
|
|
96
|
+
{LIBRAW_CAMERAMAKER_RED, "Red"},
|
|
97
|
+
{LIBRAW_CAMERAMAKER_PhotoControl, "Photo Control"},
|
|
98
|
+
{LIBRAW_CAMERAMAKER_Google, "Google"},
|
|
99
|
+
{LIBRAW_CAMERAMAKER_GoPro, "GoPro"},
|
|
100
|
+
{LIBRAW_CAMERAMAKER_Parrot, "Parrot"},
|
|
101
|
+
{LIBRAW_CAMERAMAKER_Zeiss, "Zeiss"},
|
|
102
|
+
{LIBRAW_CAMERAMAKER_OnePlus, "OnePlus"},
|
|
103
|
+
{LIBRAW_CAMERAMAKER_VIVO, "Vivo"},
|
|
104
|
+
{LIBRAW_CAMERAMAKER_HMD_Global, "HMD Global"},
|
|
105
|
+
{LIBRAW_CAMERAMAKER_HUAWEI, "Huawei"},
|
|
106
|
+
{LIBRAW_CAMERAMAKER_RaspberryPi, "RaspberryPi"},
|
|
107
|
+
};
|
|
108
|
+
// clang-format on
|
|
109
|
+
|
|
110
|
+
int LibRaw::setMakeFromIndex(unsigned makei)
|
|
111
|
+
{
|
|
112
|
+
if (makei <= LIBRAW_CAMERAMAKER_Unknown || makei >= LIBRAW_CAMERAMAKER_TheLastOne) return 0;
|
|
113
|
+
|
|
114
|
+
for (int i = 0; i < int(sizeof CorpTable / sizeof *CorpTable); i++)
|
|
115
|
+
if ((unsigned)CorpTable[i].CorpId == makei)
|
|
116
|
+
{
|
|
117
|
+
strcpy(normalized_make, CorpTable[i].CorpName);
|
|
118
|
+
maker_index = makei;
|
|
119
|
+
return 1;
|
|
120
|
+
}
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const char *LibRaw::cameramakeridx2maker(unsigned maker)
|
|
125
|
+
{
|
|
126
|
+
for (int i = 0; i < int(sizeof CorpTable / sizeof *CorpTable); i++)
|
|
127
|
+
if((unsigned)CorpTable[i].CorpId == maker)
|
|
128
|
+
return CorpTable[i].CorpName;
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
134
|
+
void LibRaw::fixupArri()
|
|
135
|
+
{
|
|
136
|
+
struct alist_t
|
|
137
|
+
{
|
|
138
|
+
const char *a_model;
|
|
139
|
+
const char *a_software;
|
|
140
|
+
ushort a_width,a_height;
|
|
141
|
+
int a_black;
|
|
142
|
+
unsigned a_filters;
|
|
143
|
+
float a_aspect;
|
|
144
|
+
}
|
|
145
|
+
alist[] =
|
|
146
|
+
{
|
|
147
|
+
{"ALEXA65", "Alexa65 XT", 6560 ,3100, 256,0x49494949,1.f},
|
|
148
|
+
|
|
149
|
+
{"ALEXALF", "Alexa LF Plus W", 3840 ,2160, 256,0x49494949,1.0f },
|
|
150
|
+
{"ALEXALF", "Alexa LF Plus W", 4448 ,1856, 256,0x49494949,0.75f },
|
|
151
|
+
{"ALEXALF", "Alexa LF Plus W", 4448 ,3096, 256,0x49494949,1.f },
|
|
152
|
+
|
|
153
|
+
{"ALEXA", "Alexa Plus 4:3 SXT", 2880 ,1620, 256,0x61616161,.75f},
|
|
154
|
+
{"ALEXA", "Alexa Plus 4:3 SXT", 3168 ,1782, 256,0x61616161,0.75f},
|
|
155
|
+
{"ALEXA", "Alexa Plus 4:3 SXT", 3424 ,2202, 256,0x61616161,1.f},
|
|
156
|
+
{"ALEXA", "Alexa Plus 4:3 SXT", 2592 ,2160, 256,0x61616161,1.12f},
|
|
157
|
+
|
|
158
|
+
{"ALEXA", "Alexa Plus 4:3 XT", 2592 ,2160, 256,0x61616161,1.12f},
|
|
159
|
+
{"ALEXA", "Alexa Plus 4:3 XT", 2880 ,2160, 256,0x61616161,1.f},
|
|
160
|
+
{"ALEXA", "Alexa Plus 4:3 XT", 2880 ,1620, 256,0x61616161,0.75f},
|
|
161
|
+
{"ALEXA", "Alexa Plus 4:3 XT", 3424 ,2202, 256,0x61616161,1.f},
|
|
162
|
+
};
|
|
163
|
+
for(int i = 0; i < int(sizeof(alist)/sizeof(alist[0])); i++)
|
|
164
|
+
if(!strncasecmp(model,alist[i].a_model,strlen(alist[i].a_model)) && software
|
|
165
|
+
&& !strncasecmp(software,alist[i].a_software,strlen(alist[i].a_software))
|
|
166
|
+
&& width == alist[i].a_width && height == alist[i].a_height)
|
|
167
|
+
{
|
|
168
|
+
filters = alist[i].a_filters;
|
|
169
|
+
black = alist[i].a_black;
|
|
170
|
+
pixel_aspect = alist[i].a_aspect;
|
|
171
|
+
strcpy(model,software);
|
|
172
|
+
software[0]=0;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
#endif
|
|
177
|
+
/*
|
|
178
|
+
Identify which camera created this file, and set global variables
|
|
179
|
+
accordingly.
|
|
180
|
+
*/
|
|
181
|
+
void LibRaw::identify()
|
|
182
|
+
{
|
|
183
|
+
// clang-format off
|
|
184
|
+
static const ushort canon[][11] = {
|
|
185
|
+
// raw_width, raw_height, left_margin, top_margin,
|
|
186
|
+
// width_decrement, height_decrement,
|
|
187
|
+
// mask01, mask03, mask11, mask13,
|
|
188
|
+
// CFA_filters.
|
|
189
|
+
{ 1944, 1416, 0, 0, 48, 0 }, // 00 "PowerShot Pro90 IS"
|
|
190
|
+
{ 2144, 1560, 4, 8, 52, 2, 0, 0, 0, 25 }, // 01 "PowerShot S30", "PowerShot G1"
|
|
191
|
+
{ 2224, 1456, 48, 6, 0, 2 }, // 02 "EOS D30"
|
|
192
|
+
{ 2376, 1728, 12, 6, 52, 2 }, // 03 "PowerShot G2", "PowerShot S40", "PowerShot G3", "PowerShot S45"
|
|
193
|
+
{ 2672, 1968, 12, 6, 44, 2 }, // 04 "PowerShot G5", "PowerShot S50", "PowerShot S60"
|
|
194
|
+
{ 3152, 2068, 64, 12, 0, 0, 16 }, // 05 "EOS D60", "EOS 10D", "EOS 300D"
|
|
195
|
+
{ 3160, 2344, 44, 12, 4, 4 }, // 06 "PowerShot G6", "PowerShot S70"
|
|
196
|
+
{ 3344, 2484, 4, 6, 52, 6 }, // 07 "PowerShot Pro1"
|
|
197
|
+
{ 3516, 2328, 42, 14, 0, 0 }, // 08 "EOS 350D"
|
|
198
|
+
{ 3596, 2360, 74, 12, 0, 0 }, // 09 "EOS-1D Mark II", "EOS 20D", "EOS-1D Mark II N", "EOS 30D"
|
|
199
|
+
{ 3744, 2784, 52, 12, 8, 12 }, // 10 "PowerShot G11", "PowerShot S90", "PowerShot G12", "PowerShot S95"
|
|
200
|
+
{ 3944, 2622, 30, 18, 6, 2 }, // 11 "EOS 40D"
|
|
201
|
+
{ 3948, 2622, 42, 18, 0, 2 }, // 12 "EOS 400D", "EOS 1000D"
|
|
202
|
+
{ 3984, 2622, 76, 20, 0, 2, 14 }, // 13 "EOS-1D Mark III"
|
|
203
|
+
{ 4032, 2656, 112, 44, 10, 0 }, // 14 APS-C crop mode: "EOS 6D Mark II"??, "EOS RP"
|
|
204
|
+
{ 4104, 3048, 48, 12, 24, 12 }, // 15 "PowerShot G9"
|
|
205
|
+
{ 4116, 2178, 4, 2, 0, 0 }, // 16 ??
|
|
206
|
+
{ 4152, 2772, 192, 12, 0, 0 }, // 17 "PowerShot SX1 IS"
|
|
207
|
+
{ 4160, 3124, 104, 11, 8, 65 }, // 18 "PowerShot S100 (new)", "PowerShot S100V", "PowerShot G15", "PowerShot S110 (new)"
|
|
208
|
+
{ 4176, 3062, 96, 17, 8, 0, 0, 16, 0, 7, 0x49 }, // 19 "PowerShot SX50 HS"
|
|
209
|
+
{ 4192, 3062, 96, 17, 24, 0, 0, 16, 0, 0, 0x49 }, // 20 "PowerShot G16", "PowerShot S120"
|
|
210
|
+
{ 4312, 2876, 22, 18, 0, 2 }, // 21 "EOS 450D"
|
|
211
|
+
{ 4352, 2850, 144, 46, 0, 0 }, // 22 APS-C crop mode: "EOS R"
|
|
212
|
+
{ 4352, 2874, 62, 18, 0, 0 }, // 23 "EOS 1100D"
|
|
213
|
+
{ 4476, 2954, 90, 34, 0, 0 }, // 24 "EOS 5D"
|
|
214
|
+
{ 4480, 3348, 12, 10, 36, 12, 0, 0, 0, 18, 0x49 }, // 25 "PowerShot G10"
|
|
215
|
+
{ 4480, 3366, 80, 50, 0, 0 }, // 26 "PowerShot G1 X Mark II"
|
|
216
|
+
{ 4496, 3366, 80, 50, 12, 0 }, // 27 "PowerShot G1 X"
|
|
217
|
+
{ 4768, 3516, 96, 16, 0, 0, 0, 16 }, // 28 "PowerShot SX60 HS"
|
|
218
|
+
{ 4832, 3204, 62, 26, 0, 0 }, // 29 "EOS 500D"
|
|
219
|
+
{ 4832, 3228, 62, 51, 0, 0 }, // 30 "EOS 50D"
|
|
220
|
+
{ 5108, 3349, 98, 13, 0, 0 }, // 31 "EOS-1Ds Mark II"
|
|
221
|
+
{ 5120, 3318, 142, 45, 62, 0 }, // 32 "EOS-1D Mark IV"
|
|
222
|
+
{ 5280, 3528, 72, 52, 0, 0 }, // 33 "EOS M10", "EOS 650D", "EOS 700D", "EOS M", "EOS 100D", "EOS M2"
|
|
223
|
+
{ 5344, 3516, 142, 51, 0, 0 }, // 34 "EOS 550D", "EOS 600D", "EOS 60D", "EOS 1200D", "EOS 1300D", "EOS 3000D"
|
|
224
|
+
{ 5344, 3584, 126, 100, 0, 2 }, // 35 "EOS-1D X", "EOS-1D C"
|
|
225
|
+
{ 5344, 3950, 98, 18, 0, 0, 0, 24, 0, 0 }, // 36 "PowerShot SX70 HS"
|
|
226
|
+
{ 5360, 3516, 158, 51, 0, 0 }, // 37 "EOS 7D"
|
|
227
|
+
{ 5568, 3708, 72, 38, 0, 0 }, // 38; "EOS 7D Mark II", "EOS 6D", "EOS 70D", "EOS-1D X MARK II"
|
|
228
|
+
{ 5632, 3710, 96, 17, 0, 0, 0, 16, 0, 0, 0x49 }, // 39 "PowerShot G7 X", "PowerShot G3 X", "PowerShot G9 X", "PowerShot G5 X", "PowerShot G7 X Mark II", "PowerShot G9 X Mark II"
|
|
229
|
+
{ 5712, 3774, 62, 20, 10, 2 }, // 40 "EOS-1Ds Mark III"
|
|
230
|
+
{ 5792, 3804, 158, 51, 0, 0 }, // 41 "EOS 5D Mark II"
|
|
231
|
+
{ 5920, 3950, 122, 80, 2, 0 }, // 42 "EOS 5D Mark III"
|
|
232
|
+
{ 6096, 4051, 76, 35, 0, 0 }, // 43 "EOS 1500D"
|
|
233
|
+
{ 6096, 4056, 72, 34, 0, 0 }, // 44 "EOS M3", "EOS 760D", "EOS 750D"
|
|
234
|
+
{ 6288, 4056, 264, 36, 0, 0 }, // 45 "EOS M5", "EOS M100", "EOS M6", "PowerShot G1 X Mark III", "EOS 80D", "EOS 800D", "EOS 77D", "EOS 200D", "EOS 250D", "EOS M50"
|
|
235
|
+
{ 6384, 4224, 120, 44, 0, 0 }, // 46 "EOS 6D Mark II", "EOS RP"
|
|
236
|
+
{ 6880, 4544, 136, 42, 0, 0 }, // 47 "EOS 5D Mark IV"
|
|
237
|
+
{ 6888, 4546, 146, 48, 0, 0 }, // 48 "EOS R"
|
|
238
|
+
{ 7128, 4732, 144, 72, 0, 0 }, // 49 "EOS M6 II", "EOS 90D"
|
|
239
|
+
{ 8896, 5920, 160, 64, 0, 0 }, // 50 "EOS 5DS", "EOS 5DS R"
|
|
240
|
+
{ 6192, 4152, 160, 120, 0, 0}, // EOS R3
|
|
241
|
+
{ 6192, 4060, 168, 52, 24, 8, 16,48,32,0,} // EOS R10
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
static const libraw_custom_camera_t const_table[] = {
|
|
245
|
+
{ 786432, 1024, 768, 0, 0, 0, 0, 0, 0x94, 0, 0, "AVT", "F-080C" },
|
|
246
|
+
{ 1447680, 1392, 1040, 0, 0, 0, 0, 0, 0x94, 0, 0, "AVT", "F-145C" },
|
|
247
|
+
{ 1920000, 1600, 1200, 0, 0, 0, 0, 0, 0x94, 0, 0, "AVT", "F-201C" },
|
|
248
|
+
{ 5067304, 2588, 1958, 0, 0, 0, 0, 0, 0x94, 0, 0, "AVT", "F-510C" },
|
|
249
|
+
{ 5067316, 2588, 1958, 0, 0, 0, 0, 0, 0x94, 0, 0, "AVT", "F-510C", 12 },
|
|
250
|
+
{ 10134608, 2588, 1958, 0, 0, 0, 0, 9, 0x94, 0, 0, "AVT", "F-510C" },
|
|
251
|
+
{ 10134620, 2588, 1958, 0, 0, 0, 0, 9, 0x94, 0, 0, "AVT", "F-510C", 12 },
|
|
252
|
+
{ 16157136, 3272, 2469, 0, 0, 0, 0, 9, 0x94, 0, 0, "AVT", "F-810C" },
|
|
253
|
+
{ 3995136, 1632, 1224, 0, 0, 0, 0, 8, 0x61, 0, 1, "AgfaPhoto", "DC-833m" },
|
|
254
|
+
{ 15980544, 3264, 2448, 0, 0, 0, 0, 8, 0x61, 0, 1, "AgfaPhoto", "DC-833m" },
|
|
255
|
+
{ 9631728, 2532, 1902, 0, 0, 0, 0, 96, 0x61, 0, 0, "Alcatel", "5035D" },
|
|
256
|
+
{ 31850496, 4608, 3456, 0, 0, 0, 0, 0, 0x94, 0, 0, "GITUP", "GIT2 4:3" },
|
|
257
|
+
{ 23887872, 4608, 2592, 0, 0, 0, 0, 0, 0x94, 0, 0, "GITUP", "GIT2 16:9" },
|
|
258
|
+
{ 32257024, 4624, 3488, 8, 2, 16, 2, 0, 0x94, 0, 0, "GITUP", "GIT2P 4:3" },
|
|
259
|
+
{ 24192768, 4624, 2616, 8, 2, 16, 2, 0, 0x94, 0, 0, "GITUP", "GIT2P 16:9" },
|
|
260
|
+
{ 18016000, 4000, 2252, 0, 0, 0, 0, 0, 0x94, 0, 0, "GITUP", "G3DUO 16:9" },
|
|
261
|
+
// {24000000, 4000, 3000, 0, 0, 0, 0, 0, 0x94, 0, 0, "GITUP",
|
|
262
|
+
// "G3DUO 4:3"}, // Conflict w/ Samsung WB550
|
|
263
|
+
|
|
264
|
+
// Android Raw dumps id start
|
|
265
|
+
// File Size in bytes Horizontal Res Vertical Flag then bayer order eg
|
|
266
|
+
// 0x16 bbgr 0x94 rggb
|
|
267
|
+
{ 1540857, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "Samsung", "S3" },
|
|
268
|
+
{ 2658304, 1212, 1096, 0, 0, 0, 0, 1, 0x16, 0, 0, "LG", "G3FrontMipi" },
|
|
269
|
+
{ 2842624, 1296, 1096, 0, 0, 0, 0, 1, 0x16, 0, 0, "LG", "G3FrontQCOM" },
|
|
270
|
+
{ 2969600, 1976, 1200, 0, 0, 0, 0, 1, 0x16, 0, 0, "Xiaomi", "MI3wMipi" },
|
|
271
|
+
{ 3170304, 1976, 1200, 0, 0, 0, 0, 1, 0x16, 0, 0, "Xiaomi", "MI3wQCOM" },
|
|
272
|
+
{ 3763584, 1584, 1184, 0, 0, 0, 0, 96, 0x61, 0, 0, "I_Mobile", "I_StyleQ6" },
|
|
273
|
+
{ 5107712, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "OmniVisi", "UltraPixel1" },
|
|
274
|
+
{ 5382640, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "OmniVisi", "UltraPixel2" },
|
|
275
|
+
{ 5664912, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "OmniVisi", "4688" },
|
|
276
|
+
{ 5664912, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "OmniVisi", "4688" },
|
|
277
|
+
{ 5364240, 2688, 1520, 0, 0, 0, 0, 1, 0x61, 0, 0, "OmniVisi", "4688" },
|
|
278
|
+
{ 6299648, 2592, 1944, 0, 0, 0, 0, 1, 0x16, 0, 0, "OmniVisi", "OV5648" },
|
|
279
|
+
{ 6721536, 2592, 1944, 0, 0, 0, 0, 0, 0x16, 0, 0, "OmniVisi", "OV56482" },
|
|
280
|
+
{ 6746112, 2592, 1944, 0, 0, 0, 0, 0, 0x16, 0, 0, "HTC", "OneSV" },
|
|
281
|
+
{ 9631728, 2532, 1902, 0, 0, 0, 0, 96, 0x61, 0, 0, "Sony", "5mp" },
|
|
282
|
+
{ 9830400, 2560, 1920, 0, 0, 0, 0, 96, 0x61, 0, 0, "NGM", "ForwardArt" },
|
|
283
|
+
{ 10186752, 3264, 2448, 0, 0, 0, 0, 1, 0x94, 0, 0, "Sony", "IMX219-mipi 8mp" },
|
|
284
|
+
{ 10223360, 2608, 1944, 0, 0, 0, 0, 96, 0x16, 0, 0, "Sony", "IMX" },
|
|
285
|
+
{ 10782464, 3282, 2448, 0, 0, 0, 0, 0, 0x16, 0, 0, "HTC", "MyTouch4GSlide" },
|
|
286
|
+
{ 10788864, 3282, 2448, 0, 0, 0, 0, 0, 0x16, 0, 0, "Xperia", "L" },
|
|
287
|
+
{ 15967488, 3264, 2446, 0, 0, 0, 0, 96, 0x16, 0, 0, "OmniVison", "OV8850" },
|
|
288
|
+
{ 16224256, 4208, 3082, 0, 0, 0, 0, 1, 0x16, 0, 0, "LG", "G3MipiL" },
|
|
289
|
+
{ 16424960, 4208, 3120, 0, 0, 0, 0, 1, 0x16, 0, 0, "IMX135", "MipiL" },
|
|
290
|
+
{ 17326080, 4164, 3120, 0, 0, 0, 0, 1, 0x16, 0, 0, "LG", "G3LQCom" },
|
|
291
|
+
{ 17522688, 4212, 3120, 0, 0, 0, 0, 0, 0x16, 0, 0, "Sony", "IMX135-QCOM" },
|
|
292
|
+
{ 19906560, 4608, 3456, 0, 0, 0, 0, 1, 0x16, 0, 0, "Gione", "E7mipi" },
|
|
293
|
+
{ 19976192, 5312, 2988, 0, 0, 0, 0, 1, 0x16, 0, 0, "LG", "G4" },
|
|
294
|
+
{ 20389888, 4632, 3480, 0, 0, 0, 0, 1, 0x16, 0, 0, "Xiaomi", "RedmiNote3Pro" },
|
|
295
|
+
{ 20500480, 4656, 3496, 0, 0, 0, 0, 1, 0x94, 0, 0, "Sony", "IMX298-mipi 16mp" },
|
|
296
|
+
{ 21233664, 4608, 3456, 0, 0, 0, 0, 1, 0x16, 0, 0, "Gione", "E7qcom" },
|
|
297
|
+
{ 26023936, 4192, 3104, 0, 0, 0, 0, 96, 0x94, 0, 0, "THL", "5000" },
|
|
298
|
+
{ 26257920, 4208, 3120, 0, 0, 0, 0, 96, 0x94, 0, 0, "Sony", "IMX214" },
|
|
299
|
+
{ 26357760, 4224, 3120, 0, 0, 0, 0, 96, 0x61, 0, 0, "OV", "13860" },
|
|
300
|
+
{ 41312256, 5248, 3936, 0, 0, 0, 0, 96, 0x61, 0, 0, "Meizu", "MX4" },
|
|
301
|
+
{ 42923008, 5344, 4016, 0, 0, 0, 0, 96, 0x61, 0, 0, "Sony", "IMX230" },
|
|
302
|
+
// Android Raw dumps id end
|
|
303
|
+
{ 20137344, 3664, 2748, 0, 0, 0, 0, 0x40, 0x49, 0, 0, "Aptina", "MT9J003", 0xffff },
|
|
304
|
+
{ 2868726, 1384, 1036, 0, 0, 0, 0, 64, 0x49, 0, 8, "Baumer", "TXG14", 1078 },
|
|
305
|
+
{ 6553440, 2664, 1968, 4, 4, 44, 4, 40, 0x94, 0, 2, "Canon", "PowerShot A460" }, // chdk hack
|
|
306
|
+
{ 9243240, 3152, 2346, 12, 7, 44, 13, 40, 0x49, 0, 2, "Canon", "PowerShot A470" }, // chdk hack
|
|
307
|
+
{ 6653280, 2672, 1992, 10, 6, 42, 2, 40, 0x94, 0, 2, "Canon", "PowerShot A530" }, // chdk hack
|
|
308
|
+
{ 6573120, 2672, 1968, 12, 8, 44, 0, 40, 0x94, 0, 2, "Canon", "PowerShot A610" }, // chdk hack
|
|
309
|
+
{ 9219600, 3152, 2340, 36, 12, 4, 0, 40, 0x94, 0, 2, "Canon", "PowerShot A620" }, // chdk hack
|
|
310
|
+
{ 10383120, 3344, 2484, 12, 6, 44, 6, 40, 0x94, 0, 2, "Canon", "PowerShot A630" }, // chdk hack
|
|
311
|
+
{ 12945240, 3736, 2772, 12, 6, 52, 6, 40, 0x94, 0, 2, "Canon", "PowerShot A640" }, // chdk hack
|
|
312
|
+
{ 15636240, 4104, 3048, 48, 12, 24, 12, 40, 0x94, 0, 2, "Canon", "PowerShot A650 IS" }, // chdk hack
|
|
313
|
+
{ 10341600, 3336, 2480, 6, 5, 32, 3, 40, 0x94, 0, 2, "Canon", "PowerShot A720 IS" }, // chdk hack
|
|
314
|
+
{ 24724224, 4704, 3504, 8, 16, 56, 8, 40, 0x49, 0, 2, "Canon", "PowerShot A3300 IS" }, // chdk hack
|
|
315
|
+
{ 18763488, 4104, 3048, 10, 22, 82, 22, 8, 0x49, 0, 0, "Canon", "PowerShot D10" }, // ? chdk hack ?
|
|
316
|
+
{ 19493760, 4160, 3124, 104, 12, 8, 66, 40, 0x49, 0, 2, "Canon", "PowerShot S100" }, // chdk hack CRW
|
|
317
|
+
{ 7710960, 2888, 2136, 44, 8, 4, 0, 40, 0x94, 0, 2, "Canon", "PowerShot S3 IS" }, // chdk hack
|
|
318
|
+
{ 5298000, 2400, 1766, 12, 12, 44, 2, 40, 0x94, 0, 2, "Canon", "PowerShot SD300" }, // chdk hack
|
|
319
|
+
{ 18653760, 4080, 3048, 24, 12, 24, 12, 40, 0x94, 0, 2, "Canon", "PowerShot SX20 IS" }, // chdk hack
|
|
320
|
+
{ 21936096, 4464, 3276, 25, 10, 73, 12, 40, 0x16, 0, 2, "Canon", "PowerShot SX30 IS" }, // chdk hack
|
|
321
|
+
{ 19167840, 4176, 3060, 96, 16, 8, 0, 40, 0x94, 0, 2, "Canon", "PowerShot SX40 HS" }, // chdk hack CR2
|
|
322
|
+
{ 15467760, 3720, 2772, 6, 12, 30, 0, 40, 0x94, 0, 2, "Canon", "PowerShot SX110 IS" }, // chdk hack
|
|
323
|
+
{ 15534576, 3728, 2778, 12, 9, 44, 9, 40, 0x94, 0, 2, "Canon", "PowerShot SX120 IS" }, // chdk hack
|
|
324
|
+
{ 19131120, 4168, 3060, 92, 16, 4, 1, 40, 0x94, 0, 2, "Canon", "PowerShot SX220 HS" }, // chdk hack
|
|
325
|
+
{ 31663200, 5344, 3950, 96, 18, 0, 0, 40, 0x94, 0, 2, "Canon", "PowerShot SX710 HS" }, // chdk hack
|
|
326
|
+
{ 30858240, 5248, 3920, 8, 16, 56, 16, 40, 0x94, 0, 2, "Canon", "IXUS 160" }, // chdk hack
|
|
327
|
+
{ 1976352, 1632, 1211, 0, 2, 0, 1, 0, 0x94, 0, 1, "Casio", "QV-2000UX" },
|
|
328
|
+
{ 3217760, 2080, 1547, 0, 0, 10, 1, 0, 0x94, 0, 1, "Casio", "QV-3*00EX" },
|
|
329
|
+
{ 6218368, 2585, 1924, 0, 0, 9, 0, 0, 0x94, 0, 1, "Casio", "QV-5700" },
|
|
330
|
+
{ 7816704, 2867, 2181, 0, 0, 34, 36, 0, 0x16, 0, 1, "Casio", "EX-Z60" },
|
|
331
|
+
{ 2937856, 1621, 1208, 0, 0, 1, 0, 0, 0x94, 7, 13, "Casio", "EX-S20" },
|
|
332
|
+
{ 4948608, 2090, 1578, 0, 0, 32, 34, 0, 0x94, 7, 1, "Casio", "EX-S100" },
|
|
333
|
+
{ 6054400, 2346, 1720, 2, 0, 32, 0, 0, 0x94, 7, 1, "Casio", "QV-R41" },
|
|
334
|
+
{ 7426656, 2568, 1928, 0, 0, 0, 0, 0, 0x94, 0, 1, "Casio", "EX-P505" },
|
|
335
|
+
{ 7530816, 2602, 1929, 0, 0, 22, 0, 0, 0x94, 7, 1, "Casio", "QV-R51" },
|
|
336
|
+
{ 7542528, 2602, 1932, 0, 0, 32, 0, 0, 0x94, 7, 1, "Casio", "EX-Z50" },
|
|
337
|
+
{ 7562048, 2602, 1937, 0, 0, 25, 0, 0, 0x16, 7, 1, "Casio", "EX-Z500" },
|
|
338
|
+
{ 7753344, 2602, 1986, 0, 0, 32, 26, 0, 0x94, 7, 1, "Casio", "EX-Z55" },
|
|
339
|
+
{ 9313536, 2858, 2172, 0, 0, 14, 30, 0, 0x94, 7, 1, "Casio", "EX-P600" },
|
|
340
|
+
{ 10834368, 3114, 2319, 0, 0, 27, 0, 0, 0x94, 0, 1, "Casio", "EX-Z750" },
|
|
341
|
+
{ 10843712, 3114, 2321, 0, 0, 25, 0, 0, 0x94, 0, 1, "Casio", "EX-Z75" },
|
|
342
|
+
{ 10979200, 3114, 2350, 0, 0, 32, 32, 0, 0x94, 7, 1, "Casio", "EX-P700" },
|
|
343
|
+
{ 12310144, 3285, 2498, 0, 0, 6, 30, 0, 0x94, 0, 1, "Casio", "EX-Z850" },
|
|
344
|
+
{ 12489984, 3328, 2502, 0, 0, 47, 35, 0, 0x94, 0, 1, "Casio", "EX-Z8" },
|
|
345
|
+
{ 15499264, 3754, 2752, 0, 0, 82, 0, 0, 0x94, 0, 1, "Casio", "EX-Z1050" },
|
|
346
|
+
{ 18702336, 4096, 3044, 0, 0, 24, 0, 80, 0x94, 7, 1, "Casio", "EX-ZR100" },
|
|
347
|
+
{ 7684000, 2260, 1700, 0, 0, 0, 0, 13, 0x94, 0, 1, "Casio", "QV-4000" },
|
|
348
|
+
{ 787456, 1024, 769, 0, 1, 0, 0, 0, 0x49, 0, 0, "Creative", "PC-CAM 600" },
|
|
349
|
+
{ 28829184, 4384, 3288, 0, 0, 0, 0, 36, 0x61, 0, 0, "DJI" },
|
|
350
|
+
{ 15151104, 4608, 3288, 0, 0, 0, 0, 0, 0x94, 0, 0, "Matrix" },
|
|
351
|
+
{ 3840000, 1600, 1200, 0, 0, 0, 0, 65, 0x49, 0, 0, "Foculus", "531C" },
|
|
352
|
+
{ 307200, 640, 480, 0, 0, 0, 0, 0, 0x94, 0, 0, "Generic" },
|
|
353
|
+
{ 62464, 256, 244, 1, 1, 6, 1, 0, 0x8d, 0, 0, "Kodak", "DC20" },
|
|
354
|
+
{ 124928, 512, 244, 1, 1, 10, 1, 0, 0x8d, 0, 0, "Kodak", "DC20" },
|
|
355
|
+
{ 1652736, 1536, 1076, 0, 52, 0, 0, 0, 0x61, 0, 0, "Kodak", "DCS200" },
|
|
356
|
+
{ 4159302, 2338, 1779, 1, 33, 1, 2, 0, 0x94, 0, 0, "Kodak", "C330" },
|
|
357
|
+
{ 4162462, 2338, 1779, 1, 33, 1, 2, 0, 0x94, 0, 0, "Kodak", "C330", 3160 },
|
|
358
|
+
{ 2247168, 1232, 912, 0, 0, 16, 0, 0, 0x00, 0, 0, "Kodak", "C330" },
|
|
359
|
+
{ 3370752, 1232, 912, 0, 0, 16, 0, 0, 0x00, 0, 0, "Kodak", "C330" },
|
|
360
|
+
{ 6163328, 2864, 2152, 0, 0, 0, 0, 0, 0x94, 0, 0, "Kodak", "C603" },
|
|
361
|
+
{ 6166488, 2864, 2152, 0, 0, 0, 0, 0, 0x94, 0, 0, "Kodak", "C603", 3160 },
|
|
362
|
+
{ 460800, 640, 480, 0, 0, 0, 0, 0, 0x00, 0, 0, "Kodak", "C603" },
|
|
363
|
+
{ 9116448, 2848, 2134, 0, 0, 0, 0, 0, 0x00, 0, 0, "Kodak", "C603" },
|
|
364
|
+
{ 12241200, 4040, 3030, 2, 0, 0, 13, 0, 0x49, 0, 0, "Kodak", "12MP" },
|
|
365
|
+
{ 12272756, 4040, 3030, 2, 0, 0, 13, 0, 0x49, 0, 0, "Kodak", "12MP", 31556 },
|
|
366
|
+
{ 18000000, 4000, 3000, 0, 0, 0, 0, 0, 0x00, 0, 0, "Kodak", "12MP" },
|
|
367
|
+
{ 614400, 640, 480, 0, 3, 0, 0, 64, 0x94, 0, 0, "Kodak", "KAI-0340" },
|
|
368
|
+
{ 15360000, 3200, 2400, 0, 0, 0, 0, 96, 0x16, 0, 0, "Lenovo", "A820" },
|
|
369
|
+
{ 3884928, 1608, 1207, 0, 0, 0, 0, 96, 0x16, 0, 0, "Micron", "2010", 3212 },
|
|
370
|
+
{ 1138688, 1534, 986, 0, 0, 0, 0, 0, 0x61, 0, 0, "Minolta", "RD175", 513 },
|
|
371
|
+
{ 1581060, 1305, 969, 0, 0, 18, 6, 6, 0x1e, 4, 1, "Nikon", "E900" }, // "diag raw" hack
|
|
372
|
+
{ 2465792, 1638, 1204, 0, 0, 22, 1, 6, 0x4b, 5, 1, "Nikon", "E950" }, // "diag raw" hack; possibly also Nikon E700, E800, E775;
|
|
373
|
+
// Olympus C-2020Z
|
|
374
|
+
{ 2940928, 1616, 1213, 0, 0, 0, 7, 30, 0x94, 0, 1, "Nikon", "E2100" }, // "diag raw" hack; also Nikon E2500
|
|
375
|
+
{ 4771840, 2064, 1541, 0, 0, 0, 1, 6, 0xe1, 0, 1, "Nikon", "E990" }, // "diag raw" hack; possibly also Nikon E880, E885, E995;
|
|
376
|
+
// Olympus C-3030Z
|
|
377
|
+
{ 4775936, 2064, 1542, 0, 0, 0, 0, 30, 0x94, 0, 1, "Nikon", "E3700" }, // "diag raw" hack; Nikon E3100, E3200, E3500;
|
|
378
|
+
// Pentax "Optio 33WR"; possibly also Olympus C-740UZ
|
|
379
|
+
{ 5865472, 2288, 1709, 0, 0, 0, 1, 6, 0xb4, 0, 1, "Nikon", "E4500" }, // "diag raw" hack; possibly also Olympus C-4040Z
|
|
380
|
+
{ 5869568, 2288, 1710, 0, 0, 0, 0, 6, 0x16, 0, 1, "Nikon", "E4300" }, // "diag raw" hack; also Minolta "DiMAGE Z2"
|
|
381
|
+
{ 7438336, 2576, 1925, 0, 0, 0, 1, 6, 0xb4, 0, 1, "Nikon", "E5000" }, // also Nikon E5700
|
|
382
|
+
{ 8998912, 2832, 2118, 0, 0, 0, 0, 30, 0x94, 7, 1, "Nikon", "COOLPIX S6" }, // "diag raw" hack
|
|
383
|
+
{ 5939200, 2304, 1718, 0, 0, 0, 0, 30, 0x16, 0, 0, "Olympus", "C-770UZ" }, // possibly also Olympus C-4100Z, C-765UZ
|
|
384
|
+
{ 3178560, 2064, 1540, 0, 0, 0, 0, 0, 0x94, 0, 1, "Pentax", "Optio S V1.01" },
|
|
385
|
+
{ 4841984, 2090, 1544, 0, 0, 22, 0, 0, 0x94, 7, 1, "Pentax", "Optio S" },
|
|
386
|
+
{ 6114240, 2346, 1737, 0, 0, 22, 0, 0, 0x94, 7, 1, "Pentax", "Optio S4" },
|
|
387
|
+
{ 10702848, 3072, 2322, 0, 0, 0, 21, 30, 0x94, 0, 1, "Pentax", "Optio 750Z" },
|
|
388
|
+
{ 4147200, 1920, 1080, 0, 0, 0, 0, 0, 0x49, 0, 0, "Photron", "BC2-HD" },
|
|
389
|
+
{ 4151666, 1920, 1080, 0, 0, 0, 0, 0, 0x49, 0, 0, "Photron", "BC2-HD", 8 },
|
|
390
|
+
{ 13248000, 2208, 3000, 0, 0, 0, 0, 13, 0x61, 0, 0, "Pixelink", "A782" },
|
|
391
|
+
{ 6291456, 2048, 1536, 0, 0, 0, 0, 96, 0x61, 0, 0, "RoverShot", "3320AF" },
|
|
392
|
+
{ 311696, 644, 484, 0, 0, 0, 0, 0, 0x16, 0, 8, "ST Micro", "STV680 VGA" },
|
|
393
|
+
{ 16098048, 3288, 2448, 0, 0, 24, 0, 9, 0x94, 0, 1, "Samsung", "S85" }, // hack
|
|
394
|
+
{ 16215552, 3312, 2448, 0, 0, 48, 0, 9, 0x94, 0, 1, "Samsung", "S85" }, // hack
|
|
395
|
+
{ 20487168, 3648, 2808, 0, 0, 0, 0, 13, 0x94, 5, 1, "Samsung", "WB550" },
|
|
396
|
+
{ 24000000, 4000, 3000, 0, 0, 0, 0, 13, 0x94, 5, 1, "Samsung", "WB550" },
|
|
397
|
+
{ 12582980, 3072, 2048, 0, 0, 0, 0, 33, 0x61, 0, 0, "Sinar", "", 68 }, // Sinarback 23; same res. as Leaf Volare & Cantare
|
|
398
|
+
{ 33292868, 4080, 4080, 0, 0, 0, 0, 33, 0x61, 0, 0, "Sinar", "", 68 }, // Sinarback 44
|
|
399
|
+
{ 44390468, 4080, 5440, 0, 0, 0, 0, 33, 0x61, 0, 0, "Sinar", "", 68 }, // Sinarback 54
|
|
400
|
+
{ 1409024, 1376, 1024, 0, 0, 1, 0, 0, 0x49, 0, 0, "Sony", "XCD-SX910CR" },
|
|
401
|
+
{ 2818048, 1376, 1024, 0, 0, 1, 0, 97, 0x49, 0, 0, "Sony", "XCD-SX910CR" },
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
libraw_custom_camera_t
|
|
405
|
+
table[64 + sizeof(const_table) / sizeof(const_table[0])];
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
// clang-format on
|
|
409
|
+
|
|
410
|
+
char head[64] = {0}, *cp;
|
|
411
|
+
int hlen, fsize, flen, zero_fsize = 1, i, c;
|
|
412
|
+
INT64 fsize64;
|
|
413
|
+
struct jhead jh;
|
|
414
|
+
|
|
415
|
+
unsigned camera_count =
|
|
416
|
+
parse_custom_cameras(64, table, imgdata.rawparams.custom_camera_strings);
|
|
417
|
+
for (int q = 0; q < int(sizeof(const_table) / sizeof(const_table[0])); q++)
|
|
418
|
+
memmove(&table[q + camera_count], &const_table[q], sizeof(const_table[0]));
|
|
419
|
+
camera_count += sizeof(const_table) / sizeof(const_table[0]);
|
|
420
|
+
|
|
421
|
+
tiff_flip = flip = filters = UINT_MAX; /* unknown */
|
|
422
|
+
raw_height = raw_width = fuji_width = fuji_layout = cr2_slice[0] = 0;
|
|
423
|
+
maximum = height = width = top_margin = left_margin = 0;
|
|
424
|
+
cdesc[0] = desc[0] = artist[0] = make[0] = model[0] = model2[0] = 0;
|
|
425
|
+
iso_speed = shutter = aperture = focal_len = 0;
|
|
426
|
+
unique_id = 0ULL;
|
|
427
|
+
tiff_nifds = 0;
|
|
428
|
+
is_NikonTransfer = 0;
|
|
429
|
+
is_Olympus = 0;
|
|
430
|
+
OlympusDNG_SubDirOffsetValid = 0;
|
|
431
|
+
is_Sony = 0;
|
|
432
|
+
is_pana_raw = 0;
|
|
433
|
+
maker_index = LIBRAW_CAMERAMAKER_Unknown;
|
|
434
|
+
FujiCropMode = 0;
|
|
435
|
+
is_PentaxRicohMakernotes = 0;
|
|
436
|
+
normalized_model[0] = 0;
|
|
437
|
+
normalized_make[0] = 0;
|
|
438
|
+
CM_found = 0;
|
|
439
|
+
memset(tiff_ifd, 0, sizeof tiff_ifd);
|
|
440
|
+
libraw_internal_data.unpacker_data.crx_track_selected = -1;
|
|
441
|
+
libraw_internal_data.unpacker_data.crx_track_count = -1;
|
|
442
|
+
libraw_internal_data.unpacker_data.CR3_CTMDtag = 0;
|
|
443
|
+
imHassy.nIFD_CM[0] = imHassy.nIFD_CM[1] = -1;
|
|
444
|
+
imKodak.ISOCalibrationGain = 1.0f;
|
|
445
|
+
imCommon.CameraTemperature = imCommon.SensorTemperature =
|
|
446
|
+
imCommon.SensorTemperature2 = imCommon.LensTemperature =
|
|
447
|
+
imCommon.AmbientTemperature = imCommon.BatteryTemperature =
|
|
448
|
+
imCommon.exifAmbientTemperature = -1000.0f;
|
|
449
|
+
|
|
450
|
+
libraw_internal_data.unpacker_data.ifd0_offset = -1LL;
|
|
451
|
+
|
|
452
|
+
imgdata.color.ExifColorSpace = LIBRAW_COLORSPACE_Unknown;
|
|
453
|
+
for (i = 0; i < LIBRAW_IFD_MAXCOUNT; i++)
|
|
454
|
+
{
|
|
455
|
+
tiff_ifd[i].dng_color[0].illuminant = tiff_ifd[i].dng_color[1].illuminant =
|
|
456
|
+
0xffff;
|
|
457
|
+
for (int q = 0; q < 4; q++)
|
|
458
|
+
tiff_ifd[i].dng_levels.analogbalance[q] = 1.0f;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
memset(gpsdata, 0, sizeof gpsdata);
|
|
462
|
+
memset(cblack, 0, sizeof cblack);
|
|
463
|
+
memset(white, 0, sizeof white);
|
|
464
|
+
memset(mask, 0, sizeof mask);
|
|
465
|
+
thumb_offset = thumb_length = thumb_width = thumb_height = 0;
|
|
466
|
+
load_raw = 0;
|
|
467
|
+
thumb_format = LIBRAW_INTERNAL_THUMBNAIL_JPEG; // default to JPEG
|
|
468
|
+
data_offset = meta_offset = meta_length = tiff_bps = tiff_compress = 0;
|
|
469
|
+
kodak_cbpp = zero_after_ff = dng_version = load_flags = 0;
|
|
470
|
+
timestamp = shot_order = tiff_samples = black = is_foveon = 0;
|
|
471
|
+
mix_green = profile_length = data_error = zero_is_bad = 0;
|
|
472
|
+
pixel_aspect = is_raw = raw_color = 1;
|
|
473
|
+
tile_width = tile_length = 0;
|
|
474
|
+
metadata_blocks = 0;
|
|
475
|
+
|
|
476
|
+
for (i = 0; i < 4; i++)
|
|
477
|
+
{
|
|
478
|
+
cam_mul[i] = i == 1;
|
|
479
|
+
pre_mul[i] = i < 3;
|
|
480
|
+
FORC3 cmatrix[c][i] = 0;
|
|
481
|
+
FORC3 rgb_cam[c][i] = c == i;
|
|
482
|
+
}
|
|
483
|
+
colors = 3;
|
|
484
|
+
for (i = 0; i < 0x10000; i++)
|
|
485
|
+
curve[i] = i;
|
|
486
|
+
|
|
487
|
+
order = get2();
|
|
488
|
+
hlen = get4();
|
|
489
|
+
fseek(ifp, 0, SEEK_SET);
|
|
490
|
+
|
|
491
|
+
if (fread(head, 1, 64, ifp) < 64)
|
|
492
|
+
throw LIBRAW_EXCEPTION_IO_CORRUPT;
|
|
493
|
+
libraw_internal_data.unpacker_data.lenRAFData =
|
|
494
|
+
libraw_internal_data.unpacker_data.posRAFData = 0;
|
|
495
|
+
|
|
496
|
+
fseek(ifp, 0, SEEK_END);
|
|
497
|
+
fsize64 = ftell(ifp);
|
|
498
|
+
if(fsize64 > LIBRAW_MAX_NONDNG_RAW_FILE_SIZE && fsize64 > LIBRAW_MAX_DNG_RAW_FILE_SIZE)
|
|
499
|
+
throw LIBRAW_EXCEPTION_TOOBIG;
|
|
500
|
+
|
|
501
|
+
flen = fsize = ftell(ifp);
|
|
502
|
+
if ((cp = (char *)memmem(head, 32, (char *)"MMMM", 4)) ||
|
|
503
|
+
(cp = (char *)memmem(head, 32, (char *)"IIII", 4)))
|
|
504
|
+
{
|
|
505
|
+
parse_phase_one(cp - head);
|
|
506
|
+
if (cp - head && parse_tiff(0))
|
|
507
|
+
apply_tiff();
|
|
508
|
+
}
|
|
509
|
+
else if (order == 0x4949 || order == 0x4d4d)
|
|
510
|
+
{
|
|
511
|
+
if (!memcmp(head + 6, "HEAPCCDR", 8))
|
|
512
|
+
{
|
|
513
|
+
data_offset = hlen;
|
|
514
|
+
parse_ciff(hlen, flen - hlen, 0);
|
|
515
|
+
load_raw = &LibRaw::canon_load_raw;
|
|
516
|
+
}
|
|
517
|
+
else if (parse_tiff(0))
|
|
518
|
+
apply_tiff();
|
|
519
|
+
}
|
|
520
|
+
else if (!memcmp(head, "\xff\xd8\xff\xe1", 4) && !memcmp(head + 6, "Exif", 4))
|
|
521
|
+
{
|
|
522
|
+
fseek(ifp, 4, SEEK_SET);
|
|
523
|
+
data_offset = 4 + get2();
|
|
524
|
+
fseek(ifp, data_offset, SEEK_SET);
|
|
525
|
+
if (fgetc(ifp) != 0xff)
|
|
526
|
+
parse_tiff(12);
|
|
527
|
+
thumb_offset = 0;
|
|
528
|
+
}
|
|
529
|
+
else if (!memcmp(head + 25, "ARECOYK", 7)) // 'KYOCERA' right-to-left
|
|
530
|
+
{
|
|
531
|
+
strcpy(make, "Contax");
|
|
532
|
+
strcpy(model, "N Digital");
|
|
533
|
+
parse_kyocera();
|
|
534
|
+
}
|
|
535
|
+
else if (!strcmp(head, "PXN"))
|
|
536
|
+
{
|
|
537
|
+
strcpy(make, "Logitech");
|
|
538
|
+
strcpy(model, "Fotoman Pixtura");
|
|
539
|
+
}
|
|
540
|
+
else if (!strcmp(head, "qktk"))
|
|
541
|
+
{
|
|
542
|
+
strcpy(make, "Apple");
|
|
543
|
+
strcpy(model, "QuickTake 100");
|
|
544
|
+
load_raw = &LibRaw::quicktake_100_load_raw;
|
|
545
|
+
}
|
|
546
|
+
else if (!strcmp(head, "qktn"))
|
|
547
|
+
{
|
|
548
|
+
strcpy(make, "Apple");
|
|
549
|
+
strcpy(model, "QuickTake 150");
|
|
550
|
+
load_raw = &LibRaw::kodak_radc_load_raw;
|
|
551
|
+
}
|
|
552
|
+
else if (!memcmp(head, "FUJIFILM", 8))
|
|
553
|
+
{
|
|
554
|
+
memcpy(imFuji.SerialSignature, head + 0x10, 0x0c);
|
|
555
|
+
imFuji.SerialSignature[0x0c] = 0;
|
|
556
|
+
memcpy(imFuji.SensorID, imFuji.SerialSignature + 0x06, 0x04);
|
|
557
|
+
imFuji.SensorID[0x04] = 0;
|
|
558
|
+
strncpy(model, head + 0x1c, 0x20);
|
|
559
|
+
model[0x20] = 0;
|
|
560
|
+
c = 11;
|
|
561
|
+
while (imFuji.SerialSignature[c] > 0 && isdigit(imFuji.SerialSignature[c]) && (c>0))
|
|
562
|
+
c--;
|
|
563
|
+
if(c < 11)
|
|
564
|
+
unique_id = (unsigned long long)atoi(imFuji.SerialSignature+c+1);
|
|
565
|
+
memcpy(imFuji.RAFVersion, head + 0x3c, 4);
|
|
566
|
+
imFuji.RAFVersion[4] = 0;
|
|
567
|
+
fseek(ifp, 84, SEEK_SET);
|
|
568
|
+
thumb_offset = get4();
|
|
569
|
+
thumb_length = get4();
|
|
570
|
+
fseek(ifp, 92, SEEK_SET);
|
|
571
|
+
parse_fuji(get4());
|
|
572
|
+
if (thumb_offset > 120)
|
|
573
|
+
{
|
|
574
|
+
fseek(ifp, 120, SEEK_SET);
|
|
575
|
+
is_raw += (i = get4()) ? 1 : 0;
|
|
576
|
+
if (is_raw == 2 && shot_select)
|
|
577
|
+
parse_fuji(i);
|
|
578
|
+
}
|
|
579
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
580
|
+
fseek(ifp, 100 + 28 * (shot_select > 0), SEEK_SET);
|
|
581
|
+
parse_tiff(data_offset = get4());
|
|
582
|
+
parse_tiff(thumb_offset + 12);
|
|
583
|
+
parse_fuji_thumbnail(thumb_offset);
|
|
584
|
+
apply_tiff();
|
|
585
|
+
}
|
|
586
|
+
else if (!memcmp(head, "RIFF", 4))
|
|
587
|
+
{
|
|
588
|
+
fseek(ifp, 0, SEEK_SET);
|
|
589
|
+
parse_riff(100);
|
|
590
|
+
}
|
|
591
|
+
else if (!memcmp(head + 4, "ftypqt ", 9))
|
|
592
|
+
{
|
|
593
|
+
fseek(ifp, 0, SEEK_SET);
|
|
594
|
+
parse_qt(fsize);
|
|
595
|
+
is_raw = 0;
|
|
596
|
+
}
|
|
597
|
+
else if (!memcmp(head, "\0\001\0\001\0@", 6))
|
|
598
|
+
{
|
|
599
|
+
fseek(ifp, 6, SEEK_SET);
|
|
600
|
+
fread(make, 1, 8, ifp);
|
|
601
|
+
fread(model, 1, 8, ifp);
|
|
602
|
+
fread(model2, 1, 16, ifp);
|
|
603
|
+
data_offset = get2();
|
|
604
|
+
get2();
|
|
605
|
+
raw_width = get2();
|
|
606
|
+
raw_height = get2();
|
|
607
|
+
load_raw = &LibRaw::nokia_load_raw;
|
|
608
|
+
filters = 0x61616161;
|
|
609
|
+
}
|
|
610
|
+
else if (!memcmp(head, "NOKIARAW", 8))
|
|
611
|
+
{
|
|
612
|
+
strcpy(make, "NOKIA");
|
|
613
|
+
order = 0x4949;
|
|
614
|
+
fseek(ifp, 300, SEEK_SET);
|
|
615
|
+
data_offset = get4();
|
|
616
|
+
i = get4(); // bytes count
|
|
617
|
+
width = get2();
|
|
618
|
+
height = get2();
|
|
619
|
+
|
|
620
|
+
// Data integrity check
|
|
621
|
+
if (width < 1 || width > 16000 || height < 1 || height > 16000 ||
|
|
622
|
+
i < (width * height) || i > (2 * width * height))
|
|
623
|
+
throw LIBRAW_EXCEPTION_IO_CORRUPT;
|
|
624
|
+
|
|
625
|
+
switch (tiff_bps = i * 8 / (width * height))
|
|
626
|
+
{
|
|
627
|
+
case 8:
|
|
628
|
+
load_raw = &LibRaw::eight_bit_load_raw;
|
|
629
|
+
break;
|
|
630
|
+
case 10:
|
|
631
|
+
load_raw = &LibRaw::nokia_load_raw;
|
|
632
|
+
break;
|
|
633
|
+
case 0:
|
|
634
|
+
throw LIBRAW_EXCEPTION_IO_CORRUPT;
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
raw_height = height + (top_margin = i / (width * tiff_bps / 8) - height);
|
|
638
|
+
mask[0][3] = 1;
|
|
639
|
+
filters = 0x61616161;
|
|
640
|
+
}
|
|
641
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
642
|
+
else if (!memcmp(head, "ARRI", 4))
|
|
643
|
+
{
|
|
644
|
+
order = 0x4949;
|
|
645
|
+
fseek(ifp, 20, SEEK_SET);
|
|
646
|
+
width = get4();
|
|
647
|
+
height = get4();
|
|
648
|
+
strcpy(make, "ARRI");
|
|
649
|
+
fseek(ifp, 668, SEEK_SET);
|
|
650
|
+
fread(model, 1, 64, ifp);
|
|
651
|
+
model[63] = 0;
|
|
652
|
+
fseek(ifp, 760, SEEK_SET);
|
|
653
|
+
fread(software, 1, 64, ifp);
|
|
654
|
+
if((unsigned char)software[0] == 0xff) software[0] = 0;
|
|
655
|
+
software[63] = 0;
|
|
656
|
+
data_offset = 4096;
|
|
657
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
658
|
+
load_flags = 88;
|
|
659
|
+
filters = 0x61616161;
|
|
660
|
+
fixupArri();
|
|
661
|
+
}
|
|
662
|
+
else if (!memcmp(head, "XPDS", 4))
|
|
663
|
+
{
|
|
664
|
+
order = 0x4949;
|
|
665
|
+
fseek(ifp, 0x800, SEEK_SET);
|
|
666
|
+
fread(make, 1, 41, ifp);
|
|
667
|
+
raw_height = get2();
|
|
668
|
+
raw_width = get2();
|
|
669
|
+
fseek(ifp, 56, SEEK_CUR);
|
|
670
|
+
fread(model, 1, 30, ifp);
|
|
671
|
+
data_offset = 0x10000;
|
|
672
|
+
load_raw = &LibRaw::canon_rmf_load_raw;
|
|
673
|
+
gamma_curve(0, 12.25, 1, 1023);
|
|
674
|
+
}
|
|
675
|
+
else if (!memcmp(head + 4, "RED1", 4))
|
|
676
|
+
{
|
|
677
|
+
strcpy(make, "Red");
|
|
678
|
+
strcpy(model, "One");
|
|
679
|
+
parse_redcine();
|
|
680
|
+
load_raw = &LibRaw::redcine_load_raw;
|
|
681
|
+
gamma_curve(1 / 2.4, 12.92, 1, 4095);
|
|
682
|
+
filters = 0x49494949;
|
|
683
|
+
}
|
|
684
|
+
#endif
|
|
685
|
+
else if (!memcmp(head, "DSC-Image", 9))
|
|
686
|
+
parse_rollei();
|
|
687
|
+
else if (!memcmp(head, "PWAD", 4))
|
|
688
|
+
parse_sinar_ia();
|
|
689
|
+
else if (!memcmp(head, "\0MRM", 4))
|
|
690
|
+
parse_minolta(0);
|
|
691
|
+
else if (!memcmp(head, "FOVb", 4))
|
|
692
|
+
{
|
|
693
|
+
parse_x3f(); /* Does nothing if USE_X3FTOOLS is not defined */
|
|
694
|
+
}
|
|
695
|
+
else if (!memcmp(head, "CI", 2))
|
|
696
|
+
parse_cine();
|
|
697
|
+
#ifdef USE_6BY9RPI
|
|
698
|
+
else if (!memcmp(head, "BRCM", 4)) {
|
|
699
|
+
fseek(ifp, 0, SEEK_SET);
|
|
700
|
+
strcpy(make, "RaspberryPi");
|
|
701
|
+
strcpy(model, "Pi");
|
|
702
|
+
parse_raspberrypi();
|
|
703
|
+
}
|
|
704
|
+
#endif
|
|
705
|
+
else if (!memcmp(head + 4, "ftypcrx ", 8))
|
|
706
|
+
{
|
|
707
|
+
int err;
|
|
708
|
+
unsigned long long szAtomList;
|
|
709
|
+
short nesting = -1;
|
|
710
|
+
short nTrack = -1;
|
|
711
|
+
short TrackType;
|
|
712
|
+
char AtomNameStack[129];
|
|
713
|
+
strcpy(make, "Canon");
|
|
714
|
+
|
|
715
|
+
szAtomList = ifp->size();
|
|
716
|
+
err = parseCR3(0ULL, szAtomList, nesting, AtomNameStack, nTrack, TrackType);
|
|
717
|
+
libraw_internal_data.unpacker_data.crx_track_count = nTrack;
|
|
718
|
+
if ((err == 0 || err == -14) &&
|
|
719
|
+
nTrack >= 0) // no error, or too deep nesting
|
|
720
|
+
selectCRXTrack();
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (dng_version)
|
|
724
|
+
{
|
|
725
|
+
if (fsize64 > LIBRAW_MAX_DNG_RAW_FILE_SIZE)
|
|
726
|
+
throw LIBRAW_EXCEPTION_TOOBIG;
|
|
727
|
+
}
|
|
728
|
+
else
|
|
729
|
+
{
|
|
730
|
+
if (fsize64 > LIBRAW_MAX_NONDNG_RAW_FILE_SIZE)
|
|
731
|
+
throw LIBRAW_EXCEPTION_TOOBIG;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (make[0] == 0)
|
|
735
|
+
for (zero_fsize = i = 0; i < (int)camera_count; i++)
|
|
736
|
+
if (fsize == (int)table[i].fsize)
|
|
737
|
+
{
|
|
738
|
+
strcpy(make, table[i].t_make);
|
|
739
|
+
strcpy(model, table[i].t_model);
|
|
740
|
+
flip = table[i].flags >> 2;
|
|
741
|
+
zero_is_bad = table[i].flags & 2;
|
|
742
|
+
data_offset = table[i].offset == 0xffff ? 0 : table[i].offset;
|
|
743
|
+
raw_width = table[i].rw;
|
|
744
|
+
raw_height = table[i].rh;
|
|
745
|
+
left_margin = table[i].lm;
|
|
746
|
+
top_margin = table[i].tm;
|
|
747
|
+
width = raw_width - left_margin - table[i].rm;
|
|
748
|
+
height = raw_height - top_margin - table[i].bm;
|
|
749
|
+
filters = 0x1010101U * table[i].cf;
|
|
750
|
+
colors = 4 - !((filters & filters >> 1) & 0x5555);
|
|
751
|
+
load_flags = table[i].lf & 0xff;
|
|
752
|
+
if (table[i].lf & 0x100) /* Monochrome sensor dump */
|
|
753
|
+
{
|
|
754
|
+
colors = 1;
|
|
755
|
+
filters = 0;
|
|
756
|
+
}
|
|
757
|
+
switch (tiff_bps = (fsize - data_offset) * 8 / (raw_width * raw_height))
|
|
758
|
+
{
|
|
759
|
+
case 6:
|
|
760
|
+
load_raw = &LibRaw::minolta_rd175_load_raw;
|
|
761
|
+
ilm.CameraMount = LIBRAW_MOUNT_Minolta_A;
|
|
762
|
+
break;
|
|
763
|
+
case 8:
|
|
764
|
+
load_raw = &LibRaw::eight_bit_load_raw;
|
|
765
|
+
break;
|
|
766
|
+
case 10:
|
|
767
|
+
if ((fsize - data_offset) / raw_height * 3 >= raw_width * 4)
|
|
768
|
+
{
|
|
769
|
+
load_raw = &LibRaw::android_loose_load_raw;
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
else if (load_flags & 1)
|
|
773
|
+
{
|
|
774
|
+
load_raw = &LibRaw::android_tight_load_raw;
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
case 12:
|
|
778
|
+
load_flags |= 128;
|
|
779
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
780
|
+
break;
|
|
781
|
+
case 16:
|
|
782
|
+
order = 0x4949 | 0x404 * (load_flags & 1);
|
|
783
|
+
tiff_bps -= load_flags >> 4;
|
|
784
|
+
tiff_bps -= load_flags = load_flags >> 1 & 7;
|
|
785
|
+
load_raw = table[i].offset == 0xffff
|
|
786
|
+
? &LibRaw::unpacked_load_raw_reversed
|
|
787
|
+
: &LibRaw::unpacked_load_raw;
|
|
788
|
+
}
|
|
789
|
+
maximum = (1 << tiff_bps) - (1 << table[i].max);
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
if (zero_fsize)
|
|
793
|
+
fsize = 0;
|
|
794
|
+
if (make[0] == 0 && fsize64 < 25000000LL)
|
|
795
|
+
parse_smal(0, flen);
|
|
796
|
+
if (make[0] == 0)
|
|
797
|
+
{
|
|
798
|
+
parse_jpeg(0);
|
|
799
|
+
#ifdef USE_6BY9RPI
|
|
800
|
+
if (!(strncmp(model, "ov", 2) && strncmp(model, "RP_", 3) && strncmp(model, "imx477", 6))) {
|
|
801
|
+
//Assume that this isn't a raw unless the header can be found
|
|
802
|
+
is_raw = 0;
|
|
803
|
+
|
|
804
|
+
if (!strncasecmp(model, "RP_testc",8)
|
|
805
|
+
|| !strncasecmp(model, "imx477", 6) // from PyDNG
|
|
806
|
+
|| !strncasecmp(model, "RP_imx477",9)) {
|
|
807
|
+
const long offsets[] = {
|
|
808
|
+
//IMX477 offsets
|
|
809
|
+
3375104, //2028x1080 12bit
|
|
810
|
+
4751360, //2028x1520 12bit
|
|
811
|
+
18711040, //4056x3040 12bit
|
|
812
|
+
1015808, //1012x760 10bit
|
|
813
|
+
-1 //Marker for end of table
|
|
814
|
+
};
|
|
815
|
+
int offset_idx;
|
|
816
|
+
for (offset_idx=0; offsets[offset_idx]!=-1; offset_idx++) {
|
|
817
|
+
if(!fseek (ifp, -offsets[offset_idx], SEEK_END) &&
|
|
818
|
+
fread (head, 1, 32, ifp) && !strncmp(head,"BRCM", 4)) {
|
|
819
|
+
fseek(ifp, -32, SEEK_CUR);
|
|
820
|
+
strcpy (make, "RaspberryPi");
|
|
821
|
+
strcpy(model, "RP_imx477"); // Force single model
|
|
822
|
+
black = (offset_idx == 3) ? 64 : 256;
|
|
823
|
+
parse_raspberrypi();
|
|
824
|
+
break;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
else if (!strncasecmp(model, "RP_imx", 6)) {
|
|
829
|
+
const long offsets[] = {
|
|
830
|
+
//IMX219 offsets
|
|
831
|
+
10270208, //8MPix 3280x2464
|
|
832
|
+
2678784, //1920x1080
|
|
833
|
+
2628608, //1640x1232
|
|
834
|
+
1963008, //1640x922
|
|
835
|
+
1233920, //1280x720
|
|
836
|
+
445440, //640x480
|
|
837
|
+
-1 //Marker for end of table
|
|
838
|
+
};
|
|
839
|
+
int offset_idx;
|
|
840
|
+
for (offset_idx = 0; offsets[offset_idx] != -1; offset_idx++) {
|
|
841
|
+
if (!fseek(ifp, -offsets[offset_idx], SEEK_END) &&
|
|
842
|
+
fread(head, 1, 32, ifp) && !strncmp(head, "BRCM", 4)) {
|
|
843
|
+
|
|
844
|
+
fseek(ifp, -32, SEEK_CUR);
|
|
845
|
+
strcpy(make, "RaspberryPi");
|
|
846
|
+
black = 66;
|
|
847
|
+
parse_raspberrypi();
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
else if (!strncasecmp(model, "RP_OV", 5) || !strncasecmp(model, "ov5647", 6)) {
|
|
853
|
+
const long offsets[] = {
|
|
854
|
+
6404096, //5MPix 2592x1944
|
|
855
|
+
2717696, //1920x1080
|
|
856
|
+
1625600, //1296x972
|
|
857
|
+
1233920, //1296x730
|
|
858
|
+
445440, //640x480
|
|
859
|
+
-1 //Marker for end of table
|
|
860
|
+
};
|
|
861
|
+
int offset_idx;
|
|
862
|
+
for (offset_idx = 0; offsets[offset_idx] != -1; offset_idx++) {
|
|
863
|
+
if (!fseek(ifp, -offsets[offset_idx], SEEK_END) &&
|
|
864
|
+
fread(head, 1, 32, ifp) && !strncmp(head, "BRCM", 4)) {
|
|
865
|
+
fseek(ifp, -32, SEEK_CUR);
|
|
866
|
+
strcpy(make, "RaspberryPi");
|
|
867
|
+
strcpy(model, "ov5647"); // Force single model
|
|
868
|
+
width = raw_width;
|
|
869
|
+
//Defaults
|
|
870
|
+
raw_width = 2611;
|
|
871
|
+
filters = 0x16161616;
|
|
872
|
+
black = 16;
|
|
873
|
+
parse_raspberrypi();
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}// else is_raw = 0;
|
|
879
|
+
#else
|
|
880
|
+
fseek(ifp, 0, SEEK_END);
|
|
881
|
+
int sz = ftell(ifp);
|
|
882
|
+
if (!strncmp(model, "RP_imx219", 9) && sz >= 0x9cb600 &&
|
|
883
|
+
!fseek(ifp, -0x9cb600, SEEK_END) && fread(head, 1, 0x20, ifp) &&
|
|
884
|
+
!strncmp(head, "BRCM", 4))
|
|
885
|
+
{
|
|
886
|
+
strcpy(make, "Broadcom");
|
|
887
|
+
strcpy(model, "RPi IMX219");
|
|
888
|
+
if (raw_height > raw_width)
|
|
889
|
+
flip = 5;
|
|
890
|
+
data_offset = ftell(ifp) + 0x8000 - 0x20;
|
|
891
|
+
parse_broadcom();
|
|
892
|
+
black = 66;
|
|
893
|
+
maximum = 0x3ff;
|
|
894
|
+
load_raw = &LibRaw::broadcom_load_raw;
|
|
895
|
+
thumb_offset = 0;
|
|
896
|
+
thumb_length = sz - 0x9cb600 - 1;
|
|
897
|
+
}
|
|
898
|
+
else if (!(strncmp(model, "ov5647", 6) && strncmp(model, "RP_OV5647", 9)) &&
|
|
899
|
+
sz >= 0x61b800 && !fseek(ifp, -0x61b800, SEEK_END) &&
|
|
900
|
+
fread(head, 1, 0x20, ifp) && !strncmp(head, "BRCM", 4))
|
|
901
|
+
{
|
|
902
|
+
strcpy(make, "Broadcom");
|
|
903
|
+
if (!strncmp(model, "ov5647", 6))
|
|
904
|
+
strcpy(model, "RPi OV5647 v.1");
|
|
905
|
+
else
|
|
906
|
+
strcpy(model, "RPi OV5647 v.2");
|
|
907
|
+
if (raw_height > raw_width)
|
|
908
|
+
flip = 5;
|
|
909
|
+
data_offset = ftell(ifp) + 0x8000 - 0x20;
|
|
910
|
+
parse_broadcom();
|
|
911
|
+
black = 16;
|
|
912
|
+
maximum = 0x3ff;
|
|
913
|
+
load_raw = &LibRaw::broadcom_load_raw;
|
|
914
|
+
thumb_offset = 0;
|
|
915
|
+
thumb_length = sz - 0x61b800 - 1;
|
|
916
|
+
}
|
|
917
|
+
else
|
|
918
|
+
is_raw = 0;
|
|
919
|
+
#endif
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
// make sure strings are terminated
|
|
923
|
+
desc[511] = artist[63] = make[63] = model[63] = model2[63] = 0;
|
|
924
|
+
|
|
925
|
+
for (i = 0; i < int(sizeof CorpTable / sizeof *CorpTable); i++)
|
|
926
|
+
{
|
|
927
|
+
if (strcasestr(make, CorpTable[i].CorpName))
|
|
928
|
+
{ /* Simplify company names */
|
|
929
|
+
maker_index = CorpTable[i].CorpId;
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
if (makeIs(LIBRAW_CAMERAMAKER_HMD_Global) && !strncasecmp(model, "Nokia", 5)) {
|
|
935
|
+
maker_index = LIBRAW_CAMERAMAKER_Nokia;
|
|
936
|
+
} else if (makeIs(LIBRAW_CAMERAMAKER_JK_Imaging) && !strncasecmp(model, "Kodak", 5)) {
|
|
937
|
+
maker_index = LIBRAW_CAMERAMAKER_Kodak;
|
|
938
|
+
} else if (makeIs(LIBRAW_CAMERAMAKER_Ricoh) && !strncasecmp(model, "PENTAX", 6)) {
|
|
939
|
+
maker_index = LIBRAW_CAMERAMAKER_Pentax;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
for (i = 0; i < int(sizeof CorpTable / sizeof *CorpTable); i++) {
|
|
943
|
+
if (maker_index == (unsigned)CorpTable[i].CorpId) {
|
|
944
|
+
strcpy(make, CorpTable[i].CorpName);
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
if ((makeIs(LIBRAW_CAMERAMAKER_Kodak) || makeIs(LIBRAW_CAMERAMAKER_Leica)) &&
|
|
950
|
+
((cp = strcasestr(model, " DIGITAL CAMERA")) ||
|
|
951
|
+
(cp = strstr(model, "FILE VERSION")))) {
|
|
952
|
+
*cp = 0;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
remove_trailing_spaces(make, sizeof(make));
|
|
956
|
+
remove_trailing_spaces(model, sizeof(model));
|
|
957
|
+
|
|
958
|
+
i = int(strbuflen(make)); /* Remove make from model */
|
|
959
|
+
if (!strncasecmp(model, make, i) && model[i++] == ' ')
|
|
960
|
+
memmove(model, model + i, 64 - i);
|
|
961
|
+
|
|
962
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Fujifilm) && !strncmp(model, "FinePix", 7)) {
|
|
963
|
+
memmove(model, model + 7, strlen(model) - 6);
|
|
964
|
+
if (model[0] == ' ') {
|
|
965
|
+
memmove(model, model + 1, strlen(model));
|
|
966
|
+
}
|
|
967
|
+
} else if ((makeIs(LIBRAW_CAMERAMAKER_Kodak) || makeIs(LIBRAW_CAMERAMAKER_Konica)) &&
|
|
968
|
+
!strncmp(model, "Digital Camera ", 15)) {
|
|
969
|
+
memmove(model, model + 15, strlen(model) - 14);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
desc[511] = artist[63] = make[63] = model[63] = model2[63] = 0;
|
|
973
|
+
if (!is_raw)
|
|
974
|
+
goto notraw;
|
|
975
|
+
|
|
976
|
+
if (!height)
|
|
977
|
+
height = raw_height;
|
|
978
|
+
if (!width)
|
|
979
|
+
width = raw_width;
|
|
980
|
+
|
|
981
|
+
identify_finetune_pentax();
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
if (dng_version)
|
|
985
|
+
{
|
|
986
|
+
if (filters == UINT_MAX)
|
|
987
|
+
filters = 0;
|
|
988
|
+
if (!filters)
|
|
989
|
+
colors = tiff_samples;
|
|
990
|
+
switch (tiff_compress)
|
|
991
|
+
{
|
|
992
|
+
case 0: // Compression not set, assuming uncompressed
|
|
993
|
+
case 1:
|
|
994
|
+
// Uncompressed float: decoder set in apply_tiff for valid files; not set for non-valid with sampleformat==3
|
|
995
|
+
if ((load_raw != &LibRaw::uncompressed_fp_dng_load_raw) && (tiff_sampleformat != 3))
|
|
996
|
+
load_raw = &LibRaw::packed_dng_load_raw;
|
|
997
|
+
break;
|
|
998
|
+
case 7:
|
|
999
|
+
load_raw = &LibRaw::lossless_dng_load_raw;
|
|
1000
|
+
break;
|
|
1001
|
+
case 8:
|
|
1002
|
+
if (tiff_sampleformat == 3 && tiff_bps > 8 && (tiff_bps % 8 == 0) && tiff_bps <= 32)
|
|
1003
|
+
load_raw = &LibRaw::deflate_dng_load_raw;
|
|
1004
|
+
else if((tiff_sampleformat == 0 || tiff_sampleformat == 1) && tiff_bps>=8 && tiff_bps <=16)
|
|
1005
|
+
load_raw = &LibRaw::deflate_dng_load_raw;
|
|
1006
|
+
break;
|
|
1007
|
+
#ifdef USE_GPRSDK
|
|
1008
|
+
case 9:
|
|
1009
|
+
load_raw = &LibRaw::vc5_dng_load_raw_placeholder;
|
|
1010
|
+
break;
|
|
1011
|
+
#endif
|
|
1012
|
+
case 34892:
|
|
1013
|
+
load_raw = &LibRaw::lossy_dng_load_raw;
|
|
1014
|
+
break;
|
|
1015
|
+
default:
|
|
1016
|
+
load_raw = 0;
|
|
1017
|
+
}
|
|
1018
|
+
GetNormalizedModel();
|
|
1019
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Leica)) {
|
|
1020
|
+
if (!strcmp(model, "SL2"))
|
|
1021
|
+
height -= 3;
|
|
1022
|
+
if (!strncasecmp(model, "Q2 MONO",7))
|
|
1023
|
+
height -= 18;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Olympus) &&
|
|
1027
|
+
(OlyID == OlyID_STYLUS_1) && // don't use normalized_model below, it is 'Stylus 1'
|
|
1028
|
+
(strchr(model+6, 's') ||
|
|
1029
|
+
strchr(model+6, 'S')))
|
|
1030
|
+
{
|
|
1031
|
+
width -= 16;
|
|
1032
|
+
}
|
|
1033
|
+
goto dng_skip;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Canon) && !fsize && tiff_bps != 15)
|
|
1037
|
+
{
|
|
1038
|
+
bool fromtable = false;
|
|
1039
|
+
if (!load_raw)
|
|
1040
|
+
load_raw = &LibRaw::lossless_jpeg_load_raw;
|
|
1041
|
+
for (i = 0; i < int(sizeof canon / sizeof *canon); i++)
|
|
1042
|
+
if (raw_width == canon[i][0] && raw_height == canon[i][1])
|
|
1043
|
+
{
|
|
1044
|
+
width = raw_width - (left_margin = canon[i][2]);
|
|
1045
|
+
height = raw_height - (top_margin = canon[i][3]);
|
|
1046
|
+
width -= canon[i][4];
|
|
1047
|
+
height -= canon[i][5];
|
|
1048
|
+
mask[0][1] = canon[i][6];
|
|
1049
|
+
mask[0][3] = -canon[i][7];
|
|
1050
|
+
mask[1][1] = canon[i][8];
|
|
1051
|
+
mask[1][3] = -canon[i][9];
|
|
1052
|
+
if (canon[i][10])
|
|
1053
|
+
filters = canon[i][10] * 0x01010101U;
|
|
1054
|
+
fromtable = true;
|
|
1055
|
+
}
|
|
1056
|
+
if ((unique_id | 0x20000ULL) ==
|
|
1057
|
+
0x2720000ULL) // "PowerShot G11", "PowerShot S90": 0x2700000, 0x2720000
|
|
1058
|
+
// possibly "PowerShot SX120 IS" (if not chdk hack?): 0x2710000
|
|
1059
|
+
{
|
|
1060
|
+
left_margin = 8;
|
|
1061
|
+
top_margin = 16;
|
|
1062
|
+
}
|
|
1063
|
+
if(!fromtable && imCanon.AverageBlackLevel) // not known, but metadata known
|
|
1064
|
+
{
|
|
1065
|
+
FORC4 cblack[c] = imCanon.ChannelBlackLevel[c];
|
|
1066
|
+
black = cblack[4] = cblack[5] = 0;
|
|
1067
|
+
// Prevent automatic BL calculation
|
|
1068
|
+
mask[0][3] = 1;
|
|
1069
|
+
mask[0][1] = 2;
|
|
1070
|
+
|
|
1071
|
+
if ((imCanon.SensorWidth == raw_width) &&
|
|
1072
|
+
(imCanon.SensorHeight == raw_height))
|
|
1073
|
+
{
|
|
1074
|
+
left_margin = (imCanon.DefaultCropAbsolute.l+1) & 0xfffe; // round to 2
|
|
1075
|
+
width = imCanon.DefaultCropAbsolute.r - left_margin;
|
|
1076
|
+
top_margin = (imCanon.DefaultCropAbsolute.t +1) & 0xfffe;
|
|
1077
|
+
height = imCanon.DefaultCropAbsolute.b - top_margin;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
identify_finetune_by_filesize(fsize);
|
|
1083
|
+
|
|
1084
|
+
if (!strcmp(model, "KAI-0340") && find_green(16, 16, 3840, 5120) < 25)
|
|
1085
|
+
{
|
|
1086
|
+
height = 480;
|
|
1087
|
+
top_margin = filters = 0;
|
|
1088
|
+
strcpy(model, "C603");
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
GetNormalizedModel();
|
|
1092
|
+
|
|
1093
|
+
identify_finetune_dcr(head, fsize, flen);
|
|
1094
|
+
|
|
1095
|
+
/* Early reject for damaged images */
|
|
1096
|
+
if (!load_raw || height < 22 || width < 22 ||
|
|
1097
|
+
(tiff_bps > 16 &&
|
|
1098
|
+
(load_raw != &LibRaw::deflate_dng_load_raw &&
|
|
1099
|
+
load_raw != &LibRaw::uncompressed_fp_dng_load_raw)) ||
|
|
1100
|
+
tiff_samples > 4 || colors > 4 ||
|
|
1101
|
+
colors < 1
|
|
1102
|
+
/* alloc in unpack() may be fooled by size adjust */
|
|
1103
|
+
|| ((int)width + (int)left_margin > 65535) ||
|
|
1104
|
+
((int)height + (int)top_margin > 65535))
|
|
1105
|
+
{
|
|
1106
|
+
is_raw = 0;
|
|
1107
|
+
RUN_CALLBACK(LIBRAW_PROGRESS_IDENTIFY, 1, 2);
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
if (!model[0])
|
|
1111
|
+
{
|
|
1112
|
+
sprintf(model, "%dx%d", width, height);
|
|
1113
|
+
strcpy(normalized_model, model);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
if (!(imgdata.rawparams.options & LIBRAW_RAWOPTIONS_ZEROFILTERS_FOR_MONOCHROMETIFFS) &&
|
|
1117
|
+
(filters == UINT_MAX)) // Default dcraw behaviour
|
|
1118
|
+
filters = 0x94949494;
|
|
1119
|
+
else if (filters == UINT_MAX)
|
|
1120
|
+
{
|
|
1121
|
+
if (tiff_nifds > 0 && tiff_samples == 1)
|
|
1122
|
+
{
|
|
1123
|
+
colors = 1;
|
|
1124
|
+
filters = 0;
|
|
1125
|
+
}
|
|
1126
|
+
else
|
|
1127
|
+
filters = 0x94949494;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
if (thumb_offset && !thumb_height)
|
|
1131
|
+
{
|
|
1132
|
+
fseek(ifp, thumb_offset, SEEK_SET);
|
|
1133
|
+
if (ljpeg_start(&jh, 1))
|
|
1134
|
+
{
|
|
1135
|
+
thumb_width = jh.wide;
|
|
1136
|
+
thumb_height = jh.high;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
dng_skip:
|
|
1141
|
+
if (dng_version)
|
|
1142
|
+
identify_process_dng_fields();
|
|
1143
|
+
|
|
1144
|
+
/* Early reject for damaged images again (after dng fields processing) */
|
|
1145
|
+
if (!load_raw || height < 22 || width < 22 ||
|
|
1146
|
+
(tiff_bps > 16 &&
|
|
1147
|
+
(load_raw != &LibRaw::deflate_dng_load_raw &&
|
|
1148
|
+
load_raw != &LibRaw::uncompressed_fp_dng_load_raw )) ||
|
|
1149
|
+
((load_raw == &LibRaw::deflate_dng_load_raw || load_raw == &LibRaw::uncompressed_fp_dng_load_raw)
|
|
1150
|
+
&& (tiff_bps < 16 || tiff_bps > 32 || (tiff_bps % 8)) )
|
|
1151
|
+
||tiff_samples > 4 || colors > 4 || colors < 1)
|
|
1152
|
+
{
|
|
1153
|
+
is_raw = 0;
|
|
1154
|
+
RUN_CALLBACK(LIBRAW_PROGRESS_IDENTIFY, 1, 2);
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
{
|
|
1158
|
+
// Check cam_mul range
|
|
1159
|
+
int cmul_ok = 1;
|
|
1160
|
+
FORCC if (cam_mul[c] <= 0.001f) cmul_ok = 0;
|
|
1161
|
+
;
|
|
1162
|
+
|
|
1163
|
+
if (cmul_ok)
|
|
1164
|
+
{
|
|
1165
|
+
double cmin = cam_mul[0], cmax;
|
|
1166
|
+
double cnorm[4];
|
|
1167
|
+
FORCC cmin = MIN(cmin, cam_mul[c]);
|
|
1168
|
+
FORCC cnorm[c] = cam_mul[c] / cmin;
|
|
1169
|
+
cmax = cmin = cnorm[0];
|
|
1170
|
+
FORCC
|
|
1171
|
+
{
|
|
1172
|
+
cmin = MIN(cmin, cnorm[c]);
|
|
1173
|
+
cmax = MIN(cmax, cnorm[c]);
|
|
1174
|
+
}
|
|
1175
|
+
if (cmin <= 0.01f || cmax > 100.f)
|
|
1176
|
+
cmul_ok = false;
|
|
1177
|
+
}
|
|
1178
|
+
if (!cmul_ok)
|
|
1179
|
+
{
|
|
1180
|
+
if (cam_mul[0] > 0)
|
|
1181
|
+
cam_mul[0] = 0;
|
|
1182
|
+
cam_mul[3] = 0;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
if ((use_camera_matrix & (((use_camera_wb || dng_version)?1:0) | 0x2)) &&
|
|
1186
|
+
cmatrix[0][0] > 0.125)
|
|
1187
|
+
{
|
|
1188
|
+
memcpy(rgb_cam, cmatrix, sizeof cmatrix);
|
|
1189
|
+
raw_color = 0;
|
|
1190
|
+
}
|
|
1191
|
+
if (raw_color && !CM_found)
|
|
1192
|
+
CM_found = adobe_coeff(maker_index, normalized_model);
|
|
1193
|
+
else if ((imgdata.color.cam_xyz[0][0] < 0.01) && !CM_found)
|
|
1194
|
+
CM_found = adobe_coeff(maker_index, normalized_model, 1);
|
|
1195
|
+
|
|
1196
|
+
if (load_raw == &LibRaw::kodak_radc_load_raw)
|
|
1197
|
+
if ((raw_color) && !CM_found)
|
|
1198
|
+
CM_found = adobe_coeff(LIBRAW_CAMERAMAKER_Apple, "Quicktake");
|
|
1199
|
+
|
|
1200
|
+
if ((maker_index != LIBRAW_CAMERAMAKER_Unknown) && normalized_model[0])
|
|
1201
|
+
SetStandardIlluminants (maker_index, normalized_model);
|
|
1202
|
+
|
|
1203
|
+
// Clear erroneous fuji_width if not set through parse_fuji or for DNG
|
|
1204
|
+
if (fuji_width && !dng_version &&
|
|
1205
|
+
!(imgdata.process_warnings & LIBRAW_WARN_PARSEFUJI_PROCESSED))
|
|
1206
|
+
fuji_width = 0;
|
|
1207
|
+
|
|
1208
|
+
if (fuji_width)
|
|
1209
|
+
{
|
|
1210
|
+
fuji_width = width >> int(!fuji_layout);
|
|
1211
|
+
filters = fuji_width & 1 ? 0x94949494 : 0x49494949;
|
|
1212
|
+
width = (height >> fuji_layout) + fuji_width;
|
|
1213
|
+
height = width - 1;
|
|
1214
|
+
pixel_aspect = 1;
|
|
1215
|
+
// Prevent incorrect-sized fuji-rotated files
|
|
1216
|
+
if (INT64(width)*INT64(height) > INT64(raw_width) * INT64(raw_height) * 8LL)
|
|
1217
|
+
is_raw = 0;
|
|
1218
|
+
}
|
|
1219
|
+
else
|
|
1220
|
+
{
|
|
1221
|
+
if (raw_height < height)
|
|
1222
|
+
raw_height = height;
|
|
1223
|
+
if (raw_width < width)
|
|
1224
|
+
raw_width = width;
|
|
1225
|
+
}
|
|
1226
|
+
if (!tiff_bps)
|
|
1227
|
+
tiff_bps = 12;
|
|
1228
|
+
if (!maximum)
|
|
1229
|
+
{
|
|
1230
|
+
maximum = (1 << tiff_bps) - 1;
|
|
1231
|
+
if (maximum < 0x10000 && curve[maximum] > 0 &&
|
|
1232
|
+
load_raw == &LibRaw::sony_arw2_load_raw)
|
|
1233
|
+
maximum = curve[maximum];
|
|
1234
|
+
}
|
|
1235
|
+
if (maximum > 0xffff)
|
|
1236
|
+
maximum = 0xffff;
|
|
1237
|
+
if (!load_raw || height < 22 || width < 22 ||
|
|
1238
|
+
(tiff_bps > 16 &&
|
|
1239
|
+
(load_raw != &LibRaw::deflate_dng_load_raw &&
|
|
1240
|
+
load_raw != &LibRaw::uncompressed_fp_dng_load_raw)) ||
|
|
1241
|
+
tiff_samples > 6 || colors > 4)
|
|
1242
|
+
is_raw = 0;
|
|
1243
|
+
|
|
1244
|
+
if (raw_width < 22 || raw_width > 64000 || raw_height < 22 ||
|
|
1245
|
+
pixel_aspect < 0.1 || pixel_aspect > 10. ||
|
|
1246
|
+
raw_height > 64000)
|
|
1247
|
+
is_raw = 0;
|
|
1248
|
+
if(raw_width <= left_margin || raw_height <= top_margin)
|
|
1249
|
+
is_raw = 0;
|
|
1250
|
+
if (dng_version && (tiff_samples < 1 || tiff_samples > 4))
|
|
1251
|
+
is_raw = 0; // we do not handle DNGs with more than 4 values per pixel
|
|
1252
|
+
|
|
1253
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
1254
|
+
#ifdef NO_JASPER
|
|
1255
|
+
if (load_raw == &LibRaw::redcine_load_raw)
|
|
1256
|
+
{
|
|
1257
|
+
is_raw = 0;
|
|
1258
|
+
imgdata.process_warnings |= LIBRAW_WARN_NO_JASPER;
|
|
1259
|
+
}
|
|
1260
|
+
#endif
|
|
1261
|
+
#endif
|
|
1262
|
+
#ifdef NO_JPEG
|
|
1263
|
+
if (load_raw == &LibRaw::kodak_jpeg_load_raw ||
|
|
1264
|
+
load_raw == &LibRaw::lossy_dng_load_raw)
|
|
1265
|
+
{
|
|
1266
|
+
is_raw = 0;
|
|
1267
|
+
imgdata.process_warnings |= LIBRAW_WARN_NO_JPEGLIB;
|
|
1268
|
+
}
|
|
1269
|
+
#endif
|
|
1270
|
+
if (!cdesc[0])
|
|
1271
|
+
strcpy(cdesc, colors == 3 ? "RGBG" : "GMCY");
|
|
1272
|
+
if (!raw_height)
|
|
1273
|
+
raw_height = height;
|
|
1274
|
+
if (!raw_width)
|
|
1275
|
+
raw_width = width;
|
|
1276
|
+
if (filters > 999 && colors == 3)
|
|
1277
|
+
filters |= ((filters >> 2 & 0x22222222) | (filters << 2 & 0x88888888)) &
|
|
1278
|
+
filters << 1;
|
|
1279
|
+
notraw:
|
|
1280
|
+
if (flip == (int)UINT_MAX)
|
|
1281
|
+
flip = tiff_flip;
|
|
1282
|
+
if (flip == (int)UINT_MAX)
|
|
1283
|
+
flip = 0;
|
|
1284
|
+
|
|
1285
|
+
// Convert from degrees to bit-field if needed
|
|
1286
|
+
if (flip > 89 || flip < -89)
|
|
1287
|
+
{
|
|
1288
|
+
switch ((flip + 3600) % 360)
|
|
1289
|
+
{
|
|
1290
|
+
case 270:
|
|
1291
|
+
flip = 5;
|
|
1292
|
+
break;
|
|
1293
|
+
case 180:
|
|
1294
|
+
flip = 3;
|
|
1295
|
+
break;
|
|
1296
|
+
case 90:
|
|
1297
|
+
flip = 6;
|
|
1298
|
+
break;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
if (pana_bpp)
|
|
1303
|
+
imgdata.color.raw_bps = pana_bpp;
|
|
1304
|
+
else if ((load_raw == &LibRaw::phase_one_load_raw) ||
|
|
1305
|
+
(load_raw == &LibRaw::phase_one_load_raw_s) ||
|
|
1306
|
+
(load_raw == &LibRaw::phase_one_load_raw_c))
|
|
1307
|
+
imgdata.color.raw_bps = ph1.format;
|
|
1308
|
+
else
|
|
1309
|
+
imgdata.color.raw_bps = tiff_bps;
|
|
1310
|
+
|
|
1311
|
+
RUN_CALLBACK(LIBRAW_PROGRESS_IDENTIFY, 1, 2);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
void LibRaw::identify_process_dng_fields()
|
|
1315
|
+
{
|
|
1316
|
+
if (!dng_version) return;
|
|
1317
|
+
|
|
1318
|
+
// Cleanup inset_crops if set by makernotes parser
|
|
1319
|
+
imgdata.sizes.raw_inset_crops[0].cleft = imgdata.sizes.raw_inset_crops[0].ctop =
|
|
1320
|
+
imgdata.sizes.raw_inset_crops[1].cleft = imgdata.sizes.raw_inset_crops[1].ctop = 0xffff;
|
|
1321
|
+
imgdata.sizes.raw_inset_crops[0].cwidth = imgdata.sizes.raw_inset_crops[0].cheight =
|
|
1322
|
+
imgdata.sizes.raw_inset_crops[1].cwidth = imgdata.sizes.raw_inset_crops[1].cheight = 0;
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
int c;
|
|
1326
|
+
{
|
|
1327
|
+
/* copy DNG data from per-IFD field to color.dng */
|
|
1328
|
+
int iifd = find_ifd_by_offset(data_offset);
|
|
1329
|
+
int pifd = find_ifd_by_offset(thumb_offset);
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
#define IFDCOLORINDEX(ifd, subset, bit) \
|
|
1333
|
+
(tiff_ifd[ifd].dng_color[subset].parsedfields & bit) \
|
|
1334
|
+
? ifd \
|
|
1335
|
+
: ((tiff_ifd[0].dng_color[subset].parsedfields & bit) ? 0 : -1)
|
|
1336
|
+
|
|
1337
|
+
#define IFDLEVELINDEX(ifd, bit) \
|
|
1338
|
+
(tiff_ifd[ifd].dng_levels.parsedfields & bit) \
|
|
1339
|
+
? ifd \
|
|
1340
|
+
: ((tiff_ifd[0].dng_levels.parsedfields & bit) ? 0 : -1)
|
|
1341
|
+
|
|
1342
|
+
#define COPYARR(to, from) memmove(&to, &from, sizeof(from))
|
|
1343
|
+
|
|
1344
|
+
if (iifd < (int)tiff_nifds && iifd >= 0)
|
|
1345
|
+
{
|
|
1346
|
+
int sidx;
|
|
1347
|
+
// Per field, not per structure
|
|
1348
|
+
if (!(imgdata.rawparams.options & LIBRAW_RAWOPTIONS_DONT_CHECK_DNG_ILLUMINANT))
|
|
1349
|
+
{
|
|
1350
|
+
int illidx[2], cmidx[2], calidx[2], abidx;
|
|
1351
|
+
for (int i = 0; i < 2; i++)
|
|
1352
|
+
{
|
|
1353
|
+
illidx[i] = IFDCOLORINDEX(iifd, i, LIBRAW_DNGFM_ILLUMINANT);
|
|
1354
|
+
cmidx[i] = IFDCOLORINDEX(iifd, i, LIBRAW_DNGFM_COLORMATRIX);
|
|
1355
|
+
calidx[i] = IFDCOLORINDEX(iifd, i, LIBRAW_DNGFM_CALIBRATION);
|
|
1356
|
+
}
|
|
1357
|
+
abidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_ANALOGBALANCE);
|
|
1358
|
+
// Data found, all in same ifd, illuminants are inited
|
|
1359
|
+
if (illidx[0] >= 0 && illidx[0] < (int)tiff_nifds &&
|
|
1360
|
+
illidx[0] == illidx[1] && illidx[0] == cmidx[0] &&
|
|
1361
|
+
illidx[0] == cmidx[1] &&
|
|
1362
|
+
tiff_ifd[illidx[0]].dng_color[0].illuminant > 0 &&
|
|
1363
|
+
tiff_ifd[illidx[0]].dng_color[1].illuminant > 0)
|
|
1364
|
+
{
|
|
1365
|
+
sidx = illidx[0]; // => selected IFD
|
|
1366
|
+
double cc[4][4], cm[4][3], cam_xyz[4][3];
|
|
1367
|
+
// CM -> Color Matrix
|
|
1368
|
+
// CC -> Camera calibration
|
|
1369
|
+
for (int j = 0; j < 4; j++)
|
|
1370
|
+
for (int i = 0; i < 4; i++)
|
|
1371
|
+
cc[j][i] = i == j;
|
|
1372
|
+
int colidx = -1;
|
|
1373
|
+
|
|
1374
|
+
// IS D65 here?
|
|
1375
|
+
for (int i = 0; i < 2; i++)
|
|
1376
|
+
{
|
|
1377
|
+
if (tiff_ifd[sidx].dng_color[i].illuminant == LIBRAW_WBI_D65)
|
|
1378
|
+
{
|
|
1379
|
+
colidx = i;
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// Other daylight-type ill
|
|
1385
|
+
if (colidx < 0)
|
|
1386
|
+
for (int i = 0; i < 2; i++)
|
|
1387
|
+
{
|
|
1388
|
+
int ill = tiff_ifd[sidx].dng_color[i].illuminant;
|
|
1389
|
+
if (ill == LIBRAW_WBI_Daylight || ill == LIBRAW_WBI_D55 ||
|
|
1390
|
+
ill == LIBRAW_WBI_D75 || ill == LIBRAW_WBI_D50 ||
|
|
1391
|
+
ill == LIBRAW_WBI_Flash)
|
|
1392
|
+
{
|
|
1393
|
+
colidx = i;
|
|
1394
|
+
break;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
if (colidx >= 0) // Selected
|
|
1398
|
+
{
|
|
1399
|
+
// Init camera matrix from DNG
|
|
1400
|
+
FORCC for (int j = 0; j < 3; j++) cm[c][j] =
|
|
1401
|
+
tiff_ifd[sidx].dng_color[colidx].colormatrix[c][j];
|
|
1402
|
+
|
|
1403
|
+
if (calidx[colidx] == sidx)
|
|
1404
|
+
{
|
|
1405
|
+
for (int i = 0; i < colors && i < 4; i++)
|
|
1406
|
+
FORCC
|
|
1407
|
+
cc[i][c] = tiff_ifd[sidx].dng_color[colidx].calibration[i][c];
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
if (abidx == sidx)
|
|
1411
|
+
for (int i = 0; i < colors && i < 4; i++)
|
|
1412
|
+
FORCC cc[i][c] *= tiff_ifd[sidx].dng_levels.analogbalance[i];
|
|
1413
|
+
int j;
|
|
1414
|
+
FORCC for (int i = 0; i < 3; i++)
|
|
1415
|
+
for (cam_xyz[c][i] = j = 0; j < colors && j < 4; j++)
|
|
1416
|
+
cam_xyz[c][i] +=
|
|
1417
|
+
cc[c][j] * cm[j][i]; // add AsShotXY later * xyz[i];
|
|
1418
|
+
cam_xyz_coeff(cmatrix, cam_xyz);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
bool noFujiDNGCrop = makeIs(LIBRAW_CAMERAMAKER_Fujifilm)
|
|
1424
|
+
&& (!strcmp(normalized_model, "S3Pro")
|
|
1425
|
+
|| !strcmp(normalized_model, "S5Pro")
|
|
1426
|
+
|| !strcmp(normalized_model, "S2Pro"));
|
|
1427
|
+
|
|
1428
|
+
if (!noFujiDNGCrop) // Promote DNG Crops to raw_inset_crops
|
|
1429
|
+
{
|
|
1430
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_CROPORIGIN);
|
|
1431
|
+
int sidx2 = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_CROPSIZE);
|
|
1432
|
+
if (sidx >= 0 && sidx == sidx2 &&
|
|
1433
|
+
tiff_ifd[sidx].dng_levels.default_crop[2] > 0 &&
|
|
1434
|
+
tiff_ifd[sidx].dng_levels.default_crop[3] > 0)
|
|
1435
|
+
{
|
|
1436
|
+
int lm = tiff_ifd[sidx].dng_levels.default_crop[0];
|
|
1437
|
+
int tm = tiff_ifd[sidx].dng_levels.default_crop[1];
|
|
1438
|
+
int ww = tiff_ifd[sidx].dng_levels.default_crop[2];
|
|
1439
|
+
int hh = tiff_ifd[sidx].dng_levels.default_crop[3];
|
|
1440
|
+
if ((lm + ww < int(raw_width) + int(left_margin))
|
|
1441
|
+
&& (tm + hh < int(raw_height) + int(top_margin))) // Crop data is correct
|
|
1442
|
+
{
|
|
1443
|
+
imgdata.sizes.raw_inset_crops[0].cleft = left_margin + lm;
|
|
1444
|
+
imgdata.sizes.raw_inset_crops[0].cwidth = ww;
|
|
1445
|
+
imgdata.sizes.raw_inset_crops[0].ctop = top_margin + tm;
|
|
1446
|
+
imgdata.sizes.raw_inset_crops[0].cheight = hh;
|
|
1447
|
+
|
|
1448
|
+
int sidx3 = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_USERCROP);
|
|
1449
|
+
if (sidx3 >= 0 && sidx3 == sidx) // No need to check values range, it is checked at parse
|
|
1450
|
+
{
|
|
1451
|
+
int dt = int(imgdata.sizes.raw_inset_crops[0].cheight * tiff_ifd[sidx].dng_levels.user_crop[0]);
|
|
1452
|
+
int dl = int(imgdata.sizes.raw_inset_crops[0].cwidth * tiff_ifd[sidx].dng_levels.user_crop[1]);
|
|
1453
|
+
int db = int(imgdata.sizes.raw_inset_crops[0].cheight * tiff_ifd[sidx].dng_levels.user_crop[2]);
|
|
1454
|
+
int dr = int(imgdata.sizes.raw_inset_crops[0].cwidth * tiff_ifd[sidx].dng_levels.user_crop[3]);
|
|
1455
|
+
|
|
1456
|
+
int dh = db - dt;
|
|
1457
|
+
int dw = dr - dl;
|
|
1458
|
+
|
|
1459
|
+
if (dh > 0 && dw > 0
|
|
1460
|
+
&& dh < imgdata.sizes.raw_inset_crops[0].cheight // No need to repeat crop for 0,0,1,1
|
|
1461
|
+
&& dw < imgdata.sizes.raw_inset_crops[0].cwidth)
|
|
1462
|
+
{
|
|
1463
|
+
imgdata.sizes.raw_inset_crops[1].cleft = imgdata.sizes.raw_inset_crops[0].cleft + dl;
|
|
1464
|
+
imgdata.sizes.raw_inset_crops[1].cwidth = dw;
|
|
1465
|
+
imgdata.sizes.raw_inset_crops[1].ctop = imgdata.sizes.raw_inset_crops[0].ctop + dt;
|
|
1466
|
+
imgdata.sizes.raw_inset_crops[1].cheight = dh;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
if (!(imgdata.color.dng_color[0].parsedfields &
|
|
1474
|
+
LIBRAW_DNGFM_FORWARDMATRIX)) // Not set already (Leica makernotes)
|
|
1475
|
+
{
|
|
1476
|
+
sidx = IFDCOLORINDEX(iifd, 0, LIBRAW_DNGFM_FORWARDMATRIX);
|
|
1477
|
+
if (sidx >= 0)
|
|
1478
|
+
COPYARR(imgdata.color.dng_color[0].forwardmatrix,
|
|
1479
|
+
tiff_ifd[sidx].dng_color[0].forwardmatrix);
|
|
1480
|
+
}
|
|
1481
|
+
if (!(imgdata.color.dng_color[1].parsedfields &
|
|
1482
|
+
LIBRAW_DNGFM_FORWARDMATRIX)) // Not set already (Leica makernotes)
|
|
1483
|
+
{
|
|
1484
|
+
sidx = IFDCOLORINDEX(iifd, 1, LIBRAW_DNGFM_FORWARDMATRIX);
|
|
1485
|
+
if (sidx >= 0)
|
|
1486
|
+
COPYARR(imgdata.color.dng_color[1].forwardmatrix,
|
|
1487
|
+
tiff_ifd[sidx].dng_color[1].forwardmatrix);
|
|
1488
|
+
}
|
|
1489
|
+
for (int ss = 0; ss < 2; ss++)
|
|
1490
|
+
{
|
|
1491
|
+
sidx = IFDCOLORINDEX(iifd, ss, LIBRAW_DNGFM_COLORMATRIX);
|
|
1492
|
+
if (sidx >= 0)
|
|
1493
|
+
COPYARR(imgdata.color.dng_color[ss].colormatrix,
|
|
1494
|
+
tiff_ifd[sidx].dng_color[ss].colormatrix);
|
|
1495
|
+
|
|
1496
|
+
sidx = IFDCOLORINDEX(iifd, ss, LIBRAW_DNGFM_CALIBRATION);
|
|
1497
|
+
if (sidx >= 0)
|
|
1498
|
+
COPYARR(imgdata.color.dng_color[ss].calibration,
|
|
1499
|
+
tiff_ifd[sidx].dng_color[ss].calibration);
|
|
1500
|
+
|
|
1501
|
+
sidx = IFDCOLORINDEX(iifd, ss, LIBRAW_DNGFM_ILLUMINANT);
|
|
1502
|
+
if (sidx >= 0)
|
|
1503
|
+
imgdata.color.dng_color[ss].illuminant =
|
|
1504
|
+
tiff_ifd[sidx].dng_color[ss].illuminant;
|
|
1505
|
+
}
|
|
1506
|
+
// Levels
|
|
1507
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_ANALOGBALANCE);
|
|
1508
|
+
if (sidx >= 0)
|
|
1509
|
+
COPYARR(imgdata.color.dng_levels.analogbalance,
|
|
1510
|
+
tiff_ifd[sidx].dng_levels.analogbalance);
|
|
1511
|
+
|
|
1512
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_BASELINEEXPOSURE);
|
|
1513
|
+
if (sidx >= 0)
|
|
1514
|
+
imgdata.color.dng_levels.baseline_exposure =
|
|
1515
|
+
tiff_ifd[sidx].dng_levels.baseline_exposure;
|
|
1516
|
+
|
|
1517
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_WHITE);
|
|
1518
|
+
if (sidx >= 0 && tiff_ifd[sidx].dng_levels.dng_whitelevel[0])
|
|
1519
|
+
COPYARR(imgdata.color.dng_levels.dng_whitelevel,
|
|
1520
|
+
tiff_ifd[sidx].dng_levels.dng_whitelevel);
|
|
1521
|
+
else if (tiff_ifd[iifd].sample_format <= 2 && tiff_ifd[iifd].bps > 0 && tiff_ifd[iifd].bps < 32)
|
|
1522
|
+
FORC4
|
|
1523
|
+
imgdata.color.dng_levels.dng_whitelevel[c] = (1 << tiff_ifd[iifd].bps) - 1;
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_ASSHOTNEUTRAL);
|
|
1528
|
+
if (sidx >= 0)
|
|
1529
|
+
{
|
|
1530
|
+
COPYARR(imgdata.color.dng_levels.asshotneutral,
|
|
1531
|
+
tiff_ifd[sidx].dng_levels.asshotneutral);
|
|
1532
|
+
if (imgdata.color.dng_levels.asshotneutral[0])
|
|
1533
|
+
{
|
|
1534
|
+
cam_mul[3] = 0;
|
|
1535
|
+
FORCC
|
|
1536
|
+
if (fabs(imgdata.color.dng_levels.asshotneutral[c]) > 0.0001)
|
|
1537
|
+
cam_mul[c] = 1 / imgdata.color.dng_levels.asshotneutral[c];
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_BLACK);
|
|
1541
|
+
if (sidx >= 0)
|
|
1542
|
+
{
|
|
1543
|
+
imgdata.color.dng_levels.dng_fblack =
|
|
1544
|
+
tiff_ifd[sidx].dng_levels.dng_fblack;
|
|
1545
|
+
imgdata.color.dng_levels.dng_black =
|
|
1546
|
+
tiff_ifd[sidx].dng_levels.dng_black;
|
|
1547
|
+
COPYARR(imgdata.color.dng_levels.dng_cblack,
|
|
1548
|
+
tiff_ifd[sidx].dng_levels.dng_cblack);
|
|
1549
|
+
COPYARR(imgdata.color.dng_levels.dng_fcblack,
|
|
1550
|
+
tiff_ifd[sidx].dng_levels.dng_fcblack);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
if (pifd >= 0)
|
|
1555
|
+
{
|
|
1556
|
+
sidx = IFDLEVELINDEX(pifd, LIBRAW_DNGFM_PREVIEWCS);
|
|
1557
|
+
if (sidx >= 0)
|
|
1558
|
+
imgdata.color.dng_levels.preview_colorspace =
|
|
1559
|
+
tiff_ifd[sidx].dng_levels.preview_colorspace;
|
|
1560
|
+
}
|
|
1561
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_OPCODE2);
|
|
1562
|
+
if (sidx >= 0)
|
|
1563
|
+
meta_offset = tiff_ifd[sidx].opcode2_offset;
|
|
1564
|
+
|
|
1565
|
+
sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_LINTABLE);
|
|
1566
|
+
INT64 linoff = -1;
|
|
1567
|
+
int linlen = 0;
|
|
1568
|
+
if (sidx >= 0)
|
|
1569
|
+
{
|
|
1570
|
+
linoff = tiff_ifd[sidx].lineartable_offset;
|
|
1571
|
+
linlen = tiff_ifd[sidx].lineartable_len;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
if (linoff >= 0 && linlen > 0)
|
|
1575
|
+
{
|
|
1576
|
+
INT64 pos = ftell(ifp);
|
|
1577
|
+
fseek(ifp, linoff, SEEK_SET);
|
|
1578
|
+
linear_table(linlen);
|
|
1579
|
+
fseek(ifp, pos, SEEK_SET);
|
|
1580
|
+
}
|
|
1581
|
+
// Need to add curve too
|
|
1582
|
+
}
|
|
1583
|
+
/* Copy DNG black level to LibRaw's */
|
|
1584
|
+
if (load_raw == &LibRaw::lossy_dng_load_raw)
|
|
1585
|
+
{
|
|
1586
|
+
maximum = 0xffff;
|
|
1587
|
+
FORC4 imgdata.color.linear_max[c] = imgdata.color.dng_levels.dng_whitelevel[c] = 0xffff;
|
|
1588
|
+
}
|
|
1589
|
+
else
|
|
1590
|
+
{
|
|
1591
|
+
maximum = imgdata.color.dng_levels.dng_whitelevel[0];
|
|
1592
|
+
}
|
|
1593
|
+
black = imgdata.color.dng_levels.dng_black;
|
|
1594
|
+
if (tiff_samples == 2 &&
|
|
1595
|
+
!imgdata.color.dng_levels.dng_cblack[2] &&
|
|
1596
|
+
!imgdata.color.dng_levels.dng_cblack[3] &&
|
|
1597
|
+
(imgdata.color.dng_levels.dng_cblack[4] == 1) &&
|
|
1598
|
+
(imgdata.color.dng_levels.dng_cblack[5] == 1)
|
|
1599
|
+
&& (imgdata.color.dng_levels.dng_cblack[LIBRAW_CBLACK_SIZE - 1] == tiff_samples)
|
|
1600
|
+
) {
|
|
1601
|
+
black = imgdata.color.dng_levels.dng_cblack[shot_select];
|
|
1602
|
+
imgdata.color.dng_levels.dng_cblack[0] = imgdata.color.dng_levels.dng_cblack[1] = 0;
|
|
1603
|
+
imgdata.color.dng_levels.dng_cblack[4] = imgdata.color.dng_levels.dng_cblack[5] = 0;
|
|
1604
|
+
imgdata.color.dng_levels.dng_fcblack[0] = imgdata.color.dng_levels.dng_fcblack[1] = 0.0f;
|
|
1605
|
+
imgdata.color.dng_levels.dng_fcblack[4] = imgdata.color.dng_levels.dng_fcblack[5] = 0.0f;
|
|
1606
|
+
}
|
|
1607
|
+
else if (tiff_samples == 2 && imgdata.color.dng_levels.dng_cblack[4] * imgdata.color.dng_levels.dng_cblack[5] * tiff_samples
|
|
1608
|
+
== imgdata.color.dng_levels.dng_cblack[LIBRAW_CBLACK_SIZE - 1])
|
|
1609
|
+
{
|
|
1610
|
+
unsigned ff = filters;
|
|
1611
|
+
if (filters > 999 && colors == 3)
|
|
1612
|
+
filters |= ((filters >> 2 & 0x22222222) | (filters << 2 & 0x88888888)) &
|
|
1613
|
+
filters << 1;
|
|
1614
|
+
|
|
1615
|
+
/* Special case, Fuji SuperCCD dng */
|
|
1616
|
+
int csum[4] = { 0,0,0,0 }, ccount[4] = { 0,0,0,0 };
|
|
1617
|
+
int i = 6 + shot_select;
|
|
1618
|
+
for (unsigned row = 0; row < imgdata.color.dng_levels.dng_cblack[4]; row++)
|
|
1619
|
+
for (unsigned col = 0; col < imgdata.color.dng_levels.dng_cblack[5]; col++)
|
|
1620
|
+
{
|
|
1621
|
+
csum[FC(row, col)] += imgdata.color.dng_levels.dng_cblack[i];
|
|
1622
|
+
ccount[FC(row, col)]++;
|
|
1623
|
+
i += tiff_samples;
|
|
1624
|
+
}
|
|
1625
|
+
for (int q = 0; q < 4; q++)
|
|
1626
|
+
if (ccount[q])
|
|
1627
|
+
imgdata.color.dng_levels.dng_cblack[q] += csum[q] / ccount[q];
|
|
1628
|
+
imgdata.color.dng_levels.dng_cblack[4] = imgdata.color.dng_levels.dng_cblack[5] = 0;
|
|
1629
|
+
filters = ff;
|
|
1630
|
+
}
|
|
1631
|
+
else if (tiff_samples > 2 && tiff_samples <= 4 && imgdata.color.dng_levels.dng_cblack[4] * imgdata.color.dng_levels.dng_cblack[5] * tiff_samples
|
|
1632
|
+
== imgdata.color.dng_levels.dng_cblack[LIBRAW_CBLACK_SIZE - 1])
|
|
1633
|
+
{
|
|
1634
|
+
/* Special case, per_channel blacks in RepeatDim, average for per-channel */
|
|
1635
|
+
int csum[4] = { 0,0,0,0 }, ccount[4] = { 0,0,0,0 };
|
|
1636
|
+
int i = 6;
|
|
1637
|
+
for (unsigned row = 0; row < imgdata.color.dng_levels.dng_cblack[4]; row++)
|
|
1638
|
+
for (unsigned col = 0; col < imgdata.color.dng_levels.dng_cblack[5]; col++)
|
|
1639
|
+
for (unsigned q = 0; q < tiff_samples && q < 4; q++)
|
|
1640
|
+
{
|
|
1641
|
+
csum[q] += imgdata.color.dng_levels.dng_cblack[i];
|
|
1642
|
+
ccount[q]++;
|
|
1643
|
+
i++;
|
|
1644
|
+
}
|
|
1645
|
+
for (int q = 0; q < 4; q++)
|
|
1646
|
+
if (ccount[q])
|
|
1647
|
+
imgdata.color.dng_levels.dng_cblack[q] += csum[q] / ccount[q];
|
|
1648
|
+
imgdata.color.dng_levels.dng_cblack[4] = imgdata.color.dng_levels.dng_cblack[5] = 0;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
memmove(cblack, imgdata.color.dng_levels.dng_cblack, sizeof(cblack));
|
|
1652
|
+
|
|
1653
|
+
if (iifd < (int)tiff_nifds && iifd >= 0)
|
|
1654
|
+
{
|
|
1655
|
+
int sidx = IFDLEVELINDEX(iifd, LIBRAW_DNGFM_LINEARRESPONSELIMIT);
|
|
1656
|
+
if (sidx >= 0)
|
|
1657
|
+
{
|
|
1658
|
+
imgdata.color.dng_levels.LinearResponseLimit =
|
|
1659
|
+
tiff_ifd[sidx].dng_levels.LinearResponseLimit;
|
|
1660
|
+
if (imgdata.color.dng_levels.LinearResponseLimit > 0.1 &&
|
|
1661
|
+
imgdata.color.dng_levels.LinearResponseLimit <= 1.0)
|
|
1662
|
+
{
|
|
1663
|
+
// And approx promote it to linear_max:
|
|
1664
|
+
int bl4 = 0, bl64 = 0;
|
|
1665
|
+
for (int chan = 0; chan < colors && chan < 4; chan++)
|
|
1666
|
+
bl4 += cblack[chan];
|
|
1667
|
+
bl4 /= LIM(colors, 1, 4);
|
|
1668
|
+
|
|
1669
|
+
if (cblack[4] * cblack[5] > 0)
|
|
1670
|
+
{
|
|
1671
|
+
unsigned cnt = 0;
|
|
1672
|
+
for (unsigned q = 0; q < 4096 && q < cblack[4] * cblack[5]; q++)
|
|
1673
|
+
{
|
|
1674
|
+
bl64 += cblack[q + 6];
|
|
1675
|
+
cnt++;
|
|
1676
|
+
}
|
|
1677
|
+
bl64 /= LIM(cnt, 1, 4096);
|
|
1678
|
+
}
|
|
1679
|
+
int rblack = black + bl4 + bl64;
|
|
1680
|
+
for (int chan = 0; chan < colors && chan < 4; chan++)
|
|
1681
|
+
imgdata.color.linear_max[chan] =
|
|
1682
|
+
(maximum - rblack) *
|
|
1683
|
+
imgdata.color.dng_levels.LinearResponseLimit +
|
|
1684
|
+
rblack;
|
|
1685
|
+
if (imgdata.color.linear_max[1] && !imgdata.color.linear_max[3])
|
|
1686
|
+
imgdata.color.linear_max[3] = imgdata.color.linear_max[1];
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
void LibRaw::identify_finetune_pentax()
|
|
1694
|
+
{
|
|
1695
|
+
if (dng_version && data_offset)
|
|
1696
|
+
{
|
|
1697
|
+
for(int i = 0; i < (int)tiff_nifds; i++)
|
|
1698
|
+
if (tiff_ifd[i].offset == data_offset)
|
|
1699
|
+
{
|
|
1700
|
+
if (tiff_ifd[i].phint == 34892) return; // Linear DNG made from Pentax source
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Pentax) ||
|
|
1706
|
+
makeIs(LIBRAW_CAMERAMAKER_Samsung)) {
|
|
1707
|
+
if (height == 2624 &&
|
|
1708
|
+
width == 3936) // Pentax K10D, Samsung GX10;
|
|
1709
|
+
{
|
|
1710
|
+
height = 2616;
|
|
1711
|
+
width = 3896;
|
|
1712
|
+
}
|
|
1713
|
+
if (height == 3136 &&
|
|
1714
|
+
width == 4864) // Pentax K20D, Samsung GX20;
|
|
1715
|
+
{
|
|
1716
|
+
height = 3124;
|
|
1717
|
+
width = 4688;
|
|
1718
|
+
filters = 0x16161616;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Pentax)) {
|
|
1723
|
+
if ((width == 4352) &&
|
|
1724
|
+
((unique_id == PentaxID_K_r) ||
|
|
1725
|
+
(unique_id == PentaxID_K_x)))
|
|
1726
|
+
{
|
|
1727
|
+
width = 4309;
|
|
1728
|
+
filters = 0x16161616;
|
|
1729
|
+
}
|
|
1730
|
+
if ((width >= 4960) &&
|
|
1731
|
+
((unique_id == PentaxID_K_5) ||
|
|
1732
|
+
(unique_id == PentaxID_K_5_II) ||
|
|
1733
|
+
(unique_id == PentaxID_K_5_II_s)))
|
|
1734
|
+
{
|
|
1735
|
+
left_margin = 10;
|
|
1736
|
+
width = 4950;
|
|
1737
|
+
filters = 0x16161616;
|
|
1738
|
+
}
|
|
1739
|
+
if ((width == 6080) && (unique_id == PentaxID_K_70))
|
|
1740
|
+
{
|
|
1741
|
+
height = 4016;
|
|
1742
|
+
top_margin = 32;
|
|
1743
|
+
width = 6020;
|
|
1744
|
+
left_margin = 60;
|
|
1745
|
+
}
|
|
1746
|
+
if ((width == 4736) && (unique_id == PentaxID_K_7))
|
|
1747
|
+
{
|
|
1748
|
+
height = 3122;
|
|
1749
|
+
width = 4684;
|
|
1750
|
+
filters = 0x16161616;
|
|
1751
|
+
top_margin = 2;
|
|
1752
|
+
}
|
|
1753
|
+
if ((width == 6080) && (unique_id == PentaxID_K_3_II))
|
|
1754
|
+
{
|
|
1755
|
+
left_margin = 4;
|
|
1756
|
+
width = 6040;
|
|
1757
|
+
}
|
|
1758
|
+
if ((width == 6304) && (unique_id == PentaxID_K_3_III)) // From DNG ActiveArea
|
|
1759
|
+
{
|
|
1760
|
+
left_margin = 26;
|
|
1761
|
+
width = 6224;
|
|
1762
|
+
top_margin = 34;
|
|
1763
|
+
height = 4160;
|
|
1764
|
+
}
|
|
1765
|
+
if ((width == 6112) && (unique_id == PentaxID_KP))
|
|
1766
|
+
{
|
|
1767
|
+
// From DNG, maybe too strict
|
|
1768
|
+
left_margin = 54;
|
|
1769
|
+
top_margin = 28;
|
|
1770
|
+
width = 6028;
|
|
1771
|
+
height = raw_height - top_margin;
|
|
1772
|
+
}
|
|
1773
|
+
if ((width == 6080) && (unique_id == PentaxID_K_3))
|
|
1774
|
+
{
|
|
1775
|
+
left_margin = 4;
|
|
1776
|
+
width = 6040;
|
|
1777
|
+
}
|
|
1778
|
+
if ((width == 7424) && (unique_id == PentaxID_645D))
|
|
1779
|
+
{
|
|
1780
|
+
height = 5502;
|
|
1781
|
+
width = 7328;
|
|
1782
|
+
filters = 0x61616161;
|
|
1783
|
+
top_margin = 29;
|
|
1784
|
+
left_margin = 48;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Ricoh) &&
|
|
1788
|
+
(height == 3014) && (width == 4096)) // Ricoh GX200
|
|
1789
|
+
width = 4014;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
void LibRaw::identify_finetune_by_filesize(int fsize)
|
|
1793
|
+
{
|
|
1794
|
+
|
|
1795
|
+
if (fsize == 4771840)
|
|
1796
|
+
{ // hack Nikon 3mpix: E880, E885, E990, E995;
|
|
1797
|
+
// Olympus C-3030Z
|
|
1798
|
+
if (!timestamp && nikon_e995())
|
|
1799
|
+
strcpy(model, "E995");
|
|
1800
|
+
}
|
|
1801
|
+
else if (fsize == 2940928)
|
|
1802
|
+
{ // hack Nikon 2mpix: E2100, E2500
|
|
1803
|
+
if (!timestamp && !nikon_e2100())
|
|
1804
|
+
strcpy(model, "E2500");
|
|
1805
|
+
}
|
|
1806
|
+
else if (fsize == 4775936)
|
|
1807
|
+
{ // hack Nikon 3mpix: E3100, E3200, E3500, E3700;
|
|
1808
|
+
// Pentax "Optio 33WR";
|
|
1809
|
+
// Olympus C-740UZ
|
|
1810
|
+
if (!timestamp)
|
|
1811
|
+
nikon_3700();
|
|
1812
|
+
}
|
|
1813
|
+
else if (fsize == 5869568)
|
|
1814
|
+
{ // hack Nikon 4mpix: E4300;
|
|
1815
|
+
// hack Minolta "DiMAGE Z2"
|
|
1816
|
+
if (!timestamp && minolta_z2())
|
|
1817
|
+
{
|
|
1818
|
+
maker_index = LIBRAW_CAMERAMAKER_Minolta;
|
|
1819
|
+
strcpy(make, "Minolta");
|
|
1820
|
+
strcpy(model, "DiMAGE Z2");
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
void LibRaw::identify_finetune_dcr(char head[64], int fsize, int flen)
|
|
1826
|
+
{
|
|
1827
|
+
static const short pana[][6] = {
|
|
1828
|
+
// raw_width, raw_height, left_margin, top_margin, width_increment,
|
|
1829
|
+
// height_increment
|
|
1830
|
+
{3130, 1743, 4, 0, -6, 0}, /* 00 */
|
|
1831
|
+
{3130, 2055, 4, 0, -6, 0}, /* 01 */
|
|
1832
|
+
{3130, 2319, 4, 0, -6, 0}, /* 02 DMC-FZ8 */
|
|
1833
|
+
{3170, 2103, 18, 0, -42, 20}, /* 03 */
|
|
1834
|
+
{3170, 2367, 18, 13, -42, -21}, /* 04 */
|
|
1835
|
+
{3177, 2367, 0, 0, -1, 0}, /* 05 DMC-L1 */
|
|
1836
|
+
{3304, 2458, 0, 0, -1, 0}, /* 06 DMC-FZ30 */
|
|
1837
|
+
{3330, 2463, 9, 0, -5, 0}, /* 07 DMC-FZ18 */
|
|
1838
|
+
{3330, 2479, 9, 0, -17, 4}, /* 08 */
|
|
1839
|
+
{3370, 1899, 15, 0, -44, 20}, /* 09 */
|
|
1840
|
+
{3370, 2235, 15, 0, -44, 20}, /* 10 */
|
|
1841
|
+
{3370, 2511, 15, 10, -44, -21}, /* 11 */
|
|
1842
|
+
{3690, 2751, 3, 0, -8, -3}, /* 12 DMC-FZ50 */
|
|
1843
|
+
{3710, 2751, 0, 0, -3, 0}, /* 13 DMC-L10 */
|
|
1844
|
+
{3724, 2450, 0, 0, 0, -2}, /* 14 */
|
|
1845
|
+
{3770, 2487, 17, 0, -44, 19}, /* 15 */
|
|
1846
|
+
{3770, 2799, 17, 15, -44, -19}, /* 16 */
|
|
1847
|
+
{3880, 2170, 6, 0, -6, 0}, /* 17 DMC-LX1 */
|
|
1848
|
+
{4060, 3018, 0, 0, 0, -2}, /* 18 DMC-FZ35, DMC-FZ38 */
|
|
1849
|
+
{4290, 2391, 3, 0, -8, -1}, /* 19 DMC-LX2 */
|
|
1850
|
+
{4330, 2439, 17, 15, -44, -19}, /* 20 "D-LUX 3" */
|
|
1851
|
+
{4508, 2962, 0, 0, -3, -4}, /* 21 */
|
|
1852
|
+
{4508, 3330, 0, 0, -3, -6}, /* 22 */
|
|
1853
|
+
{10480, 7794, 0, 0, -2, 0}, /* 23: G9 in high-res */
|
|
1854
|
+
};
|
|
1855
|
+
int i,c;
|
|
1856
|
+
struct jhead jh;
|
|
1857
|
+
|
|
1858
|
+
if (makeIs(LIBRAW_CAMERAMAKER_Canon)
|
|
1859
|
+
&& ( !tiff_flip || unique_id == CanonID_EOS_40D)
|
|
1860
|
+
&& !(imgdata.rawparams.options & LIBRAW_RAWOPTIONS_CANON_IGNORE_MAKERNOTES_ROTATION)
|
|
1861
|
+
&& imCanon.MakernotesFlip)
|
|
1862
|
+
{
|
|
1863
|
+
tiff_flip = imCanon.MakernotesFlip;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Nikon))
|
|
1867
|
+
{
|
|
1868
|
+
if (!load_raw)
|
|
1869
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
1870
|
+
if (model[0] == 'E') // Nikon E8800, E8700, E8400, E5700, E5400, E5000,
|
|
1871
|
+
// others are diag hacks?
|
|
1872
|
+
load_flags |= !data_offset << 2 | 2;
|
|
1873
|
+
}
|
|
1874
|
+
/* Set parameters based on camera name (for non-DNG files). */
|
|
1875
|
+
|
|
1876
|
+
/* Always 512 for arw2_load_raw */
|
|
1877
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Sony) &&
|
|
1878
|
+
(raw_width > 3888) && !black && !cblack[0])
|
|
1879
|
+
{
|
|
1880
|
+
black = (load_raw == &LibRaw::sony_arw2_load_raw)
|
|
1881
|
+
? 512
|
|
1882
|
+
: (128 << (tiff_bps - 12));
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
if (is_foveon) {
|
|
1886
|
+
if (height * 2 < width)
|
|
1887
|
+
pixel_aspect = 0.5;
|
|
1888
|
+
if (height > width)
|
|
1889
|
+
pixel_aspect = 2;
|
|
1890
|
+
filters = 0;
|
|
1891
|
+
|
|
1892
|
+
}
|
|
1893
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Pentax)) {
|
|
1894
|
+
if ((unique_id == PentaxID_K_1) ||
|
|
1895
|
+
(unique_id == PentaxID_K_1_Mark_II)) {
|
|
1896
|
+
top_margin = 18;
|
|
1897
|
+
height = raw_height - top_margin;
|
|
1898
|
+
if (raw_width == 7392) {
|
|
1899
|
+
left_margin = 6;
|
|
1900
|
+
width = 7376;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
}
|
|
1904
|
+
else if (unique_id == PentaxID_Optio_S_V101) { // (fsize == 3178560)
|
|
1905
|
+
cam_mul[0] *= 4;
|
|
1906
|
+
cam_mul[2] *= 4;
|
|
1907
|
+
|
|
1908
|
+
}
|
|
1909
|
+
else if (unique_id == PentaxID_Optio_33WR) { // (fsize == 4775936)
|
|
1910
|
+
flip = 1;
|
|
1911
|
+
filters = 0x16161616;
|
|
1912
|
+
|
|
1913
|
+
}
|
|
1914
|
+
else if (unique_id == PentaxID_staristD) {
|
|
1915
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
1916
|
+
/* data_error = -1; */ /* No way to know why data_error was raised in dcraw.c, looks not needed esp. for unpacked_load_raw */
|
|
1917
|
+
}
|
|
1918
|
+
else if (unique_id == PentaxID_staristDS) {
|
|
1919
|
+
height -= 2;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
}
|
|
1923
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Canon)) {
|
|
1924
|
+
if (tiff_bps == 15) { // Canon sRAW
|
|
1925
|
+
if (width == 3344)
|
|
1926
|
+
width = 3272;
|
|
1927
|
+
else if (width == 3872)
|
|
1928
|
+
width = 3866;
|
|
1929
|
+
|
|
1930
|
+
if (height > width) {
|
|
1931
|
+
SWAP(height, width);
|
|
1932
|
+
SWAP(raw_height, raw_width);
|
|
1933
|
+
}
|
|
1934
|
+
if (width == 7200 &&
|
|
1935
|
+
height == 3888) { // Canon EOS 5DS (R);
|
|
1936
|
+
raw_width = width = 6480;
|
|
1937
|
+
raw_height = height = 4320;
|
|
1938
|
+
}
|
|
1939
|
+
filters = 0;
|
|
1940
|
+
tiff_samples = colors = 3;
|
|
1941
|
+
load_raw = &LibRaw::canon_sraw_load_raw;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
if (!strcmp(normalized_model, "PowerShot 600")) {
|
|
1945
|
+
height = 613;
|
|
1946
|
+
width = 854;
|
|
1947
|
+
raw_width = 896;
|
|
1948
|
+
colors = 4;
|
|
1949
|
+
filters = 0xe1e4e1e4;
|
|
1950
|
+
load_raw = &LibRaw::canon_600_load_raw;
|
|
1951
|
+
|
|
1952
|
+
}
|
|
1953
|
+
else if (!strcmp(normalized_model, "PowerShot A5") ||
|
|
1954
|
+
!strcmp(normalized_model, "PowerShot A5 Zoom")) {
|
|
1955
|
+
height = 773;
|
|
1956
|
+
width = 960;
|
|
1957
|
+
raw_width = 992;
|
|
1958
|
+
pixel_aspect = 256 / 235.0;
|
|
1959
|
+
filters = 0x1e4e1e4e;
|
|
1960
|
+
goto canon_a5;
|
|
1961
|
+
|
|
1962
|
+
}
|
|
1963
|
+
else if (!strcmp(normalized_model, "PowerShot A50")) {
|
|
1964
|
+
height = 968;
|
|
1965
|
+
width = 1290;
|
|
1966
|
+
raw_width = 1320;
|
|
1967
|
+
filters = 0x1b4e4b1e;
|
|
1968
|
+
goto canon_a5;
|
|
1969
|
+
|
|
1970
|
+
}
|
|
1971
|
+
else if (!strcmp(normalized_model, "PowerShot Pro70")) {
|
|
1972
|
+
height = 1024;
|
|
1973
|
+
width = 1552;
|
|
1974
|
+
filters = 0x1e4b4e1b;
|
|
1975
|
+
canon_a5:
|
|
1976
|
+
colors = 4;
|
|
1977
|
+
tiff_bps = 10;
|
|
1978
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
1979
|
+
load_flags = 40;
|
|
1980
|
+
|
|
1981
|
+
}
|
|
1982
|
+
else if (!strcmp(normalized_model, "PowerShot Pro90 IS") ||
|
|
1983
|
+
!strcmp(normalized_model, "PowerShot G1")) {
|
|
1984
|
+
colors = 4;
|
|
1985
|
+
filters = 0xb4b4b4b4;
|
|
1986
|
+
|
|
1987
|
+
}
|
|
1988
|
+
else if (!strcmp(normalized_model, "PowerShot A610")) { // chdk hack
|
|
1989
|
+
if (canon_s2is()) {
|
|
1990
|
+
strcpy(model + 10, "S2 IS");
|
|
1991
|
+
strcpy(normalized_model + 10, "S2 IS");
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
}
|
|
1995
|
+
else if (!strcmp(normalized_model, "PowerShot SX220 HS")) { // chdk hack
|
|
1996
|
+
mask[1][3] = -4;
|
|
1997
|
+
top_margin = 16;
|
|
1998
|
+
left_margin = 92;
|
|
1999
|
+
|
|
2000
|
+
}
|
|
2001
|
+
else if (!strcmp(normalized_model, "PowerShot S120")) { // chdk hack
|
|
2002
|
+
raw_width = 4192;
|
|
2003
|
+
raw_height = 3062;
|
|
2004
|
+
width = 4022;
|
|
2005
|
+
height = 3016;
|
|
2006
|
+
mask[0][0] = top_margin = 31;
|
|
2007
|
+
mask[0][2] = top_margin + height;
|
|
2008
|
+
left_margin = 120;
|
|
2009
|
+
mask[0][1] = 23;
|
|
2010
|
+
mask[0][3] = 72;
|
|
2011
|
+
|
|
2012
|
+
}
|
|
2013
|
+
else if (!strcmp(normalized_model, "PowerShot G16")) {
|
|
2014
|
+
mask[0][0] = 0;
|
|
2015
|
+
mask[0][2] = 80;
|
|
2016
|
+
mask[0][1] = 0;
|
|
2017
|
+
mask[0][3] = 16;
|
|
2018
|
+
top_margin = 29;
|
|
2019
|
+
left_margin = 120;
|
|
2020
|
+
width = raw_width - left_margin - 48;
|
|
2021
|
+
height = raw_height - top_margin - 14;
|
|
2022
|
+
|
|
2023
|
+
}
|
|
2024
|
+
else if (!strcmp(normalized_model, "PowerShot SX50 HS")) {
|
|
2025
|
+
top_margin = 17;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Nikon)) {
|
|
2031
|
+
if (!strcmp(model, "D1"))
|
|
2032
|
+
{
|
|
2033
|
+
imgdata.other.analogbalance[0] = cam_mul[0];
|
|
2034
|
+
imgdata.other.analogbalance[2] = cam_mul[2];
|
|
2035
|
+
imgdata.other.analogbalance[1] = imgdata.other.analogbalance[3] =
|
|
2036
|
+
cam_mul[1];
|
|
2037
|
+
cam_mul[0] = cam_mul[1] = cam_mul[2] = 1.0f;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
else if (!strcmp(model, "D1X"))
|
|
2041
|
+
{
|
|
2042
|
+
width -= 4;
|
|
2043
|
+
pixel_aspect = 0.5;
|
|
2044
|
+
}
|
|
2045
|
+
else if (!strcmp(model, "D40X") ||
|
|
2046
|
+
!strcmp(model, "D60") ||
|
|
2047
|
+
!strcmp(model, "D80") ||
|
|
2048
|
+
!strcmp(model, "D3000"))
|
|
2049
|
+
{
|
|
2050
|
+
height -= 3;
|
|
2051
|
+
width -= 4;
|
|
2052
|
+
}
|
|
2053
|
+
else if (!strcmp(model, "D3") ||
|
|
2054
|
+
!strcmp(model, "D3S") ||
|
|
2055
|
+
!strcmp(model, "D700"))
|
|
2056
|
+
{
|
|
2057
|
+
width -= 4;
|
|
2058
|
+
left_margin = 2;
|
|
2059
|
+
}
|
|
2060
|
+
else if (!strcmp(model, "D3100"))
|
|
2061
|
+
{
|
|
2062
|
+
width -= 28;
|
|
2063
|
+
left_margin = 6;
|
|
2064
|
+
}
|
|
2065
|
+
else if (!strcmp(model, "D5000") ||
|
|
2066
|
+
!strcmp(model, "D90"))
|
|
2067
|
+
{
|
|
2068
|
+
width -= 42;
|
|
2069
|
+
}
|
|
2070
|
+
else if (!strcmp(model, "D5100") ||
|
|
2071
|
+
!strcmp(model, "D7000") ||
|
|
2072
|
+
!strcmp(model, "COOLPIX A"))
|
|
2073
|
+
{
|
|
2074
|
+
width -= 44;
|
|
2075
|
+
}
|
|
2076
|
+
else if (!strcmp(model, "D3200") ||
|
|
2077
|
+
!strcmp(model, "D600") ||
|
|
2078
|
+
!strcmp(model, "D610") ||
|
|
2079
|
+
!strncmp(model, "D800", 4)) // Nikons: D800, D800E
|
|
2080
|
+
{
|
|
2081
|
+
width -= 46;
|
|
2082
|
+
}
|
|
2083
|
+
else if (!strcmp(model, "D4") ||
|
|
2084
|
+
!strcmp(model, "Df"))
|
|
2085
|
+
{
|
|
2086
|
+
width -= 52;
|
|
2087
|
+
left_margin = 2;
|
|
2088
|
+
}
|
|
2089
|
+
else if (!strcmp(model, "D500"))
|
|
2090
|
+
{
|
|
2091
|
+
// Empty - to avoid width-1 below
|
|
2092
|
+
}
|
|
2093
|
+
else if (!strncmp(model, "D40", 3) ||
|
|
2094
|
+
!strncmp(model, "D50", 3) ||
|
|
2095
|
+
!strncmp(model, "D70", 3))
|
|
2096
|
+
{
|
|
2097
|
+
width--;
|
|
2098
|
+
}
|
|
2099
|
+
else if (!strcmp(model, "D100"))
|
|
2100
|
+
{
|
|
2101
|
+
if (load_flags) // compressed NEF
|
|
2102
|
+
raw_width = (width += 3) + 3;
|
|
2103
|
+
}
|
|
2104
|
+
else if (!strcmp(model, "D200"))
|
|
2105
|
+
{
|
|
2106
|
+
left_margin = 1;
|
|
2107
|
+
width -= 4;
|
|
2108
|
+
filters = 0x94949494;
|
|
2109
|
+
}
|
|
2110
|
+
else if (!strncmp(model, "D2H", 3)) // Nikons: D2H, D2Hs
|
|
2111
|
+
{
|
|
2112
|
+
left_margin = 6;
|
|
2113
|
+
width -= 14;
|
|
2114
|
+
}
|
|
2115
|
+
else if (!strncmp(model, "D2X", 3)) // Nikons: D2X, D2Xs
|
|
2116
|
+
{
|
|
2117
|
+
if (width == 3264) // in-camera Hi-speed crop: On
|
|
2118
|
+
width -= 32;
|
|
2119
|
+
else
|
|
2120
|
+
width -= 8;
|
|
2121
|
+
}
|
|
2122
|
+
else if (!strncmp(model, "D300", 4)) // Nikons: D300, D300s
|
|
2123
|
+
{
|
|
2124
|
+
width -= 32;
|
|
2125
|
+
}
|
|
2126
|
+
else if (raw_width == 4032) // Nikon "COOLPIX P7700", "COOLPIX P7800",
|
|
2127
|
+
// "COOLPIX P330", "COOLPIX P340"
|
|
2128
|
+
{
|
|
2129
|
+
if (!strcmp(normalized_model, "COOLPIX P7700"))
|
|
2130
|
+
{
|
|
2131
|
+
maximum = 65504;
|
|
2132
|
+
load_flags = 0;
|
|
2133
|
+
}
|
|
2134
|
+
else if (!strcmp(normalized_model, "COOLPIX P7800"))
|
|
2135
|
+
{
|
|
2136
|
+
maximum = 65504;
|
|
2137
|
+
load_flags = 0;
|
|
2138
|
+
}
|
|
2139
|
+
else if (!strcmp(model, "COOLPIX P340"))
|
|
2140
|
+
{
|
|
2141
|
+
load_flags = 0;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
else if (!strncmp(model, "COOLPIX P", 9) &&
|
|
2145
|
+
raw_width != 4032) // Nikon "COOLPIX P1000", "COOLPIX P6000",
|
|
2146
|
+
// "COOLPIX P7000", "COOLPIX P7100"
|
|
2147
|
+
{
|
|
2148
|
+
load_flags = 24;
|
|
2149
|
+
filters = 0x94949494;
|
|
2150
|
+
/* the following 'if' is most probably obsolete, because we now read black
|
|
2151
|
+
* level from metadata */
|
|
2152
|
+
if ((model[9] == '7') && /* P7000, P7100 */
|
|
2153
|
+
((iso_speed >= 400) || (iso_speed == 0)) &&
|
|
2154
|
+
!strstr(software, "V1.2")) /* v. 1.2 seen for P7000 only */
|
|
2155
|
+
black = 255;
|
|
2156
|
+
}
|
|
2157
|
+
else if (!strncmp(model, "COOLPIX B700", 12))
|
|
2158
|
+
{
|
|
2159
|
+
load_flags = 24;
|
|
2160
|
+
}
|
|
2161
|
+
else if (!strncmp(model, "1 ",
|
|
2162
|
+
2)) // Nikons: "1 AW1", "1 J1", "1 J2", "1 J3", "1 J4",
|
|
2163
|
+
// "1 J5", "1 S1", "1 S2", "1 V1", "1 V2", "1 V3"
|
|
2164
|
+
{
|
|
2165
|
+
height -= 2;
|
|
2166
|
+
}
|
|
2167
|
+
else if (fsize == 1581060) // hack Nikon 1mpix: E900
|
|
2168
|
+
{
|
|
2169
|
+
simple_coeff(3);
|
|
2170
|
+
pre_mul[0] = 1.2085f;
|
|
2171
|
+
pre_mul[1] = 1.0943f;
|
|
2172
|
+
pre_mul[3] = 1.1103f;
|
|
2173
|
+
}
|
|
2174
|
+
else if ((fsize == 4771840) && // hack Nikon 3mpix: E880, E885, E990
|
|
2175
|
+
strcmp(model, "E995")) // but not E995
|
|
2176
|
+
{
|
|
2177
|
+
filters = 0xb4b4b4b4;
|
|
2178
|
+
simple_coeff(3);
|
|
2179
|
+
pre_mul[0] = 1.196f;
|
|
2180
|
+
pre_mul[1] = 1.246f;
|
|
2181
|
+
pre_mul[2] = 1.018f;
|
|
2182
|
+
}
|
|
2183
|
+
else if ((fsize == 4775936) && // hack Nikon 3mpix: E3100, E3200, E3500
|
|
2184
|
+
(atoi(model + 1) < 3700)) // but not E3700;
|
|
2185
|
+
{
|
|
2186
|
+
filters = 0x49494949;
|
|
2187
|
+
}
|
|
2188
|
+
else if (fsize == 5869568) // hack Nikon 4mpix: E4300;
|
|
2189
|
+
{
|
|
2190
|
+
load_flags = 6;
|
|
2191
|
+
}
|
|
2192
|
+
else if (!strcmp(model, "E2500"))
|
|
2193
|
+
{
|
|
2194
|
+
height -= 2;
|
|
2195
|
+
load_flags = 6;
|
|
2196
|
+
colors = 4;
|
|
2197
|
+
filters = 0x4b4b4b4b;
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Olympus)) {
|
|
2202
|
+
if (OlyID == OlyID_C_740UZ) { // (fsize == 4775936)
|
|
2203
|
+
i = find_green(12, 32, 1188864, 3576832);
|
|
2204
|
+
c = find_green(12, 32, 2383920, 2387016);
|
|
2205
|
+
if (abs(i) < abs(c)) {
|
|
2206
|
+
SWAP(i, c);
|
|
2207
|
+
load_flags = 24;
|
|
2208
|
+
}
|
|
2209
|
+
if (i < 0)
|
|
2210
|
+
filters = 0x61616161;
|
|
2211
|
+
}
|
|
2212
|
+
else if (OlyID == OlyID_C_770UZ) {
|
|
2213
|
+
height = 1718;
|
|
2214
|
+
width = 2304;
|
|
2215
|
+
filters = 0x16161616;
|
|
2216
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
2217
|
+
load_flags = 30;
|
|
2218
|
+
}
|
|
2219
|
+
else {
|
|
2220
|
+
height += height & 1;
|
|
2221
|
+
if (exif_cfa)
|
|
2222
|
+
filters = exif_cfa;
|
|
2223
|
+
|
|
2224
|
+
if (width == 4100) // Olympus E-PL2, E-PL1, E-P2, E-P1, E-620, E-600, E-5, E-30;
|
|
2225
|
+
width -= 4;
|
|
2226
|
+
|
|
2227
|
+
if (width == 4080) // Olympus E-PM1, E-PL3, E-P3;
|
|
2228
|
+
width -= 24;
|
|
2229
|
+
|
|
2230
|
+
if (width == 10400) // Olympus PEN-F, E-M1-II, E-M1-III, E-M1X, OM-1
|
|
2231
|
+
width -= 12;
|
|
2232
|
+
|
|
2233
|
+
if (width == 8200) // E-M1-III in 50Mp mode, E-M1X
|
|
2234
|
+
width -= 30;
|
|
2235
|
+
|
|
2236
|
+
if (width == 8180) // OM-1 in 50Mp
|
|
2237
|
+
width -= 10;
|
|
2238
|
+
|
|
2239
|
+
if (width == 9280) { // Olympus E-M5 Mark II;
|
|
2240
|
+
width -= 6;
|
|
2241
|
+
height -= 6;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
if (load_raw == &LibRaw::unpacked_load_raw) {
|
|
2245
|
+
load_flags = 4;
|
|
2246
|
+
if (imOly.ValidBits == 10) load_flags += 2;
|
|
2247
|
+
}
|
|
2248
|
+
tiff_bps = imOly.ValidBits;
|
|
2249
|
+
|
|
2250
|
+
if ((OlyID == OlyID_E_300) ||
|
|
2251
|
+
(OlyID == OlyID_E_500)) {
|
|
2252
|
+
width -= 20;
|
|
2253
|
+
if (load_raw == &LibRaw::unpacked_load_raw) {
|
|
2254
|
+
maximum = 0xfc3;
|
|
2255
|
+
memset(cblack, 0, sizeof cblack);
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
else if (OlyID == OlyID_STYLUS_1) {
|
|
2259
|
+
width -= 16;
|
|
2260
|
+
maximum = 0xfff;
|
|
2261
|
+
|
|
2262
|
+
}
|
|
2263
|
+
else if (OlyID == OlyID_E_330) {
|
|
2264
|
+
width -= 30;
|
|
2265
|
+
if (load_raw == &LibRaw::unpacked_load_raw)
|
|
2266
|
+
maximum = 0xf79;
|
|
2267
|
+
|
|
2268
|
+
}
|
|
2269
|
+
else if (OlyID == OlyID_SP_550UZ) {
|
|
2270
|
+
thumb_length = flen - (thumb_offset = 0xa39800);
|
|
2271
|
+
thumb_height = 480;
|
|
2272
|
+
thumb_width = 640;
|
|
2273
|
+
|
|
2274
|
+
}
|
|
2275
|
+
else if (OlyID == OlyID_TG_4) {
|
|
2276
|
+
width -= 16;
|
|
2277
|
+
|
|
2278
|
+
}
|
|
2279
|
+
else if ((OlyID == OlyID_TG_5) ||
|
|
2280
|
+
(OlyID == OlyID_TG_6)) {
|
|
2281
|
+
width -= 26;
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
}
|
|
2286
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_RoverShot) &&
|
|
2287
|
+
(fsize == 6291456)) { // RoverShot 3320AF
|
|
2288
|
+
fseek(ifp, 0x300000, SEEK_SET);
|
|
2289
|
+
if ((order = guess_byte_order(0x10000)) == 0x4d4d)
|
|
2290
|
+
{
|
|
2291
|
+
height -= (top_margin = 16);
|
|
2292
|
+
width -= (left_margin = 28);
|
|
2293
|
+
maximum = 0xf5c0;
|
|
2294
|
+
strcpy(make, "ISG");
|
|
2295
|
+
maker_index = LIBRAW_CAMERAMAKER_ISG;
|
|
2296
|
+
model[0] = 0;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
}
|
|
2300
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Fujifilm)) {
|
|
2301
|
+
if (!imFuji.RAFDataGeneration && (raw_width == 2944)) // S2Pro
|
|
2302
|
+
{
|
|
2303
|
+
height = 2144;
|
|
2304
|
+
width = 2880;
|
|
2305
|
+
flip = 6;
|
|
2306
|
+
}
|
|
2307
|
+
else if (load_raw != &LibRaw::packed_load_raw &&
|
|
2308
|
+
strncmp(model, "X-", 2) &&
|
|
2309
|
+
filters >= 1000) // Bayer and not an X-model
|
|
2310
|
+
maximum = (is_raw == 2 && shot_select) ? 0x2f00 : 0x3e00;
|
|
2311
|
+
|
|
2312
|
+
if (!FujiCropMode && imFuji.RAFDataGeneration && (imFuji.RAFDataGeneration != 4096))
|
|
2313
|
+
{
|
|
2314
|
+
width = imFuji.RAFData_ImageSizeTable[0];
|
|
2315
|
+
height = imFuji.RAFData_ImageSizeTable[1];
|
|
2316
|
+
}
|
|
2317
|
+
else if (FujiCropMode == 1) // FF crop on GFX
|
|
2318
|
+
{
|
|
2319
|
+
width = raw_width;
|
|
2320
|
+
height = raw_height;
|
|
2321
|
+
}
|
|
2322
|
+
// Do we need set height = raw_height for CropMode == 2 for all cameras??
|
|
2323
|
+
else if (FujiCropMode == 4) // electronic shutter, high speed mode (1.25x crop)
|
|
2324
|
+
{
|
|
2325
|
+
height = raw_height;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
top_margin = (raw_height >= height) ? (raw_height - height) >> 2 << 1 : 0;
|
|
2329
|
+
left_margin = (raw_width >= width) ? (raw_width - width) >> 2 << 1 : 0;
|
|
2330
|
+
|
|
2331
|
+
if (imFuji.RAFDataGeneration && (imFuji.RAFDataGeneration != 4096)) {
|
|
2332
|
+
switch (raw_width) {
|
|
2333
|
+
case 2944: // X-S1, X10, XF1
|
|
2334
|
+
filters = 0x16161616;
|
|
2335
|
+
break;
|
|
2336
|
+
case 4096: // X20, X30, XQ1, XQ2
|
|
2337
|
+
case 5120: // X-Pro1, X-E1, X-A1, X-A2, X-M1
|
|
2338
|
+
case 6048: // lossless compressed X100F, X-T2, X-T20, X-Pro2, X-H1, X-E3
|
|
2339
|
+
case 6160: // uncompressed (unpacked) X100F, X-T2, X-T20, X-Pro2, X-H1, X-E3
|
|
2340
|
+
left_margin = 0;
|
|
2341
|
+
break;
|
|
2342
|
+
case 4992: // X-E2S, X-E2, X-T10, X-T1, X100S, X100T, X70
|
|
2343
|
+
left_margin = 4;
|
|
2344
|
+
break;
|
|
2345
|
+
case 6336: // X-H2S
|
|
2346
|
+
top_margin = 6;
|
|
2347
|
+
left_margin = 0;
|
|
2348
|
+
width = 6264;
|
|
2349
|
+
height = 4176;
|
|
2350
|
+
break;
|
|
2351
|
+
case 6384: // X-T3, X-T4, X100V, X-S10, X-T30, X-Pro3
|
|
2352
|
+
top_margin = 0;
|
|
2353
|
+
switch (FujiCropMode) {
|
|
2354
|
+
case 0: // no crop
|
|
2355
|
+
left_margin = 0;
|
|
2356
|
+
top_margin = 6;
|
|
2357
|
+
width = 6246;
|
|
2358
|
+
height = 4170;
|
|
2359
|
+
break;
|
|
2360
|
+
case 2: // sports finder mode
|
|
2361
|
+
left_margin = 624;
|
|
2362
|
+
width = 5004;
|
|
2363
|
+
height = raw_height;
|
|
2364
|
+
break;
|
|
2365
|
+
case 4: // electronic shutter, high speed mode (1.25x crop)
|
|
2366
|
+
left_margin = 624;
|
|
2367
|
+
width = 5004;
|
|
2368
|
+
break;
|
|
2369
|
+
}
|
|
2370
|
+
break;
|
|
2371
|
+
case 6912: // GFX 50S, GFX 50R; FF crop
|
|
2372
|
+
case 9216: // GFX 50S, GFX 50R; no crop
|
|
2373
|
+
left_margin = 0;
|
|
2374
|
+
top_margin = 0;
|
|
2375
|
+
break;
|
|
2376
|
+
case 8472: // GFX 50S II
|
|
2377
|
+
left_margin = 0;
|
|
2378
|
+
top_margin = 0;
|
|
2379
|
+
width = raw_width - 192;
|
|
2380
|
+
break;
|
|
2381
|
+
case 9696: // GFX 100; FF crop
|
|
2382
|
+
case 11808: // GFX 100; no crop
|
|
2383
|
+
left_margin = 0;
|
|
2384
|
+
width = raw_width - 146;
|
|
2385
|
+
height = raw_height - (top_margin = 2);
|
|
2386
|
+
if (tiff_bps == 16)
|
|
2387
|
+
maximum = 0xffff;
|
|
2388
|
+
default:
|
|
2389
|
+
/* insert model name-based width/height/margins/etc. assignments */
|
|
2390
|
+
break;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
} else if (!imFuji.RAFDataGeneration) {
|
|
2394
|
+
switch (raw_width) {
|
|
2395
|
+
case 2304: // S5100
|
|
2396
|
+
height -= (top_margin = 6);
|
|
2397
|
+
break;
|
|
2398
|
+
case 3328: // F550EXR, F600EXR, F770EXR, F800EXR, F900EXR,
|
|
2399
|
+
// HS20EXR, HS30EXR, HS33EXR, HS50EXR
|
|
2400
|
+
if ((width = raw_width - 66))
|
|
2401
|
+
left_margin = 34;
|
|
2402
|
+
if (imgdata.sizes.raw_inset_crops[0].cleft == 8) // HS50EXR, F900EXR
|
|
2403
|
+
{
|
|
2404
|
+
left_margin = 0;
|
|
2405
|
+
width += 2;
|
|
2406
|
+
filters = 0x16161616;
|
|
2407
|
+
}
|
|
2408
|
+
break;
|
|
2409
|
+
case 3664: // "HS10 HS11"
|
|
2410
|
+
filters = 0x16161616;
|
|
2411
|
+
break;
|
|
2412
|
+
case 5504: // DBP for GX680 aka DX-2000
|
|
2413
|
+
|
|
2414
|
+
// 7712 2752 -> 5504 3856
|
|
2415
|
+
// width = 688;
|
|
2416
|
+
// height = 30848;
|
|
2417
|
+
// raw_width = 688;
|
|
2418
|
+
// raw_height = 30848;
|
|
2419
|
+
|
|
2420
|
+
left_margin = 32; // imgdata.sizes.raw_inset_crops[0].cleft
|
|
2421
|
+
top_margin = 8;
|
|
2422
|
+
width = raw_width - 2*left_margin;
|
|
2423
|
+
height = raw_height - 2*top_margin;
|
|
2424
|
+
|
|
2425
|
+
load_raw = &LibRaw::unpacked_load_raw_FujiDBP;
|
|
2426
|
+
// maximum = 0x0fff;
|
|
2427
|
+
filters = 0x16161616;
|
|
2428
|
+
load_flags = 0;
|
|
2429
|
+
flip = 6;
|
|
2430
|
+
break;
|
|
2431
|
+
default:
|
|
2432
|
+
/* insert model name-based width/height/margins/etc. assignments */
|
|
2433
|
+
break;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
if (fuji_layout)
|
|
2437
|
+
raw_width *= is_raw;
|
|
2438
|
+
if (filters == 9)
|
|
2439
|
+
FORC(36)
|
|
2440
|
+
((char *)xtrans)[c] =
|
|
2441
|
+
xtrans_abs[(c / 6 + top_margin) % 6][(c + left_margin) % 6];
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Konica)) {
|
|
2445
|
+
if (!strcmp(model, "KD-400Z")) {
|
|
2446
|
+
height = 1711; // 1712
|
|
2447
|
+
width = 2312;
|
|
2448
|
+
raw_width = 2336;
|
|
2449
|
+
goto konica_400z;
|
|
2450
|
+
}
|
|
2451
|
+
else if (!strcmp(model, "KD-510Z")) {
|
|
2452
|
+
goto konica_510z;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
}
|
|
2456
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Minolta)) {
|
|
2457
|
+
if (fsize == 5869568) { // hack "DiMAGE Z2"
|
|
2458
|
+
load_flags = 30;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
if (imSony.prd_StorageMethod == LIBRAW_MINOLTA_UNPACKED) {
|
|
2462
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2463
|
+
} else if (imSony.prd_StorageMethod == LIBRAW_MINOLTA_PACKED) {
|
|
2464
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
2465
|
+
} else if (!load_raw && (maximum = 0xfff)) {
|
|
2466
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
if (imSony.prd_BayerPattern == LIBRAW_MINOLTA_G2BRG1) {
|
|
2470
|
+
filters = 0x49494949;
|
|
2471
|
+
} else if (imSony.prd_BayerPattern == LIBRAW_MINOLTA_RGGB) {
|
|
2472
|
+
filters = 0x94949494;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
if (imSony.prd_Active_bps && imSony.prd_Total_bps) {
|
|
2476
|
+
tiff_bps = imSony.prd_Active_bps;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
if (!strncmp(model, "DiMAGE G", 8)) // hack "DiMAGE G400", "DiMAGE G500",
|
|
2480
|
+
// "DiMAGE G530", "DiMAGE G600"
|
|
2481
|
+
{
|
|
2482
|
+
if (model[8] == '4') // DiMAGE G400
|
|
2483
|
+
{
|
|
2484
|
+
height = 1716;
|
|
2485
|
+
width = 2304;
|
|
2486
|
+
}
|
|
2487
|
+
else if (model[8] == '5') // DiMAGE G500 / G530
|
|
2488
|
+
{
|
|
2489
|
+
konica_510z:
|
|
2490
|
+
height = 1956;
|
|
2491
|
+
width = 2607;
|
|
2492
|
+
raw_width = 2624;
|
|
2493
|
+
}
|
|
2494
|
+
else if (model[8] == '6') // DiMAGE G600
|
|
2495
|
+
{
|
|
2496
|
+
height = 2136;
|
|
2497
|
+
width = 2848;
|
|
2498
|
+
}
|
|
2499
|
+
data_offset += 14;
|
|
2500
|
+
filters = 0x61616161;
|
|
2501
|
+
konica_400z:
|
|
2502
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2503
|
+
maximum = 0x3df;
|
|
2504
|
+
order = 0x4d4d;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
}
|
|
2508
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Samsung)) {
|
|
2509
|
+
if (raw_width == 4704) // Samsung NX100, NX10, NX11,
|
|
2510
|
+
{
|
|
2511
|
+
height -= top_margin = 8;
|
|
2512
|
+
width -= 2 * (left_margin = 8);
|
|
2513
|
+
load_flags = 32;
|
|
2514
|
+
}
|
|
2515
|
+
else if (!strcmp(model, "NX3000")) // Samsung NX3000; raw_width: 5600
|
|
2516
|
+
{
|
|
2517
|
+
top_margin = 38;
|
|
2518
|
+
left_margin = 92;
|
|
2519
|
+
width = 5456;
|
|
2520
|
+
height = 3634;
|
|
2521
|
+
filters = 0x61616161;
|
|
2522
|
+
colors = 3;
|
|
2523
|
+
}
|
|
2524
|
+
else if (raw_height == 3714) // Samsung NX2000, NX300M, NX300, NX30,
|
|
2525
|
+
// "NX U" (aka:
|
|
2526
|
+
// "EK-GN100", "EK-GN110", "EK-GN120",
|
|
2527
|
+
// "EK-KN120", "Galaxy NX")
|
|
2528
|
+
{
|
|
2529
|
+
height -= top_margin = 18;
|
|
2530
|
+
left_margin = raw_width - (width = 5536);
|
|
2531
|
+
if (raw_width != 5600)
|
|
2532
|
+
left_margin = top_margin = 0;
|
|
2533
|
+
filters = 0x61616161;
|
|
2534
|
+
colors = 3;
|
|
2535
|
+
}
|
|
2536
|
+
else if (raw_width == 5632) // Samsung NX1000, NX200, NX20, NX210
|
|
2537
|
+
{
|
|
2538
|
+
order = 0x4949;
|
|
2539
|
+
height = 3694;
|
|
2540
|
+
top_margin = 2;
|
|
2541
|
+
width = 5574 - (left_margin = 32 + tiff_bps);
|
|
2542
|
+
if (tiff_bps == 12)
|
|
2543
|
+
load_flags = 80;
|
|
2544
|
+
}
|
|
2545
|
+
else if (raw_width == 5664) // Samsung "NX mini"
|
|
2546
|
+
{
|
|
2547
|
+
height -= top_margin = 17;
|
|
2548
|
+
left_margin = 96;
|
|
2549
|
+
width = 5544;
|
|
2550
|
+
filters = 0x49494949;
|
|
2551
|
+
}
|
|
2552
|
+
else if (raw_width == 6496) // Samsung NX1, NX500
|
|
2553
|
+
{
|
|
2554
|
+
filters = 0x61616161;
|
|
2555
|
+
if (!black && !cblack[0] && !cblack[1] && !cblack[2] && !cblack[3])
|
|
2556
|
+
black = 1 << (tiff_bps - 7);
|
|
2557
|
+
}
|
|
2558
|
+
else if (!strcmp(normalized_model, "EX1")) // Samsung EX1; raw_width: 3688
|
|
2559
|
+
{
|
|
2560
|
+
order = 0x4949;
|
|
2561
|
+
height -= 20;
|
|
2562
|
+
top_margin = 2;
|
|
2563
|
+
if ((width -= 6) > 3682)
|
|
2564
|
+
{
|
|
2565
|
+
height -= 10;
|
|
2566
|
+
width -= 46;
|
|
2567
|
+
top_margin = 8;
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
else if (!strcmp(normalized_model, "WB2000")) // Samsung WB2000; raw_width: 3728
|
|
2571
|
+
{
|
|
2572
|
+
order = 0x4949;
|
|
2573
|
+
height -= 3;
|
|
2574
|
+
top_margin = 2;
|
|
2575
|
+
if ((width -= 10) > 3718)
|
|
2576
|
+
{
|
|
2577
|
+
height -= 28;
|
|
2578
|
+
width -= 56;
|
|
2579
|
+
top_margin = 8;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
else if (!strcmp(model, "WB550")) // Samsung WB550; raw_width: 4000
|
|
2583
|
+
{
|
|
2584
|
+
order = 0x4949;
|
|
2585
|
+
}
|
|
2586
|
+
else if (!strcmp(model, "EX2F")) // Samsung EX2F; raw_width: 4176
|
|
2587
|
+
{
|
|
2588
|
+
height = 3030;
|
|
2589
|
+
width = 4040;
|
|
2590
|
+
top_margin = 15;
|
|
2591
|
+
left_margin = 24;
|
|
2592
|
+
order = 0x4949;
|
|
2593
|
+
filters = 0x49494949;
|
|
2594
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_ST_Micro) && !strcmp(model, "STV680 VGA"))
|
|
2599
|
+
{
|
|
2600
|
+
black = 16;
|
|
2601
|
+
}
|
|
2602
|
+
else if (!strcmp(model, "N95"))
|
|
2603
|
+
{
|
|
2604
|
+
height = raw_height - (top_margin = 2);
|
|
2605
|
+
}
|
|
2606
|
+
else if (!strcmp(model, "640x480"))
|
|
2607
|
+
{
|
|
2608
|
+
gamma_curve(0.45, 4.5, 1, 255);
|
|
2609
|
+
}
|
|
2610
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Hasselblad))
|
|
2611
|
+
{
|
|
2612
|
+
if (load_raw == &LibRaw::lossless_jpeg_load_raw)
|
|
2613
|
+
load_raw = &LibRaw::hasselblad_load_raw;
|
|
2614
|
+
|
|
2615
|
+
if ((imHassy.SensorCode == 4) && !strncmp(model, "V96C", 4)) { // Hasselblad V96C
|
|
2616
|
+
strcpy(model, "V96C");
|
|
2617
|
+
strcpy(normalized_model, model);
|
|
2618
|
+
height -= (top_margin = 6);
|
|
2619
|
+
width -= (left_margin = 3) + 7;
|
|
2620
|
+
filters = 0x61616161;
|
|
2621
|
+
|
|
2622
|
+
}
|
|
2623
|
+
else if ((imHassy.SensorCode == 9) && imHassy.uncropped) { // various Hasselblad '-39'
|
|
2624
|
+
height = 5444;
|
|
2625
|
+
width = 7248;
|
|
2626
|
+
top_margin = 4;
|
|
2627
|
+
left_margin = 7;
|
|
2628
|
+
filters = 0x61616161;
|
|
2629
|
+
|
|
2630
|
+
}
|
|
2631
|
+
else if ((imHassy.SensorCode == 13) && imHassy.uncropped) { // Hasselblad H4D-40, H5D-40
|
|
2632
|
+
height -= 84;
|
|
2633
|
+
width -= 82;
|
|
2634
|
+
top_margin = 4;
|
|
2635
|
+
left_margin = 41;
|
|
2636
|
+
filters = 0x61616161;
|
|
2637
|
+
|
|
2638
|
+
}
|
|
2639
|
+
else if ((imHassy.SensorCode == 11) && imHassy.uncropped) { // Hasselblad H5D-50
|
|
2640
|
+
height -= 84;
|
|
2641
|
+
width -= 82;
|
|
2642
|
+
top_margin = 4;
|
|
2643
|
+
left_margin = 41;
|
|
2644
|
+
filters = 0x61616161;
|
|
2645
|
+
|
|
2646
|
+
}
|
|
2647
|
+
else if ((imHassy.SensorCode == 15) &&
|
|
2648
|
+
!imHassy.SensorSubCode && // Hasselblad H5D-50c
|
|
2649
|
+
imHassy.uncropped) {
|
|
2650
|
+
left_margin = 52;
|
|
2651
|
+
top_margin = 100;
|
|
2652
|
+
width = 8272;
|
|
2653
|
+
height = 6200;
|
|
2654
|
+
black = 256;
|
|
2655
|
+
|
|
2656
|
+
}
|
|
2657
|
+
else if ((imHassy.SensorCode == 15) &&
|
|
2658
|
+
(imHassy.SensorSubCode == 2) && // various Hasselblad X1D cameras
|
|
2659
|
+
imHassy.uncropped) {
|
|
2660
|
+
top_margin = 96;
|
|
2661
|
+
height -= 96;
|
|
2662
|
+
left_margin = 48;
|
|
2663
|
+
width -= 106;
|
|
2664
|
+
maximum = 0xffff;
|
|
2665
|
+
tiff_bps = 16;
|
|
2666
|
+
|
|
2667
|
+
}
|
|
2668
|
+
else if ((imHassy.SensorCode == 12) && imHassy.uncropped) { // Hasselblad H4D-60
|
|
2669
|
+
if (black > 500) { // (imHassy.format == LIBRAW_HF_FFF)
|
|
2670
|
+
top_margin = 12;
|
|
2671
|
+
left_margin = 44;
|
|
2672
|
+
width = 8956;
|
|
2673
|
+
height = 6708;
|
|
2674
|
+
memset(cblack, 0, sizeof(cblack));
|
|
2675
|
+
black = 512;
|
|
2676
|
+
}
|
|
2677
|
+
else { // (imHassy.format == LIBRAW_HF_3FR)
|
|
2678
|
+
top_margin = 8;
|
|
2679
|
+
left_margin = 40;
|
|
2680
|
+
width = 8964;
|
|
2681
|
+
height = 6716;
|
|
2682
|
+
black += load_flags = 256;
|
|
2683
|
+
maximum = 0x8101;
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2686
|
+
}
|
|
2687
|
+
else if ((imHassy.SensorCode == 17) && imHassy.uncropped) { // Hasselblad H6D-100c, A6D-100c
|
|
2688
|
+
left_margin = 64;
|
|
2689
|
+
width = 11608;
|
|
2690
|
+
top_margin = 108;
|
|
2691
|
+
height = raw_height - top_margin;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
if (tiff_samples > 1)
|
|
2695
|
+
{
|
|
2696
|
+
is_raw = tiff_samples + 1;
|
|
2697
|
+
if (!shot_select && !half_size)
|
|
2698
|
+
filters = 0;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Sinar))
|
|
2702
|
+
{
|
|
2703
|
+
if (!load_raw)
|
|
2704
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2705
|
+
if (is_raw > 1 && !shot_select)
|
|
2706
|
+
filters = 0;
|
|
2707
|
+
maximum = 0x3fff;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
if (load_raw == &LibRaw::sinar_4shot_load_raw)
|
|
2711
|
+
{
|
|
2712
|
+
if (is_raw > 1 && !shot_select)
|
|
2713
|
+
filters = 0;
|
|
2714
|
+
}
|
|
2715
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Leaf))
|
|
2716
|
+
{
|
|
2717
|
+
maximum = 0x3fff;
|
|
2718
|
+
fseek(ifp, data_offset, SEEK_SET);
|
|
2719
|
+
if (ljpeg_start(&jh, 1) && jh.bits == 15)
|
|
2720
|
+
maximum = 0x1fff;
|
|
2721
|
+
if (tiff_samples > 1)
|
|
2722
|
+
filters = 0;
|
|
2723
|
+
if (tiff_samples > 1 || tile_length < raw_height)
|
|
2724
|
+
{
|
|
2725
|
+
load_raw = &LibRaw::leaf_hdr_load_raw;
|
|
2726
|
+
raw_width = tile_width;
|
|
2727
|
+
}
|
|
2728
|
+
if ((width | height) == 2048)
|
|
2729
|
+
{
|
|
2730
|
+
if (tiff_samples == 1)
|
|
2731
|
+
{
|
|
2732
|
+
filters = 1;
|
|
2733
|
+
strcpy(cdesc, "RBTG");
|
|
2734
|
+
strcpy(model, "CatchLight");
|
|
2735
|
+
strcpy(normalized_model, model);
|
|
2736
|
+
top_margin = 8;
|
|
2737
|
+
left_margin = 18;
|
|
2738
|
+
height = 2032;
|
|
2739
|
+
width = 2016;
|
|
2740
|
+
}
|
|
2741
|
+
else
|
|
2742
|
+
{
|
|
2743
|
+
strcpy(model, "DCB2");
|
|
2744
|
+
strcpy(normalized_model, model);
|
|
2745
|
+
top_margin = 10;
|
|
2746
|
+
left_margin = 16;
|
|
2747
|
+
height = 2028;
|
|
2748
|
+
width = 2022;
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
else if (width + height == 3144 + 2060)
|
|
2752
|
+
{
|
|
2753
|
+
if (!model[0])
|
|
2754
|
+
{
|
|
2755
|
+
strcpy(model, "Cantare");
|
|
2756
|
+
strcpy(normalized_model, model);
|
|
2757
|
+
}
|
|
2758
|
+
if (width > height)
|
|
2759
|
+
{
|
|
2760
|
+
top_margin = 6;
|
|
2761
|
+
left_margin = 32;
|
|
2762
|
+
height = 2048;
|
|
2763
|
+
width = 3072;
|
|
2764
|
+
filters = 0x61616161;
|
|
2765
|
+
}
|
|
2766
|
+
else
|
|
2767
|
+
{
|
|
2768
|
+
left_margin = 6;
|
|
2769
|
+
top_margin = 32;
|
|
2770
|
+
width = 2048;
|
|
2771
|
+
height = 3072;
|
|
2772
|
+
filters = 0x16161616;
|
|
2773
|
+
}
|
|
2774
|
+
if (!cam_mul[0] || model[0] == 'V')
|
|
2775
|
+
filters = 0;
|
|
2776
|
+
else
|
|
2777
|
+
is_raw = tiff_samples;
|
|
2778
|
+
}
|
|
2779
|
+
else if (width == 2116) // Leaf "Valeo 6"
|
|
2780
|
+
{
|
|
2781
|
+
strcpy(model, "Valeo 6");
|
|
2782
|
+
strcpy(normalized_model, model);
|
|
2783
|
+
height -= 2 * (top_margin = 30);
|
|
2784
|
+
width -= 2 * (left_margin = 55);
|
|
2785
|
+
filters = 0x49494949;
|
|
2786
|
+
}
|
|
2787
|
+
else if (width == 3171) // Leaf "Valeo 6"
|
|
2788
|
+
{
|
|
2789
|
+
strcpy(model, "Valeo 6");
|
|
2790
|
+
strcpy(normalized_model, model);
|
|
2791
|
+
height -= 2 * (top_margin = 24);
|
|
2792
|
+
width -= 2 * (left_margin = 24);
|
|
2793
|
+
filters = 0x16161616;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Panasonic))
|
|
2797
|
+
{
|
|
2798
|
+
if (raw_width > 0 &&
|
|
2799
|
+
((flen - data_offset) / (raw_width * 8 / 7) == raw_height))
|
|
2800
|
+
load_raw = &LibRaw::panasonic_load_raw;
|
|
2801
|
+
if (!load_raw)
|
|
2802
|
+
{
|
|
2803
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
2804
|
+
load_flags = 4;
|
|
2805
|
+
}
|
|
2806
|
+
zero_is_bad = 1;
|
|
2807
|
+
if ((height += 12) > raw_height)
|
|
2808
|
+
height = raw_height;
|
|
2809
|
+
for (i = 0; i < int(sizeof pana / sizeof *pana); i++)
|
|
2810
|
+
if (raw_width == pana[i][0] && raw_height == pana[i][1])
|
|
2811
|
+
{
|
|
2812
|
+
left_margin = pana[i][2];
|
|
2813
|
+
top_margin = pana[i][3];
|
|
2814
|
+
width += pana[i][4];
|
|
2815
|
+
height += pana[i][5];
|
|
2816
|
+
}
|
|
2817
|
+
if (!tiff_bps && pana_bpp >= 12 && pana_bpp <= 14)
|
|
2818
|
+
tiff_bps = pana_bpp;
|
|
2819
|
+
|
|
2820
|
+
if (!strcmp(model, "DC-LX100M2") && raw_height == 3568 && raw_width == 4816 && filters == 3)
|
|
2821
|
+
filters = 4;
|
|
2822
|
+
|
|
2823
|
+
filters = 0x01010101U *
|
|
2824
|
+
(uchar) "\x94\x61\x49\x16"[((filters - 1) ^ (left_margin & 1) ^
|
|
2825
|
+
(top_margin << 1)) &
|
|
2826
|
+
3];
|
|
2827
|
+
|
|
2828
|
+
}
|
|
2829
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Contax) &&
|
|
2830
|
+
!strcmp(model, "N Digital")) {
|
|
2831
|
+
height = 2047;
|
|
2832
|
+
width = 3072;
|
|
2833
|
+
filters = 0x61616161;
|
|
2834
|
+
data_offset = 0x1a00;
|
|
2835
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
2836
|
+
|
|
2837
|
+
}
|
|
2838
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Sony)) {
|
|
2839
|
+
if (!strcmp(model, "DSC-F828")) { // Sony DSC-F828
|
|
2840
|
+
width = 3288;
|
|
2841
|
+
left_margin = 5;
|
|
2842
|
+
mask[1][3] = -17;
|
|
2843
|
+
data_offset = 862144;
|
|
2844
|
+
load_raw = &LibRaw::sony_load_raw;
|
|
2845
|
+
filters = 0x9c9c9c9c;
|
|
2846
|
+
colors = 4;
|
|
2847
|
+
strcpy(cdesc, "RGBE");
|
|
2848
|
+
|
|
2849
|
+
}
|
|
2850
|
+
else if (!strcmp(model, "DSC-V3")) { // Sony DSC-V3
|
|
2851
|
+
width = 3109;
|
|
2852
|
+
left_margin = 59;
|
|
2853
|
+
mask[0][1] = 9;
|
|
2854
|
+
data_offset = 787392;
|
|
2855
|
+
load_raw = &LibRaw::sony_load_raw;
|
|
2856
|
+
|
|
2857
|
+
}
|
|
2858
|
+
else if (raw_width == 3984) { // Sony DSC-R1;
|
|
2859
|
+
width = 3925;
|
|
2860
|
+
order = 0x4d4d;
|
|
2861
|
+
|
|
2862
|
+
}
|
|
2863
|
+
else if (raw_width == 4288) { // Sony ILCE-7S, ILCE-7SM2, ILCE-7SM3, DSLR-A700, DSLR-A500;
|
|
2864
|
+
width -= 32;
|
|
2865
|
+
}
|
|
2866
|
+
else if (raw_width == 4600) { // Sony DSLR-A290, DSLR-A350, DSLR-A380;
|
|
2867
|
+
if (!strcmp(model, "DSLR-A350"))
|
|
2868
|
+
height -= 4;
|
|
2869
|
+
black = 0;
|
|
2870
|
+
|
|
2871
|
+
}
|
|
2872
|
+
else if (raw_width == 4928) {
|
|
2873
|
+
// Sony DSLR-A580, NEX-C3, SLT-A35, DSC-HX99, SLT-A55,
|
|
2874
|
+
// NEX-5N, SLT-A37, SLT-A57, NEX-F3, NEX-6, NEX-5R, NEX-3N, NEX-5T;
|
|
2875
|
+
if (height < 3280)
|
|
2876
|
+
width -= 8;
|
|
2877
|
+
|
|
2878
|
+
}
|
|
2879
|
+
else if (raw_width == 5504) {
|
|
2880
|
+
// Sony ILCE-3000, SLT-A58, DSC-RX100M3, ILCE-QX1,
|
|
2881
|
+
// DSC-RX10M4, DSC-RX100M6, DSC-RX100, DSC-RX100M2, DSC-RX10,
|
|
2882
|
+
// ILCE-5000, DSC-RX100M4, DSC-RX10M2, DSC-RX10M3,
|
|
2883
|
+
// DSC-RX100M5, DSC-RX100M5A;
|
|
2884
|
+
width -= height > 3664 ? 8 : 32;
|
|
2885
|
+
|
|
2886
|
+
}
|
|
2887
|
+
else if (raw_width == 6048) {
|
|
2888
|
+
// Sony SLT-A65, DSC-RX1, SLT-A77, DSC-RX1, ILCA-77M2,
|
|
2889
|
+
// ILCE-7M3, NEX-7, SLT-A99, ILCE-7, DSC-RX1R, ILCE-6000,
|
|
2890
|
+
// ILCE-5100, ILCE-7M2, ILCA-68, ILCE-6300, ILCE-9,
|
|
2891
|
+
// ILCE-6500, ILCE-6400;
|
|
2892
|
+
width -= 24;
|
|
2893
|
+
if (strstr(normalized_model, "RX1") ||
|
|
2894
|
+
strstr(normalized_model, "A99"))
|
|
2895
|
+
width -= 6;
|
|
2896
|
+
|
|
2897
|
+
}
|
|
2898
|
+
else if (raw_width == 7392) { // Sony ILCE-7R;
|
|
2899
|
+
width -= 30;
|
|
2900
|
+
|
|
2901
|
+
}
|
|
2902
|
+
else if (raw_width == 8000) {
|
|
2903
|
+
// Sony ILCE-7RM2, ILCE-7RM2, ILCE-7RM3, DSC-RX1RM2, ILCA-99M2;
|
|
2904
|
+
width -= 32;
|
|
2905
|
+
|
|
2906
|
+
}
|
|
2907
|
+
else if (raw_width == 9600) { // Sony ILCE-7RM4
|
|
2908
|
+
width -= 32;
|
|
2909
|
+
|
|
2910
|
+
}
|
|
2911
|
+
else if(unique_id == SonyID_ILCE_1)
|
|
2912
|
+
{
|
|
2913
|
+
if (raw_width == 8704 && raw_height == 6144) // ILCE-1 FF@Compressed
|
|
2914
|
+
{
|
|
2915
|
+
width = 8660;
|
|
2916
|
+
height = 5784;
|
|
2917
|
+
}
|
|
2918
|
+
else if (raw_width == 8672) // FF uncompressed/lossy
|
|
2919
|
+
{
|
|
2920
|
+
width -= 12;
|
|
2921
|
+
}
|
|
2922
|
+
else if (raw_width == 6144 && raw_height == 4096) // APSC/Lossless
|
|
2923
|
+
{
|
|
2924
|
+
width = 5636;
|
|
2925
|
+
height = 3768;
|
|
2926
|
+
}
|
|
2927
|
+
else if (raw_width == 5664) // APS-C/Uncompressed or lossy
|
|
2928
|
+
{
|
|
2929
|
+
width -= 28;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
else if (unique_id == SonyID_ILCE_7M4)
|
|
2933
|
+
{
|
|
2934
|
+
if (raw_width == 7168 && raw_height == 5120) // ILCE-1 FF@Compressed
|
|
2935
|
+
{
|
|
2936
|
+
width = 7028;
|
|
2937
|
+
height = 4688;
|
|
2938
|
+
}
|
|
2939
|
+
else if (raw_width == 7040) // FF uncompressed/lossy
|
|
2940
|
+
{
|
|
2941
|
+
width -= 12;
|
|
2942
|
+
}
|
|
2943
|
+
/* FIXME: need APS-C samples, both losslesscompressed and uncompressed or lossy */
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
else if (!strcmp(model, "DSLR-A100")) {
|
|
2947
|
+
if (width == 3880) {
|
|
2948
|
+
height--;
|
|
2949
|
+
width = ++raw_width;
|
|
2950
|
+
}
|
|
2951
|
+
else {
|
|
2952
|
+
height -= 4;
|
|
2953
|
+
width -= 4;
|
|
2954
|
+
order = 0x4d4d;
|
|
2955
|
+
load_flags = 2;
|
|
2956
|
+
}
|
|
2957
|
+
filters = 0x61616161;
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
|
|
2961
|
+
else if (!strcmp(model, "PIXL")) {
|
|
2962
|
+
height -= top_margin = 4;
|
|
2963
|
+
width -= left_margin = 32;
|
|
2964
|
+
gamma_curve(0, 7, 1, 255);
|
|
2965
|
+
|
|
2966
|
+
}
|
|
2967
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Kodak)) {
|
|
2968
|
+
|
|
2969
|
+
if (!strncasecmp(model, "EasyShare", 9)) {
|
|
2970
|
+
data_offset = data_offset < 0x15000 ? 0x15000 : 0x17000;
|
|
2971
|
+
load_raw = &LibRaw::packed_load_raw;
|
|
2972
|
+
|
|
2973
|
+
}
|
|
2974
|
+
else if (!strcmp(model, "C603") ||
|
|
2975
|
+
!strcmp(model, "C330") ||
|
|
2976
|
+
!strcmp(model, "12MP")) {
|
|
2977
|
+
order = 0x4949;
|
|
2978
|
+
if (filters && data_offset) {
|
|
2979
|
+
fseek(ifp, data_offset < 4096 ? 168 : 5252, SEEK_SET);
|
|
2980
|
+
read_shorts(curve, 256);
|
|
2981
|
+
}
|
|
2982
|
+
else
|
|
2983
|
+
gamma_curve(0, 3.875, 1, 255);
|
|
2984
|
+
|
|
2985
|
+
load_raw = filters ? &LibRaw::eight_bit_load_raw
|
|
2986
|
+
: strcmp(model, "C330") ? &LibRaw::kodak_c603_load_raw
|
|
2987
|
+
: &LibRaw::kodak_c330_load_raw;
|
|
2988
|
+
load_flags = tiff_bps > 16;
|
|
2989
|
+
tiff_bps = 8;
|
|
2990
|
+
|
|
2991
|
+
}
|
|
2992
|
+
else {
|
|
2993
|
+
if (!strncmp(model, "NC2000", 6) ||
|
|
2994
|
+
!strncmp(model, "EOSDCS", 6) ||
|
|
2995
|
+
!strncmp(model, "DCS4", 4)) {
|
|
2996
|
+
width -= 4;
|
|
2997
|
+
left_margin = 2;
|
|
2998
|
+
|
|
2999
|
+
}
|
|
3000
|
+
else if (!strcmp(model, "DCS660M")) {
|
|
3001
|
+
black = 214;
|
|
3002
|
+
|
|
3003
|
+
}
|
|
3004
|
+
else if (!strcmp(model, "EOS D2000C")) {
|
|
3005
|
+
filters = 0x61616161;
|
|
3006
|
+
if (!black) black = curve[200];
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
if (filters == UINT_MAX) filters = 0x61616161;
|
|
3010
|
+
|
|
3011
|
+
if (!strcmp(model + 4, "20X"))
|
|
3012
|
+
strcpy(cdesc, "MYCY");
|
|
3013
|
+
if (!strcmp(model, "DC25")) {
|
|
3014
|
+
data_offset = 15424;
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
if (!strncmp(model, "DC2", 3)) {
|
|
3018
|
+
raw_height = 2 + (height = 242);
|
|
3019
|
+
if (!strncmp(model, "DC290", 5))
|
|
3020
|
+
iso_speed = 100;
|
|
3021
|
+
if (!strncmp(model, "DC280", 5))
|
|
3022
|
+
iso_speed = 70;
|
|
3023
|
+
if (flen < 100000) {
|
|
3024
|
+
raw_width = 256;
|
|
3025
|
+
width = 249;
|
|
3026
|
+
pixel_aspect = (4.0 * height) / (3.0 * width);
|
|
3027
|
+
}
|
|
3028
|
+
else {
|
|
3029
|
+
raw_width = 512;
|
|
3030
|
+
width = 501;
|
|
3031
|
+
pixel_aspect = (493.0 * height) / (373.0 * width);
|
|
3032
|
+
}
|
|
3033
|
+
top_margin = left_margin = 1;
|
|
3034
|
+
colors = 4;
|
|
3035
|
+
filters = 0x8d8d8d8d;
|
|
3036
|
+
simple_coeff(1);
|
|
3037
|
+
pre_mul[1] = 1.179f;
|
|
3038
|
+
pre_mul[2] = 1.209f;
|
|
3039
|
+
pre_mul[3] = 1.036f;
|
|
3040
|
+
load_raw = &LibRaw::eight_bit_load_raw;
|
|
3041
|
+
}
|
|
3042
|
+
else if (!strcmp(model, "DC40")) {
|
|
3043
|
+
height = 512;
|
|
3044
|
+
width = 768;
|
|
3045
|
+
data_offset = 1152;
|
|
3046
|
+
load_raw = &LibRaw::kodak_radc_load_raw;
|
|
3047
|
+
tiff_bps = 12;
|
|
3048
|
+
FORC4 cam_mul[c] = 1.0f;
|
|
3049
|
+
|
|
3050
|
+
}
|
|
3051
|
+
else if (!strcmp(model, "DC50")) {
|
|
3052
|
+
height = 512;
|
|
3053
|
+
width = 768;
|
|
3054
|
+
iso_speed = 84;
|
|
3055
|
+
data_offset = 19712;
|
|
3056
|
+
load_raw = &LibRaw::kodak_radc_load_raw;
|
|
3057
|
+
FORC4 cam_mul[c] = 1.0f;
|
|
3058
|
+
|
|
3059
|
+
}
|
|
3060
|
+
else if (!strcmp(model, "DC120")) {
|
|
3061
|
+
raw_height = height = 976;
|
|
3062
|
+
raw_width = width = 848;
|
|
3063
|
+
iso_speed = 160;
|
|
3064
|
+
pixel_aspect = height / 0.75 / width;
|
|
3065
|
+
load_raw = tiff_compress == 7 ? &LibRaw::kodak_jpeg_load_raw
|
|
3066
|
+
: &LibRaw::kodak_dc120_load_raw;
|
|
3067
|
+
|
|
3068
|
+
}
|
|
3069
|
+
else if (!strcmp(model, "DCS200")) {
|
|
3070
|
+
thumb_height = 128;
|
|
3071
|
+
thumb_width = 192;
|
|
3072
|
+
thumb_offset = 6144;
|
|
3073
|
+
thumb_misc = 360;
|
|
3074
|
+
iso_speed = 140;
|
|
3075
|
+
thumb_format = LIBRAW_INTERNAL_THUMBNAIL_LAYER;
|
|
3076
|
+
black = 17;
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
}
|
|
3081
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Logitech) &&
|
|
3082
|
+
!strcmp(model, "Fotoman Pixtura")) {
|
|
3083
|
+
height = 512;
|
|
3084
|
+
width = 768;
|
|
3085
|
+
data_offset = 3632;
|
|
3086
|
+
load_raw = &LibRaw::kodak_radc_load_raw;
|
|
3087
|
+
filters = 0x61616161;
|
|
3088
|
+
simple_coeff(2);
|
|
3089
|
+
|
|
3090
|
+
}
|
|
3091
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Apple) &&
|
|
3092
|
+
!strncmp(model, "QuickTake", 9)) {
|
|
3093
|
+
if (head[5]) {
|
|
3094
|
+
strcpy(model + 10, "200");
|
|
3095
|
+
strcpy(normalized_model, model);
|
|
3096
|
+
}
|
|
3097
|
+
fseek(ifp, 544, SEEK_SET);
|
|
3098
|
+
height = get2();
|
|
3099
|
+
width = get2();
|
|
3100
|
+
data_offset = (get4(), get2()) == 30 ? 738 : 736;
|
|
3101
|
+
if (height > width) {
|
|
3102
|
+
SWAP(height, width);
|
|
3103
|
+
fseek(ifp, data_offset - 6, SEEK_SET);
|
|
3104
|
+
flip = ~get2() & 3 ? 5 : 6;
|
|
3105
|
+
}
|
|
3106
|
+
filters = 0x61616161;
|
|
3107
|
+
|
|
3108
|
+
}
|
|
3109
|
+
else if (makeIs(LIBRAW_CAMERAMAKER_Rollei) &&
|
|
3110
|
+
!load_raw) {
|
|
3111
|
+
switch (raw_width) {
|
|
3112
|
+
case 1316: // Rollei d530flex
|
|
3113
|
+
height = 1030;
|
|
3114
|
+
width = 1300;
|
|
3115
|
+
top_margin = 1;
|
|
3116
|
+
left_margin = 6;
|
|
3117
|
+
break;
|
|
3118
|
+
case 2568:
|
|
3119
|
+
height = 1960;
|
|
3120
|
+
width = 2560;
|
|
3121
|
+
top_margin = 2;
|
|
3122
|
+
left_margin = 8;
|
|
3123
|
+
}
|
|
3124
|
+
filters = 0x16161616;
|
|
3125
|
+
load_raw = &LibRaw::rollei_load_raw;
|
|
3126
|
+
|
|
3127
|
+
}
|
|
3128
|
+
else if (!strcmp(model, "GRAS-50S5C")) {
|
|
3129
|
+
height = 2048;
|
|
3130
|
+
width = 2440;
|
|
3131
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
3132
|
+
data_offset = 0;
|
|
3133
|
+
filters = 0x49494949;
|
|
3134
|
+
order = 0x4949;
|
|
3135
|
+
maximum = 0xfffC;
|
|
3136
|
+
|
|
3137
|
+
}
|
|
3138
|
+
else if (!strcmp(model, "BB-500CL")) {
|
|
3139
|
+
height = 2058;
|
|
3140
|
+
width = 2448;
|
|
3141
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
3142
|
+
data_offset = 0;
|
|
3143
|
+
filters = 0x94949494;
|
|
3144
|
+
order = 0x4949;
|
|
3145
|
+
maximum = 0x3fff;
|
|
3146
|
+
|
|
3147
|
+
}
|
|
3148
|
+
else if (!strcmp(model, "BB-500GE")) {
|
|
3149
|
+
height = 2058;
|
|
3150
|
+
width = 2456;
|
|
3151
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
3152
|
+
data_offset = 0;
|
|
3153
|
+
filters = 0x94949494;
|
|
3154
|
+
order = 0x4949;
|
|
3155
|
+
maximum = 0x3fff;
|
|
3156
|
+
|
|
3157
|
+
}
|
|
3158
|
+
else if (!strcmp(model, "SVS625CL")) {
|
|
3159
|
+
height = 2050;
|
|
3160
|
+
width = 2448;
|
|
3161
|
+
load_raw = &LibRaw::unpacked_load_raw;
|
|
3162
|
+
data_offset = 0;
|
|
3163
|
+
filters = 0x94949494;
|
|
3164
|
+
order = 0x4949;
|
|
3165
|
+
maximum = 0x0fff;
|
|
3166
|
+
}
|
|
3167
|
+
}
|