rfreeimage 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (860) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +1 -0
  4. data/Rakefile +34 -0
  5. data/ext/rfreeimage/extconf.rb +35 -0
  6. data/ext/rfreeimage/rfi_main.c +389 -0
  7. data/lib/rfreeimage/image.rb +26 -0
  8. data/lib/rfreeimage/version.rb +3 -0
  9. data/lib/rfreeimage.rb +3 -0
  10. data/rfreeimage.gemspec +32 -0
  11. data/vendor/FreeImage/Makefile +34 -0
  12. data/vendor/FreeImage/Makefile.cygwin +74 -0
  13. data/vendor/FreeImage/Makefile.fip +84 -0
  14. data/vendor/FreeImage/Makefile.gnu +83 -0
  15. data/vendor/FreeImage/Makefile.iphone +96 -0
  16. data/vendor/FreeImage/Makefile.mingw +136 -0
  17. data/vendor/FreeImage/Makefile.osx +115 -0
  18. data/vendor/FreeImage/Makefile.solaris +66 -0
  19. data/vendor/FreeImage/Makefile.srcs +6 -0
  20. data/vendor/FreeImage/README.iphone +19 -0
  21. data/vendor/FreeImage/README.linux +50 -0
  22. data/vendor/FreeImage/README.minGW +236 -0
  23. data/vendor/FreeImage/README.osx +44 -0
  24. data/vendor/FreeImage/README.solaris +67 -0
  25. data/vendor/FreeImage/Source/CacheFile.h +92 -0
  26. data/vendor/FreeImage/Source/DeprecationManager/Deprecated.cpp +36 -0
  27. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.cpp +103 -0
  28. data/vendor/FreeImage/Source/DeprecationManager/DeprecationMgr.h +83 -0
  29. data/vendor/FreeImage/Source/FreeImage/BitmapAccess.cpp +1573 -0
  30. data/vendor/FreeImage/Source/FreeImage/CacheFile.cpp +271 -0
  31. data/vendor/FreeImage/Source/FreeImage/ColorLookup.cpp +785 -0
  32. data/vendor/FreeImage/Source/FreeImage/Conversion.cpp +551 -0
  33. data/vendor/FreeImage/Source/FreeImage/Conversion16_555.cpp +209 -0
  34. data/vendor/FreeImage/Source/FreeImage/Conversion16_565.cpp +204 -0
  35. data/vendor/FreeImage/Source/FreeImage/Conversion24.cpp +252 -0
  36. data/vendor/FreeImage/Source/FreeImage/Conversion32.cpp +345 -0
  37. data/vendor/FreeImage/Source/FreeImage/Conversion4.cpp +246 -0
  38. data/vendor/FreeImage/Source/FreeImage/Conversion8.cpp +305 -0
  39. data/vendor/FreeImage/Source/FreeImage/ConversionFloat.cpp +194 -0
  40. data/vendor/FreeImage/Source/FreeImage/ConversionRGB16.cpp +144 -0
  41. data/vendor/FreeImage/Source/FreeImage/ConversionRGBA16.cpp +147 -0
  42. data/vendor/FreeImage/Source/FreeImage/ConversionRGBAF.cpp +250 -0
  43. data/vendor/FreeImage/Source/FreeImage/ConversionRGBF.cpp +243 -0
  44. data/vendor/FreeImage/Source/FreeImage/ConversionType.cpp +699 -0
  45. data/vendor/FreeImage/Source/FreeImage/ConversionUINT16.cpp +134 -0
  46. data/vendor/FreeImage/Source/FreeImage/FreeImage.cpp +226 -0
  47. data/vendor/FreeImage/Source/FreeImage/FreeImageC.c +22 -0
  48. data/vendor/FreeImage/Source/FreeImage/FreeImageIO.cpp +175 -0
  49. data/vendor/FreeImage/Source/FreeImage/GetType.cpp +92 -0
  50. data/vendor/FreeImage/Source/FreeImage/Halftoning.cpp +474 -0
  51. data/vendor/FreeImage/Source/FreeImage/J2KHelper.cpp +591 -0
  52. data/vendor/FreeImage/Source/FreeImage/J2KHelper.h +36 -0
  53. data/vendor/FreeImage/Source/FreeImage/LFPQuantizer.cpp +208 -0
  54. data/vendor/FreeImage/Source/FreeImage/MNGHelper.cpp +1320 -0
  55. data/vendor/FreeImage/Source/FreeImage/MemoryIO.cpp +237 -0
  56. data/vendor/FreeImage/Source/FreeImage/MultiPage.cpp +974 -0
  57. data/vendor/FreeImage/Source/FreeImage/NNQuantizer.cpp +507 -0
  58. data/vendor/FreeImage/Source/FreeImage/PSDParser.cpp +1057 -0
  59. data/vendor/FreeImage/Source/FreeImage/PSDParser.h +271 -0
  60. data/vendor/FreeImage/Source/FreeImage/PixelAccess.cpp +197 -0
  61. data/vendor/FreeImage/Source/FreeImage/Plugin.cpp +822 -0
  62. data/vendor/FreeImage/Source/FreeImage/PluginBMP.cpp +1494 -0
  63. data/vendor/FreeImage/Source/FreeImage/PluginCUT.cpp +240 -0
  64. data/vendor/FreeImage/Source/FreeImage/PluginDDS.cpp +655 -0
  65. data/vendor/FreeImage/Source/FreeImage/PluginEXR.cpp +773 -0
  66. data/vendor/FreeImage/Source/FreeImage/PluginG3.cpp +433 -0
  67. data/vendor/FreeImage/Source/FreeImage/PluginGIF.cpp +1407 -0
  68. data/vendor/FreeImage/Source/FreeImage/PluginHDR.cpp +722 -0
  69. data/vendor/FreeImage/Source/FreeImage/PluginICO.cpp +824 -0
  70. data/vendor/FreeImage/Source/FreeImage/PluginIFF.cpp +459 -0
  71. data/vendor/FreeImage/Source/FreeImage/PluginJ2K.cpp +328 -0
  72. data/vendor/FreeImage/Source/FreeImage/PluginJNG.cpp +162 -0
  73. data/vendor/FreeImage/Source/FreeImage/PluginJP2.cpp +328 -0
  74. data/vendor/FreeImage/Source/FreeImage/PluginJPEG.cpp +1706 -0
  75. data/vendor/FreeImage/Source/FreeImage/PluginJXR.cpp +1475 -0
  76. data/vendor/FreeImage/Source/FreeImage/PluginKOALA.cpp +243 -0
  77. data/vendor/FreeImage/Source/FreeImage/PluginMNG.cpp +153 -0
  78. data/vendor/FreeImage/Source/FreeImage/PluginPCD.cpp +251 -0
  79. data/vendor/FreeImage/Source/FreeImage/PluginPCX.cpp +659 -0
  80. data/vendor/FreeImage/Source/FreeImage/PluginPFM.cpp +409 -0
  81. data/vendor/FreeImage/Source/FreeImage/PluginPICT.cpp +1343 -0
  82. data/vendor/FreeImage/Source/FreeImage/PluginPNG.cpp +1115 -0
  83. data/vendor/FreeImage/Source/FreeImage/PluginPNM.cpp +838 -0
  84. data/vendor/FreeImage/Source/FreeImage/PluginPSD.cpp +131 -0
  85. data/vendor/FreeImage/Source/FreeImage/PluginRAS.cpp +512 -0
  86. data/vendor/FreeImage/Source/FreeImage/PluginRAW.cpp +793 -0
  87. data/vendor/FreeImage/Source/FreeImage/PluginSGI.cpp +425 -0
  88. data/vendor/FreeImage/Source/FreeImage/PluginTARGA.cpp +1591 -0
  89. data/vendor/FreeImage/Source/FreeImage/PluginTIFF.cpp +2631 -0
  90. data/vendor/FreeImage/Source/FreeImage/PluginWBMP.cpp +372 -0
  91. data/vendor/FreeImage/Source/FreeImage/PluginWebP.cpp +698 -0
  92. data/vendor/FreeImage/Source/FreeImage/PluginXBM.cpp +399 -0
  93. data/vendor/FreeImage/Source/FreeImage/PluginXPM.cpp +487 -0
  94. data/vendor/FreeImage/Source/FreeImage/TIFFLogLuv.cpp +65 -0
  95. data/vendor/FreeImage/Source/FreeImage/ToneMapping.cpp +75 -0
  96. data/vendor/FreeImage/Source/FreeImage/WuQuantizer.cpp +559 -0
  97. data/vendor/FreeImage/Source/FreeImage/ZLibInterface.cpp +223 -0
  98. data/vendor/FreeImage/Source/FreeImage/tmoColorConvert.cpp +479 -0
  99. data/vendor/FreeImage/Source/FreeImage/tmoDrago03.cpp +295 -0
  100. data/vendor/FreeImage/Source/FreeImage/tmoFattal02.cpp +689 -0
  101. data/vendor/FreeImage/Source/FreeImage/tmoReinhard05.cpp +260 -0
  102. data/vendor/FreeImage/Source/FreeImage.h +1153 -0
  103. data/vendor/FreeImage/Source/FreeImageIO.h +63 -0
  104. data/vendor/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp +730 -0
  105. data/vendor/FreeImage/Source/FreeImageToolkit/Background.cpp +895 -0
  106. data/vendor/FreeImage/Source/FreeImageToolkit/Channels.cpp +488 -0
  107. data/vendor/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp +917 -0
  108. data/vendor/FreeImage/Source/FreeImageToolkit/Colors.cpp +967 -0
  109. data/vendor/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp +861 -0
  110. data/vendor/FreeImage/Source/FreeImageToolkit/Display.cpp +230 -0
  111. data/vendor/FreeImage/Source/FreeImageToolkit/Filters.h +287 -0
  112. data/vendor/FreeImage/Source/FreeImageToolkit/Flip.cpp +166 -0
  113. data/vendor/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp +623 -0
  114. data/vendor/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp +505 -0
  115. data/vendor/FreeImage/Source/FreeImageToolkit/Rescale.cpp +192 -0
  116. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.cpp +2116 -0
  117. data/vendor/FreeImage/Source/FreeImageToolkit/Resize.h +196 -0
  118. data/vendor/FreeImage/Source/LibJPEG/ansi2knr.c +739 -0
  119. data/vendor/FreeImage/Source/LibJPEG/cderror.h +134 -0
  120. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.c +181 -0
  121. data/vendor/FreeImage/Source/LibJPEG/cdjpeg.h +187 -0
  122. data/vendor/FreeImage/Source/LibJPEG/cjpeg.c +664 -0
  123. data/vendor/FreeImage/Source/LibJPEG/ckconfig.c +402 -0
  124. data/vendor/FreeImage/Source/LibJPEG/djpeg.c +617 -0
  125. data/vendor/FreeImage/Source/LibJPEG/example.c +433 -0
  126. data/vendor/FreeImage/Source/LibJPEG/jaricom.c +153 -0
  127. data/vendor/FreeImage/Source/LibJPEG/jcapimin.c +288 -0
  128. data/vendor/FreeImage/Source/LibJPEG/jcapistd.c +162 -0
  129. data/vendor/FreeImage/Source/LibJPEG/jcarith.c +944 -0
  130. data/vendor/FreeImage/Source/LibJPEG/jccoefct.c +454 -0
  131. data/vendor/FreeImage/Source/LibJPEG/jccolor.c +604 -0
  132. data/vendor/FreeImage/Source/LibJPEG/jcdctmgr.c +477 -0
  133. data/vendor/FreeImage/Source/LibJPEG/jchuff.c +1573 -0
  134. data/vendor/FreeImage/Source/LibJPEG/jcinit.c +84 -0
  135. data/vendor/FreeImage/Source/LibJPEG/jcmainct.c +297 -0
  136. data/vendor/FreeImage/Source/LibJPEG/jcmarker.c +719 -0
  137. data/vendor/FreeImage/Source/LibJPEG/jcmaster.c +856 -0
  138. data/vendor/FreeImage/Source/LibJPEG/jcomapi.c +106 -0
  139. data/vendor/FreeImage/Source/LibJPEG/jconfig.h +161 -0
  140. data/vendor/FreeImage/Source/LibJPEG/jcparam.c +675 -0
  141. data/vendor/FreeImage/Source/LibJPEG/jcprepct.c +358 -0
  142. data/vendor/FreeImage/Source/LibJPEG/jcsample.c +545 -0
  143. data/vendor/FreeImage/Source/LibJPEG/jctrans.c +385 -0
  144. data/vendor/FreeImage/Source/LibJPEG/jdapimin.c +399 -0
  145. data/vendor/FreeImage/Source/LibJPEG/jdapistd.c +276 -0
  146. data/vendor/FreeImage/Source/LibJPEG/jdarith.c +796 -0
  147. data/vendor/FreeImage/Source/LibJPEG/jdatadst.c +270 -0
  148. data/vendor/FreeImage/Source/LibJPEG/jdatasrc.c +275 -0
  149. data/vendor/FreeImage/Source/LibJPEG/jdcoefct.c +741 -0
  150. data/vendor/FreeImage/Source/LibJPEG/jdcolor.c +748 -0
  151. data/vendor/FreeImage/Source/LibJPEG/jdct.h +393 -0
  152. data/vendor/FreeImage/Source/LibJPEG/jddctmgr.c +384 -0
  153. data/vendor/FreeImage/Source/LibJPEG/jdhuff.c +1554 -0
  154. data/vendor/FreeImage/Source/LibJPEG/jdinput.c +662 -0
  155. data/vendor/FreeImage/Source/LibJPEG/jdmainct.c +513 -0
  156. data/vendor/FreeImage/Source/LibJPEG/jdmarker.c +1511 -0
  157. data/vendor/FreeImage/Source/LibJPEG/jdmaster.c +543 -0
  158. data/vendor/FreeImage/Source/LibJPEG/jdmerge.c +401 -0
  159. data/vendor/FreeImage/Source/LibJPEG/jdpostct.c +290 -0
  160. data/vendor/FreeImage/Source/LibJPEG/jdsample.c +361 -0
  161. data/vendor/FreeImage/Source/LibJPEG/jdtrans.c +140 -0
  162. data/vendor/FreeImage/Source/LibJPEG/jerror.c +253 -0
  163. data/vendor/FreeImage/Source/LibJPEG/jerror.h +304 -0
  164. data/vendor/FreeImage/Source/LibJPEG/jfdctflt.c +174 -0
  165. data/vendor/FreeImage/Source/LibJPEG/jfdctfst.c +230 -0
  166. data/vendor/FreeImage/Source/LibJPEG/jfdctint.c +4406 -0
  167. data/vendor/FreeImage/Source/LibJPEG/jidctflt.c +235 -0
  168. data/vendor/FreeImage/Source/LibJPEG/jidctfst.c +368 -0
  169. data/vendor/FreeImage/Source/LibJPEG/jidctint.c +5179 -0
  170. data/vendor/FreeImage/Source/LibJPEG/jinclude.h +91 -0
  171. data/vendor/FreeImage/Source/LibJPEG/jmemansi.c +167 -0
  172. data/vendor/FreeImage/Source/LibJPEG/jmemdos.c +638 -0
  173. data/vendor/FreeImage/Source/LibJPEG/jmemmac.c +289 -0
  174. data/vendor/FreeImage/Source/LibJPEG/jmemmgr.c +1119 -0
  175. data/vendor/FreeImage/Source/LibJPEG/jmemname.c +276 -0
  176. data/vendor/FreeImage/Source/LibJPEG/jmemnobs.c +109 -0
  177. data/vendor/FreeImage/Source/LibJPEG/jmemsys.h +198 -0
  178. data/vendor/FreeImage/Source/LibJPEG/jmorecfg.h +442 -0
  179. data/vendor/FreeImage/Source/LibJPEG/jpegint.h +426 -0
  180. data/vendor/FreeImage/Source/LibJPEG/jpeglib.h +1180 -0
  181. data/vendor/FreeImage/Source/LibJPEG/jpegtran.c +577 -0
  182. data/vendor/FreeImage/Source/LibJPEG/jquant1.c +857 -0
  183. data/vendor/FreeImage/Source/LibJPEG/jquant2.c +1311 -0
  184. data/vendor/FreeImage/Source/LibJPEG/jutils.c +227 -0
  185. data/vendor/FreeImage/Source/LibJPEG/jversion.h +14 -0
  186. data/vendor/FreeImage/Source/LibJPEG/rdbmp.c +480 -0
  187. data/vendor/FreeImage/Source/LibJPEG/rdcolmap.c +253 -0
  188. data/vendor/FreeImage/Source/LibJPEG/rdgif.c +38 -0
  189. data/vendor/FreeImage/Source/LibJPEG/rdjpgcom.c +515 -0
  190. data/vendor/FreeImage/Source/LibJPEG/rdppm.c +459 -0
  191. data/vendor/FreeImage/Source/LibJPEG/rdrle.c +387 -0
  192. data/vendor/FreeImage/Source/LibJPEG/rdswitch.c +365 -0
  193. data/vendor/FreeImage/Source/LibJPEG/rdtarga.c +500 -0
  194. data/vendor/FreeImage/Source/LibJPEG/transupp.c +1763 -0
  195. data/vendor/FreeImage/Source/LibJPEG/transupp.h +219 -0
  196. data/vendor/FreeImage/Source/LibJPEG/wrbmp.c +442 -0
  197. data/vendor/FreeImage/Source/LibJPEG/wrgif.c +399 -0
  198. data/vendor/FreeImage/Source/LibJPEG/wrjpgcom.c +583 -0
  199. data/vendor/FreeImage/Source/LibJPEG/wrppm.c +269 -0
  200. data/vendor/FreeImage/Source/LibJPEG/wrrle.c +305 -0
  201. data/vendor/FreeImage/Source/LibJPEG/wrtarga.c +253 -0
  202. data/vendor/FreeImage/Source/LibJXR/common/include/guiddef.h +230 -0
  203. data/vendor/FreeImage/Source/LibJXR/common/include/wmsal.h +757 -0
  204. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstring.h +342 -0
  205. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_adt.h +71 -0
  206. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_strict.h +1096 -0
  207. data/vendor/FreeImage/Source/LibJXR/common/include/wmspecstrings_undef.h +406 -0
  208. data/vendor/FreeImage/Source/LibJXR/image/decode/JXRTranscode.c +987 -0
  209. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.c +200 -0
  210. data/vendor/FreeImage/Source/LibJXR/image/decode/decode.h +143 -0
  211. data/vendor/FreeImage/Source/LibJXR/image/decode/postprocess.c +288 -0
  212. data/vendor/FreeImage/Source/LibJXR/image/decode/segdec.c +1205 -0
  213. data/vendor/FreeImage/Source/LibJXR/image/decode/strInvTransform.c +1888 -0
  214. data/vendor/FreeImage/Source/LibJXR/image/decode/strPredQuantDec.c +539 -0
  215. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec.c +3628 -0
  216. data/vendor/FreeImage/Source/LibJXR/image/decode/strdec_x86.c +1640 -0
  217. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.c +144 -0
  218. data/vendor/FreeImage/Source/LibJXR/image/encode/encode.h +113 -0
  219. data/vendor/FreeImage/Source/LibJXR/image/encode/segenc.c +1186 -0
  220. data/vendor/FreeImage/Source/LibJXR/image/encode/strFwdTransform.c +1111 -0
  221. data/vendor/FreeImage/Source/LibJXR/image/encode/strPredQuantEnc.c +511 -0
  222. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc.c +2370 -0
  223. data/vendor/FreeImage/Source/LibJXR/image/encode/strenc_x86.c +409 -0
  224. data/vendor/FreeImage/Source/LibJXR/image/sys/adapthuff.c +511 -0
  225. data/vendor/FreeImage/Source/LibJXR/image/sys/ansi.h +61 -0
  226. data/vendor/FreeImage/Source/LibJXR/image/sys/common.h +131 -0
  227. data/vendor/FreeImage/Source/LibJXR/image/sys/image.c +183 -0
  228. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimer.h +115 -0
  229. data/vendor/FreeImage/Source/LibJXR/image/sys/perfTimerANSI.c +274 -0
  230. data/vendor/FreeImage/Source/LibJXR/image/sys/strPredQuant.c +306 -0
  231. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.c +85 -0
  232. data/vendor/FreeImage/Source/LibJXR/image/sys/strTransform.h +50 -0
  233. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.c +1251 -0
  234. data/vendor/FreeImage/Source/LibJXR/image/sys/strcodec.h +681 -0
  235. data/vendor/FreeImage/Source/LibJXR/image/sys/windowsmediaphoto.h +515 -0
  236. data/vendor/FreeImage/Source/LibJXR/image/sys/xplatform_image.h +84 -0
  237. data/vendor/FreeImage/Source/LibJXR/image/x86/x86.h +58 -0
  238. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.c +930 -0
  239. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlue.h +636 -0
  240. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGlueJxr.c +2246 -0
  241. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRGluePFC.c +2338 -0
  242. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.c +905 -0
  243. data/vendor/FreeImage/Source/LibJXR/jxrgluelib/JXRMeta.h +258 -0
  244. data/vendor/FreeImage/Source/LibOpenJPEG/bio.c +188 -0
  245. data/vendor/FreeImage/Source/LibOpenJPEG/bio.h +128 -0
  246. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.c +239 -0
  247. data/vendor/FreeImage/Source/LibOpenJPEG/cidx_manager.h +68 -0
  248. data/vendor/FreeImage/Source/LibOpenJPEG/cio.c +644 -0
  249. data/vendor/FreeImage/Source/LibOpenJPEG/cio.h +393 -0
  250. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.c +919 -0
  251. data/vendor/FreeImage/Source/LibOpenJPEG/dwt.h +116 -0
  252. data/vendor/FreeImage/Source/LibOpenJPEG/event.c +141 -0
  253. data/vendor/FreeImage/Source/LibOpenJPEG/event.h +97 -0
  254. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.c +114 -0
  255. data/vendor/FreeImage/Source/LibOpenJPEG/function_list.h +126 -0
  256. data/vendor/FreeImage/Source/LibOpenJPEG/image.c +235 -0
  257. data/vendor/FreeImage/Source/LibOpenJPEG/image.h +63 -0
  258. data/vendor/FreeImage/Source/LibOpenJPEG/indexbox_manager.h +148 -0
  259. data/vendor/FreeImage/Source/LibOpenJPEG/invert.c +289 -0
  260. data/vendor/FreeImage/Source/LibOpenJPEG/invert.h +59 -0
  261. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.c +10238 -0
  262. data/vendor/FreeImage/Source/LibOpenJPEG/j2k.h +838 -0
  263. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.c +2776 -0
  264. data/vendor/FreeImage/Source/LibOpenJPEG/jp2.h +490 -0
  265. data/vendor/FreeImage/Source/LibOpenJPEG/mct.c +319 -0
  266. data/vendor/FreeImage/Source/LibOpenJPEG/mct.h +149 -0
  267. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.c +604 -0
  268. data/vendor/FreeImage/Source/LibOpenJPEG/mqc.h +201 -0
  269. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.c +955 -0
  270. data/vendor/FreeImage/Source/LibOpenJPEG/openjpeg.h +1475 -0
  271. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.c +59 -0
  272. data/vendor/FreeImage/Source/LibOpenJPEG/opj_clock.h +54 -0
  273. data/vendor/FreeImage/Source/LibOpenJPEG/opj_codec.h +160 -0
  274. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config.h +9 -0
  275. data/vendor/FreeImage/Source/LibOpenJPEG/opj_config_private.h +16 -0
  276. data/vendor/FreeImage/Source/LibOpenJPEG/opj_includes.h +175 -0
  277. data/vendor/FreeImage/Source/LibOpenJPEG/opj_intmath.h +172 -0
  278. data/vendor/FreeImage/Source/LibOpenJPEG/opj_inttypes.h +43 -0
  279. data/vendor/FreeImage/Source/LibOpenJPEG/opj_malloc.h +180 -0
  280. data/vendor/FreeImage/Source/LibOpenJPEG/opj_stdint.h +47 -0
  281. data/vendor/FreeImage/Source/LibOpenJPEG/phix_manager.c +191 -0
  282. data/vendor/FreeImage/Source/LibOpenJPEG/pi.c +1870 -0
  283. data/vendor/FreeImage/Source/LibOpenJPEG/pi.h +182 -0
  284. data/vendor/FreeImage/Source/LibOpenJPEG/ppix_manager.c +194 -0
  285. data/vendor/FreeImage/Source/LibOpenJPEG/raw.c +89 -0
  286. data/vendor/FreeImage/Source/LibOpenJPEG/raw.h +100 -0
  287. data/vendor/FreeImage/Source/LibOpenJPEG/t1.c +1751 -0
  288. data/vendor/FreeImage/Source/LibOpenJPEG/t1.h +157 -0
  289. data/vendor/FreeImage/Source/LibOpenJPEG/t1_generate_luts.c +276 -0
  290. data/vendor/FreeImage/Source/LibOpenJPEG/t1_luts.h +143 -0
  291. data/vendor/FreeImage/Source/LibOpenJPEG/t2.c +1334 -0
  292. data/vendor/FreeImage/Source/LibOpenJPEG/t2.h +127 -0
  293. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.c +2123 -0
  294. data/vendor/FreeImage/Source/LibOpenJPEG/tcd.h +348 -0
  295. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.c +331 -0
  296. data/vendor/FreeImage/Source/LibOpenJPEG/tgt.h +140 -0
  297. data/vendor/FreeImage/Source/LibOpenJPEG/thix_manager.c +134 -0
  298. data/vendor/FreeImage/Source/LibOpenJPEG/tpix_manager.c +185 -0
  299. data/vendor/FreeImage/Source/LibPNG/example.c +1061 -0
  300. data/vendor/FreeImage/Source/LibPNG/png.c +4493 -0
  301. data/vendor/FreeImage/Source/LibPNG/png.h +3282 -0
  302. data/vendor/FreeImage/Source/LibPNG/pngconf.h +644 -0
  303. data/vendor/FreeImage/Source/LibPNG/pngdebug.h +154 -0
  304. data/vendor/FreeImage/Source/LibPNG/pngerror.c +963 -0
  305. data/vendor/FreeImage/Source/LibPNG/pngget.c +1213 -0
  306. data/vendor/FreeImage/Source/LibPNG/pnginfo.h +260 -0
  307. data/vendor/FreeImage/Source/LibPNG/pnglibconf.h +218 -0
  308. data/vendor/FreeImage/Source/LibPNG/pngmem.c +281 -0
  309. data/vendor/FreeImage/Source/LibPNG/pngpread.c +1168 -0
  310. data/vendor/FreeImage/Source/LibPNG/pngpriv.h +1944 -0
  311. data/vendor/FreeImage/Source/LibPNG/pngread.c +4121 -0
  312. data/vendor/FreeImage/Source/LibPNG/pngrio.c +120 -0
  313. data/vendor/FreeImage/Source/LibPNG/pngrtran.c +4994 -0
  314. data/vendor/FreeImage/Source/LibPNG/pngrutil.c +4474 -0
  315. data/vendor/FreeImage/Source/LibPNG/pngset.c +1611 -0
  316. data/vendor/FreeImage/Source/LibPNG/pngstruct.h +489 -0
  317. data/vendor/FreeImage/Source/LibPNG/pngtest.c +2011 -0
  318. data/vendor/FreeImage/Source/LibPNG/pngtrans.c +849 -0
  319. data/vendor/FreeImage/Source/LibPNG/pngwio.c +168 -0
  320. data/vendor/FreeImage/Source/LibPNG/pngwrite.c +2455 -0
  321. data/vendor/FreeImage/Source/LibPNG/pngwtran.c +574 -0
  322. data/vendor/FreeImage/Source/LibPNG/pngwutil.c +3029 -0
  323. data/vendor/FreeImage/Source/LibRawLite/dcraw/dcraw.c +15462 -0
  324. data/vendor/FreeImage/Source/LibRawLite/internal/aahd_demosaic.cpp +706 -0
  325. data/vendor/FreeImage/Source/LibRawLite/internal/dcb_demosaicing.c +710 -0
  326. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_common.cpp +13593 -0
  327. data/vendor/FreeImage/Source/LibRawLite/internal/dcraw_fileio.cpp +240 -0
  328. data/vendor/FreeImage/Source/LibRawLite/internal/defines.h +167 -0
  329. data/vendor/FreeImage/Source/LibRawLite/internal/demosaic_packs.cpp +99 -0
  330. data/vendor/FreeImage/Source/LibRawLite/internal/dht_demosaic.cpp +873 -0
  331. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_internal_funcs.h +282 -0
  332. data/vendor/FreeImage/Source/LibRawLite/internal/libraw_x3f.cpp +1919 -0
  333. data/vendor/FreeImage/Source/LibRawLite/internal/var_defines.h +216 -0
  334. data/vendor/FreeImage/Source/LibRawLite/internal/wf_filtering.cpp +1950 -0
  335. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw.h +338 -0
  336. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_alloc.h +99 -0
  337. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_const.h +233 -0
  338. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_datastream.h +238 -0
  339. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_internal.h +225 -0
  340. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_types.h +442 -0
  341. data/vendor/FreeImage/Source/LibRawLite/libraw/libraw_version.h +62 -0
  342. data/vendor/FreeImage/Source/LibRawLite/src/libraw_c_api.cpp +230 -0
  343. data/vendor/FreeImage/Source/LibRawLite/src/libraw_cxx.cpp +4533 -0
  344. data/vendor/FreeImage/Source/LibRawLite/src/libraw_datastream.cpp +703 -0
  345. data/vendor/FreeImage/Source/LibTIFF4/mkg3states.c +451 -0
  346. data/vendor/FreeImage/Source/LibTIFF4/mkspans.c +82 -0
  347. data/vendor/FreeImage/Source/LibTIFF4/t4.h +292 -0
  348. data/vendor/FreeImage/Source/LibTIFF4/tif_aux.c +358 -0
  349. data/vendor/FreeImage/Source/LibTIFF4/tif_close.c +140 -0
  350. data/vendor/FreeImage/Source/LibTIFF4/tif_codec.c +166 -0
  351. data/vendor/FreeImage/Source/LibTIFF4/tif_color.c +287 -0
  352. data/vendor/FreeImage/Source/LibTIFF4/tif_compress.c +304 -0
  353. data/vendor/FreeImage/Source/LibTIFF4/tif_config.h +97 -0
  354. data/vendor/FreeImage/Source/LibTIFF4/tif_config.vc.h +74 -0
  355. data/vendor/FreeImage/Source/LibTIFF4/tif_config.wince.h +71 -0
  356. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.c +1700 -0
  357. data/vendor/FreeImage/Source/LibTIFF4/tif_dir.h +308 -0
  358. data/vendor/FreeImage/Source/LibTIFF4/tif_dirinfo.c +959 -0
  359. data/vendor/FreeImage/Source/LibTIFF4/tif_dirread.c +5640 -0
  360. data/vendor/FreeImage/Source/LibTIFF4/tif_dirwrite.c +2910 -0
  361. data/vendor/FreeImage/Source/LibTIFF4/tif_dumpmode.c +143 -0
  362. data/vendor/FreeImage/Source/LibTIFF4/tif_error.c +80 -0
  363. data/vendor/FreeImage/Source/LibTIFF4/tif_extension.c +118 -0
  364. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.c +1595 -0
  365. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3.h +538 -0
  366. data/vendor/FreeImage/Source/LibTIFF4/tif_fax3sm.c +1260 -0
  367. data/vendor/FreeImage/Source/LibTIFF4/tif_flush.c +118 -0
  368. data/vendor/FreeImage/Source/LibTIFF4/tif_getimage.c +2890 -0
  369. data/vendor/FreeImage/Source/LibTIFF4/tif_jbig.c +213 -0
  370. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg.c +2354 -0
  371. data/vendor/FreeImage/Source/LibTIFF4/tif_jpeg_12.c +65 -0
  372. data/vendor/FreeImage/Source/LibTIFF4/tif_luv.c +1683 -0
  373. data/vendor/FreeImage/Source/LibTIFF4/tif_lzma.c +495 -0
  374. data/vendor/FreeImage/Source/LibTIFF4/tif_lzw.c +1169 -0
  375. data/vendor/FreeImage/Source/LibTIFF4/tif_next.c +181 -0
  376. data/vendor/FreeImage/Source/LibTIFF4/tif_ojpeg.c +2501 -0
  377. data/vendor/FreeImage/Source/LibTIFF4/tif_open.c +725 -0
  378. data/vendor/FreeImage/Source/LibTIFF4/tif_packbits.c +300 -0
  379. data/vendor/FreeImage/Source/LibTIFF4/tif_pixarlog.c +1442 -0
  380. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.c +764 -0
  381. data/vendor/FreeImage/Source/LibTIFF4/tif_predict.h +77 -0
  382. data/vendor/FreeImage/Source/LibTIFF4/tif_print.c +716 -0
  383. data/vendor/FreeImage/Source/LibTIFF4/tif_read.c +1086 -0
  384. data/vendor/FreeImage/Source/LibTIFF4/tif_strip.c +383 -0
  385. data/vendor/FreeImage/Source/LibTIFF4/tif_swab.c +310 -0
  386. data/vendor/FreeImage/Source/LibTIFF4/tif_thunder.c +207 -0
  387. data/vendor/FreeImage/Source/LibTIFF4/tif_tile.c +299 -0
  388. data/vendor/FreeImage/Source/LibTIFF4/tif_unix.c +325 -0
  389. data/vendor/FreeImage/Source/LibTIFF4/tif_version.c +40 -0
  390. data/vendor/FreeImage/Source/LibTIFF4/tif_vms.c +603 -0
  391. data/vendor/FreeImage/Source/LibTIFF4/tif_warning.c +81 -0
  392. data/vendor/FreeImage/Source/LibTIFF4/tif_win32.c +443 -0
  393. data/vendor/FreeImage/Source/LibTIFF4/tif_wince.c +293 -0
  394. data/vendor/FreeImage/Source/LibTIFF4/tif_write.c +771 -0
  395. data/vendor/FreeImage/Source/LibTIFF4/tif_zip.c +472 -0
  396. data/vendor/FreeImage/Source/LibTIFF4/tiff.h +681 -0
  397. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.h +170 -0
  398. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.vc.h +160 -0
  399. data/vendor/FreeImage/Source/LibTIFF4/tiffconf.wince.h +121 -0
  400. data/vendor/FreeImage/Source/LibTIFF4/tiffio.h +557 -0
  401. data/vendor/FreeImage/Source/LibTIFF4/tiffiop.h +367 -0
  402. data/vendor/FreeImage/Source/LibTIFF4/tiffvers.h +9 -0
  403. data/vendor/FreeImage/Source/LibTIFF4/uvcode.h +180 -0
  404. data/vendor/FreeImage/Source/LibWebP/src/dec/alphai.h +55 -0
  405. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.alpha.c +167 -0
  406. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.buffer.c +249 -0
  407. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.frame.c +827 -0
  408. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.idec.c +857 -0
  409. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.io.c +640 -0
  410. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.quant.c +110 -0
  411. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.tree.c +525 -0
  412. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8.c +663 -0
  413. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.vp8l.c +1584 -0
  414. data/vendor/FreeImage/Source/LibWebP/src/dec/dec.webp.c +834 -0
  415. data/vendor/FreeImage/Source/LibWebP/src/dec/decode_vp8.h +185 -0
  416. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8i.h +353 -0
  417. data/vendor/FreeImage/Source/LibWebP/src/dec/vp8li.h +136 -0
  418. data/vendor/FreeImage/Source/LibWebP/src/dec/webpi.h +120 -0
  419. data/vendor/FreeImage/Source/LibWebP/src/demux/demux.demux.c +957 -0
  420. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing.c +377 -0
  421. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_mips_dsp_r2.c +139 -0
  422. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.alpha_processing_sse2.c +296 -0
  423. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb.c +68 -0
  424. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_mips_dsp_r2.c +108 -0
  425. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.argb_sse2.c +62 -0
  426. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost.c +412 -0
  427. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips32.c +154 -0
  428. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_mips_dsp_r2.c +107 -0
  429. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cost_sse2.c +121 -0
  430. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.cpu.c +138 -0
  431. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec.c +760 -0
  432. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_clip_tables.c +366 -0
  433. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips32.c +585 -0
  434. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +992 -0
  435. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_neon.c +1489 -0
  436. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.dec_sse2.c +1284 -0
  437. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc.c +788 -0
  438. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_avx2.c +24 -0
  439. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips32.c +670 -0
  440. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +1510 -0
  441. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_neon.c +932 -0
  442. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.enc_sse2.c +940 -0
  443. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters.c +240 -0
  444. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +404 -0
  445. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.filters_sse2.c +349 -0
  446. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.h +434 -0
  447. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless.c +1838 -0
  448. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +416 -0
  449. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +921 -0
  450. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_neon.c +357 -0
  451. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.lossless_sse2.c +535 -0
  452. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler.c +115 -0
  453. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips32.c +192 -0
  454. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.rescaler_mips_dsp_r2.c +210 -0
  455. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling.c +252 -0
  456. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +280 -0
  457. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_neon.c +267 -0
  458. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.upsampling_sse2.c +214 -0
  459. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv.c +166 -0
  460. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips32.c +100 -0
  461. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +131 -0
  462. data/vendor/FreeImage/Source/LibWebP/src/dsp/dsp.yuv_sse2.c +322 -0
  463. data/vendor/FreeImage/Source/LibWebP/src/dsp/lossless.h +313 -0
  464. data/vendor/FreeImage/Source/LibWebP/src/dsp/mips_macro.h +200 -0
  465. data/vendor/FreeImage/Source/LibWebP/src/dsp/neon.h +82 -0
  466. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv.h +321 -0
  467. data/vendor/FreeImage/Source/LibWebP/src/dsp/yuv_tables_sse2.h +536 -0
  468. data/vendor/FreeImage/Source/LibWebP/src/enc/backward_references.h +202 -0
  469. data/vendor/FreeImage/Source/LibWebP/src/enc/cost.h +69 -0
  470. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.alpha.c +440 -0
  471. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.analysis.c +501 -0
  472. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.backward_references.c +1076 -0
  473. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.config.c +163 -0
  474. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.cost.c +355 -0
  475. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.filter.c +296 -0
  476. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.frame.c +850 -0
  477. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.histogram.c +897 -0
  478. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.iterator.c +456 -0
  479. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.near_lossless.c +160 -0
  480. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture.c +290 -0
  481. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_csp.c +1100 -0
  482. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_psnr.c +150 -0
  483. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_rescale.c +285 -0
  484. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.picture_tools.c +206 -0
  485. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.quant.c +1191 -0
  486. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.syntax.c +383 -0
  487. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.token.c +285 -0
  488. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.tree.c +504 -0
  489. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.vp8l.c +1437 -0
  490. data/vendor/FreeImage/Source/LibWebP/src/enc/enc.webpenc.c +379 -0
  491. data/vendor/FreeImage/Source/LibWebP/src/enc/histogram.h +114 -0
  492. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8enci.h +551 -0
  493. data/vendor/FreeImage/Source/LibWebP/src/enc/vp8li.h +78 -0
  494. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.anim_encode.c +1241 -0
  495. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxedit.c +696 -0
  496. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxinternal.c +551 -0
  497. data/vendor/FreeImage/Source/LibWebP/src/mux/mux.muxread.c +544 -0
  498. data/vendor/FreeImage/Source/LibWebP/src/mux/muxi.h +232 -0
  499. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader.h +168 -0
  500. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_reader_inl.h +172 -0
  501. data/vendor/FreeImage/Source/LibWebP/src/utils/bit_writer.h +120 -0
  502. data/vendor/FreeImage/Source/LibWebP/src/utils/color_cache.h +74 -0
  503. data/vendor/FreeImage/Source/LibWebP/src/utils/endian_inl.h +100 -0
  504. data/vendor/FreeImage/Source/LibWebP/src/utils/filters.h +32 -0
  505. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman.h +67 -0
  506. data/vendor/FreeImage/Source/LibWebP/src/utils/huffman_encode.h +60 -0
  507. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels.h +36 -0
  508. data/vendor/FreeImage/Source/LibWebP/src/utils/quant_levels_dec.h +35 -0
  509. data/vendor/FreeImage/Source/LibWebP/src/utils/random.h +63 -0
  510. data/vendor/FreeImage/Source/LibWebP/src/utils/rescaler.h +78 -0
  511. data/vendor/FreeImage/Source/LibWebP/src/utils/thread.h +93 -0
  512. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_reader.c +208 -0
  513. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.bit_writer.c +308 -0
  514. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.color_cache.c +49 -0
  515. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.filters.c +76 -0
  516. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.h +121 -0
  517. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman.c +205 -0
  518. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.huffman_encode.c +417 -0
  519. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels.c +140 -0
  520. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.quant_levels_dec.c +279 -0
  521. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.random.c +43 -0
  522. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.rescaler.c +82 -0
  523. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.thread.c +309 -0
  524. data/vendor/FreeImage/Source/LibWebP/src/utils/utils.utils.c +211 -0
  525. data/vendor/FreeImage/Source/LibWebP/src/webp/decode.h +493 -0
  526. data/vendor/FreeImage/Source/LibWebP/src/webp/demux.h +224 -0
  527. data/vendor/FreeImage/Source/LibWebP/src/webp/encode.h +515 -0
  528. data/vendor/FreeImage/Source/LibWebP/src/webp/format_constants.h +88 -0
  529. data/vendor/FreeImage/Source/LibWebP/src/webp/mux.h +507 -0
  530. data/vendor/FreeImage/Source/LibWebP/src/webp/mux_types.h +97 -0
  531. data/vendor/FreeImage/Source/LibWebP/src/webp/types.h +52 -0
  532. data/vendor/FreeImage/Source/MapIntrospector.h +212 -0
  533. data/vendor/FreeImage/Source/Metadata/Exif.cpp +1253 -0
  534. data/vendor/FreeImage/Source/Metadata/FIRational.cpp +176 -0
  535. data/vendor/FreeImage/Source/Metadata/FIRational.h +108 -0
  536. data/vendor/FreeImage/Source/Metadata/FreeImageTag.cpp +353 -0
  537. data/vendor/FreeImage/Source/Metadata/FreeImageTag.h +500 -0
  538. data/vendor/FreeImage/Source/Metadata/IPTC.cpp +342 -0
  539. data/vendor/FreeImage/Source/Metadata/TagConversion.cpp +1094 -0
  540. data/vendor/FreeImage/Source/Metadata/TagLib.cpp +1618 -0
  541. data/vendor/FreeImage/Source/Metadata/XTIFF.cpp +766 -0
  542. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.cpp +114 -0
  543. data/vendor/FreeImage/Source/OpenEXR/Half/eLut.h +71 -0
  544. data/vendor/FreeImage/Source/OpenEXR/Half/half.cpp +310 -0
  545. data/vendor/FreeImage/Source/OpenEXR/Half/half.h +757 -0
  546. data/vendor/FreeImage/Source/OpenEXR/Half/halfExport.h +27 -0
  547. data/vendor/FreeImage/Source/OpenEXR/Half/halfFunction.h +179 -0
  548. data/vendor/FreeImage/Source/OpenEXR/Half/halfLimits.h +102 -0
  549. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.cpp +164 -0
  550. data/vendor/FreeImage/Source/OpenEXR/Half/toFloat.h +16391 -0
  551. data/vendor/FreeImage/Source/OpenEXR/Iex/Iex.h +60 -0
  552. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.cpp +156 -0
  553. data/vendor/FreeImage/Source/OpenEXR/Iex/IexBaseExc.h +264 -0
  554. data/vendor/FreeImage/Source/OpenEXR/Iex/IexErrnoExc.h +208 -0
  555. data/vendor/FreeImage/Source/OpenEXR/Iex/IexExport.h +51 -0
  556. data/vendor/FreeImage/Source/OpenEXR/Iex/IexForward.h +229 -0
  557. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMacros.h +170 -0
  558. data/vendor/FreeImage/Source/OpenEXR/Iex/IexMathExc.h +57 -0
  559. data/vendor/FreeImage/Source/OpenEXR/Iex/IexNamespace.h +112 -0
  560. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.cpp +873 -0
  561. data/vendor/FreeImage/Source/OpenEXR/Iex/IexThrowErrnoExc.h +97 -0
  562. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.cpp +113 -0
  563. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFloatExc.h +146 -0
  564. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.cpp +530 -0
  565. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathFpu.h +91 -0
  566. data/vendor/FreeImage/Source/OpenEXR/IexMath/IexMathIeeeExc.h +62 -0
  567. data/vendor/FreeImage/Source/OpenEXR/IlmBaseConfig.h +61 -0
  568. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.cpp +633 -0
  569. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAcesFile.h +324 -0
  570. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfArray.h +285 -0
  571. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.cpp +158 -0
  572. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAttribute.h +407 -0
  573. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfAutoArray.h +95 -0
  574. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.cpp +1072 -0
  575. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfB44Compressor.h +118 -0
  576. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp +111 -0
  577. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfBoxAttribute.h +87 -0
  578. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp +1438 -0
  579. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCRgbaFile.h +555 -0
  580. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.cpp +322 -0
  581. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelList.h +436 -0
  582. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp +150 -0
  583. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChannelListAttribute.h +74 -0
  584. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h +163 -0
  585. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.cpp +151 -0
  586. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticities.h +131 -0
  587. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp +87 -0
  588. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.h +73 -0
  589. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp +591 -0
  590. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.h +142 -0
  591. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompression.h +84 -0
  592. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp +78 -0
  593. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressionAttribute.h +64 -0
  594. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.cpp +226 -0
  595. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfCompressor.h +265 -0
  596. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.cpp +143 -0
  597. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfConvert.h +107 -0
  598. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp +110 -0
  599. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepCompositing.h +132 -0
  600. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp +230 -0
  601. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.h +339 -0
  602. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageState.h +96 -0
  603. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp +78 -0
  604. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h +68 -0
  605. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp +2025 -0
  606. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.h +276 -0
  607. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp +149 -0
  608. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.h +181 -0
  609. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp +1552 -0
  610. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h +244 -0
  611. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp +107 -0
  612. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.h +168 -0
  613. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp +1979 -0
  614. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.h +437 -0
  615. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp +273 -0
  616. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.h +362 -0
  617. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp +2055 -0
  618. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.h +475 -0
  619. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp +250 -0
  620. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.h +394 -0
  621. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp +57 -0
  622. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDoubleAttribute.h +59 -0
  623. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp +3424 -0
  624. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressor.h +210 -0
  625. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfDwaCompressorSimd.h +2145 -0
  626. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.cpp +335 -0
  627. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmap.h +336 -0
  628. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp +76 -0
  629. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfEnvmapAttribute.h +68 -0
  630. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfExport.h +46 -0
  631. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.cpp +768 -0
  632. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFastHuf.h +148 -0
  633. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp +57 -0
  634. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatAttribute.h +58 -0
  635. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp +84 -0
  636. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.h +76 -0
  637. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfForward.h +127 -0
  638. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp +228 -0
  639. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFrameBuffer.h +386 -0
  640. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp +76 -0
  641. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h +94 -0
  642. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp +76 -0
  643. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericInputFile.h +58 -0
  644. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp +112 -0
  645. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfGenericOutputFile.h +62 -0
  646. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.cpp +1283 -0
  647. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHeader.h +699 -0
  648. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.cpp +1114 -0
  649. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.h +82 -0
  650. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.cpp +110 -0
  651. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIO.h +255 -0
  652. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.cpp +895 -0
  653. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputFile.h +240 -0
  654. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.cpp +114 -0
  655. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPart.h +84 -0
  656. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.cpp +51 -0
  657. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputPartData.h +69 -0
  658. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInputStreamMutex.h +68 -0
  659. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfInt64.h +56 -0
  660. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.cpp +57 -0
  661. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfIntAttribute.h +58 -0
  662. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.cpp +217 -0
  663. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCode.h +167 -0
  664. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp +99 -0
  665. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.h +73 -0
  666. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrder.h +69 -0
  667. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp +78 -0
  668. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLineOrderAttribute.h +72 -0
  669. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.cpp +178 -0
  670. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfLut.h +188 -0
  671. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp +263 -0
  672. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMatrixAttribute.h +83 -0
  673. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.cpp +1872 -0
  674. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMisc.h +466 -0
  675. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +783 -0
  676. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartInputFile.h +128 -0
  677. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp +519 -0
  678. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.h +118 -0
  679. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.cpp +435 -0
  680. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfMultiView.h +187 -0
  681. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfName.h +150 -0
  682. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfNamespace.h +115 -0
  683. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp +126 -0
  684. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOpaqueAttribute.h +110 -0
  685. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOptimizedPixelReading.h +646 -0
  686. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.cpp +1378 -0
  687. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputFile.h +263 -0
  688. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.cpp +105 -0
  689. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPart.h +77 -0
  690. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.cpp +52 -0
  691. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputPartData.h +62 -0
  692. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfOutputStreamMutex.h +70 -0
  693. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartHelper.h +262 -0
  694. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.cpp +63 -0
  695. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPartType.h +62 -0
  696. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPixelType.h +67 -0
  697. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.cpp +667 -0
  698. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPizCompressor.h +117 -0
  699. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.cpp +104 -0
  700. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImage.h +135 -0
  701. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp +103 -0
  702. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.h +70 -0
  703. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp +553 -0
  704. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfPxr24Compressor.h +109 -0
  705. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.cpp +127 -0
  706. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRational.h +98 -0
  707. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp +74 -0
  708. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRationalAttribute.h +69 -0
  709. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgba.h +109 -0
  710. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.cpp +1405 -0
  711. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaFile.h +346 -0
  712. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.cpp +497 -0
  713. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRgbaYca.h +259 -0
  714. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.cpp +157 -0
  715. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRle.h +63 -0
  716. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.cpp +220 -0
  717. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfRleCompressor.h +80 -0
  718. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp +1702 -0
  719. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfScanLineInputFile.h +210 -0
  720. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSimd.h +59 -0
  721. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp +125 -0
  722. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.h +382 -0
  723. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.cpp +242 -0
  724. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStdIO.h +160 -0
  725. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.cpp +80 -0
  726. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringAttribute.h +71 -0
  727. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp +100 -0
  728. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfStringVectorAttribute.h +74 -0
  729. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp +129 -0
  730. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfSystemSpecific.h +172 -0
  731. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.cpp +216 -0
  732. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTestFile.h +97 -0
  733. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.cpp +62 -0
  734. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfThreading.h +95 -0
  735. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescription.h +107 -0
  736. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp +86 -0
  737. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.h +72 -0
  738. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.cpp +552 -0
  739. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTileOffsets.h +125 -0
  740. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp +1533 -0
  741. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputFile.h +401 -0
  742. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp +208 -0
  743. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledInputPart.h +100 -0
  744. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.cpp +389 -0
  745. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledMisc.h +106 -0
  746. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp +1841 -0
  747. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputFile.h +495 -0
  748. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp +228 -0
  749. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledOutputPart.h +105 -0
  750. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp +1163 -0
  751. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTiledRgbaFile.h +482 -0
  752. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.cpp +431 -0
  753. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCode.h +242 -0
  754. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp +79 -0
  755. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.h +74 -0
  756. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.cpp +217 -0
  757. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVecAttribute.h +100 -0
  758. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.cpp +60 -0
  759. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfVersion.h +136 -0
  760. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.cpp +391 -0
  761. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfWav.h +78 -0
  762. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfXdr.h +927 -0
  763. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.cpp +196 -0
  764. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZip.h +78 -0
  765. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.cpp +127 -0
  766. data/vendor/FreeImage/Source/OpenEXR/IlmImf/ImfZipCompressor.h +89 -0
  767. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.cpp +136 -0
  768. data/vendor/FreeImage/Source/OpenEXR/IlmImf/b44ExpLogTable.h +16396 -0
  769. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.cpp +573 -0
  770. data/vendor/FreeImage/Source/OpenEXR/IlmImf/dwaLookups.h +98334 -0
  771. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.cpp +80 -0
  772. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThread.h +143 -0
  773. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadExport.h +46 -0
  774. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadForward.h +52 -0
  775. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.cpp +59 -0
  776. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutex.h +160 -0
  777. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexPosix.cpp +85 -0
  778. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadMutexWin32.cpp +79 -0
  779. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadNamespace.h +114 -0
  780. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.cpp +483 -0
  781. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPool.h +160 -0
  782. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadPosix.cpp +98 -0
  783. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp +60 -0
  784. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphore.h +112 -0
  785. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosix.cpp +106 -0
  786. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphorePosixCompat.cpp +155 -0
  787. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadSemaphoreWin32.cpp +153 -0
  788. data/vendor/FreeImage/Source/OpenEXR/IlmThread/IlmThreadWin32.cpp +100 -0
  789. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.cpp +37 -0
  790. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBox.h +849 -0
  791. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathBoxAlgo.h +1016 -0
  792. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColor.h +736 -0
  793. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.cpp +178 -0
  794. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathColorAlgo.h +257 -0
  795. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathEuler.h +926 -0
  796. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExc.h +73 -0
  797. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathExport.h +46 -0
  798. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathForward.h +72 -0
  799. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrame.h +192 -0
  800. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustum.h +741 -0
  801. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFrustumTest.h +417 -0
  802. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.cpp +181 -0
  803. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathFun.h +269 -0
  804. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGL.h +166 -0
  805. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathGLU.h +54 -0
  806. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathHalfLimits.h +68 -0
  807. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInt64.h +62 -0
  808. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathInterval.h +226 -0
  809. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLimits.h +268 -0
  810. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLine.h +185 -0
  811. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathLineAlgo.h +288 -0
  812. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMath.h +208 -0
  813. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrix.h +3441 -0
  814. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.cpp +1252 -0
  815. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.h +1425 -0
  816. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathNamespace.h +115 -0
  817. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlane.h +257 -0
  818. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathPlatform.h +112 -0
  819. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathQuat.h +964 -0
  820. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.cpp +194 -0
  821. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRandom.h +401 -0
  822. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathRoots.h +219 -0
  823. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.cpp +54 -0
  824. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathShear.h +656 -0
  825. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathSphere.h +177 -0
  826. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.cpp +583 -0
  827. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVec.h +2227 -0
  828. data/vendor/FreeImage/Source/OpenEXR/Imath/ImathVecAlgo.h +147 -0
  829. data/vendor/FreeImage/Source/OpenEXR/OpenEXRConfig.h +72 -0
  830. data/vendor/FreeImage/Source/Plugin.h +144 -0
  831. data/vendor/FreeImage/Source/Quantizers.h +354 -0
  832. data/vendor/FreeImage/Source/ToneMapping.h +44 -0
  833. data/vendor/FreeImage/Source/Utilities.h +516 -0
  834. data/vendor/FreeImage/Source/ZLib/adler32.c +179 -0
  835. data/vendor/FreeImage/Source/ZLib/compress.c +80 -0
  836. data/vendor/FreeImage/Source/ZLib/crc32.c +425 -0
  837. data/vendor/FreeImage/Source/ZLib/crc32.h +441 -0
  838. data/vendor/FreeImage/Source/ZLib/deflate.c +1967 -0
  839. data/vendor/FreeImage/Source/ZLib/deflate.h +346 -0
  840. data/vendor/FreeImage/Source/ZLib/gzclose.c +25 -0
  841. data/vendor/FreeImage/Source/ZLib/gzguts.h +209 -0
  842. data/vendor/FreeImage/Source/ZLib/gzlib.c +634 -0
  843. data/vendor/FreeImage/Source/ZLib/gzread.c +594 -0
  844. data/vendor/FreeImage/Source/ZLib/gzwrite.c +577 -0
  845. data/vendor/FreeImage/Source/ZLib/infback.c +640 -0
  846. data/vendor/FreeImage/Source/ZLib/inffast.c +340 -0
  847. data/vendor/FreeImage/Source/ZLib/inffast.h +11 -0
  848. data/vendor/FreeImage/Source/ZLib/inffixed.h +94 -0
  849. data/vendor/FreeImage/Source/ZLib/inflate.c +1512 -0
  850. data/vendor/FreeImage/Source/ZLib/inflate.h +122 -0
  851. data/vendor/FreeImage/Source/ZLib/inftrees.c +306 -0
  852. data/vendor/FreeImage/Source/ZLib/inftrees.h +62 -0
  853. data/vendor/FreeImage/Source/ZLib/trees.c +1226 -0
  854. data/vendor/FreeImage/Source/ZLib/trees.h +128 -0
  855. data/vendor/FreeImage/Source/ZLib/uncompr.c +59 -0
  856. data/vendor/FreeImage/Source/ZLib/zconf.h +511 -0
  857. data/vendor/FreeImage/Source/ZLib/zlib.h +1768 -0
  858. data/vendor/FreeImage/Source/ZLib/zutil.c +324 -0
  859. data/vendor/FreeImage/Source/ZLib/zutil.h +253 -0
  860. metadata +931 -0
