epeg 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (504) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/MANIFEST +5 -0
  4. data/TODO +1 -0
  5. data/epeg/.dockerignore +4 -0
  6. data/epeg/.gitignore +5 -0
  7. data/epeg/CMakeLists.txt +30 -0
  8. data/epeg/Dockerfile +23 -0
  9. data/epeg/Epeg.h +90 -0
  10. data/epeg/README.md +42 -0
  11. data/epeg/epeg_main.c +1642 -0
  12. data/epeg/epeg_private.h +85 -0
  13. data/epeg/example/.gitignore +1 -0
  14. data/epeg/example/CMakeLists.txt +20 -0
  15. data/epeg/example/example.jpg +0 -0
  16. data/epeg/example/rotatetest.c +29 -0
  17. data/epeg/example/scaletest.c +48 -0
  18. data/epeg/vendor/libjpeg-turbo-2.0.4/BUILDING.md +828 -0
  19. data/epeg/vendor/libjpeg-turbo-2.0.4/CMakeLists.txt +1420 -0
  20. data/epeg/vendor/libjpeg-turbo-2.0.4/ChangeLog.md +1494 -0
  21. data/epeg/vendor/libjpeg-turbo-2.0.4/LICENSE.md +132 -0
  22. data/epeg/vendor/libjpeg-turbo-2.0.4/README.ijg +277 -0
  23. data/epeg/vendor/libjpeg-turbo-2.0.4/README.md +356 -0
  24. data/epeg/vendor/libjpeg-turbo-2.0.4/cderror.h +137 -0
  25. data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.c +145 -0
  26. data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.h +157 -0
  27. data/epeg/vendor/libjpeg-turbo-2.0.4/change.log +315 -0
  28. data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.1 +354 -0
  29. data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.c +695 -0
  30. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/BuildPackages.cmake +182 -0
  31. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/GNUInstallDirs.cmake +416 -0
  32. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/cmake_uninstall.cmake.in +24 -0
  33. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/testclean.cmake +41 -0
  34. data/epeg/vendor/libjpeg-turbo-2.0.4/cmyk.h +61 -0
  35. data/epeg/vendor/libjpeg-turbo-2.0.4/coderules.txt +78 -0
  36. data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.1 +296 -0
  37. data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.c +822 -0
  38. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/annotated.html +104 -0
  39. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bc_s.png +0 -0
  40. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bdwn.png +0 -0
  41. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/classes.html +106 -0
  42. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/closed.png +0 -0
  43. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen-extra.css +3 -0
  44. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.css +1184 -0
  45. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.png +0 -0
  46. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/dynsections.js +97 -0
  47. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2blank.png +0 -0
  48. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2cl.png +0 -0
  49. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2doc.png +0 -0
  50. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderclosed.png +0 -0
  51. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderopen.png +0 -0
  52. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2lastnode.png +0 -0
  53. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2link.png +0 -0
  54. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mlastnode.png +0 -0
  55. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mnode.png +0 -0
  56. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mo.png +0 -0
  57. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2node.png +0 -0
  58. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2ns.png +0 -0
  59. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2plastnode.png +0 -0
  60. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2pnode.png +0 -0
  61. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2splitbar.png +0 -0
  62. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2vertline.png +0 -0
  63. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions.html +134 -0
  64. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions_vars.html +134 -0
  65. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/group___turbo_j_p_e_g.html +2775 -0
  66. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/index.html +90 -0
  67. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/jquery.js +8 -0
  68. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/modules.html +95 -0
  69. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_f.png +0 -0
  70. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_g.png +0 -0
  71. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_h.png +0 -0
  72. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/open.png +0 -0
  73. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.html +26 -0
  74. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.js +4 -0
  75. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.html +26 -0
  76. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.js +5 -0
  77. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.html +26 -0
  78. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.js +4 -0
  79. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.html +26 -0
  80. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.js +4 -0
  81. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.html +26 -0
  82. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.js +5 -0
  83. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.html +26 -0
  84. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.js +4 -0
  85. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.html +26 -0
  86. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.js +102 -0
  87. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.html +26 -0
  88. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.js +4 -0
  89. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.html +26 -0
  90. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.js +4 -0
  91. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.html +26 -0
  92. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.js +4 -0
  93. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.html +26 -0
  94. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.js +6 -0
  95. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/close.png +0 -0
  96. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.html +26 -0
  97. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.js +8 -0
  98. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.html +26 -0
  99. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.js +37 -0
  100. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.html +26 -0
  101. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.js +31 -0
  102. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.html +26 -0
  103. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.js +4 -0
  104. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/mag_sel.png +0 -0
  105. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/nomatches.html +12 -0
  106. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.css +271 -0
  107. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.js +809 -0
  108. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_l.png +0 -0
  109. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_m.png +0 -0
  110. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_r.png +0 -0
  111. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.html +26 -0
  112. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.js +5 -0
  113. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.html +26 -0
  114. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.js +4 -0
  115. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.html +26 -0
  116. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.js +5 -0
  117. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.html +26 -0
  118. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.js +4 -0
  119. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.html +26 -0
  120. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.js +4 -0
  121. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.html +26 -0
  122. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.js +5 -0
  123. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.html +26 -0
  124. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.js +4 -0
  125. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.html +26 -0
  126. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.js +10 -0
  127. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.html +26 -0
  128. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.js +4 -0
  129. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.html +26 -0
  130. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.js +4 -0
  131. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.html +26 -0
  132. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.js +4 -0
  133. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjregion.html +186 -0
  134. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjscalingfactor.html +148 -0
  135. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjtransform.html +212 -0
  136. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_off.png +0 -0
  137. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_on.png +0 -0
  138. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_a.png +0 -0
  139. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_b.png +0 -0
  140. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_h.png +0 -0
  141. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_s.png +0 -0
  142. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tabs.css +60 -0
  143. data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen-extra.css +3 -0
  144. data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen.config +16 -0
  145. data/epeg/vendor/libjpeg-turbo-2.0.4/example.txt +464 -0
  146. data/epeg/vendor/libjpeg-turbo-2.0.4/jaricom.c +157 -0
  147. data/epeg/vendor/libjpeg-turbo-2.0.4/java/CMakeLists.txt +88 -0
  148. data/epeg/vendor/libjpeg-turbo-2.0.4/java/MANIFEST.MF +2 -0
  149. data/epeg/vendor/libjpeg-turbo-2.0.4/java/README +52 -0
  150. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJBench.java +1021 -0
  151. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJExample.java +405 -0
  152. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJUnitTest.java +960 -0
  153. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-frame.html +24 -0
  154. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-noframe.html +24 -0
  155. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/constant-values.html +532 -0
  156. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/deprecated-list.html +252 -0
  157. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/help-doc.html +210 -0
  158. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index-all.html +1029 -0
  159. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index.html +71 -0
  160. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJ.html +1356 -0
  161. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +926 -0
  162. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html +241 -0
  163. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +1255 -0
  164. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJException.html +340 -0
  165. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html +343 -0
  166. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html +751 -0
  167. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +421 -0
  168. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html +765 -0
  169. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-frame.html +31 -0
  170. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-summary.html +202 -0
  171. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-tree.html +160 -0
  172. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/overview-tree.html +164 -0
  173. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/package-list +1 -0
  174. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/background.gif +0 -0
  175. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/tab.gif +0 -0
  176. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar.gif +0 -0
  177. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar_end.gif +0 -0
  178. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/script.js +30 -0
  179. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/serialized-form.html +176 -0
  180. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/stylesheet.css +474 -0
  181. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJ.java +584 -0
  182. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCompressor.java +677 -0
  183. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java +76 -0
  184. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +931 -0
  185. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJException.java +78 -0
  186. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in +59 -0
  187. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in +35 -0
  188. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java +115 -0
  189. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransform.java +227 -0
  190. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransformer.java +163 -0
  191. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/YUVImage.java +445 -0
  192. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJ.h +129 -0
  193. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJCompressor.h +101 -0
  194. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJDecompressor.h +101 -0
  195. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJTransformer.h +29 -0
  196. data/epeg/vendor/libjpeg-turbo-2.0.4/jcapimin.c +295 -0
  197. data/epeg/vendor/libjpeg-turbo-2.0.4/jcapistd.c +162 -0
  198. data/epeg/vendor/libjpeg-turbo-2.0.4/jcarith.c +932 -0
  199. data/epeg/vendor/libjpeg-turbo-2.0.4/jccoefct.c +449 -0
  200. data/epeg/vendor/libjpeg-turbo-2.0.4/jccolext.c +144 -0
  201. data/epeg/vendor/libjpeg-turbo-2.0.4/jccolor.c +710 -0
  202. data/epeg/vendor/libjpeg-turbo-2.0.4/jcdctmgr.c +721 -0
  203. data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.c +1096 -0
  204. data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.h +42 -0
  205. data/epeg/vendor/libjpeg-turbo-2.0.4/jcicc.c +105 -0
  206. data/epeg/vendor/libjpeg-turbo-2.0.4/jcinit.c +77 -0
  207. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmainct.c +162 -0
  208. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmarker.c +664 -0
  209. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmaster.c +640 -0
  210. data/epeg/vendor/libjpeg-turbo-2.0.4/jcomapi.c +109 -0
  211. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.h.in +73 -0
  212. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.txt +143 -0
  213. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfigint.h.in +31 -0
  214. data/epeg/vendor/libjpeg-turbo-2.0.4/jcparam.c +541 -0
  215. data/epeg/vendor/libjpeg-turbo-2.0.4/jcphuff.c +1105 -0
  216. data/epeg/vendor/libjpeg-turbo-2.0.4/jcprepct.c +351 -0
  217. data/epeg/vendor/libjpeg-turbo-2.0.4/jcsample.c +539 -0
  218. data/epeg/vendor/libjpeg-turbo-2.0.4/jcstest.c +126 -0
  219. data/epeg/vendor/libjpeg-turbo-2.0.4/jctrans.c +400 -0
  220. data/epeg/vendor/libjpeg-turbo-2.0.4/jdapimin.c +407 -0
  221. data/epeg/vendor/libjpeg-turbo-2.0.4/jdapistd.c +639 -0
  222. data/epeg/vendor/libjpeg-turbo-2.0.4/jdarith.c +773 -0
  223. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst-tj.c +203 -0
  224. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst.c +293 -0
  225. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc-tj.c +194 -0
  226. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc.c +295 -0
  227. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.c +692 -0
  228. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.h +82 -0
  229. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcol565.c +384 -0
  230. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolext.c +143 -0
  231. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolor.c +883 -0
  232. data/epeg/vendor/libjpeg-turbo-2.0.4/jdct.h +208 -0
  233. data/epeg/vendor/libjpeg-turbo-2.0.4/jddctmgr.c +352 -0
  234. data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.c +831 -0
  235. data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.h +238 -0
  236. data/epeg/vendor/libjpeg-turbo-2.0.4/jdicc.c +171 -0
  237. data/epeg/vendor/libjpeg-turbo-2.0.4/jdinput.c +408 -0
  238. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.c +460 -0
  239. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.h +71 -0
  240. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmarker.c +1377 -0
  241. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.c +737 -0
  242. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.h +28 -0
  243. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmerge.c +617 -0
  244. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrg565.c +354 -0
  245. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrgext.c +184 -0
  246. data/epeg/vendor/libjpeg-turbo-2.0.4/jdphuff.c +687 -0
  247. data/epeg/vendor/libjpeg-turbo-2.0.4/jdpostct.c +294 -0
  248. data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.c +518 -0
  249. data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.h +50 -0
  250. data/epeg/vendor/libjpeg-turbo-2.0.4/jdtrans.c +155 -0
  251. data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.c +251 -0
  252. data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.h +316 -0
  253. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctflt.c +169 -0
  254. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctfst.c +227 -0
  255. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctint.c +288 -0
  256. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctflt.c +240 -0
  257. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctfst.c +371 -0
  258. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctint.c +2627 -0
  259. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctred.c +409 -0
  260. data/epeg/vendor/libjpeg-turbo-2.0.4/jinclude.h +88 -0
  261. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemmgr.c +1179 -0
  262. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemnobs.c +115 -0
  263. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemsys.h +178 -0
  264. data/epeg/vendor/libjpeg-turbo-2.0.4/jmorecfg.h +421 -0
  265. data/epeg/vendor/libjpeg-turbo-2.0.4/jpeg_nbits_table.h +4098 -0
  266. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegcomp.h +31 -0
  267. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegint.h +368 -0
  268. data/epeg/vendor/libjpeg-turbo-2.0.4/jpeglib.h +1132 -0
  269. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.1 +295 -0
  270. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.c +601 -0
  271. data/epeg/vendor/libjpeg-turbo-2.0.4/jquant1.c +859 -0
  272. data/epeg/vendor/libjpeg-turbo-2.0.4/jquant2.c +1285 -0
  273. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd.h +117 -0
  274. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd_none.c +418 -0
  275. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimddct.h +70 -0
  276. data/epeg/vendor/libjpeg-turbo-2.0.4/jstdhuff.c +143 -0
  277. data/epeg/vendor/libjpeg-turbo-2.0.4/jutils.c +133 -0
  278. data/epeg/vendor/libjpeg-turbo-2.0.4/jversion.h +52 -0
  279. data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.map.in +11 -0
  280. data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.txt +3144 -0
  281. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/CMakeLists.txt +1 -0
  282. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.c +275 -0
  283. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.h +57 -0
  284. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5cmp.c +59 -0
  285. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5hl.c +125 -0
  286. data/epeg/vendor/libjpeg-turbo-2.0.4/rdbmp.c +689 -0
  287. data/epeg/vendor/libjpeg-turbo-2.0.4/rdcolmap.c +254 -0
  288. data/epeg/vendor/libjpeg-turbo-2.0.4/rdgif.c +39 -0
  289. data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.1 +63 -0
  290. data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.c +510 -0
  291. data/epeg/vendor/libjpeg-turbo-2.0.4/rdppm.c +766 -0
  292. data/epeg/vendor/libjpeg-turbo-2.0.4/rdrle.c +389 -0
  293. data/epeg/vendor/libjpeg-turbo-2.0.4/rdswitch.c +424 -0
  294. data/epeg/vendor/libjpeg-turbo-2.0.4/rdtarga.c +509 -0
  295. data/epeg/vendor/libjpeg-turbo-2.0.4/release/Distribution.xml.in +24 -0
  296. data/epeg/vendor/libjpeg-turbo-2.0.4/release/License.rtf +20 -0
  297. data/epeg/vendor/libjpeg-turbo-2.0.4/release/ReadMe.txt +5 -0
  298. data/epeg/vendor/libjpeg-turbo-2.0.4/release/Welcome.rtf +17 -0
  299. data/epeg/vendor/libjpeg-turbo-2.0.4/release/deb-control.in +31 -0
  300. data/epeg/vendor/libjpeg-turbo-2.0.4/release/installer.nsi.in +191 -0
  301. data/epeg/vendor/libjpeg-turbo-2.0.4/release/libjpeg.pc.in +10 -0
  302. data/epeg/vendor/libjpeg-turbo-2.0.4/release/libturbojpeg.pc.in +10 -0
  303. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makecygwinpkg.in +66 -0
  304. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makedpkg.in +115 -0
  305. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makemacpkg.in +284 -0
  306. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makerpm.in +30 -0
  307. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makesrpm.in +48 -0
  308. data/epeg/vendor/libjpeg-turbo-2.0.4/release/maketarball.in +51 -0
  309. data/epeg/vendor/libjpeg-turbo-2.0.4/release/rpm.spec.in +221 -0
  310. data/epeg/vendor/libjpeg-turbo-2.0.4/release/uninstall.in +113 -0
  311. data/epeg/vendor/libjpeg-turbo-2.0.4/sharedlib/CMakeLists.txt +99 -0
  312. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/CMakeLists.txt +385 -0
  313. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd.c +721 -0
  314. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd_neon.S +2878 -0
  315. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd.c +798 -0
  316. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd_neon.S +3433 -0
  317. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/gas-preprocessor.in +1 -0
  318. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-avx2.asm +578 -0
  319. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-mmx.asm +476 -0
  320. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-sse2.asm +503 -0
  321. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-avx2.asm +121 -0
  322. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-mmx.asm +121 -0
  323. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-sse2.asm +120 -0
  324. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-avx2.asm +113 -0
  325. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-mmx.asm +113 -0
  326. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-sse2.asm +112 -0
  327. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-avx2.asm +457 -0
  328. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-mmx.asm +355 -0
  329. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-sse2.asm +382 -0
  330. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jchuff-sse2.asm +424 -0
  331. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcphuff-sse2.asm +660 -0
  332. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-avx2.asm +388 -0
  333. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-mmx.asm +324 -0
  334. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-sse2.asm +351 -0
  335. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-avx2.asm +515 -0
  336. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-mmx.asm +404 -0
  337. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-sse2.asm +458 -0
  338. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-avx2.asm +118 -0
  339. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-mmx.asm +117 -0
  340. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-sse2.asm +117 -0
  341. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-avx2.asm +136 -0
  342. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-mmx.asm +123 -0
  343. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-sse2.asm +135 -0
  344. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-avx2.asm +575 -0
  345. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-mmx.asm +460 -0
  346. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-sse2.asm +517 -0
  347. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-avx2.asm +760 -0
  348. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-mmx.asm +731 -0
  349. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-sse2.asm +724 -0
  350. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-3dn.asm +318 -0
  351. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-sse.asm +369 -0
  352. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-mmx.asm +395 -0
  353. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-sse2.asm +403 -0
  354. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-avx2.asm +331 -0
  355. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-mmx.asm +620 -0
  356. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-sse2.asm +633 -0
  357. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-3dn.asm +451 -0
  358. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse.asm +571 -0
  359. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse2.asm +497 -0
  360. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-mmx.asm +499 -0
  361. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-sse2.asm +501 -0
  362. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-avx2.asm +453 -0
  363. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-mmx.asm +851 -0
  364. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-sse2.asm +858 -0
  365. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-mmx.asm +704 -0
  366. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-sse2.asm +592 -0
  367. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-3dn.asm +230 -0
  368. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-mmx.asm +276 -0
  369. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-sse.asm +208 -0
  370. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquantf-sse2.asm +168 -0
  371. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-avx2.asm +188 -0
  372. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-sse2.asm +201 -0
  373. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimd.c +1253 -0
  374. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimdcpu.asm +135 -0
  375. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/jsimd.h +1083 -0
  376. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolext-mmi.c +483 -0
  377. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolor-mmi.c +148 -0
  378. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample-mmi.c +100 -0
  379. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample.h +28 -0
  380. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolext-mmi.c +424 -0
  381. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolor-mmi.c +139 -0
  382. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdsample-mmi.c +245 -0
  383. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jfdctint-mmi.c +398 -0
  384. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jidctint-mmi.c +571 -0
  385. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jquanti-mmi.c +130 -0
  386. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd.c +610 -0
  387. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd_mmi.h +57 -0
  388. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/loongson-mmintrin.h +1324 -0
  389. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd.c +1123 -0
  390. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2.S +4479 -0
  391. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2_asm.h +292 -0
  392. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jcolsamp.inc +135 -0
  393. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jdct.inc +31 -0
  394. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jpeg_nbits_table.inc +4097 -0
  395. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc +93 -0
  396. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc.h +131 -0
  397. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdext.inc +479 -0
  398. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolext-altivec.c +269 -0
  399. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolor-altivec.c +116 -0
  400. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgray-altivec.c +111 -0
  401. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgryext-altivec.c +228 -0
  402. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample-altivec.c +159 -0
  403. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample.h +28 -0
  404. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolext-altivec.c +276 -0
  405. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolor-altivec.c +106 -0
  406. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmerge-altivec.c +130 -0
  407. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmrgext-altivec.c +329 -0
  408. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdsample-altivec.c +400 -0
  409. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctfst-altivec.c +154 -0
  410. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctint-altivec.c +258 -0
  411. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctfst-altivec.c +255 -0
  412. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctint-altivec.c +357 -0
  413. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jquanti-altivec.c +250 -0
  414. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd.c +872 -0
  415. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd_altivec.h +98 -0
  416. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-avx2.asm +558 -0
  417. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-sse2.asm +483 -0
  418. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-avx2.asm +121 -0
  419. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-sse2.asm +120 -0
  420. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-avx2.asm +113 -0
  421. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-sse2.asm +112 -0
  422. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-avx2.asm +437 -0
  423. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-sse2.asm +362 -0
  424. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jchuff-sse2.asm +346 -0
  425. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcphuff-sse2.asm +637 -0
  426. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-avx2.asm +366 -0
  427. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-sse2.asm +329 -0
  428. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-avx2.asm +495 -0
  429. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-sse2.asm +438 -0
  430. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-avx2.asm +118 -0
  431. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-sse2.asm +117 -0
  432. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-avx2.asm +136 -0
  433. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-sse2.asm +135 -0
  434. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-avx2.asm +593 -0
  435. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-sse2.asm +535 -0
  436. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-avx2.asm +695 -0
  437. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-sse2.asm +664 -0
  438. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctflt-sse.asm +355 -0
  439. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctfst-sse2.asm +389 -0
  440. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-avx2.asm +320 -0
  441. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-sse2.asm +619 -0
  442. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctflt-sse2.asm +481 -0
  443. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctfst-sse2.asm +490 -0
  444. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-avx2.asm +417 -0
  445. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-sse2.asm +846 -0
  446. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctred-sse2.asm +573 -0
  447. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquantf-sse2.asm +154 -0
  448. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-avx2.asm +162 -0
  449. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-sse2.asm +187 -0
  450. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimd.c +1076 -0
  451. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimdcpu.asm +86 -0
  452. data/epeg/vendor/libjpeg-turbo-2.0.4/structure.txt +904 -0
  453. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.bmp +0 -0
  454. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.txt +25 -0
  455. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test.scan +5 -0
  456. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc +0 -0
  457. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc.txt +20 -0
  458. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc +0 -0
  459. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc.txt +20 -0
  460. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgari.jpg +0 -0
  461. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgint.jpg +0 -0
  462. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.jpg +0 -0
  463. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.ppm +4 -0
  464. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig12.jpg +0 -0
  465. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_5674_0098.bmp +0 -0
  466. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6434_0018a.bmp +0 -0
  467. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6548_0026a.bmp +0 -0
  468. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbench.c +1031 -0
  469. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.in +256 -0
  470. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.java.in +215 -0
  471. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexample.c +396 -0
  472. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.in +149 -0
  473. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.java.in +151 -0
  474. data/epeg/vendor/libjpeg-turbo-2.0.4/tjunittest.c +931 -0
  475. data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.c +70 -0
  476. data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.h +47 -0
  477. data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.c +1628 -0
  478. data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.h +210 -0
  479. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-jni.c +1246 -0
  480. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile +65 -0
  481. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile.jni +101 -0
  482. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.c +2152 -0
  483. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.h +1744 -0
  484. data/epeg/vendor/libjpeg-turbo-2.0.4/usage.txt +635 -0
  485. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jconfig.h.in +34 -0
  486. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62-memsrcdst.def +108 -0
  487. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62.def +106 -0
  488. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7-memsrcdst.def +110 -0
  489. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7.def +108 -0
  490. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg8.def +111 -0
  491. data/epeg/vendor/libjpeg-turbo-2.0.4/wizard.txt +212 -0
  492. data/epeg/vendor/libjpeg-turbo-2.0.4/wrbmp.c +558 -0
  493. data/epeg/vendor/libjpeg-turbo-2.0.4/wrgif.c +413 -0
  494. data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.1 +103 -0
  495. data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.c +591 -0
  496. data/epeg/vendor/libjpeg-turbo-2.0.4/wrppm.c +365 -0
  497. data/epeg/vendor/libjpeg-turbo-2.0.4/wrrle.c +309 -0
  498. data/epeg/vendor/libjpeg-turbo-2.0.4/wrtarga.c +261 -0
  499. data/epeg.c +131 -0
  500. data/epeg.gemspec +18 -0
  501. data/extconf.rb +80 -0
  502. data/test.jpg +0 -0
  503. data/test.rb +42 -0
  504. metadata +546 -0
