PageRenderTime 49ms CodeModel.GetById 11ms app.highlight 32ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 49#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
 50#pragma option -A                      /* force ANSI-C */
 51#endif
 52
 53#ifndef _libmng_chunk_prc_h_
 54#define _libmng_chunk_prc_h_
 55
 56/* ************************************************************************** */
 57
 58void mng_add_chunk (mng_datap  pData,
 59                    mng_chunkp pChunk);
 60
 61/* ************************************************************************** */
 62
 63#define INIT_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
 64                                         mng_chunkp  pHeader,  \
 65                                         mng_chunkp* ppChunk)
 66
 67#ifdef MNG_OPTIMIZE_CHUNKINITFREE
 68INIT_CHUNK_HDR (mng_init_general) ;
 69#else
 70INIT_CHUNK_HDR (mng_init_ihdr) ;
 71INIT_CHUNK_HDR (mng_init_plte) ;
 72INIT_CHUNK_HDR (mng_init_idat) ;
 73INIT_CHUNK_HDR (mng_init_iend) ;
 74INIT_CHUNK_HDR (mng_init_trns) ;
 75INIT_CHUNK_HDR (mng_init_gama) ;
 76INIT_CHUNK_HDR (mng_init_chrm) ;
 77INIT_CHUNK_HDR (mng_init_srgb) ;
 78INIT_CHUNK_HDR (mng_init_iccp) ;
 79INIT_CHUNK_HDR (mng_init_text) ;
 80INIT_CHUNK_HDR (mng_init_ztxt) ;
 81INIT_CHUNK_HDR (mng_init_itxt) ;
 82INIT_CHUNK_HDR (mng_init_bkgd) ;
 83INIT_CHUNK_HDR (mng_init_phys) ;
 84INIT_CHUNK_HDR (mng_init_sbit) ;
 85INIT_CHUNK_HDR (mng_init_splt) ;
 86INIT_CHUNK_HDR (mng_init_hist) ;
 87INIT_CHUNK_HDR (mng_init_time) ;
 88INIT_CHUNK_HDR (mng_init_mhdr) ;
 89INIT_CHUNK_HDR (mng_init_mend) ;
 90INIT_CHUNK_HDR (mng_init_loop) ;
 91INIT_CHUNK_HDR (mng_init_endl) ;
 92INIT_CHUNK_HDR (mng_init_defi) ;
 93INIT_CHUNK_HDR (mng_init_basi) ;
 94INIT_CHUNK_HDR (mng_init_clon) ;
 95#ifndef MNG_SKIPCHUNK_PAST
 96INIT_CHUNK_HDR (mng_init_past) ;
 97#endif
 98INIT_CHUNK_HDR (mng_init_disc) ;
 99INIT_CHUNK_HDR (mng_init_back) ;