@@ -0,0 +1,1343 @@
1
+ // ==========================================================
2
+ // Apple Macintosh QuickDraw/PICT Loader
3
+ //
4
+ // Design and implementation by
5
+ // - Amir Ebrahimi (amir@unity3d.com)
6
+ //
7
+ // Based on PICT loading code from paintlib (http://www.paintlib.de/paintlib/).
8
+ //
9
+ // Paintlib License:
10
+ // The paintlib source code and all documentation are copyright (c) 1996-2002
11
+ // Ulrich von Zadow and other contributors.
12
+ //
13
+ // The paintlib source code is supplied "AS IS". Ulrich von Zadow and other
14
+ // contributors disclaim all warranties, expressed or implied, including, without
15
+ // limitation, the warranties of merchantability and of fitness for any purpose.
16
+ // The authors assume no liability for direct, indirect, incidental, special,
17
+ // exemplary, or consequential damages, which may result from the use of paintlib,
18
+ // even if advised of the possibility of such damage.
19
+ //
20
+ // Permission is hereby granted to use, copy, modify, and distribute this source
21
+ // code, or portions hereof, for any purpose, without fee, subject to the following
22
+ // restrictions:
23
+ //
24
+ // 1. The origin of this source code must not be misrepresented.
25
+ // 2. Altered versions must be plainly marked as such and must not be misrepresented
26
+ // as being the original source.
27
+ // 3. This Copyright notice may not be removed or altered from any source or altered
28
+ // source distribution.
29
+ // 4. Executables containing paintlib or parts of it must state that the software
30
+ // "contains paintlib code. paintlib is copyright (c) 1996-2002 Ulrich von Zadow
31
+ // and other contributors.". This notice must be displayed in at least one place
32
+ // where the copyright for the software itself is displayed. The documentation must
33
+ // also contain this notice.
34
+ //
35
+ // Bug fixes were made to the original code to support version 2 PICT files
36
+ // properly.
37
+ //
38
+ // Additional resources:
39
+ // http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw-458.html
40
+ // http://www.fileformat.info/format/macpict/egff.htm
41
+ //
42
+ // Notes (http://lists.apple.com/archives/java-dev/2006/Apr/msg00588.html):
43
+ // There are three main types of PICT files:
44
+ // - Version 1
45
+ // - Version 2
46
+ // - Extended Version 2
47
+ //
48
+ // Some things to look out for:
49
+ // - The bounds and target DPI are stored in a different place in all three.
50
+ // - Some of the values are fixed-point shorts ( short / 65536f )
51
+ // - Values are big endian
52
+ // - All of this may be *preceded* by a 512 byte header--sometimes it is
53
+ // there, and sometimes it isn't. You just have to check for the magic
54
+ // values in both places.
55
+ //
56
+ // This file is part of FreeImage 3
57
+ //
58
+ // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
59
+ // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
60
+ // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
61
+ // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
62
+ // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
63
+ // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
64
+ // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
65
+ // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
66
+ // THIS DISCLAIMER.
67
+ //
68
+ // Use at your own risk!
69
+ // ==========================================================
70
+
71
+ #include "FreeImage.h"
72
+ #include "Utilities.h"
73
+
74
+ // ==========================================================
75
+ // Plugin Interface
76
+ // ==========================================================
77
+ static int s_format_id;
78
+
79
+ static const int outputMessageSize = 256;
80
+
81
+ // ==========================================================
82
+ // Internal functions
83
+ // ==========================================================
84
+
85
+ static BYTE
86
+ Read8(FreeImageIO *io, fi_handle handle) {
87
+ BYTE i = 0;
88
+ io->read_proc(&i, 1, 1, handle);
89
+ return i;
90
+ }
91
+
92
+ static WORD
93
+ Read16(FreeImageIO *io, fi_handle handle) {
94
+ // reads a two-byte big-endian integer from the given file and returns its value.
95
+ // assumes unsigned.
96
+
97
+ unsigned hi = Read8(io, handle);
98
+ unsigned lo = Read8(io, handle);
99
+ return (WORD)(lo + (hi << 8));
100
+ }
101
+
102
+ static unsigned
103
+ Read32(FreeImageIO *io, fi_handle handle) {
104
+ // reads a four-byte big-endian integer from the given file and returns its value.
105
+ // assumes unsigned.
106
+
107
+ unsigned b3 = Read8(io, handle);
108
+ unsigned b2 = Read8(io, handle);
109
+ unsigned b1 = Read8(io, handle);
110
+ unsigned b0 = Read8(io, handle);
111
+ return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0;
112
+ }
113
+
114
+ // ----------------------------------------------------------
115
+
116
+ struct OpDef
117
+ {
118
+ const char * name;
119
+ int len;
120
+ const char * description;
121
+ };
122
+
123
+ // for reserved opcodes
124
+ #define res(length) { "reserved", (length), "reserved for Apple use" }
125
+ #define RGB_LEN 6
126
+ #define WORD_LEN -1
127
+ #define NA 0
128
+
129
+ static OpDef optable[] =
130
+ {
131
+ /* 0x00 */ { "NOP", 0, "nop" },
132
+ /* 0x01 */ { "Clip", NA, "clip" },
133
+ /* 0x02 */ { "BkPat", 8, "background pattern" },
134
+ /* 0x03 */ { "TxFont", 2, "text font (word)" },
135
+ /* 0x04 */ { "TxFace", 1, "text face (byte)" },
136
+ /* 0x05 */ { "TxMode", 2, "text mode (word)" },
137
+ /* 0x06 */ { "SpExtra", 4, "space extra (fixed point)" },
138
+ /* 0x07 */ { "PnSize", 4, "pen size (point)" },
139
+ /* 0x08 */ { "PnMode", 2, "pen mode (word)" },
140
+ /* 0x09 */ { "PnPat", 8, "pen pattern" },
141
+ /* 0x0a */ { "FillPat", 8, "fill pattern" },
142
+ /* 0x0b */ { "OvSize", 4, "oval size (point)" },
143
+ /* 0x0c */ { "Origin", 4, "dh, dv (word)" },
144
+ /* 0x0d */ { "TxSize", 2, "text size (word)" },
145
+ /* 0x0e */ { "FgColor", 4, "foreground color (longword)" },
146
+ /* 0x0f */ { "BkColor", 4, "background color (longword)" },
147
+ /* 0x10 */ { "TxRatio", 8, "numerator (point), denominator (point)" },
148
+ /* 0x11 */ { "Version", 1, "version (byte)" },
149
+ /* 0x12 */ { "BkPixPat", NA, "color background pattern" },
150
+ /* 0x13 */ { "PnPixPat", NA, "color pen pattern" },
151
+ /* 0x14 */ { "FillPixPat", NA, "color fill pattern" },
152
+ /* 0x15 */ { "PnLocHFrac", 2, "fractional pen position" },
153
+ /* 0x16 */ { "ChExtra", 2, "extra for each character" },
154
+ /* 0x17 */ res(0),
155
+ /* 0x18 */ res(0),
156
+ /* 0x19 */ res(0),
157
+ /* 0x1a */ { "RGBFgCol", RGB_LEN, "RGB foreColor" },
158
+ /* 0x1b */ { "RGBBkCol", RGB_LEN, "RGB backColor" },
159
+ /* 0x1c */ { "HiliteMode", 0, "hilite mode flag" },
160
+ /* 0x1d */ { "HiliteColor", RGB_LEN, "RGB hilite color" },
161
+ /* 0x1e */ { "DefHilite", 0, "Use default hilite color" },
162
+ /* 0x1f */ { "OpColor", 6, "RGB OpColor for arithmetic modes" },
163
+ /* 0x20 */ { "Line", 8, "pnLoc (point), newPt (point)" },
164
+ /* 0x21 */ { "LineFrom", 4, "newPt (point)" },
165
+ /* 0x22 */ { "ShortLine", 6, "pnLoc (point, dh, dv (-128 .. 127))" },
166
+ /* 0x23 */ { "ShortLineFrom", 2, "dh, dv (-128 .. 127)" },
167
+ /* 0x24 */ res(WORD_LEN),
168
+ /* 0x25 */ res(WORD_LEN),
169
+ /* 0x26 */ res(WORD_LEN),
170
+ /* 0x27 */ res(WORD_LEN),
171
+ /* 0x28 */ { "LongText", NA, "txLoc (point), count (0..255), text" },
172
+ /* 0x29 */ { "DHText", NA, "dh (0..255), count (0..255), text" },
173
+ /* 0x2a */ { "DVText", NA, "dv (0..255), count (0..255), text" },
174
+ /* 0x2b */ { "DHDVText", NA, "dh, dv (0..255), count (0..255), text" },
175
+ /* 0x2c */ res(WORD_LEN),
176
+ /* 0x2d */ res(WORD_LEN),
177
+ /* 0x2e */ res(WORD_LEN),
178
+ /* 0x2f */ res(WORD_LEN),
179
+ /* 0x30 */ { "frameRect", 8, "rect" },
180
+ /* 0x31 */ { "paintRect", 8, "rect" },
181
+ /* 0x32 */ { "eraseRect", 8, "rect" },
182
+ /* 0x33 */ { "invertRect", 8, "rect" },
183
+ /* 0x34 */ { "fillRect", 8, "rect" },
184
+ /* 0x35 */ res(8),
185
+ /* 0x36 */ res(8),
186
+ /* 0x37 */ res(8),
187
+ /* 0x38 */ { "frameSameRect", 0, "rect" },
188
+ /* 0x39 */ { "paintSameRect", 0, "rect" },
189
+ /* 0x3a */ { "eraseSameRect", 0, "rect" },
190
+ /* 0x3b */ { "invertSameRect", 0, "rect" },
191
+ /* 0x3c */ { "fillSameRect", 0, "rect" },
192
+ /* 0x3d */ res(0),
193
+ /* 0x3e */ res(0),
194
+ /* 0x3f */ res(0),
195
+ /* 0x40 */ { "frameRRect", 8, "rect" },
196
+ /* 0x41 */ { "paintRRect", 8, "rect" },
197
+ /* 0x42 */ { "eraseRRect", 8, "rect" },
198
+ /* 0x43 */ { "invertRRect", 8, "rect" },
199
+ /* 0x44 */ { "fillRRrect", 8, "rect" },
200
+ /* 0x45 */ res(8),
201
+ /* 0x46 */ res(8),
202
+ /* 0x47 */ res(8),
203
+ /* 0x48 */ { "frameSameRRect", 0, "rect" },
204
+ /* 0x49 */ { "paintSameRRect", 0, "rect" },
205
+ /* 0x4a */ { "eraseSameRRect", 0, "rect" },
206
+ /* 0x4b */ { "invertSameRRect", 0, "rect" },
207
+ /* 0x4c */ { "fillSameRRect", 0, "rect" },
208
+ /* 0x4d */ res(0),
209
+ /* 0x4e */ res(0),
210
+ /* 0x4f */ res(0),
211
+ /* 0x50 */ { "frameOval", 8, "rect" },
212
+ /* 0x51 */ { "paintOval", 8, "rect" },
213
+ /* 0x52 */ { "eraseOval", 8, "rect" },
214
+ /* 0x53 */ { "invertOval", 8, "rect" },
215
+ /* 0x54 */ { "fillOval", 8, "rect" },
216
+ /* 0x55 */ res(8),
217
+ /* 0x56 */ res(8),
218
+ /* 0x57 */ res(8),
219
+ /* 0x58 */ { "frameSameOval", 0, "rect" },
220
+ /* 0x59 */ { "paintSameOval", 0, "rect" },
221
+ /* 0x5a */ { "eraseSameOval", 0, "rect" },
222
+ /* 0x5b */ { "invertSameOval", 0, "rect" },
223
+ /* 0x5c */ { "fillSameOval", 0, "rect" },
224
+ /* 0x5d */ res(0),
225
+ /* 0x5e */ res(0),
226
+ /* 0x5f */ res(0),
227
+ /* 0x60 */ { "frameArc", 12, "rect, startAngle, arcAngle" },
228
+ /* 0x61 */ { "paintArc", 12, "rect, startAngle, arcAngle" },
229
+ /* 0x62 */ { "eraseArc", 12, "rect, startAngle, arcAngle" },
230
+ /* 0x63 */ { "invertArc", 12, "rect, startAngle, arcAngle" },
231
+ /* 0x64 */ { "fillArc", 12, "rect, startAngle, arcAngle" },
232
+ /* 0x65 */ res(12),
233
+ /* 0x66 */ res(12),
234
+ /* 0x67 */ res(12),
235
+ /* 0x68 */ { "frameSameArc", 4, "rect, startAngle, arcAngle" },
236
+ /* 0x69 */ { "paintSameArc", 4, "rect, startAngle, arcAngle" },
237
+ /* 0x6a */ { "eraseSameArc", 4, "rect, startAngle, arcAngle" },
238
+ /* 0x6b */ { "invertSameArc", 4, "rect, startAngle, arcAngle" },
239
+ /* 0x6c */ { "fillSameArc", 4, "rect, startAngle, arcAngle" },
240
+ /* 0x6d */ res(4),
241
+ /* 0x6e */ res(4),
242
+ /* 0x6f */ res(4),
243
+ /* 0x70 */ { "framePoly", NA, "poly" },
244
+ /* 0x71 */ { "paintPoly", NA, "poly" },
245
+ /* 0x72 */ { "erasePoly", NA, "poly" },
246
+ /* 0x73 */ { "invertPoly", NA, "poly" },
247
+ /* 0x74 */ { "fillPoly", NA, "poly" },
248
+ /* 0x75 */ res(NA),
249
+ /* 0x76 */ res(NA),
250
+ /* 0x77 */ res(NA),
251
+ /* 0x78 */ { "frameSamePoly", 0, "poly (NYI)" },
252
+ /* 0x79 */ { "paintSamePoly", 0, "poly (NYI)" },
253
+ /* 0x7a */ { "eraseSamePoly", 0, "poly (NYI)" },
254
+ /* 0x7b */ { "invertSamePoly", 0, "poly (NYI)" },
255
+ /* 0x7c */ { "fillSamePoly", 0, "poly (NYI)" },
256
+ /* 0x7d */ res(0),
257
+ /* 0x7e */ res(0),
258
+ /* 0x7f */ res(0),
259
+ /* 0x80 */ { "frameRgn", NA, "region" },
260
+ /* 0x81 */ { "paintRgn", NA, "region" },
261
+ /* 0x82 */ { "eraseRgn", NA, "region" },
262
+ /* 0x83 */ { "invertRgn", NA, "region" },
263
+ /* 0x84 */ { "fillRgn", NA, "region" },
264
+ /* 0x85 */ res(NA),
265
+ /* 0x86 */ res(NA),
266
+ /* 0x87 */ res(NA),
267
+ /* 0x88 */ { "frameSameRgn", 0, "region (NYI)" },
268
+ /* 0x89 */ { "paintSameRgn", 0, "region (NYI)" },
269
+ /* 0x8a */ { "eraseSameRgn", 0, "region (NYI)" },
270
+ /* 0x8b */ { "invertSameRgn", 0, "region (NYI)" },
271
+ /* 0x8c */ { "fillSameRgn", 0, "region (NYI)" },
272
+ /* 0x8d */ res(0),
273
+ /* 0x8e */ res(0),
274
+ /* 0x8f */ res(0),
275
+ /* 0x90 */ { "BitsRect", NA, "copybits, rect clipped" },
276
+ /* 0x91 */ { "BitsRgn", NA, "copybits, rgn clipped" },
277
+ /* 0x92 */ res(WORD_LEN),
278
+ /* 0x93 */ res(WORD_LEN),
279
+ /* 0x94 */ res(WORD_LEN),
280
+ /* 0x95 */ res(WORD_LEN),
281
+ /* 0x96 */ res(WORD_LEN),
282
+ /* 0x97 */ res(WORD_LEN),
283
+ /* 0x98 */ { "PackBitsRect", NA, "packed copybits, rect clipped" },
284
+ /* 0x99 */ { "PackBitsRgn", NA, "packed copybits, rgn clipped" },
285
+ /* 0x9a */ { "Opcode_9A", NA, "the mysterious opcode 9A" },
286
+ /* 0x9b */ res(WORD_LEN),
287
+ /* 0x9c */ res(WORD_LEN),
288
+ /* 0x9d */ res(WORD_LEN),
289
+ /* 0x9e */ res(WORD_LEN),
290
+ /* 0x9f */ res(WORD_LEN),
291
+ /* 0xa0 */ { "ShortComment", 2, "kind (word)" },
292
+ /* 0xa1 */ { "LongComment", NA, "kind (word), size (word), data" }
293
+ };
294
+
295
+ // ----------------------------------------------------------
296
+
297
+ struct MacRect
298
+ {
299
+ WORD top;
300
+ WORD left;
301
+ WORD bottom;
302
+ WORD right;
303
+ };
304
+
305
+ struct MacpixMap
306
+ {
307
+ // Ptr baseAddr // Not used in file.
308
+ // short rowBytes // read in seperatly.
309
+ struct MacRect Bounds;
310
+ WORD version;
311
+ WORD packType;
312
+ LONG packSize;
313
+ LONG hRes;
314
+ LONG vRes;
315
+ WORD pixelType;
316
+ WORD pixelSize;
317
+ WORD cmpCount;
318
+ WORD cmpSize;
319
+ LONG planeBytes;
320
+ LONG pmTable;
321
+ LONG pmReserved;
322
+ };
323
+
324
+ struct MacRGBColour
325
+ {
326
+ WORD red;
327
+ WORD green;
328
+ WORD blue;
329
+ };
330
+
331
+ struct MacPoint
332
+ {
333
+ WORD x;
334
+ WORD y;
335
+ };
336
+
337
+ struct MacPattern // Klaube
338
+ {
339
+ BYTE pix[64];
340
+ };
341
+
342
+ // ----------------------------------------------------------
343
+
344
+ static void
345
+ ReadRect( FreeImageIO *io, fi_handle handle, MacRect* rect ) {
346
+ rect->top = Read16( io, handle );
347
+ rect->left = Read16( io, handle );
348
+ rect->bottom = Read16( io, handle );
349
+ rect->right = Read16( io, handle );
350
+ }
351
+
352
+ static void
353
+ ReadPixmap( FreeImageIO *io, fi_handle handle, MacpixMap* pPixMap ) {
354
+ pPixMap->version = Read16( io, handle );
355
+ pPixMap->packType = Read16( io, handle );
356
+ pPixMap->packSize = Read32( io, handle );
357
+ pPixMap->hRes = Read16( io, handle );
358
+ Read16( io, handle );
359
+ pPixMap->vRes = Read16( io, handle );
360
+ Read16( io, handle );
361
+ pPixMap->pixelType = Read16( io, handle );
362
+ pPixMap->pixelSize = Read16( io, handle );
363
+ pPixMap->cmpCount = Read16( io, handle );
364
+ pPixMap->cmpSize = Read16( io, handle );
365
+ pPixMap->planeBytes = Read32( io, handle );
366
+ pPixMap->pmTable = Read32( io, handle );
367
+ pPixMap->pmReserved = Read32( io, handle );
368
+ }
369
+
370
+ /**
371
+ Reads a mac color table into a bitmap palette.
372
+ */
373
+ static void
374
+ ReadColorTable( FreeImageIO *io, fi_handle handle, WORD* pNumColors, RGBQUAD* pPal ) {
375
+ LONG ctSeed;
376
+ WORD ctFlags;
377
+ WORD val;
378
+ int i;
379
+
380
+ ctSeed = Read32( io, handle );
381
+ ctFlags = Read16( io, handle );
382
+ WORD numColors = Read16( io, handle )+1;
383
+ *pNumColors = numColors;
384
+
385
+ for (i = 0; i < numColors; i++) {
386
+ val = Read16( io, handle );
387
+ if (ctFlags & 0x8000) {
388
+ // The indicies in a device colour table are bogus and
389
+ // usually == 0, so I assume we allocate up the list of
390
+ // colours in order.
391
+ val = (WORD)i;
392
+ }
393
+ if (val >= numColors) {
394
+ throw "pixel value greater than color table size.";
395
+ }
396
+ // Mac colour tables contain 16-bit values for R, G, and B...
397
+ pPal[val].rgbRed = ((BYTE) (((WORD) (Read16( io, handle )) >> 8) & 0xFF));
398
+ pPal[val].rgbGreen = ((BYTE) (((WORD) (Read16( io, handle )) >> 8) & 0xFF));
399
+ pPal[val].rgbBlue = ((BYTE) (((WORD) (Read16( io, handle )) >> 8) & 0xFF));
400
+ }
401
+ }
402
+
403
+ /**
404
+ skips unneeded packbits.
405
+ pixelSize == Source bits per pixel.
406
+ */
407
+ static void
408
+ SkipBits( FreeImageIO *io, fi_handle handle, MacRect* bounds, WORD rowBytes, int pixelSize ) {
409
+ int i;
410
+ WORD pixwidth; // bytes per row when uncompressed.
411
+
412
+ int height = bounds->bottom - bounds->top;
413
+ int width = bounds->right - bounds->left;
414
+
415
+ // High bit of rowBytes is flag.
416
+ if (pixelSize <= 8) {
417
+ rowBytes &= 0x7fff;
418
+ }
419
+ pixwidth = (WORD)width;
420
+
421
+ if (pixelSize == 16) {
422
+ pixwidth *= 2;
423
+ }
424
+ if (rowBytes == 0) {
425
+ rowBytes = pixwidth;
426
+ }
427
+ if (rowBytes < 8) {
428
+ io->seek_proc( handle, rowBytes*height, SEEK_CUR );
429
+ }
430
+ else {
431
+ for (i = 0; i < height; i++) {
432
+ int lineLen; // length of source line in bytes.
433
+ if (rowBytes > 250) {
434
+ lineLen = Read16( io, handle );
435
+ } else {
436
+ lineLen = Read8( io, handle );
437
+ }
438
+ io->seek_proc( handle, lineLen, SEEK_CUR );
439
+ }
440
+ }
441
+ }
442
+
443
+ /**
444
+ Skip polygon or region
445
+ */
446
+ static void
447
+ SkipPolyOrRegion( FreeImageIO *io, fi_handle handle ) {
448
+ WORD len = Read16( io, handle ) - 2;
449
+ io->seek_proc(handle, len, SEEK_CUR);
450
+ }
451
+
452
+ /**
453
+ Width in bytes for 8 bpp or less.
454
+ Width in pixels for 16 bpp.
455
+ Expands Width units to 32-bit pixel data.
456
+ */
457
+ static void
458
+ expandBuf( FreeImageIO *io, fi_handle handle, int width, int bpp, BYTE* dst ) {
459
+ switch (bpp) {
460
+ case 16:
461
+ for ( int i=0; i<width; i++) {
462
+ WORD src = Read16( io, handle );
463
+ dst[ FI_RGBA_BLUE ] = (src & 31)*8; // Blue
464
+ dst[ FI_RGBA_GREEN ] = ((src >> 5) & 31)*8; // Green
465
+ dst[ FI_RGBA_RED ] = ((src >> 10) & 31)*8; // Red
466
+ dst[ FI_RGBA_ALPHA ] = 0xFF; // Alpha
467
+ dst += 4;
468
+ }
469
+ break;
470
+ default:
471
+ throw "Bad bits per pixel in expandBuf.";
472
+ }
473
+ }
474
+
475
+ /**
476
+ Expands Width units to 8-bit pixel data.
477
+ Max. 8 bpp source format.
478
+ */
479
+ static void
480
+ expandBuf8( FreeImageIO *io, fi_handle handle, int width, int bpp, BYTE* dst )
481
+ {
482
+ switch (bpp) {
483
+ case 8:
484
+ io->read_proc( dst, width, 1, handle );
485
+ break;
486
+ case 4:
487
+ for (int i = 0; i < width; i++) {
488
+ WORD src = Read8( io, handle );
489
+ *dst = (src >> 4) & 15;
490
+ *(dst+1) = (src & 15);
491
+ dst += 2;
492
+ }
493
+ if (width & 1) { // Odd Width?
494
+ WORD src = Read8( io, handle );
495
+ *dst = (src >> 4) & 15;
496
+ dst++;
497
+ }
498
+ break;
499
+ case 2:
500
+ for (int i = 0; i < width; i++) {
501
+ WORD src = Read8( io, handle );
502
+ *dst = (src >> 6) & 3;
503
+ *(dst+1) = (src >> 4) & 3;
504
+ *(dst+2) = (src >> 2) & 3;
505
+ *(dst+3) = (src & 3);
506
+ dst += 4;
507
+ }
508
+ if (width & 3) { // Check for leftover pixels
509
+ for (int i = 6; i > 8 - (width & 3) * 2; i -= 2) {
510
+ WORD src = Read8( io, handle );
511
+ *dst = (src >> i) & 3;
512
+ dst++;
513
+ }
514
+ }
515
+ break;
516
+ case 1:
517
+ for (int i = 0; i < width; i++) {
518
+ WORD src = Read8( io, handle );
519
+ *dst = (src >> 7) & 1;
520
+ *(dst+1) = (src >> 6) & 1;
521
+ *(dst+2) = (src >> 5) & 1;
522
+ *(dst+3) = (src >> 4) & 1;
523
+ *(dst+4) = (src >> 3) & 1;
524
+ *(dst+5) = (src >> 2) & 1;
525
+ *(dst+6) = (src >> 1) & 1;
526
+ *(dst+7) = (src & 1);
527
+ dst += 8;
528
+ }
529
+ if (width & 7) { // Check for leftover pixels
530
+ for (int i = 7; i > (8-width & 7); i--) {
531
+ WORD src = Read8( io, handle );
532
+ *dst = (src >> i) & 1;
533
+ dst++;
534
+ }
535
+ }
536
+ break;
537
+ default:
538
+ throw "Bad bits per pixel in expandBuf8.";
539
+ }
540
+ }
541
+
542
+ static BYTE*
543
+ UnpackPictRow( FreeImageIO *io, fi_handle handle, BYTE* pLineBuf, int width, int rowBytes, int srcBytes ) {
544
+
545
+ if (rowBytes < 8) { // Ah-ha! The bits aren't actually packed. This will be easy.
546
+ io->read_proc( pLineBuf, rowBytes, 1, handle );
547
+ }
548
+ else {
549
+ BYTE* pCurPixel = pLineBuf;
550
+
551
+ // Unpack RLE. The data is packed bytewise.
552
+ for (int j = 0; j < srcBytes; ) {
553
+ BYTE FlagCounter = Read8( io, handle );
554
+ if (FlagCounter & 0x80) {
555
+ if (FlagCounter == 0x80) {
556
+ // Special case: repeat value of 0.
557
+ // Apple says ignore.
558
+ j++;
559
+ } else {
560
+ // Packed data.
561
+ int len = ((FlagCounter ^ 255) & 255) + 2;
562
+ BYTE p = Read8( io, handle );
563
+ memset( pCurPixel, p, len);
564
+ pCurPixel += len;
565
+ j += 2;
566
+ }
567
+ }
568
+ else {
569
+ // Unpacked data
570
+ int len = (FlagCounter & 255) + 1;
571
+ io->read_proc( pCurPixel, len, 1, handle );
572
+ pCurPixel += len;
573
+ j += len + 1;
574
+ }
575
+ }
576
+ }
577
+
578
+ return pLineBuf;
579
+ }
580
+
581
+ /**
582
+ This routine decompresses BitsRects with a packType of 4 (and 32 bits per pixel).
583
+ In this format, each line is separated into 8-bit-bitplanes and then compressed via RLE.
584
+ To decode, the routine decompresses each line & then juggles the bytes around to get pixel-oriented data.
585
+ NumBitPlanes == 3 if RGB, 4 if RGBA
586
+ */
587
+ static void
588
+ Unpack32Bits( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, MacRect* bounds, WORD rowBytes, int numPlanes ) {
589
+ int height = bounds->bottom - bounds->top;
590
+ int width = bounds->right - bounds->left;
591
+
592
+ if (rowBytes == 0) {
593
+ rowBytes = (WORD)( width * 4 );
594
+ }
595
+
596
+ BYTE* pLineBuf = (BYTE*)malloc( rowBytes ); // Let's allocate enough for 4 bit planes
597
+ if ( pLineBuf ) {
598
+ try {
599
+ for ( int i = 0; i < height; i++ ) {
600
+ // for each line do...
601
+ int linelen; // length of source line in bytes.
602
+ if (rowBytes > 250) {
603
+ linelen = Read16( io, handle );
604
+ } else {
605
+ linelen = Read8( io, handle);
606
+ }
607
+
608
+ BYTE* pBuf = UnpackPictRow( io, handle, pLineBuf, width, rowBytes, linelen );
609
+
610
+ // Convert plane-oriented data into pixel-oriented data &
611
+ // copy into destination bitmap.
612
+ BYTE* dst = (BYTE*)FreeImage_GetScanLine( dib, height - 1 - i);
613
+
614
+ if ( numPlanes == 3 ) {
615
+ for ( int j = 0; j < width; j++ ) {
616
+ // For each pixel in line...
617
+ dst[ FI_RGBA_BLUE ] = (*(pBuf+width*2)); // Blue
618
+ dst[ FI_RGBA_GREEN ] = (*(pBuf+width)); // Green
619
+ dst[ FI_RGBA_RED ] = (*pBuf); // Red
620
+ dst[ FI_RGBA_ALPHA ] = (0xFF);
621
+ dst += 4;
622
+ pBuf++;
623
+ }
624
+ } else {
625
+ for ( int j = 0; j < width; j++ ) {
626
+ // For each pixel in line...
627
+ dst[ FI_RGBA_BLUE ] = (*(pBuf+width*3)); // Blue
628
+ dst[ FI_RGBA_GREEN ] = (*(pBuf+width*2)); // Green
629
+ dst[ FI_RGBA_RED ] = (*(pBuf+width)); // Red
630
+ dst[ FI_RGBA_ALPHA ] = (*pBuf);
631
+ dst += 4;
632
+ pBuf++;
633
+ }
634
+ }
635
+ }
636
+ }
637
+ catch( ... ) {
638
+ free( pLineBuf );
639
+ throw;
640
+ }
641
+ }
642
+ free( pLineBuf );
643
+ }
644
+
645
+ /**
646
+ Decompression routine for 8 bpp.
647
+ rowBytes is the number of bytes each source row would take if it were uncompressed.
648
+ This _isn't_ equal to the number of pixels in the row - it seems apple pads the data to a word boundary and then compresses it.
649
+ Of course, we have to decompress the excess data and then throw it away.
650
+ */
651
+ static void
652
+ Unpack8Bits( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, MacRect* bounds, WORD rowBytes ) {
653
+ int height = bounds->bottom - bounds->top;
654
+ int width = bounds->right - bounds->left;
655
+
656
+ // High bit of rowBytes is flag.
657
+ rowBytes &= 0x7fff;
658
+
659
+ if (rowBytes == 0) {
660
+ rowBytes = (WORD)width;
661
+ }
662
+
663
+ for ( int i = 0; i < height; i++ ) {
664
+ int linelen; // length of source line in bytes.
665
+ if (rowBytes > 250) {
666
+ linelen = Read16( io, handle );
667
+ } else {
668
+ linelen = Read8( io, handle );
669
+ }
670
+ BYTE* dst = (BYTE*)FreeImage_GetScanLine( dib, height - 1 - i);
671
+ dst = UnpackPictRow( io, handle, dst, width, rowBytes, linelen );
672
+ }
673
+ }
674
+
675
+ /**
676
+ Decompression routine for everything but 8 & 32 bpp.
677
+ This routine is slower than the two routines above since it has to deal with a lot of special cases :-(.
678
+ It's also a bit chaotic because of these special cases...
679
+ unpack8bits is basically a dumber version of unpackbits.
680
+ pixelSize == Source bits per pixel.
681
+ */
682
+ static void
683
+ UnpackBits( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, MacRect* bounds, WORD rowBytes, int pixelSize ) {
684
+ WORD pixwidth; // bytes per row when uncompressed.
685
+ int pkpixsize;
686
+ int PixelPerRLEUnit;
687
+
688
+ char outputMessage[ outputMessageSize ] = "";
689
+
690
+ int height = bounds->bottom - bounds->top;
691
+ int width = bounds->right - bounds->left;
692
+
693
+ // High bit of rowBytes is flag.
694
+ if (pixelSize <= 8) {
695
+ rowBytes &= 0x7fff;
696
+ }
697
+
698
+ pixwidth = (WORD)width;
699
+ pkpixsize = 1; // RLE unit: one byte for everything...
700
+ if (pixelSize == 16) { // ...except 16 bpp.
701
+ pkpixsize = 2;
702
+ pixwidth *= 2;
703
+ }
704
+
705
+ if (rowBytes == 0) {
706
+ rowBytes = pixwidth;
707
+ }
708
+
709
+ {
710
+ // I allocate the temporary line buffer here. I allocate too
711
+ // much memory to compensate for sloppy (& hence fast) decompression.
712
+ switch (pixelSize) {
713
+ case 1:
714
+ PixelPerRLEUnit = 8;
715
+ break;
716
+ case 2:
717
+ PixelPerRLEUnit = 4;
718
+ break;
719
+ case 4:
720
+ PixelPerRLEUnit = 2;
721
+ break;
722
+ case 8:
723
+ PixelPerRLEUnit = 1;
724
+ break;
725
+ case 16:
726
+ PixelPerRLEUnit = 1;
727
+ break;
728
+ default:
729
+ sprintf( outputMessage, "Illegal bpp value in unpackbits: %d\n", pixelSize );
730
+ throw outputMessage;
731
+ }
732
+
733
+ if (rowBytes < 8) {
734
+ // ah-ha! The bits aren't actually packed. This will be easy.
735
+ for ( int i = 0; i < height; i++ ) {
736
+ BYTE* dst = (BYTE*)FreeImage_GetScanLine( dib, height - 1 - i);
737
+ if (pixelSize == 16) {
738
+ expandBuf( io, handle, width, pixelSize, dst );
739
+ } else {
740
+ expandBuf8( io, handle, width, pixelSize, dst );
741
+ }
742
+ }
743
+ }
744
+ else {
745
+ for ( int i = 0; i < height; i++ ) {
746
+ // For each line do...
747
+ int linelen; // length of source line in bytes.
748
+ if (rowBytes > 250) {
749
+ linelen = Read16( io, handle );
750
+ } else {
751
+ linelen = Read8( io, handle );
752
+ }
753
+
754
+ BYTE* dst = (BYTE*)FreeImage_GetScanLine( dib, height - 1 - i);
755
+ BYTE FlagCounter;
756
+
757
+ // Unpack RLE. The data is packed bytewise - except for
758
+ // 16 bpp data, which is packed per pixel :-(.
759
+ for ( int j = 0; j < linelen; ) {
760
+ FlagCounter = Read8( io, handle );
761
+ if (FlagCounter & 0x80) {
762
+ if (FlagCounter == 0x80) {
763
+ // Special case: repeat value of 0.
764
+ // Apple says ignore.
765
+ j++;
766
+ }
767
+ else {
768
+ // Packed data.
769
+ int len = ((FlagCounter ^ 255) & 255) + 2;
770
+
771
+ // This is slow for some formats...
772
+ if (pixelSize == 16) {
773
+ expandBuf( io, handle, 1, pixelSize, dst );
774
+ for ( int k = 1; k < len; k++ ) {
775
+ // Repeat the pixel len times.
776
+ memcpy( dst+(k*4*PixelPerRLEUnit), dst, 4*PixelPerRLEUnit);
777
+ }
778
+ dst += len*4*PixelPerRLEUnit;
779
+ }
780
+ else {
781
+ expandBuf8( io, handle, 1, pixelSize, dst );
782
+ for ( int k = 1; k < len; k++ ) {
783
+ // Repeat the expanded byte len times.
784
+ memcpy( dst+(k*PixelPerRLEUnit), dst, PixelPerRLEUnit);
785
+ }
786
+ dst += len*PixelPerRLEUnit;
787
+ }
788
+ j += pkpixsize + 1;
789
+ }
790
+ }
791
+ else {
792
+ // Unpacked data
793
+ int len = (FlagCounter & 255) + 1;
794
+ if (pixelSize == 16) {
795
+ expandBuf( io, handle, len, pixelSize, dst );
796
+ dst += len*4*PixelPerRLEUnit;
797
+ }
798
+ else {
799
+ expandBuf8( io, handle, len, pixelSize, dst );
800
+ dst += len*PixelPerRLEUnit;
801
+ }
802
+ j += ( len * pkpixsize ) + 1;
803
+ }
804
+ }
805
+ }
806
+ }
807
+ }
808
+ }
809
+
810
+ static void
811
+ DecodeOp9a( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, MacpixMap* pixMap ) {
812
+ // Do the actual unpacking.
813
+ switch ( pixMap->pixelSize ) {
814
+ case 32:
815
+ Unpack32Bits( io, handle, dib, &pixMap->Bounds, 0, pixMap->cmpCount );
816
+ break;
817
+ case 8:
818
+ Unpack8Bits( io, handle, dib, &pixMap->Bounds, 0 );
819
+ break;
820
+ default:
821
+ UnpackBits( io, handle, dib, &pixMap->Bounds, 0, pixMap->pixelSize );
822
+ }
823
+ }
824
+
825
+ static void
826
+ DecodeBitmap( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, BOOL isRegion, MacRect* bounds, WORD rowBytes ) {
827
+ WORD mode = Read16( io, handle );
828
+
829
+ if ( isRegion ) {
830
+ SkipPolyOrRegion( io, handle );
831
+ }
832
+
833
+ RGBQUAD* pal = FreeImage_GetPalette( dib );
834
+ if ( !pal ) {
835
+ throw "No palette for bitmap!";
836
+ }
837
+
838
+ for (int i = 0; i < 2; i++) {
839
+ unsigned char val = i ? 0xFF : 0x0;
840
+ pal[i].rgbRed = val;
841
+ pal[i].rgbGreen = val;
842
+ pal[i].rgbBlue = val;
843
+ }
844
+
845
+ UnpackBits( io, handle, dib, bounds, rowBytes, 1 );
846
+ }
847
+
848
+ static void
849
+ DecodePixmap( FreeImageIO *io, fi_handle handle, FIBITMAP* dib, BOOL isRegion, MacpixMap* pixMap, WORD rowBytes ) {
850
+ // Read mac colour table into windows palette.
851
+ WORD numColors; // Palette size.
852
+ RGBQUAD ct[256];
853
+
854
+ ReadColorTable( io, handle, &numColors, ct );
855
+ if ( FreeImage_GetBPP( dib ) == 8 ) {
856
+ RGBQUAD* pal = FreeImage_GetPalette( dib );
857
+ if ( !pal ) {
858
+ throw "No palette for bitmap!";
859
+ }
860
+
861
+ for (int i = 0; i < numColors; i++) {
862
+ pal[i].rgbRed = ct[ i ].rgbRed;
863
+ pal[i].rgbGreen = ct[ i ].rgbGreen;
864
+ pal[i].rgbBlue = ct[ i ].rgbBlue;
865
+ }
866
+ }
867
+
868
+ // Ignore source & destination rectangle as well as transfer mode.
869
+ MacRect tempRect;
870
+ ReadRect( io, handle, &tempRect );
871
+ ReadRect( io, handle, &tempRect );
872
+ WORD mode = Read16( io, handle );
873
+
874
+ if ( isRegion) {
875
+ SkipPolyOrRegion( io, handle );
876
+ }
877
+
878
+ switch ( pixMap->pixelSize ) {
879
+ case 32:
880
+ Unpack32Bits( io, handle, dib, &pixMap->Bounds, rowBytes, pixMap->cmpCount );
881
+ break;
882
+ case 8:
883
+ Unpack8Bits( io, handle, dib, &pixMap->Bounds, rowBytes );
884
+ break;
885
+ default:
886
+ UnpackBits( io, handle, dib, &pixMap->Bounds, rowBytes, pixMap->pixelSize );
887
+ }
888
+ }
889
+
890
+ // ==========================================================
891
+ // Plugin Implementation
892
+ // ==========================================================
893
+
894
+ static const char * DLL_CALLCONV
895
+ Format() {
896
+ return "PICT";
897
+ }
898
+
899
+ static const char * DLL_CALLCONV
900
+ Description() {
901
+ return "Macintosh PICT";
902
+ }
903
+
904
+ static const char * DLL_CALLCONV
905
+ Extension() {
906
+ return "pct,pict,pic";
907
+ }
908
+
909
+ static const char * DLL_CALLCONV
910
+ MimeType() {
911
+ return "image/x-pict";
912
+ }
913
+
914
+ static BOOL DLL_CALLCONV
915
+ Validate(FreeImageIO *io, fi_handle handle) {
916
+ if(io->seek_proc(handle, 522, SEEK_SET) == 0) {
917
+ BYTE pict_signature[] = { 0x00, 0x11, 0x02, 0xFF, 0x0C, 0X00 };
918
+ BYTE signature[6];
919
+
920
+ if(io->read_proc(signature, 1, sizeof(pict_signature), handle)) {
921
+ // v1.0 files have 0x11 (version operator) followed by 0x01 (version number)
922
+ // v2.0 files have 0x0011 (version operator) followed by 0x02ff (version number)
923
+ // and additionally 0x0c00 as a header opcode
924
+ // Currently, we are only supporting v2.0
925
+ return (memcmp(pict_signature, signature, sizeof(pict_signature)) == 0);
926
+ } else {
927
+ return FALSE;
928
+ }
929
+ }
930
+
931
+ return FALSE;
932
+ }
933
+
934
+ static BOOL DLL_CALLCONV
935
+ SupportsExportDepth(int depth) {
936
+ return FALSE;
937
+ }
938
+
939
+ static BOOL DLL_CALLCONV
940
+ SupportsExportType(FREE_IMAGE_TYPE type) {
941
+ return FALSE;
942
+ }
943
+
944
+ static BOOL DLL_CALLCONV
945
+ SupportsICCProfiles() {
946
+ return FALSE;
947
+ }
948
+
949
+ /**
950
+ This plugin decodes macintosh PICT files with 1,2,4,8,16 and 32 bits per pixel as well as PICT/JPEG.
951
+ If an alpha channel is present in a 32-bit-PICT, it is decoded as well.
952
+ The PICT format is a general picture file format and can contain a lot of other elements besides bitmaps.
953
+ These elements are ignored.
954
+ */
955
+ static FIBITMAP * DLL_CALLCONV
956
+ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
957
+ char outputMessage[ outputMessageSize ] = "";
958
+ FIBITMAP* dib = NULL;
959
+ try {
960
+ // Skip empty 512 byte header.
961
+ if ( !io->seek_proc(handle, 512, SEEK_CUR) == 0 )
962
+ return NULL;
963
+
964
+ // Read PICT header
965
+ Read16( io, handle ); // Skip version 1 picture size
966
+
967
+ MacRect frame;
968
+ ReadRect( io, handle, &frame );
969
+
970
+ BYTE b = 0;
971
+ while ((b = Read8(io, handle)) == 0);
972
+ if ( b != 0x11 ) {
973
+ throw "invalid header: version number missing.";
974
+ }
975
+
976
+ int version = Read8( io, handle );
977
+ if ( version == 2 && Read8( io, handle ) != 0xff ) {
978
+ throw "invalid header: illegal version number.";
979
+ }
980
+
981
+ enum PICTType {none, op9a, jpeg, pixmap, bitmap};
982
+ PICTType pictType = none;
983
+
984
+ MacRect bounds;
985
+ MacpixMap pixMap;
986
+ int hRes = 0x480000; // in pixels/inch (72 by default == 0x480000 in fixed point)
987
+ int vRes = 0x480000; // in pixels/inch (72 by default == 0x480000 in fixed point)
988
+ WORD rowBytes = 0;
989
+ BOOL isRegion = FALSE;
990
+ BOOL done = FALSE;
991
+ long currentPos = 0;
992
+
993
+ while ( !done ) {
994
+ WORD opcode = 0;
995
+
996
+ // get the current stream position (used to avoid infinite loops)
997
+ currentPos = io->tell_proc(handle);
998
+
999
+ if ((version == 1) || ((io->tell_proc( handle ) % 2) != 0)) {
1000
+ // align to word for version 2
1001
+ opcode = Read8( io, handle );
1002
+ }
1003
+ if (version == 2) {
1004
+ opcode = Read16( io, handle );
1005
+ }
1006
+
1007
+ if (opcode == 0xFF || opcode == 0xFFFF) {
1008
+ done = TRUE;
1009
+ throw "PICT contained only vector data!";
1010
+ }
1011
+ else if (opcode < 0xa2) {
1012
+ switch (opcode) {
1013
+ case 0x01:
1014
+ {
1015
+ // skip clipping rectangle
1016
+ MacRect clipRect;
1017
+ WORD len = Read16( io, handle );
1018
+
1019
+ if (len == 0x000a) {
1020
+ /* null rgn */
1021
+ ReadRect( io, handle, &clipRect );
1022
+ } else {
1023
+ io->seek_proc(handle, len - 2, SEEK_CUR);
1024
+ }
1025
+ break;
1026
+ }
1027
+ case 0x12:
1028
+ case 0x13:
1029
+ case 0x14:
1030
+ {
1031
+ // skip pattern definition
1032
+ WORD patType;
1033
+ WORD rowBytes;
1034
+ MacpixMap p;
1035
+ WORD numColors;
1036
+
1037
+ patType = Read16( io, handle );
1038
+
1039
+ switch( patType ) {
1040
+ case 2:
1041
+ io->seek_proc(handle, 8, SEEK_CUR);
1042
+ io->seek_proc(handle, 5, SEEK_CUR);
1043
+ break;
1044
+ case 1:
1045
+ {
1046
+ io->seek_proc(handle, 8, SEEK_CUR);
1047
+ rowBytes = Read16( io, handle );
1048
+ ReadRect( io, handle, &p.Bounds );
1049
+ ReadPixmap( io, handle, &p);
1050
+
1051
+ RGBQUAD ct[256];
1052
+ ReadColorTable(io, handle, &numColors, ct );
1053
+ SkipBits( io, handle, &p.Bounds, rowBytes, p.pixelSize );
1054
+ break;
1055
+ }
1056
+ default:
1057
+ throw "Unknown pattern type.";
1058
+ }
1059
+
1060
+ break;
1061
+ }
1062
+ case 0x70:
1063
+ case 0x71:
1064
+ case 0x72:
1065
+ case 0x73:
1066
+ case 0x74:
1067
+ case 0x75:
1068
+ case 0x76:
1069
+ case 0x77:
1070
+ {
1071
+ SkipPolyOrRegion( io, handle );
1072
+ break;
1073
+ }
1074
+ case 0x90:
1075
+ case 0x98:
1076
+ {
1077
+ // Bitmap/pixmap data clipped by a rectangle.
1078
+ rowBytes = Read16( io, handle ); // Bytes per row in source when uncompressed.
1079
+ isRegion = FALSE;
1080
+
1081
+ if ( rowBytes & 0x8000) {
1082
+ pictType = pixmap;
1083
+ } else {
1084
+ pictType = bitmap;
1085
+ }
1086
+ done = TRUE;
1087
+ break;
1088
+ }
1089
+ case 0x91:
1090
+ case 0x99:
1091
+ {
1092
+ // Bitmap/pixmap data clipped by a region.
1093
+ rowBytes = Read16( io, handle ); // Bytes per row in source when uncompressed.
1094
+ isRegion = TRUE;
1095
+
1096
+ if ( rowBytes & 0x8000) {
1097
+ pictType = pixmap;
1098
+ } else {
1099
+ pictType = bitmap;
1100
+ }
1101
+ done = TRUE;
1102
+ break;
1103
+ }
1104
+ case 0x9a:
1105
+ {
1106
+ // DirectBitsRect.
1107
+ Read32( io, handle ); // Skip fake len and fake EOF.
1108
+ Read16( io, handle ); // bogus row bytes.
1109
+
1110
+ // Read in the PixMap fields.
1111
+ ReadRect( io, handle, &pixMap.Bounds );
1112
+ ReadPixmap( io, handle, &pixMap );
1113
+
1114
+ // Ignore source & destination rectangle as well as transfer mode.
1115
+ MacRect dummy;
1116
+ ReadRect( io, handle, &dummy );
1117
+ ReadRect( io, handle, &dummy );
1118
+ WORD mode = Read16( io, handle );
1119
+
1120
+ pictType=op9a;
1121
+ done = TRUE;
1122
+ break;
1123
+ }
1124
+ case 0xa1:
1125
+ {
1126
+ // long comment
1127
+ WORD type;
1128
+ WORD len;
1129
+
1130
+ type = Read16( io, handle );
1131
+ len = Read16( io, handle);
1132
+ if (len > 0) {
1133
+ io->seek_proc(handle, len, SEEK_CUR);
1134
+ }
1135
+ break;
1136
+ }
1137
+ default:
1138
+ // No function => skip to next opcode
1139
+ if (optable[opcode].len == WORD_LEN) {
1140
+ WORD len = Read16( io, handle );
1141
+ io->seek_proc(handle, len, SEEK_CUR);
1142
+ } else {
1143
+ io->seek_proc(handle, optable[opcode].len, SEEK_CUR);
1144
+ }
1145
+ break;
1146
+ }
1147
+ }
1148
+ else if (opcode == 0xc00) {
1149
+ // version 2 header (26 bytes)
1150
+ WORD minorVersion = Read16( io, handle ); // always FFFE (-2) for extended version 2
1151
+ Read16( io, handle ); // reserved
1152
+ hRes = Read32( io, handle ); // original horizontal resolution in pixels/inch
1153
+ vRes = Read32( io, handle ); // original horizontal resolution in pixels/inch
1154
+ MacRect dummy;
1155
+ ReadRect( io, handle, &dummy ); // frame bounds at original resolution
1156
+ Read32( io, handle ); // reserved
1157
+ }
1158
+ else if (opcode == 0x8200) {
1159
+ // jpeg
1160
+ long opLen = Read32( io, handle );
1161
+ BOOL found = FALSE;
1162
+ int i = 0;
1163
+
1164
+ // skip to JPEG header.
1165
+ while ( !found && i < opLen ) {
1166
+ // io->seek_proc( handle, 24, SEEK_CUR );
1167
+ // MacRect dummy;
1168
+ // ReadRect( io, handle, &dummy );
1169
+ // io->seek_proc( handle, 122, SEEK_CUR );
1170
+ // found = TRUE;
1171
+ BYTE data[ 2 ];
1172
+ if( io->read_proc( data, 2, 1, handle ) ) {
1173
+ io->seek_proc( handle, -2, SEEK_CUR );
1174
+
1175
+ if ( data[0] == 0xFF && data[1] == 0xD8 ) {
1176
+ found = TRUE;
1177
+ } else {
1178
+ Read8( io, handle );
1179
+ i++;
1180
+ }
1181
+ }
1182
+ }
1183
+
1184
+ if ( found ) {
1185
+ // Pass the data to the JPEG decoder.
1186
+ pictType = jpeg;
1187
+ } else {
1188
+ throw "PICT file contains unrecognized quicktime data.";
1189
+ }
1190
+ done = TRUE;
1191
+ }
1192
+ else if (opcode >= 0xa2 && opcode <= 0xaf) {
1193
+ // reserved
1194
+ WORD len = Read16( io, handle );
1195
+ io->seek_proc(handle, len, SEEK_CUR);
1196
+ }
1197
+ else if ((opcode >= 0xb0 && opcode <= 0xcf) || (opcode >= 0x8000 && opcode <= 0x80ff)) {
1198
+ // just a reserved opcode, no data
1199
+ }
1200
+ else if ((opcode >= 0xd0 && opcode <= 0xfe) || opcode >= 8100) {
1201
+ // reserved
1202
+ LONG len = Read32( io, handle );
1203
+ io->seek_proc(handle, len, SEEK_CUR);
1204
+ }
1205
+ else if (opcode >= 0x100 && opcode <= 0x7fff) {
1206
+ // reserved
1207
+ io->seek_proc(handle, ((opcode >> 7) & 255), SEEK_CUR);
1208
+ }
1209
+ else {
1210
+ sprintf( outputMessage, "Can't handle opcode %x.\n", opcode );
1211
+ throw outputMessage;
1212
+ }
1213
+
1214
+ if(currentPos == io->tell_proc(handle)) {
1215
+ // we probaly reached the end of file as we can no longer move forward ...
1216
+ throw "Invalid PICT file";
1217
+ }
1218
+ }
1219
+
1220
+ switch ( pictType ) {
1221
+ case op9a:
1222
+ {
1223
+ bounds = pixMap.Bounds;
1224
+ int width = bounds.right - bounds.left;
1225
+ int height = bounds.bottom - bounds.top;
1226
+
1227
+ if ( pixMap.pixelSize > 8 ) {
1228
+ dib = FreeImage_Allocate( width, height, 32, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
1229
+ } else {
1230
+ dib = FreeImage_Allocate( width, height, 8);
1231
+ }
1232
+ hRes = pixMap.hRes << 16;
1233
+ vRes = pixMap.vRes << 16;
1234
+ break;
1235
+ }
1236
+
1237
+ case jpeg:
1238
+ {
1239
+ dib = FreeImage_LoadFromHandle( FIF_JPEG, io, handle );
1240
+ break;
1241
+ }
1242
+
1243
+ case pixmap:
1244
+ {
1245
+ // Decode version 2 pixmap
1246
+ ReadRect( io, handle, &pixMap.Bounds );
1247
+ ReadPixmap( io, handle, &pixMap );
1248
+
1249
+ bounds = pixMap.Bounds;
1250
+ int width = bounds.right - bounds.left;
1251
+ int height = bounds.bottom - bounds.top;
1252
+
1253
+ if ( pixMap.pixelSize > 8 ) {
1254
+ dib = FreeImage_Allocate( width, height, 32, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
1255
+ } else {
1256
+ dib = FreeImage_Allocate( width, height, 8);
1257
+ }
1258
+ hRes = pixMap.hRes << 16;
1259
+ vRes = pixMap.vRes << 16;
1260
+ break;
1261
+ }
1262
+
1263
+ case bitmap:
1264
+ {
1265
+ // Decode version 1 bitmap: 1 bpp.
1266
+ MacRect srcRect;
1267
+ MacRect dstRect;
1268
+ WORD width; // Width in pixels
1269
+ WORD height; // Height in pixels
1270
+
1271
+ ReadRect( io, handle, &bounds );
1272
+ ReadRect( io, handle, &srcRect );
1273
+ ReadRect( io, handle, &dstRect );
1274
+
1275
+ width = bounds.right - bounds.left;
1276
+ height = bounds.bottom - bounds.top;
1277
+
1278
+ dib = FreeImage_Allocate(width, height, 8);
1279
+ break;
1280
+ }
1281
+ }
1282
+
1283
+ if ( dib ) {
1284
+ // need to convert resolution figures from fixed point, pixels/inch
1285
+ // to floating point, pixels/meter.
1286
+ float hres_ppm = hRes * ((float)39.4 / (float)65536.0);
1287
+ float vres_ppm = vRes * ((float)39.4 / (float)65536.0);
1288
+
1289
+ FreeImage_SetDotsPerMeterX( dib, (LONG)hres_ppm );
1290
+ FreeImage_SetDotsPerMeterY( dib, (LONG)vres_ppm );
1291
+
1292
+ switch( pictType ) {
1293
+ case op9a:
1294
+ DecodeOp9a( io, handle, dib, &pixMap );
1295
+ break;
1296
+ case jpeg:
1297
+ // Already decoded if the embedded format was valid.
1298
+ break;
1299
+ case pixmap:
1300
+ DecodePixmap( io, handle, dib, isRegion, &pixMap, rowBytes );
1301
+ break;
1302
+ case bitmap:
1303
+ DecodeBitmap( io, handle, dib, isRegion, &bounds, rowBytes );
1304
+ break;
1305
+ default:
1306
+ throw "invalid pict type";
1307
+ }
1308
+ }
1309
+
1310
+ return dib;
1311
+ }
1312
+ catch(const char *message) {
1313
+ FreeImage_Unload( dib );
1314
+ FreeImage_OutputMessageProc(s_format_id, message);
1315
+ }
1316
+
1317
+ return NULL;
1318
+ }
1319
+
1320
+ // ==========================================================
1321
+ // Init
1322
+ // ==========================================================
1323
+
1324
+ void DLL_CALLCONV
1325
+ InitPICT(Plugin *plugin, int format_id) {
1326
+ s_format_id = format_id;
1327
+
1328
+ plugin->format_proc = Format;
1329
+ plugin->description_proc = Description;
1330
+ plugin->extension_proc = Extension;
1331
+ plugin->regexpr_proc = NULL;
1332
+ plugin->open_proc = NULL;
1333
+ plugin->close_proc = NULL;
1334
+ plugin->pagecount_proc = NULL;
1335
+ plugin->pagecapability_proc = NULL;
1336
+ plugin->load_proc = Load;
1337
+ plugin->save_proc = NULL;
1338
+ plugin->validate_proc = Validate;
1339
+ plugin->mime_proc = MimeType;
1340
+ plugin->supports_export_bpp_proc = SupportsExportDepth;
1341
+ plugin->supports_export_type_proc = SupportsExportType;
1342
+ plugin->supports_icc_profiles_proc = SupportsICCProfiles;
1343
+ }