@@ -0,0 +1,1420 @@
1
+ cmake_minimum_required(VERSION 2.8.12)
2
+
3
+ if(CMAKE_EXECUTABLE_SUFFIX)
4
+ set(CMAKE_EXECUTABLE_SUFFIX_TMP ${CMAKE_EXECUTABLE_SUFFIX})
5
+ endif()
6
+
7
+ project(libjpeg-turbo C)
8
+ set(VERSION 2.0.4)
9
+ string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
10
+ list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
11
+ list(GET VERSION_TRIPLET 1 VERSION_MINOR)
12
+ list(GET VERSION_TRIPLET 2 VERSION_REVISION)
13
+ function(pad_number NUMBER OUTPUT_LEN)
14
+ string(LENGTH "${${NUMBER}}" INPUT_LEN)
15
+ if(INPUT_LEN LESS OUTPUT_LEN)
16
+ math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
17
+ set(NUM ${${NUMBER}})
18
+ foreach(C RANGE ${ZEROES})
19
+ set(NUM "0${NUM}")
20
+ endforeach()
21
+ set(${NUMBER} ${NUM} PARENT_SCOPE)
22
+ endif()
23
+ endfunction()
24
+ pad_number(VERSION_MINOR 3)
25
+ pad_number(VERSION_REVISION 3)
26
+ set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
27
+
28
+ string(TIMESTAMP DEFAULT_BUILD "%Y%m%d")
29
+ set(BUILD ${DEFAULT_BUILD} CACHE STRING "Build string (default: ${DEFAULT_BUILD})")
30
+
31
+ # NOTE: On Windows, this does nothing except when using MinGW or Cygwin.
32
+ # CMAKE_BUILD_TYPE has no meaning in Visual Studio, and it always defaults to
33
+ # Debug when using NMake.
34
+ if(NOT CMAKE_BUILD_TYPE)
35
+ set(CMAKE_BUILD_TYPE Release)
36
+ endif()
37
+ message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
38
+
39
+ message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
40
+
41
+ # Detect CPU type and whether we're building 64-bit or 32-bit code
42
+ math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
43
+ string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
44
+ if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
45
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
46
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
47
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86" OR
48
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "ia32")
49
+ if(BITS EQUAL 64)
50
+ set(CPU_TYPE x86_64)
51
+ else()
52
+ set(CPU_TYPE i386)
53
+ endif()
54
+ if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ${CPU_TYPE})
55
+ set(CMAKE_SYSTEM_PROCESSOR ${CPU_TYPE})
56
+ endif()
57
+ elseif(CMAKE_SYSTEM_PROCESSOR_LC STREQUAL "aarch64" OR
58
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "arm*64*")
59
+ set(CPU_TYPE arm64)
60
+ elseif(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "arm*")
61
+ set(CPU_TYPE arm)
62
+ elseif(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "ppc*" OR
63
+ CMAKE_SYSTEM_PROCESSOR_LC MATCHES "powerpc*")
64
+ set(CPU_TYPE powerpc)
65
+ else()
66
+ set(CPU_TYPE ${CMAKE_SYSTEM_PROCESSOR_LC})
67
+ endif()
68
+ message(STATUS "${BITS}-bit build (${CPU_TYPE})")
69
+
70
+
71
+ ###############################################################################
72
+ # INSTALL DIRECTORIES
73
+ ###############################################################################
74
+
75
+ if(WIN32)
76
+ if(MSVC)
77
+ set(CMAKE_INSTALL_DEFAULT_PREFIX "c:/${CMAKE_PROJECT_NAME}")
78
+ else()
79
+ set(CMAKE_INSTALL_DEFAULT_PREFIX "c:/${CMAKE_PROJECT_NAME}-gcc")
80
+ endif()
81
+ if(BITS EQUAL 64)
82
+ set(CMAKE_INSTALL_DEFAULT_PREFIX "${CMAKE_INSTALL_DEFAULT_PREFIX}64")
83
+ endif()
84
+ else()
85
+ set(CMAKE_INSTALL_DEFAULT_PREFIX /opt/${CMAKE_PROJECT_NAME})
86
+ endif()
87
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
88
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_DEFAULT_PREFIX}" CACHE PATH
89
+ "Directory into which to install ${CMAKE_PROJECT_NAME} (default: ${CMAKE_INSTALL_DEFAULT_PREFIX})"
90
+ FORCE)
91
+ endif()
92
+ message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
93
+
94
+ # When the prefix is /opt/${CMAKE_PROJECT_NAME}, we assume that an "official"
95
+ # build is being created, and thus we install things into specific locations.
96
+
97
+ if(CMAKE_INSTALL_PREFIX STREQUAL "${CMAKE_INSTALL_DEFAULT_PREFIX}")
98
+ set(CMAKE_INSTALL_DEFAULT_DATAROOTDIR "")
99
+ set(CMAKE_INSTALL_DEFAULT_DOCDIR "<CMAKE_INSTALL_DATAROOTDIR>/doc")
100
+ set(CMAKE_INSTALL_DEFAULT_JAVADIR "<CMAKE_INSTALL_DATAROOTDIR>/classes")
101
+ if(UNIX AND NOT APPLE)
102
+ if(BITS EQUAL 64)
103
+ set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib64")
104
+ else()
105
+ set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib32")
106
+ endif()
107
+ endif()
108
+ endif()
109
+
110
+ include(cmakescripts/GNUInstallDirs.cmake)
111
+
112
+ macro(report_directory var)
113
+ if(CMAKE_INSTALL_${var} STREQUAL CMAKE_INSTALL_FULL_${var})
114
+ message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}}")
115
+ else()
116
+ message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}} (${CMAKE_INSTALL_FULL_${var}})")
117
+ endif()
118
+ mark_as_advanced(CLEAR CMAKE_INSTALL_${var})
119
+ endmacro()
120
+
121
+ set(DIRLIST "BINDIR;DATAROOTDIR;DOCDIR;INCLUDEDIR;LIBDIR")
122
+ if(UNIX)
123
+ list(APPEND DIRLIST "MANDIR")
124
+ endif()
125
+ foreach(dir ${DIRLIST})
126
+ report_directory(${dir})
127
+ endforeach()
128
+
129
+
130
+ ###############################################################################
131
+ # CONFIGURATION OPTIONS
132
+ ###############################################################################
133
+
134
+ macro(boolean_number var)
135
+ if(${var})
136
+ set(${var} 1)
137
+ else()
138
+ set(${var} 0)
139
+ endif()
140
+ endmacro()
141
+
142
+ option(ENABLE_SHARED "Build shared libraries" TRUE)
143
+ boolean_number(ENABLE_SHARED)
144
+ option(ENABLE_STATIC "Build static libraries" TRUE)
145
+ boolean_number(ENABLE_STATIC)
146
+ option(REQUIRE_SIMD "Generate a fatal error if SIMD extensions are not available for this platform (default is to fall back to a non-SIMD build)" FALSE)
147
+ boolean_number(REQUIRE_SIMD)
148
+ option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_ARITH_DEC=0 WITH_ARITH_ENC=0 WITH_JAVA=0 WITH_SIMD=0 WITH_TURBOJPEG=0 )" FALSE)
149
+ boolean_number(WITH_12BIT)
150
+ option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
151
+ boolean_number(WITH_ARITH_DEC)
152
+ option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
153
+ boolean_number(WITH_ARITH_ENC)
154
+ option(WITH_JAVA "Build Java wrapper for the TurboJPEG API library (implies ENABLE_SHARED=1)" FALSE)
155
+ boolean_number(WITH_JAVA)
156
+ option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
157
+ boolean_number(WITH_JPEG7)
158
+ option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
159
+ boolean_number(WITH_JPEG8)
160
+ option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
161
+ boolean_number(WITH_MEM_SRCDST)
162
+ option(WITH_SIMD "Include SIMD extensions, if available for this platform" TRUE)
163
+ boolean_number(WITH_SIMD)
164
+ option(WITH_TURBOJPEG "Include the TurboJPEG API library and associated test programs" TRUE)
165
+ boolean_number(WITH_TURBOJPEG)
166
+
167
+ macro(report_option var desc)
168
+ if(${var})
169
+ message(STATUS "${desc} enabled (${var} = ${${var}})")
170
+ else()
171
+ message(STATUS "${desc} disabled (${var} = ${${var}})")
172
+ endif()
173
+ endmacro()
174
+
175
+ if(WITH_JAVA)
176
+ set(ENABLE_SHARED 1)
177
+ endif()
178
+
179
+ # Explicitly setting CMAKE_POSITION_INDEPENDENT_CODE=FALSE disables PIC for all
180
+ # targets, which will cause the shared library builds to fail. Thus, if shared
181
+ # libraries are enabled and CMAKE_POSITION_INDEPENDENT_CODE is explicitly set
182
+ # to FALSE, we need to unset it, thus restoring the default behavior
183
+ # (automatically using PIC for shared library targets.)
184
+ if(DEFINED CMAKE_POSITION_INDEPENDENT_CODE AND
185
+ NOT CMAKE_POSITION_INDEPENDENT_CODE AND ENABLE_SHARED)
186
+ unset(CMAKE_POSITION_INDEPENDENT_CODE CACHE)
187
+ endif()
188
+
189
+ report_option(ENABLE_SHARED "Shared libraries")
190
+ report_option(ENABLE_STATIC "Static libraries")
191
+
192
+ if(ENABLE_SHARED)
193
+ set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
194
+ endif()
195
+
196
+ if(WITH_12BIT)
197
+ set(WITH_ARITH_DEC 0)
198
+ set(WITH_ARITH_ENC 0)
199
+ set(WITH_JAVA 0)
200
+ set(WITH_SIMD 0)
201
+ set(WITH_TURBOJPEG 0)
202
+ set(BITS_IN_JSAMPLE 12)
203
+ else()
204
+ set(BITS_IN_JSAMPLE 8)
205
+ endif()
206
+ report_option(WITH_12BIT "12-bit JPEG support")
207
+
208
+ if(WITH_JPEG8 OR WITH_JPEG7)
209
+ set(WITH_ARITH_ENC 1)
210
+ set(WITH_ARITH_DEC 1)
211
+ endif()
212
+ if(WITH_JPEG8)
213
+ set(WITH_MEM_SRCDST 0)
214
+ endif()
215
+
216
+ if(WITH_ARITH_DEC)
217
+ set(D_ARITH_CODING_SUPPORTED 1)
218
+ endif()
219
+ if(NOT WITH_12BIT)
220
+ report_option(WITH_ARITH_DEC "Arithmetic decoding support")
221
+ endif()
222
+
223
+ if(WITH_ARITH_ENC)
224
+ set(C_ARITH_CODING_SUPPORTED 1)
225
+ endif()
226
+ if(NOT WITH_12BIT)
227
+ report_option(WITH_ARITH_ENC "Arithmetic encoding support")
228
+ endif()
229
+
230
+ if(NOT WITH_12BIT)
231
+ report_option(WITH_TURBOJPEG "TurboJPEG API library")
232
+ report_option(WITH_JAVA "TurboJPEG Java wrapper")
233
+ endif()
234
+
235
+ if(WITH_MEM_SRCDST)
236
+ set(MEM_SRCDST_SUPPORTED 1)
237
+ set(MEM_SRCDST_FUNCTIONS "global: jpeg_mem_dest; jpeg_mem_src;")
238
+ endif()
239
+ if(NOT WITH_JPEG8)
240
+ report_option(WITH_MEM_SRCDST "In-memory source/destination managers")
241
+ endif()
242
+
243
+ set(SO_AGE 2)
244
+ if(WITH_MEM_SRCDST)
245
+ set(SO_AGE 3)
246
+ endif()
247
+
248
+ if(WITH_JPEG8)
249
+ set(JPEG_LIB_VERSION 80)
250
+ elseif(WITH_JPEG7)
251
+ set(JPEG_LIB_VERSION 70)
252
+ else()
253
+ set(JPEG_LIB_VERSION 62)
254
+ endif()
255
+
256
+ math(EXPR JPEG_LIB_VERSION_DIV10 "${JPEG_LIB_VERSION} / 10")
257
+ math(EXPR JPEG_LIB_VERSION_MOD10 "${JPEG_LIB_VERSION} % 10")
258
+ if(JPEG_LIB_VERSION STREQUAL "62")
259
+ set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION})
260
+ else()
261
+ set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION_DIV10})
262
+ endif()
263
+ if(JPEG_LIB_VERSION STREQUAL "80")
264
+ set(DEFAULT_SO_MINOR_VERSION 2)
265
+ else()
266
+ set(DEFAULT_SO_MINOR_VERSION 0)
267
+ endif()
268
+
269
+ # This causes SO_MAJOR_VERSION/SO_MINOR_VERSION to reset to defaults if
270
+ # WITH_JPEG7 or WITH_JPEG8 has changed.
271
+ if((DEFINED WITH_JPEG7_INT AND NOT WITH_JPEG7 EQUAL WITH_JPEG7_INT) OR
272
+ (DEFINED WITH_JPEG8_INT AND NOT WITH_JPEG8 EQUAL WITH_JPEG8_INT))
273
+ set(FORCE_SO_VERSION "FORCE")
274
+ endif()
275
+ set(WITH_JPEG7_INT ${WITH_JPEG7} CACHE INTERNAL "")
276
+ set(WITH_JPEG8_INT ${WITH_JPEG8} CACHE INTERNAL "")
277
+
278
+ set(SO_MAJOR_VERSION ${DEFAULT_SO_MAJOR_VERSION} CACHE STRING
279
+ "Major version of the libjpeg API shared library (default: ${DEFAULT_SO_MAJOR_VERSION})"
280
+ ${FORCE_SO_VERSION})
281
+ set(SO_MINOR_VERSION ${DEFAULT_SO_MINOR_VERSION} CACHE STRING
282
+ "Minor version of the libjpeg API shared library (default: ${DEFAULT_SO_MINOR_VERSION})"
283
+ ${FORCE_SO_VERSION})
284
+
285
+ set(JPEG_LIB_VERSION_DECIMAL "${JPEG_LIB_VERSION_DIV10}.${JPEG_LIB_VERSION_MOD10}")
286
+ message(STATUS "Emulating libjpeg API/ABI v${JPEG_LIB_VERSION_DECIMAL} (WITH_JPEG7 = ${WITH_JPEG7}, WITH_JPEG8 = ${WITH_JPEG8})")
287
+ message(STATUS "libjpeg API shared library version = ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION}")
288
+
289
+ # Because the TurboJPEG API library uses versioned symbols and changes the
290
+ # names of functions whenever they are modified in a backward-incompatible
291
+ # manner, it is always backward-ABI-compatible with itself, so the major and
292
+ # minor SO versions don't change. However, we increase the middle number (the
293
+ # SO "age") whenever functions are added to the API.
294
+ set(TURBOJPEG_SO_MAJOR_VERSION 0)
295
+ set(TURBOJPEG_SO_VERSION 0.2.0)
296
+
297
+
298
+ ###############################################################################
299
+ # COMPILER SETTINGS
300
+ ###############################################################################
301
+
302
+ if(MSVC)
303
+ option(WITH_CRT_DLL
304
+ "Link all ${CMAKE_PROJECT_NAME} libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The default is to use the C run-time DLL only with the libraries and executables that need it."
305
+ FALSE)
306
+ if(NOT WITH_CRT_DLL)
307
+ # Use the static C library for all build types
308
+ foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
309
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
310
+ if(${var} MATCHES "/MD")
311
+ string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
312
+ endif()
313
+ endforeach()
314
+ endif()
315
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /wd4996")
316
+ endif()
317
+
318
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
319
+ # Use the maximum optimization level for release builds
320
+ foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
321
+ if(${var} MATCHES "-O2")
322
+ string(REGEX REPLACE "-O2" "-O3" ${var} "${${var}}")
323
+ endif()
324
+ endforeach()
325
+ endif()
326
+
327
+ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
328
+ if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
329
+ # Use the maximum optimization level for release builds
330
+ foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
331
+ if(${var} MATCHES "-xO3")
332
+ string(REGEX REPLACE "-xO3" "-xO5" ${var} "${${var}}")
333
+ endif()
334
+ if(${var} MATCHES "-xO2")
335
+ string(REGEX REPLACE "-xO2" "-xO5" ${var} "${${var}}")
336
+ endif()
337
+ endforeach()
338
+ endif()
339
+ endif()
340
+
341
+ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
342
+
343
+ set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
344
+ message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}")
345
+
346
+ set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
347
+ message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}")
348
+
349
+ include(CheckCSourceCompiles)
350
+ include(CheckIncludeFiles)
351
+ include(CheckTypeSize)
352
+
353
+ check_type_size("size_t" SIZE_T)
354
+ check_type_size("unsigned long" UNSIGNED_LONG)
355
+
356
+ if(SIZE_T EQUAL UNSIGNED_LONG)
357
+ check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
358
+ HAVE_BUILTIN_CTZL)
359
+ endif()
360
+ if(MSVC)
361
+ check_include_files("intrin.h" HAVE_INTRIN_H)
362
+ endif()
363
+
364
+ if(UNIX)
365
+ # Check for headers
366
+ check_include_files(locale.h HAVE_LOCALE_H)
367
+ check_include_files(stddef.h HAVE_STDDEF_H)
368
+ check_include_files(stdlib.h HAVE_STDLIB_H)
369
+ check_include_files(sys/types.h NEED_SYS_TYPES_H)
370
+
371
+ # Check for functions
372
+ include(CheckSymbolExists)
373
+ check_symbol_exists(memset string.h HAVE_MEMSET)
374
+ check_symbol_exists(memcpy string.h HAVE_MEMCPY)
375
+ if(NOT HAVE_MEMSET AND NOT HAVE_MEMCPY)
376
+ set(NEED_BSD_STRINGS 1)
377
+ endif()
378
+
379
+ # Check for types
380
+ check_type_size("unsigned char" UNSIGNED_CHAR)
381
+ check_type_size("unsigned short" UNSIGNED_SHORT)
382
+
383
+ # Check for compiler features
384
+ check_c_source_compiles("int main(void) { typedef struct undefined_structure *undef_struct_ptr; undef_struct_ptr ptr = 0; return ptr != 0; }"
385
+ INCOMPLETE_TYPES)
386
+ if(INCOMPLETE_TYPES)
387
+ message(STATUS "Compiler supports pointers to undefined structures.")
388
+ else()
389
+ set(INCOMPLETE_TYPES_BROKEN 1)
390
+ message(STATUS "Compiler does not support pointers to undefined structures.")
391
+ endif()
392
+
393
+ if(CMAKE_CROSSCOMPILING)
394
+ set(RIGHT_SHIFT_IS_UNSIGNED 0)
395
+ else()
396
+ include(CheckCSourceRuns)
397
+ check_c_source_runs("
398
+ #include <stdio.h>
399
+ #include <stdlib.h>
400
+ int is_shifting_signed (long arg) {
401
+ long res = arg >> 4;
402
+ if (res == -0x7F7E80CL)
403
+ return 1; /* right shift is signed */
404
+ /* see if unsigned-shift hack will fix it. */
405
+ /* we can't just test exact value since it depends on width of long... */
406
+ res |= (~0L) << (32-4);
407
+ if (res == -0x7F7E80CL)
408
+ return 0; /* right shift is unsigned */
409
+ printf(\"Right shift isn't acting as I expect it to.\\\\n\");
410
+ printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
411
+ return 0; /* try it with unsigned anyway */
412
+ }
413
+ int main (void) {
414
+ exit(is_shifting_signed(-0x7F7E80B1L));
415
+ }" RIGHT_SHIFT_IS_UNSIGNED)
416
+ endif()
417
+
418
+ if(CMAKE_CROSSCOMPILING)
419
+ set(__CHAR_UNSIGNED__ 0)
420
+ else()
421
+ check_c_source_runs("int main(void) { return ((char) -1 < 0); }"
422
+ __CHAR_UNSIGNED__)
423
+ endif()
424
+ endif()
425
+
426
+ if(MSVC)
427
+ set(INLINE_OPTIONS "__inline;inline")
428
+ else()
429
+ set(INLINE_OPTIONS "__inline__;inline")
430
+ endif()
431
+ option(FORCE_INLINE "Force function inlining" TRUE)
432
+ boolean_number(FORCE_INLINE)
433
+ if(FORCE_INLINE)
434
+ if(MSVC)
435
+ list(INSERT INLINE_OPTIONS 0 "__forceinline")
436
+ else()
437
+ list(INSERT INLINE_OPTIONS 0 "inline __attribute__((always_inline))")
438
+ list(INSERT INLINE_OPTIONS 0 "__inline__ __attribute__((always_inline))")
439
+ endif()
440
+ endif()
441
+ foreach(inline ${INLINE_OPTIONS})
442
+ check_c_source_compiles("${inline} static int foo(void) { return 0; } int main(void) { return foo(); }"
443
+ INLINE_WORKS)
444
+ if(INLINE_WORKS)
445
+ set(INLINE ${inline})
446
+ break()
447
+ endif()
448
+ endforeach()
449
+ if(NOT INLINE_WORKS)
450
+ message(FATAL_ERROR "Could not determine how to inline functions.")
451
+ endif()
452
+ message(STATUS "INLINE = ${INLINE} (FORCE_INLINE = ${FORCE_INLINE})")
453
+
454
+ if(UNIX AND NOT APPLE)
455
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map "VERS_1 { global: *; };")
456
+ set(CMAKE_REQUIRED_FLAGS
457
+ "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
458
+ check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSION_SCRIPT)
459
+ set(CMAKE_REQUIRED_FLAGS)
460
+ file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
461
+ if(HAVE_VERSION_SCRIPT)
462
+ message(STATUS "Linker supports GNU-style version scripts")
463
+ set(MAPFLAG "-Wl,--version-script,")
464
+ set(TJMAPFLAG "-Wl,--version-script,")
465
+ else()
466
+ message(STATUS "Linker does not support GNU-style version scripts")
467
+ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
468
+ # The Solaris linker doesn't like our version script for the libjpeg API
469
+ # library, but the version script for the TurboJPEG API library should
470
+ # still work.
471
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map
472
+ "VERS_1 { global: foo; local: *; }; VERS_2 { global: foo2; } VERS_1;")
473
+ set(CMAKE_REQUIRED_FLAGS "-Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/conftest.map -shared")
474
+ check_c_source_compiles("int foo() { return 0; } int foo2() { return 2; }"
475
+ HAVE_MAPFILE)
476
+ set(CMAKE_REQUIRED_FLAGS)
477
+ file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
478
+ if(HAVE_MAPFILE)
479
+ message(STATUS "Linker supports mapfiles")
480
+ set(TJMAPFLAG "-Wl,-M,")
481
+ else()
482
+ message(STATUS "Linker does not support mapfiles")
483
+ endif()
484
+ endif()
485
+ endif()
486
+ endif()
487
+
488
+ # Generate files
489
+ if(WIN32)
490
+ configure_file(win/jconfig.h.in jconfig.h)
491
+ else()
492
+ configure_file(jconfig.h.in jconfig.h)
493
+ endif()
494
+ configure_file(jconfigint.h.in jconfigint.h)
495
+ if(UNIX)
496
+ configure_file(libjpeg.map.in libjpeg.map)
497
+ endif()
498
+
499
+ # Include directories and compiler definitions
500
+ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
501
+
502
+
503
+ ###############################################################################
504
+ # TARGETS
505
+ ###############################################################################
506
+
507
+ if(CMAKE_EXECUTABLE_SUFFIX_TMP)
508
+ set(CMAKE_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX_TMP})
509
+ endif()
510
+ message(STATUS "CMAKE_EXECUTABLE_SUFFIX = ${CMAKE_EXECUTABLE_SUFFIX}")
511
+
512
+ set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
513
+ jcicc.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
514
+ jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
515
+ jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
516
+ jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
517
+ jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
518
+ jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
519
+ jpegtran.c cdjpeg.c rdswitch.c transupp.c)
520
+
521
+ if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
522
+ set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
523
+ endif()
524
+
525
+ if(WITH_ARITH_ENC)
526
+ set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
527
+ endif()
528
+
529
+ if(WITH_ARITH_DEC)
530
+ set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
531
+ endif()
532
+
533
+ if(WITH_SIMD)
534
+ add_subdirectory(simd)
535
+ elseif(NOT WITH_12BIT)
536
+ message(STATUS "SIMD extensions: None (WITH_SIMD = ${WITH_SIMD})")
537
+ endif()
538
+ if(WITH_SIMD)
539
+ message(STATUS "SIMD extensions: ${CPU_TYPE} (WITH_SIMD = ${WITH_SIMD})")
540
+ if(MSVC_IDE OR XCODE)
541
+ set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
542
+ endif()
543
+ else()
544
+ add_library(simd OBJECT jsimd_none.c)
545
+ endif()
546
+
547
+ if(WITH_JAVA)
548
+ add_subdirectory(java)
549
+ endif()
550
+
551
+ if(ENABLE_SHARED)
552
+ add_subdirectory(sharedlib)
553
+ endif()
554
+
555
+ if(ENABLE_STATIC)
556
+ add_library(jpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
557
+ ${SIMD_OBJS})
558
+ if(NOT MSVC)
559
+ set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)
560
+ endif()
561
+ endif()
562
+
563
+ if(WITH_TURBOJPEG)
564
+ if(ENABLE_SHARED)
565
+ set(TURBOJPEG_SOURCES ${JPEG_SOURCES} $<TARGET_OBJECTS:simd> ${SIMD_OBJS}
566
+ turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c rdppm.c
567
+ wrbmp.c wrppm.c)
568
+ set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile)
569
+ if(WITH_JAVA)
570
+ set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
571
+ include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
572
+ set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile.jni)
573
+ endif()
574
+ add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
575
+ set_property(TARGET turbojpeg PROPERTY COMPILE_FLAGS
576
+ "-DBMP_SUPPORTED -DPPM_SUPPORTED")
577
+ if(WIN32)
578
+ set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
579
+ endif()
580
+ if(MINGW)
581
+ set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
582
+ endif()
583
+ if(APPLE AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR
584
+ CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4))
585
+ if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
586
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
587
+ endif()
588
+ set_target_properties(turbojpeg PROPERTIES MACOSX_RPATH 1)
589
+ endif()
590
+ set_target_properties(turbojpeg PROPERTIES
591
+ SOVERSION ${TURBOJPEG_SO_MAJOR_VERSION} VERSION ${TURBOJPEG_SO_VERSION})
592
+ if(TJMAPFLAG)
593
+ set_target_properties(turbojpeg PROPERTIES
594
+ LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
595
+ endif()
596
+
597
+ add_executable(tjunittest tjunittest.c tjutil.c md5/md5.c md5/md5hl.c)
598
+ target_link_libraries(tjunittest turbojpeg)
599
+
600
+ add_executable(tjbench tjbench.c tjutil.c)
601
+ target_link_libraries(tjbench turbojpeg)
602
+ if(UNIX)
603
+ target_link_libraries(tjbench m)
604
+ endif()
605
+
606
+ add_executable(tjexample tjexample.c)
607
+ target_link_libraries(tjexample turbojpeg)
608
+ endif()
609
+
610
+ if(ENABLE_STATIC)
611
+ add_library(turbojpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
612
+ ${SIMD_OBJS} turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c
613
+ rdppm.c wrbmp.c wrppm.c)
614
+ set_property(TARGET turbojpeg-static PROPERTY COMPILE_FLAGS
615
+ "-DBMP_SUPPORTED -DPPM_SUPPORTED")
616
+ if(NOT MSVC)
617
+ set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
618
+ endif()
619
+
620
+ add_executable(tjunittest-static tjunittest.c tjutil.c md5/md5.c
621
+ md5/md5hl.c)
622
+ target_link_libraries(tjunittest-static turbojpeg-static)
623
+
624
+ add_executable(tjbench-static tjbench.c tjutil.c)
625
+ target_link_libraries(tjbench-static turbojpeg-static)
626
+ if(UNIX)
627
+ target_link_libraries(tjbench-static m)
628
+ endif()
629
+ endif()
630
+ endif()
631
+
632
+ if(WIN32)
633
+ set(USE_SETMODE "-DUSE_SETMODE")
634
+ endif()
635
+ if(WITH_12BIT)
636
+ set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
637
+ else()
638
+ set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
639
+ set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
640
+ set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
641
+ endif()
642
+
643
+ if(ENABLE_STATIC)
644
+ add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c
645
+ ${CJPEG_BMP_SOURCES})
646
+ set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
647
+ target_link_libraries(cjpeg-static jpeg-static)
648
+
649
+ add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrgif.c
650
+ wrppm.c ${DJPEG_BMP_SOURCES})
651
+ set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
652
+ target_link_libraries(djpeg-static jpeg-static)
653
+
654
+ add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)
655
+ target_link_libraries(jpegtran-static jpeg-static)
656
+ set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
657
+ endif()
658
+
659
+ add_executable(rdjpgcom rdjpgcom.c)
660
+
661
+ add_executable(wrjpgcom wrjpgcom.c)
662
+
663
+
664
+ ###############################################################################
665
+ # TESTS
666
+ ###############################################################################
667
+
668
+ add_subdirectory(md5)
669
+
670
+ if(MSVC_IDE OR XCODE)
671
+ set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/")
672
+ else()
673
+ set(OBJDIR "")
674
+ endif()
675
+
676
+ enable_testing()
677
+
678
+ if(WITH_12BIT)
679
+ set(TESTORIG testorig12.jpg)
680
+ set(MD5_JPEG_RGB_ISLOW 9d7369207c520d37f2c1cbfcb82b2964)
681
+ set(MD5_JPEG_RGB_ISLOW2 a00bd20d8ae49684640ef7177d2e0b64)
682
+ set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0)
683
+ set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4)
684
+ set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950)
685
+ set(MD5_PPM_422M_IFAST 07737bfe8a7c1c87aaa393a0098d16b0)
686
+ set(MD5_JPEG_420_IFAST_Q100_PROG 008ab68d6ddbba04a8f01deee4e0f9f8)
687
+ set(MD5_PPM_420_Q100_IFAST 1b3730122709f53d007255e8dfd3305e)
688
+ set(MD5_PPM_420M_Q100_IFAST 980a1a3c5bf9510022869d30b7d26566)
689
+ set(MD5_JPEG_GRAY_ISLOW 235c90707b16e2e069f37c888b2636d9)
690
+ set(MD5_PPM_GRAY_ISLOW 7213c10af507ad467da5578ca5ee1fca)
691
+ set(MD5_PPM_GRAY_ISLOW_RGB e96ee81c30a6ed422d466338bd3de65d)
692
+ set(MD5_JPEG_420S_IFAST_OPT 7af8e60be4d9c227ec63ac9b6630855e)
693
+
694
+ set(MD5_JPEG_3x2_FLOAT_PROG_SSE a8c17daf77b457725ec929e215b603f8)
695
+ set(MD5_PPM_3x2_FLOAT_SSE 42876ab9e5c2f76a87d08db5fbd57956)
696
+ set(MD5_JPEG_3x2_FLOAT_PROG_32BIT a8c17daf77b457725ec929e215b603f8)
697
+ set(MD5_PPM_3x2_FLOAT_32BIT ${MD5_PPM_3x2_FLOAT_SSE})
698
+ set(MD5_JPEG_3x2_FLOAT_PROG_64BIT ${MD5_JPEG_3x2_FLOAT_PROG_32BIT})
699
+ set(MD5_PPM_3x2_FLOAT_64BIT ${MD5_PPM_3x2_FLOAT_SSE})
700
+ set(MD5_JPEG_3x2_FLOAT_PROG_387 bc6dbbefac2872f6b9d6c4a0ae60c3c0)
701
+ set(MD5_PPM_3x2_FLOAT_387 bcc5723c61560463ac60f772e742d092)
702
+ set(MD5_JPEG_3x2_FLOAT_PROG_MSVC e27840755870fa849872e58aa0cd1400)
703
+ set(MD5_PPM_3x2_FLOAT_MSVC 6c2880b83bb1aa41dfe330e7a9768690)
704
+
705
+ set(MD5_JPEG_3x2_IFAST_PROG 1396cc2b7185cfe943d408c9d305339e)
706
+ set(MD5_PPM_3x2_IFAST 3975985ef6eeb0a2cdc58daa651ccc00)
707
+ set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0)
708
+ set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb)
709
+ set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96)
710
+ set(MD5_PPM_420M_ISLOW_11_8 800a16f9f4dc9b293197bfe11be10a82)
711
+ set(MD5_PPM_420M_ISLOW_9_8 06b7a92a9bc69f4dc36ec40f1937d55c)
712
+ set(MD5_PPM_420M_ISLOW_7_8 3ec444a14a4ab4eab88ffc49c48eca43)
713
+ set(MD5_PPM_420M_ISLOW_3_4 3e726b7ea872445b19437d1c1d4f0d93)
714
+ set(MD5_PPM_420M_ISLOW_5_8 a8a771abdc94301d20ffac119b2caccd)
715
+ set(MD5_PPM_420M_ISLOW_1_2 b419124dd5568b085787234866102866)
716
+ set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8)
717
+ set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb)
718
+ set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7)
719
+ set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97)
720
+ set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 452a21656115a163029cfba5c04fa76a)
721
+ set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84)
722
+ set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 15b173fb5872d9575572fbcc1b05956f)
723
+ set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c)
724
+ else()
725
+ set(TESTORIG testorig.jpg)
726
+ set(MD5_JPEG_RGB_ISLOW 1d44a406f61da743b5fd31c0a9abdca3)
727
+ set(MD5_JPEG_RGB_ISLOW2 31d121e57b6c2934c890a7fc7763bcd4)
728
+ set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291)
729
+ set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be)
730
+ set(MD5_BMP_RGB_ISLOW_565D 4cfa0928ef3e6bb626d7728c924cfda4)
731
+ set(MD5_JPEG_422_IFAST_OPT 2540287b79d913f91665e660303ab2c8)
732
+ set(MD5_PPM_422_IFAST 35bd6b3f833bad23de82acea847129fa)
733
+ set(MD5_PPM_422M_IFAST 8dbc65323d62cca7c91ba02dd1cfa81d)
734
+ set(MD5_BMP_422M_IFAST_565 3294bd4d9a1f2b3d08ea6020d0db7065)
735
+ set(MD5_BMP_422M_IFAST_565D da98c9c7b6039511be4a79a878a9abc1)
736
+ set(MD5_JPEG_420_IFAST_Q100_PROG e59bb462016a8d9a748c330a3474bb55)
737
+ set(MD5_PPM_420_Q100_IFAST 5a732542015c278ff43635e473a8a294)
738
+ set(MD5_PPM_420M_Q100_IFAST ff692ee9323a3b424894862557c092f1)
739
+ set(MD5_JPEG_GRAY_ISLOW 72b51f894b8f4a10b3ee3066770aa38d)
740
+ set(MD5_PPM_GRAY_ISLOW 8d3596c56eace32f205deccc229aa5ed)
741
+ set(MD5_PPM_GRAY_ISLOW_RGB 116424ac07b79e5e801f00508eab48ec)
742
+ set(MD5_BMP_GRAY_ISLOW_565 12f78118e56a2f48b966f792fedf23cc)
743
+ set(MD5_BMP_GRAY_ISLOW_565D bdbbd616441a24354c98553df5dc82db)
744
+ set(MD5_JPEG_420S_IFAST_OPT 388708217ac46273ca33086b22827ed8)
745
+
746
+ set(MD5_JPEG_3x2_FLOAT_PROG_SSE 343e3f8caf8af5986ebaf0bdc13b5c71)
747
+ set(MD5_PPM_3x2_FLOAT_SSE 1a75f36e5904d6fc3a85a43da9ad89bb)
748
+ set(MD5_JPEG_3x2_FLOAT_PROG_32BIT 9bca803d2042bd1eb03819e2bf92b3e5)
749
+ set(MD5_PPM_3x2_FLOAT_32BIT f6bfab038438ed8f5522fbd33595dcdc)
750
+ set(MD5_JPEG_3x2_FLOAT_PROG_64BIT ${MD5_JPEG_3x2_FLOAT_PROG_32BIT})
751
+ set(MD5_PPM_3x2_FLOAT_64BIT 0e917a34193ef976b679a6b069b1be26)
752
+ set(MD5_JPEG_3x2_FLOAT_PROG_387 1657664a410e0822c924b54f6f65e6e9)
753
+ set(MD5_PPM_3x2_FLOAT_387 cb0a1f027f3d2917c902b5640214e025)
754
+ set(MD5_JPEG_3x2_FLOAT_PROG_MSVC 7999ce9cd0ee9b6c7043b7351ab7639d)
755
+ set(MD5_PPM_3x2_FLOAT_MSVC 28cdc448a6b75e97892f0e0f8d4b21f3)
756
+
757
+ set(MD5_JPEG_3x2_IFAST_PROG 1ee5d2c1a77f2da495f993c8c7cceca5)
758
+ set(MD5_PPM_3x2_IFAST fd283664b3b49127984af0a7f118fccd)
759
+ set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
760
+ set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617)
761
+ set(MD5_PPM_420M_IFAST_ARI 72b59a99bcf1de24c5b27d151bde2437)
762
+ set(MD5_JPEG_420_ISLOW 9a68f56bc76e466aa7e52f415d0f4a5f)
763
+ set(MD5_PPM_420M_ISLOW_2_1 9f9de8c0612f8d06869b960b05abf9c9)
764
+ set(MD5_PPM_420M_ISLOW_15_8 b6875bc070720b899566cc06459b63b7)
765
+ set(MD5_PPM_420M_ISLOW_13_8 bc3452573c8152f6ae552939ee19f82f)
766
+ set(MD5_PPM_420M_ISLOW_11_8 d8cc73c0aaacd4556569b59437ba00a5)
767
+ set(MD5_PPM_420M_ISLOW_9_8 d25e61bc7eac0002f5b393aa223747b6)
768
+ set(MD5_PPM_420M_ISLOW_7_8 ddb564b7c74a09494016d6cd7502a946)
769
+ set(MD5_PPM_420M_ISLOW_3_4 8ed8e68808c3fbc4ea764fc9d2968646)
770
+ set(MD5_PPM_420M_ISLOW_5_8 a3363274999da2366a024efae6d16c9b)
771
+ set(MD5_PPM_420M_ISLOW_1_2 e692a315cea26b988c8e8b29a5dbcd81)
772
+ set(MD5_PPM_420M_ISLOW_3_8 79eca9175652ced755155c90e785a996)
773
+ set(MD5_PPM_420M_ISLOW_1_4 79cd778f8bf1a117690052cacdd54eca)
774
+ set(MD5_PPM_420M_ISLOW_1_8 391b3d4aca640c8567d6f8745eb2142f)
775
+ set(MD5_BMP_420_ISLOW_256 4980185e3776e89bd931736e1cddeee6)
776
+ set(MD5_BMP_420_ISLOW_565 bf9d13e16c4923b92e1faa604d7922cb)
777
+ set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2)
778
+ set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f)
779
+ set(MD5_BMP_420M_ISLOW_565D ce034037d212bc403330df6f915c161b)
780
+ set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0)
781
+ set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a)
782
+ set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 26eb36ccc7d1f0cb80cdabb0ac8b5d99)
783
+ set(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 886c6775af22370257122f8b16207e6d)
784
+ set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6)
785
+ set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 db87dc7ce26bcdc7a6b56239ce2b9d6c)
786
+ set(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 cb57b32bd6d03e35432362f7bf184b6d)
787
+ set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
788
+ endif()
789
+
790
+ if(WITH_JAVA)
791
+ add_test(TJUnitTest
792
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
793
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
794
+ TJUnitTest)
795
+ add_test(TJUnitTest-yuv
796
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
797
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
798
+ TJUnitTest -yuv)
799
+ add_test(TJUnitTest-yuv-nopad
800
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
801
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
802
+ TJUnitTest -yuv -noyuvpad)
803
+ add_test(TJUnitTest-bi
804
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
805
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
806
+ TJUnitTest -bi)
807
+ add_test(TJUnitTest-bi-yuv
808
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
809
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
810
+ TJUnitTest -bi -yuv)
811
+ add_test(TJUnitTest-bi-yuv-nopad
812
+ ${Java_JAVA_EXECUTABLE} ${JAVAARGS} -cp java/turbojpeg.jar
813
+ -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
814
+ TJUnitTest -bi -yuv -noyuvpad)
815
+ endif()
816
+
817
+ set(TEST_LIBTYPES "")
818
+ if(ENABLE_SHARED)
819
+ set(TEST_LIBTYPES ${TEST_LIBTYPES} shared)
820
+ endif()
821
+ if(ENABLE_STATIC)
822
+ set(TEST_LIBTYPES ${TEST_LIBTYPES} static)
823
+ endif()
824
+
825
+ set(TESTIMAGES ${CMAKE_CURRENT_SOURCE_DIR}/testimages)
826
+ set(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp)
827
+ if(CMAKE_CROSSCOMPILING)
828
+ file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES})
829
+ file(RELATIVE_PATH MD5CMP ${CMAKE_CURRENT_BINARY_DIR} ${MD5CMP})
830
+ endif()
831
+
832
+ # The output of the floating point DCT/IDCT algorithms differs depending on the
833
+ # type of floating point math used, so the FLOATTEST CMake variable must be
834
+ # set in order to tell the testing system which floating point results it
835
+ # should expect:
836
+ #
837
+ # sse = validate against the expected results from the libjpeg-turbo SSE SIMD
838
+ # extensions
839
+ # 32bit = validate against the expected results from the C code when running on
840
+ # a 32-bit FPU (or when SSE is being used for floating point math,
841
+ # which is generally the default with x86-64 compilers)
842
+ # 64bit = validate against the expected results from the C code when running
843
+ # on a 64-bit FPU
844
+ # 387 = validate against the expected results from the C code when the 387 FPU
845
+ # is being used for floating point math (which is generally the default
846
+ # with x86 compilers)
847
+ # msvc = validate against the expected results from the C code when compiled
848
+ # with a 32-bit version of Visual C++
849
+
850
+ if(CPU_TYPE STREQUAL "x86_64" OR CPU_TYPE STREQUAL "i386")
851
+ if(WITH_SIMD)
852
+ set(DEFAULT_FLOATTEST sse)
853
+ elseif(CPU_TYPE STREQUAL "x86_64")
854
+ set(DEFAULT_FLOATTEST 32bit)
855
+ elseif(CPU_TYPE STREQUAL "i386" AND MSVC)
856
+ set(DEFAULT_FLOATTEST msvc)
857
+ endif()
858
+ else()
859
+ if(BITS EQUAL 64)
860
+ set(DEFAULT_FLOATTEST 64bit)
861
+ elseif(BITS EQUAL 32)
862
+ set(DEFAULT_FLOATTEST 32bit)
863
+ endif()
864
+ endif()
865
+
866
+ # This causes FLOATTEST to reset to the default value if WITH_SIMD has
867
+ # changed.
868
+ if(DEFINED WITH_SIMD_INT AND NOT WITH_SIMD EQUAL WITH_SIMD_INT)
869
+ set(FORCE_FLOATTEST "FORCE")
870
+ endif()
871
+ set(WITH_SIMD_INT ${WITH_SIMD} CACHE INTERNAL "")
872
+ set(FLOATTEST ${DEFAULT_FLOATTEST} CACHE STRING
873
+ "The type of floating point math used by the floating point DCT/IDCT algorithms. This tells the testing system which numerical results it should expect from those tests. [sse = libjpeg-turbo x86/x86-64 SIMD extensions, 32bit = generic 32-bit FPU or SSE, 64bit = generic 64-bit FPU, 387 = 387 FPU, msvc = 32-bit Visual Studio] (default = ${DEFAULT_FLOATTEST})"
874
+ ${FORCE_FLOATTEST})
875
+ message(STATUS "FLOATTEST = ${FLOATTEST}")
876
+
877
+ if(FLOATTEST)
878
+ string(TOUPPER ${FLOATTEST} FLOATTEST_UC)
879
+ string(TOLOWER ${FLOATTEST} FLOATTEST)
880
+ if(NOT FLOATTEST STREQUAL "sse" AND NOT FLOATTEST STREQUAL "32bit" AND
881
+ NOT FLOATTEST STREQUAL "64bit" AND NOT FLOATTEST STREQUAL "387" AND
882
+ NOT FLOATTEST STREQUAL "msvc")
883
+ message(FATAL_ERROR "\"${FLOATTEST}\" is not a valid value for FLOATTEST.")
884
+ endif()
885
+ endif()
886
+
887
+ foreach(libtype ${TEST_LIBTYPES})
888
+ if(libtype STREQUAL "static")
889
+ set(suffix -static)
890
+ endif()
891
+ if(WITH_TURBOJPEG)
892
+ add_test(tjunittest-${libtype} tjunittest${suffix})
893
+ add_test(tjunittest-${libtype}-alloc tjunittest${suffix} -alloc)
894
+ add_test(tjunittest-${libtype}-yuv tjunittest${suffix} -yuv)
895
+ add_test(tjunittest-${libtype}-yuv-alloc tjunittest${suffix} -yuv -alloc)
896
+ add_test(tjunittest-${libtype}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad)
897
+ add_test(tjunittest-${libtype}-bmp tjunittest${suffix} -bmp)
898
+
899
+ set(MD5_PPM_GRAY_TILE 89d3ca21213d9d864b50b4e4e7de4ca6)
900
+ set(MD5_PPM_420_8x8_TILE 847fceab15c5b7b911cb986cf0f71de3)
901
+ set(MD5_PPM_420_16x16_TILE ca45552a93687e078f7137cc4126a7b0)
902
+ set(MD5_PPM_420_32x32_TILE d8676f1d6b68df358353bba9844f4a00)
903
+ set(MD5_PPM_420_64x64_TILE 4e4c1a3d7ea4bace4f868bcbe83b7050)
904
+ set(MD5_PPM_420_128x128_TILE f24c3429c52265832beab9df72a0ceae)
905
+ set(MD5_PPM_420M_8x8_TILE bc25320e1f4c31ce2e610e43e9fd173c)
906
+ set(MD5_PPM_420M_TILE 75ffdf14602258c5c189522af57fa605)
907
+ set(MD5_PPM_422_8x8_TILE d83dacd9fc73b0a6f10c09acad64eb1e)
908
+ set(MD5_PPM_422_16x16_TILE 35077fb610d72dd743b1eb0cbcfe10fb)
909
+ set(MD5_PPM_422_32x32_TILE e6902ed8a449ecc0f0d6f2bf945f65f7)
910
+ set(MD5_PPM_422_64x64_TILE 2b4502a8f316cedbde1da7bce3d2231e)
911
+ set(MD5_PPM_422_128x128_TILE f0b5617d578f5e13c8eee215d64d4877)
912
+ set(MD5_PPM_422M_8x8_TILE 828941d7f41cd6283abd6beffb7fd51d)
913
+ set(MD5_PPM_422M_TILE e877ae1324c4a280b95376f7f018172f)
914
+ set(MD5_PPM_444_TILE 7964e41e67cfb8d0a587c0aa4798f9c3)
915
+
916
+ # Test compressing from/decompressing to an arbitrary subregion of a larger
917
+ # image buffer
918
+ add_test(tjbench-${libtype}-tile-cp
919
+ ${CMAKE_COMMAND} -E copy_if_different ${TESTIMAGES}/testorig.ppm
920
+ testout_tile.ppm)
921
+ add_test(tjbench-${libtype}-tile
922
+ tjbench${suffix} testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01
923
+ -warmup 0)
924
+ set_tests_properties(tjbench-${libtype}-tile
925
+ PROPERTIES DEPENDS tjbench-${libtype}-tile-cp)
926
+
927
+ foreach(tile 8 16 32 64 128)
928
+ add_test(tjbench-${libtype}-tile-gray-${tile}x${tile}-cmp
929
+ ${MD5CMP} ${MD5_PPM_GRAY_TILE}
930
+ testout_tile_GRAY_Q95_${tile}x${tile}.ppm)
931
+ foreach(subsamp 420 422)
932
+ add_test(tjbench-${libtype}-tile-${subsamp}-${tile}x${tile}-cmp
933
+ ${MD5CMP} ${MD5_PPM_${subsamp}_${tile}x${tile}_TILE}
934
+ testout_tile_${subsamp}_Q95_${tile}x${tile}.ppm)
935
+ endforeach()
936
+ add_test(tjbench-${libtype}-tile-444-${tile}x${tile}-cmp
937
+ ${MD5CMP} ${MD5_PPM_444_TILE}
938
+ testout_tile_444_Q95_${tile}x${tile}.ppm)
939
+ foreach(subsamp gray 420 422 444)
940
+ set_tests_properties(tjbench-${libtype}-tile-${subsamp}-${tile}x${tile}-cmp
941
+ PROPERTIES DEPENDS tjbench-${libtype}-tile)
942
+ endforeach()
943
+ endforeach()
944
+
945
+ add_test(tjbench-${libtype}-tilem-cp
946
+ ${CMAKE_COMMAND} -E copy_if_different ${TESTIMAGES}/testorig.ppm
947
+ testout_tilem.ppm)
948
+ add_test(tjbench-${libtype}-tilem
949
+ tjbench${suffix} testout_tilem.ppm 95 -rgb -fastupsample -quiet -tile
950
+ -benchtime 0.01 -warmup 0)
951
+ set_tests_properties(tjbench-${libtype}-tilem
952
+ PROPERTIES DEPENDS tjbench-${libtype}-tilem-cp)
953
+
954
+ add_test(tjbench-${libtype}-tile-420m-8x8-cmp
955
+ ${MD5CMP} ${MD5_PPM_420M_8x8_TILE} testout_tilem_420_Q95_8x8.ppm)
956
+ add_test(tjbench-${libtype}-tile-422m-8x8-cmp
957
+ ${MD5CMP} ${MD5_PPM_422M_8x8_TILE} testout_tilem_422_Q95_8x8.ppm)
958
+ foreach(tile 16 32 64 128)
959
+ foreach(subsamp 420 422)
960
+ add_test(tjbench-${libtype}-tile-${subsamp}m-${tile}x${tile}-cmp
961
+ ${MD5CMP} ${MD5_PPM_${subsamp}M_TILE}
962
+ testout_tilem_${subsamp}_Q95_${tile}x${tile}.ppm)
963
+ endforeach()
964
+ endforeach()
965
+ foreach(tile 8 16 32 64 128)
966
+ foreach(subsamp 420 422)
967
+ set_tests_properties(tjbench-${libtype}-tile-${subsamp}m-${tile}x${tile}-cmp
968
+ PROPERTIES DEPENDS tjbench-${libtype}-tilem)
969
+ endforeach()
970
+ endforeach()
971
+ endif()
972
+
973
+ # These tests are carefully crafted to provide full coverage of as many of
974
+ # the underlying algorithms as possible (including all of the
975
+ # SIMD-accelerated ones.)
976
+
977
+ macro(add_bittest PROG NAME ARGS OUTFILE INFILE MD5SUM)
978
+ add_test(${PROG}-${libtype}-${NAME}
979
+ ${PROG}${suffix} ${ARGS} -outfile ${OUTFILE} ${INFILE})
980
+ add_test(${PROG}-${libtype}-${NAME}-cmp
981
+ ${MD5CMP} ${MD5SUM} ${OUTFILE})
982
+ set_tests_properties(${PROG}-${libtype}-${NAME}-cmp PROPERTIES
983
+ DEPENDS ${PROG}-${libtype}-${NAME})
984
+ if(${ARGC} GREATER 6)
985
+ set(DEPENDS ${ARGN})
986
+ set_tests_properties(${PROG}-${libtype}-${NAME} PROPERTIES
987
+ DEPENDS ${DEPENDS})
988
+ endif()
989
+ endmacro()
990
+
991
+ # CC: null SAMP: fullsize FDCT: islow ENT: huff
992
+ add_bittest(cjpeg rgb-islow "-rgb;-dct;int;-icc;${TESTIMAGES}/test1.icc"
993
+ testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm
994
+ ${MD5_JPEG_RGB_ISLOW})
995
+
996
+ # CC: null SAMP: fullsize IDCT: islow ENT: huff
997
+ add_bittest(djpeg rgb-islow "-dct;int;-ppm;-icc;testout_rgb_islow.icc"
998
+ testout_rgb_islow.ppm testout_rgb_islow.jpg
999
+ ${MD5_PPM_RGB_ISLOW} cjpeg-${libtype}-rgb-islow)
1000
+
1001
+ add_test(djpeg-${libtype}-rgb-islow-icc-cmp
1002
+ ${MD5CMP} b06a39d730129122e85c1363ed1bbc9e testout_rgb_islow.icc)
1003
+ set_tests_properties(djpeg-${libtype}-rgb-islow-icc-cmp PROPERTIES
1004
+ DEPENDS djpeg-${libtype}-rgb-islow)
1005
+
1006
+ add_bittest(jpegtran icc "-copy;all;-icc;${TESTIMAGES}/test2.icc"
1007
+ testout_rgb_islow2.jpg testout_rgb_islow.jpg ${MD5_JPEG_RGB_ISLOW2})
1008
+
1009
+ if(NOT WITH_12BIT)
1010
+ # CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
1011
+ add_bittest(djpeg rgb-islow-565 "-dct;int;-rgb565;-dither;none;-bmp"
1012
+ testout_rgb_islow_565.bmp testout_rgb_islow.jpg
1013
+ ${MD5_BMP_RGB_ISLOW_565} cjpeg-${libtype}-rgb-islow)
1014
+
1015
+ # CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
1016
+ add_bittest(djpeg rgb-islow-565D "-dct;int;-rgb565;-bmp"
1017
+ testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
1018
+ ${MD5_BMP_RGB_ISLOW_565D} cjpeg-${libtype}-rgb-islow)
1019
+ endif()
1020
+
1021
+ # CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
1022
+ add_bittest(cjpeg 422-ifast-opt "-sample;2x1;-dct;fast;-opt"
1023
+ testout_422_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm
1024
+ ${MD5_JPEG_422_IFAST_OPT})
1025
+
1026
+ # CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff
1027
+ add_bittest(djpeg 422-ifast "-dct;fast"
1028
+ testout_422_ifast.ppm testout_422_ifast_opt.jpg
1029
+ ${MD5_PPM_422_IFAST} cjpeg-${libtype}-422-ifast-opt)
1030
+
1031
+ # CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff
1032
+ add_bittest(djpeg 422m-ifast "-dct;fast;-nosmooth"
1033
+ testout_422m_ifast.ppm testout_422_ifast_opt.jpg
1034
+ ${MD5_PPM_422M_IFAST} cjpeg-${libtype}-422-ifast-opt)
1035
+
1036
+ if(NOT WITH_12BIT)
1037
+ # CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
1038
+ add_bittest(djpeg 422m-ifast-565
1039
+ "-dct;int;-nosmooth;-rgb565;-dither;none;-bmp"
1040
+ testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg
1041
+ ${MD5_BMP_422M_IFAST_565} cjpeg-${libtype}-422-ifast-opt)
1042
+
1043
+ # CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff
1044
+ add_bittest(djpeg 422m-ifast-565D "-dct;int;-nosmooth;-rgb565;-bmp"
1045
+ testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
1046
+ ${MD5_BMP_422M_IFAST_565D} cjpeg-${libtype}-422-ifast-opt)
1047
+ endif()
1048
+
1049
+ # CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
1050
+ add_bittest(cjpeg 420-q100-ifast-prog
1051
+ "-sample;2x2;-quality;100;-dct;fast;-scans;${TESTIMAGES}/test.scan"
1052
+ testout_420_q100_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm
1053
+ ${MD5_JPEG_420_IFAST_Q100_PROG})
1054
+
1055
+ # CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff
1056
+ add_bittest(djpeg 420-q100-ifast-prog "-dct;fast"
1057
+ testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
1058
+ ${MD5_PPM_420_Q100_IFAST} cjpeg-${libtype}-420-q100-ifast-prog)
1059
+
1060
+ # CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff
1061
+ add_bittest(djpeg 420m-q100-ifast-prog "-dct;fast;-nosmooth"
1062
+ testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
1063
+ ${MD5_PPM_420M_Q100_IFAST} cjpeg-${libtype}-420-q100-ifast-prog)
1064
+
1065
+ # CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
1066
+ add_bittest(cjpeg gray-islow "-gray;-dct;int"
1067
+ testout_gray_islow.jpg ${TESTIMAGES}/testorig.ppm
1068
+ ${MD5_JPEG_GRAY_ISLOW})
1069
+
1070
+ # CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff
1071
+ add_bittest(djpeg gray-islow "-dct;int"
1072
+ testout_gray_islow.ppm testout_gray_islow.jpg
1073
+ ${MD5_PPM_GRAY_ISLOW} cjpeg-${libtype}-gray-islow)
1074
+
1075
+ # CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff
1076
+ add_bittest(djpeg gray-islow-rgb "-dct;int;-rgb"
1077
+ testout_gray_islow_rgb.ppm testout_gray_islow.jpg
1078
+ ${MD5_PPM_GRAY_ISLOW_RGB} cjpeg-${libtype}-gray-islow)
1079
+
1080
+ if(NOT WITH_12BIT)
1081
+ # CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
1082
+ add_bittest(djpeg gray-islow-565 "-dct;int;-rgb565;-dither;none;-bmp"
1083
+ testout_gray_islow_565.bmp testout_gray_islow.jpg
1084
+ ${MD5_BMP_GRAY_ISLOW_565} cjpeg-${libtype}-gray-islow)
1085
+
1086
+ # CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
1087
+ add_bittest(djpeg gray-islow-565D "-dct;int;-rgb565;-bmp"
1088
+ testout_gray_islow_565D.bmp testout_gray_islow.jpg
1089
+ ${MD5_BMP_GRAY_ISLOW_565D} cjpeg-${libtype}-gray-islow)
1090
+ endif()
1091
+
1092
+ # CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
1093
+ # ENT: 2-pass huff
1094
+ add_bittest(cjpeg 420s-ifast-opt "-sample;2x2;-smooth;1;-dct;int;-opt"
1095
+ testout_420s_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm
1096
+ ${MD5_JPEG_420S_IFAST_OPT})
1097
+
1098
+ if(FLOATTEST)
1099
+ # CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
1100
+ add_bittest(cjpeg 3x2-float-prog "-sample;3x2;-dct;float;-prog"
1101
+ testout_3x2_float_prog.jpg ${TESTIMAGES}/testorig.ppm
1102
+ ${MD5_JPEG_3x2_FLOAT_PROG_${FLOATTEST_UC}})
1103
+
1104
+ # CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff
1105
+ add_bittest(djpeg 3x2-float-prog "-dct;float"
1106
+ testout_3x2_float.ppm testout_3x2_float_prog.jpg
1107
+ ${MD5_PPM_3x2_FLOAT_${FLOATTEST_UC}} cjpeg-${libtype}-3x2-float-prog)
1108
+ endif()
1109
+
1110
+ # CC: RGB->YCC SAMP: fullsize/int FDCT: ifast ENT: prog huff
1111
+ add_bittest(cjpeg 3x2-ifast-prog "-sample;3x2;-dct;fast;-prog"
1112
+ testout_3x2_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm
1113
+ ${MD5_JPEG_3x2_IFAST_PROG})
1114
+
1115
+ # CC: YCC->RGB SAMP: fullsize/int IDCT: ifast ENT: prog huff
1116
+ add_bittest(djpeg 3x2-ifast-prog "-dct;fast"
1117
+ testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
1118
+ ${MD5_PPM_3x2_IFAST} cjpeg-${libtype}-3x2-ifast-prog)
1119
+
1120
+ if(WITH_ARITH_ENC)
1121
+ # CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
1122
+ add_bittest(cjpeg 420-islow-ari "-dct;int;-arithmetic"
1123
+ testout_420_islow_ari.jpg ${TESTIMAGES}/testorig.ppm
1124
+ ${MD5_JPEG_420_ISLOW_ARI})
1125
+
1126
+ add_bittest(jpegtran 420-islow-ari "-arithmetic"
1127
+ testout_420_islow_ari2.jpg ${TESTIMAGES}/testimgint.jpg
1128
+ ${MD5_JPEG_420_ISLOW_ARI})
1129
+
1130
+ # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
1131
+ add_bittest(cjpeg 444-islow-progari
1132
+ "-sample;1x1;-dct;int;-prog;-arithmetic"
1133
+ testout_444_islow_progari.jpg ${TESTIMAGES}/testorig.ppm
1134
+ ${MD5_JPEG_444_ISLOW_PROGARI})
1135
+ endif()
1136
+
1137
+ if(WITH_ARITH_DEC)
1138
+ # CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith
1139
+ add_bittest(djpeg 420m-ifast-ari "-fast;-ppm"
1140
+ testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg
1141
+ ${MD5_PPM_420M_IFAST_ARI})
1142
+
1143
+ add_bittest(jpegtran 420-islow ""
1144
+ testout_420_islow.jpg ${TESTIMAGES}/testimgari.jpg
1145
+ ${MD5_JPEG_420_ISLOW})
1146
+ endif()
1147
+
1148
+ # 2/1-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
1149
+ # 15/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff
1150
+ # 13/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff
1151
+ # 11/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff
1152
+ # 9/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff
1153
+ # 7/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow
1154
+ # ENT: huff
1155
+ # 3/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow
1156
+ # ENT: huff
1157
+ # 5/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow
1158
+ # ENT: huff
1159
+ # 1/2-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow
1160
+ # ENT: huff
1161
+ # 3/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow
1162
+ # ENT: huff
1163
+ # 1/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow
1164
+ # ENT: huff
1165
+ # 1/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow
1166
+ # ENT: huff
1167
+ foreach(scale 2_1 15_8 13_8 11_8 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
1168
+ string(REGEX REPLACE "_" "/" scalearg ${scale})
1169
+ add_bittest(djpeg 420m-islow-${scale}
1170
+ "-dct;int;-scale;${scalearg};-nosmooth;-ppm"
1171
+ testout_420m_islow_${scale}.ppm ${TESTIMAGES}/${TESTORIG}
1172
+ ${MD5_PPM_420M_ISLOW_${scale}})
1173
+ endforeach()
1174
+
1175
+ if(NOT WITH_12BIT)
1176
+ # CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
1177
+ add_bittest(djpeg 420-islow-256 "-dct;int;-colors;256;-bmp"
1178
+ testout_420_islow_256.bmp ${TESTIMAGES}/${TESTORIG}
1179
+ ${MD5_BMP_420_ISLOW_256})
1180
+
1181
+ # CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff
1182
+ add_bittest(djpeg 420-islow-565 "-dct;int;-rgb565;-dither;none;-bmp"
1183
+ testout_420_islow_565.bmp ${TESTIMAGES}/${TESTORIG}
1184
+ ${MD5_BMP_420_ISLOW_565})
1185
+
1186
+ # CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
1187
+ add_bittest(djpeg 420-islow-565D "-dct;int;-rgb565;-bmp"
1188
+ testout_420_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}
1189
+ ${MD5_BMP_420_ISLOW_565D})
1190
+
1191
+ # CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff
1192
+ add_bittest(djpeg 420m-islow-565
1193
+ "-dct;int;-nosmooth;-rgb565;-dither;none;-bmp"
1194
+ testout_420m_islow_565.bmp ${TESTIMAGES}/${TESTORIG}
1195
+ ${MD5_BMP_420M_ISLOW_565})
1196
+
1197
+ # CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff
1198
+ add_bittest(djpeg 420m-islow-565D "-dct;int;-nosmooth;-rgb565;-bmp"
1199
+ testout_420m_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}
1200
+ ${MD5_BMP_420M_ISLOW_565D})
1201
+ endif()
1202
+
1203
+ # Partial decode tests. These tests are designed to cover all of the
1204
+ # possible code paths in jpeg_skip_scanlines().
1205
+
1206
+ # Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff
1207
+ add_bittest(djpeg 420-islow-skip15_31 "-dct;int;-skip;15,31;-ppm"
1208
+ testout_420_islow_skip15,31.ppm ${TESTIMAGES}/${TESTORIG}
1209
+ ${MD5_PPM_420_ISLOW_SKIP15_31})
1210
+
1211
+ # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith
1212
+ if(WITH_ARITH_DEC)
1213
+ add_bittest(djpeg 420-islow-ari-skip16_139 "-dct;int;-skip;16,139;-ppm"
1214
+ testout_420_islow_ari_skip16,139.ppm ${TESTIMAGES}/testimgari.jpg
1215
+ ${MD5_PPM_420_ISLOW_ARI_SKIP16_139})
1216
+ endif()
1217
+
1218
+ # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff
1219
+ add_test(cjpeg-${libtype}-420-islow-prog
1220
+ cjpeg${suffix} -dct int -prog
1221
+ -outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)
1222
+ add_bittest(djpeg 420-islow-prog-crop62x62_71_71
1223
+ "-dct;int;-crop;62x62+71+71;-ppm"
1224
+ testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg
1225
+ ${MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71} cjpeg-${libtype}-420-islow-prog)
1226
+
1227
+ # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith
1228
+ if(WITH_ARITH_DEC)
1229
+ add_bittest(djpeg 420-islow-ari-crop53x53_4_4
1230
+ "-dct;int;-crop;53x53+4+4;-ppm"
1231
+ testout_420_islow_ari_crop53x53,4,4.ppm ${TESTIMAGES}/testimgari.jpg
1232
+ ${MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4})
1233
+ endif()
1234
+
1235
+ # Context rows: No Intra-iMCU row: Yes ENT: huff
1236
+ add_test(cjpeg-${libtype}-444-islow
1237
+ cjpeg${suffix} -dct int -sample 1x1
1238
+ -outfile testout_444_islow.jpg ${TESTIMAGES}/testorig.ppm)
1239
+ add_bittest(djpeg 444-islow-skip1_6 "-dct;int;-skip;1,6;-ppm"
1240
+ testout_444_islow_skip1,6.ppm testout_444_islow.jpg
1241
+ ${MD5_PPM_444_ISLOW_SKIP1_6} cjpeg-${libtype}-444-islow)
1242
+
1243
+ # Context rows: No Intra-iMCU row: No ENT: prog huff
1244
+ add_test(cjpeg-${libtype}-444-islow-prog
1245
+ cjpeg${suffix} -dct int -prog -sample 1x1
1246
+ -outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)
1247
+ add_bittest(djpeg 444-islow-prog-crop98x98_13_13
1248
+ "-dct;int;-crop;98x98+13+13;-ppm"
1249
+ testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg
1250
+ ${MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13} cjpeg-${libtype}-444-islow-prog)
1251
+
1252
+ # Context rows: No Intra-iMCU row: No ENT: arith
1253
+ if(WITH_ARITH_ENC)
1254
+ add_test(cjpeg-${libtype}-444-islow-ari
1255
+ cjpeg${suffix} -dct int -arithmetic -sample 1x1
1256
+ -outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm)
1257
+ if(WITH_ARITH_DEC)
1258
+ add_bittest(djpeg 444-islow-ari-crop37x37_0_0
1259
+ "-dct;int;-crop;37x37+0+0;-ppm"
1260
+ testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg
1261
+ ${MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0} cjpeg-${libtype}-444-islow-ari)
1262
+ endif()
1263
+ endif()
1264
+
1265
+ add_bittest(jpegtran crop "-crop;120x90+20+50;-transpose;-perfect"
1266
+ testout_crop.jpg ${TESTIMAGES}/${TESTORIG}
1267
+ ${MD5_JPEG_CROP})
1268
+
1269
+ endforeach()
1270
+
1271
+ add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
1272
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/testclean.cmake)
1273
+
1274
+ if(WITH_TURBOJPEG)
1275
+ configure_file(tjbenchtest.in tjbenchtest @ONLY)
1276
+ configure_file(tjexampletest.in tjexampletest @ONLY)
1277
+ if(WIN32)
1278
+ set(BASH bash)
1279
+ endif()
1280
+ if(WITH_JAVA)
1281
+ configure_file(tjbenchtest.java.in tjbenchtest.java @ONLY)
1282
+ configure_file(tjexampletest.java.in tjexampletest.java @ONLY)
1283
+ add_custom_target(tjtest
1284
+ COMMAND echo tjbenchtest
1285
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest
1286
+ COMMAND echo tjbenchtest -alloc
1287
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -alloc
1288
+ COMMAND echo tjbenchtest -yuv
1289
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -yuv
1290
+ COMMAND echo tjbenchtest -yuv -alloc
1291
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -yuv -alloc
1292
+ COMMAND echo tjbenchtest -progressive
1293
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -progressive
1294
+ COMMAND echo tjbenchtest -progressive -yuv
1295
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -progressive -yuv
1296
+ COMMAND echo tjexampletest
1297
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjexampletest
1298
+ COMMAND echo tjbenchtest.java
1299
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest.java
1300
+ COMMAND echo tjbenchtest.java -yuv
1301
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest.java -yuv
1302
+ COMMAND echo tjbenchtest.java -progressive
1303
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest.java -progressive
1304
+ COMMAND echo tjexampletest.java -progressive -yuv
1305
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest.java
1306
+ -progressive -yuv
1307
+ COMMAND echo tjexampletest.java
1308
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjexampletest.java
1309
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest
1310
+ ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest.java
1311
+ ${CMAKE_CURRENT_BINARY_DIR}/tjexampletest)
1312
+ else()
1313
+ add_custom_target(tjtest
1314
+ COMMAND echo tjbenchtest
1315
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest
1316
+ COMMAND echo tjbenchtest -alloc
1317
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -alloc
1318
+ COMMAND echo tjbenchtest -yuv
1319
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -yuv
1320
+ COMMAND echo tjbenchtest -yuv -alloc
1321
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -yuv -alloc
1322
+ COMMAND echo tjbenchtest -progressive
1323
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -progressive
1324
+ COMMAND echo tjbenchtest -progressive -yuv
1325
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest -progressive -yuv
1326
+ COMMAND echo tjexampletest
1327
+ COMMAND ${BASH} ${CMAKE_CURRENT_BINARY_DIR}/tjexampletest
1328
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest)
1329
+ endif()
1330
+ endif()
1331
+
1332
+
1333
+ ###############################################################################
1334
+ # INSTALLATION
1335
+ ###############################################################################
1336
+
1337
+ set(EXE ${CMAKE_EXECUTABLE_SUFFIX})
1338
+
1339
+ if(WITH_TURBOJPEG)
1340
+ if(ENABLE_SHARED)
1341
+ install(TARGETS turbojpeg tjbench
1342
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
1343
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
1344
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1345
+ if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
1346
+ CMAKE_C_LINKER_SUPPORTS_PDB)
1347
+ install(FILES "$<TARGET_PDB_FILE:turbojpeg>"
1348
+ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
1349
+ endif()
1350
+ endif()
1351
+ if(ENABLE_STATIC)
1352
+ install(TARGETS turbojpeg-static ARCHIVE
1353
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
1354
+ if(NOT ENABLE_SHARED)
1355
+ if(MSVC_IDE OR XCODE)
1356
+ set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
1357
+ else()
1358
+ set(DIR ${CMAKE_CURRENT_BINARY_DIR})
1359
+ endif()
1360
+ install(PROGRAMS ${DIR}/tjbench-static${EXE}
1361
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE})
1362
+ endif()
1363
+ endif()
1364
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h
1365
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
1366
+ endif()
1367
+
1368
+ if(ENABLE_STATIC)
1369
+ install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
1370
+ if(NOT ENABLE_SHARED)
1371
+ if(MSVC_IDE OR XCODE)
1372
+ set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
1373
+ else()
1374
+ set(DIR ${CMAKE_CURRENT_BINARY_DIR})
1375
+ endif()
1376
+ install(PROGRAMS ${DIR}/cjpeg-static${EXE}
1377
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE})
1378
+ install(PROGRAMS ${DIR}/djpeg-static${EXE}
1379
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE})
1380
+ install(PROGRAMS ${DIR}/jpegtran-static${EXE}
1381
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE})
1382
+ endif()
1383
+ endif()
1384
+
1385
+ install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1386
+
1387
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
1388
+ ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
1389
+ ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c
1390
+ ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt
1391
+ ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt
1392
+ ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt
1393
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
1394
+ if(WITH_JAVA)
1395
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java
1396
+ DESTINATION ${CMAKE_INSTALL_DOCDIR})
1397
+ endif()
1398
+
1399
+ if(UNIX OR MINGW)
1400
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1
1401
+ ${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1
1402
+ ${CMAKE_CURRENT_SOURCE_DIR}/rdjpgcom.1
1403
+ ${CMAKE_CURRENT_SOURCE_DIR}/wrjpgcom.1
1404
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
1405
+ endif()
1406
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc
1407
+ ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc
1408
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
1409
+
1410
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
1411
+ ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
1412
+ ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/transupp.h
1413
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
1414
+
1415
+ include(cmakescripts/BuildPackages.cmake)
1416
+
1417
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/cmake_uninstall.cmake.in"
1418
+ "cmake_uninstall.cmake" IMMEDIATE @ONLY)
1419
+
1420
+ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P cmake_uninstall.cmake)