100INIT_CHUNK_HDR (mng_init_fram) ;
101INIT_CHUNK_HDR (mng_init_move) ;
102INIT_CHUNK_HDR (mng_init_clip) ;
103INIT_CHUNK_HDR (mng_init_show) ;
104INIT_CHUNK_HDR (mng_init_term) ;
105INIT_CHUNK_HDR (mng_init_save) ;
106INIT_CHUNK_HDR (mng_init_seek) ;
107INIT_CHUNK_HDR (mng_init_expi) ;
108INIT_CHUNK_HDR (mng_init_fpri) ;
109INIT_CHUNK_HDR (mng_init_need) ;
110INIT_CHUNK_HDR (mng_init_phyg) ;
111#ifdef MNG_INCLUDE_JNG
112INIT_CHUNK_HDR (mng_init_jhdr) ;
113INIT_CHUNK_HDR (mng_init_jdaa) ;
114INIT_CHUNK_HDR (mng_init_jdat) ;
115INIT_CHUNK_HDR (mng_init_jsep) ;
116#endif
117#ifndef MNG_NO_DELTA_PNG
118INIT_CHUNK_HDR (mng_init_dhdr) ;
119INIT_CHUNK_HDR (mng_init_prom) ;
120INIT_CHUNK_HDR (mng_init_ipng) ;
121INIT_CHUNK_HDR (mng_init_pplt) ;
122#ifdef MNG_INCLUDE_JNG
123INIT_CHUNK_HDR (mng_init_ijng) ;
124#endif
125INIT_CHUNK_HDR (mng_init_drop) ;
126INIT_CHUNK_HDR (mng_init_dbyk) ;
127INIT_CHUNK_HDR (mng_init_ordr) ;
128#endif
129INIT_CHUNK_HDR (mng_init_magn) ;
130INIT_CHUNK_HDR (mng_init_evnt) ;
131INIT_CHUNK_HDR (mng_init_unknown) ;
132#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
133
134/* ************************************************************************** */
135
136#define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
137                                         mng_chunkp  pHeader)
138
139#ifdef MNG_OPTIMIZE_CHUNKINITFREE
140FREE_CHUNK_HDR (mng_free_general) ;
141#else /* MNG_OPTIMIZE_CHUNKINITFREE */
142FREE_CHUNK_HDR (mng_free_ihdr) ;
143FREE_CHUNK_HDR (mng_free_plte) ;
144FREE_CHUNK_HDR (mng_free_iend) ;
145FREE_CHUNK_HDR (mng_free_trns) ;
146FREE_CHUNK_HDR (mng_free_gama) ;
147FREE_CHUNK_HDR (mng_free_chrm) ;
148FREE_CHUNK_HDR (mng_free_srgb) ;
149FREE_CHUNK_HDR (mng_free_bkgd) ;
150FREE_CHUNK_HDR (mng_free_phys) ;
151FREE_CHUNK_HDR (mng_free_sbit) ;
152FREE_CHUNK_HDR (mng_free_hist) ;
153FREE_CHUNK_HDR (mng_free_time) ;
154FREE_CHUNK_HDR (mng_free_mhdr) ;
155FREE_CHUNK_HDR (mng_free_mend) ;
156FREE_CHUNK_HDR (mng_free_endl) ;
157FREE_CHUNK_HDR (mng_free_defi) ;
158FREE_CHUNK_HDR (mng_free_basi) ;
159FREE_CHUNK_HDR (mng_free_clon) ;
160FREE_CHUNK_HDR (mng_free_back) ;
161FREE_CHUNK_HDR (mng_free_move) ;
162FREE_CHUNK_HDR (mng_free_clip) ;
163FREE_CHUNK_HDR (mng_free_show) ;
164FREE_CHUNK_HDR (mng_free_term) ;
165FREE_CHUNK_HDR (mng_free_fpri) ;
166FREE_CHUNK_HDR (mng_free_phyg) ;
167#ifdef MNG_INCLUDE_JNG
168FREE_CHUNK_HDR (mng_free_jhdr) ;
169FREE_CHUNK_HDR (mng_free_jsep) ;
170#endif
171#ifndef MNG_NO_DELTA_PNG
172FREE_CHUNK_HDR (mng_free_dhdr) ;
173FREE_CHUNK_HDR (mng_free_prom) ;
174FREE_CHUNK_HDR (mng_free_ipng) ;
175FREE_CHUNK_HDR (mng_free_pplt) ;
176#ifdef MNG_INCLUDE_JNG
177FREE_CHUNK_HDR (mng_free_ijng) ;
178#endif
179#endif
180FREE_CHUNK_HDR (mng_free_magn) ;
181#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
182
183FREE_CHUNK_HDR (mng_free_idat) ;
184FREE_CHUNK_HDR (mng_free_iccp) ;
185FREE_CHUNK_HDR (mng_free_text) ;
186FREE_CHUNK_HDR (mng_free_ztxt) ;
187FREE_CHUNK_HDR (mng_free_itxt) ;
188FREE_CHUNK_HDR (mng_free_splt) ;
189FREE_CHUNK_HDR (mng_free_loop) ;
190#ifndef MNG_SKIPCHUNK_PAST
191FREE_CHUNK_HDR (mng_free_past) ;
192#endif
193FREE_CHUNK_HDR (mng_free_disc) ;
194FREE_CHUNK_HDR (mng_free_fram) ;
195FREE_CHUNK_HDR (mng_free_save) ;
196FREE_CHUNK_HDR (mng_free_seek) ;
197FREE_CHUNK_HDR (mng_free_expi) ;
198FREE_CHUNK_HDR (mng_free_need) ;
199#ifdef MNG_INCLUDE_JNG
200FREE_CHUNK_HDR (mng_free_jdaa) ;
201FREE_CHUNK_HDR (mng_free_jdat) ;
202#endif
203#ifndef MNG_NO_DELTA_PNG
204FREE_CHUNK_HDR (mng_free_drop) ;
205FREE_CHUNK_HDR (mng_free_dbyk) ;
206FREE_CHUNK_HDR (mng_free_ordr) ;
207#endif
208#ifdef MNG_INCLUDE_MPNG_PROPOSAL
209FREE_CHUNK_HDR (mng_free_mpng) ;
210#endif
211#ifdef MNG_INCLUDE_ANG_PROPOSAL
212FREE_CHUNK_HDR (mng_free_adat) ;
213#endif
214FREE_CHUNK_HDR (mng_free_evnt) ;
215FREE_CHUNK_HDR (mng_free_unknown) ;
216
217/* ************************************************************************** */
218
219#ifdef MNG_INCLUDE_WRITE_PROCS
220
221#define ASSIGN_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
222                                           mng_chunkp  pChunkto, \
223                                           mng_chunkp  pChunkfrom)
224
225#ifdef MNG_OPTIMIZE_CHUNKASSIGN
226ASSIGN_CHUNK_HDR (mng_assign_general) ;
227#else /* MNG_OPTIMIZE_CHUNKASSIGN */
228ASSIGN_CHUNK_HDR (mng_assign_ihdr) ;
229ASSIGN_CHUNK_HDR (mng_assign_plte) ;
230ASSIGN_CHUNK_HDR (mng_assign_iend) ;
231ASSIGN_CHUNK_HDR (mng_assign_trns) ;
232ASSIGN_CHUNK_HDR (mng_assign_gama) ;
233ASSIGN_CHUNK_HDR (mng_assign_chrm) ;
234ASSIGN_CHUNK_HDR (mng_assign_srgb) ;
235ASSIGN_CHUNK_HDR (mng_assign_bkgd) ;
236ASSIGN_CHUNK_HDR (mng_assign_phys) ;
237ASSIGN_CHUNK_HDR (mng_assign_sbit) ;
238ASSIGN_CHUNK_HDR (mng_assign_hist) ;
239ASSIGN_CHUNK_HDR (mng_assign_time) ;
240ASSIGN_CHUNK_HDR (mng_assign_mhdr) ;
241ASSIGN_CHUNK_HDR (mng_assign_mend) ;
242ASSIGN_CHUNK_HDR (mng_assign_endl) ;
243ASSIGN_CHUNK_HDR (mng_assign_defi) ;
244ASSIGN_CHUNK_HDR (mng_assign_basi) ;
245ASSIGN_CHUNK_HDR (mng_assign_clon) ;
246ASSIGN_CHUNK_HDR (mng_assign_back) ;
247ASSIGN_CHUNK_HDR (mng_assign_move) ;
248ASSIGN_CHUNK_HDR (mng_assign_clip) ;
249ASSIGN_CHUNK_HDR (mng_assign_show) ;
250ASSIGN_CHUNK_HDR (mng_assign_term) ;
251ASSIGN_CHUNK_HDR (mng_assign_fpri) ;
252ASSIGN_CHUNK_HDR (mng_assign_phyg) ;
253#ifdef MNG_INCLUDE_JNG
254ASSIGN_CHUNK_HDR (mng_assign_jhdr) ;
255ASSIGN_CHUNK_HDR (mng_assign_jsep) ;
256#endif
257#ifndef MNG_NO_DELTA_PNG
258ASSIGN_CHUNK_HDR (mng_assign_dhdr) ;
259ASSIGN_CHUNK_HDR (mng_assign_prom) ;
260ASSIGN_CHUNK_HDR (mng_assign_ipng) ;
261ASSIGN_CHUNK_HDR (mng_assign_pplt) ;
262#ifdef MNG_INCLUDE_JNG
263ASSIGN_CHUNK_HDR (mng_assign_ijng) ;
264#endif
265#endif
266ASSIGN_CHUNK_HDR (mng_assign_magn) ;
267#endif /* MNG_OPTIMIZE_CHUNKASSIGN */
268
269ASSIGN_CHUNK_HDR (mng_assign_idat) ;
270ASSIGN_CHUNK_HDR (mng_assign_iccp) ;
271ASSIGN_CHUNK_HDR (mng_assign_text) ;
272ASSIGN_CHUNK_HDR (mng_assign_ztxt) ;
273ASSIGN_CHUNK_HDR (mng_assign_itxt) ;
274ASSIGN_CHUNK_HDR (mng_assign_splt) ;
275ASSIGN_CHUNK_HDR (mng_assign_loop) ;
276#ifndef MNG_SKIPCHUNK_PAST
277ASSIGN_CHUNK_HDR (mng_assign_past) ;
278#endif
279ASSIGN_CHUNK_HDR (mng_assign_disc) ;
280ASSIGN_CHUNK_HDR (mng_assign_fram) ;
281ASSIGN_CHUNK_HDR (mng_assign_save) ;
282ASSIGN_CHUNK_HDR (mng_assign_seek) ;
283ASSIGN_CHUNK_HDR (mng_assign_need) ;
284ASSIGN_CHUNK_HDR (mng_assign_expi) ;
285#ifdef MNG_INCLUDE_JNG
286ASSIGN_CHUNK_HDR (mng_assign_jdaa) ;
287ASSIGN_CHUNK_HDR (mng_assign_jdat) ;
288#endif
289#ifndef MNG_NO_DELTA_PNG
290ASSIGN_CHUNK_HDR (mng_assign_drop) ;
291ASSIGN_CHUNK_HDR (mng_assign_dbyk) ;
292ASSIGN_CHUNK_HDR (mng_assign_ordr) ;
293#endif
294#ifdef MNG_INCLUDE_MPNG_PROPOSAL
295ASSIGN_CHUNK_HDR (mng_assign_mpng) ;
296#endif
297#ifdef MNG_INCLUDE_ANG_PROPOSAL
298ASSIGN_CHUNK_HDR (mng_assign_ahdr) ;
299ASSIGN_CHUNK_HDR (mng_assign_adat) ;
300#endif
301ASSIGN_CHUNK_HDR (mng_assign_evnt) ;
302ASSIGN_CHUNK_HDR (mng_assign_unknown) ;
303
304/* ************************************************************************** */
305
306#else /* MNG_INCLUDE_WRITE_PROCS */
307#define mng_assign_general 0
308#define mng_assign_ihdr 0
309#define mng_assign_plte 0
310#define mng_assign_idat 0
311#define mng_assign_iend 0
312#define mng_assign_trns 0
313#define mng_assign_gama 0
314#define mng_assign_chrm 0
315#define mng_assign_srgb 0
316#define mng_assign_iccp 0
317#define mng_assign_text 0
318#define mng_assign_ztxt 0
319#define mng_assign_itxt 0
320#define mng_assign_bkgd 0
321#define mng_assign_phys 0
322#define mng_assign_sbit 0
323#define mng_assign_splt 0
324#define mng_assign_hist 0
325#define mng_assign_time 0
326#define mng_assign_mhdr 0
327#define mng_assign_mend 0
328#define mng_assign_loop 0
329#define mng_assign_endl 0
330#define mng_assign_defi 0
331#define mng_assign_basi 0
332#define mng_assign_clon 0
333#ifndef MNG_SKIPCHUNK_PAST
334#define mng_assign_past 0
335#endif
336#define mng_assign_disc 0
337#define mng_assign_back 0
338#define mng_assign_fram 0
339#define mng_assign_move 0
340#define mng_assign_clip 0
341#define mng_assign_show 0
342#define mng_assign_term 0
343#define mng_assign_save 0
344#define mng_assign_seek 0
345#define mng_assign_expi 0
346#define mng_assign_fpri 0
347#define mng_assign_phyg 0
348#ifdef MNG_INCLUDE_JNG
349#define mng_assign_jhdr 0
350#define mng_assign_jdaa 0
351#define mng_assign_jdat 0
352#define mng_assign_jsep 0
353#endif
354#ifndef MNG_NO_DELTA_PNG
355#define mng_assign_dhdr 0
356#define mng_assign_prom 0
357#define mng_assign_ipng 0
358#define mng_assign_pplt 0
359#ifdef MNG_INCLUDE_JNG
360#define mng_assign_ijng 0
361#endif
362#define mng_assign_drop 0
363#define mng_assign_dbyk 0
364#define mng_assign_ordr 0
365#endif
366#define mng_assign_magn 0
367#define mng_assign_need 0
368#define mng_assign_mpng 0
369#define mng_assign_ahdr 0
370#define mng_assign_adat 0
371#define mng_assign_evnt 0
372#define mng_assign_unknown 0
373#endif /* MNG_INCLUDE_WRITE_PROCS */
374
375/* ************************************************************************** */
376
377#endif /* _libmng_chunk_prc_h_ */
378
379/* ************************************************************************** */
380/* * end of file                                                            * */
381/* ************************************************************************** */