laag-libjpeg-turbo 1.5.3.0

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