libmng_chunks.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. /* ************************************************************************** */
  2. /* * For conditions of distribution and use, * */
  3. /* * see copyright notice in libmng.h * */
  4. /* ************************************************************************** */
  5. /* * * */
  6. /* * project : libmng * */
  7. /* * file : libmng_chunks.h copyright (c) 2000-2007 G.Juyn * */
  8. /* * version : 1.0.10 * */
  9. /* * * */
  10. /* * purpose : Chunk structures (definition) * */
  11. /* * * */
  12. /* * author : G.Juyn * */
  13. /* * * */
  14. /* * comment : Definition of known chunk structures * */
  15. /* * * */
  16. /* * changes : 0.5.1 - 05/04/2000 - G.Juyn * */
  17. /* * - put in some extra comments * */
  18. /* * 0.5.1 - 05/06/2000 - G.Juyn * */
  19. /* * - fixed layout for sBIT, PPLT * */
  20. /* * 0.5.1 - 05/08/2000 - G.Juyn * */
  21. /* * - changed write callback definition * */
  22. /* * - changed strict-ANSI stuff * */
  23. /* * 0.5.1 - 05/11/2000 - G.Juyn * */
  24. /* * - fixed layout for PPLT again (missed deltatype ?!?) * */
  25. /* * * */
  26. /* * 0.5.2 - 05/31/2000 - G.Juyn * */
  27. /* * - removed useless definition (contributed by Tim Rowley) * */
  28. /* * 0.5.2 - 06/03/2000 - G.Juyn * */
  29. /* * - fixed makeup for Linux gcc compile * */
  30. /* * * */
  31. /* * 0.9.2 - 08/05/2000 - G.Juyn * */
  32. /* * - changed file-prefixes * */
  33. /* * * */
  34. /* * 0.9.3 - 08/26/2000 - G.Juyn * */
  35. /* * - added MAGN chunk * */
  36. /* * 0.9.3 - 09/10/2000 - G.Juyn * */
  37. /* * - fixed DEFI behavior * */
  38. /* * 0.9.3 - 10/16/2000 - G.Juyn * */
  39. /* * - added JDAA chunk * */
  40. /* * * */
  41. /* * 1.0.5 - 08/19/2002 - G.Juyn * */
  42. /* * - added HLAPI function to copy chunks * */
  43. /* * 1.0.5 - 09/14/2002 - G.Juyn * */
  44. /* * - added event handling for dynamic MNG * */
  45. /* * 1.0.5 - 11/28/2002 - G.Juyn * */
  46. /* * - fixed definition of iMethodX/Y for MAGN chunk * */
  47. /* * * */
  48. /* * 1.0.6 - 05/25/2003 - G.R-P * */
  49. /* * added MNG_SKIPCHUNK_cHNK footprint optimizations * */
  50. /* * 1.0.6 - 07/29/2003 - G.R-P * */
  51. /* * - added conditionals around PAST chunk support * */
  52. /* * * */
  53. /* * 1.0.7 - 03/24/2004 - G.R-P * */
  54. /* * - added conditional around MNG_NO_DELTA_PNG support * */
  55. /* * * */
  56. /* * 1.0.9 - 12/05/2004 - G.Juyn * */
  57. /* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */
  58. /* * 1.0.9 - 12/06/2004 - G.Juyn * */
  59. /* * - added conditional MNG_OPTIMIZE_CHUNKREADER * */
  60. /* * * */
  61. /* * 1.0.10 - 04/08/2007 - G.Juyn * */
  62. /* * - added support for mPNG proposal * */
  63. /* * 1.0.10 - 04/12/2007 - G.Juyn * */
  64. /* * - added support for ANG proposal * */
  65. /* * * */
  66. /* ************************************************************************** */
  67. #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
  68. #pragma option -A /* force ANSI-C */
  69. #endif
  70. #ifndef _libmng_chunks_h_
  71. #define _libmng_chunks_h_
  72. /* ************************************************************************** */
  73. #ifdef MNG_SWAP_ENDIAN
  74. #define PNG_SIG 0x474e5089L
  75. #define JNG_SIG 0x474e4a8bL
  76. #define MNG_SIG 0x474e4d8aL
  77. #define POST_SIG 0x0a1a0a0dL
  78. #else
  79. #define PNG_SIG 0x89504e47L
  80. #define JNG_SIG 0x8b4a4e47L
  81. #define MNG_SIG 0x8a4d4e47L
  82. #define POST_SIG 0x0d0a1a0aL
  83. #endif
  84. /* ************************************************************************** */
  85. #ifdef MNG_OPTIMIZE_CHUNKREADER
  86. typedef mng_retcode (*mng_f_specialfunc) (mng_datap pData,
  87. mng_chunkp pChunk,
  88. mng_uint32* piRawlen,
  89. mng_uint8p* ppRawdata);
  90. typedef mng_retcode (*mng_c_specialfunc) (mng_datap pData,
  91. mng_chunkp pChunk);
  92. #define MNG_FIELD_OPTIONAL 0x0001
  93. #define MNG_FIELD_TERMINATOR 0x0002
  94. #define MNG_FIELD_REPETITIVE 0x0004
  95. #define MNG_FIELD_DEFLATED 0x0008
  96. #define MNG_FIELD_IFIMGTYPES 0x01F0 /* image-type mask */
  97. #define MNG_FIELD_IFIMGTYPE0 0x0010
  98. #define MNG_FIELD_IFIMGTYPE2 0x0020
  99. #define MNG_FIELD_IFIMGTYPE3 0x0040
  100. #define MNG_FIELD_IFIMGTYPE4 0x0080
  101. #define MNG_FIELD_IFIMGTYPE6 0x0100
  102. #define MNG_FIELD_PUTIMGTYPE 0x0200
  103. #define MNG_FIELD_NOHIGHBIT 0x0400
  104. #define MNG_FIELD_GROUPMASK 0x7000
  105. #define MNG_FIELD_GROUP1 0x1000
  106. #define MNG_FIELD_GROUP2 0x2000
  107. #define MNG_FIELD_GROUP3 0x3000
  108. #define MNG_FIELD_GROUP4 0x4000
  109. #define MNG_FIELD_GROUP5 0x5000
  110. #define MNG_FIELD_GROUP6 0x6000
  111. #define MNG_FIELD_GROUP7 0x7000
  112. #define MNG_FIELD_INT 0x8000
  113. typedef struct { /* chunk-field descriptor */
  114. mng_f_specialfunc pSpecialfunc;
  115. mng_uint16 iFlags;
  116. mng_uint16 iMinvalue;
  117. mng_uint16 iMaxvalue;
  118. mng_uint16 iLengthmin;
  119. mng_uint16 iLengthmax;
  120. mng_uint16 iOffsetchunk;
  121. mng_uint16 iOffsetchunkind;
  122. mng_uint16 iOffsetchunklen;
  123. } mng_field_descriptor;
  124. typedef mng_field_descriptor * mng_field_descp;
  125. #define MNG_DESCR_GLOBAL 0x0001
  126. #define MNG_DESCR_EMPTY 0x0002
  127. #define MNG_DESCR_EMPTYEMBED 0x0006
  128. #define MNG_DESCR_EMPTYGLOBAL 0x000A
  129. #define MNG_DESCR_GenHDR 0x0001 /* IHDR/JHDR/BASI/DHDR */
  130. #define MNG_DESCR_JngHDR 0x0002 /* JHDR/DHDR */
  131. #define MNG_DESCR_MHDR 0x0004
  132. #define MNG_DESCR_IHDR 0x0008
  133. #define MNG_DESCR_JHDR 0x0010
  134. #define MNG_DESCR_DHDR 0x0020
  135. #define MNG_DESCR_LOOP 0x0040
  136. #define MNG_DESCR_PLTE 0x0080
  137. #define MNG_DESCR_SAVE 0x0100
  138. #define MNG_DESCR_NOIHDR 0x0001
  139. #define MNG_DESCR_NOJHDR 0x0002
  140. #define MNG_DESCR_NOBASI 0x0004
  141. #define MNG_DESCR_NODHDR 0x0008
  142. #define MNG_DESCR_NOIDAT 0x0010
  143. #define MNG_DESCR_NOJDAT 0x0020
  144. #define MNG_DESCR_NOJDAA 0x0040
  145. #define MNG_DESCR_NOPLTE 0x0080
  146. #define MNG_DESCR_NOJSEP 0x0100
  147. #define MNG_DESCR_NOMHDR 0x0200
  148. #define MNG_DESCR_NOTERM 0x0400
  149. #define MNG_DESCR_NOLOOP 0x0800
  150. #define MNG_DESCR_NOSAVE 0x1000
  151. typedef struct { /* chunk descriptor */
  152. mng_imgtype eImgtype;
  153. mng_createobjtype eCreateobject;
  154. mng_uint16 iObjsize;
  155. mng_uint16 iOffsetempty;
  156. mng_ptr pObjcleanup;
  157. mng_ptr pObjprocess;
  158. mng_c_specialfunc pSpecialfunc;
  159. mng_field_descp pFielddesc;
  160. mng_uint16 iFielddesc;
  161. mng_uint16 iAllowed;
  162. mng_uint16 iMusthaves;
  163. mng_uint16 iMustNOThaves;
  164. } mng_chunk_descriptor;
  165. typedef mng_chunk_descriptor * mng_chunk_descp;
  166. #endif /* MNG_OPTIMIZE_CHUNKREADER */
  167. /* ************************************************************************** */
  168. typedef mng_retcode (*mng_createchunk) (mng_datap pData,
  169. mng_chunkp pHeader,
  170. mng_chunkp* ppChunk);
  171. typedef mng_retcode (*mng_cleanupchunk) (mng_datap pData,
  172. mng_chunkp pHeader);
  173. typedef mng_retcode (*mng_readchunk) (mng_datap pData,
  174. mng_chunkp pHeader,
  175. mng_uint32 iRawlen,
  176. mng_uint8p pRawdata,
  177. mng_chunkp* pChunk);
  178. typedef mng_retcode (*mng_writechunk) (mng_datap pData,
  179. mng_chunkp pChunk);
  180. typedef mng_retcode (*mng_assignchunk) (mng_datap pData,
  181. mng_chunkp pChunkto,
  182. mng_chunkp pChunkfrom);
  183. /* ************************************************************************** */
  184. typedef struct { /* generic header */
  185. mng_chunkid iChunkname;
  186. mng_createchunk fCreate;
  187. mng_cleanupchunk fCleanup;
  188. mng_readchunk fRead;
  189. mng_writechunk fWrite;
  190. mng_assignchunk fAssign;
  191. mng_chunkp pNext; /* for double-linked list */
  192. mng_chunkp pPrev;
  193. #ifdef MNG_OPTIMIZE_CHUNKINITFREE
  194. mng_size_t iChunksize;
  195. #endif
  196. #ifdef MNG_OPTIMIZE_CHUNKREADER
  197. mng_chunk_descp pChunkdescr;
  198. #endif
  199. } mng_chunk_header;
  200. typedef mng_chunk_header * mng_chunk_headerp;
  201. /* ************************************************************************** */
  202. typedef struct { /* IHDR */
  203. mng_chunk_header sHeader;
  204. mng_uint32 iWidth;
  205. mng_uint32 iHeight;
  206. mng_uint8 iBitdepth;
  207. mng_uint8 iColortype;
  208. mng_uint8 iCompression;
  209. mng_uint8 iFilter;
  210. mng_uint8 iInterlace;
  211. } mng_ihdr;
  212. typedef mng_ihdr * mng_ihdrp;
  213. /* ************************************************************************** */
  214. typedef struct { /* PLTE */
  215. mng_chunk_header sHeader;
  216. mng_bool bEmpty;
  217. mng_uint32 iEntrycount;
  218. mng_rgbpaltab aEntries;
  219. } mng_plte;
  220. typedef mng_plte * mng_pltep;
  221. /* ************************************************************************** */
  222. typedef struct { /* IDAT */
  223. mng_chunk_header sHeader;
  224. mng_bool bEmpty;
  225. mng_uint32 iDatasize;
  226. mng_ptr pData;
  227. } mng_idat;
  228. typedef mng_idat * mng_idatp;
  229. /* ************************************************************************** */
  230. typedef struct { /* IEND */
  231. mng_chunk_header sHeader;
  232. } mng_iend;
  233. typedef mng_iend * mng_iendp;
  234. /* ************************************************************************** */
  235. typedef struct { /* tRNS */
  236. mng_chunk_header sHeader;
  237. mng_bool bEmpty;
  238. mng_bool bGlobal;
  239. mng_uint8 iType; /* colortype (0,2,3) */
  240. mng_uint32 iCount;
  241. mng_uint8arr aEntries;
  242. mng_uint16 iGray;
  243. mng_uint16 iRed;
  244. mng_uint16 iGreen;
  245. mng_uint16 iBlue;
  246. mng_uint32 iRawlen;
  247. mng_uint8arr aRawdata;
  248. } mng_trns;
  249. typedef mng_trns * mng_trnsp;
  250. /* ************************************************************************** */
  251. typedef struct { /* gAMA */
  252. mng_chunk_header sHeader;
  253. mng_bool bEmpty;
  254. mng_uint32 iGamma;
  255. } mng_gama;
  256. typedef mng_gama * mng_gamap;
  257. /* ************************************************************************** */
  258. #ifndef MNG_SKIPCHUNK_cHRM
  259. typedef struct { /* cHRM */
  260. mng_chunk_header sHeader;
  261. mng_bool bEmpty;
  262. mng_uint32 iWhitepointx;
  263. mng_uint32 iWhitepointy;
  264. mng_uint32 iRedx;
  265. mng_uint32 iRedy;
  266. mng_uint32 iGreenx;
  267. mng_uint32 iGreeny;
  268. mng_uint32 iBluex;
  269. mng_uint32 iBluey;
  270. } mng_chrm;
  271. typedef mng_chrm * mng_chrmp;
  272. #endif
  273. /* ************************************************************************** */
  274. typedef struct { /* sRGB */
  275. mng_chunk_header sHeader;
  276. mng_bool bEmpty;
  277. mng_uint8 iRenderingintent;
  278. } mng_srgb;
  279. typedef mng_srgb * mng_srgbp;
  280. /* ************************************************************************** */
  281. #ifndef MNG_SKIPCHUNK_iCCP
  282. typedef struct { /* iCCP */
  283. mng_chunk_header sHeader;
  284. mng_bool bEmpty;
  285. mng_uint32 iNamesize;
  286. mng_pchar zName;
  287. mng_uint8 iCompression;
  288. mng_uint32 iProfilesize;
  289. mng_ptr pProfile;
  290. } mng_iccp;
  291. typedef mng_iccp * mng_iccpp;
  292. #endif
  293. /* ************************************************************************** */
  294. #ifndef MNG_SKIPCHUNK_tEXt
  295. typedef struct { /* tEXt */
  296. mng_chunk_header sHeader;
  297. mng_uint32 iKeywordsize;
  298. mng_pchar zKeyword;
  299. mng_uint32 iTextsize;
  300. mng_pchar zText;
  301. } mng_text;
  302. typedef mng_text * mng_textp;
  303. #endif
  304. /* ************************************************************************** */
  305. #ifndef MNG_SKIPCHUNK_zTXt
  306. typedef struct { /* zTXt */
  307. mng_chunk_header sHeader;
  308. mng_uint32 iKeywordsize;
  309. mng_pchar zKeyword;
  310. mng_uint8 iCompression;
  311. mng_uint32 iTextsize;
  312. mng_pchar zText;
  313. } mng_ztxt;
  314. typedef mng_ztxt * mng_ztxtp;
  315. #endif
  316. /* ************************************************************************** */
  317. #ifndef MNG_SKIPCHUNK_iTXt
  318. typedef struct { /* iTXt */
  319. mng_chunk_header sHeader;
  320. mng_uint32 iKeywordsize;
  321. mng_pchar zKeyword;
  322. mng_uint8 iCompressionflag;
  323. mng_uint8 iCompressionmethod;
  324. mng_uint32 iLanguagesize;
  325. mng_pchar zLanguage;
  326. mng_uint32 iTranslationsize;
  327. mng_pchar zTranslation;
  328. mng_uint32 iTextsize;
  329. mng_pchar zText;
  330. } mng_itxt;
  331. typedef mng_itxt * mng_itxtp;
  332. #endif
  333. /* ************************************************************************** */
  334. #ifndef MNG_SKIPCHUNK_bKGD
  335. typedef struct { /* bKGD */
  336. mng_chunk_header sHeader;
  337. mng_bool bEmpty;
  338. mng_uint8 iType; /* 3=indexed, 0=gray, 2=rgb */
  339. mng_uint8 iIndex;
  340. mng_uint16 iGray;
  341. mng_uint16 iRed;
  342. mng_uint16 iGreen;
  343. mng_uint16 iBlue;
  344. } mng_bkgd;
  345. typedef mng_bkgd * mng_bkgdp;
  346. #endif
  347. /* ************************************************************************** */
  348. #ifndef MNG_SKIPCHUNK_pHYs
  349. typedef struct { /* pHYs */
  350. mng_chunk_header sHeader;
  351. mng_bool bEmpty;
  352. mng_uint32 iSizex;
  353. mng_uint32 iSizey;
  354. mng_uint8 iUnit;
  355. } mng_phys;
  356. typedef mng_phys * mng_physp;
  357. #endif
  358. /* ************************************************************************** */
  359. #ifndef MNG_SKIPCHUNK_sBIT
  360. typedef struct { /* sBIT */
  361. mng_chunk_header sHeader;
  362. mng_bool bEmpty;
  363. mng_uint8 iType; /* colortype (0,2,3,4,6,10,12,14,16) */
  364. mng_uint8arr4 aBits;
  365. } mng_sbit;
  366. typedef mng_sbit * mng_sbitp;
  367. #endif
  368. /* ************************************************************************** */
  369. #ifndef MNG_SKIPCHUNK_sPLT
  370. typedef struct { /* sPLT */
  371. mng_chunk_header sHeader;
  372. mng_bool bEmpty;
  373. mng_uint32 iNamesize;
  374. mng_pchar zName;
  375. mng_uint8 iSampledepth;
  376. mng_uint32 iEntrycount;
  377. mng_ptr pEntries;
  378. } mng_splt;
  379. typedef mng_splt * mng_spltp;
  380. #endif
  381. /* ************************************************************************** */
  382. #ifndef MNG_SKIPCHUNK_hIST
  383. typedef struct { /* hIST */
  384. mng_chunk_header sHeader;
  385. mng_uint32 iEntrycount;
  386. mng_uint16arr aEntries;
  387. } mng_hist;
  388. typedef mng_hist * mng_histp;
  389. #endif
  390. /* ************************************************************************** */
  391. #ifndef MNG_SKIPCHUNK_tIME
  392. typedef struct { /* tIME */
  393. mng_chunk_header sHeader;
  394. mng_uint16 iYear;
  395. mng_uint8 iMonth;
  396. mng_uint8 iDay;
  397. mng_uint8 iHour;
  398. mng_uint8 iMinute;
  399. mng_uint8 iSecond;
  400. } mng_time;
  401. typedef mng_time * mng_timep;
  402. #endif
  403. /* ************************************************************************** */
  404. typedef struct { /* MHDR */
  405. mng_chunk_header sHeader;
  406. mng_uint32 iWidth;
  407. mng_uint32 iHeight;
  408. mng_uint32 iTicks;
  409. mng_uint32 iLayercount;
  410. mng_uint32 iFramecount;
  411. mng_uint32 iPlaytime;
  412. mng_uint32 iSimplicity;
  413. } mng_mhdr;
  414. typedef mng_mhdr * mng_mhdrp;
  415. /* ************************************************************************** */
  416. typedef struct { /* MEND */
  417. mng_chunk_header sHeader;
  418. } mng_mend;
  419. typedef mng_mend * mng_mendp;
  420. /* ************************************************************************** */
  421. typedef struct { /* LOOP */
  422. mng_chunk_header sHeader;
  423. mng_uint8 iLevel;
  424. mng_uint32 iRepeat;
  425. mng_uint8 iTermination;
  426. mng_uint32 iItermin;
  427. mng_uint32 iItermax;
  428. mng_uint32 iCount;
  429. mng_uint32p pSignals;
  430. } mng_loop;
  431. typedef mng_loop * mng_loopp;
  432. /* ************************************************************************** */
  433. typedef struct { /* ENDL */
  434. mng_chunk_header sHeader;
  435. mng_uint8 iLevel;
  436. } mng_endl;
  437. typedef mng_endl * mng_endlp;
  438. /* ************************************************************************** */
  439. typedef struct { /* DEFI */
  440. mng_chunk_header sHeader;
  441. mng_uint16 iObjectid;
  442. mng_bool bHasdonotshow;
  443. mng_uint8 iDonotshow;
  444. mng_bool bHasconcrete;
  445. mng_uint8 iConcrete;
  446. mng_bool bHasloca;
  447. mng_int32 iXlocation;
  448. mng_int32 iYlocation;
  449. mng_bool bHasclip;
  450. mng_int32 iLeftcb;
  451. mng_int32 iRightcb;
  452. mng_int32 iTopcb;
  453. mng_int32 iBottomcb;
  454. } mng_defi;
  455. typedef mng_defi * mng_defip;
  456. /* ************************************************************************** */
  457. typedef struct { /* BASI */
  458. mng_chunk_header sHeader;
  459. mng_uint32 iWidth;
  460. mng_uint32 iHeight;
  461. mng_uint8 iBitdepth;
  462. mng_uint8 iColortype;
  463. mng_uint8 iCompression;
  464. mng_uint8 iFilter;
  465. mng_uint8 iInterlace;
  466. mng_uint16 iRed;
  467. mng_uint16 iGreen;
  468. mng_uint16 iBlue;
  469. #ifdef MNG_OPTIMIZE_CHUNKREADER
  470. mng_bool bHasalpha;
  471. #endif
  472. mng_uint16 iAlpha;
  473. mng_uint8 iViewable;
  474. } mng_basi;
  475. typedef mng_basi * mng_basip;
  476. /* ************************************************************************** */
  477. typedef struct { /* CLON */
  478. mng_chunk_header sHeader;
  479. mng_uint16 iSourceid;
  480. mng_uint16 iCloneid;
  481. mng_uint8 iClonetype;
  482. #ifdef MNG_OPTIMIZE_CHUNKREADER
  483. mng_bool bHasdonotshow;
  484. #endif
  485. mng_uint8 iDonotshow;
  486. mng_uint8 iConcrete;
  487. mng_bool bHasloca;
  488. mng_uint8 iLocationtype;
  489. mng_int32 iLocationx;
  490. mng_int32 iLocationy;
  491. } mng_clon;
  492. typedef mng_clon * mng_clonp;
  493. /* ************************************************************************** */
  494. #ifndef MNG_SKIPCHUNK_PAST
  495. typedef struct { /* PAST source */
  496. mng_uint16 iSourceid;
  497. mng_uint8 iComposition;
  498. mng_uint8 iOrientation;
  499. mng_uint8 iOffsettype;
  500. mng_int32 iOffsetx;
  501. mng_int32 iOffsety;
  502. mng_uint8 iBoundarytype;
  503. mng_int32 iBoundaryl;
  504. mng_int32 iBoundaryr;
  505. mng_int32 iBoundaryt;
  506. mng_int32 iBoundaryb;
  507. } mng_past_source;
  508. typedef mng_past_source * mng_past_sourcep;
  509. typedef struct { /* PAST */
  510. mng_chunk_header sHeader;
  511. mng_uint16 iDestid;
  512. mng_uint8 iTargettype;
  513. mng_int32 iTargetx;
  514. mng_int32 iTargety;
  515. mng_uint32 iCount;
  516. mng_past_sourcep pSources;
  517. } mng_past;
  518. typedef mng_past * mng_pastp;
  519. #endif
  520. /* ************************************************************************** */
  521. typedef struct { /* DISC */
  522. mng_chunk_header sHeader;
  523. mng_uint32 iCount;
  524. mng_uint16p pObjectids;
  525. } mng_disc;
  526. typedef mng_disc * mng_discp;
  527. /* ************************************************************************** */
  528. typedef struct { /* BACK */
  529. mng_chunk_header sHeader;
  530. mng_uint16 iRed;
  531. mng_uint16 iGreen;
  532. mng_uint16 iBlue;
  533. mng_uint8 iMandatory;
  534. mng_uint16 iImageid;
  535. mng_uint8 iTile;
  536. } mng_back;
  537. typedef mng_back * mng_backp;
  538. /* ************************************************************************** */
  539. typedef struct { /* FRAM */
  540. mng_chunk_header sHeader;
  541. mng_bool bEmpty;
  542. mng_uint8 iMode;
  543. mng_uint32 iNamesize;
  544. mng_pchar zName;
  545. mng_uint8 iChangedelay;
  546. mng_uint8 iChangetimeout;
  547. mng_uint8 iChangeclipping;
  548. mng_uint8 iChangesyncid;
  549. mng_uint32 iDelay;
  550. mng_uint32 iTimeout;
  551. mng_uint8 iBoundarytype;
  552. mng_int32 iBoundaryl;
  553. mng_int32 iBoundaryr;
  554. mng_int32 iBoundaryt;
  555. mng_int32 iBoundaryb;
  556. mng_uint32 iCount;
  557. mng_uint32p pSyncids;
  558. } mng_fram;
  559. typedef mng_fram * mng_framp;
  560. /* ************************************************************************** */
  561. typedef struct { /* MOVE */
  562. mng_chunk_header sHeader;
  563. mng_uint16 iFirstid;
  564. mng_uint16 iLastid;
  565. mng_uint8 iMovetype;
  566. mng_int32 iMovex;
  567. mng_int32 iMovey;
  568. } mng_move;
  569. typedef mng_move * mng_movep;
  570. /* ************************************************************************** */
  571. typedef struct { /* CLIP */
  572. mng_chunk_header sHeader;
  573. mng_uint16 iFirstid;
  574. mng_uint16 iLastid;
  575. mng_uint8 iCliptype;
  576. mng_int32 iClipl;
  577. mng_int32 iClipr;
  578. mng_int32 iClipt;
  579. mng_int32 iClipb;
  580. } mng_clip;
  581. typedef mng_clip * mng_clipp;
  582. /* ************************************************************************** */
  583. typedef struct { /* SHOW */
  584. mng_chunk_header sHeader;
  585. mng_bool bEmpty;
  586. mng_uint16 iFirstid;
  587. #ifdef MNG_OPTIMIZE_CHUNKREADER
  588. mng_bool bHaslastid;
  589. #endif
  590. mng_uint16 iLastid;
  591. mng_uint8 iMode;
  592. } mng_show;
  593. typedef mng_show * mng_showp;
  594. /* ************************************************************************** */
  595. typedef struct { /* TERM */
  596. mng_chunk_header sHeader;
  597. mng_uint8 iTermaction;
  598. mng_uint8 iIteraction;
  599. mng_uint32 iDelay;
  600. mng_uint32 iItermax;
  601. } mng_term;
  602. typedef mng_term * mng_termp;
  603. /* ************************************************************************** */
  604. #ifndef MNG_SKIPCHUNK_SAVE
  605. typedef struct { /* SAVE entry */
  606. mng_uint8 iEntrytype;
  607. mng_uint32arr2 iOffset; /* 0=MSI, 1=LSI */
  608. mng_uint32arr2 iStarttime; /* 0=MSI, 1=LSI */
  609. mng_uint32 iLayernr;
  610. mng_uint32 iFramenr;
  611. mng_uint32 iNamesize;
  612. mng_pchar zName;
  613. } mng_save_entry;
  614. typedef mng_save_entry * mng_save_entryp;
  615. typedef struct { /* SAVE */
  616. mng_chunk_header sHeader;
  617. mng_bool bEmpty;
  618. mng_uint8 iOffsettype;
  619. mng_uint32 iCount;
  620. mng_save_entryp pEntries;
  621. } mng_save;
  622. typedef mng_save * mng_savep;
  623. #endif
  624. /* ************************************************************************** */
  625. #ifndef MNG_SKIPCHUNK_SEEK
  626. typedef struct { /* SEEK */
  627. mng_chunk_header sHeader;
  628. mng_uint32 iNamesize;
  629. mng_pchar zName;
  630. } mng_seek;
  631. typedef mng_seek * mng_seekp;
  632. #endif
  633. /* ************************************************************************** */
  634. #ifndef MNG_SKIPCHUNK_eXPI
  635. typedef struct { /* eXPI */
  636. mng_chunk_header sHeader;
  637. mng_uint16 iSnapshotid;
  638. mng_uint32 iNamesize;
  639. mng_pchar zName;
  640. } mng_expi;
  641. typedef mng_expi * mng_expip;
  642. #endif
  643. /* ************************************************************************** */
  644. #ifndef MNG_SKIPCHUNK_fPRI
  645. typedef struct { /* fPRI */
  646. mng_chunk_header sHeader;
  647. mng_uint8 iDeltatype;
  648. mng_uint8 iPriority;
  649. } mng_fpri;
  650. typedef mng_fpri * mng_fprip;
  651. #endif
  652. /* ************************************************************************** */
  653. #ifndef MNG_SKIPCHUNK_nEED
  654. typedef struct { /* nEED */
  655. mng_chunk_header sHeader;
  656. mng_uint32 iKeywordssize;
  657. mng_pchar zKeywords;
  658. } mng_need;
  659. typedef mng_need * mng_needp;
  660. #endif
  661. /* ************************************************************************** */
  662. #ifndef MNG_SKIPCHUNK_pHYg
  663. typedef mng_phys mng_phyg; /* pHYg */
  664. typedef mng_phyg * mng_phygp;
  665. #endif
  666. /* ************************************************************************** */
  667. #ifdef MNG_INCLUDE_JNG
  668. typedef struct { /* JHDR */
  669. mng_chunk_header sHeader;
  670. mng_uint32 iWidth;
  671. mng_uint32 iHeight;
  672. mng_uint8 iColortype;
  673. mng_uint8 iImagesampledepth;
  674. mng_uint8 iImagecompression;
  675. mng_uint8 iImageinterlace;
  676. mng_uint8 iAlphasampledepth;
  677. mng_uint8 iAlphacompression;
  678. mng_uint8 iAlphafilter;
  679. mng_uint8 iAlphainterlace;
  680. } mng_jhdr;
  681. typedef mng_jhdr * mng_jhdrp;
  682. /* ************************************************************************** */
  683. typedef mng_idat mng_jdaa; /* JDAA */
  684. typedef mng_jdaa * mng_jdaap;
  685. /* ************************************************************************** */
  686. typedef mng_idat mng_jdat; /* JDAT */
  687. typedef mng_jdat * mng_jdatp;
  688. /* ************************************************************************** */
  689. typedef struct { /* JSEP */
  690. mng_chunk_header sHeader;
  691. } mng_jsep;
  692. typedef mng_jsep * mng_jsepp;
  693. #endif /* MNG_INCLUDE_JNG */
  694. /* ************************************************************************** */
  695. #ifndef MNG_NO_DELTA_PNG
  696. typedef struct { /* DHDR */
  697. mng_chunk_header sHeader;
  698. mng_uint16 iObjectid;
  699. mng_uint8 iImagetype;
  700. mng_uint8 iDeltatype;
  701. #ifdef MNG_OPTIMIZE_CHUNKREADER
  702. mng_bool bHasblocksize;
  703. #endif
  704. mng_uint32 iBlockwidth;
  705. mng_uint32 iBlockheight;
  706. #ifdef MNG_OPTIMIZE_CHUNKREADER
  707. mng_bool bHasblockloc;
  708. #endif
  709. mng_uint32 iBlockx;
  710. mng_uint32 iBlocky;
  711. } mng_dhdr;
  712. typedef mng_dhdr * mng_dhdrp;
  713. /* ************************************************************************** */
  714. typedef struct { /* PROM */
  715. mng_chunk_header sHeader;
  716. mng_uint8 iColortype;
  717. mng_uint8 iSampledepth;
  718. mng_uint8 iFilltype;
  719. } mng_prom;
  720. typedef mng_prom * mng_promp;
  721. /* ************************************************************************** */
  722. typedef struct { /* IPNG */
  723. mng_chunk_header sHeader;
  724. } mng_ipng;
  725. typedef mng_ipng *mng_ipngp;
  726. /* ************************************************************************** */
  727. typedef struct { /* PPLT entry */
  728. mng_uint8 iRed;
  729. mng_uint8 iGreen;
  730. mng_uint8 iBlue;
  731. mng_uint8 iAlpha;
  732. mng_bool bUsed;
  733. } mng_pplt_entry;
  734. typedef mng_pplt_entry * mng_pplt_entryp;
  735. typedef struct { /* PPLT */
  736. mng_chunk_header sHeader;
  737. mng_uint8 iDeltatype;
  738. mng_uint32 iCount;
  739. mng_pplt_entry aEntries [256];
  740. } mng_pplt;
  741. typedef mng_pplt * mng_ppltp;
  742. /* ************************************************************************** */
  743. typedef struct { /* IJNG */
  744. mng_chunk_header sHeader;
  745. } mng_ijng;
  746. typedef mng_ijng *mng_ijngp;
  747. /* ************************************************************************** */
  748. typedef struct { /* DROP */
  749. mng_chunk_header sHeader;
  750. mng_uint32 iCount;
  751. mng_chunkidp pChunknames;
  752. } mng_drop;
  753. typedef mng_drop * mng_dropp;
  754. /* ************************************************************************** */
  755. #ifndef MNG_SKIPCHUNK_DBYK
  756. typedef struct { /* DBYK */
  757. mng_chunk_header sHeader;
  758. mng_chunkid iChunkname;
  759. mng_uint8 iPolarity;
  760. mng_uint32 iKeywordssize;
  761. mng_pchar zKeywords;
  762. } mng_dbyk;
  763. typedef mng_dbyk * mng_dbykp;
  764. #endif
  765. /* ************************************************************************** */
  766. #ifndef MNG_SKIPCHUNK_ORDR
  767. typedef struct { /* ORDR entry */
  768. mng_chunkid iChunkname;
  769. mng_uint8 iOrdertype;
  770. } mng_ordr_entry;
  771. typedef mng_ordr_entry * mng_ordr_entryp;
  772. typedef struct mng_ordr_struct { /* ORDR */
  773. mng_chunk_header sHeader;
  774. mng_uint32 iCount;
  775. mng_ordr_entryp pEntries;
  776. } mng_ordr;
  777. typedef mng_ordr * mng_ordrp;
  778. #endif
  779. #endif /* MNG_NO_DELTA_PNG */
  780. /* ************************************************************************** */
  781. typedef struct { /* MAGN */
  782. mng_chunk_header sHeader;
  783. mng_uint16 iFirstid;
  784. mng_uint16 iLastid;
  785. mng_uint8 iMethodX;
  786. mng_uint16 iMX;
  787. mng_uint16 iMY;
  788. mng_uint16 iML;
  789. mng_uint16 iMR;
  790. mng_uint16 iMT;
  791. mng_uint16 iMB;
  792. mng_uint8 iMethodY;
  793. } mng_magn;
  794. typedef mng_magn * mng_magnp;
  795. /* ************************************************************************** */
  796. typedef struct { /* evNT entry */
  797. mng_uint8 iEventtype;
  798. mng_uint8 iMasktype;
  799. mng_int32 iLeft;
  800. mng_int32 iRight;
  801. mng_int32 iTop;
  802. mng_int32 iBottom;
  803. mng_uint16 iObjectid;
  804. mng_uint8 iIndex;
  805. mng_uint32 iSegmentnamesize;
  806. mng_pchar zSegmentname;
  807. } mng_evnt_entry;
  808. typedef mng_evnt_entry * mng_evnt_entryp;
  809. typedef struct { /* evNT */
  810. mng_chunk_header sHeader;
  811. mng_uint32 iCount;
  812. mng_evnt_entryp pEntries;
  813. } mng_evnt;
  814. typedef mng_evnt * mng_evntp;
  815. /* ************************************************************************** */
  816. #ifdef MNG_INCLUDE_MPNG_PROPOSAL
  817. typedef struct { /* mpNG frame */
  818. mng_uint32 iX;
  819. mng_uint32 iY;
  820. mng_uint32 iWidth;
  821. mng_uint32 iHeight;
  822. mng_int32 iXoffset;
  823. mng_int32 iYoffset;
  824. mng_uint16 iTicks;
  825. } mng_mpng_frame;
  826. typedef mng_mpng_frame * mng_mpng_framep;
  827. typedef struct { /* mpNG */
  828. mng_chunk_header sHeader;
  829. mng_uint32 iFramewidth;
  830. mng_uint32 iFrameheight;
  831. mng_uint16 iNumplays;
  832. mng_uint16 iTickspersec;
  833. mng_uint8 iCompressionmethod;
  834. mng_uint32 iFramessize;
  835. mng_mpng_framep pFrames;
  836. } mng_mpng;
  837. typedef mng_mpng * mng_mpngp;
  838. #endif
  839. /* ************************************************************************** */
  840. #ifdef MNG_INCLUDE_ANG_PROPOSAL
  841. typedef struct { /* ahDR */
  842. mng_chunk_header sHeader;
  843. mng_uint32 iNumframes;
  844. mng_uint32 iTickspersec;
  845. mng_uint32 iNumplays;
  846. mng_uint32 iTilewidth;
  847. mng_uint32 iTileheight;
  848. mng_uint8 iInterlace;
  849. mng_uint8 iStillused;
  850. } mng_ahdr;
  851. typedef mng_ahdr * mng_ahdrp;
  852. typedef struct { /* adAT tile */
  853. mng_uint32 iTicks;
  854. mng_int32 iXoffset;
  855. mng_int32 iYoffset;
  856. mng_uint8 iTilesource;
  857. } mng_adat_tile;
  858. typedef mng_adat_tile * mng_adat_tilep;
  859. typedef struct { /* adAT */
  860. mng_chunk_header sHeader;
  861. mng_uint32 iTilessize;
  862. mng_adat_tilep pTiles;
  863. } mng_adat;
  864. typedef mng_adat * mng_adatp;
  865. #endif
  866. /* ************************************************************************** */
  867. typedef struct { /* unknown chunk */
  868. mng_chunk_header sHeader;
  869. mng_uint32 iDatasize;
  870. mng_ptr pData;
  871. } mng_unknown_chunk;
  872. typedef mng_unknown_chunk * mng_unknown_chunkp;
  873. /* ************************************************************************** */
  874. #endif /* _libmng_chunks_h_ */
  875. /* ************************************************************************** */
  876. /* * end of file * */
  877. /* ************************************************************************** */