source: trunk/src/3rdparty/libmng/libmng_objects.h

Last change on this file was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 28.9 KB
Line 
1/* ************************************************************************** */
2/* * For conditions of distribution and use, * */
3/* * see copyright notice in libmng.h * */
4/* ************************************************************************** */
5/* * * */
6/* * project : libmng * */
7/* * file : libmng_objects.h copyright (c) 2000-2007 G.Juyn * */
8/* * version : 1.0.10 * */
9/* * * */
10/* * purpose : Internal object structures (definition) * */
11/* * * */
12/* * author : G.Juyn * */
13/* * * */
14/* * comment : Definition of the internal object structures * */
15/* * * */
16/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
17/* * - changed strict-ANSI stuff * */
18/* * * */
19/* * 0.5.2 - 05/23/2000 - G.Juyn * */
20/* * - changed inclusion to DISPLAY_PROCS * */
21/* * 0.5.2 - 05/24/2000 - G.Juyn * */
22/* * - added global color-chunks for animations * */
23/* * - added global PLTE,tRNS,bKGD chunks for animation * */
24/* * - added SAVE & SEEK animation objects * */
25/* * 0.5.2 - 05/29/2000 - G.Juyn * */
26/* * - added framenr/layernr/playtime to object header * */
27/* * 0.5.2 - 05/30/2000 - G.Juyn * */
28/* * - added ani-objects for delta-image processing * */
29/* * - added compression/filter/interlace fields to * */
30/* * object-buffer for delta-image processing * */
31/* * * */
32/* * 0.5.3 - 06/17/2000 - G.Juyn * */
33/* * - changed definition of aTRNSentries * */
34/* * 0.5.3 - 06/22/2000 - G.Juyn * */
35/* * - added definition for PPLT animation-processing * */
36/* * * */
37/* * 0.9.2 - 08/05/2000 - G.Juyn * */
38/* * - changed file-prefixes * */
39/* * * */
40/* * 0.9.3 - 08/26/2000 - G.Juyn * */
41/* * - added MAGN chunk * */
42/* * 0.9.3 - 09/10/2000 - G.Juyn * */
43/* * - fixed DEFI behavior * */
44/* * 0.9.3 - 10/16/2000 - G.Juyn * */
45/* * - added support for delta-JNG * */
46/* * 0.9.3 - 10/17/2000 - G.Juyn * */
47/* * - added valid-flag to stored objects for read() / display()* */
48/* * 0.9.3 - 10/19/2000 - G.Juyn * */
49/* * - added storage for pixel-/alpha-sampledepth for delta's * */
50/* * * */
51/* * 1.0.5 - 09/13/2002 - G.Juyn * */
52/* * - fixed read/write of MAGN chunk * */
53/* * 1.0.5 - 09/15/2002 - G.Juyn * */
54/* * - added event handling for dynamic MNG * */
55/* * 1.0.5 - 09/20/2002 - G.Juyn * */
56/* * - added support for PAST * */
57/* * 1.0.5 - 09/23/2002 - G.Juyn * */
58/* * - added in-memory color-correction of abstract images * */
59/* * 1.0.5 - 10/07/2002 - G.Juyn * */
60/* * - fixed DISC support * */
61/* * * */
62/* * 1.0.6 - 10/07/2003 - G.R-P * */
63/* * - added SKIPCHUNK conditionals * */
64/* * * */
65/* * 1.0.7 - 03/24/2004 - G.R-P * */
66/* * - added more SKIPCHUNK conditionals * */
67/* * * */
68/* * 1.0.9 - 12/05/2004 - G.Juyn * */
69/* * - added conditional MNG_OPTIMIZE_OBJCLEANUP * */
70/* * * */
71/* * 1.0.10 - 04/08/2007 - G.Juyn * */
72/* * - added support for mPNG proposal * */
73/* * 1.0.10 - 04/12/2007 - G.Juyn * */
74/* * - added support for ANG proposal * */
75/* * * */
76/* ************************************************************************** */
77
78#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
79#pragma option -A /* force ANSI-C */
80#endif
81
82#ifndef _libmng_objects_h_
83#define _libmng_objects_h_
84
85/* ************************************************************************** */
86
87#ifdef MNG_INCLUDE_DISPLAY_PROCS
88
89/* ************************************************************************** */
90
91typedef mng_retcode (*mng_cleanupobject) (mng_datap pData,
92 mng_objectp pHeader);
93
94typedef mng_retcode (*mng_processobject) (mng_datap pData,
95 mng_objectp pHeader);
96
97/* ************************************************************************** */
98
99typedef struct {
100 mng_cleanupobject fCleanup;
101 mng_processobject fProcess;
102 mng_objectp pNext; /* for double-linked list */
103 mng_objectp pPrev;
104 mng_uint32 iFramenr;
105 mng_uint32 iLayernr;
106 mng_uint32 iPlaytime;
107#ifdef MNG_OPTIMIZE_OBJCLEANUP
108 mng_size_t iObjsize;
109#endif
110 } mng_object_header;
111typedef mng_object_header * mng_object_headerp;
112
113/* ************************************************************************** */
114
115typedef struct { /* MNG specification "object-buffer" */
116 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
117 mng_uint32 iRefcount; /* reference counter */
118 mng_bool bFrozen; /* frozen flag */
119 mng_bool bConcrete; /* concrete flag */
120 mng_bool bViewable; /* viewable flag */
121 mng_uint32 iWidth; /* image specifics */
122 mng_uint32 iHeight;
123 mng_uint8 iBitdepth;
124 mng_uint8 iColortype;
125 mng_uint8 iCompression;
126 mng_uint8 iFilter;
127 mng_uint8 iInterlace;
128
129 mng_bool bCorrected; /* indicates if an abstract image
130 has already been color-corrected */
131
132 mng_uint8 iAlphabitdepth; /* used only for JNG images */
133 mng_uint8 iJHDRcompression;
134 mng_uint8 iJHDRinterlace;
135
136 mng_uint8 iPixelsampledepth; /* used with delta-images */
137 mng_uint8 iAlphasampledepth;
138
139 mng_bool bHasPLTE; /* PLTE chunk present */
140 mng_bool bHasTRNS; /* tRNS chunk present */
141 mng_bool bHasGAMA; /* gAMA chunk present */
142 mng_bool bHasCHRM; /* cHRM chunk present */
143 mng_bool bHasSRGB; /* sRGB chunk present */
144 mng_bool bHasICCP; /* iCCP chunk present */
145 mng_bool bHasBKGD; /* bKGD chunk present */
146
147 mng_uint32 iPLTEcount; /* PLTE fields */
148 mng_rgbpaltab aPLTEentries;
149
150 mng_uint16 iTRNSgray; /* tRNS fields */
151 mng_uint16 iTRNSred;
152 mng_uint16 iTRNSgreen;
153 mng_uint16 iTRNSblue;
154 mng_uint32 iTRNScount;
155 mng_uint8arr aTRNSentries;
156
157 mng_uint32 iGamma; /* gAMA fields */
158
159 mng_uint32 iWhitepointx; /* cHRM fields */
160 mng_uint32 iWhitepointy;
161 mng_uint32 iPrimaryredx;
162 mng_uint32 iPrimaryredy;
163 mng_uint32 iPrimarygreenx;
164 mng_uint32 iPrimarygreeny;
165 mng_uint32 iPrimarybluex;
166 mng_uint32 iPrimarybluey;
167
168 mng_uint8 iRenderingintent; /* sRGB fields */
169
170 mng_uint32 iProfilesize; /* iCCP fields */
171 mng_ptr pProfile;
172
173 mng_uint8 iBKGDindex; /* bKGD fields */
174 mng_uint16 iBKGDgray;
175 mng_uint16 iBKGDred;
176 mng_uint16 iBKGDgreen;
177 mng_uint16 iBKGDblue;
178
179 mng_uint32 iSamplesize; /* size of a sample */
180 mng_uint32 iRowsize; /* size of a row of samples */
181 mng_uint32 iImgdatasize; /* size of the sample data buffer */
182 mng_uint8p pImgdata; /* actual sample data buffer */
183
184 } mng_imagedata;
185typedef mng_imagedata * mng_imagedatap;
186
187/* ************************************************************************** */
188
189typedef struct { /* MNG specification "object" */
190 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
191 mng_uint16 iId; /* object-id */
192 mng_bool bFrozen; /* frozen flag */
193 mng_bool bVisible; /* potential visibility flag */
194 mng_bool bViewable; /* viewable flag */
195 mng_bool bValid; /* marks invalid when only reading */
196 mng_int32 iPosx; /* location fields */
197 mng_int32 iPosy;
198 mng_bool bClipped; /* clipping fields */
199 mng_int32 iClipl;
200 mng_int32 iClipr;
201 mng_int32 iClipt;
202 mng_int32 iClipb;
203#ifndef MNG_SKIPCHUNK_MAGN
204 mng_uint8 iMAGN_MethodX; /* magnification (MAGN) */
205 mng_uint8 iMAGN_MethodY;
206 mng_uint16 iMAGN_MX;
207 mng_uint16 iMAGN_MY;
208 mng_uint16 iMAGN_ML;
209 mng_uint16 iMAGN_MR;
210 mng_uint16 iMAGN_MT;
211 mng_uint16 iMAGN_MB;
212#endif
213#ifndef MNG_SKIPCHUNK_PAST
214 mng_int32 iPastx; /* target x/y from previous PAST */
215 mng_int32 iPasty;
216#endif
217 mng_imagedatap pImgbuf; /* the image-data buffer */
218 } mng_image;
219typedef mng_image * mng_imagep;
220
221/* ************************************************************************** */
222
223 /* "on-the-fly" image (= object 0) */
224typedef mng_image mng_ani_image; /* let's (ab)use the general "object" */
225typedef mng_ani_image * mng_ani_imagep; /* that's actualy crucial, so don't change it! */
226
227/* ************************************************************************** */
228
229typedef struct { /* global PLTE object */
230 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
231 mng_uint32 iEntrycount;
232 mng_rgbpaltab aEntries;
233 } mng_ani_plte;
234typedef mng_ani_plte * mng_ani_pltep;
235
236/* ************************************************************************** */
237
238typedef struct { /* global tRNS object */
239 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
240 mng_uint32 iRawlen;
241 mng_uint8arr aRawdata;
242 } mng_ani_trns;
243typedef mng_ani_trns * mng_ani_trnsp;
244
245/* ************************************************************************** */
246
247typedef struct { /* global gAMA object */
248 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
249 mng_bool bEmpty;
250 mng_uint32 iGamma;
251 } mng_ani_gama;
252typedef mng_ani_gama * mng_ani_gamap;
253
254/* ************************************************************************** */
255
256#ifndef MNG_SKIPCHUNK_cHRM
257typedef struct { /* global cHRM object */
258 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
259 mng_bool bEmpty;
260 mng_uint32 iWhitepointx;
261 mng_uint32 iWhitepointy;
262 mng_uint32 iRedx;
263 mng_uint32 iRedy;
264 mng_uint32 iGreenx;
265 mng_uint32 iGreeny;
266 mng_uint32 iBluex;
267 mng_uint32 iBluey;
268 } mng_ani_chrm;
269typedef mng_ani_chrm * mng_ani_chrmp;
270#endif
271
272/* ************************************************************************** */
273
274typedef struct { /* global sRGB object */
275 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
276 mng_bool bEmpty;
277 mng_uint8 iRenderingintent;
278 } mng_ani_srgb;
279typedef mng_ani_srgb * mng_ani_srgbp;
280
281/* ************************************************************************** */
282
283#ifndef MNG_SKIPCHUNK_iCCP
284typedef struct { /* global iCCP object */
285 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
286 mng_bool bEmpty;
287 mng_uint32 iProfilesize;
288 mng_ptr pProfile;
289 } mng_ani_iccp;
290typedef mng_ani_iccp * mng_ani_iccpp;
291#endif
292
293/* ************************************************************************** */
294
295typedef struct { /* global bKGD object */
296 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
297 mng_uint16 iRed;
298 mng_uint16 iGreen;
299 mng_uint16 iBlue;
300 } mng_ani_bkgd;
301typedef mng_ani_bkgd * mng_ani_bkgdp;
302
303/* ************************************************************************** */
304
305typedef struct { /* LOOP object */
306 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
307 mng_uint8 iLevel;
308 mng_uint32 iRepeatcount;
309 mng_uint8 iTermcond;
310 mng_uint32 iItermin;
311 mng_uint32 iItermax;
312 mng_uint32 iCount;
313 mng_uint32p pSignals;
314
315 mng_uint32 iRunningcount; /* running counter */
316 } mng_ani_loop;
317typedef mng_ani_loop * mng_ani_loopp;
318
319/* ************************************************************************** */
320
321typedef struct { /* ENDL object */
322 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
323 mng_uint8 iLevel;
324
325 mng_ani_loopp pLOOP; /* matching LOOP */
326 } mng_ani_endl;
327typedef mng_ani_endl * mng_ani_endlp;
328
329/* ************************************************************************** */
330
331typedef struct { /* DEFI object */
332 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
333 mng_uint16 iId;
334 mng_bool bHasdonotshow;
335 mng_uint8 iDonotshow;
336 mng_bool bHasconcrete;
337 mng_uint8 iConcrete;
338 mng_bool bHasloca;
339 mng_int32 iLocax;
340 mng_int32 iLocay;
341 mng_bool bHasclip;
342 mng_int32 iClipl;
343 mng_int32 iClipr;
344 mng_int32 iClipt;
345 mng_int32 iClipb;
346 } mng_ani_defi;
347typedef mng_ani_defi * mng_ani_defip;
348
349/* ************************************************************************** */
350
351typedef struct { /* BASI object */
352 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
353 mng_uint16 iRed;
354 mng_uint16 iGreen;
355 mng_uint16 iBlue;
356 mng_bool bHasalpha;
357 mng_uint16 iAlpha;
358 mng_uint8 iViewable;
359 } mng_ani_basi;
360typedef mng_ani_basi * mng_ani_basip;
361
362/* ************************************************************************** */
363
364typedef struct { /* CLON object */
365 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
366 mng_uint16 iCloneid;
367 mng_uint16 iSourceid;
368 mng_uint8 iClonetype;
369 mng_bool bHasdonotshow;
370 mng_uint8 iDonotshow;
371 mng_uint8 iConcrete;
372 mng_bool bHasloca;
373 mng_uint8 iLocatype;
374 mng_int32 iLocax;
375 mng_int32 iLocay;
376 } mng_ani_clon;
377typedef mng_ani_clon * mng_ani_clonp;
378
379/* ************************************************************************** */
380
381typedef struct { /* BACK object */
382 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
383 mng_uint16 iRed;
384 mng_uint16 iGreen;
385 mng_uint16 iBlue;
386 mng_uint8 iMandatory;
387 mng_uint16 iImageid;
388 mng_uint8 iTile;
389 } mng_ani_back;
390typedef mng_ani_back * mng_ani_backp;
391
392/* ************************************************************************** */
393
394typedef struct { /* FRAM object */
395 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
396 mng_uint8 iFramemode;
397 mng_uint8 iChangedelay;
398 mng_uint32 iDelay;
399 mng_uint8 iChangetimeout;
400 mng_uint32 iTimeout;
401 mng_uint8 iChangeclipping;
402 mng_uint8 iCliptype;
403 mng_int32 iClipl;
404 mng_int32 iClipr;
405 mng_int32 iClipt;
406 mng_int32 iClipb;
407 } mng_ani_fram;
408typedef mng_ani_fram * mng_ani_framp;
409
410/* ************************************************************************** */
411
412typedef struct { /* MOVE object */
413 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
414 mng_uint16 iFirstid;
415 mng_uint16 iLastid;
416 mng_uint8 iType;
417 mng_int32 iLocax;
418 mng_int32 iLocay;
419 } mng_ani_move;
420typedef mng_ani_move * mng_ani_movep;
421
422/* ************************************************************************** */
423
424typedef struct { /* CLIP object */
425 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
426 mng_uint16 iFirstid;
427 mng_uint16 iLastid;
428 mng_uint8 iType;
429 mng_int32 iClipl;
430 mng_int32 iClipr;
431 mng_int32 iClipt;
432 mng_int32 iClipb;
433 } mng_ani_clip;
434typedef mng_ani_clip * mng_ani_clipp;
435
436/* ************************************************************************** */
437
438typedef struct { /* SHOW object */
439 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
440 mng_uint16 iFirstid;
441 mng_uint16 iLastid;
442 mng_uint8 iMode;
443 } mng_ani_show;
444typedef mng_ani_show * mng_ani_showp;
445
446/* ************************************************************************** */
447
448typedef struct { /* TERM object */
449 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
450 mng_uint8 iTermaction;
451 mng_uint8 iIteraction;
452 mng_uint32 iDelay;
453 mng_uint32 iItermax;
454 } mng_ani_term;
455typedef mng_ani_term * mng_ani_termp;
456
457/* ************************************************************************** */
458
459typedef struct { /* SAVE object */
460 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
461 } mng_ani_save;
462typedef mng_ani_save * mng_ani_savep;
463
464/* ************************************************************************** */
465
466typedef struct { /* SEEK object */
467 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
468 mng_uint32 iSegmentnamesize;
469 mng_pchar zSegmentname;
470 } mng_ani_seek;
471typedef mng_ani_seek * mng_ani_seekp;
472
473/* ************************************************************************** */
474#ifndef MNG_NO_DELTA_PNG
475typedef struct { /* DHDR object */
476 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
477 mng_uint16 iObjectid;
478 mng_uint8 iImagetype;
479 mng_uint8 iDeltatype;
480 mng_uint32 iBlockwidth;
481 mng_uint32 iBlockheight;
482 mng_uint32 iBlockx;
483 mng_uint32 iBlocky;
484 } mng_ani_dhdr;
485typedef mng_ani_dhdr * mng_ani_dhdrp;
486
487/* ************************************************************************** */
488
489typedef struct { /* PROM object */
490 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
491 mng_uint8 iBitdepth;
492 mng_uint8 iColortype;
493 mng_uint8 iFilltype;
494 } mng_ani_prom;
495typedef mng_ani_prom * mng_ani_promp;
496
497/* ************************************************************************** */
498
499typedef struct { /* IPNG object */
500 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
501 } mng_ani_ipng;
502typedef mng_ani_ipng * mng_ani_ipngp;
503
504/* ************************************************************************** */
505
506typedef struct { /* IJNG object */
507 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
508 } mng_ani_ijng;
509typedef mng_ani_ijng * mng_ani_ijngp;
510
511/* ************************************************************************** */
512
513typedef struct { /* PPLT object */
514 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
515 mng_uint8 iType;
516 mng_uint32 iCount;
517 mng_rgbpaltab aIndexentries;
518 mng_uint8arr aAlphaentries;
519 mng_uint8arr aUsedentries;
520 } mng_ani_pplt;
521typedef mng_ani_pplt * mng_ani_ppltp;
522#endif
523
524/* ************************************************************************** */
525
526#ifndef MNG_SKIPCHUNK_MAGN
527typedef struct { /* MAGN object */
528 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
529 mng_uint16 iFirstid;
530 mng_uint16 iLastid;
531 mng_uint8 iMethodX;
532 mng_uint16 iMX;
533 mng_uint16 iMY;
534 mng_uint16 iML;
535 mng_uint16 iMR;
536 mng_uint16 iMT;
537 mng_uint16 iMB;
538 mng_uint8 iMethodY;
539 } mng_ani_magn;
540typedef mng_ani_magn * mng_ani_magnp;
541#endif
542
543/* ************************************************************************** */
544
545#ifndef MNG_SKIPCHUNK_PAST
546typedef struct { /* PAST object */
547 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
548 mng_uint16 iTargetid;
549 mng_uint8 iTargettype;
550 mng_int32 iTargetx;
551 mng_int32 iTargety;
552 mng_uint32 iCount;
553 mng_ptr pSources;
554 } mng_ani_past;
555typedef mng_ani_past * mng_ani_pastp;
556#endif
557
558/* ************************************************************************** */
559
560#ifndef MNG_SKIPCHUNK_DISC
561typedef struct { /* DISC object */
562 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
563 mng_uint32 iCount;
564 mng_uint16p pIds;
565 } mng_ani_disc;
566typedef mng_ani_disc * mng_ani_discp;
567#endif
568
569/* ************************************************************************** */
570
571#ifdef MNG_SUPPORT_DYNAMICMNG
572typedef struct { /* event object */
573 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
574 mng_uint8 iEventtype;
575 mng_uint8 iMasktype;
576 mng_int32 iLeft;
577 mng_int32 iRight;
578 mng_int32 iTop;
579 mng_int32 iBottom;
580 mng_uint16 iObjectid;
581 mng_uint8 iIndex;
582 mng_uint32 iSegmentnamesize;
583 mng_pchar zSegmentname;
584
585 mng_ani_seekp pSEEK; /* SEEK ani object */
586 mng_int32 iLastx; /* last X/Y coordinates */
587 mng_int32 iLasty;
588 } mng_event;
589typedef mng_event * mng_eventp;
590#endif
591
592/* ************************************************************************** */
593
594#ifdef MNG_INCLUDE_MPNG_PROPOSAL
595typedef struct { /* mPNG object */
596 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
597 mng_uint32 iFramewidth;
598 mng_uint32 iFrameheight;
599 mng_uint32 iNumplays;
600 mng_uint16 iTickspersec;
601 mng_uint32 iFramessize;
602 mng_ptr pFrames;
603 } mng_mpng_obj;
604typedef mng_mpng_obj * mng_mpng_objp;
605#endif
606
607/* ************************************************************************** */
608
609#ifdef MNG_INCLUDE_ANG_PROPOSAL
610typedef struct { /* ANG object */
611 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
612 mng_uint32 iNumframes;
613 mng_uint32 iTickspersec;
614 mng_uint32 iNumplays;
615 mng_uint32 iTilewidth;
616 mng_uint32 iTileheight;
617 mng_uint8 iInterlace;
618 mng_uint8 iStillused;
619 mng_uint32 iTilessize;
620 mng_ptr pTiles;
621 } mng_ang_obj;
622typedef mng_ang_obj * mng_ang_objp;
623#endif
624
625/* ************************************************************************** */
626
627#endif /* MNG_INCLUDE_DISPLAY_PROCS */
628
629/* ************************************************************************** */
630
631#endif /* _libmng_objects_h_ */
632
633/* ************************************************************************** */
634/* * end of file * */
635/* ************************************************************************** */
Note: See TracBrowser for help on using the repository browser.