/src/FreeImage/Source/LibMNG/libmng_chunk_prc.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 381 lines · 304 code · 21 blank · 56 comment · 1 complexity · b3a19f5e08f3a3d0bc0ef2b2fb0842b8 MD5 · raw file

  1. /* ************************************************************************** */
  2. /* * For conditions of distribution and use, * */
  3. /* * see copyright notice in libmng.h * */
  4. /* ************************************************************************** */
  5. /* * * */
  6. /* * project : libmng * */
  7. /* * file : libmng_chunk_prc.h copyright (c) 2000-2007 G.Juyn * */
  8. /* * version : 1.0.10 * */
  9. /* * * */
  10. /* * purpose : Chunk initialization & cleanup (definition) * */
  11. /* * * */
  12. /* * author : G.Juyn * */
  13. /* * * */
  14. /* * comment : definition of the chunk initialization & cleanup routines * */
  15. /* * * */
  16. /* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
  17. /* * - changed strict-ANSI stuff * */
  18. /* * * */
  19. /* * 0.9.2 - 08/05/2000 - G.Juyn * */
  20. /* * - changed file-prefixes * */
  21. /* * * */
  22. /* * 0.9.3 - 08/26/2000 - G.Juyn * */
  23. /* * - added MAGN chunk * */
  24. /* * 0.9.3 - 10/16/2000 - G.Juyn * */
  25. /* * - added support for JDAA * */
  26. /* * * */
  27. /* * 1.0.5 - 08/19/2002 - G.Juyn * */
  28. /* * - B597134 - libmng pollutes the linker namespace * */
  29. /* * 1.0.5 - 09/14/2002 - G.Juyn * */
  30. /* * - added event handling for dynamic MNG * */
  31. /* * * */
  32. /* * 1.0.6 - 07/07/2003 - G.R-P * */
  33. /* * - added NO_DELTA_PNG support * */
  34. /* * 1.0.6 - 07/29/2003 - G.R-P * */
  35. /* * - added conditionals around PAST chunk support * */
  36. /* * * */
  37. /* * 1.0.9 - 12/05/2004 - G.Juyn * */
  38. /* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */
  39. /* * 1.0.9 - 12/06/2004 - G.Juyn * */
  40. /* * - added conditional MNG_OPTIMIZE_CHUNKASSIGN * */
  41. /* * * */
  42. /* * 1.0.10 - 04/08/2007 - G.Juyn * */
  43. /* * - added support for mPNG proposal * */
  44. /* * 1.0.10 - 04/12/2007 - G.Juyn * */
  45. /* * - added support for ANG proposal * */
  46. /* * * */
  47. /* ************************************************************************** */
  48. #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
  49. #pragma option -A /* force ANSI-C */
  50. #endif
  51. #ifndef _libmng_chunk_prc_h_
  52. #define _libmng_chunk_prc_h_
  53. /* ************************************************************************** */
  54. void mng_add_chunk (mng_datap pData,
  55. mng_chunkp pChunk);
  56. /* ************************************************************************** */
  57. #define INIT_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
  58. mng_chunkp pHeader, \
  59. mng_chunkp* ppChunk)
  60. #ifdef MNG_OPTIMIZE_CHUNKINITFREE
  61. INIT_CHUNK_HDR (mng_init_general) ;
  62. #else
  63. INIT_CHUNK_HDR (mng_init_ihdr) ;
  64. INIT_CHUNK_HDR (mng_init_plte) ;
  65. INIT_CHUNK_HDR (mng_init_idat) ;
  66. INIT_CHUNK_HDR (mng_init_iend) ;
  67. INIT_CHUNK_HDR (mng_init_trns) ;
  68. INIT_CHUNK_HDR (mng_init_gama) ;
  69. INIT_CHUNK_HDR (mng_init_chrm) ;
  70. INIT_CHUNK_HDR (mng_init_srgb) ;
  71. INIT_CHUNK_HDR (mng_init_iccp) ;
  72. INIT_CHUNK_HDR (mng_init_text) ;
  73. INIT_CHUNK_HDR (mng_init_ztxt) ;
  74. INIT_CHUNK_HDR (mng_init_itxt) ;
  75. INIT_CHUNK_HDR (mng_init_bkgd) ;
  76. INIT_CHUNK_HDR (mng_init_phys) ;
  77. INIT_CHUNK_HDR (mng_init_sbit) ;
  78. INIT_CHUNK_HDR (mng_init_splt) ;
  79. INIT_CHUNK_HDR (mng_init_hist) ;
  80. INIT_CHUNK_HDR (mng_init_time) ;
  81. INIT_CHUNK_HDR (mng_init_mhdr) ;
  82. INIT_CHUNK_HDR (mng_init_mend) ;
  83. INIT_CHUNK_HDR (mng_init_loop) ;
  84. INIT_CHUNK_HDR (mng_init_endl) ;
  85. INIT_CHUNK_HDR (mng_init_defi) ;
  86. INIT_CHUNK_HDR (mng_init_basi) ;
  87. INIT_CHUNK_HDR (mng_init_clon) ;
  88. #ifndef MNG_SKIPCHUNK_PAST
  89. INIT_CHUNK_HDR (mng_init_past) ;
  90. #endif
  91. INIT_CHUNK_HDR (mng_init_disc) ;
  92. INIT_CHUNK_HDR (mng_init_back) ;
  93. INIT_CHUNK_HDR (mng_init_fram) ;
  94. INIT_CHUNK_HDR (mng_init_move) ;
  95. INIT_CHUNK_HDR (mng_init_clip) ;
  96. INIT_CHUNK_HDR (mng_init_show) ;
  97. INIT_CHUNK_HDR (mng_init_term) ;
  98. INIT_CHUNK_HDR (mng_init_save) ;
  99. INIT_CHUNK_HDR (mng_init_seek) ;
  100. INIT_CHUNK_HDR (mng_init_expi) ;
  101. INIT_CHUNK_HDR (mng_init_fpri) ;
  102. INIT_CHUNK_HDR (mng_init_need) ;
  103. INIT_CHUNK_HDR (mng_init_phyg) ;
  104. #ifdef MNG_INCLUDE_JNG
  105. INIT_CHUNK_HDR (mng_init_jhdr) ;
  106. INIT_CHUNK_HDR (mng_init_jdaa) ;
  107. INIT_CHUNK_HDR (mng_init_jdat) ;
  108. INIT_CHUNK_HDR (mng_init_jsep) ;
  109. #endif
  110. #ifndef MNG_NO_DELTA_PNG
  111. INIT_CHUNK_HDR (mng_init_dhdr) ;
  112. INIT_CHUNK_HDR (mng_init_prom) ;
  113. INIT_CHUNK_HDR (mng_init_ipng) ;
  114. INIT_CHUNK_HDR (mng_init_pplt) ;
  115. #ifdef MNG_INCLUDE_JNG
  116. INIT_CHUNK_HDR (mng_init_ijng) ;
  117. #endif
  118. INIT_CHUNK_HDR (mng_init_drop) ;
  119. INIT_CHUNK_HDR (mng_init_dbyk) ;
  120. INIT_CHUNK_HDR (mng_init_ordr) ;
  121. #endif
  122. INIT_CHUNK_HDR (mng_init_magn) ;
  123. INIT_CHUNK_HDR (mng_init_evnt) ;
  124. INIT_CHUNK_HDR (mng_init_unknown) ;
  125. #endif /* MNG_OPTIMIZE_CHUNKINITFREE */
  126. /* ************************************************************************** */
  127. #define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
  128. mng_chunkp pHeader)
  129. #ifdef MNG_OPTIMIZE_CHUNKINITFREE
  130. FREE_CHUNK_HDR (mng_free_general) ;
  131. #else /* MNG_OPTIMIZE_CHUNKINITFREE */
  132. FREE_CHUNK_HDR (mng_free_ihdr) ;
  133. FREE_CHUNK_HDR (mng_free_plte) ;
  134. FREE_CHUNK_HDR (mng_free_iend) ;
  135. FREE_CHUNK_HDR (mng_free_trns) ;
  136. FREE_CHUNK_HDR (mng_free_gama) ;
  137. FREE_CHUNK_HDR (mng_free_chrm) ;
  138. FREE_CHUNK_HDR (mng_free_srgb) ;
  139. FREE_CHUNK_HDR (mng_free_bkgd) ;
  140. FREE_CHUNK_HDR (mng_free_phys) ;
  141. FREE_CHUNK_HDR (mng_free_sbit) ;
  142. FREE_CHUNK_HDR (mng_free_hist) ;
  143. FREE_CHUNK_HDR (mng_free_time) ;
  144. FREE_CHUNK_HDR (mng_free_mhdr) ;
  145. FREE_CHUNK_HDR (mng_free_mend) ;
  146. FREE_CHUNK_HDR (mng_free_endl) ;
  147. FREE_CHUNK_HDR (mng_free_defi) ;
  148. FREE_CHUNK_HDR (mng_free_basi) ;
  149. FREE_CHUNK_HDR (mng_free_clon) ;
  150. FREE_CHUNK_HDR (mng_free_back) ;
  151. FREE_CHUNK_HDR (mng_free_move) ;
  152. FREE_CHUNK_HDR (mng_free_clip) ;
  153. FREE_CHUNK_HDR (mng_free_show) ;
  154. FREE_CHUNK_HDR (mng_free_term) ;
  155. FREE_CHUNK_HDR (mng_free_fpri) ;
  156. FREE_CHUNK_HDR (mng_free_phyg) ;
  157. #ifdef MNG_INCLUDE_JNG
  158. FREE_CHUNK_HDR (mng_free_jhdr) ;
  159. FREE_CHUNK_HDR (mng_free_jsep) ;
  160. #endif
  161. #ifndef MNG_NO_DELTA_PNG
  162. FREE_CHUNK_HDR (mng_free_dhdr) ;
  163. FREE_CHUNK_HDR (mng_free_prom) ;
  164. FREE_CHUNK_HDR (mng_free_ipng) ;
  165. FREE_CHUNK_HDR (mng_free_pplt) ;
  166. #ifdef MNG_INCLUDE_JNG
  167. FREE_CHUNK_HDR (mng_free_ijng) ;
  168. #endif
  169. #endif
  170. FREE_CHUNK_HDR (mng_free_magn) ;
  171. #endif /* MNG_OPTIMIZE_CHUNKINITFREE */
  172. FREE_CHUNK_HDR (mng_free_idat) ;
  173. FREE_CHUNK_HDR (mng_free_iccp) ;
  174. FREE_CHUNK_HDR (mng_free_text) ;
  175. FREE_CHUNK_HDR (mng_free_ztxt) ;
  176. FREE_CHUNK_HDR (mng_free_itxt) ;
  177. FREE_CHUNK_HDR (mng_free_splt) ;
  178. FREE_CHUNK_HDR (mng_free_loop) ;
  179. #ifndef MNG_SKIPCHUNK_PAST
  180. FREE_CHUNK_HDR (mng_free_past) ;
  181. #endif
  182. FREE_CHUNK_HDR (mng_free_disc) ;
  183. FREE_CHUNK_HDR (mng_free_fram) ;
  184. FREE_CHUNK_HDR (mng_free_save) ;
  185. FREE_CHUNK_HDR (mng_free_seek) ;
  186. FREE_CHUNK_HDR (mng_free_expi) ;
  187. FREE_CHUNK_HDR (mng_free_need) ;
  188. #ifdef MNG_INCLUDE_JNG
  189. FREE_CHUNK_HDR (mng_free_jdaa) ;
  190. FREE_CHUNK_HDR (mng_free_jdat) ;
  191. #endif
  192. #ifndef MNG_NO_DELTA_PNG
  193. FREE_CHUNK_HDR (mng_free_drop) ;
  194. FREE_CHUNK_HDR (mng_free_dbyk) ;
  195. FREE_CHUNK_HDR (mng_free_ordr) ;
  196. #endif
  197. #ifdef MNG_INCLUDE_MPNG_PROPOSAL
  198. FREE_CHUNK_HDR (mng_free_mpng) ;
  199. #endif
  200. #ifdef MNG_INCLUDE_ANG_PROPOSAL
  201. FREE_CHUNK_HDR (mng_free_adat) ;
  202. #endif
  203. FREE_CHUNK_HDR (mng_free_evnt) ;
  204. FREE_CHUNK_HDR (mng_free_unknown) ;
  205. /* ************************************************************************** */
  206. #ifdef MNG_INCLUDE_WRITE_PROCS
  207. #define ASSIGN_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
  208. mng_chunkp pChunkto, \
  209. mng_chunkp pChunkfrom)
  210. #ifdef MNG_OPTIMIZE_CHUNKASSIGN
  211. ASSIGN_CHUNK_HDR (mng_assign_general) ;
  212. #else /* MNG_OPTIMIZE_CHUNKASSIGN */
  213. ASSIGN_CHUNK_HDR (mng_assign_ihdr) ;
  214. ASSIGN_CHUNK_HDR (mng_assign_plte) ;
  215. ASSIGN_CHUNK_HDR (mng_assign_iend) ;
  216. ASSIGN_CHUNK_HDR (mng_assign_trns) ;
  217. ASSIGN_CHUNK_HDR (mng_assign_gama) ;
  218. ASSIGN_CHUNK_HDR (mng_assign_chrm) ;
  219. ASSIGN_CHUNK_HDR (mng_assign_srgb) ;
  220. ASSIGN_CHUNK_HDR (mng_assign_bkgd) ;
  221. ASSIGN_CHUNK_HDR (mng_assign_phys) ;
  222. ASSIGN_CHUNK_HDR (mng_assign_sbit) ;
  223. ASSIGN_CHUNK_HDR (mng_assign_hist) ;
  224. ASSIGN_CHUNK_HDR (mng_assign_time) ;
  225. ASSIGN_CHUNK_HDR (mng_assign_mhdr) ;
  226. ASSIGN_CHUNK_HDR (mng_assign_mend) ;
  227. ASSIGN_CHUNK_HDR (mng_assign_endl) ;
  228. ASSIGN_CHUNK_HDR (mng_assign_defi) ;
  229. ASSIGN_CHUNK_HDR (mng_assign_basi) ;
  230. ASSIGN_CHUNK_HDR (mng_assign_clon) ;
  231. ASSIGN_CHUNK_HDR (mng_assign_back) ;
  232. ASSIGN_CHUNK_HDR (mng_assign_move) ;
  233. ASSIGN_CHUNK_HDR (mng_assign_clip) ;
  234. ASSIGN_CHUNK_HDR (mng_assign_show) ;
  235. ASSIGN_CHUNK_HDR (mng_assign_term) ;
  236. ASSIGN_CHUNK_HDR (mng_assign_fpri) ;
  237. ASSIGN_CHUNK_HDR (mng_assign_phyg) ;
  238. #ifdef MNG_INCLUDE_JNG
  239. ASSIGN_CHUNK_HDR (mng_assign_jhdr) ;
  240. ASSIGN_CHUNK_HDR (mng_assign_jsep) ;
  241. #endif
  242. #ifndef MNG_NO_DELTA_PNG
  243. ASSIGN_CHUNK_HDR (mng_assign_dhdr) ;
  244. ASSIGN_CHUNK_HDR (mng_assign_prom) ;
  245. ASSIGN_CHUNK_HDR (mng_assign_ipng) ;
  246. ASSIGN_CHUNK_HDR (mng_assign_pplt) ;
  247. #ifdef MNG_INCLUDE_JNG
  248. ASSIGN_CHUNK_HDR (mng_assign_ijng) ;
  249. #endif
  250. #endif
  251. ASSIGN_CHUNK_HDR (mng_assign_magn) ;
  252. #endif /* MNG_OPTIMIZE_CHUNKASSIGN */
  253. ASSIGN_CHUNK_HDR (mng_assign_idat) ;
  254. ASSIGN_CHUNK_HDR (mng_assign_iccp) ;
  255. ASSIGN_CHUNK_HDR (mng_assign_text) ;
  256. ASSIGN_CHUNK_HDR (mng_assign_ztxt) ;
  257. ASSIGN_CHUNK_HDR (mng_assign_itxt) ;
  258. ASSIGN_CHUNK_HDR (mng_assign_splt) ;
  259. ASSIGN_CHUNK_HDR (mng_assign_loop) ;
  260. #ifndef MNG_SKIPCHUNK_PAST
  261. ASSIGN_CHUNK_HDR (mng_assign_past) ;
  262. #endif
  263. ASSIGN_CHUNK_HDR (mng_assign_disc) ;
  264. ASSIGN_CHUNK_HDR (mng_assign_fram) ;
  265. ASSIGN_CHUNK_HDR (mng_assign_save) ;
  266. ASSIGN_CHUNK_HDR (mng_assign_seek) ;
  267. ASSIGN_CHUNK_HDR (mng_assign_need) ;
  268. ASSIGN_CHUNK_HDR (mng_assign_expi) ;
  269. #ifdef MNG_INCLUDE_JNG
  270. ASSIGN_CHUNK_HDR (mng_assign_jdaa) ;
  271. ASSIGN_CHUNK_HDR (mng_assign_jdat) ;
  272. #endif
  273. #ifndef MNG_NO_DELTA_PNG
  274. ASSIGN_CHUNK_HDR (mng_assign_drop) ;
  275. ASSIGN_CHUNK_HDR (mng_assign_dbyk) ;
  276. ASSIGN_CHUNK_HDR (mng_assign_ordr) ;
  277. #endif
  278. #ifdef MNG_INCLUDE_MPNG_PROPOSAL
  279. ASSIGN_CHUNK_HDR (mng_assign_mpng) ;
  280. #endif
  281. #ifdef MNG_INCLUDE_ANG_PROPOSAL
  282. ASSIGN_CHUNK_HDR (mng_assign_ahdr) ;
  283. ASSIGN_CHUNK_HDR (mng_assign_adat) ;
  284. #endif
  285. ASSIGN_CHUNK_HDR (mng_assign_evnt) ;
  286. ASSIGN_CHUNK_HDR (mng_assign_unknown) ;
  287. /* ************************************************************************** */
  288. #else /* MNG_INCLUDE_WRITE_PROCS */
  289. #define mng_assign_general 0
  290. #define mng_assign_ihdr 0
  291. #define mng_assign_plte 0
  292. #define mng_assign_idat 0
  293. #define mng_assign_iend 0
  294. #define mng_assign_trns 0
  295. #define mng_assign_gama 0
  296. #define mng_assign_chrm 0
  297. #define mng_assign_srgb 0
  298. #define mng_assign_iccp 0
  299. #define mng_assign_text 0
  300. #define mng_assign_ztxt 0
  301. #define mng_assign_itxt 0
  302. #define mng_assign_bkgd 0
  303. #define mng_assign_phys 0
  304. #define mng_assign_sbit 0
  305. #define mng_assign_splt 0
  306. #define mng_assign_hist 0
  307. #define mng_assign_time 0
  308. #define mng_assign_mhdr 0
  309. #define mng_assign_mend 0
  310. #define mng_assign_loop 0
  311. #define mng_assign_endl 0
  312. #define mng_assign_defi 0
  313. #define mng_assign_basi 0
  314. #define mng_assign_clon 0
  315. #ifndef MNG_SKIPCHUNK_PAST
  316. #define mng_assign_past 0
  317. #endif
  318. #define mng_assign_disc 0
  319. #define mng_assign_back 0
  320. #define mng_assign_fram 0
  321. #define mng_assign_move 0
  322. #define mng_assign_clip 0
  323. #define mng_assign_show 0
  324. #define mng_assign_term 0
  325. #define mng_assign_save 0
  326. #define mng_assign_seek 0
  327. #define mng_assign_expi 0
  328. #define mng_assign_fpri 0
  329. #define mng_assign_phyg 0
  330. #ifdef MNG_INCLUDE_JNG
  331. #define mng_assign_jhdr 0
  332. #define mng_assign_jdaa 0
  333. #define mng_assign_jdat 0
  334. #define mng_assign_jsep 0
  335. #endif
  336. #ifndef MNG_NO_DELTA_PNG
  337. #define mng_assign_dhdr 0
  338. #define mng_assign_prom 0
  339. #define mng_assign_ipng 0
  340. #define mng_assign_pplt 0
  341. #ifdef MNG_INCLUDE_JNG
  342. #define mng_assign_ijng 0
  343. #endif
  344. #define mng_assign_drop 0
  345. #define mng_assign_dbyk 0
  346. #define mng_assign_ordr 0
  347. #endif
  348. #define mng_assign_magn 0
  349. #define mng_assign_need 0
  350. #define mng_assign_mpng 0
  351. #define mng_assign_ahdr 0
  352. #define mng_assign_adat 0
  353. #define mng_assign_evnt 0
  354. #define mng_assign_unknown 0
  355. #endif /* MNG_INCLUDE_WRITE_PROCS */
  356. /* ************************************************************************** */
  357. #endif /* _libmng_chunk_prc_h_ */
  358. /* ************************************************************************** */
  359. /* * end of file * */
  360. /* ************************************************************************** */