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,1046 @@
|
|
|
1
|
+
/* -*- C++ -*-
|
|
2
|
+
* File: libraw_datastream.cpp
|
|
3
|
+
* Copyright 2008-2021 LibRaw LLC (info@libraw.org)
|
|
4
|
+
*
|
|
5
|
+
* LibRaw C++ interface (implementation)
|
|
6
|
+
|
|
7
|
+
LibRaw is free software; you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the one of two licenses as you choose:
|
|
9
|
+
|
|
10
|
+
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
|
|
11
|
+
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
|
|
12
|
+
|
|
13
|
+
2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
|
14
|
+
(See file LICENSE.CDDL provided in LibRaw distribution archive for details).
|
|
15
|
+
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#ifdef _WIN32
|
|
19
|
+
#ifdef __MINGW32__
|
|
20
|
+
#define _WIN32_WINNT 0x0500
|
|
21
|
+
#include <stdexcept>
|
|
22
|
+
#endif
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
#define LIBRAW_LIBRARY_BUILD
|
|
26
|
+
#include "libraw/libraw.h"
|
|
27
|
+
#include "libraw/libraw_types.h"
|
|
28
|
+
#include "libraw/libraw_datastream.h"
|
|
29
|
+
#include <sys/stat.h>
|
|
30
|
+
#ifdef USE_JASPER
|
|
31
|
+
#include <jasper/jasper.h> /* Decode RED camera movies */
|
|
32
|
+
#else
|
|
33
|
+
#define NO_JASPER
|
|
34
|
+
#endif
|
|
35
|
+
#ifdef USE_JPEG
|
|
36
|
+
#include <jpeglib.h>
|
|
37
|
+
#include <jerror.h>
|
|
38
|
+
#else
|
|
39
|
+
#define NO_JPEG
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#ifdef USE_JPEG
|
|
43
|
+
|
|
44
|
+
typedef struct
|
|
45
|
+
{
|
|
46
|
+
struct jpeg_source_mgr pub; /* public fields */
|
|
47
|
+
LibRaw_abstract_datastream *instream; /* source stream */
|
|
48
|
+
JOCTET *buffer; /* start of buffer */
|
|
49
|
+
boolean start_of_file; /* have we gotten any data yet? */
|
|
50
|
+
} lr_jpg_source_mgr;
|
|
51
|
+
|
|
52
|
+
typedef lr_jpg_source_mgr *lr_jpg_src_ptr;
|
|
53
|
+
|
|
54
|
+
#define LR_JPEG_INPUT_BUF_SIZE 16384
|
|
55
|
+
|
|
56
|
+
static void f_init_source(j_decompress_ptr cinfo)
|
|
57
|
+
{
|
|
58
|
+
lr_jpg_src_ptr src = (lr_jpg_src_ptr)cinfo->src;
|
|
59
|
+
src->start_of_file = TRUE;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#ifdef ERREXIT
|
|
63
|
+
#undef ERREXIT
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
#define ERREXIT(cinfo, code) \
|
|
67
|
+
((cinfo)->err->msg_code = (code), \
|
|
68
|
+
(*(cinfo)->err->error_exit)((j_common_ptr)(cinfo)))
|
|
69
|
+
|
|
70
|
+
static boolean lr_fill_input_buffer(j_decompress_ptr cinfo)
|
|
71
|
+
{
|
|
72
|
+
lr_jpg_src_ptr src = (lr_jpg_src_ptr)cinfo->src;
|
|
73
|
+
size_t nbytes;
|
|
74
|
+
|
|
75
|
+
nbytes = src->instream->read((void*)src->buffer, 1, LR_JPEG_INPUT_BUF_SIZE);
|
|
76
|
+
|
|
77
|
+
if (nbytes <= 0)
|
|
78
|
+
{
|
|
79
|
+
if (src->start_of_file) /* Treat empty input file as fatal error */
|
|
80
|
+
ERREXIT(cinfo, JERR_INPUT_EMPTY);
|
|
81
|
+
WARNMS(cinfo, JWRN_JPEG_EOF);
|
|
82
|
+
/* Insert a fake EOI marker */
|
|
83
|
+
src->buffer[0] = (JOCTET)0xFF;
|
|
84
|
+
src->buffer[1] = (JOCTET)JPEG_EOI;
|
|
85
|
+
nbytes = 2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
src->pub.next_input_byte = src->buffer;
|
|
89
|
+
src->pub.bytes_in_buffer = nbytes;
|
|
90
|
+
src->start_of_file = FALSE;
|
|
91
|
+
return TRUE;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static void lr_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
|
95
|
+
{
|
|
96
|
+
struct jpeg_source_mgr *src = cinfo->src;
|
|
97
|
+
if (num_bytes > 0)
|
|
98
|
+
{
|
|
99
|
+
while (num_bytes > (long)src->bytes_in_buffer)
|
|
100
|
+
{
|
|
101
|
+
num_bytes -= (long)src->bytes_in_buffer;
|
|
102
|
+
(void)(*src->fill_input_buffer)(cinfo);
|
|
103
|
+
/* note we assume that fill_input_buffer will never return FALSE,
|
|
104
|
+
* so suspension need not be handled.
|
|
105
|
+
*/
|
|
106
|
+
}
|
|
107
|
+
src->next_input_byte += (size_t)num_bytes;
|
|
108
|
+
src->bytes_in_buffer -= (size_t)num_bytes;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static void lr_term_source(j_decompress_ptr /*cinfo*/) {}
|
|
113
|
+
|
|
114
|
+
static void lr_jpeg_src(j_decompress_ptr cinfo, LibRaw_abstract_datastream *inf)
|
|
115
|
+
{
|
|
116
|
+
lr_jpg_src_ptr src;
|
|
117
|
+
if (cinfo->src == NULL)
|
|
118
|
+
{ /* first time for this JPEG object? */
|
|
119
|
+
cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)(
|
|
120
|
+
(j_common_ptr)cinfo, JPOOL_PERMANENT, sizeof(lr_jpg_source_mgr));
|
|
121
|
+
src = (lr_jpg_src_ptr)cinfo->src;
|
|
122
|
+
src->buffer = (JOCTET *)(*cinfo->mem->alloc_small)(
|
|
123
|
+
(j_common_ptr)cinfo, JPOOL_PERMANENT,
|
|
124
|
+
LR_JPEG_INPUT_BUF_SIZE * sizeof(JOCTET));
|
|
125
|
+
}
|
|
126
|
+
else if (cinfo->src->init_source != f_init_source)
|
|
127
|
+
{
|
|
128
|
+
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
src = (lr_jpg_src_ptr)cinfo->src;
|
|
132
|
+
src->pub.init_source = f_init_source;
|
|
133
|
+
src->pub.fill_input_buffer = lr_fill_input_buffer;
|
|
134
|
+
src->pub.skip_input_data = lr_skip_input_data;
|
|
135
|
+
src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
|
136
|
+
src->pub.term_source = lr_term_source;
|
|
137
|
+
src->instream = inf;
|
|
138
|
+
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
|
|
139
|
+
src->pub.next_input_byte = NULL; /* until buffer loaded */
|
|
140
|
+
}
|
|
141
|
+
#endif
|
|
142
|
+
|
|
143
|
+
int LibRaw_abstract_datastream::jpeg_src(void *jpegdata)
|
|
144
|
+
{
|
|
145
|
+
#ifdef NO_JPEG
|
|
146
|
+
return -1;
|
|
147
|
+
#else
|
|
148
|
+
j_decompress_ptr cinfo = (j_decompress_ptr)jpegdata;
|
|
149
|
+
buffering_off();
|
|
150
|
+
lr_jpeg_src(cinfo, this);
|
|
151
|
+
return 0; // OK
|
|
152
|
+
#endif
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
#ifndef LIBRAW_NO_IOSTREAMS_DATASTREAM
|
|
157
|
+
// == LibRaw_file_datastream ==
|
|
158
|
+
|
|
159
|
+
LibRaw_file_datastream::~LibRaw_file_datastream()
|
|
160
|
+
{
|
|
161
|
+
if (jas_file)
|
|
162
|
+
fclose(jas_file);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
LibRaw_file_datastream::LibRaw_file_datastream(const char *fname)
|
|
166
|
+
: filename(fname), _fsize(0)
|
|
167
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
168
|
+
,
|
|
169
|
+
wfilename()
|
|
170
|
+
#endif
|
|
171
|
+
,
|
|
172
|
+
jas_file(NULL)
|
|
173
|
+
{
|
|
174
|
+
if (filename.size() > 0)
|
|
175
|
+
{
|
|
176
|
+
#ifndef LIBRAW_WIN32_CALLS
|
|
177
|
+
struct stat st;
|
|
178
|
+
if (!stat(filename.c_str(), &st))
|
|
179
|
+
_fsize = st.st_size;
|
|
180
|
+
#else
|
|
181
|
+
struct _stati64 st;
|
|
182
|
+
if (!_stati64(filename.c_str(), &st))
|
|
183
|
+
_fsize = st.st_size;
|
|
184
|
+
#endif
|
|
185
|
+
#ifdef LIBRAW_USE_AUTOPTR
|
|
186
|
+
std::auto_ptr<std::filebuf> buf(new std::filebuf());
|
|
187
|
+
#else
|
|
188
|
+
std::unique_ptr<std::filebuf> buf(new std::filebuf());
|
|
189
|
+
#endif
|
|
190
|
+
buf->open(filename.c_str(), std::ios_base::in | std::ios_base::binary);
|
|
191
|
+
if (buf->is_open())
|
|
192
|
+
{
|
|
193
|
+
#ifdef LIBRAW_USE_AUTOPTR
|
|
194
|
+
f = buf;
|
|
195
|
+
#else
|
|
196
|
+
f = std::move(buf);
|
|
197
|
+
#endif
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
202
|
+
LibRaw_file_datastream::LibRaw_file_datastream(const wchar_t *fname)
|
|
203
|
+
: filename(), wfilename(fname), jas_file(NULL), _fsize(0)
|
|
204
|
+
{
|
|
205
|
+
if (wfilename.size() > 0)
|
|
206
|
+
{
|
|
207
|
+
struct _stati64 st;
|
|
208
|
+
if (!_wstati64(wfilename.c_str(), &st))
|
|
209
|
+
_fsize = st.st_size;
|
|
210
|
+
#ifdef LIBRAW_USE_AUTOPTR
|
|
211
|
+
std::auto_ptr<std::filebuf> buf(new std::filebuf());
|
|
212
|
+
#else
|
|
213
|
+
std::unique_ptr<std::filebuf> buf(new std::filebuf());
|
|
214
|
+
#endif
|
|
215
|
+
buf->open(wfilename.c_str(), std::ios_base::in | std::ios_base::binary);
|
|
216
|
+
if (buf->is_open())
|
|
217
|
+
{
|
|
218
|
+
#ifdef LIBRAW_USE_AUTOPTR
|
|
219
|
+
f = buf;
|
|
220
|
+
#else
|
|
221
|
+
f = std::move(buf);
|
|
222
|
+
#endif
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const wchar_t *LibRaw_file_datastream::wfname()
|
|
227
|
+
{
|
|
228
|
+
return wfilename.size() > 0 ? wfilename.c_str() : NULL;
|
|
229
|
+
}
|
|
230
|
+
#endif
|
|
231
|
+
|
|
232
|
+
int LibRaw_file_datastream::valid() { return f.get() ? 1 : 0; }
|
|
233
|
+
|
|
234
|
+
#define LR_STREAM_CHK() \
|
|
235
|
+
do \
|
|
236
|
+
{ \
|
|
237
|
+
if (!f.get()) \
|
|
238
|
+
throw LIBRAW_EXCEPTION_IO_EOF; \
|
|
239
|
+
} while (0)
|
|
240
|
+
|
|
241
|
+
int LibRaw_file_datastream::read(void *ptr, size_t size, size_t nmemb)
|
|
242
|
+
{
|
|
243
|
+
/* Visual Studio 2008 marks sgetn as insecure, but VS2010 does not. */
|
|
244
|
+
#if defined(WIN32SECURECALLS) && (_MSC_VER < 1600)
|
|
245
|
+
LR_STREAM_CHK();
|
|
246
|
+
return int(f->_Sgetn_s(static_cast<char *>(ptr), nmemb * size, nmemb * size) /
|
|
247
|
+
(size > 0 ? size : 1));
|
|
248
|
+
#else
|
|
249
|
+
LR_STREAM_CHK();
|
|
250
|
+
return int(f->sgetn(static_cast<char *>(ptr), std::streamsize(nmemb * size)) /
|
|
251
|
+
(size > 0 ? size : 1));
|
|
252
|
+
#endif
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
int LibRaw_file_datastream::eof()
|
|
256
|
+
{
|
|
257
|
+
LR_STREAM_CHK();
|
|
258
|
+
return f->sgetc() == EOF;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
int LibRaw_file_datastream::seek(INT64 o, int whence)
|
|
262
|
+
{
|
|
263
|
+
LR_STREAM_CHK();
|
|
264
|
+
std::ios_base::seekdir dir;
|
|
265
|
+
switch (whence)
|
|
266
|
+
{
|
|
267
|
+
case SEEK_SET:
|
|
268
|
+
dir = std::ios_base::beg;
|
|
269
|
+
break;
|
|
270
|
+
case SEEK_CUR:
|
|
271
|
+
dir = std::ios_base::cur;
|
|
272
|
+
break;
|
|
273
|
+
case SEEK_END:
|
|
274
|
+
dir = std::ios_base::end;
|
|
275
|
+
break;
|
|
276
|
+
default:
|
|
277
|
+
dir = std::ios_base::beg;
|
|
278
|
+
}
|
|
279
|
+
return f->pubseekoff((long)o, dir) < 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
INT64 LibRaw_file_datastream::tell()
|
|
283
|
+
{
|
|
284
|
+
LR_STREAM_CHK();
|
|
285
|
+
return f->pubseekoff(0, std::ios_base::cur);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
char *LibRaw_file_datastream::gets(char *str, int sz)
|
|
289
|
+
{
|
|
290
|
+
if(sz<1) return NULL;
|
|
291
|
+
LR_STREAM_CHK();
|
|
292
|
+
std::istream is(f.get());
|
|
293
|
+
is.getline(str, sz);
|
|
294
|
+
if (is.fail())
|
|
295
|
+
return 0;
|
|
296
|
+
return str;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
int LibRaw_file_datastream::scanf_one(const char *fmt, void *val)
|
|
300
|
+
{
|
|
301
|
+
LR_STREAM_CHK();
|
|
302
|
+
|
|
303
|
+
std::istream is(f.get());
|
|
304
|
+
|
|
305
|
+
/* HUGE ASSUMPTION: *fmt is either "%d" or "%f" */
|
|
306
|
+
if (strcmp(fmt, "%d") == 0)
|
|
307
|
+
{
|
|
308
|
+
int d;
|
|
309
|
+
is >> d;
|
|
310
|
+
if (is.fail())
|
|
311
|
+
return EOF;
|
|
312
|
+
*(static_cast<int *>(val)) = d;
|
|
313
|
+
}
|
|
314
|
+
else
|
|
315
|
+
{
|
|
316
|
+
float f;
|
|
317
|
+
is >> f;
|
|
318
|
+
if (is.fail())
|
|
319
|
+
return EOF;
|
|
320
|
+
*(static_cast<float *>(val)) = f;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return 1;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const char *LibRaw_file_datastream::fname()
|
|
327
|
+
{
|
|
328
|
+
return filename.size() > 0 ? filename.c_str() : NULL;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
#undef LR_STREAM_CHK
|
|
332
|
+
|
|
333
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
334
|
+
void *LibRaw_file_datastream::make_jas_stream()
|
|
335
|
+
{
|
|
336
|
+
#ifdef NO_JASPER
|
|
337
|
+
return NULL;
|
|
338
|
+
#else
|
|
339
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
340
|
+
if (wfname())
|
|
341
|
+
{
|
|
342
|
+
jas_file = _wfopen(wfname(), L"rb");
|
|
343
|
+
return jas_stream_fdopen(fileno(jas_file), "rb");
|
|
344
|
+
}
|
|
345
|
+
else
|
|
346
|
+
#endif
|
|
347
|
+
{
|
|
348
|
+
return jas_stream_fopen(fname(), "rb");
|
|
349
|
+
}
|
|
350
|
+
#endif
|
|
351
|
+
}
|
|
352
|
+
#endif
|
|
353
|
+
#endif
|
|
354
|
+
|
|
355
|
+
// == LibRaw_buffer_datastream
|
|
356
|
+
LibRaw_buffer_datastream::LibRaw_buffer_datastream(const void *buffer, size_t bsize)
|
|
357
|
+
{
|
|
358
|
+
buf = (unsigned char *)buffer;
|
|
359
|
+
streampos = 0;
|
|
360
|
+
streamsize = bsize;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
LibRaw_buffer_datastream::~LibRaw_buffer_datastream() {}
|
|
364
|
+
|
|
365
|
+
int LibRaw_buffer_datastream::read(void *ptr, size_t sz, size_t nmemb)
|
|
366
|
+
{
|
|
367
|
+
size_t to_read = sz * nmemb;
|
|
368
|
+
if (to_read > streamsize - streampos)
|
|
369
|
+
to_read = streamsize - streampos;
|
|
370
|
+
if (to_read < 1)
|
|
371
|
+
return 0;
|
|
372
|
+
memmove(ptr, buf + streampos, to_read);
|
|
373
|
+
streampos += to_read;
|
|
374
|
+
return int((to_read + sz - 1) / (sz > 0 ? sz : 1));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
int LibRaw_buffer_datastream::seek(INT64 o, int whence)
|
|
378
|
+
{
|
|
379
|
+
switch (whence)
|
|
380
|
+
{
|
|
381
|
+
case SEEK_SET:
|
|
382
|
+
if (o < 0)
|
|
383
|
+
streampos = 0;
|
|
384
|
+
else if (size_t(o) > streamsize)
|
|
385
|
+
streampos = streamsize;
|
|
386
|
+
else
|
|
387
|
+
streampos = size_t(o);
|
|
388
|
+
return 0;
|
|
389
|
+
case SEEK_CUR:
|
|
390
|
+
if (o < 0)
|
|
391
|
+
{
|
|
392
|
+
if (size_t(-o) >= streampos)
|
|
393
|
+
streampos = 0;
|
|
394
|
+
else
|
|
395
|
+
streampos += (size_t)o;
|
|
396
|
+
}
|
|
397
|
+
else if (o > 0)
|
|
398
|
+
{
|
|
399
|
+
if (o + streampos > streamsize)
|
|
400
|
+
streampos = streamsize;
|
|
401
|
+
else
|
|
402
|
+
streampos += (size_t)o;
|
|
403
|
+
}
|
|
404
|
+
return 0;
|
|
405
|
+
case SEEK_END:
|
|
406
|
+
if (o > 0)
|
|
407
|
+
streampos = streamsize;
|
|
408
|
+
else if (size_t(-o) > streamsize)
|
|
409
|
+
streampos = 0;
|
|
410
|
+
else
|
|
411
|
+
streampos = streamsize + (size_t)o;
|
|
412
|
+
return 0;
|
|
413
|
+
default:
|
|
414
|
+
return 0;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
INT64 LibRaw_buffer_datastream::tell()
|
|
419
|
+
{
|
|
420
|
+
return INT64(streampos);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
char *LibRaw_buffer_datastream::gets(char *s, int sz)
|
|
424
|
+
{
|
|
425
|
+
if(sz<1) return NULL;
|
|
426
|
+
unsigned char *psrc, *pdest, *str;
|
|
427
|
+
str = (unsigned char *)s;
|
|
428
|
+
psrc = buf + streampos;
|
|
429
|
+
pdest = str;
|
|
430
|
+
if(streampos >= streamsize) return NULL;
|
|
431
|
+
while ((size_t(psrc - buf) < streamsize) && ((pdest - str) < (sz-1)))
|
|
432
|
+
{
|
|
433
|
+
*pdest = *psrc;
|
|
434
|
+
if (*psrc == '\n')
|
|
435
|
+
break;
|
|
436
|
+
psrc++;
|
|
437
|
+
pdest++;
|
|
438
|
+
}
|
|
439
|
+
if (size_t(psrc - buf) < streamsize)
|
|
440
|
+
psrc++;
|
|
441
|
+
if ((pdest - str) < sz-1)
|
|
442
|
+
*(++pdest) = 0;
|
|
443
|
+
else
|
|
444
|
+
s[sz - 1] = 0; // ensure trailing zero
|
|
445
|
+
|
|
446
|
+
streampos = psrc - buf;
|
|
447
|
+
return s;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
int LibRaw_buffer_datastream::scanf_one(const char *fmt, void *val)
|
|
451
|
+
{
|
|
452
|
+
int scanf_res;
|
|
453
|
+
if (streampos > streamsize)
|
|
454
|
+
return 0;
|
|
455
|
+
#ifndef WIN32SECURECALLS
|
|
456
|
+
scanf_res = sscanf((char *)(buf + streampos), fmt, val);
|
|
457
|
+
#else
|
|
458
|
+
scanf_res = sscanf_s((char *)(buf + streampos), fmt, val);
|
|
459
|
+
#endif
|
|
460
|
+
if (scanf_res > 0)
|
|
461
|
+
{
|
|
462
|
+
int xcnt = 0;
|
|
463
|
+
while (streampos < streamsize-1)
|
|
464
|
+
{
|
|
465
|
+
streampos++;
|
|
466
|
+
xcnt++;
|
|
467
|
+
if (buf[streampos] == 0 || buf[streampos] == ' ' ||
|
|
468
|
+
buf[streampos] == '\t' || buf[streampos] == '\n' || xcnt > 24)
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return scanf_res;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
int LibRaw_buffer_datastream::eof()
|
|
476
|
+
{
|
|
477
|
+
return streampos >= streamsize;
|
|
478
|
+
}
|
|
479
|
+
int LibRaw_buffer_datastream::valid() { return buf ? 1 : 0; }
|
|
480
|
+
|
|
481
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
482
|
+
void *LibRaw_buffer_datastream::make_jas_stream()
|
|
483
|
+
{
|
|
484
|
+
#ifdef NO_JASPER
|
|
485
|
+
return NULL;
|
|
486
|
+
#else
|
|
487
|
+
return jas_stream_memopen((char *)buf + streampos, streamsize - streampos);
|
|
488
|
+
#endif
|
|
489
|
+
}
|
|
490
|
+
#endif
|
|
491
|
+
|
|
492
|
+
int LibRaw_buffer_datastream::jpeg_src(void *jpegdata)
|
|
493
|
+
{
|
|
494
|
+
#if defined(NO_JPEG) || !defined(USE_JPEG)
|
|
495
|
+
return -1;
|
|
496
|
+
#else
|
|
497
|
+
j_decompress_ptr cinfo = (j_decompress_ptr)jpegdata;
|
|
498
|
+
jpeg_mem_src(cinfo, (unsigned char *)buf + streampos,(unsigned long)(streamsize - streampos));
|
|
499
|
+
return 0;
|
|
500
|
+
#endif
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// int LibRaw_buffer_datastream
|
|
504
|
+
|
|
505
|
+
// == LibRaw_bigfile_datastream
|
|
506
|
+
LibRaw_bigfile_datastream::LibRaw_bigfile_datastream(const char *fname)
|
|
507
|
+
: filename(fname)
|
|
508
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
509
|
+
,
|
|
510
|
+
wfilename()
|
|
511
|
+
#endif
|
|
512
|
+
{
|
|
513
|
+
if (filename.size() > 0)
|
|
514
|
+
{
|
|
515
|
+
#ifndef LIBRAW_WIN32_CALLS
|
|
516
|
+
struct stat st;
|
|
517
|
+
if (!stat(filename.c_str(), &st))
|
|
518
|
+
_fsize = st.st_size;
|
|
519
|
+
#else
|
|
520
|
+
struct _stati64 st;
|
|
521
|
+
if (!_stati64(filename.c_str(), &st))
|
|
522
|
+
_fsize = st.st_size;
|
|
523
|
+
#endif
|
|
524
|
+
|
|
525
|
+
#ifndef WIN32SECURECALLS
|
|
526
|
+
f = fopen(fname, "rb");
|
|
527
|
+
#else
|
|
528
|
+
if (fopen_s(&f, fname, "rb"))
|
|
529
|
+
f = 0;
|
|
530
|
+
#endif
|
|
531
|
+
}
|
|
532
|
+
else
|
|
533
|
+
{
|
|
534
|
+
filename = std::string();
|
|
535
|
+
f = 0;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
540
|
+
LibRaw_bigfile_datastream::LibRaw_bigfile_datastream(const wchar_t *fname)
|
|
541
|
+
: filename(), wfilename(fname)
|
|
542
|
+
{
|
|
543
|
+
if (wfilename.size() > 0)
|
|
544
|
+
{
|
|
545
|
+
struct _stati64 st;
|
|
546
|
+
if (!_wstati64(wfilename.c_str(), &st))
|
|
547
|
+
_fsize = st.st_size;
|
|
548
|
+
#ifndef WIN32SECURECALLS
|
|
549
|
+
f = _wfopen(wfilename.c_str(), L"rb");
|
|
550
|
+
#else
|
|
551
|
+
if (_wfopen_s(&f, fname, L"rb"))
|
|
552
|
+
f = 0;
|
|
553
|
+
#endif
|
|
554
|
+
}
|
|
555
|
+
else
|
|
556
|
+
{
|
|
557
|
+
wfilename = std::wstring();
|
|
558
|
+
f = 0;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
const wchar_t *LibRaw_bigfile_datastream::wfname()
|
|
562
|
+
{
|
|
563
|
+
return wfilename.size() > 0 ? wfilename.c_str() : NULL;
|
|
564
|
+
}
|
|
565
|
+
#endif
|
|
566
|
+
|
|
567
|
+
LibRaw_bigfile_datastream::~LibRaw_bigfile_datastream()
|
|
568
|
+
{
|
|
569
|
+
if (f)
|
|
570
|
+
fclose(f);
|
|
571
|
+
}
|
|
572
|
+
int LibRaw_bigfile_datastream::valid() { return f ? 1 : 0; }
|
|
573
|
+
|
|
574
|
+
#define LR_BF_CHK() \
|
|
575
|
+
do \
|
|
576
|
+
{ \
|
|
577
|
+
if (!f) \
|
|
578
|
+
throw LIBRAW_EXCEPTION_IO_EOF; \
|
|
579
|
+
} while (0)
|
|
580
|
+
|
|
581
|
+
int LibRaw_bigfile_datastream::read(void *ptr, size_t size, size_t nmemb)
|
|
582
|
+
{
|
|
583
|
+
LR_BF_CHK();
|
|
584
|
+
return int(fread(ptr, size, nmemb, f));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
int LibRaw_bigfile_datastream::eof()
|
|
588
|
+
{
|
|
589
|
+
LR_BF_CHK();
|
|
590
|
+
return feof(f);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
int LibRaw_bigfile_datastream::seek(INT64 o, int whence)
|
|
594
|
+
{
|
|
595
|
+
LR_BF_CHK();
|
|
596
|
+
#if defined(_WIN32)
|
|
597
|
+
#ifdef WIN32SECURECALLS
|
|
598
|
+
return _fseeki64(f, o, whence);
|
|
599
|
+
#else
|
|
600
|
+
return fseek(f, (long)o, whence);
|
|
601
|
+
#endif
|
|
602
|
+
#else
|
|
603
|
+
return fseeko(f, o, whence);
|
|
604
|
+
#endif
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
INT64 LibRaw_bigfile_datastream::tell()
|
|
608
|
+
{
|
|
609
|
+
LR_BF_CHK();
|
|
610
|
+
#if defined(_WIN32)
|
|
611
|
+
#ifdef WIN32SECURECALLS
|
|
612
|
+
return _ftelli64(f);
|
|
613
|
+
#else
|
|
614
|
+
return ftell(f);
|
|
615
|
+
#endif
|
|
616
|
+
#else
|
|
617
|
+
return ftello(f);
|
|
618
|
+
#endif
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
char *LibRaw_bigfile_datastream::gets(char *str, int sz)
|
|
622
|
+
{
|
|
623
|
+
if(sz<1) return NULL;
|
|
624
|
+
LR_BF_CHK();
|
|
625
|
+
return fgets(str, sz, f);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
int LibRaw_bigfile_datastream::scanf_one(const char *fmt, void *val)
|
|
629
|
+
{
|
|
630
|
+
LR_BF_CHK();
|
|
631
|
+
return
|
|
632
|
+
#ifndef WIN32SECURECALLS
|
|
633
|
+
fscanf(f, fmt, val)
|
|
634
|
+
#else
|
|
635
|
+
fscanf_s(f, fmt, val)
|
|
636
|
+
#endif
|
|
637
|
+
;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
const char *LibRaw_bigfile_datastream::fname()
|
|
641
|
+
{
|
|
642
|
+
return filename.size() > 0 ? filename.c_str() : NULL;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
646
|
+
void *LibRaw_bigfile_datastream::make_jas_stream()
|
|
647
|
+
{
|
|
648
|
+
#ifdef NO_JASPER
|
|
649
|
+
return NULL;
|
|
650
|
+
#else
|
|
651
|
+
return jas_stream_fdopen(fileno(f), "rb");
|
|
652
|
+
#endif
|
|
653
|
+
}
|
|
654
|
+
#endif
|
|
655
|
+
|
|
656
|
+
// == LibRaw_windows_datastream
|
|
657
|
+
#ifdef LIBRAW_WIN32_CALLS
|
|
658
|
+
|
|
659
|
+
LibRaw_windows_datastream::LibRaw_windows_datastream(const TCHAR *sFile)
|
|
660
|
+
: LibRaw_buffer_datastream(NULL, 0), hMap_(0), pView_(NULL)
|
|
661
|
+
{
|
|
662
|
+
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
|
663
|
+
HANDLE hFile = CreateFile2(sFile, GENERIC_READ, 0, OPEN_EXISTING, 0);
|
|
664
|
+
#else
|
|
665
|
+
HANDLE hFile = CreateFile(sFile, GENERIC_READ, 0, 0, OPEN_EXISTING,
|
|
666
|
+
FILE_ATTRIBUTE_NORMAL, 0);
|
|
667
|
+
#endif
|
|
668
|
+
if (hFile == INVALID_HANDLE_VALUE)
|
|
669
|
+
throw std::runtime_error("failed to open the file");
|
|
670
|
+
|
|
671
|
+
try
|
|
672
|
+
{
|
|
673
|
+
Open(hFile);
|
|
674
|
+
}
|
|
675
|
+
catch (...)
|
|
676
|
+
{
|
|
677
|
+
CloseHandle(hFile);
|
|
678
|
+
throw;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
CloseHandle(hFile); // windows will defer the actual closing of this handle
|
|
682
|
+
// until the hMap_ is closed
|
|
683
|
+
reconstruct_base();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// ctor: construct with a file handle - caller is responsible for closing the
|
|
687
|
+
// file handle
|
|
688
|
+
LibRaw_windows_datastream::LibRaw_windows_datastream(HANDLE hFile)
|
|
689
|
+
: LibRaw_buffer_datastream(NULL, 0), hMap_(0), pView_(NULL)
|
|
690
|
+
{
|
|
691
|
+
Open(hFile);
|
|
692
|
+
reconstruct_base();
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// dtor: unmap and close the mapping handle
|
|
696
|
+
LibRaw_windows_datastream::~LibRaw_windows_datastream()
|
|
697
|
+
{
|
|
698
|
+
if (pView_ != NULL)
|
|
699
|
+
::UnmapViewOfFile(pView_);
|
|
700
|
+
|
|
701
|
+
if (hMap_ != 0)
|
|
702
|
+
::CloseHandle(hMap_);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
void LibRaw_windows_datastream::Open(HANDLE hFile)
|
|
706
|
+
{
|
|
707
|
+
// create a file mapping handle on the file handle
|
|
708
|
+
hMap_ = ::CreateFileMapping(hFile, 0, PAGE_READONLY, 0, 0, 0);
|
|
709
|
+
if (hMap_ == NULL)
|
|
710
|
+
throw std::runtime_error("failed to create file mapping");
|
|
711
|
+
|
|
712
|
+
// now map the whole file base view
|
|
713
|
+
if (!::GetFileSizeEx(hFile, (PLARGE_INTEGER)&cbView_))
|
|
714
|
+
throw std::runtime_error("failed to get the file size");
|
|
715
|
+
|
|
716
|
+
pView_ = ::MapViewOfFile(hMap_, FILE_MAP_READ, 0, 0, (size_t)cbView_);
|
|
717
|
+
if (pView_ == NULL)
|
|
718
|
+
throw std::runtime_error("failed to map the file");
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
#endif
|
|
722
|
+
|
|
723
|
+
#if defined (LIBRAW_NO_IOSTREAMS_DATASTREAM) && defined (LIBRAW_WIN32_CALLS)
|
|
724
|
+
|
|
725
|
+
/* LibRaw_bigfile_buffered_datastream: copypasted from LibRaw_bigfile_datastream + extra cache on read */
|
|
726
|
+
|
|
727
|
+
#undef LR_BF_CHK
|
|
728
|
+
#define LR_BF_CHK() \
|
|
729
|
+
do \
|
|
730
|
+
{ \
|
|
731
|
+
if (fhandle ==0 || fhandle == INVALID_HANDLE_VALUE) \
|
|
732
|
+
throw LIBRAW_EXCEPTION_IO_EOF; \
|
|
733
|
+
} while (0)
|
|
734
|
+
|
|
735
|
+
#define LIBRAW_BUFFER_ALIGN 4096
|
|
736
|
+
|
|
737
|
+
int LibRaw_bufio_params::bufsize = 16384;
|
|
738
|
+
|
|
739
|
+
void LibRaw_bufio_params::set_bufsize(int bs)
|
|
740
|
+
{
|
|
741
|
+
if (bs > 0)
|
|
742
|
+
bufsize = bs;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
LibRaw_bigfile_buffered_datastream::LibRaw_bigfile_buffered_datastream(const char *fname)
|
|
747
|
+
: filename(fname), _fsize(0), _fpos(0)
|
|
748
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
749
|
+
, wfilename()
|
|
750
|
+
#endif
|
|
751
|
+
, iobuffers(), buffered(1)
|
|
752
|
+
{
|
|
753
|
+
if (filename.size() > 0)
|
|
754
|
+
{
|
|
755
|
+
std::string fn(fname);
|
|
756
|
+
std::wstring fpath(fn.begin(), fn.end());
|
|
757
|
+
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
|
758
|
+
if ((fhandle = CreateFile2(fpath.c_str(), GENERIC_READ, 0, OPEN_EXISTING, 0)) != INVALID_HANDLE_VALUE)
|
|
759
|
+
#else
|
|
760
|
+
if ((fhandle = CreateFileW(fpath.c_str(), GENERIC_READ, FILE_SHARE_READ, 0,
|
|
761
|
+
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE)
|
|
762
|
+
#endif
|
|
763
|
+
{
|
|
764
|
+
LARGE_INTEGER fs;
|
|
765
|
+
if (GetFileSizeEx(fhandle, &fs))
|
|
766
|
+
_fsize = fs.QuadPart;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
else
|
|
770
|
+
{
|
|
771
|
+
filename = std::string();
|
|
772
|
+
fhandle = INVALID_HANDLE_VALUE;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
#ifdef LIBRAW_WIN32_UNICODEPATHS
|
|
777
|
+
LibRaw_bigfile_buffered_datastream::LibRaw_bigfile_buffered_datastream(const wchar_t *fname)
|
|
778
|
+
: filename(), _fsize(0), _fpos(0),
|
|
779
|
+
wfilename(fname), iobuffers(), buffered(1)
|
|
780
|
+
{
|
|
781
|
+
if (wfilename.size() > 0)
|
|
782
|
+
{
|
|
783
|
+
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_APP) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
|
|
784
|
+
if ((fhandle = CreateFile2(wfilename.c_str(), GENERIC_READ, 0, OPEN_EXISTING, 0)) != INVALID_HANDLE_VALUE)
|
|
785
|
+
#else
|
|
786
|
+
if ((fhandle = CreateFileW(wfilename.c_str(), GENERIC_READ, FILE_SHARE_READ, 0,
|
|
787
|
+
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE)
|
|
788
|
+
#endif
|
|
789
|
+
{
|
|
790
|
+
LARGE_INTEGER fs;
|
|
791
|
+
if (GetFileSizeEx(fhandle, &fs))
|
|
792
|
+
_fsize = fs.QuadPart;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
}
|
|
796
|
+
else
|
|
797
|
+
{
|
|
798
|
+
wfilename = std::wstring();
|
|
799
|
+
fhandle = INVALID_HANDLE_VALUE;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
const wchar_t *LibRaw_bigfile_buffered_datastream::wfname()
|
|
804
|
+
{
|
|
805
|
+
return wfilename.size() > 0 ? wfilename.c_str() : NULL;
|
|
806
|
+
}
|
|
807
|
+
#endif
|
|
808
|
+
|
|
809
|
+
LibRaw_bigfile_buffered_datastream::~LibRaw_bigfile_buffered_datastream()
|
|
810
|
+
{
|
|
811
|
+
if (valid())
|
|
812
|
+
CloseHandle(fhandle);
|
|
813
|
+
}
|
|
814
|
+
int LibRaw_bigfile_buffered_datastream::valid() {
|
|
815
|
+
return (fhandle != NULL) && (fhandle != INVALID_HANDLE_VALUE);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
const char *LibRaw_bigfile_buffered_datastream::fname()
|
|
819
|
+
{
|
|
820
|
+
return filename.size() > 0 ? filename.c_str() : NULL;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
#ifdef LIBRAW_OLD_VIDEO_SUPPORT
|
|
824
|
+
void *LibRaw_bigfile_buffered_datastream::make_jas_stream()
|
|
825
|
+
{
|
|
826
|
+
#ifdef NO_JASPER
|
|
827
|
+
return NULL;
|
|
828
|
+
#else
|
|
829
|
+
return NULL;
|
|
830
|
+
#endif
|
|
831
|
+
}
|
|
832
|
+
#endif
|
|
833
|
+
|
|
834
|
+
INT64 LibRaw_bigfile_buffered_datastream::readAt(void *ptr, size_t size, INT64 off)
|
|
835
|
+
{
|
|
836
|
+
LR_BF_CHK();
|
|
837
|
+
DWORD NumberOfBytesRead;
|
|
838
|
+
DWORD nNumberOfBytesToRead = (DWORD)size;
|
|
839
|
+
struct _OVERLAPPED olap;
|
|
840
|
+
memset(&olap, 0, sizeof(olap));
|
|
841
|
+
olap.Offset = off & 0xffffffff;
|
|
842
|
+
olap.OffsetHigh = off >> 32;
|
|
843
|
+
if (ReadFile(fhandle, ptr, nNumberOfBytesToRead, &NumberOfBytesRead, &olap))
|
|
844
|
+
return NumberOfBytesRead;
|
|
845
|
+
else
|
|
846
|
+
return 0;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
850
|
+
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
851
|
+
|
|
852
|
+
#ifdef _MSC_VER
|
|
853
|
+
#pragma intrinsic(memcpy)
|
|
854
|
+
#endif
|
|
855
|
+
|
|
856
|
+
int LibRaw_bigfile_buffered_datastream::read(void *data, size_t size, size_t nmemb)
|
|
857
|
+
{
|
|
858
|
+
if (size < 1 || nmemb < 1)
|
|
859
|
+
return 0;
|
|
860
|
+
LR_BF_CHK();
|
|
861
|
+
INT64 count = size * nmemb;
|
|
862
|
+
INT64 partbytes = 0;
|
|
863
|
+
if (!buffered)
|
|
864
|
+
{
|
|
865
|
+
INT64 r = readAt(data, count, _fpos);
|
|
866
|
+
_fpos += r;
|
|
867
|
+
return int(r / size);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
unsigned char *fBuffer = (unsigned char*)iobuffers[0].data();
|
|
871
|
+
while (count)
|
|
872
|
+
{
|
|
873
|
+
INT64 inbuffer = 0;
|
|
874
|
+
// See if the request is totally inside buffer.
|
|
875
|
+
if (iobuffers[0].contains(_fpos, inbuffer))
|
|
876
|
+
{
|
|
877
|
+
if (inbuffer >= count)
|
|
878
|
+
{
|
|
879
|
+
memcpy(data, fBuffer + (unsigned)(_fpos - iobuffers[0]._bstart), count);
|
|
880
|
+
_fpos += count;
|
|
881
|
+
return int((count + partbytes) / size);
|
|
882
|
+
}
|
|
883
|
+
memcpy(data, fBuffer + (_fpos - iobuffers[0]._bstart), inbuffer);
|
|
884
|
+
partbytes += inbuffer;
|
|
885
|
+
count -= inbuffer;
|
|
886
|
+
data = (void *)(((char *)data) + inbuffer);
|
|
887
|
+
_fpos += inbuffer;
|
|
888
|
+
}
|
|
889
|
+
if (count > (INT64) iobuffers[0].size())
|
|
890
|
+
{
|
|
891
|
+
fallback:
|
|
892
|
+
if (_fpos + count > _fsize)
|
|
893
|
+
count = MAX(0, _fsize - _fpos);
|
|
894
|
+
if (count > 0)
|
|
895
|
+
{
|
|
896
|
+
INT64 r = readAt(data, count, _fpos);
|
|
897
|
+
_fpos += r;
|
|
898
|
+
return int((r + partbytes) / size);
|
|
899
|
+
}
|
|
900
|
+
else
|
|
901
|
+
return 0;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
if (!fillBufferAt(0, _fpos))
|
|
905
|
+
goto fallback;
|
|
906
|
+
}
|
|
907
|
+
return 0;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
bool LibRaw_bigfile_buffered_datastream::fillBufferAt(int bi, INT64 off)
|
|
911
|
+
{
|
|
912
|
+
if (off < 0LL) return false;
|
|
913
|
+
iobuffers[bi]._bstart = off;
|
|
914
|
+
if (iobuffers[bi].size() >= LIBRAW_BUFFER_ALIGN * 2)// Align to a file block.
|
|
915
|
+
iobuffers[bi]._bstart &= (INT64)~((INT64)(LIBRAW_BUFFER_ALIGN - 1));
|
|
916
|
+
|
|
917
|
+
iobuffers[bi]._bend = MIN(iobuffers[bi]._bstart + (INT64)iobuffers[bi].size(), _fsize);
|
|
918
|
+
if (iobuffers[bi]._bend <= off) // Buffer alignment problem, fallback
|
|
919
|
+
return false;
|
|
920
|
+
INT64 rr = readAt(iobuffers[bi].data(), (uint32_t)(iobuffers[bi]._bend - iobuffers[bi]._bstart), iobuffers[bi]._bstart);
|
|
921
|
+
if (rr > 0)
|
|
922
|
+
{
|
|
923
|
+
iobuffers[bi]._bend = iobuffers[bi]._bstart + rr;
|
|
924
|
+
return true;
|
|
925
|
+
}
|
|
926
|
+
return false;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
int LibRaw_bigfile_buffered_datastream::eof()
|
|
931
|
+
{
|
|
932
|
+
LR_BF_CHK();
|
|
933
|
+
return _fpos >= _fsize;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
int LibRaw_bigfile_buffered_datastream::seek(INT64 o, int whence)
|
|
937
|
+
{
|
|
938
|
+
LR_BF_CHK();
|
|
939
|
+
if (whence == SEEK_SET) _fpos = o;
|
|
940
|
+
else if (whence == SEEK_END) _fpos = o > 0 ? _fsize : _fsize + o;
|
|
941
|
+
else if (whence == SEEK_CUR) _fpos += o;
|
|
942
|
+
return 0;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
INT64 LibRaw_bigfile_buffered_datastream::tell()
|
|
946
|
+
{
|
|
947
|
+
LR_BF_CHK();
|
|
948
|
+
return _fpos;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
char *LibRaw_bigfile_buffered_datastream::gets(char *s, int sz)
|
|
952
|
+
{
|
|
953
|
+
if (sz < 1)
|
|
954
|
+
return NULL;
|
|
955
|
+
else if (sz < 2)
|
|
956
|
+
{
|
|
957
|
+
s[0] = 0;
|
|
958
|
+
return s;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
LR_BF_CHK();
|
|
962
|
+
INT64 contains;
|
|
963
|
+
int bufindex = selectStringBuffer(sz, contains);
|
|
964
|
+
if (bufindex < 0) return NULL;
|
|
965
|
+
if (contains >= sz)
|
|
966
|
+
{
|
|
967
|
+
unsigned char *buf = iobuffers[bufindex].data() + (_fpos - iobuffers[bufindex]._bstart);
|
|
968
|
+
int streampos = 0;
|
|
969
|
+
int streamsize = contains;
|
|
970
|
+
unsigned char *str = (unsigned char *)s;
|
|
971
|
+
unsigned char *psrc, *pdest;
|
|
972
|
+
psrc = buf + streampos;
|
|
973
|
+
pdest = str;
|
|
974
|
+
|
|
975
|
+
while ((size_t(psrc - buf) < streamsize) && ((pdest - str) < sz-1)) // sz-1: to append \0
|
|
976
|
+
{
|
|
977
|
+
*pdest = *psrc;
|
|
978
|
+
if (*psrc == '\n')
|
|
979
|
+
break;
|
|
980
|
+
psrc++;
|
|
981
|
+
pdest++;
|
|
982
|
+
}
|
|
983
|
+
if (size_t(psrc - buf) < streamsize)
|
|
984
|
+
psrc++;
|
|
985
|
+
if ((pdest - str) < sz - 1)
|
|
986
|
+
*(++pdest) = 0;
|
|
987
|
+
else
|
|
988
|
+
s[sz - 1] = 0; // ensure trailing zero
|
|
989
|
+
streampos = psrc - buf;
|
|
990
|
+
_fpos += streampos;
|
|
991
|
+
return s;
|
|
992
|
+
}
|
|
993
|
+
return NULL;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
int LibRaw_bigfile_buffered_datastream::selectStringBuffer(INT64 len, INT64& contains)
|
|
997
|
+
{
|
|
998
|
+
if (iobuffers[0].contains(_fpos, contains) && contains >= len)
|
|
999
|
+
return 0;
|
|
1000
|
+
|
|
1001
|
+
if (iobuffers[1].contains(_fpos, contains) && contains >= len)
|
|
1002
|
+
return 1;
|
|
1003
|
+
|
|
1004
|
+
fillBufferAt(1, _fpos);
|
|
1005
|
+
if (iobuffers[1].contains(_fpos, contains) && contains >= len)
|
|
1006
|
+
return 1;
|
|
1007
|
+
return -1;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
int LibRaw_bigfile_buffered_datastream::scanf_one(const char *fmt, void *val)
|
|
1011
|
+
{
|
|
1012
|
+
LR_BF_CHK();
|
|
1013
|
+
INT64 contains = 0;
|
|
1014
|
+
int bufindex = selectStringBuffer(24, contains);
|
|
1015
|
+
if (bufindex < 0) return -1;
|
|
1016
|
+
if (contains >= 24)
|
|
1017
|
+
{
|
|
1018
|
+
unsigned char *bstart = iobuffers[bufindex].data() + (_fpos - iobuffers[bufindex]._bstart);
|
|
1019
|
+
int streampos = 0;
|
|
1020
|
+
int streamsize = contains;
|
|
1021
|
+
int
|
|
1022
|
+
#ifndef WIN32SECURECALLS
|
|
1023
|
+
scanf_res = sscanf((char *)(bstart), fmt, val);
|
|
1024
|
+
#else
|
|
1025
|
+
scanf_res = sscanf_s((char *)(bstart), fmt, val);
|
|
1026
|
+
#endif
|
|
1027
|
+
if (scanf_res > 0)
|
|
1028
|
+
{
|
|
1029
|
+
int xcnt = 0;
|
|
1030
|
+
while (streampos < streamsize)
|
|
1031
|
+
{
|
|
1032
|
+
streampos++;
|
|
1033
|
+
xcnt++;
|
|
1034
|
+
if (bstart[streampos] == 0 || bstart[streampos] == ' ' ||
|
|
1035
|
+
bstart[streampos] == '\t' || bstart[streampos] == '\n' || xcnt > 24)
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1038
|
+
_fpos += streampos;
|
|
1039
|
+
return scanf_res;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return -1;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
#endif
|
|
1046
|
+
|