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

Last change on this file was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

  • Property svn:keywords set to Id
File size: 23.8 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 G.Juyn * */
8/* * version : 1.0.0 * */
9/* * * */
10/* * purpose : Internal object structures (definition) * */
11/* * * */
12/* * author : G.Juyn * */
13/* * web : http://www.3-t.com * */
14/* * email : mailto:info@3-t.com * */
15/* * * */
16/* * comment : Definition of the internal object structures * */
17/* * * */
18/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
19/* * - changed strict-ANSI stuff * */
20/* * * */
21/* * 0.5.2 - 05/23/2000 - G.Juyn * */
22/* * - changed inclusion to DISPLAY_PROCS * */
23/* * 0.5.2 - 05/24/2000 - G.Juyn * */
24/* * - added global color-chunks for animations * */
25/* * - added global PLTE,tRNS,bKGD chunks for animation * */
26/* * - added SAVE & SEEK animation objects * */
27/* * 0.5.2 - 05/29/2000 - G.Juyn * */
28/* * - added framenr/layernr/playtime to object header * */
29/* * 0.5.2 - 05/30/2000 - G.Juyn * */
30/* * - added ani-objects for delta-image processing * */
31/* * - added compression/filter/interlace fields to * */
32/* * object-buffer for delta-image processing * */
33/* * * */
34/* * 0.5.3 - 06/17/2000 - G.Juyn * */
35/* * - changed definition of aTRNSentries * */
36/* * 0.5.3 - 06/22/2000 - G.Juyn * */
37/* * - added definition for PPLT animation-processing * */
38/* * * */
39/* * 0.9.2 - 08/05/2000 - G.Juyn * */
40/* * - changed file-prefixes * */
41/* * * */
42/* * 0.9.3 - 08/26/2000 - G.Juyn * */
43/* * - added MAGN chunk * */
44/* * 0.9.3 - 09/10/2000 - G.Juyn * */
45/* * - fixed DEFI behavior * */
46/* * 0.9.3 - 10/16/2000 - G.Juyn * */
47/* * - added support for delta-JNG * */
48/* * 0.9.3 - 10/17/2000 - G.Juyn * */
49/* * - added valid-flag to stored objects for read() / display()* */
50/* * 0.9.3 - 10/19/2000 - G.Juyn * */
51/* * - added storage for pixel-/alpha-sampledepth for delta's * */
52/* * * */
53/* ************************************************************************** */
54
55#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
56#pragma option -A /* force ANSI-C */
57#endif
58
59#ifndef _libmng_objects_h_
60#define _libmng_objects_h_
61
62/* ************************************************************************** */
63
64#ifdef MNG_INCLUDE_DISPLAY_PROCS
65
66/* ************************************************************************** */
67
68typedef mng_retcode (*mng_cleanupobject) (mng_datap pData,
69 mng_objectp pHeader);
70
71typedef mng_retcode (*mng_processobject) (mng_datap pData,
72 mng_objectp pHeader);
73
74/* ************************************************************************** */
75
76typedef struct {
77 mng_cleanupobject fCleanup;
78 mng_processobject fProcess;
79 mng_objectp pNext; /* for double-linked list */
80 mng_objectp pPrev;
81 mng_uint32 iFramenr;
82 mng_uint32 iLayernr;
83 mng_uint32 iPlaytime;
84 } mng_object_header;
85typedef mng_object_header * mng_object_headerp;
86
87/* ************************************************************************** */
88
89typedef struct { /* MNG specification "object-buffer" */
90 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
91 mng_uint32 iRefcount; /* reference counter */
92 mng_bool bFrozen; /* frozen flag */
93 mng_bool bConcrete; /* concrete flag */
94 mng_bool bViewable; /* viewable flag */
95 mng_uint32 iWidth; /* image specifics */
96 mng_uint32 iHeight;
97 mng_uint8 iBitdepth;
98 mng_uint8 iColortype;
99 mng_uint8 iCompression;
100 mng_uint8 iFilter;
101 mng_uint8 iInterlace;
102
103 mng_uint8 iAlphabitdepth; /* used only for JNG images */
104 mng_uint8 iJHDRcompression;
105 mng_uint8 iJHDRinterlace;
106
107 mng_uint8 iPixelsampledepth; /* used with delta-images */
108 mng_uint8 iAlphasampledepth;
109
110 mng_bool bHasPLTE; /* PLTE chunk present */
111 mng_bool bHasTRNS; /* tRNS chunk present */
112 mng_bool bHasGAMA; /* gAMA chunk present */
113 mng_bool bHasCHRM; /* cHRM chunk present */
114 mng_bool bHasSRGB; /* sRGB chunk present */
115 mng_bool bHasICCP; /* iCCP chunk present */
116 mng_bool bHasBKGD; /* bKGD chunk present */
117
118 mng_uint32 iPLTEcount; /* PLTE fields */
119 mng_rgbpaltab aPLTEentries;
120
121 mng_uint16 iTRNSgray; /* tRNS fields */
122 mng_uint16 iTRNSred;
123 mng_uint16 iTRNSgreen;
124 mng_uint16 iTRNSblue;
125 mng_uint32 iTRNScount;
126 mng_uint8arr aTRNSentries;
127
128 mng_uint32 iGamma; /* gAMA fields */
129
130 mng_uint32 iWhitepointx; /* cHRM fields */
131 mng_uint32 iWhitepointy;
132 mng_uint32 iPrimaryredx;
133 mng_uint32 iPrimaryredy;
134 mng_uint32 iPrimarygreenx;
135 mng_uint32 iPrimarygreeny;
136 mng_uint32 iPrimarybluex;
137 mng_uint32 iPrimarybluey;
138
139 mng_uint8 iRenderingintent; /* sRGB fields */
140
141 mng_uint32 iProfilesize; /* iCCP fields */
142 mng_ptr pProfile;
143
144 mng_uint8 iBKGDindex; /* bKGD fields */
145 mng_uint16 iBKGDgray;
146 mng_uint16 iBKGDred;
147 mng_uint16 iBKGDgreen;
148 mng_uint16 iBKGDblue;
149
150 mng_uint32 iSamplesize; /* size of a sample */
151 mng_uint32 iRowsize; /* size of a row of samples */
152 mng_uint32 iImgdatasize; /* size of the sample data buffer */
153 mng_uint8p pImgdata; /* actual sample data buffer */
154
155 } mng_imagedata;
156typedef mng_imagedata * mng_imagedatap;
157
158/* ************************************************************************** */
159
160typedef struct { /* MNG specification "object" */
161 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
162 mng_uint16 iId; /* object-id */
163 mng_bool bFrozen; /* frozen flag */
164 mng_bool bVisible; /* potential visibility flag */
165 mng_bool bViewable; /* viewable flag */
166 mng_bool bValid; /* marks invalid when only reading */
167 mng_int32 iPosx; /* location fields */
168 mng_int32 iPosy;
169 mng_bool bClipped; /* clipping fields */
170 mng_int32 iClipl;
171 mng_int32 iClipr;
172 mng_int32 iClipt;
173 mng_int32 iClipb;
174 mng_uint16 iMAGN_MethodX; /* magnification (MAGN) */
175 mng_uint16 iMAGN_MethodY;
176 mng_uint16 iMAGN_MX;
177 mng_uint16 iMAGN_MY;
178 mng_uint16 iMAGN_ML;
179 mng_uint16 iMAGN_MR;
180 mng_uint16 iMAGN_MT;
181 mng_uint16 iMAGN_MB;
182 mng_imagedatap pImgbuf; /* the image-data buffer */
183 } mng_image;
184typedef mng_image * mng_imagep;
185
186/* ************************************************************************** */
187
188 /* "on-the-fly" image (= object 0) */
189typedef mng_image mng_ani_image; /* let's (ab)use the general "object" */
190typedef mng_ani_image * mng_ani_imagep; /* that's actualy crucial, so don't change it! */
191
192/* ************************************************************************** */
193
194typedef struct { /* global PLTE object */
195 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
196 mng_uint32 iEntrycount;
197 mng_rgbpaltab aEntries;
198 } mng_ani_plte;
199typedef mng_ani_plte * mng_ani_pltep;
200
201/* ************************************************************************** */
202
203typedef struct { /* global tRNS object */
204 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
205 mng_uint32 iRawlen;
206 mng_uint8arr aRawdata;
207 } mng_ani_trns;
208typedef mng_ani_trns * mng_ani_trnsp;
209
210/* ************************************************************************** */
211
212typedef struct { /* global gAMA object */
213 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
214 mng_bool bEmpty;
215 mng_uint32 iGamma;
216 } mng_ani_gama;
217typedef mng_ani_gama * mng_ani_gamap;
218
219/* ************************************************************************** */
220
221typedef struct { /* global gCRM object */
222 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
223 mng_bool bEmpty;
224 mng_uint32 iWhitepointx;
225 mng_uint32 iWhitepointy;
226 mng_uint32 iRedx;
227 mng_uint32 iRedy;
228 mng_uint32 iGreenx;
229 mng_uint32 iGreeny;
230 mng_uint32 iBluex;
231 mng_uint32 iBluey;
232 } mng_ani_chrm;
233typedef mng_ani_chrm * mng_ani_chrmp;
234
235/* ************************************************************************** */
236
237typedef struct { /* global sRGB object */
238 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
239 mng_bool bEmpty;
240 mng_uint8 iRenderingintent;
241 } mng_ani_srgb;
242typedef mng_ani_srgb * mng_ani_srgbp;
243
244/* ************************************************************************** */
245
246typedef struct { /* global iCCP object */
247 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
248 mng_bool bEmpty;
249 mng_uint32 iProfilesize;
250 mng_ptr pProfile;
251 } mng_ani_iccp;
252typedef mng_ani_iccp * mng_ani_iccpp;
253
254/* ************************************************************************** */
255
256typedef struct { /* global bKGD object */
257 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
258 mng_uint16 iRed;
259 mng_uint16 iGreen;
260 mng_uint16 iBlue;
261 } mng_ani_bkgd;
262typedef mng_ani_bkgd * mng_ani_bkgdp;
263
264/* ************************************************************************** */
265
266typedef struct { /* LOOP object */
267 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
268 mng_uint8 iLevel;
269 mng_uint32 iRepeatcount;
270 mng_uint8 iTermcond;
271 mng_uint32 iItermin;
272 mng_uint32 iItermax;
273 mng_uint32 iCount;
274 mng_uint32p pSignals;
275
276 mng_uint32 iRunningcount; /* running counter */
277 } mng_ani_loop;
278typedef mng_ani_loop * mng_ani_loopp;
279
280/* ************************************************************************** */
281
282typedef struct { /* ENDL object */
283 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
284 mng_uint8 iLevel;
285
286 mng_ani_loopp pLOOP; /* matching LOOP */
287 } mng_ani_endl;
288typedef mng_ani_endl * mng_ani_endlp;
289
290/* ************************************************************************** */
291
292typedef struct { /* DEFI object */
293 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
294 mng_uint16 iId;
295 mng_bool bHasdonotshow;
296 mng_uint8 iDonotshow;
297 mng_bool bHasconcrete;
298 mng_uint8 iConcrete;
299 mng_bool bHasloca;
300 mng_int32 iLocax;
301 mng_int32 iLocay;
302 mng_bool bHasclip;
303 mng_int32 iClipl;
304 mng_int32 iClipr;
305 mng_int32 iClipt;
306 mng_int32 iClipb;
307 } mng_ani_defi;
308typedef mng_ani_defi * mng_ani_defip;
309
310/* ************************************************************************** */
311
312typedef struct { /* BASI object */
313 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
314 mng_uint16 iRed;
315 mng_uint16 iGreen;
316 mng_uint16 iBlue;
317 mng_bool bHasalpha;
318 mng_uint16 iAlpha;
319 mng_uint8 iViewable;
320 } mng_ani_basi;
321typedef mng_ani_basi * mng_ani_basip;
322
323/* ************************************************************************** */
324
325typedef struct { /* CLON object */
326 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
327 mng_uint16 iCloneid;
328 mng_uint16 iSourceid;
329 mng_uint8 iClonetype;
330 mng_bool bHasdonotshow;
331 mng_uint8 iDonotshow;
332 mng_uint8 iConcrete;
333 mng_bool bHasloca;
334 mng_uint8 iLocatype;
335 mng_int32 iLocax;
336 mng_int32 iLocay;
337 } mng_ani_clon;
338typedef mng_ani_clon * mng_ani_clonp;
339
340/* ************************************************************************** */
341
342typedef struct { /* BACK object */
343 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
344 mng_uint16 iRed;
345 mng_uint16 iGreen;
346 mng_uint16 iBlue;
347 mng_uint8 iMandatory;
348 mng_uint16 iImageid;
349 mng_uint8 iTile;
350 } mng_ani_back;
351typedef mng_ani_back * mng_ani_backp;
352
353/* ************************************************************************** */
354
355typedef struct { /* FRAM object */
356 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
357 mng_uint8 iFramemode;
358 mng_uint8 iChangedelay;
359 mng_uint32 iDelay;
360 mng_uint8 iChangetimeout;
361 mng_uint32 iTimeout;
362 mng_uint8 iChangeclipping;
363 mng_uint8 iCliptype;
364 mng_int32 iClipl;
365 mng_int32 iClipr;
366 mng_int32 iClipt;
367 mng_int32 iClipb;
368 } mng_ani_fram;
369typedef mng_ani_fram * mng_ani_framp;
370
371/* ************************************************************************** */
372
373typedef struct { /* MOVE object */
374 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
375 mng_uint16 iFirstid;
376 mng_uint16 iLastid;
377 mng_uint8 iType;
378 mng_int32 iLocax;
379 mng_int32 iLocay;
380 } mng_ani_move;
381typedef mng_ani_move * mng_ani_movep;
382
383/* ************************************************************************** */
384
385typedef struct { /* CLIP object */
386 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
387 mng_uint16 iFirstid;
388 mng_uint16 iLastid;
389 mng_uint8 iType;
390 mng_int32 iClipl;
391 mng_int32 iClipr;
392 mng_int32 iClipt;
393 mng_int32 iClipb;
394 } mng_ani_clip;
395typedef mng_ani_clip * mng_ani_clipp;
396
397/* ************************************************************************** */
398
399typedef struct { /* SHOW object */
400 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
401 mng_uint16 iFirstid;
402 mng_uint16 iLastid;
403 mng_uint8 iMode;
404 } mng_ani_show;
405typedef mng_ani_show * mng_ani_showp;
406
407/* ************************************************************************** */
408
409typedef struct { /* TERM object */
410 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
411 mng_uint8 iTermaction;
412 mng_uint8 iIteraction;
413 mng_uint32 iDelay;
414 mng_uint32 iItermax;
415 } mng_ani_term;
416typedef mng_ani_term * mng_ani_termp;
417
418/* ************************************************************************** */
419
420typedef struct { /* SAVE object */
421 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
422 } mng_ani_save;
423typedef mng_ani_save * mng_ani_savep;
424
425/* ************************************************************************** */
426
427typedef struct { /* SEEK object */
428 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
429 } mng_ani_seek;
430typedef mng_ani_seek * mng_ani_seekp;
431
432/* ************************************************************************** */
433
434typedef struct { /* DHDR object */
435 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
436 mng_uint16 iObjectid;
437 mng_uint8 iImagetype;
438 mng_uint8 iDeltatype;
439 mng_uint32 iBlockwidth;
440 mng_uint32 iBlockheight;
441 mng_uint32 iBlockx;
442 mng_uint32 iBlocky;
443 } mng_ani_dhdr;
444typedef mng_ani_dhdr * mng_ani_dhdrp;
445
446/* ************************************************************************** */
447
448typedef struct { /* PROM object */
449 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
450 mng_uint8 iBitdepth;
451 mng_uint8 iColortype;
452 mng_uint8 iFilltype;
453 } mng_ani_prom;
454typedef mng_ani_prom * mng_ani_promp;
455
456/* ************************************************************************** */
457
458typedef struct { /* IPNG object */
459 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
460 } mng_ani_ipng;
461typedef mng_ani_ipng * mng_ani_ipngp;
462
463/* ************************************************************************** */
464
465typedef struct { /* IJNG object */
466 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
467 } mng_ani_ijng;
468typedef mng_ani_ijng * mng_ani_ijngp;
469
470/* ************************************************************************** */
471
472typedef struct { /* PPLT object */
473 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
474 mng_uint8 iType;
475 mng_uint32 iCount;
476 mng_rgbpaltab aIndexentries;
477 mng_uint8arr aAlphaentries;
478 mng_uint8arr aUsedentries;
479 } mng_ani_pplt;
480typedef mng_ani_pplt * mng_ani_ppltp;
481
482/* ************************************************************************** */
483
484typedef struct { /* MAGN object */
485 mng_object_header sHeader; /* default header (DO NOT REMOVE) */
486 mng_uint16 iFirstid;
487 mng_uint16 iLastid;
488 mng_uint16 iMethodX;
489 mng_uint16 iMX;
490 mng_uint16 iMY;
491 mng_uint16 iML;
492 mng_uint16 iMR;
493 mng_uint16 iMT;
494 mng_uint16 iMB;
495 mng_uint16 iMethodY;
496 } mng_ani_magn;
497typedef mng_ani_magn * mng_ani_magnp;
498
499/* ************************************************************************** */
500
501#endif /* MNG_INCLUDE_DISPLAY_PROCS */
502
503/* ************************************************************************** */
504
505#endif /* _libmng_objects_h_ */
506
507/* ************************************************************************** */
508/* * end of file * */
509/* ************************************************************************** */
Note: See TracBrowser for help on using the repository browser.