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,1545 @@
1
+ /*
2
+ * Copyright (C)2009-2015, 2017 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
+ #ifndef __TURBOJPEG_H__
30
+ #define __TURBOJPEG_H__
31
+
32
+ #if defined(_WIN32) && defined(DLLDEFINE)
33
+ #define DLLEXPORT __declspec(dllexport)
34
+ #else
35
+ #define DLLEXPORT
36
+ #endif
37
+ #define DLLCALL
38
+
39
+
40
+ /**
41
+ * @addtogroup TurboJPEG
42
+ * TurboJPEG API. This API provides an interface for generating, decoding, and
43
+ * transforming planar YUV and JPEG images in memory.
44
+ *
45
+ * @anchor YUVnotes
46
+ * YUV Image Format Notes
47
+ * ----------------------
48
+ * Technically, the JPEG format uses the YCbCr colorspace (which is technically
49
+ * not a colorspace but a color transform), but per the convention of the
50
+ * digital video community, the TurboJPEG API uses "YUV" to refer to an image
51
+ * format consisting of Y, Cb, and Cr image planes.
52
+ *
53
+ * Each plane is simply a 2D array of bytes, each byte representing the value
54
+ * of one of the components (Y, Cb, or Cr) at a particular location in the
55
+ * image. The width and height of each plane are determined by the image
56
+ * width, height, and level of chrominance subsampling. The luminance plane
57
+ * width is the image width padded to the nearest multiple of the horizontal
58
+ * subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of
59
+ * 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane
60
+ * height is the image height padded to the nearest multiple of the vertical
61
+ * subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4
62
+ * or grayscale.) This is irrespective of any additional padding that may be
63
+ * specified as an argument to the various YUV functions. The chrominance
64
+ * plane width is equal to the luminance plane width divided by the horizontal
65
+ * subsampling factor, and the chrominance plane height is equal to the
66
+ * luminance plane height divided by the vertical subsampling factor.
67
+ *
68
+ * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
69
+ * used, then the luminance plane would be 36 x 35 bytes, and each of the
70
+ * chrominance planes would be 18 x 35 bytes. If you specify a line padding of
71
+ * 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
72
+ * each of the chrominance planes would be 20 x 35 bytes.
73
+ *
74
+ * @{
75
+ */
76
+
77
+
78
+ /**
79
+ * The number of chrominance subsampling options
80
+ */
81
+ #define TJ_NUMSAMP 6
82
+
83
+ /**
84
+ * Chrominance subsampling options.
85
+ * When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK
86
+ * to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of
87
+ * the Cb and Cr (chrominance) components can be discarded or averaged together
88
+ * to produce a smaller image with little perceptible loss of image clarity
89
+ * (the human eye is more sensitive to small changes in brightness than to
90
+ * small changes in color.) This is called "chrominance subsampling".
91
+ */
92
+ enum TJSAMP
93
+ {
94
+ /**
95
+ * 4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG or
96
+ * YUV image will contain one chrominance component for every pixel in the
97
+ * source image.
98
+ */
99
+ TJSAMP_444=0,
100
+ /**
101
+ * 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one
102
+ * chrominance component for every 2x1 block of pixels in the source image.
103
+ */
104
+ TJSAMP_422,
105
+ /**
106
+ * 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one
107
+ * chrominance component for every 2x2 block of pixels in the source image.
108
+ */
109
+ TJSAMP_420,
110
+ /**
111
+ * Grayscale. The JPEG or YUV image will contain no chrominance components.
112
+ */
113
+ TJSAMP_GRAY,
114
+ /**
115
+ * 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one
116
+ * chrominance component for every 1x2 block of pixels in the source image.
117
+ *
118
+ * @note 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
119
+ */
120
+ TJSAMP_440,
121
+ /**
122
+ * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one
123
+ * chrominance component for every 4x1 block of pixels in the source image.
124
+ * JPEG images compressed with 4:1:1 subsampling will be almost exactly the
125
+ * same size as those compressed with 4:2:0 subsampling, and in the
126
+ * aggregate, both subsampling methods produce approximately the same
127
+ * perceptual quality. However, 4:1:1 is better able to reproduce sharp
128
+ * horizontal features.
129
+ *
130
+ * @note 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.
131
+ */
132
+ TJSAMP_411
133
+ };
134
+
135
+ /**
136
+ * MCU block width (in pixels) for a given level of chrominance subsampling.
137
+ * MCU block sizes:
138
+ * - 8x8 for no subsampling or grayscale
139
+ * - 16x8 for 4:2:2
140
+ * - 8x16 for 4:4:0
141
+ * - 16x16 for 4:2:0
142
+ * - 32x8 for 4:1:1
143
+ */
144
+ static const int tjMCUWidth[TJ_NUMSAMP] = {8, 16, 16, 8, 8, 32};
145
+
146
+ /**
147
+ * MCU block height (in pixels) for a given level of chrominance subsampling.
148
+ * MCU block sizes:
149
+ * - 8x8 for no subsampling or grayscale
150
+ * - 16x8 for 4:2:2
151
+ * - 8x16 for 4:4:0
152
+ * - 16x16 for 4:2:0
153
+ * - 32x8 for 4:1:1
154
+ */
155
+ static const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16, 8};
156
+
157
+
158
+ /**
159
+ * The number of pixel formats
160
+ */
161
+ #define TJ_NUMPF 12
162
+
163
+ /**
164
+ * Pixel formats
165
+ */
166
+ enum TJPF
167
+ {
168
+ /**
169
+ * RGB pixel format. The red, green, and blue components in the image are
170
+ * stored in 3-byte pixels in the order R, G, B from lowest to highest byte
171
+ * address within each pixel.
172
+ */
173
+ TJPF_RGB=0,
174
+ /**
175
+ * BGR pixel format. The red, green, and blue components in the image are
176
+ * stored in 3-byte pixels in the order B, G, R from lowest to highest byte
177
+ * address within each pixel.
178
+ */
179
+ TJPF_BGR,
180
+ /**
181
+ * RGBX pixel format. The red, green, and blue components in the image are
182
+ * stored in 4-byte pixels in the order R, G, B from lowest to highest byte
183
+ * address within each pixel. The X component is ignored when compressing
184
+ * and undefined when decompressing.
185
+ */
186
+ TJPF_RGBX,
187
+ /**
188
+ * BGRX pixel format. The red, green, and blue components in the image are
189
+ * stored in 4-byte pixels in the order B, G, R from lowest to highest byte
190
+ * address within each pixel. The X component is ignored when compressing
191
+ * and undefined when decompressing.
192
+ */
193
+ TJPF_BGRX,
194
+ /**
195
+ * XBGR pixel format. The red, green, and blue components in the image are
196
+ * stored in 4-byte pixels in the order R, G, B from highest to lowest byte
197
+ * address within each pixel. The X component is ignored when compressing
198
+ * and undefined when decompressing.
199
+ */
200
+ TJPF_XBGR,
201
+ /**
202
+ * XRGB pixel format. The red, green, and blue components in the image are
203
+ * stored in 4-byte pixels in the order B, G, R from highest to lowest byte
204
+ * address within each pixel. The X component is ignored when compressing
205
+ * and undefined when decompressing.
206
+ */
207
+ TJPF_XRGB,
208
+ /**
209
+ * Grayscale pixel format. Each 1-byte pixel represents a luminance
210
+ * (brightness) level from 0 to 255.
211
+ */
212
+ TJPF_GRAY,
213
+ /**
214
+ * RGBA pixel format. This is the same as @ref TJPF_RGBX, except that when
215
+ * decompressing, the X component is guaranteed to be 0xFF, which can be
216
+ * interpreted as an opaque alpha channel.
217
+ */
218
+ TJPF_RGBA,
219
+ /**
220
+ * BGRA pixel format. This is the same as @ref TJPF_BGRX, except that when
221
+ * decompressing, the X component is guaranteed to be 0xFF, which can be
222
+ * interpreted as an opaque alpha channel.
223
+ */
224
+ TJPF_BGRA,
225
+ /**
226
+ * ABGR pixel format. This is the same as @ref TJPF_XBGR, except that when
227
+ * decompressing, the X component is guaranteed to be 0xFF, which can be
228
+ * interpreted as an opaque alpha channel.
229
+ */
230
+ TJPF_ABGR,
231
+ /**
232
+ * ARGB pixel format. This is the same as @ref TJPF_XRGB, except that when
233
+ * decompressing, the X component is guaranteed to be 0xFF, which can be
234
+ * interpreted as an opaque alpha channel.
235
+ */
236
+ TJPF_ARGB,
237
+ /**
238
+ * CMYK pixel format. Unlike RGB, which is an additive color model used
239
+ * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
240
+ * color model used primarily for printing. In the CMYK color model, the
241
+ * value of each color component typically corresponds to an amount of cyan,
242
+ * magenta, yellow, or black ink that is applied to a white background. In
243
+ * order to convert between CMYK and RGB, it is necessary to use a color
244
+ * management system (CMS.) A CMS will attempt to map colors within the
245
+ * printer's gamut to perceptually similar colors in the display's gamut and
246
+ * vice versa, but the mapping is typically not 1:1 or reversible, nor can it
247
+ * be defined with a simple formula. Thus, such a conversion is out of scope
248
+ * for a codec library. However, the TurboJPEG API allows for compressing
249
+ * CMYK pixels into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK
250
+ * JPEG images into CMYK pixels.
251
+ */
252
+ TJPF_CMYK
253
+ };
254
+
255
+
256
+ /**
257
+ * Red offset (in bytes) for a given pixel format. This specifies the number
258
+ * of bytes that the red component is offset from the start of the pixel. For
259
+ * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
260
+ * then the red component will be <tt>pixel[tjRedOffset[TJ_BGRX]]</tt>.
261
+ */
262
+ static const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1, -1};
263
+ /**
264
+ * Green offset (in bytes) for a given pixel format. This specifies the number
265
+ * of bytes that the green component is offset from the start of the pixel.
266
+ * For instance, if a pixel of format TJ_BGRX is stored in
267
+ * <tt>char pixel[]</tt>, then the green component will be
268
+ * <tt>pixel[tjGreenOffset[TJ_BGRX]]</tt>.
269
+ */
270
+ static const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2, -1};
271
+ /**
272
+ * Blue offset (in bytes) for a given pixel format. This specifies the number
273
+ * of bytes that the Blue component is offset from the start of the pixel. For
274
+ * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
275
+ * then the blue component will be <tt>pixel[tjBlueOffset[TJ_BGRX]]</tt>.
276
+ */
277
+ static const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3, -1};
278
+ /**
279
+ * Pixel size (in bytes) for a given pixel format.
280
+ */
281
+ static const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4};
282
+
283
+
284
+ /**
285
+ * The number of JPEG colorspaces
286
+ */
287
+ #define TJ_NUMCS 5
288
+
289
+ /**
290
+ * JPEG colorspaces
291
+ */
292
+ enum TJCS
293
+ {
294
+ /**
295
+ * RGB colorspace. When compressing the JPEG image, the R, G, and B
296
+ * components in the source image are reordered into image planes, but no
297
+ * colorspace conversion or subsampling is performed. RGB JPEG images can be
298
+ * decompressed to any of the extended RGB pixel formats or grayscale, but
299
+ * they cannot be decompressed to YUV images.
300
+ */
301
+ TJCS_RGB=0,
302
+ /**
303
+ * YCbCr colorspace. YCbCr is not an absolute colorspace but rather a
304
+ * mathematical transformation of RGB designed solely for storage and
305
+ * transmission. YCbCr images must be converted to RGB before they can
306
+ * actually be displayed. In the YCbCr colorspace, the Y (luminance)
307
+ * component represents the black & white portion of the original image, and
308
+ * the Cb and Cr (chrominance) components represent the color portion of the
309
+ * original image. Originally, the analog equivalent of this transformation
310
+ * allowed the same signal to drive both black & white and color televisions,
311
+ * but JPEG images use YCbCr primarily because it allows the color data to be
312
+ * optionally subsampled for the purposes of reducing bandwidth or disk
313
+ * space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images
314
+ * can be compressed from and decompressed to any of the extended RGB pixel
315
+ * formats or grayscale, or they can be decompressed to YUV planar images.
316
+ */
317
+ TJCS_YCbCr,
318
+ /**
319
+ * Grayscale colorspace. The JPEG image retains only the luminance data (Y
320
+ * component), and any color data from the source image is discarded.
321
+ * Grayscale JPEG images can be compressed from and decompressed to any of
322
+ * the extended RGB pixel formats or grayscale, or they can be decompressed
323
+ * to YUV planar images.
324
+ */
325
+ TJCS_GRAY,
326
+ /**
327
+ * CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K
328
+ * components in the source image are reordered into image planes, but no
329
+ * colorspace conversion or subsampling is performed. CMYK JPEG images can
330
+ * only be decompressed to CMYK pixels.
331
+ */
332
+ TJCS_CMYK,
333
+ /**
334
+ * YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but
335
+ * rather a mathematical transformation of CMYK designed solely for storage
336
+ * and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
337
+ * reversibly transformed into YCCK, and as with YCbCr, the chrominance
338
+ * components in the YCCK pixels can be subsampled without incurring major
339
+ * perceptual loss. YCCK JPEG images can only be compressed from and
340
+ * decompressed to CMYK pixels.
341
+ */
342
+ TJCS_YCCK
343
+ };
344
+
345
+
346
+ /**
347
+ * The uncompressed source/destination image is stored in bottom-up (Windows,
348
+ * OpenGL) order, not top-down (X11) order.
349
+ */
350
+ #define TJFLAG_BOTTOMUP 2
351
+ /**
352
+ * When decompressing an image that was compressed using chrominance
353
+ * subsampling, use the fastest chrominance upsampling algorithm available in
354
+ * the underlying codec. The default is to use smooth upsampling, which
355
+ * creates a smooth transition between neighboring chrominance components in
356
+ * order to reduce upsampling artifacts in the decompressed image.
357
+ */
358
+ #define TJFLAG_FASTUPSAMPLE 256
359
+ /**
360
+ * Disable buffer (re)allocation. If passed to one of the JPEG compression or
361
+ * transform functions, this flag will cause those functions to generate an
362
+ * error if the JPEG image buffer is invalid or too small rather than
363
+ * attempting to allocate or reallocate that buffer. This reproduces the
364
+ * behavior of earlier versions of TurboJPEG.
365
+ */
366
+ #define TJFLAG_NOREALLOC 1024
367
+ /**
368
+ * Use the fastest DCT/IDCT algorithm available in the underlying codec. The
369
+ * default if this flag is not specified is implementation-specific. For
370
+ * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast
371
+ * algorithm by default when compressing, because this has been shown to have
372
+ * only a very slight effect on accuracy, but it uses the accurate algorithm
373
+ * when decompressing, because this has been shown to have a larger effect.
374
+ */
375
+ #define TJFLAG_FASTDCT 2048
376
+ /**
377
+ * Use the most accurate DCT/IDCT algorithm available in the underlying codec.
378
+ * The default if this flag is not specified is implementation-specific. For
379
+ * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast
380
+ * algorithm by default when compressing, because this has been shown to have
381
+ * only a very slight effect on accuracy, but it uses the accurate algorithm
382
+ * when decompressing, because this has been shown to have a larger effect.
383
+ */
384
+ #define TJFLAG_ACCURATEDCT 4096
385
+
386
+
387
+ /**
388
+ * The number of transform operations
389
+ */
390
+ #define TJ_NUMXOP 8
391
+
392
+ /**
393
+ * Transform operations for #tjTransform()
394
+ */
395
+ enum TJXOP
396
+ {
397
+ /**
398
+ * Do not transform the position of the image pixels
399
+ */
400
+ TJXOP_NONE=0,
401
+ /**
402
+ * Flip (mirror) image horizontally. This transform is imperfect if there
403
+ * are any partial MCU blocks on the right edge (see #TJXOPT_PERFECT.)
404
+ */
405
+ TJXOP_HFLIP,
406
+ /**
407
+ * Flip (mirror) image vertically. This transform is imperfect if there are
408
+ * any partial MCU blocks on the bottom edge (see #TJXOPT_PERFECT.)
409
+ */
410
+ TJXOP_VFLIP,
411
+ /**
412
+ * Transpose image (flip/mirror along upper left to lower right axis.) This
413
+ * transform is always perfect.
414
+ */
415
+ TJXOP_TRANSPOSE,
416
+ /**
417
+ * Transverse transpose image (flip/mirror along upper right to lower left
418
+ * axis.) This transform is imperfect if there are any partial MCU blocks in
419
+ * the image (see #TJXOPT_PERFECT.)
420
+ */
421
+ TJXOP_TRANSVERSE,
422
+ /**
423
+ * Rotate image clockwise by 90 degrees. This transform is imperfect if
424
+ * there are any partial MCU blocks on the bottom edge (see
425
+ * #TJXOPT_PERFECT.)
426
+ */
427
+ TJXOP_ROT90,
428
+ /**
429
+ * Rotate image 180 degrees. This transform is imperfect if there are any
430
+ * partial MCU blocks in the image (see #TJXOPT_PERFECT.)
431
+ */
432
+ TJXOP_ROT180,
433
+ /**
434
+ * Rotate image counter-clockwise by 90 degrees. This transform is imperfect
435
+ * if there are any partial MCU blocks on the right edge (see
436
+ * #TJXOPT_PERFECT.)
437
+ */
438
+ TJXOP_ROT270
439
+ };
440
+
441
+
442
+ /**
443
+ * This option will cause #tjTransform() to return an error if the transform is
444
+ * not perfect. Lossless transforms operate on MCU blocks, whose size depends
445
+ * on the level of chrominance subsampling used (see #tjMCUWidth
446
+ * and #tjMCUHeight.) If the image's width or height is not evenly divisible
447
+ * by the MCU block size, then there will be partial MCU blocks on the right
448
+ * and/or bottom edges. It is not possible to move these partial MCU blocks to
449
+ * the top or left of the image, so any transform that would require that is
450
+ * "imperfect." If this option is not specified, then any partial MCU blocks
451
+ * that cannot be transformed will be left in place, which will create
452
+ * odd-looking strips on the right or bottom edge of the image.
453
+ */
454
+ #define TJXOPT_PERFECT 1
455
+ /**
456
+ * This option will cause #tjTransform() to discard any partial MCU blocks that
457
+ * cannot be transformed.
458
+ */
459
+ #define TJXOPT_TRIM 2
460
+ /**
461
+ * This option will enable lossless cropping. See #tjTransform() for more
462
+ * information.
463
+ */
464
+ #define TJXOPT_CROP 4
465
+ /**
466
+ * This option will discard the color data in the input image and produce
467
+ * a grayscale output image.
468
+ */
469
+ #define TJXOPT_GRAY 8
470
+ /**
471
+ * This option will prevent #tjTransform() from outputting a JPEG image for
472
+ * this particular transform (this can be used in conjunction with a custom
473
+ * filter to capture the transformed DCT coefficients without transcoding
474
+ * them.)
475
+ */
476
+ #define TJXOPT_NOOUTPUT 16
477
+
478
+
479
+ /**
480
+ * Scaling factor
481
+ */
482
+ typedef struct
483
+ {
484
+ /**
485
+ * Numerator
486
+ */
487
+ int num;
488
+ /**
489
+ * Denominator
490
+ */
491
+ int denom;
492
+ } tjscalingfactor;
493
+
494
+ /**
495
+ * Cropping region
496
+ */
497
+ typedef struct
498
+ {
499
+ /**
500
+ * The left boundary of the cropping region. This must be evenly divisible
501
+ * by the MCU block width (see #tjMCUWidth.)
502
+ */
503
+ int x;
504
+ /**
505
+ * The upper boundary of the cropping region. This must be evenly divisible
506
+ * by the MCU block height (see #tjMCUHeight.)
507
+ */
508
+ int y;
509
+ /**
510
+ * The width of the cropping region. Setting this to 0 is the equivalent of
511
+ * setting it to the width of the source JPEG image - x.
512
+ */
513
+ int w;
514
+ /**
515
+ * The height of the cropping region. Setting this to 0 is the equivalent of
516
+ * setting it to the height of the source JPEG image - y.
517
+ */
518
+ int h;
519
+ } tjregion;
520
+
521
+ /**
522
+ * Lossless transform
523
+ */
524
+ typedef struct tjtransform
525
+ {
526
+ /**
527
+ * Cropping region
528
+ */
529
+ tjregion r;
530
+ /**
531
+ * One of the @ref TJXOP "transform operations"
532
+ */
533
+ int op;
534
+ /**
535
+ * The bitwise OR of one of more of the @ref TJXOPT_CROP "transform options"
536
+ */
537
+ int options;
538
+ /**
539
+ * Arbitrary data that can be accessed within the body of the callback
540
+ * function
541
+ */
542
+ void *data;
543
+ /**
544
+ * A callback function that can be used to modify the DCT coefficients
545
+ * after they are losslessly transformed but before they are transcoded to a
546
+ * new JPEG image. This allows for custom filters or other transformations
547
+ * to be applied in the frequency domain.
548
+ *
549
+ * @param coeffs pointer to an array of transformed DCT coefficients. (NOTE:
550
+ * this pointer is not guaranteed to be valid once the callback returns, so
551
+ * applications wishing to hand off the DCT coefficients to another function
552
+ * or library should make a copy of them within the body of the callback.)
553
+ *
554
+ * @param arrayRegion #tjregion structure containing the width and height of
555
+ * the array pointed to by <tt>coeffs</tt> as well as its offset relative to
556
+ * the component plane. TurboJPEG implementations may choose to split each
557
+ * component plane into multiple DCT coefficient arrays and call the callback
558
+ * function once for each array.
559
+ *
560
+ * @param planeRegion #tjregion structure containing the width and height of
561
+ * the component plane to which <tt>coeffs</tt> belongs
562
+ *
563
+ * @param componentID ID number of the component plane to which
564
+ * <tt>coeffs</tt> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1,
565
+ * and 2 in typical JPEG images.)
566
+ *
567
+ * @param transformID ID number of the transformed image to which
568
+ * <tt>coeffs</tt> belongs. This is the same as the index of the transform
569
+ * in the <tt>transforms</tt> array that was passed to #tjTransform().
570
+ *
571
+ * @param transform a pointer to a #tjtransform structure that specifies the
572
+ * parameters and/or cropping region for this transform
573
+ *
574
+ * @return 0 if the callback was successful, or -1 if an error occurred.
575
+ */
576
+ int (*customFilter)(short *coeffs, tjregion arrayRegion,
577
+ tjregion planeRegion, int componentIndex, int transformIndex,
578
+ struct tjtransform *transform);
579
+ } tjtransform;
580
+
581
+ /**
582
+ * TurboJPEG instance handle
583
+ */
584
+ typedef void* tjhandle;
585
+
586
+
587
+ /**
588
+ * Pad the given width to the nearest 32-bit boundary
589
+ */
590
+ #define TJPAD(width) (((width)+3)&(~3))
591
+
592
+ /**
593
+ * Compute the scaled value of <tt>dimension</tt> using the given scaling
594
+ * factor. This macro performs the integer equivalent of <tt>ceil(dimension *
595
+ * scalingFactor)</tt>.
596
+ */
597
+ #define TJSCALED(dimension, scalingFactor) ((dimension * scalingFactor.num \
598
+ + scalingFactor.denom - 1) / scalingFactor.denom)
599
+
600
+
601
+ #ifdef __cplusplus
602
+ extern "C" {
603
+ #endif
604
+
605
+
606
+ /**
607
+ * Create a TurboJPEG compressor instance.
608
+ *
609
+ * @return a handle to the newly-created instance, or NULL if an error
610
+ * occurred (see #tjGetErrorStr().)
611
+ */
612
+ DLLEXPORT tjhandle DLLCALL tjInitCompress(void);
613
+
614
+
615
+ /**
616
+ * Compress an RGB, grayscale, or CMYK image into a JPEG image.
617
+ *
618
+ * @param handle a handle to a TurboJPEG compressor or transformer instance
619
+ *
620
+ * @param srcBuf pointer to an image buffer containing RGB, grayscale, or
621
+ * CMYK pixels to be compressed
622
+ *
623
+ * @param width width (in pixels) of the source image
624
+ *
625
+ * @param pitch bytes per line in the source image. Normally, this should be
626
+ * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
627
+ * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
628
+ * is padded to the nearest 32-bit boundary, as is the case for Windows
629
+ * bitmaps. You can also be clever and use this parameter to skip lines, etc.
630
+ * Setting this parameter to 0 is the equivalent of setting it to
631
+ * <tt>width * #tjPixelSize[pixelFormat]</tt>.
632
+ *
633
+ * @param height height (in pixels) of the source image
634
+ *
635
+ * @param pixelFormat pixel format of the source image (see @ref TJPF
636
+ * "Pixel formats".)
637
+ *
638
+ * @param jpegBuf address of a pointer to an image buffer that will receive the
639
+ * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer
640
+ * to accommodate the size of the JPEG image. Thus, you can choose to:
641
+ * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
642
+ * let TurboJPEG grow the buffer as needed,
643
+ * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
644
+ * for you, or
645
+ * -# pre-allocate the buffer to a "worst case" size determined by calling
646
+ * #tjBufSize(). This should ensure that the buffer never has to be
647
+ * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.)
648
+ * .
649
+ * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
650
+ * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
651
+ * you should always check <tt>*jpegBuf</tt> upon return from this function, as
652
+ * it may have changed.
653
+ *
654
+ * @param jpegSize pointer to an unsigned long variable that holds the size of
655
+ * the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
656
+ * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
657
+ * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
658
+ * bytes.) If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being
659
+ * reused from a previous call to one of the JPEG compression functions, then
660
+ * <tt>*jpegSize</tt> is ignored.
661
+ *
662
+ * @param jpegSubsamp the level of chrominance subsampling to be used when
663
+ * generating the JPEG image (see @ref TJSAMP
664
+ * "Chrominance subsampling options".)
665
+ *
666
+ * @param jpegQual the image quality of the generated JPEG image (1 = worst,
667
+ * 100 = best)
668
+ *
669
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
670
+ * "flags"
671
+ *
672
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
673
+ */
674
+ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf,
675
+ int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,
676
+ unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags);
677
+
678
+
679
+ /**
680
+ * Compress a YUV planar image into a JPEG image.
681
+ *
682
+ * @param handle a handle to a TurboJPEG compressor or transformer instance
683
+ *
684
+ * @param srcBuf pointer to an image buffer containing a YUV planar image to be
685
+ * compressed. The size of this buffer should match the value returned by
686
+ * #tjBufSizeYUV2() for the given image width, height, padding, and level of
687
+ * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be
688
+ * stored sequentially in the source buffer (refer to @ref YUVnotes
689
+ * "YUV Image Format Notes".)
690
+ *
691
+ * @param width width (in pixels) of the source image. If the width is not an
692
+ * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate
693
+ * buffer copy will be performed within TurboJPEG.
694
+ *
695
+ * @param pad the line padding used in the source image. For instance, if each
696
+ * line in each plane of the YUV image is padded to the nearest multiple of 4
697
+ * bytes, then <tt>pad</tt> should be set to 4.
698
+ *
699
+ * @param height height (in pixels) of the source image. If the height is not
700
+ * an even multiple of the MCU block height (see #tjMCUHeight), then an
701
+ * intermediate buffer copy will be performed within TurboJPEG.
702
+ *
703
+ * @param subsamp the level of chrominance subsampling used in the source
704
+ * image (see @ref TJSAMP "Chrominance subsampling options".)
705
+ *
706
+ * @param jpegBuf address of a pointer to an image buffer that will receive the
707
+ * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
708
+ * accommodate the size of the JPEG image. Thus, you can choose to:
709
+ * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
710
+ * let TurboJPEG grow the buffer as needed,
711
+ * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
712
+ * for you, or
713
+ * -# pre-allocate the buffer to a "worst case" size determined by calling
714
+ * #tjBufSize(). This should ensure that the buffer never has to be
715
+ * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.)
716
+ * .
717
+ * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
718
+ * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
719
+ * you should always check <tt>*jpegBuf</tt> upon return from this function, as
720
+ * it may have changed.
721
+ *
722
+ * @param jpegSize pointer to an unsigned long variable that holds the size of
723
+ * the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
724
+ * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
725
+ * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
726
+ * bytes.) If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being
727
+ * reused from a previous call to one of the JPEG compression functions, then
728
+ * <tt>*jpegSize</tt> is ignored.
729
+ *
730
+ * @param jpegQual the image quality of the generated JPEG image (1 = worst,
731
+ * 100 = best)
732
+ *
733
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
734
+ * "flags"
735
+ *
736
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
737
+ */
738
+ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle,
739
+ const unsigned char *srcBuf, int width, int pad, int height, int subsamp,
740
+ unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags);
741
+
742
+
743
+ /**
744
+ * Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.
745
+ *
746
+ * @param handle a handle to a TurboJPEG compressor or transformer instance
747
+ *
748
+ * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
749
+ * (or just a Y plane, if compressing a grayscale image) that contain a YUV
750
+ * image to be compressed. These planes can be contiguous or non-contiguous in
751
+ * memory. The size of each plane should match the value returned by
752
+ * #tjPlaneSizeYUV() for the given image width, height, strides, and level of
753
+ * chrominance subsampling. Refer to @ref YUVnotes "YUV Image Format Notes"
754
+ * for more details.
755
+ *
756
+ * @param width width (in pixels) of the source image. If the width is not an
757
+ * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate
758
+ * buffer copy will be performed within TurboJPEG.
759
+ *
760
+ * @param strides an array of integers, each specifying the number of bytes per
761
+ * line in the corresponding plane of the YUV source image. Setting the stride
762
+ * for any plane to 0 is the same as setting it to the plane width (see
763
+ * @ref YUVnotes "YUV Image Format Notes".) If <tt>strides</tt> is NULL, then
764
+ * the strides for all planes will be set to their respective plane widths.
765
+ * You can adjust the strides in order to specify an arbitrary amount of line
766
+ * padding in each plane or to create a JPEG image from a subregion of a larger
767
+ * YUV planar image.
768
+ *
769
+ * @param height height (in pixels) of the source image. If the height is not
770
+ * an even multiple of the MCU block height (see #tjMCUHeight), then an
771
+ * intermediate buffer copy will be performed within TurboJPEG.
772
+ *
773
+ * @param subsamp the level of chrominance subsampling used in the source
774
+ * image (see @ref TJSAMP "Chrominance subsampling options".)
775
+ *
776
+ * @param jpegBuf address of a pointer to an image buffer that will receive the
777
+ * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
778
+ * accommodate the size of the JPEG image. Thus, you can choose to:
779
+ * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
780
+ * let TurboJPEG grow the buffer as needed,
781
+ * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
782
+ * for you, or
783
+ * -# pre-allocate the buffer to a "worst case" size determined by calling
784
+ * #tjBufSize(). This should ensure that the buffer never has to be
785
+ * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.)
786
+ * .
787
+ * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
788
+ * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
789
+ * you should always check <tt>*jpegBuf</tt> upon return from this function, as
790
+ * it may have changed.
791
+ *
792
+ * @param jpegSize pointer to an unsigned long variable that holds the size of
793
+ * the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
794
+ * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
795
+ * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
796
+ * bytes.) If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being
797
+ * reused from a previous call to one of the JPEG compression functions, then
798
+ * <tt>*jpegSize</tt> is ignored.
799
+ *
800
+ * @param jpegQual the image quality of the generated JPEG image (1 = worst,
801
+ * 100 = best)
802
+ *
803
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
804
+ * "flags"
805
+ *
806
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
807
+ */
808
+ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
809
+ const unsigned char **srcPlanes, int width, const int *strides, int height,
810
+ int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual,
811
+ int flags);
812
+
813
+
814
+ /**
815
+ * The maximum size of the buffer (in bytes) required to hold a JPEG image with
816
+ * the given parameters. The number of bytes returned by this function is
817
+ * larger than the size of the uncompressed source image. The reason for this
818
+ * is that the JPEG format uses 16-bit coefficients, and it is thus possible
819
+ * for a very high-quality JPEG image with very high-frequency content to
820
+ * expand rather than compress when converted to the JPEG format. Such images
821
+ * represent a very rare corner case, but since there is no way to predict the
822
+ * size of a JPEG image prior to compression, the corner case has to be
823
+ * handled.
824
+ *
825
+ * @param width width (in pixels) of the image
826
+ *
827
+ * @param height height (in pixels) of the image
828
+ *
829
+ * @param jpegSubsamp the level of chrominance subsampling to be used when
830
+ * generating the JPEG image (see @ref TJSAMP
831
+ * "Chrominance subsampling options".)
832
+ *
833
+ * @return the maximum size of the buffer (in bytes) required to hold the
834
+ * image, or -1 if the arguments are out of bounds.
835
+ */
836
+ DLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,
837
+ int jpegSubsamp);
838
+
839
+
840
+ /**
841
+ * The size of the buffer (in bytes) required to hold a YUV planar image with
842
+ * the given parameters.
843
+ *
844
+ * @param width width (in pixels) of the image
845
+ *
846
+ * @param pad the width of each line in each plane of the image is padded to
847
+ * the nearest multiple of this number of bytes (must be a power of 2.)
848
+ *
849
+ * @param height height (in pixels) of the image
850
+ *
851
+ * @param subsamp level of chrominance subsampling in the image (see
852
+ * @ref TJSAMP "Chrominance subsampling options".)
853
+ *
854
+ * @return the size of the buffer (in bytes) required to hold the image, or
855
+ * -1 if the arguments are out of bounds.
856
+ */
857
+ DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,
858
+ int subsamp);
859
+
860
+
861
+ /**
862
+ * The size of the buffer (in bytes) required to hold a YUV image plane with
863
+ * the given parameters.
864
+ *
865
+ * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
866
+ *
867
+ * @param width width (in pixels) of the YUV image. NOTE: this is the width of
868
+ * the whole image, not the plane width.
869
+ *
870
+ * @param stride bytes per line in the image plane. Setting this to 0 is the
871
+ * equivalent of setting it to the plane width.
872
+ *
873
+ * @param height height (in pixels) of the YUV image. NOTE: this is the height
874
+ * of the whole image, not the plane height.
875
+ *
876
+ * @param subsamp level of chrominance subsampling in the image (see
877
+ * @ref TJSAMP "Chrominance subsampling options".)
878
+ *
879
+ * @return the size of the buffer (in bytes) required to hold the YUV image
880
+ * plane, or -1 if the arguments are out of bounds.
881
+ */
882
+ DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width,
883
+ int stride, int height, int subsamp);
884
+
885
+
886
+ /**
887
+ * The plane width of a YUV image plane with the given parameters. Refer to
888
+ * @ref YUVnotes "YUV Image Format Notes" for a description of plane width.
889
+ *
890
+ * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
891
+ *
892
+ * @param width width (in pixels) of the YUV image
893
+ *
894
+ * @param subsamp level of chrominance subsampling in the image (see
895
+ * @ref TJSAMP "Chrominance subsampling options".)
896
+ *
897
+ * @return the plane width of a YUV image plane with the given parameters, or
898
+ * -1 if the arguments are out of bounds.
899
+ */
900
+ DLLEXPORT int tjPlaneWidth(int componentID, int width, int subsamp);
901
+
902
+
903
+ /**
904
+ * The plane height of a YUV image plane with the given parameters. Refer to
905
+ * @ref YUVnotes "YUV Image Format Notes" for a description of plane height.
906
+ *
907
+ * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
908
+ *
909
+ * @param height height (in pixels) of the YUV image
910
+ *
911
+ * @param subsamp level of chrominance subsampling in the image (see
912
+ * @ref TJSAMP "Chrominance subsampling options".)
913
+ *
914
+ * @return the plane height of a YUV image plane with the given parameters, or
915
+ * -1 if the arguments are out of bounds.
916
+ */
917
+ DLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp);
918
+
919
+
920
+ /**
921
+ * Encode an RGB or grayscale image into a YUV planar image. This function
922
+ * uses the accelerated color conversion routines in the underlying
923
+ * codec but does not execute any of the other steps in the JPEG compression
924
+ * process.
925
+ *
926
+ * @param handle a handle to a TurboJPEG compressor or transformer instance
927
+ *
928
+ * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
929
+ * to be encoded
930
+ *
931
+ * @param width width (in pixels) of the source image
932
+ *
933
+ * @param pitch bytes per line in the source image. Normally, this should be
934
+ * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
935
+ * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
936
+ * is padded to the nearest 32-bit boundary, as is the case for Windows
937
+ * bitmaps. You can also be clever and use this parameter to skip lines, etc.
938
+ * Setting this parameter to 0 is the equivalent of setting it to
939
+ * <tt>width * #tjPixelSize[pixelFormat]</tt>.
940
+ *
941
+ * @param height height (in pixels) of the source image
942
+ *
943
+ * @param pixelFormat pixel format of the source image (see @ref TJPF
944
+ * "Pixel formats".)
945
+ *
946
+ * @param dstBuf pointer to an image buffer that will receive the YUV image.
947
+ * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based
948
+ * on the image width, height, padding, and level of chrominance subsampling.
949
+ * The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the
950
+ * buffer (refer to @ref YUVnotes "YUV Image Format Notes".)
951
+ *
952
+ * @param pad the width of each line in each plane of the YUV image will be
953
+ * padded to the nearest multiple of this number of bytes (must be a power of
954
+ * 2.) To generate images suitable for X Video, <tt>pad</tt> should be set to
955
+ * 4.
956
+ *
957
+ * @param subsamp the level of chrominance subsampling to be used when
958
+ * generating the YUV image (see @ref TJSAMP
959
+ * "Chrominance subsampling options".) To generate images suitable for X
960
+ * Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This produces an
961
+ * image compatible with the I420 (AKA "YUV420P") format.
962
+ *
963
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
964
+ * "flags"
965
+ *
966
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
967
+ */
968
+ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle,
969
+ const unsigned char *srcBuf, int width, int pitch, int height,
970
+ int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags);
971
+
972
+
973
+ /**
974
+ * Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image
975
+ * planes. This function uses the accelerated color conversion routines in the
976
+ * underlying codec but does not execute any of the other steps in the JPEG
977
+ * compression process.
978
+ *
979
+ * @param handle a handle to a TurboJPEG compressor or transformer instance
980
+ *
981
+ * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
982
+ * to be encoded
983
+ *
984
+ * @param width width (in pixels) of the source image
985
+ *
986
+ * @param pitch bytes per line in the source image. Normally, this should be
987
+ * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
988
+ * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
989
+ * is padded to the nearest 32-bit boundary, as is the case for Windows
990
+ * bitmaps. You can also be clever and use this parameter to skip lines, etc.
991
+ * Setting this parameter to 0 is the equivalent of setting it to
992
+ * <tt>width * #tjPixelSize[pixelFormat]</tt>.
993
+ *
994
+ * @param height height (in pixels) of the source image
995
+ *
996
+ * @param pixelFormat pixel format of the source image (see @ref TJPF
997
+ * "Pixel formats".)
998
+ *
999
+ * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1000
+ * (or just a Y plane, if generating a grayscale image) that will receive the
1001
+ * encoded image. These planes can be contiguous or non-contiguous in memory.
1002
+ * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based
1003
+ * on the image width, height, strides, and level of chrominance subsampling.
1004
+ * Refer to @ref YUVnotes "YUV Image Format Notes" for more details.
1005
+ *
1006
+ * @param strides an array of integers, each specifying the number of bytes per
1007
+ * line in the corresponding plane of the output image. Setting the stride for
1008
+ * any plane to 0 is the same as setting it to the plane width (see
1009
+ * @ref YUVnotes "YUV Image Format Notes".) If <tt>strides</tt> is NULL, then
1010
+ * the strides for all planes will be set to their respective plane widths.
1011
+ * You can adjust the strides in order to add an arbitrary amount of line
1012
+ * padding to each plane or to encode an RGB or grayscale image into a
1013
+ * subregion of a larger YUV planar image.
1014
+ *
1015
+ * @param subsamp the level of chrominance subsampling to be used when
1016
+ * generating the YUV image (see @ref TJSAMP
1017
+ * "Chrominance subsampling options".) To generate images suitable for X
1018
+ * Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This produces an
1019
+ * image compatible with the I420 (AKA "YUV420P") format.
1020
+ *
1021
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1022
+ * "flags"
1023
+ *
1024
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1025
+ */
1026
+ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle,
1027
+ const unsigned char *srcBuf, int width, int pitch, int height,
1028
+ int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp,
1029
+ int flags);
1030
+
1031
+
1032
+ /**
1033
+ * Create a TurboJPEG decompressor instance.
1034
+ *
1035
+ * @return a handle to the newly-created instance, or NULL if an error
1036
+ * occurred (see #tjGetErrorStr().)
1037
+ */
1038
+ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
1039
+
1040
+
1041
+ /**
1042
+ * Retrieve information about a JPEG image without decompressing it.
1043
+ *
1044
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1045
+ *
1046
+ * @param jpegBuf pointer to a buffer containing a JPEG image
1047
+ *
1048
+ * @param jpegSize size of the JPEG image (in bytes)
1049
+ *
1050
+ * @param width pointer to an integer variable that will receive the width (in
1051
+ * pixels) of the JPEG image
1052
+ *
1053
+ * @param height pointer to an integer variable that will receive the height
1054
+ * (in pixels) of the JPEG image
1055
+ *
1056
+ * @param jpegSubsamp pointer to an integer variable that will receive the
1057
+ * level of chrominance subsampling used when the JPEG image was compressed
1058
+ * (see @ref TJSAMP "Chrominance subsampling options".)
1059
+ *
1060
+ * @param jpegColorspace pointer to an integer variable that will receive one
1061
+ * of the JPEG colorspace constants, indicating the colorspace of the JPEG
1062
+ * image (see @ref TJCS "JPEG colorspaces".)
1063
+ *
1064
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1065
+ */
1066
+ DLLEXPORT int DLLCALL tjDecompressHeader3(tjhandle handle,
1067
+ const unsigned char *jpegBuf, unsigned long jpegSize, int *width,
1068
+ int *height, int *jpegSubsamp, int *jpegColorspace);
1069
+
1070
+
1071
+ /**
1072
+ * Returns a list of fractional scaling factors that the JPEG decompressor in
1073
+ * this implementation of TurboJPEG supports.
1074
+ *
1075
+ * @param numscalingfactors pointer to an integer variable that will receive
1076
+ * the number of elements in the list
1077
+ *
1078
+ * @return a pointer to a list of fractional scaling factors, or NULL if an
1079
+ * error is encountered (see #tjGetErrorStr().)
1080
+ */
1081
+ DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors);
1082
+
1083
+
1084
+ /**
1085
+ * Decompress a JPEG image to an RGB, grayscale, or CMYK image.
1086
+ *
1087
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1088
+ *
1089
+ * @param jpegBuf pointer to a buffer containing the JPEG image to decompress
1090
+ *
1091
+ * @param jpegSize size of the JPEG image (in bytes)
1092
+ *
1093
+ * @param dstBuf pointer to an image buffer that will receive the decompressed
1094
+ * image. This buffer should normally be <tt>pitch * scaledHeight</tt> bytes
1095
+ * in size, where <tt>scaledHeight</tt> can be determined by calling
1096
+ * #TJSCALED() with the JPEG image height and one of the scaling factors
1097
+ * returned by #tjGetScalingFactors(). The <tt>dstBuf</tt> pointer may also be
1098
+ * used to decompress into a specific region of a larger buffer.
1099
+ *
1100
+ * @param width desired width (in pixels) of the destination image. If this is
1101
+ * different than the width of the JPEG image being decompressed, then
1102
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1103
+ * possible image that will fit within the desired width. If <tt>width</tt> is
1104
+ * set to 0, then only the height will be considered when determining the
1105
+ * scaled image size.
1106
+ *
1107
+ * @param pitch bytes per line in the destination image. Normally, this is
1108
+ * <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed image
1109
+ * is unpadded, else <tt>#TJPAD(scaledWidth * #tjPixelSize[pixelFormat])</tt>
1110
+ * if each line of the decompressed image is padded to the nearest 32-bit
1111
+ * boundary, as is the case for Windows bitmaps. (NOTE: <tt>scaledWidth</tt>
1112
+ * can be determined by calling #TJSCALED() with the JPEG image width and one
1113
+ * of the scaling factors returned by #tjGetScalingFactors().) You can also be
1114
+ * clever and use the pitch parameter to skip lines, etc. Setting this
1115
+ * parameter to 0 is the equivalent of setting it to
1116
+ * <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt>.
1117
+ *
1118
+ * @param height desired height (in pixels) of the destination image. If this
1119
+ * is different than the height of the JPEG image being decompressed, then
1120
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1121
+ * possible image that will fit within the desired height. If <tt>height</tt>
1122
+ * is set to 0, then only the width will be considered when determining the
1123
+ * scaled image size.
1124
+ *
1125
+ * @param pixelFormat pixel format of the destination image (see @ref
1126
+ * TJPF "Pixel formats".)
1127
+ *
1128
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1129
+ * "flags"
1130
+ *
1131
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1132
+ */
1133
+ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
1134
+ const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
1135
+ int width, int pitch, int height, int pixelFormat, int flags);
1136
+
1137
+
1138
+ /**
1139
+ * Decompress a JPEG image to a YUV planar image. This function performs JPEG
1140
+ * decompression but leaves out the color conversion step, so a planar YUV
1141
+ * image is generated instead of an RGB image.
1142
+ *
1143
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1144
+ *
1145
+ * @param jpegBuf pointer to a buffer containing the JPEG image to decompress
1146
+ *
1147
+ * @param jpegSize size of the JPEG image (in bytes)
1148
+ *
1149
+ * @param dstBuf pointer to an image buffer that will receive the YUV image.
1150
+ * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based
1151
+ * on the image width, height, padding, and level of subsampling. The Y,
1152
+ * U (Cb), and V (Cr) image planes will be stored sequentially in the buffer
1153
+ * (refer to @ref YUVnotes "YUV Image Format Notes".)
1154
+ *
1155
+ * @param width desired width (in pixels) of the YUV image. If this is
1156
+ * different than the width of the JPEG image being decompressed, then
1157
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1158
+ * possible image that will fit within the desired width. If <tt>width</tt> is
1159
+ * set to 0, then only the height will be considered when determining the
1160
+ * scaled image size. If the scaled width is not an even multiple of the MCU
1161
+ * block width (see #tjMCUWidth), then an intermediate buffer copy will be
1162
+ * performed within TurboJPEG.
1163
+ *
1164
+ * @param pad the width of each line in each plane of the YUV image will be
1165
+ * padded to the nearest multiple of this number of bytes (must be a power of
1166
+ * 2.) To generate images suitable for X Video, <tt>pad</tt> should be set to
1167
+ * 4.
1168
+ *
1169
+ * @param height desired height (in pixels) of the YUV image. If this is
1170
+ * different than the height of the JPEG image being decompressed, then
1171
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1172
+ * possible image that will fit within the desired height. If <tt>height</tt>
1173
+ * is set to 0, then only the width will be considered when determining the
1174
+ * scaled image size. If the scaled height is not an even multiple of the MCU
1175
+ * block height (see #tjMCUHeight), then an intermediate buffer copy will be
1176
+ * performed within TurboJPEG.
1177
+ *
1178
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1179
+ * "flags"
1180
+ *
1181
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1182
+ */
1183
+ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
1184
+ const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
1185
+ int width, int pad, int height, int flags);
1186
+
1187
+
1188
+ /**
1189
+ * Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image
1190
+ * planes. This function performs JPEG decompression but leaves out the color
1191
+ * conversion step, so a planar YUV image is generated instead of an RGB image.
1192
+ *
1193
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1194
+ *
1195
+ * @param jpegBuf pointer to a buffer containing the JPEG image to decompress
1196
+ *
1197
+ * @param jpegSize size of the JPEG image (in bytes)
1198
+ *
1199
+ * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1200
+ * (or just a Y plane, if decompressing a grayscale image) that will receive
1201
+ * the YUV image. These planes can be contiguous or non-contiguous in memory.
1202
+ * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based
1203
+ * on the scaled image width, scaled image height, strides, and level of
1204
+ * chrominance subsampling. Refer to @ref YUVnotes "YUV Image Format Notes"
1205
+ * for more details.
1206
+ *
1207
+ * @param width desired width (in pixels) of the YUV image. If this is
1208
+ * different than the width of the JPEG image being decompressed, then
1209
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1210
+ * possible image that will fit within the desired width. If <tt>width</tt> is
1211
+ * set to 0, then only the height will be considered when determining the
1212
+ * scaled image size. If the scaled width is not an even multiple of the MCU
1213
+ * block width (see #tjMCUWidth), then an intermediate buffer copy will be
1214
+ * performed within TurboJPEG.
1215
+ *
1216
+ * @param strides an array of integers, each specifying the number of bytes per
1217
+ * line in the corresponding plane of the output image. Setting the stride for
1218
+ * any plane to 0 is the same as setting it to the scaled plane width (see
1219
+ * @ref YUVnotes "YUV Image Format Notes".) If <tt>strides</tt> is NULL, then
1220
+ * the strides for all planes will be set to their respective scaled plane
1221
+ * widths. You can adjust the strides in order to add an arbitrary amount of
1222
+ * line padding to each plane or to decompress the JPEG image into a subregion
1223
+ * of a larger YUV planar image.
1224
+ *
1225
+ * @param height desired height (in pixels) of the YUV image. If this is
1226
+ * different than the height of the JPEG image being decompressed, then
1227
+ * TurboJPEG will use scaling in the JPEG decompressor to generate the largest
1228
+ * possible image that will fit within the desired height. If <tt>height</tt>
1229
+ * is set to 0, then only the width will be considered when determining the
1230
+ * scaled image size. If the scaled height is not an even multiple of the MCU
1231
+ * block height (see #tjMCUHeight), then an intermediate buffer copy will be
1232
+ * performed within TurboJPEG.
1233
+ *
1234
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1235
+ * "flags"
1236
+ *
1237
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1238
+ */
1239
+ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
1240
+ const unsigned char *jpegBuf, unsigned long jpegSize,
1241
+ unsigned char **dstPlanes, int width, int *strides, int height, int flags);
1242
+
1243
+
1244
+ /**
1245
+ * Decode a YUV planar image into an RGB or grayscale image. This function
1246
+ * uses the accelerated color conversion routines in the underlying
1247
+ * codec but does not execute any of the other steps in the JPEG decompression
1248
+ * process.
1249
+ *
1250
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1251
+ *
1252
+ * @param srcBuf pointer to an image buffer containing a YUV planar image to be
1253
+ * decoded. The size of this buffer should match the value returned by
1254
+ * #tjBufSizeYUV2() for the given image width, height, padding, and level of
1255
+ * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be
1256
+ * stored sequentially in the source buffer (refer to @ref YUVnotes
1257
+ * "YUV Image Format Notes".)
1258
+ *
1259
+ * @param pad Use this parameter to specify that the width of each line in each
1260
+ * plane of the YUV source image is padded to the nearest multiple of this
1261
+ * number of bytes (must be a power of 2.)
1262
+ *
1263
+ * @param subsamp the level of chrominance subsampling used in the YUV source
1264
+ * image (see @ref TJSAMP "Chrominance subsampling options".)
1265
+ *
1266
+ * @param dstBuf pointer to an image buffer that will receive the decoded
1267
+ * image. This buffer should normally be <tt>pitch * height</tt> bytes in
1268
+ * size, but the <tt>dstBuf</tt> pointer can also be used to decode into a
1269
+ * specific region of a larger buffer.
1270
+ *
1271
+ * @param width width (in pixels) of the source and destination images
1272
+ *
1273
+ * @param pitch bytes per line in the destination image. Normally, this should
1274
+ * be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is
1275
+ * unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line
1276
+ * of the destination image should be padded to the nearest 32-bit boundary, as
1277
+ * is the case for Windows bitmaps. You can also be clever and use the pitch
1278
+ * parameter to skip lines, etc. Setting this parameter to 0 is the equivalent
1279
+ * of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
1280
+ *
1281
+ * @param height height (in pixels) of the source and destination images
1282
+ *
1283
+ * @param pixelFormat pixel format of the destination image (see @ref TJPF
1284
+ * "Pixel formats".)
1285
+ *
1286
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1287
+ * "flags"
1288
+ *
1289
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1290
+ */
1291
+ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf,
1292
+ int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,
1293
+ int height, int pixelFormat, int flags);
1294
+
1295
+
1296
+ /**
1297
+ * Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale
1298
+ * image. This function uses the accelerated color conversion routines in the
1299
+ * underlying codec but does not execute any of the other steps in the JPEG
1300
+ * decompression process.
1301
+ *
1302
+ * @param handle a handle to a TurboJPEG decompressor or transformer instance
1303
+ *
1304
+ * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1305
+ * (or just a Y plane, if decoding a grayscale image) that contain a YUV image
1306
+ * to be decoded. These planes can be contiguous or non-contiguous in memory.
1307
+ * The size of each plane should match the value returned by #tjPlaneSizeYUV()
1308
+ * for the given image width, height, strides, and level of chrominance
1309
+ * subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" for more
1310
+ * details.
1311
+ *
1312
+ * @param strides an array of integers, each specifying the number of bytes per
1313
+ * line in the corresponding plane of the YUV source image. Setting the stride
1314
+ * for any plane to 0 is the same as setting it to the plane width (see
1315
+ * @ref YUVnotes "YUV Image Format Notes".) If <tt>strides</tt> is NULL, then
1316
+ * the strides for all planes will be set to their respective plane widths.
1317
+ * You can adjust the strides in order to specify an arbitrary amount of line
1318
+ * padding in each plane or to decode a subregion of a larger YUV planar image.
1319
+ *
1320
+ * @param subsamp the level of chrominance subsampling used in the YUV source
1321
+ * image (see @ref TJSAMP "Chrominance subsampling options".)
1322
+ *
1323
+ * @param dstBuf pointer to an image buffer that will receive the decoded
1324
+ * image. This buffer should normally be <tt>pitch * height</tt> bytes in
1325
+ * size, but the <tt>dstBuf</tt> pointer can also be used to decode into a
1326
+ * specific region of a larger buffer.
1327
+ *
1328
+ * @param width width (in pixels) of the source and destination images
1329
+ *
1330
+ * @param pitch bytes per line in the destination image. Normally, this should
1331
+ * be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is
1332
+ * unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line
1333
+ * of the destination image should be padded to the nearest 32-bit boundary, as
1334
+ * is the case for Windows bitmaps. You can also be clever and use the pitch
1335
+ * parameter to skip lines, etc. Setting this parameter to 0 is the equivalent
1336
+ * of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
1337
+ *
1338
+ * @param height height (in pixels) of the source and destination images
1339
+ *
1340
+ * @param pixelFormat pixel format of the destination image (see @ref TJPF
1341
+ * "Pixel formats".)
1342
+ *
1343
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1344
+ * "flags"
1345
+ *
1346
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1347
+ */
1348
+ DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,
1349
+ const unsigned char **srcPlanes, const int *strides, int subsamp,
1350
+ unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat,
1351
+ int flags);
1352
+
1353
+
1354
+ /**
1355
+ * Create a new TurboJPEG transformer instance.
1356
+ *
1357
+ * @return a handle to the newly-created instance, or NULL if an error
1358
+ * occurred (see #tjGetErrorStr().)
1359
+ */
1360
+ DLLEXPORT tjhandle DLLCALL tjInitTransform(void);
1361
+
1362
+
1363
+ /**
1364
+ * Losslessly transform a JPEG image into another JPEG image. Lossless
1365
+ * transforms work by moving the raw DCT coefficients from one JPEG image
1366
+ * structure to another without altering the values of the coefficients. While
1367
+ * this is typically faster than decompressing the image, transforming it, and
1368
+ * re-compressing it, lossless transforms are not free. Each lossless
1369
+ * transform requires reading and performing Huffman decoding on all of the
1370
+ * coefficients in the source image, regardless of the size of the destination
1371
+ * image. Thus, this function provides a means of generating multiple
1372
+ * transformed images from the same source or applying multiple
1373
+ * transformations simultaneously, in order to eliminate the need to read the
1374
+ * source coefficients multiple times.
1375
+ *
1376
+ * @param handle a handle to a TurboJPEG transformer instance
1377
+ *
1378
+ * @param jpegBuf pointer to a buffer containing the JPEG source image to
1379
+ * transform
1380
+ *
1381
+ * @param jpegSize size of the JPEG source image (in bytes)
1382
+ *
1383
+ * @param n the number of transformed JPEG images to generate
1384
+ *
1385
+ * @param dstBufs pointer to an array of n image buffers. <tt>dstBufs[i]</tt>
1386
+ * will receive a JPEG image that has been transformed using the parameters in
1387
+ * <tt>transforms[i]</tt>. TurboJPEG has the ability to reallocate the JPEG
1388
+ * buffer to accommodate the size of the JPEG image. Thus, you can choose to:
1389
+ * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
1390
+ * let TurboJPEG grow the buffer as needed,
1391
+ * -# set <tt>dstBufs[i]</tt> to NULL to tell TurboJPEG to allocate the buffer
1392
+ * for you, or
1393
+ * -# pre-allocate the buffer to a "worst case" size determined by calling
1394
+ * #tjBufSize() with the transformed or cropped width and height. Under normal
1395
+ * circumstances, this should ensure that the buffer never has to be
1396
+ * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.) Note,
1397
+ * however, that there are some rare cases (such as transforming images with a
1398
+ * large amount of embedded EXIF or ICC profile data) in which the output image
1399
+ * will be larger than the worst-case size, and #TJFLAG_NOREALLOC cannot be
1400
+ * used in those cases.
1401
+ * .
1402
+ * If you choose option 1, <tt>dstSizes[i]</tt> should be set to the size of
1403
+ * your pre-allocated buffer. In any case, unless you have set
1404
+ * #TJFLAG_NOREALLOC, you should always check <tt>dstBufs[i]</tt> upon return
1405
+ * from this function, as it may have changed.
1406
+ *
1407
+ * @param dstSizes pointer to an array of n unsigned long variables that will
1408
+ * receive the actual sizes (in bytes) of each transformed JPEG image. If
1409
+ * <tt>dstBufs[i]</tt> points to a pre-allocated buffer, then
1410
+ * <tt>dstSizes[i]</tt> should be set to the size of the buffer. Upon return,
1411
+ * <tt>dstSizes[i]</tt> will contain the size of the JPEG image (in bytes.)
1412
+ *
1413
+ * @param transforms pointer to an array of n #tjtransform structures, each of
1414
+ * which specifies the transform parameters and/or cropping region for the
1415
+ * corresponding transformed output image.
1416
+ *
1417
+ * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT
1418
+ * "flags"
1419
+ *
1420
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1421
+ */
1422
+ DLLEXPORT int DLLCALL tjTransform(tjhandle handle,
1423
+ const unsigned char *jpegBuf, unsigned long jpegSize, int n,
1424
+ unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms,
1425
+ int flags);
1426
+
1427
+
1428
+ /**
1429
+ * Destroy a TurboJPEG compressor, decompressor, or transformer instance.
1430
+ *
1431
+ * @param handle a handle to a TurboJPEG compressor, decompressor or
1432
+ * transformer instance
1433
+ *
1434
+ * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
1435
+ */
1436
+ DLLEXPORT int DLLCALL tjDestroy(tjhandle handle);
1437
+
1438
+
1439
+ /**
1440
+ * Allocate an image buffer for use with TurboJPEG. You should always use
1441
+ * this function to allocate the JPEG destination buffer(s) for the compression
1442
+ * and transform functions unless you are disabling automatic buffer
1443
+ * (re)allocation (by setting #TJFLAG_NOREALLOC.)
1444
+ *
1445
+ * @param bytes the number of bytes to allocate
1446
+ *
1447
+ * @return a pointer to a newly-allocated buffer with the specified number of
1448
+ * bytes.
1449
+ *
1450
+ * @sa tjFree()
1451
+ */
1452
+ DLLEXPORT unsigned char* DLLCALL tjAlloc(int bytes);
1453
+
1454
+
1455
+ /**
1456
+ * Free an image buffer previously allocated by TurboJPEG. You should always
1457
+ * use this function to free JPEG destination buffer(s) that were automatically
1458
+ * (re)allocated by the compression and transform functions or that were
1459
+ * manually allocated using #tjAlloc().
1460
+ *
1461
+ * @param buffer address of the buffer to free
1462
+ *
1463
+ * @sa tjAlloc()
1464
+ */
1465
+ DLLEXPORT void DLLCALL tjFree(unsigned char *buffer);
1466
+
1467
+
1468
+ /**
1469
+ * Returns a descriptive error message explaining why the last command failed.
1470
+ *
1471
+ * @return a descriptive error message explaining why the last command failed.
1472
+ */
1473
+ DLLEXPORT char* DLLCALL tjGetErrorStr(void);
1474
+
1475
+
1476
+ /* Deprecated functions and macros */
1477
+ #define TJFLAG_FORCEMMX 8
1478
+ #define TJFLAG_FORCESSE 16
1479
+ #define TJFLAG_FORCESSE2 32
1480
+ #define TJFLAG_FORCESSE3 128
1481
+
1482
+
1483
+ /* Backward compatibility functions and macros (nothing to see here) */
1484
+ #define NUMSUBOPT TJ_NUMSAMP
1485
+ #define TJ_444 TJSAMP_444
1486
+ #define TJ_422 TJSAMP_422
1487
+ #define TJ_420 TJSAMP_420
1488
+ #define TJ_411 TJSAMP_420
1489
+ #define TJ_GRAYSCALE TJSAMP_GRAY
1490
+
1491
+ #define TJ_BGR 1
1492
+ #define TJ_BOTTOMUP TJFLAG_BOTTOMUP
1493
+ #define TJ_FORCEMMX TJFLAG_FORCEMMX
1494
+ #define TJ_FORCESSE TJFLAG_FORCESSE
1495
+ #define TJ_FORCESSE2 TJFLAG_FORCESSE2
1496
+ #define TJ_ALPHAFIRST 64
1497
+ #define TJ_FORCESSE3 TJFLAG_FORCESSE3
1498
+ #define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE
1499
+ #define TJ_YUV 512
1500
+
1501
+ DLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height);
1502
+
1503
+ DLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,
1504
+ int jpegSubsamp);
1505
+
1506
+ DLLEXPORT unsigned long DLLCALL tjBufSizeYUV(int width, int height,
1507
+ int subsamp);
1508
+
1509
+ DLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,
1510
+ int width, int pitch, int height, int pixelSize, unsigned char *dstBuf,
1511
+ unsigned long *compressedSize, int jpegSubsamp, int jpegQual, int flags);
1512
+
1513
+ DLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle,
1514
+ unsigned char *srcBuf, int width, int pitch, int height, int pixelSize,
1515
+ unsigned char *dstBuf, int subsamp, int flags);
1516
+
1517
+ DLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle,
1518
+ unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat,
1519
+ unsigned char *dstBuf, int subsamp, int flags);
1520
+
1521
+ DLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,
1522
+ unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height);
1523
+
1524
+ DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,
1525
+ unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,
1526
+ int *jpegSubsamp);
1527
+
1528
+ DLLEXPORT int DLLCALL tjDecompress(tjhandle handle,
1529
+ unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
1530
+ int width, int pitch, int height, int pixelSize, int flags);
1531
+
1532
+ DLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,
1533
+ unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
1534
+ int flags);
1535
+
1536
+
1537
+ /**
1538
+ * @}
1539
+ */
1540
+
1541
+ #ifdef __cplusplus
1542
+ }
1543
+ #endif
1544
+
1545
+ #endif