epeg 1.0
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.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/MANIFEST +5 -0
- data/TODO +1 -0
- data/epeg/.dockerignore +4 -0
- data/epeg/.gitignore +5 -0
- data/epeg/CMakeLists.txt +30 -0
- data/epeg/Dockerfile +23 -0
- data/epeg/Epeg.h +90 -0
- data/epeg/README.md +42 -0
- data/epeg/epeg_main.c +1642 -0
- data/epeg/epeg_private.h +85 -0
- data/epeg/example/.gitignore +1 -0
- data/epeg/example/CMakeLists.txt +20 -0
- data/epeg/example/example.jpg +0 -0
- data/epeg/example/rotatetest.c +29 -0
- data/epeg/example/scaletest.c +48 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/BUILDING.md +828 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/CMakeLists.txt +1420 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/ChangeLog.md +1494 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/LICENSE.md +132 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/README.ijg +277 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/README.md +356 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cderror.h +137 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.c +145 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.h +157 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/change.log +315 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.1 +354 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.c +695 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/BuildPackages.cmake +182 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/GNUInstallDirs.cmake +416 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/cmake_uninstall.cmake.in +24 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/testclean.cmake +41 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/cmyk.h +61 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/coderules.txt +78 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.1 +296 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.c +822 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/annotated.html +104 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bc_s.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bdwn.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/classes.html +106 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/closed.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen-extra.css +3 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.css +1184 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/dynsections.js +97 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2blank.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2cl.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2doc.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderclosed.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderopen.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2lastnode.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2link.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mlastnode.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mnode.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mo.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2node.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2ns.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2plastnode.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2pnode.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2splitbar.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2vertline.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions.html +134 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions_vars.html +134 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/group___turbo_j_p_e_g.html +2775 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/index.html +90 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/jquery.js +8 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/modules.html +95 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_f.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_g.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_h.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/open.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.js +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.js +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.js +102 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.js +6 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/close.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.js +8 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.js +37 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.js +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/mag_sel.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/nomatches.html +12 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.css +271 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.js +809 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_l.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_m.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_r.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.js +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.js +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.js +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.js +10 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.html +26 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.js +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjregion.html +186 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjscalingfactor.html +148 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjtransform.html +212 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_off.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_on.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_a.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_b.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_h.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_s.png +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tabs.css +60 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen-extra.css +3 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen.config +16 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/example.txt +464 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jaricom.c +157 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/CMakeLists.txt +88 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/MANIFEST.MF +2 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/README +52 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJBench.java +1021 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJExample.java +405 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJUnitTest.java +960 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-frame.html +24 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-noframe.html +24 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/constant-values.html +532 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/deprecated-list.html +252 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/help-doc.html +210 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index-all.html +1029 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index.html +71 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJ.html +1356 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +926 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html +241 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +1255 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJException.html +340 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html +343 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html +751 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +421 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html +765 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-frame.html +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-summary.html +202 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-tree.html +160 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/overview-tree.html +164 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/package-list +1 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/background.gif +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/tab.gif +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar.gif +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar_end.gif +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/script.js +30 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/serialized-form.html +176 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/stylesheet.css +474 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJ.java +584 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCompressor.java +677 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java +76 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +931 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJException.java +78 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in +59 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in +35 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java +115 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransform.java +227 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransformer.java +163 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/YUVImage.java +445 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJ.h +129 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJCompressor.h +101 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJDecompressor.h +101 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJTransformer.h +29 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcapimin.c +295 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcapistd.c +162 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcarith.c +932 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jccoefct.c +449 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jccolext.c +144 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jccolor.c +710 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcdctmgr.c +721 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.c +1096 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.h +42 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcicc.c +105 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcinit.c +77 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcmainct.c +162 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcmarker.c +664 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcmaster.c +640 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcomapi.c +109 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.h.in +73 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.txt +143 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jconfigint.h.in +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcparam.c +541 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcphuff.c +1105 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcprepct.c +351 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcsample.c +539 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jcstest.c +126 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jctrans.c +400 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdapimin.c +407 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdapistd.c +639 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdarith.c +773 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst-tj.c +203 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst.c +293 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc-tj.c +194 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc.c +295 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.c +692 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.h +82 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdcol565.c +384 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolext.c +143 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolor.c +883 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdct.h +208 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jddctmgr.c +352 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.c +831 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.h +238 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdicc.c +171 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdinput.c +408 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.c +460 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.h +71 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmarker.c +1377 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.c +737 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.h +28 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmerge.c +617 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrg565.c +354 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrgext.c +184 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdphuff.c +687 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdpostct.c +294 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.c +518 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.h +50 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jdtrans.c +155 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.c +251 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.h +316 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctflt.c +169 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctfst.c +227 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctint.c +288 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jidctflt.c +240 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jidctfst.c +371 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jidctint.c +2627 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jidctred.c +409 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jinclude.h +88 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jmemmgr.c +1179 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jmemnobs.c +115 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jmemsys.h +178 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jmorecfg.h +421 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpeg_nbits_table.h +4098 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpegcomp.h +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpegint.h +368 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpeglib.h +1132 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.1 +295 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.c +601 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jquant1.c +859 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jquant2.c +1285 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd.h +117 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd_none.c +418 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jsimddct.h +70 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jstdhuff.c +143 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jutils.c +133 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/jversion.h +52 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.map.in +11 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.txt +3144 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/md5/CMakeLists.txt +1 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.c +275 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.h +57 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5cmp.c +59 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5hl.c +125 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdbmp.c +689 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdcolmap.c +254 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdgif.c +39 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.1 +63 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.c +510 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdppm.c +766 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdrle.c +389 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdswitch.c +424 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/rdtarga.c +509 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/Distribution.xml.in +24 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/License.rtf +20 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/ReadMe.txt +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/Welcome.rtf +17 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/deb-control.in +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/installer.nsi.in +191 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/libjpeg.pc.in +10 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/libturbojpeg.pc.in +10 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/makecygwinpkg.in +66 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/makedpkg.in +115 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/makemacpkg.in +284 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/makerpm.in +30 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/makesrpm.in +48 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/maketarball.in +51 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/rpm.spec.in +221 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/release/uninstall.in +113 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/sharedlib/CMakeLists.txt +99 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/CMakeLists.txt +385 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd.c +721 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd_neon.S +2878 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd.c +798 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd_neon.S +3433 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/gas-preprocessor.in +1 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-avx2.asm +578 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-mmx.asm +476 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-sse2.asm +503 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-avx2.asm +121 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-mmx.asm +121 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-sse2.asm +120 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-avx2.asm +113 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-mmx.asm +113 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-sse2.asm +112 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-avx2.asm +457 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-mmx.asm +355 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-sse2.asm +382 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jchuff-sse2.asm +424 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcphuff-sse2.asm +660 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-avx2.asm +388 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-mmx.asm +324 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-sse2.asm +351 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-avx2.asm +515 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-mmx.asm +404 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-sse2.asm +458 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-avx2.asm +118 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-mmx.asm +117 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-sse2.asm +117 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-avx2.asm +136 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-mmx.asm +123 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-sse2.asm +135 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-avx2.asm +575 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-mmx.asm +460 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-sse2.asm +517 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-avx2.asm +760 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-mmx.asm +731 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-sse2.asm +724 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-3dn.asm +318 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-sse.asm +369 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-mmx.asm +395 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-sse2.asm +403 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-avx2.asm +331 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-mmx.asm +620 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-sse2.asm +633 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-3dn.asm +451 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse.asm +571 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse2.asm +497 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-mmx.asm +499 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-sse2.asm +501 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-avx2.asm +453 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-mmx.asm +851 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-sse2.asm +858 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-mmx.asm +704 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-sse2.asm +592 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-3dn.asm +230 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-mmx.asm +276 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-sse.asm +208 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquantf-sse2.asm +168 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-avx2.asm +188 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-sse2.asm +201 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimd.c +1253 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimdcpu.asm +135 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/jsimd.h +1083 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolext-mmi.c +483 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolor-mmi.c +148 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample-mmi.c +100 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample.h +28 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolext-mmi.c +424 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolor-mmi.c +139 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdsample-mmi.c +245 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jfdctint-mmi.c +398 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jidctint-mmi.c +571 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jquanti-mmi.c +130 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd.c +610 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd_mmi.h +57 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/loongson-mmintrin.h +1324 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd.c +1123 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2.S +4479 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2_asm.h +292 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jcolsamp.inc +135 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jdct.inc +31 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jpeg_nbits_table.inc +4097 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc +93 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc.h +131 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdext.inc +479 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolext-altivec.c +269 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolor-altivec.c +116 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgray-altivec.c +111 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgryext-altivec.c +228 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample-altivec.c +159 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample.h +28 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolext-altivec.c +276 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolor-altivec.c +106 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmerge-altivec.c +130 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmrgext-altivec.c +329 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdsample-altivec.c +400 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctfst-altivec.c +154 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctint-altivec.c +258 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctfst-altivec.c +255 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctint-altivec.c +357 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jquanti-altivec.c +250 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd.c +872 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd_altivec.h +98 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-avx2.asm +558 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-sse2.asm +483 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-avx2.asm +121 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-sse2.asm +120 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-avx2.asm +113 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-sse2.asm +112 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-avx2.asm +437 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-sse2.asm +362 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jchuff-sse2.asm +346 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcphuff-sse2.asm +637 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-avx2.asm +366 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-sse2.asm +329 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-avx2.asm +495 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-sse2.asm +438 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-avx2.asm +118 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-sse2.asm +117 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-avx2.asm +136 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-sse2.asm +135 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-avx2.asm +593 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-sse2.asm +535 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-avx2.asm +695 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-sse2.asm +664 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctflt-sse.asm +355 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctfst-sse2.asm +389 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-avx2.asm +320 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-sse2.asm +619 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctflt-sse2.asm +481 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctfst-sse2.asm +490 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-avx2.asm +417 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-sse2.asm +846 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctred-sse2.asm +573 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquantf-sse2.asm +154 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-avx2.asm +162 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-sse2.asm +187 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimd.c +1076 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimdcpu.asm +86 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/structure.txt +904 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.bmp +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.txt +25 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test.scan +5 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc.txt +20 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc.txt +20 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgari.jpg +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgint.jpg +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.jpg +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.ppm +4 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig12.jpg +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_5674_0098.bmp +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6434_0018a.bmp +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6548_0026a.bmp +0 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjbench.c +1031 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.in +256 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.java.in +215 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjexample.c +396 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.in +149 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.java.in +151 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjunittest.c +931 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.c +70 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.h +47 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.c +1628 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.h +210 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-jni.c +1246 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile +65 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile.jni +101 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.c +2152 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.h +1744 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/usage.txt +635 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jconfig.h.in +34 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62-memsrcdst.def +108 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62.def +106 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7-memsrcdst.def +110 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7.def +108 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg8.def +111 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wizard.txt +212 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrbmp.c +558 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrgif.c +413 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.1 +103 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.c +591 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrppm.c +365 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrrle.c +309 -0
- data/epeg/vendor/libjpeg-turbo-2.0.4/wrtarga.c +261 -0
- data/epeg.c +131 -0
- data/epeg.gemspec +18 -0
- data/extconf.rb +80 -0
- data/test.jpg +0 -0
- data/test.rb +42 -0
- metadata +546 -0
@@ -0,0 +1,931 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C)2011-2015, 2018 D. R. Commander. All Rights Reserved.
|
3
|
+
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
4
|
+
*
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
7
|
+
*
|
8
|
+
* - Redistributions of source code must retain the above copyright notice,
|
9
|
+
* this list of conditions and the following disclaimer.
|
10
|
+
* - Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
* this list of conditions and the following disclaimer in the documentation
|
12
|
+
* and/or other materials provided with the distribution.
|
13
|
+
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
14
|
+
* contributors may be used to endorse or promote products derived from this
|
15
|
+
* software without specific prior written permission.
|
16
|
+
*
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*/
|
29
|
+
|
30
|
+
package org.libjpegturbo.turbojpeg;
|
31
|
+
|
32
|
+
import java.awt.image.*;
|
33
|
+
import java.nio.*;
|
34
|
+
import java.io.*;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* TurboJPEG decompressor
|
38
|
+
*/
|
39
|
+
public class TJDecompressor implements Closeable {
|
40
|
+
|
41
|
+
private static final String NO_ASSOC_ERROR =
|
42
|
+
"No JPEG image is associated with this instance";
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Create a TurboJPEG decompresssor instance.
|
46
|
+
*/
|
47
|
+
public TJDecompressor() throws TJException {
|
48
|
+
init();
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Create a TurboJPEG decompressor instance and associate the JPEG source
|
53
|
+
* image stored in <code>jpegImage</code> with the newly created instance.
|
54
|
+
*
|
55
|
+
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
|
56
|
+
* be the length of the array.) This buffer is not modified.
|
57
|
+
*/
|
58
|
+
public TJDecompressor(byte[] jpegImage) throws TJException {
|
59
|
+
init();
|
60
|
+
setSourceImage(jpegImage, jpegImage.length);
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Create a TurboJPEG decompressor instance and associate the JPEG source
|
65
|
+
* image of length <code>imageSize</code> bytes stored in
|
66
|
+
* <code>jpegImage</code> with the newly created instance.
|
67
|
+
*
|
68
|
+
* @param jpegImage JPEG image buffer. This buffer is not modified.
|
69
|
+
*
|
70
|
+
* @param imageSize size of the JPEG image (in bytes)
|
71
|
+
*/
|
72
|
+
public TJDecompressor(byte[] jpegImage, int imageSize) throws TJException {
|
73
|
+
init();
|
74
|
+
setSourceImage(jpegImage, imageSize);
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Create a TurboJPEG decompressor instance and associate the YUV planar
|
79
|
+
* source image stored in <code>yuvImage</code> with the newly created
|
80
|
+
* instance.
|
81
|
+
*
|
82
|
+
* @param yuvImage {@link YUVImage} instance containing a YUV planar
|
83
|
+
* image to be decoded. This image is not modified.
|
84
|
+
*/
|
85
|
+
@SuppressWarnings("checkstyle:HiddenField")
|
86
|
+
public TJDecompressor(YUVImage yuvImage) throws TJException {
|
87
|
+
init();
|
88
|
+
setSourceImage(yuvImage);
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
93
|
+
* <code>jpegImage</code> with this decompressor instance. This image will
|
94
|
+
* be used as the source image for subsequent decompress operations.
|
95
|
+
*
|
96
|
+
* @param jpegImage JPEG image buffer. This buffer is not modified.
|
97
|
+
*
|
98
|
+
* @param imageSize size of the JPEG image (in bytes)
|
99
|
+
*/
|
100
|
+
public void setSourceImage(byte[] jpegImage, int imageSize)
|
101
|
+
throws TJException {
|
102
|
+
if (jpegImage == null || imageSize < 1)
|
103
|
+
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
104
|
+
jpegBuf = jpegImage;
|
105
|
+
jpegBufSize = imageSize;
|
106
|
+
decompressHeader(jpegBuf, jpegBufSize);
|
107
|
+
yuvImage = null;
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* @deprecated Use {@link #setSourceImage(byte[], int)} instead.
|
112
|
+
*/
|
113
|
+
@SuppressWarnings("checkstyle:JavadocMethod")
|
114
|
+
@Deprecated
|
115
|
+
public void setJPEGImage(byte[] jpegImage, int imageSize)
|
116
|
+
throws TJException {
|
117
|
+
setSourceImage(jpegImage, imageSize);
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Associate the specified YUV planar source image with this decompressor
|
122
|
+
* instance. Subsequent decompress operations will decode this image into an
|
123
|
+
* RGB or grayscale destination image.
|
124
|
+
*
|
125
|
+
* @param srcImage {@link YUVImage} instance containing a YUV planar image to
|
126
|
+
* be decoded. This image is not modified.
|
127
|
+
*/
|
128
|
+
public void setSourceImage(YUVImage srcImage) {
|
129
|
+
if (srcImage == null)
|
130
|
+
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
131
|
+
yuvImage = srcImage;
|
132
|
+
jpegBuf = null;
|
133
|
+
jpegBufSize = 0;
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Returns the width of the source image (JPEG or YUV) associated with this
|
139
|
+
* decompressor instance.
|
140
|
+
*
|
141
|
+
* @return the width of the source image (JPEG or YUV) associated with this
|
142
|
+
* decompressor instance.
|
143
|
+
*/
|
144
|
+
public int getWidth() {
|
145
|
+
if (yuvImage != null)
|
146
|
+
return yuvImage.getWidth();
|
147
|
+
if (jpegWidth < 1)
|
148
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
149
|
+
return jpegWidth;
|
150
|
+
}
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Returns the height of the source image (JPEG or YUV) associated with this
|
154
|
+
* decompressor instance.
|
155
|
+
*
|
156
|
+
* @return the height of the source image (JPEG or YUV) associated with this
|
157
|
+
* decompressor instance.
|
158
|
+
*/
|
159
|
+
public int getHeight() {
|
160
|
+
if (yuvImage != null)
|
161
|
+
return yuvImage.getHeight();
|
162
|
+
if (jpegHeight < 1)
|
163
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
164
|
+
return jpegHeight;
|
165
|
+
}
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Returns the level of chrominance subsampling used in the source image
|
169
|
+
* (JPEG or YUV) associated with this decompressor instance. See
|
170
|
+
* {@link TJ#SAMP_444 TJ.SAMP_*}.
|
171
|
+
*
|
172
|
+
* @return the level of chrominance subsampling used in the source image
|
173
|
+
* (JPEG or YUV) associated with this decompressor instance.
|
174
|
+
*/
|
175
|
+
public int getSubsamp() {
|
176
|
+
if (yuvImage != null)
|
177
|
+
return yuvImage.getSubsamp();
|
178
|
+
if (jpegSubsamp < 0)
|
179
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
180
|
+
if (jpegSubsamp >= TJ.NUMSAMP)
|
181
|
+
throw new IllegalStateException("JPEG header information is invalid");
|
182
|
+
return jpegSubsamp;
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Returns the colorspace used in the source image (JPEG or YUV) associated
|
187
|
+
* with this decompressor instance. See {@link TJ#CS_RGB TJ.CS_*}. If the
|
188
|
+
* source image is YUV, then this always returns {@link TJ#CS_YCbCr}.
|
189
|
+
*
|
190
|
+
* @return the colorspace used in the source image (JPEG or YUV) associated
|
191
|
+
* with this decompressor instance.
|
192
|
+
*/
|
193
|
+
public int getColorspace() {
|
194
|
+
if (yuvImage != null)
|
195
|
+
return TJ.CS_YCbCr;
|
196
|
+
if (jpegColorspace < 0)
|
197
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
198
|
+
if (jpegColorspace >= TJ.NUMCS)
|
199
|
+
throw new IllegalStateException("JPEG header information is invalid");
|
200
|
+
return jpegColorspace;
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Returns the JPEG image buffer associated with this decompressor instance.
|
205
|
+
*
|
206
|
+
* @return the JPEG image buffer associated with this decompressor instance.
|
207
|
+
*/
|
208
|
+
public byte[] getJPEGBuf() {
|
209
|
+
if (jpegBuf == null)
|
210
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
211
|
+
return jpegBuf;
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Returns the size of the JPEG image (in bytes) associated with this
|
216
|
+
* decompressor instance.
|
217
|
+
*
|
218
|
+
* @return the size of the JPEG image (in bytes) associated with this
|
219
|
+
* decompressor instance.
|
220
|
+
*/
|
221
|
+
public int getJPEGSize() {
|
222
|
+
if (jpegBufSize < 1)
|
223
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
224
|
+
return jpegBufSize;
|
225
|
+
}
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Returns the width of the largest scaled-down image that the TurboJPEG
|
229
|
+
* decompressor can generate without exceeding the desired image width and
|
230
|
+
* height.
|
231
|
+
*
|
232
|
+
* @param desiredWidth desired width (in pixels) of the decompressed image.
|
233
|
+
* Setting this to 0 is the same as setting it to the width of the JPEG image
|
234
|
+
* (in other words, the width will not be considered when determining the
|
235
|
+
* scaled image size.)
|
236
|
+
*
|
237
|
+
* @param desiredHeight desired height (in pixels) of the decompressed image.
|
238
|
+
* Setting this to 0 is the same as setting it to the height of the JPEG
|
239
|
+
* image (in other words, the height will not be considered when determining
|
240
|
+
* the scaled image size.)
|
241
|
+
*
|
242
|
+
* @return the width of the largest scaled-down image that the TurboJPEG
|
243
|
+
* decompressor can generate without exceeding the desired image width and
|
244
|
+
* height.
|
245
|
+
*/
|
246
|
+
public int getScaledWidth(int desiredWidth, int desiredHeight) {
|
247
|
+
if (jpegWidth < 1 || jpegHeight < 1)
|
248
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
249
|
+
if (desiredWidth < 0 || desiredHeight < 0)
|
250
|
+
throw new IllegalArgumentException("Invalid argument in getScaledWidth()");
|
251
|
+
TJScalingFactor[] sf = TJ.getScalingFactors();
|
252
|
+
if (desiredWidth == 0)
|
253
|
+
desiredWidth = jpegWidth;
|
254
|
+
if (desiredHeight == 0)
|
255
|
+
desiredHeight = jpegHeight;
|
256
|
+
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
|
257
|
+
for (int i = 0; i < sf.length; i++) {
|
258
|
+
scaledWidth = sf[i].getScaled(jpegWidth);
|
259
|
+
scaledHeight = sf[i].getScaled(jpegHeight);
|
260
|
+
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
|
261
|
+
break;
|
262
|
+
}
|
263
|
+
if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)
|
264
|
+
throw new IllegalArgumentException("Could not scale down to desired image dimensions");
|
265
|
+
return scaledWidth;
|
266
|
+
}
|
267
|
+
|
268
|
+
/**
|
269
|
+
* Returns the height of the largest scaled-down image that the TurboJPEG
|
270
|
+
* decompressor can generate without exceeding the desired image width and
|
271
|
+
* height.
|
272
|
+
*
|
273
|
+
* @param desiredWidth desired width (in pixels) of the decompressed image.
|
274
|
+
* Setting this to 0 is the same as setting it to the width of the JPEG image
|
275
|
+
* (in other words, the width will not be considered when determining the
|
276
|
+
* scaled image size.)
|
277
|
+
*
|
278
|
+
* @param desiredHeight desired height (in pixels) of the decompressed image.
|
279
|
+
* Setting this to 0 is the same as setting it to the height of the JPEG
|
280
|
+
* image (in other words, the height will not be considered when determining
|
281
|
+
* the scaled image size.)
|
282
|
+
*
|
283
|
+
* @return the height of the largest scaled-down image that the TurboJPEG
|
284
|
+
* decompressor can generate without exceeding the desired image width and
|
285
|
+
* height.
|
286
|
+
*/
|
287
|
+
public int getScaledHeight(int desiredWidth, int desiredHeight) {
|
288
|
+
if (jpegWidth < 1 || jpegHeight < 1)
|
289
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
290
|
+
if (desiredWidth < 0 || desiredHeight < 0)
|
291
|
+
throw new IllegalArgumentException("Invalid argument in getScaledHeight()");
|
292
|
+
TJScalingFactor[] sf = TJ.getScalingFactors();
|
293
|
+
if (desiredWidth == 0)
|
294
|
+
desiredWidth = jpegWidth;
|
295
|
+
if (desiredHeight == 0)
|
296
|
+
desiredHeight = jpegHeight;
|
297
|
+
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
|
298
|
+
for (int i = 0; i < sf.length; i++) {
|
299
|
+
scaledWidth = sf[i].getScaled(jpegWidth);
|
300
|
+
scaledHeight = sf[i].getScaled(jpegHeight);
|
301
|
+
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
|
302
|
+
break;
|
303
|
+
}
|
304
|
+
if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)
|
305
|
+
throw new IllegalArgumentException("Could not scale down to desired image dimensions");
|
306
|
+
return scaledHeight;
|
307
|
+
}
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Decompress the JPEG source image or decode the YUV source image associated
|
311
|
+
* with this decompressor instance and output a grayscale, RGB, or CMYK image
|
312
|
+
* to the given destination buffer.
|
313
|
+
* <p>
|
314
|
+
* NOTE: The output image is fully recoverable if this method throws a
|
315
|
+
* non-fatal {@link TJException} (unless
|
316
|
+
* {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.)
|
317
|
+
*
|
318
|
+
* @param dstBuf buffer that will receive the decompressed/decoded image.
|
319
|
+
* If the source image is a JPEG image, then this buffer should normally be
|
320
|
+
* <code>pitch * scaledHeight</code> bytes in size, where
|
321
|
+
* <code>scaledHeight</code> can be determined by calling <code>
|
322
|
+
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
|
323
|
+
* </code> with one of the scaling factors returned from {@link
|
324
|
+
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
|
325
|
+
* source image is a YUV image, then this buffer should normally be
|
326
|
+
* <code>pitch * height</code> bytes in size, where <code>height</code> is
|
327
|
+
* the height of the YUV image. However, the buffer may also be larger than
|
328
|
+
* the dimensions of the source image, in which case the <code>x</code>,
|
329
|
+
* <code>y</code>, and <code>pitch</code> parameters can be used to specify
|
330
|
+
* the region into which the source image should be decompressed/decoded.
|
331
|
+
*
|
332
|
+
* @param x x offset (in pixels) of the region in the destination image into
|
333
|
+
* which the source image should be decompressed/decoded
|
334
|
+
*
|
335
|
+
* @param y y offset (in pixels) of the region in the destination image into
|
336
|
+
* which the source image should be decompressed/decoded
|
337
|
+
*
|
338
|
+
* @param desiredWidth If the source image is a JPEG image, then this
|
339
|
+
* specifies the desired width (in pixels) of the decompressed image (or
|
340
|
+
* image region.) If the desired destination image dimensions are different
|
341
|
+
* than the source image dimensions, then TurboJPEG will use scaling in the
|
342
|
+
* JPEG decompressor to generate the largest possible image that will fit
|
343
|
+
* within the desired dimensions. Setting this to 0 is the same as setting
|
344
|
+
* it to the width of the JPEG image (in other words, the width will not be
|
345
|
+
* considered when determining the scaled image size.) This parameter is
|
346
|
+
* ignored if the source image is a YUV image.
|
347
|
+
*
|
348
|
+
* @param pitch bytes per line of the destination image. Normally, this
|
349
|
+
* should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
|
350
|
+
* the destination image is unpadded, but you can use this to, for instance,
|
351
|
+
* pad each line of the destination image to a 4-byte boundary or to
|
352
|
+
* decompress/decode the source image into a region of a larger image. NOTE:
|
353
|
+
* if the source image is a JPEG image, then <code>scaledWidth</code> can be
|
354
|
+
* determined by calling <code>
|
355
|
+
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
|
356
|
+
* </code> or by calling {@link #getScaledWidth}. If the source image is a
|
357
|
+
* YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
358
|
+
* Setting this parameter to 0 is the equivalent of setting it to
|
359
|
+
* <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.
|
360
|
+
*
|
361
|
+
* @param desiredHeight If the source image is a JPEG image, then this
|
362
|
+
* specifies the desired height (in pixels) of the decompressed image (or
|
363
|
+
* image region.) If the desired destination image dimensions are different
|
364
|
+
* than the source image dimensions, then TurboJPEG will use scaling in the
|
365
|
+
* JPEG decompressor to generate the largest possible image that will fit
|
366
|
+
* within the desired dimensions. Setting this to 0 is the same as setting
|
367
|
+
* it to the height of the JPEG image (in other words, the height will not be
|
368
|
+
* considered when determining the scaled image size.) This parameter is
|
369
|
+
* ignored if the source image is a YUV image.
|
370
|
+
*
|
371
|
+
* @param pixelFormat pixel format of the decompressed/decoded image (one of
|
372
|
+
* {@link TJ#PF_RGB TJ.PF_*})
|
373
|
+
*
|
374
|
+
* @param flags the bitwise OR of one or more of
|
375
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
376
|
+
*/
|
377
|
+
public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,
|
378
|
+
int pitch, int desiredHeight, int pixelFormat,
|
379
|
+
int flags) throws TJException {
|
380
|
+
if (jpegBuf == null && yuvImage == null)
|
381
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
382
|
+
if (dstBuf == null || x < 0 || y < 0 || pitch < 0 ||
|
383
|
+
(yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
384
|
+
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
385
|
+
throw new IllegalArgumentException("Invalid argument in decompress()");
|
386
|
+
if (yuvImage != null)
|
387
|
+
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
388
|
+
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
389
|
+
yuvImage.getWidth(), pitch, yuvImage.getHeight(), pixelFormat,
|
390
|
+
flags);
|
391
|
+
else {
|
392
|
+
if (x > 0 || y > 0)
|
393
|
+
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,
|
394
|
+
desiredHeight, pixelFormat, flags);
|
395
|
+
else
|
396
|
+
decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch,
|
397
|
+
desiredHeight, pixelFormat, flags);
|
398
|
+
}
|
399
|
+
}
|
400
|
+
|
401
|
+
/**
|
402
|
+
* @deprecated Use
|
403
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)} instead.
|
404
|
+
*/
|
405
|
+
@SuppressWarnings("checkstyle:JavadocMethod")
|
406
|
+
@Deprecated
|
407
|
+
public void decompress(byte[] dstBuf, int desiredWidth, int pitch,
|
408
|
+
int desiredHeight, int pixelFormat, int flags)
|
409
|
+
throws TJException {
|
410
|
+
decompress(dstBuf, 0, 0, desiredWidth, pitch, desiredHeight, pixelFormat,
|
411
|
+
flags);
|
412
|
+
}
|
413
|
+
|
414
|
+
/**
|
415
|
+
* Decompress the JPEG source image associated with this decompressor
|
416
|
+
* instance and return a buffer containing the decompressed image.
|
417
|
+
*
|
418
|
+
* @param desiredWidth see
|
419
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
|
420
|
+
* for description
|
421
|
+
*
|
422
|
+
* @param pitch see
|
423
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
|
424
|
+
* for description
|
425
|
+
*
|
426
|
+
* @param desiredHeight see
|
427
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
|
428
|
+
* for description
|
429
|
+
*
|
430
|
+
* @param pixelFormat pixel format of the decompressed image (one of
|
431
|
+
* {@link TJ#PF_RGB TJ.PF_*})
|
432
|
+
*
|
433
|
+
* @param flags the bitwise OR of one or more of
|
434
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
435
|
+
*
|
436
|
+
* @return a buffer containing the decompressed image.
|
437
|
+
*/
|
438
|
+
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
|
439
|
+
int pixelFormat, int flags) throws TJException {
|
440
|
+
if (pitch < 0 ||
|
441
|
+
(yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
442
|
+
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
443
|
+
throw new IllegalArgumentException("Invalid argument in decompress()");
|
444
|
+
int pixelSize = TJ.getPixelSize(pixelFormat);
|
445
|
+
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
446
|
+
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
447
|
+
if (pitch == 0)
|
448
|
+
pitch = scaledWidth * pixelSize;
|
449
|
+
byte[] buf = new byte[pitch * scaledHeight];
|
450
|
+
decompress(buf, desiredWidth, pitch, desiredHeight, pixelFormat, flags);
|
451
|
+
return buf;
|
452
|
+
}
|
453
|
+
|
454
|
+
/**
|
455
|
+
* Decompress the JPEG source image associated with this decompressor
|
456
|
+
* instance into a YUV planar image and store it in the given
|
457
|
+
* <code>YUVImage</code> instance. This method performs JPEG decompression
|
458
|
+
* but leaves out the color conversion step, so a planar YUV image is
|
459
|
+
* generated instead of an RGB or grayscale image. This method cannot be
|
460
|
+
* used to decompress JPEG source images with the CMYK or YCCK colorspace.
|
461
|
+
* <p>
|
462
|
+
* NOTE: The YUV planar output image is fully recoverable if this method
|
463
|
+
* throws a non-fatal {@link TJException} (unless
|
464
|
+
* {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.)
|
465
|
+
*
|
466
|
+
* @param dstImage {@link YUVImage} instance that will receive the YUV planar
|
467
|
+
* image. The level of subsampling specified in this <code>YUVImage</code>
|
468
|
+
* instance must match that of the JPEG image, and the width and height
|
469
|
+
* specified in the <code>YUVImage</code> instance must match one of the
|
470
|
+
* scaled image sizes that TurboJPEG is capable of generating from the JPEG
|
471
|
+
* source image.
|
472
|
+
*
|
473
|
+
* @param flags the bitwise OR of one or more of
|
474
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
475
|
+
*/
|
476
|
+
public void decompressToYUV(YUVImage dstImage, int flags)
|
477
|
+
throws TJException {
|
478
|
+
if (jpegBuf == null)
|
479
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
480
|
+
if (dstImage == null || flags < 0)
|
481
|
+
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
482
|
+
int scaledWidth = getScaledWidth(dstImage.getWidth(),
|
483
|
+
dstImage.getHeight());
|
484
|
+
int scaledHeight = getScaledHeight(dstImage.getWidth(),
|
485
|
+
dstImage.getHeight());
|
486
|
+
if (scaledWidth != dstImage.getWidth() ||
|
487
|
+
scaledHeight != dstImage.getHeight())
|
488
|
+
throw new IllegalArgumentException("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
489
|
+
if (jpegSubsamp != dstImage.getSubsamp())
|
490
|
+
throw new IllegalArgumentException("YUVImage subsampling level does not match that of the JPEG image");
|
491
|
+
|
492
|
+
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(),
|
493
|
+
dstImage.getOffsets(), dstImage.getWidth(),
|
494
|
+
dstImage.getStrides(), dstImage.getHeight(), flags);
|
495
|
+
}
|
496
|
+
|
497
|
+
/**
|
498
|
+
* @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.
|
499
|
+
*/
|
500
|
+
@SuppressWarnings("checkstyle:JavadocMethod")
|
501
|
+
@Deprecated
|
502
|
+
public void decompressToYUV(byte[] dstBuf, int flags) throws TJException {
|
503
|
+
YUVImage dstYUVImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,
|
504
|
+
jpegSubsamp);
|
505
|
+
decompressToYUV(dstYUVImage, flags);
|
506
|
+
}
|
507
|
+
|
508
|
+
/**
|
509
|
+
* Decompress the JPEG source image associated with this decompressor
|
510
|
+
* instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
511
|
+
* <code>YUVImage</code> instance containing the decompressed image planes.
|
512
|
+
* This method performs JPEG decompression but leaves out the color
|
513
|
+
* conversion step, so a planar YUV image is generated instead of an RGB or
|
514
|
+
* grayscale image. This method cannot be used to decompress JPEG source
|
515
|
+
* images with the CMYK or YCCK colorspace.
|
516
|
+
*
|
517
|
+
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
518
|
+
* desired image dimensions are different than the dimensions of the JPEG
|
519
|
+
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
520
|
+
* decompressor to generate the largest possible image that will fit within
|
521
|
+
* the desired dimensions. Setting this to 0 is the same as setting it to
|
522
|
+
* the width of the JPEG image (in other words, the width will not be
|
523
|
+
* considered when determining the scaled image size.)
|
524
|
+
*
|
525
|
+
* @param strides an array of integers, each specifying the number of bytes
|
526
|
+
* per line in the corresponding plane of the output image. Setting the
|
527
|
+
* stride for any plane to 0 is the same as setting it to the scaled
|
528
|
+
* component width of the plane. If <tt>strides</tt> is NULL, then the
|
529
|
+
* strides for all planes will be set to their respective scaled component
|
530
|
+
* widths. You can adjust the strides in order to add an arbitrary amount of
|
531
|
+
* line padding to each plane.
|
532
|
+
*
|
533
|
+
* @param desiredHeight desired height (in pixels) of the YUV image. If the
|
534
|
+
* desired image dimensions are different than the dimensions of the JPEG
|
535
|
+
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
536
|
+
* decompressor to generate the largest possible image that will fit within
|
537
|
+
* the desired dimensions. Setting this to 0 is the same as setting it to
|
538
|
+
* the height of the JPEG image (in other words, the height will not be
|
539
|
+
* considered when determining the scaled image size.)
|
540
|
+
*
|
541
|
+
* @param flags the bitwise OR of one or more of
|
542
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
543
|
+
*
|
544
|
+
* @return a YUV planar image.
|
545
|
+
*/
|
546
|
+
public YUVImage decompressToYUV(int desiredWidth, int[] strides,
|
547
|
+
int desiredHeight,
|
548
|
+
int flags) throws TJException {
|
549
|
+
if (flags < 0)
|
550
|
+
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
551
|
+
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
552
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
553
|
+
if (jpegSubsamp >= TJ.NUMSAMP)
|
554
|
+
throw new IllegalStateException("JPEG header information is invalid");
|
555
|
+
if (yuvImage != null)
|
556
|
+
throw new IllegalStateException("Source image is the wrong type");
|
557
|
+
|
558
|
+
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
559
|
+
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
560
|
+
YUVImage dstYUVImage = new YUVImage(scaledWidth, null, scaledHeight,
|
561
|
+
jpegSubsamp);
|
562
|
+
decompressToYUV(dstYUVImage, flags);
|
563
|
+
return dstYUVImage;
|
564
|
+
}
|
565
|
+
|
566
|
+
/**
|
567
|
+
* Decompress the JPEG source image associated with this decompressor
|
568
|
+
* instance into a unified YUV planar image buffer and return a
|
569
|
+
* <code>YUVImage</code> instance containing the decompressed image. This
|
570
|
+
* method performs JPEG decompression but leaves out the color conversion
|
571
|
+
* step, so a planar YUV image is generated instead of an RGB or grayscale
|
572
|
+
* image. This method cannot be used to decompress JPEG source images with
|
573
|
+
* the CMYK or YCCK colorspace.
|
574
|
+
*
|
575
|
+
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
576
|
+
* desired image dimensions are different than the dimensions of the JPEG
|
577
|
+
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
578
|
+
* decompressor to generate the largest possible image that will fit within
|
579
|
+
* the desired dimensions. Setting this to 0 is the same as setting it to
|
580
|
+
* the width of the JPEG image (in other words, the width will not be
|
581
|
+
* considered when determining the scaled image size.)
|
582
|
+
*
|
583
|
+
* @param pad the width of each line in each plane of the YUV image will be
|
584
|
+
* padded to the nearest multiple of this number of bytes (must be a power of
|
585
|
+
* 2.)
|
586
|
+
*
|
587
|
+
* @param desiredHeight desired height (in pixels) of the YUV image. If the
|
588
|
+
* desired image dimensions are different than the dimensions of the JPEG
|
589
|
+
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
590
|
+
* decompressor to generate the largest possible image that will fit within
|
591
|
+
* the desired dimensions. Setting this to 0 is the same as setting it to
|
592
|
+
* the height of the JPEG image (in other words, the height will not be
|
593
|
+
* considered when determining the scaled image size.)
|
594
|
+
*
|
595
|
+
* @param flags the bitwise OR of one or more of
|
596
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
597
|
+
*
|
598
|
+
* @return a YUV planar image.
|
599
|
+
*/
|
600
|
+
public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
|
601
|
+
int flags) throws TJException {
|
602
|
+
if (flags < 0)
|
603
|
+
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
604
|
+
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
605
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
606
|
+
if (jpegSubsamp >= TJ.NUMSAMP)
|
607
|
+
throw new IllegalStateException("JPEG header information is invalid");
|
608
|
+
if (yuvImage != null)
|
609
|
+
throw new IllegalStateException("Source image is the wrong type");
|
610
|
+
|
611
|
+
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
612
|
+
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
613
|
+
YUVImage dstYUVImage = new YUVImage(scaledWidth, pad, scaledHeight,
|
614
|
+
jpegSubsamp);
|
615
|
+
decompressToYUV(dstYUVImage, flags);
|
616
|
+
return dstYUVImage;
|
617
|
+
}
|
618
|
+
|
619
|
+
/**
|
620
|
+
* @deprecated Use {@link #decompressToYUV(int, int, int, int)} instead.
|
621
|
+
*/
|
622
|
+
@SuppressWarnings("checkstyle:JavadocMethod")
|
623
|
+
@Deprecated
|
624
|
+
public byte[] decompressToYUV(int flags) throws TJException {
|
625
|
+
YUVImage dstYUVImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);
|
626
|
+
decompressToYUV(dstYUVImage, flags);
|
627
|
+
return dstYUVImage.getBuf();
|
628
|
+
}
|
629
|
+
|
630
|
+
/**
|
631
|
+
* Decompress the JPEG source image or decode the YUV source image associated
|
632
|
+
* with this decompressor instance and output a grayscale, RGB, or CMYK image
|
633
|
+
* to the given destination buffer.
|
634
|
+
* <p>
|
635
|
+
* NOTE: The output image is fully recoverable if this method throws a
|
636
|
+
* non-fatal {@link TJException} (unless
|
637
|
+
* {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.)
|
638
|
+
*
|
639
|
+
* @param dstBuf buffer that will receive the decompressed/decoded image.
|
640
|
+
* If the source image is a JPEG image, then this buffer should normally be
|
641
|
+
* <code>stride * scaledHeight</code> pixels in size, where
|
642
|
+
* <code>scaledHeight</code> can be determined by calling <code>
|
643
|
+
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
|
644
|
+
* </code> with one of the scaling factors returned from {@link
|
645
|
+
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
|
646
|
+
* source image is a YUV image, then this buffer should normally be
|
647
|
+
* <code>stride * height</code> pixels in size, where <code>height</code> is
|
648
|
+
* the height of the YUV image. However, the buffer may also be larger than
|
649
|
+
* the dimensions of the JPEG image, in which case the <code>x</code>,
|
650
|
+
* <code>y</code>, and <code>stride</code> parameters can be used to specify
|
651
|
+
* the region into which the source image should be decompressed.
|
652
|
+
*
|
653
|
+
* @param x x offset (in pixels) of the region in the destination image into
|
654
|
+
* which the source image should be decompressed/decoded
|
655
|
+
*
|
656
|
+
* @param y y offset (in pixels) of the region in the destination image into
|
657
|
+
* which the source image should be decompressed/decoded
|
658
|
+
*
|
659
|
+
* @param desiredWidth If the source image is a JPEG image, then this
|
660
|
+
* specifies the desired width (in pixels) of the decompressed image (or
|
661
|
+
* image region.) If the desired destination image dimensions are different
|
662
|
+
* than the source image dimensions, then TurboJPEG will use scaling in the
|
663
|
+
* JPEG decompressor to generate the largest possible image that will fit
|
664
|
+
* within the desired dimensions. Setting this to 0 is the same as setting
|
665
|
+
* it to the width of the JPEG image (in other words, the width will not be
|
666
|
+
* considered when determining the scaled image size.) This parameter is
|
667
|
+
* ignored if the source image is a YUV image.
|
668
|
+
*
|
669
|
+
* @param stride pixels per line of the destination image. Normally, this
|
670
|
+
* should be set to <code>scaledWidth</code>, but you can use this to, for
|
671
|
+
* instance, decompress the JPEG image into a region of a larger image.
|
672
|
+
* NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>
|
673
|
+
* can be determined by calling <code>
|
674
|
+
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
|
675
|
+
* </code> or by calling {@link #getScaledWidth}. If the source image is a
|
676
|
+
* YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
677
|
+
* Setting this parameter to 0 is the equivalent of setting it to
|
678
|
+
* <code>scaledWidth</code>.
|
679
|
+
*
|
680
|
+
* @param desiredHeight If the source image is a JPEG image, then this
|
681
|
+
* specifies the desired height (in pixels) of the decompressed image (or
|
682
|
+
* image region.) If the desired destination image dimensions are different
|
683
|
+
* than the source image dimensions, then TurboJPEG will use scaling in the
|
684
|
+
* JPEG decompressor to generate the largest possible image that will fit
|
685
|
+
* within the desired dimensions. Setting this to 0 is the same as setting
|
686
|
+
* it to the height of the JPEG image (in other words, the height will not be
|
687
|
+
* considered when determining the scaled image size.) This parameter is
|
688
|
+
* ignored if the source image is a YUV image.
|
689
|
+
*
|
690
|
+
* @param pixelFormat pixel format of the decompressed image (one of
|
691
|
+
* {@link TJ#PF_RGB TJ.PF_*})
|
692
|
+
*
|
693
|
+
* @param flags the bitwise OR of one or more of
|
694
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
695
|
+
*/
|
696
|
+
public void decompress(int[] dstBuf, int x, int y, int desiredWidth,
|
697
|
+
int stride, int desiredHeight, int pixelFormat,
|
698
|
+
int flags) throws TJException {
|
699
|
+
if (jpegBuf == null && yuvImage == null)
|
700
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
701
|
+
if (dstBuf == null || x < 0 || y < 0 || stride < 0 ||
|
702
|
+
(yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
703
|
+
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
704
|
+
throw new IllegalArgumentException("Invalid argument in decompress()");
|
705
|
+
if (yuvImage != null)
|
706
|
+
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
707
|
+
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
708
|
+
yuvImage.getWidth(), stride, yuvImage.getHeight(), pixelFormat,
|
709
|
+
flags);
|
710
|
+
else
|
711
|
+
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,
|
712
|
+
desiredHeight, pixelFormat, flags);
|
713
|
+
}
|
714
|
+
|
715
|
+
/**
|
716
|
+
* Decompress the JPEG source image or decode the YUV source image associated
|
717
|
+
* with this decompressor instance and output a decompressed/decoded image to
|
718
|
+
* the given <code>BufferedImage</code> instance.
|
719
|
+
* <p>
|
720
|
+
* NOTE: The output image is fully recoverable if this method throws a
|
721
|
+
* non-fatal {@link TJException} (unless
|
722
|
+
* {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.)
|
723
|
+
*
|
724
|
+
* @param dstImage a <code>BufferedImage</code> instance that will receive
|
725
|
+
* the decompressed/decoded image. If the source image is a JPEG image, then
|
726
|
+
* the width and height of the <code>BufferedImage</code> instance must match
|
727
|
+
* one of the scaled image sizes that TurboJPEG is capable of generating from
|
728
|
+
* the JPEG image. If the source image is a YUV image, then the width and
|
729
|
+
* height of the <code>BufferedImage</code> instance must match the width and
|
730
|
+
* height of the YUV image.
|
731
|
+
*
|
732
|
+
* @param flags the bitwise OR of one or more of
|
733
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
734
|
+
*/
|
735
|
+
public void decompress(BufferedImage dstImage, int flags)
|
736
|
+
throws TJException {
|
737
|
+
if (dstImage == null || flags < 0)
|
738
|
+
throw new IllegalArgumentException("Invalid argument in decompress()");
|
739
|
+
int desiredWidth = dstImage.getWidth();
|
740
|
+
int desiredHeight = dstImage.getHeight();
|
741
|
+
int scaledWidth, scaledHeight;
|
742
|
+
|
743
|
+
if (yuvImage != null) {
|
744
|
+
if (desiredWidth != yuvImage.getWidth() ||
|
745
|
+
desiredHeight != yuvImage.getHeight())
|
746
|
+
throw new IllegalArgumentException("BufferedImage dimensions do not match the dimensions of the source image.");
|
747
|
+
scaledWidth = yuvImage.getWidth();
|
748
|
+
scaledHeight = yuvImage.getHeight();
|
749
|
+
} else {
|
750
|
+
scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
751
|
+
scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
752
|
+
if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)
|
753
|
+
throw new IllegalArgumentException("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
754
|
+
}
|
755
|
+
int pixelFormat; boolean intPixels = false;
|
756
|
+
if (byteOrder == null)
|
757
|
+
byteOrder = ByteOrder.nativeOrder();
|
758
|
+
switch (dstImage.getType()) {
|
759
|
+
case BufferedImage.TYPE_3BYTE_BGR:
|
760
|
+
pixelFormat = TJ.PF_BGR; break;
|
761
|
+
case BufferedImage.TYPE_4BYTE_ABGR:
|
762
|
+
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
|
763
|
+
pixelFormat = TJ.PF_XBGR; break;
|
764
|
+
case BufferedImage.TYPE_BYTE_GRAY:
|
765
|
+
pixelFormat = TJ.PF_GRAY; break;
|
766
|
+
case BufferedImage.TYPE_INT_BGR:
|
767
|
+
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
768
|
+
pixelFormat = TJ.PF_XBGR;
|
769
|
+
else
|
770
|
+
pixelFormat = TJ.PF_RGBX;
|
771
|
+
intPixels = true; break;
|
772
|
+
case BufferedImage.TYPE_INT_RGB:
|
773
|
+
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
774
|
+
pixelFormat = TJ.PF_XRGB;
|
775
|
+
else
|
776
|
+
pixelFormat = TJ.PF_BGRX;
|
777
|
+
intPixels = true; break;
|
778
|
+
case BufferedImage.TYPE_INT_ARGB:
|
779
|
+
case BufferedImage.TYPE_INT_ARGB_PRE:
|
780
|
+
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
781
|
+
pixelFormat = TJ.PF_ARGB;
|
782
|
+
else
|
783
|
+
pixelFormat = TJ.PF_BGRA;
|
784
|
+
intPixels = true; break;
|
785
|
+
default:
|
786
|
+
throw new IllegalArgumentException("Unsupported BufferedImage format");
|
787
|
+
}
|
788
|
+
WritableRaster wr = dstImage.getRaster();
|
789
|
+
if (intPixels) {
|
790
|
+
SinglePixelPackedSampleModel sm =
|
791
|
+
(SinglePixelPackedSampleModel)dstImage.getSampleModel();
|
792
|
+
int stride = sm.getScanlineStride();
|
793
|
+
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
794
|
+
int[] buf = db.getData();
|
795
|
+
if (yuvImage != null)
|
796
|
+
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
797
|
+
yuvImage.getStrides(), yuvImage.getSubsamp(), buf, 0, 0,
|
798
|
+
yuvImage.getWidth(), stride, yuvImage.getHeight(),
|
799
|
+
pixelFormat, flags);
|
800
|
+
else {
|
801
|
+
if (jpegBuf == null)
|
802
|
+
throw new IllegalStateException(NO_ASSOC_ERROR);
|
803
|
+
decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride,
|
804
|
+
scaledHeight, pixelFormat, flags);
|
805
|
+
}
|
806
|
+
} else {
|
807
|
+
ComponentSampleModel sm =
|
808
|
+
(ComponentSampleModel)dstImage.getSampleModel();
|
809
|
+
int pixelSize = sm.getPixelStride();
|
810
|
+
if (pixelSize != TJ.getPixelSize(pixelFormat))
|
811
|
+
throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage");
|
812
|
+
int pitch = sm.getScanlineStride();
|
813
|
+
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
814
|
+
byte[] buf = db.getData();
|
815
|
+
decompress(buf, 0, 0, scaledWidth, pitch, scaledHeight, pixelFormat,
|
816
|
+
flags);
|
817
|
+
}
|
818
|
+
}
|
819
|
+
|
820
|
+
/**
|
821
|
+
* Decompress the JPEG source image or decode the YUV source image associated
|
822
|
+
* with this decompressor instance and return a <code>BufferedImage</code>
|
823
|
+
* instance containing the decompressed/decoded image.
|
824
|
+
*
|
825
|
+
* @param desiredWidth see
|
826
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for
|
827
|
+
* description
|
828
|
+
*
|
829
|
+
* @param desiredHeight see
|
830
|
+
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for
|
831
|
+
* description
|
832
|
+
*
|
833
|
+
* @param bufferedImageType the image type of the <code>BufferedImage</code>
|
834
|
+
* instance that will be created (for instance,
|
835
|
+
* <code>BufferedImage.TYPE_INT_RGB</code>)
|
836
|
+
*
|
837
|
+
* @param flags the bitwise OR of one or more of
|
838
|
+
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
839
|
+
*
|
840
|
+
* @return a <code>BufferedImage</code> instance containing the
|
841
|
+
* decompressed/decoded image.
|
842
|
+
*/
|
843
|
+
public BufferedImage decompress(int desiredWidth, int desiredHeight,
|
844
|
+
int bufferedImageType, int flags)
|
845
|
+
throws TJException {
|
846
|
+
if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
847
|
+
flags < 0)
|
848
|
+
throw new IllegalArgumentException("Invalid argument in decompress()");
|
849
|
+
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
850
|
+
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
851
|
+
BufferedImage img = new BufferedImage(scaledWidth, scaledHeight,
|
852
|
+
bufferedImageType);
|
853
|
+
decompress(img, flags);
|
854
|
+
return img;
|
855
|
+
}
|
856
|
+
|
857
|
+
/**
|
858
|
+
* Free the native structures associated with this decompressor instance.
|
859
|
+
*/
|
860
|
+
@Override
|
861
|
+
public void close() throws TJException {
|
862
|
+
if (handle != 0)
|
863
|
+
destroy();
|
864
|
+
}
|
865
|
+
|
866
|
+
@SuppressWarnings("checkstyle:DesignForExtension")
|
867
|
+
@Override
|
868
|
+
protected void finalize() throws Throwable {
|
869
|
+
try {
|
870
|
+
close();
|
871
|
+
} catch (TJException e) {
|
872
|
+
} finally {
|
873
|
+
super.finalize();
|
874
|
+
}
|
875
|
+
};
|
876
|
+
|
877
|
+
private native void init() throws TJException;
|
878
|
+
|
879
|
+
private native void destroy() throws TJException;
|
880
|
+
|
881
|
+
private native void decompressHeader(byte[] srcBuf, int size)
|
882
|
+
throws TJException;
|
883
|
+
|
884
|
+
@Deprecated
|
885
|
+
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf,
|
886
|
+
int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)
|
887
|
+
throws TJException;
|
888
|
+
|
889
|
+
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, int x,
|
890
|
+
int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat,
|
891
|
+
int flags) throws TJException;
|
892
|
+
|
893
|
+
@Deprecated
|
894
|
+
private native void decompress(byte[] srcBuf, int size, int[] dstBuf,
|
895
|
+
int desiredWidth, int stride, int desiredHeight, int pixelFormat,
|
896
|
+
int flags) throws TJException;
|
897
|
+
|
898
|
+
private native void decompress(byte[] srcBuf, int size, int[] dstBuf, int x,
|
899
|
+
int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat,
|
900
|
+
int flags) throws TJException;
|
901
|
+
|
902
|
+
@Deprecated
|
903
|
+
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
904
|
+
int flags) throws TJException;
|
905
|
+
|
906
|
+
private native void decompressToYUV(byte[] srcBuf, int size,
|
907
|
+
byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,
|
908
|
+
int desiredheight, int flags) throws TJException;
|
909
|
+
|
910
|
+
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
911
|
+
int[] srcStrides, int subsamp, byte[] dstBuf, int x, int y, int width,
|
912
|
+
int pitch, int height, int pixelFormat, int flags) throws TJException;
|
913
|
+
|
914
|
+
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
915
|
+
int[] srcStrides, int subsamp, int[] dstBuf, int x, int y, int width,
|
916
|
+
int stride, int height, int pixelFormat, int flags) throws TJException;
|
917
|
+
|
918
|
+
static {
|
919
|
+
TJLoader.load();
|
920
|
+
}
|
921
|
+
|
922
|
+
protected long handle = 0;
|
923
|
+
protected byte[] jpegBuf = null;
|
924
|
+
protected int jpegBufSize = 0;
|
925
|
+
protected YUVImage yuvImage = null;
|
926
|
+
protected int jpegWidth = 0;
|
927
|
+
protected int jpegHeight = 0;
|
928
|
+
protected int jpegSubsamp = -1;
|
929
|
+
protected int jpegColorspace = -1;
|
930
|
+
private ByteOrder byteOrder = null;
|
931
|
+
}
|