Warning: That file was not part of the compilation database. It may have many parsing errors.

1/* ************************************************************************** */
2/* * * */
3/* * COPYRIGHT NOTICE: * */
4/* * * */
5/* * Copyright (c) 2000-2007 Gerard Juyn * */
6/* * [You may insert additional notices after this sentence if you modify * */
7/* * this source] * */
8/* * * */
9/* * For the purposes of this copyright and license, "Contributing Authors" * */
10/* * is defined as the following set of individuals: * */
11/* * * */
12/* * Gerard Juyn - gjuyn :at: users.sourceforge.net * */
13/* * Glenn Randers-Pehrson - glennrp :at: users.sourceforge.net * */
14/* * Raphael Assenat - raph :at: raphnet.net * */
15/* * John Stiles - * */
16/* * * */
17/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
18/* * disclaim all warranties, expressed or implied, including, without * */
19/* * limitation, the warranties of merchantability and of fitness for any * */
20/* * purpose. The Contributing Authors assume no liability for direct, * */
21/* * indirect, incidental, special, exemplary, or consequential damages, * */
22/* * which may result from the use of the MNG Library, even if advised of * */
23/* * the possibility of such damage. * */
24/* * * */
25/* * Permission is hereby granted to use, copy, modify, and distribute this * */
26/* * source code, or portions hereof, for any purpose, without fee, subject * */
27/* * to the following restrictions: * */
28/* * * */
29/* * 1. The origin of this source code must not be misrepresented; * */
30/* * you must not claim that you wrote the original software. * */
31/* * * */
32/* * 2. Altered versions must be plainly marked as such and must not be * */
33/* * misrepresented as being the original source. * */
34/* * * */
35/* * 3. This Copyright notice may not be removed or altered from any source * */
36/* * or altered source distribution. * */
37/* * * */
38/* * The Contributing Authors specifically permit, without fee, and * */
39/* * encourage the use of this source code as a component to supporting * */
40/* * the MNG and JNG file format in commercial products. If you use this * */
41/* * source code in a product, acknowledgment would be highly appreciated. * */
42/* * * */
43/* ************************************************************************** */
44/* * * */
45/* * Parts of this software have been adapted from the libpng package. * */
46/* * Although this library supports all features from the PNG specification * */
47/* * (as MNG descends from it) it does not require the libpng package. * */
48/* * It does require the zlib library and optionally the IJG jpeg library, * */
49/* * and/or the "little-cms" library by Marti Maria (depending on the * */
50/* * inclusion of support for JNG and Full-Color-Management respectively. * */
51/* * * */
52/* * This library's function is primarily to read and display MNG * */
53/* * animations. It is not meant as a full-featured image-editing * */
54/* * component! It does however offer creation and editing functionality * */
55/* * at the chunk level. * */
56/* * (future modifications may include some more support for creation * */
57/* * and or editing) * */
58/* * * */
59/* ************************************************************************** */
60
61/* ************************************************************************** */
62/* * * */
63/* * Version numbering * */
64/* * * */
65/* * X.Y.Z : X = release (0 = initial build) * */
66/* * Y = major version (uneven = test; even = production) * */
67/* * Z = minor version (bugfixes; 2 is older than 10) * */
68/* * * */
69/* * production versions only appear when a test-version is extensively * */
70/* * tested and found stable or for intermediate bug-fixes (recognized by * */
71/* * a change in the Z number) * */
72/* * * */
73/* * x.1.x = test version * */
74/* * x.2.x = production version * */
75/* * x.3.x = test version * */
76/* * x.4.x = production version * */
77/* * etc. * */
78/* * * */
79/* ************************************************************************** */
80/* * * */
81/* * Identifier naming conventions throughout this library * */
82/* * * */
83/* * iXxxx = an integer * */
84/* * dXxxx = a float * */
85/* * pXxxx = a pointer * */
86/* * bXxxx = a boolean * */
87/* * eXxxx = an enumeration * */
88/* * hXxxx = a handle * */
89/* * zXxxx = a zero-terminated string (pchar) * */
90/* * fXxxx = a pointer to a function (callback) * */
91/* * aXxxx = an array * */
92/* * sXxxx = a structure * */
93/* * * */
94/* * Macros & defines are in all uppercase. * */
95/* * Functions & typedefs in all lowercase. * */
96/* * Exported stuff is prefixed with MNG_ or mng_ respectively. * */
97/* * * */
98/* * (I may have missed a couple; don't hesitate to let me know!) * */
99/* * * */
100/* ************************************************************************** */
101
102/* ************************************************************************** */
103/* * * */
104/* * project : libmng * */
105/* * file : libmng.h copyright (c) 2000-2007 G.Juyn * */
106/* * version : 1.0.10 * */
107/* * * */
108/* * purpose : main application interface * */
109/* * * */
110/* * author : G.Juyn * */
111/* * * */
112/* * comment : The main application interface. An application should not * */
113/* * need access to any of the other modules! * */
114/* * * */
115/* * changes : 0.5.1 - 05/06/2000 - G.Juyn * */
116/* * - changed chunk iteration function * */
117/* * 0.5.1 - 05/08/2000 - G.Juyn * */
118/* * - added chunk access functions * */
119/* * - added version control constants & functions * */
120/* * - changed strict-ANSI stuff * */
121/* * 0.5.1 - 05/11/2000 - G.Juyn * */
122/* * - added set_outputprofile2 & set_srgbprofile2 * */
123/* * - added empty-chunk put-routines * */
124/* * 0.5.1 - 05/12/2000 - G.Juyn * */
125/* * - added version_dll & VERSION_DLL (for consistency) * */
126/* * - added version control explanatory text & samples * */
127/* * 0.5.1 - 05/15/2000 - G.Juyn * */
128/* * - added getimgdata & putimgdata functions * */
129/* * * */
130/* * 0.5.2 - 05/16/2000 - G.Juyn * */
131/* * - changed the version parameters (obviously) * */
132/* * 0.5.2 - 05/18/2000 - G.Juyn * */
133/* * - complimented constants for chunk-property values * */
134/* * 0.5.2 - 05/23/2000 - G.Juyn * */
135/* * - fixed MNG_UINT_pHYg value * */
136/* * 0.5.2 - 05/24/2000 - G.Juyn * */
137/* * - added support for get/set default zlib/IJG parms * */
138/* * 0.5.2 - 06/02/2000 - G.Juyn * */
139/* * - added MNG_BIGENDIAN_SUPPORT (contributed by Tim Rowley) * */
140/* * - separated configuration-options into "mng_conf.h" * */
141/* * - added RGB8_A8 canvasstyle * */
142/* * - added getalphaline callback for RGB8_A8 canvasstyle * */
143/* * 0.5.2 - 06/06/2000 - G.Juyn * */
144/* * - moved errorcodes from "mng_error.h" * */
145/* * - added mng_read_resume function to support * */
146/* * read-suspension * */
147/* * * */
148/* * 0.5.3 - 06/16/2000 - G.Juyn * */
149/* * - changed the version parameters (obviously) * */
150/* * 0.5.3 - 06/21/2000 - G.Juyn * */
151/* * - added get/set for speedtype to facilitate testing * */
152/* * - added get for imagelevel during processtext callback * */
153/* * 0.5.3 - 06/24/2000 - G.Juyn * */
154/* * - fixed inclusion of IJG read/write code * */
155/* * 0.5.3 - 06/26/2000 - G.Juyn * */
156/* * - changed userdata variable to mng_ptr * */
157/* * * */
158/* * 0.9.0 - 06/30/2000 - G.Juyn * */
159/* * - changed refresh parameters to 'x,y,width,height' * */
160/* * * */
161/* * 0.9.1 - 07/06/2000 - G.Juyn * */
162/* * - added MNG_NEEDTIMERWAIT errorcode * */
163/* * - changed comments to indicate modified behavior for * */
164/* * timer & suspension breaks * */
165/* * 0.9.1 - 07/08/2000 - G.Juyn * */
166/* * - added get routines for internal display variables * */
167/* * - added get/set routines for suspensionmode variable * */
168/* * 0.9.1 - 07/15/2000 - G.Juyn * */
169/* * - added callbacks for SAVE/SEEK processing * */
170/* * - added get/set routines for sectionbreak variable * */
171/* * - added NEEDSECTIONWAIT errorcode * */
172/* * 0.9.1 - 07/19/2000 - G.Juyn * */
173/* * - added function to set frame-/layer-count & playtime * */
174/* * - added errorcode for updatemngheader if not a MNG * */
175/* * * */
176/* * 0.9.2 - 07/31/2000 - G.Juyn * */
177/* * - fixed problem with trace-functions improperly wrapped * */
178/* * - added status_xxxx functions * */
179/* * 0.9.2 - 08/05/2000 - G.Juyn * */
180/* * - changed file-prefixes * */
181/* * - added function to set simplicity field * */
182/* * * */
183/* * 0.9.3 - 08/09/2000 - G.Juyn * */
184/* * - added check for simplicity-bits in MHDR * */
185/* * 0.9.3 - 08/12/2000 - G.Juyn * */
186/* * - added workaround for faulty PhotoShop iCCP chunk * */
187/* * 0.9.3 - 08/26/2000 - G.Juyn * */
188/* * - added MAGN chunk * */
189/* * 0.9.3 - 09/07/2000 - G.Juyn * */
190/* * - added support for new filter_types * */
191/* * 0.9.3 - 10/10/2000 - G.Juyn * */
192/* * - added support for alpha-depth prediction * */
193/* * 0.9.3 - 10/11/2000 - G.Juyn * */
194/* * - fixed processing of unknown critical chunks * */
195/* * - removed test-MaGN * */
196/* * - added PNG/MNG spec version indicators * */
197/* * - added support for nEED * */
198/* * 0.9.3 - 10/16/2000 - G.Juyn * */
199/* * - added functions to retrieve PNG/JNG specific header-info * */
200/* * - added JDAA chunk * */
201/* * 0.9.3 - 10/17/2000 - G.Juyn * */
202/* * - added callback to process non-critical unknown chunks * */
203/* * 0.9.3 - 10/20/2000 - G.Juyn * */
204/* * - added errocode for delayed delta-processing * */
205/* * - added get/set for bKGD preference setting * */
206/* * 0.9.3 - 10/21/2000 - G.Juyn * */
207/* * - added get function for interlace/progressive display * */
208/* * * */
209/* * 0.9.4 - 01/18/2001 - G.Juyn * */
210/* * - added errorcode for MAGN methods * */
211/* * - removed test filter-methods 1 & 65 * */
212/* * * */
213/* * 1.0.0 - 02/05/2001 - G.Juyn * */
214/* * - version numbers (obviously) * */
215/* * * */
216/* * 1.0.1 - 02/08/2001 - G.Juyn * */
217/* * - added MEND processing callback * */
218/* * 1.0.1 - 04/21/2001 - G.Juyn (code by G.Kelly) * */
219/* * - added BGRA8 canvas with premultiplied alpha * */
220/* * 1.0.1 - 05/02/2001 - G.Juyn * */
221/* * - added "default" sRGB generation (Thanks Marti!) * */
222/* * * */
223/* * 1.0.2 - 06/23/2001 - G.Juyn * */
224/* * - added optimization option for MNG-video playback * */
225/* * - added processterm callback * */
226/* * 1.0.2 - 06/25/2001 - G.Juyn * */
227/* * - added late binding errorcode (not used internally) * */
228/* * - added option to turn off progressive refresh * */
229/* * * */
230/* * 1.0.3 - 08/06/2001 - G.Juyn * */
231/* * - added get function for last processed BACK chunk * */
232/* * * */
233/* * 1.0.5 - 07/04/2002 - G.Juyn * */
234/* * - added errorcode for extreme chunk-sizes * */
235/* * 1.0.5 - 08/07/2002 - G.Juyn * */
236/* * - added test-option for PNG filter method 193 (=no filter) * */
237/* * 1.0.5 - 08/15/2002 - G.Juyn * */
238/* * - completed PROM support * */
239/* * - completed delta-image support * */
240/* * 1.0.5 - 08/19/2002 - G.Juyn * */
241/* * - added HLAPI function to copy chunks * */
242/* * 1.0.5 - 09/14/2002 - G.Juyn * */
243/* * - added event handling for dynamic MNG * */
244/* * - added 'supports' call to check function availability * */
245/* * 1.0.5 - 09/15/2002 - G.Juyn * */
246/* * - fixed LOOP iteration=0 special case * */
247/* * 1.0.5 - 09/20/2002 - G.Juyn * */
248/* * - added support for PAST * */
249/* * 1.0.5 - 09/22/2002 - G.Juyn * */
250/* * - added bgrx8 canvas (filler byte) * */
251/* * 1.0.5 - 10/07/2002 - G.Juyn * */
252/* * - added check for TERM placement during create/write * */
253/* * - added beta version function & constant * */
254/* * 1.0.5 - 11/07/2002 - G.Juyn * */
255/* * - added support to get totals after mng_read() * */
256/* * * */
257/* * 1.0.6 - 07/07/2003 - G. Randers-Pehrson * */
258/* * - added support for reducing the footprint of libmng * */
259/* * by macros that optionally skip unused chunks, remove * */
260/* * 16-bit sample support, remove Delta support, and * */
261/* * remove JNG support, to accomodate Mozilla/Firebird. * */
262/* * 1.0.6 - 07/14/2003 - G. Randers-Pehrson * */
263/* * - further optional removal of unused functions * */
264/* * * */
265/* * 1.0.7 - 11/27/2003 - R.A * */
266/* * - added CANVAS_RGB565 and CANVAS_BGR565 * */
267/* * 1.0.7 - 12/06/2003 - R.A * */
268/* * - added CANVAS_RGBA565 and CANVAS_BGRA565 * */
269/* * 1.0.7 - 01/25/2004 - J.S * */
270/* * - added premultiplied alpha canvas' for RGBA, ARGB, ABGR * */
271/* * 1.0.7 - 03/07/2004 - G. Randers-Pehrson * */
272/* * - put gamma, cms-related declarations inside #ifdef * */
273/* * 1.0.7 - 03/10/2004 - G.R-P * */
274/* * - added conditionals around openstream/closestream * */
275/* * * */
276/* * 1.0.8 - 04/02/2004 - G.Juyn * */
277/* * - added CRC existence & checking flags * */
278/* * 1.0.8 - 04/12/2004 - G.Juyn * */
279/* * - added data-push mechanisms for specialized decoders * */
280/* * 1.0.8 - 06/05/2004 - G.R-P * */
281/* * - define MNG_INCLUDE_ZLIB when MNG_USE_ZLIB_CRC is defined * */
282/* * * */
283/* * 1.0.9 - 10/03/2004 - G.Juyn * */
284/* * - added function to retrieve current FRAM delay * */
285/* * 1.0.9 - 10/14/2004 - G.Juyn * */
286/* * - added bgr565_a8 canvas-style (thanks to J. Elvander) * */
287/* * 1.0.9 - 10/17/2004 - G.Juyn * */
288/* * - fixed PPLT getchunk/putchunk routines * */
289/* * * */
290/* * 1.0.10 - 03/07/2006 - (thanks to W. Manthey) * */
291/* * - added CANVAS_RGB555 and CANVAS_BGR555 * */
292/* * 1.0.10 - 04/08/2007 - G.Juyn * */
293/* * - added support for mPNG proposal * */
294/* * 1.0.10 - 04/12/2007 - G.Juyn * */
295/* * - added support for ANG proposal * */
296/* * * */
297/* ************************************************************************** */
298
299#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
300#pragma option -A /* force ANSI-C */
301#endif
302
303#ifndef _libmng_h_
304#define _libmng_h_
305
306/* ************************************************************************** */
307
308#include "libmng_conf.h" /* user-specific configuration options */
309
310/* ************************************************************************** */
311
312#define MNG_CHECK_BAD_ICCP /* let's catch that sucker !!! */
313
314#ifdef MNG_SUPPORT_READ /* dependencies based on user-configuration */
315#define MNG_INCLUDE_READ_PROCS
316#endif
317
318#ifdef MNG_SUPPORT_WRITE
319#define MNG_INCLUDE_WRITE_PROCS
320#endif
321
322#ifdef MNG_USE_ZLIB_CRC
323#define MNG_INCLUDE_ZLIB
324#endif
325
326#ifdef MNG_SUPPORT_DISPLAY
327#define MNG_INCLUDE_FILTERS
328#define MNG_INCLUDE_INTERLACE
329#define MNG_INCLUDE_OBJECTS
330#define MNG_INCLUDE_DISPLAY_PROCS
331#define MNG_INCLUDE_TIMING_PROCS
332#define MNG_INCLUDE_ZLIB
333#endif
334
335#ifdef MNG_STORE_CHUNKS
336#define MNG_INCLUDE_ZLIB
337#endif
338
339#ifdef MNG_SUPPORT_IJG6B
340#define MNG_INCLUDE_JNG
341#define MNG_INCLUDE_IJG6B
342#define MNG_USE_SETJMP
343#endif
344
345#ifdef MNG_INCLUDE_JNG
346#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
347#define MNG_INCLUDE_JNG_READ
348#endif
349#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
350#define MNG_INCLUDE_JNG_WRITE
351#endif
352#endif
353
354#ifdef MNG_FULL_CMS
355#define MNG_INCLUDE_LCMS
356#endif
357
358#ifdef MNG_AUTO_DITHER
359#define MNG_INCLUDE_DITHERING
360#endif
361
362#ifdef MNG_SUPPORT_TRACE
363#define MNG_INCLUDE_TRACE_PROCS
364#ifdef MNG_TRACE_TELLTALE
365#define MNG_INCLUDE_TRACE_STRINGS
366#endif
367#endif
368
369#ifdef MNG_ERROR_TELLTALE
370#define MNG_INCLUDE_ERROR_STRINGS
371#endif
372
373#ifdef MNG_OPTIMIZE_CHUNKINITFREE
374#ifndef MNG_OPTIMIZE_CHUNKACCESS
375#define MNG_OPTIMIZE_CHUNKACCESS
376#endif
377#else
378#ifdef MNG_OPTIMIZE_CHUNKACCESS
379#undef MNG_OPTIMIZE_CHUNKACCESS
380#endif
381#endif
382
383/* ************************************************************************** */
384
385#include "libmng_types.h" /* platform-specific definitions
386 and other assorted stuff */
387
388/* ************************************************************************** */
389
390#ifdef __cplusplus
391extern "C" {
392#endif
393
394/* ************************************************************************** */
395/* * * */
396/* * Versioning control * */
397/* * * */
398/* * version_so and version_dll will NOT reflect version_major; * */
399/* * these will only change for binary incompatible changes (which will * */
400/* * hopefully never occur) * */
401/* * note: they will be set to 1 on the first public release !!! * */
402/* * * */
403/* * first public release: * */
404/* * #define MNG_VERSION_TEXT "1.0.0" * */
405/* * #define MNG_VERSION_SO 1 eg. libmng.so.1 * */
406/* * #define MNG_VERSION_DLL 1 eg. libmng.dll * */
407/* * #define MNG_VERSION_MAJOR 1 * */
408/* * #define MNG_VERSION_MINOR 0 * */
409/* * #define MNG_VERSION_RELEASE 0 * */
410/* * * */
411/* * bug fix & cosmetics : * */
412/* * #define MNG_VERSION_TEXT "1.0.1" * */
413/* * #define MNG_VERSION_SO 1 eg. libmng.so.1 * */
414/* * #define MNG_VERSION_DLL 1 eg. libmng.dll * */
415/* * #define MNG_VERSION_MAJOR 1 * */
416/* * #define MNG_VERSION_MINOR 0 * */
417/* * #define MNG_VERSION_RELEASE 1 * */
418/* * * */
419/* * feature change : * */
420/* * #define MNG_VERSION_TEXT "1.2.0" * */
421/* * #define MNG_VERSION_SO 1 eg. libmng.so.1 * */
422/* * #define MNG_VERSION_DLL 1 eg. libmng.dll * */
423/* * #define MNG_VERSION_MAJOR 1 * */
424/* * #define MNG_VERSION_MINOR 2 * */
425/* * #define MNG_VERSION_RELEASE 0 * */
426/* * * */
427/* * major rewrite (still binary compatible) : * */
428/* * #define MNG_VERSION_TEXT "2.0.0" * */
429/* * #define MNG_VERSION_SO 1 eg. libmng.so.1 * */
430/* * #define MNG_VERSION_DLL 1 eg. libmng.dll * */
431/* * #define MNG_VERSION_MAJOR 2 * */
432/* * #define MNG_VERSION_MINOR 0 * */
433/* * #define MNG_VERSION_RELEASE 0 * */
434/* * * */
435/* * binary incompatible change: * */
436/* * #define MNG_VERSION_TEXT "13.0.0" * */
437/* * #define MNG_VERSION_SO 2 eg. libmng.so.2 * */
438/* * #define MNG_VERSION_DLL 2 eg. libmng2.dll * */
439/* * #define MNG_VERSION_MAJOR 13 * */
440/* * #define MNG_VERSION_MINOR 0 * */
441/* * #define MNG_VERSION_RELEASE 0 * */
442/* * * */
443/* * note that version_so & version_dll will always remain equal so it * */
444/* * doesn't matter which one is called to do version-checking; they are * */
445/* * just provided for their target platform * */
446/* * * */
447/* ************************************************************************** */
448
449#define MNG_VERSION_TEXT "2.0.2"
450#define MNG_VERSION_BETA MNG_FALSE
451
452MNG_EXT mng_pchar MNG_DECL mng_version_text (void);
453MNG_EXT mng_uint8 MNG_DECL mng_version_so (void);
454MNG_EXT mng_uint8 MNG_DECL mng_version_dll (void);
455MNG_EXT mng_uint8 MNG_DECL mng_version_major (void);
456MNG_EXT mng_uint8 MNG_DECL mng_version_minor (void);
457MNG_EXT mng_uint8 MNG_DECL mng_version_release (void);
458MNG_EXT mng_bool MNG_DECL mng_version_beta (void);
459
460/* use the following call to check wether the version of libmng your app
461 is using supports the given function; this is useful in apps that dynamically
462 load the library to make sure a certain function will work; the result will
463 be MNG_TRUE if the given function is implemented in this version of the library;
464 Major/Minor/Version indicate the version the function became available;
465 (if these fields are zero the function is not yet implemented!) */
466#ifdef MNG_SUPPORT_FUNCQUERY
467MNG_EXT mng_bool MNG_DECL mng_supports_func (mng_pchar zFunction,
468 mng_uint8* iMajor,
469 mng_uint8* iMinor,
470 mng_uint8* iRelease);
471#endif
472
473/* ************************************************************************** */
474/* * * */
475/* * MNG/PNG specification level conformance * */
476/* * * */
477/* ************************************************************************** */
478
479#define MNG_PNG_VERSION "1.2"
480#define MNG_PNG_VERSION_MAJ 1
481#define MNG_PNG_VERSION_MIN 2
482
483#define MNG_MNG_VERSION "1.1"
484#define MNG_MNG_VERSION_MAJ 1
485#define MNG_MNG_VERSION_MIN 1
486#define MNG_MNG_DRAFT 99 /* deprecated;
487 only used for nEED "MNG DRAFT nn" */
488
489/* ************************************************************************** */
490/* * * */
491/* * High-level application functions * */
492/* * * */
493/* ************************************************************************** */
494
495/* library initialization function */
496/* must be the first called before anything can be done at all */
497/* initializes internal datastructure(s) */
498MNG_EXT mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
499 mng_memalloc fMemalloc,
500 mng_memfree fMemfree,
501 mng_traceproc fTraceproc);
502
503/* library reset function */
504/* can be used to re-initialize the library, so another image can be
505 processed. there's absolutely no harm in calling it, even when it's not
506 really necessary */
507MNG_EXT mng_retcode MNG_DECL mng_reset (mng_handle hHandle);
508
509/* library cleanup function */
510/* must be the last called to clean up internal datastructure(s) */
511MNG_EXT mng_retcode MNG_DECL mng_cleanup (mng_handle* hHandle);
512
513/* high-level read functions */
514/* use mng_read if you simply want to read a Network Graphic */
515/* mng_read_resume is used in I/O-read-suspension scenarios, where the
516 "readdata" callback may return FALSE & length=0 indicating its buffer is
517 depleted or too short to supply the required bytes, and the buffer needs
518 to be refilled; libmng will return the errorcode MNG_NEEDMOREDATA telling
519 the app to refill its read-buffer after which it must call mng_read_resume
520 (or mng_display_resume if it also displaying the image simultaneously) */
521#ifdef MNG_SUPPORT_READ
522MNG_EXT mng_retcode MNG_DECL mng_read (mng_handle hHandle);
523MNG_EXT mng_retcode MNG_DECL mng_read_resume (mng_handle hHandle);
524#endif
525
526/* high-level "data push" functions */
527/* these functions can be used in situations where data is streaming into the
528 application and needs to be buffered by libmng before it is actually
529 requested by libmng itself. the pushing complements the normal reading
530 mechanism, but applications can decide to always return "0 bytes read" to
531 make libmng go into suspension mode with the returncode MNG_NEEDMOREDATA */
532/* mng_read_pushdata can be used to push blobs of data of arbitrary size;
533 mng_read_pushsig and mng_read_pushchunk can be used if the application
534 has already done some low-level decoding (eg. at the chunk level) */
535/* the data being pushed into libmng with mng_read_pushdata *must* contain
536 the regular 4-byte chunklength, but *must not* contain it with
537 mng_read_pushchunk!!! */
538/* mng_read_pushsig is used to prevent libmng from trying to parse the regular
539 PNG/JNG/MNG signature bytes; the application must have done this itself
540 and *must* indicate the proper type in the function call or things will
541 go amiss!!
542 also you *must* call this first, so pretty much right after mng_initialize
543 and certainly before any call to mng_read or mng_readdisplay !!!! */
544/* IMPORTANT!!! data can only be safely pushed when libmng is in a
545 "wait" state; eg. during MNG_NEEDTIMERWAIT, MNG_NEEDSECTIONWAIT or
546 MNG_NEEDMOREDATA !!! this just means you can't have one thread displaying
547 and another thread pushing data !!! */
548/* if bOwnership = MNG_TRUE, libmng will retain the supplied pointer and
549 *will* expect the buffer to remain available until libmng is finished
550 with it; what happens then depends on whether or not you have set the
551 releasedata() callback; if this is set than the supplied buffer will
552 be returned through this callback and your application can take care of
553 cleaning it up, otherwise libmng will use its internal freeing mechanism
554 (which, depending on compile-options, will be the standard C free() call,
555 or the memfree() callback */
556/* if bOwnership = MNG_FALSE, libmng will just copy the data into its own
557 buffers and dispose of it in the normal way */
558#ifdef MNG_SUPPORT_READ
559MNG_EXT mng_retcode MNG_DECL mng_read_pushdata (mng_handle hHandle,
560 mng_ptr pData,
561 mng_size_t iLength,
562 mng_bool bTakeownership);
563MNG_EXT mng_retcode MNG_DECL mng_read_pushsig (mng_handle hHandle,
564 mng_imgtype eSigtype);
565MNG_EXT mng_retcode MNG_DECL mng_read_pushchunk (mng_handle hHandle,
566 mng_ptr pChunk,
567 mng_size_t iLength,
568 mng_bool bTakeownership);
569#endif
570
571/* high-level write & create functions */
572/* use this if you want to write a previously read Network Graphic or
573 if you want to create a new graphic and write it */
574/* to write a previously read graphic you must have defined MNG_STORE_CHUNKS */
575/* to create a new graphic you'll also need access to the chunks
576 (eg. #define MNG_ACCESS_CHUNKS !) */
577#ifdef MNG_SUPPORT_WRITE
578MNG_EXT mng_retcode MNG_DECL mng_write (mng_handle hHandle);
579MNG_EXT mng_retcode MNG_DECL mng_create (mng_handle hHandle);
580#endif
581
582/* high-level display functions */
583/* use these to display a previously read or created graphic or
584 to read & display a graphic simultaneously */
585/* mng_display_resume should be called after a timer-interval
586 expires that was set through the settimer-callback, after a
587 read suspension-break, or, to resume an animation after a call
588 to mng_display_freeze/mng_display_reset */
589/* mng_display_freeze thru mng_display_gotime can be used to influence
590 the display of an image, BUT ONLY if it has been completely read! */
591#ifdef MNG_SUPPORT_DISPLAY
592#ifdef MNG_SUPPORT_READ
593MNG_EXT mng_retcode MNG_DECL mng_readdisplay (mng_handle hHandle);
594#endif
595MNG_EXT mng_retcode MNG_DECL mng_display (mng_handle hHandle);
596MNG_EXT mng_retcode MNG_DECL mng_display_resume (mng_handle hHandle);
597MNG_EXT mng_retcode MNG_DECL mng_display_freeze (mng_handle hHandle);
598MNG_EXT mng_retcode MNG_DECL mng_display_reset (mng_handle hHandle);
599#ifndef MNG_NO_DISPLAY_GO_SUPPORTED
600MNG_EXT mng_retcode MNG_DECL mng_display_goframe (mng_handle hHandle,
601 mng_uint32 iFramenr);
602MNG_EXT mng_retcode MNG_DECL mng_display_golayer (mng_handle hHandle,
603 mng_uint32 iLayernr);
604MNG_EXT mng_retcode MNG_DECL mng_display_gotime (mng_handle hHandle,
605 mng_uint32 iPlaytime);
606#endif
607#endif /* MNG_SUPPORT_DISPLAY */
608
609/* event processing function */
610/* this needs to be called by the app when dynamic MNG is enabled and
611 a specific event occurs in the user-interface */
612#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_SUPPORT_DYNAMICMNG)
613MNG_EXT mng_retcode MNG_DECL mng_trapevent (mng_handle hHandle,
614 mng_uint8 iEventtype,
615 mng_int32 iX,
616 mng_int32 iY);
617#endif
618
619/* error reporting function */
620/* use this if you need more detailed info on the last error */
621/* iExtra1 & iExtra2 may contain errorcodes from zlib, jpeg, etc... */
622/* zErrortext will only be filled if you #define MNG_ERROR_TELLTALE */
623MNG_EXT mng_retcode MNG_DECL mng_getlasterror (mng_handle hHandle,
624 mng_int8* iSeverity,
625 mng_chunkid* iChunkname,
626 mng_uint32* iChunkseq,
627 mng_int32* iExtra1,
628 mng_int32* iExtra2,
629 mng_pchar* zErrortext);
630
631/* ************************************************************************** */
632/* * * */
633/* * Callback set functions * */
634/* * * */
635/* ************************************************************************** */
636
637/* memory callbacks */
638/* called to allocate and release internal datastructures */
639#ifndef MNG_INTERNAL_MEMMNGMT
640MNG_EXT mng_retcode MNG_DECL mng_setcb_memalloc (mng_handle hHandle,
641 mng_memalloc fProc);
642MNG_EXT mng_retcode MNG_DECL mng_setcb_memfree (mng_handle hHandle,
643 mng_memfree fProc);
644#endif /* MNG_INTERNAL_MEMMNGMT */
645
646/* open- & close-stream callbacks */
647/* called to open & close streams for input or output */
648#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
649#ifndef MNG_NO_OPEN_CLOSE_STREAM
650MNG_EXT mng_retcode MNG_DECL mng_setcb_openstream (mng_handle hHandle,
651 mng_openstream fProc);
652MNG_EXT mng_retcode MNG_DECL mng_setcb_closestream (mng_handle hHandle,
653 mng_closestream fProc);
654#endif
655#endif
656
657/* read callback */
658/* called to get data from the inputstream */
659#ifdef MNG_SUPPORT_READ
660MNG_EXT mng_retcode MNG_DECL mng_setcb_readdata (mng_handle hHandle,
661 mng_readdata fProc);
662#endif
663
664/* write callback */
665/* called to put data into the outputstream */
666#ifdef MNG_SUPPORT_WRITE
667MNG_EXT mng_retcode MNG_DECL mng_setcb_writedata (mng_handle hHandle,
668 mng_writedata fProc);
669#endif
670
671/* error callback */
672/* called when an error occurs */
673/* the application can determine if the error is recoverable,
674 and may inform the library by setting specific returncodes */
675MNG_EXT mng_retcode MNG_DECL mng_setcb_errorproc (mng_handle hHandle,
676 mng_errorproc fProc);
677
678/* trace callback */
679/* called to show the currently executing function */
680#ifdef MNG_SUPPORT_TRACE
681MNG_EXT mng_retcode MNG_DECL mng_setcb_traceproc (mng_handle hHandle,
682 mng_traceproc fProc);
683#endif
684
685/* callbacks for read processing */
686/* processheader is called when all header information has been gathered
687 from the inputstream */
688/* processtext is called for every tEXt, zTXt and iTXt chunk in the
689 inputstream (iType=0 for tEXt, 1 for zTXt and 2 for iTXt);
690 you can call get_imagelevel to check at what nesting-level the chunk is
691 encountered (eg. tEXt inside an embedded image inside a MNG -> level == 2;
692 in most other case -> level == 1) */
693/* processsave & processseek are called for SAVE/SEEK chunks */
694/* processneed is called for the nEED chunk; you should specify a callback
695 for this as the default behavior will be to abort processing, unless
696 the requirement is one of:
697 - a supported chunk
698 - the text "draft nn" where nn is a numeric value
699 - the text "MNG-1.0" or "MNG-1.1"
700 - the text "CACHEOFF" */
701/* processmend is called at the very end of the animation-stream;
702 note that this may not be the end of the animation though! */
703/* processterm is called when a TERM chunk is encountered; there can be only
704 1 in the stream (or none) */
705/* processunknown is called after reading each non-critical unknown chunk */
706#ifdef MNG_SUPPORT_READ
707MNG_EXT mng_retcode MNG_DECL mng_setcb_processheader (mng_handle hHandle,
708 mng_processheader fProc);
709MNG_EXT mng_retcode MNG_DECL mng_setcb_processtext (mng_handle hHandle,
710 mng_processtext fProc);
711MNG_EXT mng_retcode MNG_DECL mng_setcb_processsave (mng_handle hHandle,
712 mng_processsave fProc);
713MNG_EXT mng_retcode MNG_DECL mng_setcb_processseek (mng_handle hHandle,
714 mng_processseek fProc);
715MNG_EXT mng_retcode MNG_DECL mng_setcb_processneed (mng_handle hHandle,
716 mng_processneed fProc);
717MNG_EXT mng_retcode MNG_DECL mng_setcb_processmend (mng_handle hHandle,
718 mng_processmend fProc);
719MNG_EXT mng_retcode MNG_DECL mng_setcb_processterm (mng_handle hHandle,
720 mng_processterm fProc);
721MNG_EXT mng_retcode MNG_DECL mng_setcb_processunknown(mng_handle hHandle,
722 mng_processunknown fProc);
723#endif
724
725/* callbacks for display processing */
726/* getcanvasline is called to get an access-pointer to a line on the
727 drawing-canvas */
728/* getbkgdline is called to get an access-pointer to a line from the
729 background-canvas */
730/* refresh is called to inform the GUI to redraw the current canvas onto
731 its output device (eg. in Win32 this would mean sending an
732 invalidate message for the specified region */
733/* NOTE that the update-region is specified as x,y,width,height; eg. the
734 invalidate message for Windows requires left,top,right,bottom parameters
735 where the bottom-right is exclusive of the region!!
736 to get these correctly is as simple as:
737 left = x;
738 top = y;
739 right = x + width;
740 bottom = y + height;
741 if your implementation requires inclusive points, simply subtract 1 from
742 both the right & bottom values calculated above.
743 */
744#ifdef MNG_SUPPORT_DISPLAY
745MNG_EXT mng_retcode MNG_DECL mng_setcb_getcanvasline (mng_handle hHandle,
746 mng_getcanvasline fProc);
747MNG_EXT mng_retcode MNG_DECL mng_setcb_getbkgdline (mng_handle hHandle,
748 mng_getbkgdline fProc);
749MNG_EXT mng_retcode MNG_DECL mng_setcb_getalphaline (mng_handle hHandle,
750 mng_getalphaline fProc);
751MNG_EXT mng_retcode MNG_DECL mng_setcb_refresh (mng_handle hHandle,
752 mng_refresh fProc);
753
754/* timing callbacks */
755/* gettickcount is called to get the system tickcount (milliseconds);
756 this is used to determine the remaining interval between frames */
757/* settimer is called to inform the application that it should set a timer;
758 when the timer is triggered the app must call mng_display_resume */
759MNG_EXT mng_retcode MNG_DECL mng_setcb_gettickcount (mng_handle hHandle,
760 mng_gettickcount fProc);
761MNG_EXT mng_retcode MNG_DECL mng_setcb_settimer (mng_handle hHandle,
762 mng_settimer fProc);
763
764/* color management callbacks */
765/* called to transmit color management information to the application */
766/* these are only used when you #define MNG_APP_CMS */
767#ifdef MNG_APP_CMS
768MNG_EXT mng_retcode MNG_DECL mng_setcb_processgamma (mng_handle hHandle,
769 mng_processgamma fProc);
770MNG_EXT mng_retcode MNG_DECL mng_setcb_processchroma (mng_handle hHandle,
771 mng_processchroma fProc);
772MNG_EXT mng_retcode MNG_DECL mng_setcb_processsrgb (mng_handle hHandle,
773 mng_processsrgb fProc);
774MNG_EXT mng_retcode MNG_DECL mng_setcb_processiccp (mng_handle hHandle,
775 mng_processiccp fProc);
776MNG_EXT mng_retcode MNG_DECL mng_setcb_processarow (mng_handle hHandle,
777 mng_processarow fProc);
778#endif /* MNG_APP_CMS */
779#endif /* MNG_SUPPORT_DISPLAY */
780
781/* release push data callback */
782/* used when the app pushes data into libmng (as opposed to libmng pulling it)
783 and relinquishes ownership of the pushed data-buffer, but *does* want to
784 release (free) the buffer itself once libmng has finished processing it */
785#ifdef MNG_SUPPORT_READ
786MNG_EXT mng_retcode MNG_DECL mng_setcb_releasedata (mng_handle hHandle,
787 mng_releasedata fProc);
788#endif
789
790/* ************************************************************************** */
791/* * * */
792/* * Callback get functions * */
793/* * * */
794/* ************************************************************************** */
795
796/* see _setcb_ */
797#ifndef MNG_INTERNAL_MEMMNGMT
798MNG_EXT mng_memalloc MNG_DECL mng_getcb_memalloc (mng_handle hHandle);
799MNG_EXT mng_memfree MNG_DECL mng_getcb_memfree (mng_handle hHandle);
800#endif
801
802/* see _setcb_ */
803#ifdef MNG_SUPPORT_READ
804MNG_EXT mng_releasedata MNG_DECL mng_getcb_releasedata (mng_handle hHandle);
805#endif
806
807/* see _setcb_ */
808#if defined(MNG_SUPPORT_READ) || defined(MNG_WRITE_SUPPORT)
809#ifndef MNG_NO_OPEN_CLOSE_STREAM
810MNG_EXT mng_openstream MNG_DECL mng_getcb_openstream (mng_handle hHandle);
811MNG_EXT mng_closestream MNG_DECL mng_getcb_closestream (mng_handle hHandle);
812#endif
813#endif
814
815/* see _setcb_ */
816#ifdef MNG_SUPPORT_READ
817MNG_EXT mng_readdata MNG_DECL mng_getcb_readdata (mng_handle hHandle);
818#endif
819
820/* see _setcb_ */
821#ifdef MNG_SUPPORT_WRITE
822MNG_EXT mng_writedata MNG_DECL mng_getcb_writedata (mng_handle hHandle);
823#endif
824
825/* see _setcb_ */
826MNG_EXT mng_errorproc MNG_DECL mng_getcb_errorproc (mng_handle hHandle);
827
828/* see _setcb_ */
829#ifdef MNG_SUPPORT_TRACE
830MNG_EXT mng_traceproc MNG_DECL mng_getcb_traceproc (mng_handle hHandle);
831#endif
832
833/* see _setcb_ */
834#ifdef MNG_SUPPORT_READ
835MNG_EXT mng_processheader MNG_DECL mng_getcb_processheader (mng_handle hHandle);
836MNG_EXT mng_processtext MNG_DECL mng_getcb_processtext (mng_handle hHandle);
837MNG_EXT mng_processsave MNG_DECL mng_getcb_processsave (mng_handle hHandle);
838MNG_EXT mng_processseek MNG_DECL mng_getcb_processseek (mng_handle hHandle);
839MNG_EXT mng_processneed MNG_DECL mng_getcb_processneed (mng_handle hHandle);
840MNG_EXT mng_processunknown MNG_DECL mng_getcb_processunknown (mng_handle hHandle);
841MNG_EXT mng_processterm MNG_DECL mng_getcb_processterm (mng_handle hHandle);
842#endif
843
844/* see _setcb_ */
845#ifdef MNG_SUPPORT_DISPLAY
846MNG_EXT mng_getcanvasline MNG_DECL mng_getcb_getcanvasline (mng_handle hHandle);
847MNG_EXT mng_getbkgdline MNG_DECL mng_getcb_getbkgdline (mng_handle hHandle);
848MNG_EXT mng_getalphaline MNG_DECL mng_getcb_getalphaline (mng_handle hHandle);
849MNG_EXT mng_refresh MNG_DECL mng_getcb_refresh (mng_handle hHandle);
850
851/* see _setcb_ */
852MNG_EXT mng_gettickcount MNG_DECL mng_getcb_gettickcount (mng_handle hHandle);
853MNG_EXT mng_settimer MNG_DECL mng_getcb_settimer (mng_handle hHandle);
854
855/* see _setcb_ */
856#ifdef MNG_APP_CMS
857MNG_EXT mng_processgamma MNG_DECL mng_getcb_processgamma (mng_handle hHandle);
858MNG_EXT mng_processchroma MNG_DECL mng_getcb_processchroma (mng_handle hHandle);
859MNG_EXT mng_processsrgb MNG_DECL mng_getcb_processsrgb (mng_handle hHandle);
860MNG_EXT mng_processiccp MNG_DECL mng_getcb_processiccp (mng_handle hHandle);
861MNG_EXT mng_processarow MNG_DECL mng_getcb_processarow (mng_handle hHandle);
862#endif /* MNG_APP_CMS */
863#endif /* MNG_SUPPORT_DISPLAY */
864
865/* ************************************************************************** */
866/* * * */
867/* * Property set functions * */
868/* * * */
869/* ************************************************************************** */
870
871/* Application data pointer */
872/* provided for application use; not used by the library */
873MNG_EXT mng_retcode MNG_DECL mng_set_userdata (mng_handle hHandle,
874 mng_ptr pUserdata);
875
876/* The style of the drawing- & background-canvas */
877/* only used for displaying images */
878/* both are initially set to 24-bit RGB (eg. 8-bit per channel) */
879MNG_EXT mng_retcode MNG_DECL mng_set_canvasstyle (mng_handle hHandle,
880 mng_uint32 iStyle);
881MNG_EXT mng_retcode MNG_DECL mng_set_bkgdstyle (mng_handle hHandle,
882 mng_uint32 iStyle);
883
884/* The default background color */
885/* only used if the getbkgdline callback is not defined */
886/* for initially painting the canvas and restoring (part of) the background */
887MNG_EXT mng_retcode MNG_DECL mng_set_bgcolor (mng_handle hHandle,
888 mng_uint16 iRed,
889 mng_uint16 iGreen,
890 mng_uint16 iBlue);
891
892/* Indicates preferred use of the bKGD chunk for PNG images */
893MNG_EXT mng_retcode MNG_DECL mng_set_usebkgd (mng_handle hHandle,
894 mng_bool bUseBKGD);
895
896/* Indicates storage of read chunks */
897/* only useful if you #define mng_store_chunks */
898/* can be used to dynamically change storage management */
899MNG_EXT mng_retcode MNG_DECL mng_set_storechunks (mng_handle hHandle,
900 mng_bool bStorechunks);
901
902/* Indicates breaks requested when processing SAVE/SEEK */
903/* set this to let the app handle section breaks; the library will return
904 MNG_NEEDSECTIONWAIT return-codes for each SEEK chunk */
905MNG_EXT mng_retcode MNG_DECL mng_set_sectionbreaks (mng_handle hHandle,
906 mng_bool bSectionbreaks);
907
908/* Indicates storage of playback info (ON by default!) */
909/* can be used to turn off caching of playback info; this is useful to
910 specifically optimize MNG-video playback; note that if caching is turned off
911 LOOP chunks will be flagged as errors! TERM chunks will be ignored and only
912 passed to the processterm() callback if it is defined by the app; also, this
913 feature can only be used with mng_readdisplay(); mng_read(),
914 mng_display_reset() and mng_display_goxxxx() will return an error;
915 once this option is turned off it can't be turned on for the same stream!!! */
916MNG_EXT mng_retcode MNG_DECL mng_set_cacheplayback (mng_handle hHandle,
917 mng_bool bCacheplayback);
918
919/* Indicates automatic progressive refreshes for large images (ON by default!) */
920/* turn this off if you do not want intermittent painting while a large image
921 is being read. useful if the input-stream comes from a fast medium, such
922 as a local harddisk */
923MNG_EXT mng_retcode MNG_DECL mng_set_doprogressive (mng_handle hHandle,
924 mng_bool bDoProgressive);
925
926/* Indicates existence and required checking of the CRC in input streams,
927 and generation in output streams */
928/* !!!! Use this ONLY if you know what you are doing !!!! */
929/* The value is a combination of the following flags:
930 0x0000001 = CRC is present in the input stream
931 0x0000002 = CRC must be generated in the output stream
932 0x0000010 = CRC should be checked for ancillary chunks
933 0x0000020 = a faulty CRC for ancillary chunks generates a warning only
934 0x0000040 = a faulty CRC for ancillary chunks generates an error
935 0x0000100 = CRC should be checked for critical chunks
936 0x0000200 = a faulty CRC for critical chunks generates a warning only
937 0x0000400 = a faulty CRC for critical chunks generates an error
938
939 The default is 0x00000533 = CRC present in input streams; should be checked;
940 warning for ancillary chunks; error for critical
941 chunks; generate CRC for output streams
942
943 Note that some combinations are meaningless; eg. if the CRC is not present
944 it won't do any good to turn the checking flags on; if a checking flag
945 is off, it doesn't do any good to ask for generation of warnings or errors.
946 Also libmng will generate either an error or a warning, not both,
947 so if you specify both the default will be to generate an error!
948 The only useful combinations for input are 331, 551, 351, 531, 0, 301, 501
949 and optionally 031 and 051, but only checking ancillary chunks and not
950 critical chunks is generally not a very good idea!!!
951 If you've also writing these values should be combined with 0x02 if
952 CRC's are required in the output stream
953 */
954MNG_EXT mng_retcode MNG_DECL mng_set_crcmode (mng_handle hHandle,
955 mng_uint32 iCrcmode);
956
957/* Color-management necessaries */
958/*
959 *************************************************************************
960 !!!!!!!! THIS NEXT BIT IS IMPORTANT !!!!!!!!!
961 *************************************************************************
962
963 If you have defined MNG_FULL_CMS (and are using lcms), you will have to
964 think hard about the following routines.
965
966 lcms requires 2 profiles to work off the differences in the input-image
967 and the output-device. The ICC profile for the input-image will be
968 embedded within it to reflect its color-characteristics, but the output
969 profile depends on the output-device, which is something only *YOU* know
970 about. sRGB (standard RGB) is common for x86 compatible environments
971 (eg. Windows, Linux and some others)
972
973 If you are compiling for a sRGB compliant system you probably won't have
974 to do anything special. (unless you want to of course)
975
976 If you are compiling for a non-sRGB compliant system
977 (eg. SGI, Mac, Next, others...)
978 you *MUST* define a proper ICC profile for the generic output-device
979 associated with that platform.
980
981 In either event, you may also want to offer an option to your users to
982 set the profile manually, or, if you know how, set it from a
983 system-defined default.
984
985 TO RECAP: for sRGB systems (Windows, Linux) no action required!
986 for non-sRGB systems (SGI, Mac, Next) ACTION REQUIRED!
987
988 Please visit http://www.srgb.com, http://www.color.org and
989 http://www.littlecms.com for more info.
990
991 *************************************************************************
992 !!!!!!!! THE BIT ABOVE IS IMPORTANT !!!!!!!!!
993 *************************************************************************
994*/
995/* mng_set_srgb tells libmng if it's running on a sRGB compliant system or not
996 the default is already set to MNG_TRUE */
997/* mng_set_outputprofile, mng_set_outputprofile2, mng_set_outputsrgb
998 are used to set the default profile describing the output-device
999 by default it is already initialized with an sRGB profile */
1000/* mng_set_srgbprofile, mng_set_srgbprofile2, mng_set_srgbimplicit
1001 are used to set the default profile describing a standard sRGB device
1002 this is used when the input-image is tagged only as being sRGB, but the
1003 output-device is defined as not being sRGB compliant
1004 by default it is already initialized with a standard sRGB profile */
1005#if defined(MNG_SUPPORT_DISPLAY)
1006MNG_EXT mng_retcode MNG_DECL mng_set_srgb (mng_handle hHandle,
1007 mng_bool bIssRGB);
1008MNG_EXT mng_retcode MNG_DECL mng_set_outputprofile (mng_handle hHandle,
1009 mng_pchar zFilename);
1010MNG_EXT mng_retcode MNG_DECL mng_set_outputprofile2 (mng_handle hHandle,
1011 mng_uint32 iProfilesize,
1012 mng_ptr pProfile);
1013MNG_EXT mng_retcode MNG_DECL mng_set_outputsrgb (mng_handle hHandle);
1014MNG_EXT mng_retcode MNG_DECL mng_set_srgbprofile (mng_handle hHandle,
1015 mng_pchar zFilename);
1016MNG_EXT mng_retcode MNG_DECL mng_set_srgbprofile2 (mng_handle hHandle,
1017 mng_uint32 iProfilesize,
1018 mng_ptr pProfile);
1019MNG_EXT mng_retcode MNG_DECL mng_set_srgbimplicit (mng_handle hHandle);
1020#endif
1021
1022#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY) || defined(MNG_APP_CMS)
1023/* Gamma settings */
1024/* ... blabla (explain gamma processing a little; eg. formula & stuff) ... */
1025MNG_EXT mng_retcode MNG_DECL mng_set_viewgamma (mng_handle hHandle,
1026 mng_float dGamma);
1027MNG_EXT mng_retcode MNG_DECL mng_set_displaygamma (mng_handle hHandle,
1028 mng_float dGamma);
1029MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggamma (mng_handle hHandle,
1030 mng_float dGamma);
1031MNG_EXT mng_retcode MNG_DECL mng_set_viewgammaint (mng_handle hHandle,
1032 mng_uint32 iGamma);
1033MNG_EXT mng_retcode MNG_DECL mng_set_displaygammaint (mng_handle hHandle,
1034 mng_uint32 iGamma);
1035MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggammaint (mng_handle hHandle,
1036 mng_uint32 iGamma);
1037#endif
1038
1039#ifndef MNG_SKIP_MAXCANVAS
1040/* Ultimate clipping size */
1041/* used to limit extreme graphics from overloading the system */
1042/* if a graphic exceeds these limits a warning is issued, which can
1043 be ignored by the app (using the errorproc callback). in that case
1044 the library will use these settings to clip the input graphic, and
1045 the app's canvas must account for this */
1046MNG_EXT mng_retcode MNG_DECL mng_set_maxcanvaswidth (mng_handle hHandle,
1047 mng_uint32 iMaxwidth);
1048MNG_EXT mng_retcode MNG_DECL mng_set_maxcanvasheight (mng_handle hHandle,
1049 mng_uint32 iMaxheight);
1050MNG_EXT mng_retcode MNG_DECL mng_set_maxcanvassize (mng_handle hHandle,
1051 mng_uint32 iMaxwidth,
1052 mng_uint32 iMaxheight);
1053#endif
1054
1055/* ZLIB default compression parameters */
1056/* these are used when writing out chunks */
1057/* they are also used when compressing PNG image-data or JNG alpha-data;
1058 in this case you can set them just before calling mng_putimgdata_ihdr */
1059/* set to your liking; usually the defaults will suffice though! */
1060/* check the documentation for ZLIB for details on these parameters */
1061#ifdef MNG_INCLUDE_ZLIB
1062MNG_EXT mng_retcode MNG_DECL mng_set_zlib_level (mng_handle hHandle,
1063 mng_int32 iZlevel);
1064MNG_EXT mng_retcode MNG_DECL mng_set_zlib_method (mng_handle hHandle,
1065 mng_int32 iZmethod);
1066MNG_EXT mng_retcode MNG_DECL mng_set_zlib_windowbits (mng_handle hHandle,
1067 mng_int32 iZwindowbits);
1068MNG_EXT mng_retcode MNG_DECL mng_set_zlib_memlevel (mng_handle hHandle,
1069 mng_int32 iZmemlevel);
1070MNG_EXT mng_retcode MNG_DECL mng_set_zlib_strategy (mng_handle hHandle,
1071 mng_int32 iZstrategy);
1072
1073MNG_EXT mng_retcode MNG_DECL mng_set_zlib_maxidat (mng_handle hHandle,
1074 mng_uint32 iMaxIDAT);
1075#endif /* MNG_INCLUDE_ZLIB */
1076
1077/* JNG default compression parameters (based on IJG code) */
1078/* these are used when compressing JNG image-data; so you can set them
1079 just before calling mng_putimgdata_jhdr */
1080/* set to your liking; usually the defaults will suffice though! */
1081/* check the documentation for IJGSRC6B for details on these parameters */
1082#ifdef MNG_INCLUDE_JNG
1083#ifdef MNG_INCLUDE_IJG6B
1084MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_dctmethod (mng_handle hHandle,
1085 mngjpeg_dctmethod eJPEGdctmethod);
1086#endif
1087MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_quality (mng_handle hHandle,
1088 mng_int32 iJPEGquality);
1089MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_smoothing (mng_handle hHandle,
1090 mng_int32 iJPEGsmoothing);
1091MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_progressive(mng_handle hHandle,
1092 mng_bool bJPEGprogressive);
1093MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_optimized (mng_handle hHandle,
1094 mng_bool bJPEGoptimized);
1095
1096MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_maxjdat (mng_handle hHandle,
1097 mng_uint32 iMaxJDAT);
1098#endif /* MNG_INCLUDE_JNG */
1099
1100/* Suspension-mode setting */
1101/* use this to activate the internal suspension-buffer to improve
1102 read-suspension processing */
1103/* TODO: write-suspension ??? */
1104#if defined(MNG_SUPPORT_READ)
1105MNG_EXT mng_retcode MNG_DECL mng_set_suspensionmode (mng_handle hHandle,
1106 mng_bool bSuspensionmode);
1107#endif
1108
1109/* Speed setting */
1110/* use this to influence the display-speed of animations */
1111#if defined(MNG_SUPPORT_DISPLAY)
1112MNG_EXT mng_retcode MNG_DECL mng_set_speed (mng_handle hHandle,
1113 mng_speedtype iSpeed);
1114#endif
1115
1116/* ************************************************************************** */
1117/* * * */
1118/* * Property get functions * */
1119/* * * */
1120/* ************************************************************************** */
1121
1122/* see _set_ */
1123MNG_EXT mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle);
1124
1125/* Network Graphic header details */
1126/* these get filled once the graphics header is processed,
1127 so they are available in the processheader callback; before that
1128 they are zeroed out and imagetype is set to it_unknown */
1129/* this might be a good point for the app to initialize the drawing-canvas! */
1130/* note that some fields are only set for the first(!) header-chunk:
1131 MNG/MHDR (imagetype = mng_it_mng) - ticks thru simplicity
1132 PNG/IHDR (imagetype = mng_it_png) - bitdepth thru interlace
1133 JNG/JHDR (imagetype = mng_it_jng) - bitdepth thru compression &
1134 interlace thru alphainterlace */
1135MNG_EXT mng_imgtype MNG_DECL mng_get_sigtype (mng_handle hHandle);
1136MNG_EXT mng_imgtype MNG_DECL mng_get_imagetype (mng_handle hHandle);
1137MNG_EXT mng_uint32 MNG_DECL mng_get_imagewidth (mng_handle hHandle);
1138MNG_EXT mng_uint32 MNG_DECL mng_get_imageheight (mng_handle hHandle);
1139
1140MNG_EXT mng_uint32 MNG_DECL mng_get_ticks (mng_handle hHandle);
1141MNG_EXT mng_uint32 MNG_DECL mng_get_framecount (mng_handle hHandle);
1142MNG_EXT mng_uint32 MNG_DECL mng_get_layercount (mng_handle hHandle);
1143MNG_EXT mng_uint32 MNG_DECL mng_get_playtime (mng_handle hHandle);
1144MNG_EXT mng_uint32 MNG_DECL mng_get_simplicity (mng_handle hHandle);
1145
1146MNG_EXT mng_uint8 MNG_DECL mng_get_bitdepth (mng_handle hHandle);
1147MNG_EXT mng_uint8 MNG_DECL mng_get_colortype (mng_handle hHandle);
1148MNG_EXT mng_uint8 MNG_DECL mng_get_compression (mng_handle hHandle);
1149MNG_EXT mng_uint8 MNG_DECL mng_get_filter (mng_handle hHandle);
1150MNG_EXT mng_uint8 MNG_DECL mng_get_interlace (mng_handle hHandle);
1151MNG_EXT mng_uint8 MNG_DECL mng_get_alphabitdepth (mng_handle hHandle);
1152MNG_EXT mng_uint8 MNG_DECL mng_get_alphacompression(mng_handle hHandle);
1153MNG_EXT mng_uint8 MNG_DECL mng_get_alphafilter (mng_handle hHandle);
1154MNG_EXT mng_uint8 MNG_DECL mng_get_alphainterlace (mng_handle hHandle);
1155
1156/* indicates the predicted alpha-depth required to properly display the image */
1157/* gets set once the graphics header is processed and is available in the
1158 processheader callback for any type of input-image (PNG, JNG or MNG) */
1159/* possible values are 0,1,2,4,8,16
1160 0 = no transparency required
1161 1 = on/off transparency required (alpha-values are 0 or 2^bit_depth-1)
1162 2+ = semi-transparency required (values will be scaled to the bitdepth of the
1163 canvasstyle supplied by the application) */
1164MNG_EXT mng_uint8 MNG_DECL mng_get_alphadepth (mng_handle hHandle);
1165
1166/* defines whether a refresh() callback is called for an interlace pass (PNG)
1167 or progressive scan (JNG) */
1168/* returns the interlace pass number for PNG or a fabricated pass number for JNG;
1169 returns 0 in all other cases */
1170/* only useful if the image_type = mng_it_png or mng_it_jng and if the image
1171 is actually interlaced (PNG) or progressive (JNG) */
1172#ifdef MNG_SUPPORT_DISPLAY
1173MNG_EXT mng_uint8 MNG_DECL mng_get_refreshpass (mng_handle hHandle);
1174#endif
1175
1176/* see _set_ */
1177MNG_EXT mng_uint32 MNG_DECL mng_get_canvasstyle (mng_handle hHandle);
1178MNG_EXT mng_uint32 MNG_DECL mng_get_bkgdstyle (mng_handle hHandle);
1179
1180/* see _set_ */
1181MNG_EXT mng_retcode MNG_DECL mng_get_bgcolor (mng_handle hHandle,
1182 mng_uint16* iRed,
1183 mng_uint16* iGreen,
1184 mng_uint16* iBlue);
1185
1186/* see _set_ */
1187MNG_EXT mng_bool MNG_DECL mng_get_usebkgd (mng_handle hHandle);
1188
1189/* see _set_ */
1190MNG_EXT mng_bool MNG_DECL mng_get_storechunks (mng_handle hHandle);
1191
1192/* see _set_ */
1193MNG_EXT mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle);
1194
1195/* see _set_ */
1196MNG_EXT mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle);
1197
1198/* see _set_ */
1199MNG_EXT mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle);
1200
1201/* see _set_ */
1202MNG_EXT mng_uint32 MNG_DECL mng_get_crcmode (mng_handle hHandle);
1203
1204/* see _set_ */
1205#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_FULL_CMS)
1206MNG_EXT mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle);
1207#endif
1208
1209/* see _set_ */
1210MNG_EXT mng_float MNG_DECL mng_get_viewgamma (mng_handle hHandle);
1211MNG_EXT mng_float MNG_DECL mng_get_displaygamma (mng_handle hHandle);
1212MNG_EXT mng_float MNG_DECL mng_get_dfltimggamma (mng_handle hHandle);
1213MNG_EXT mng_uint32 MNG_DECL mng_get_viewgammaint (mng_handle hHandle);
1214MNG_EXT mng_uint32 MNG_DECL mng_get_displaygammaint (mng_handle hHandle);
1215MNG_EXT mng_uint32 MNG_DECL mng_get_dfltimggammaint (mng_handle hHandle);
1216
1217#ifndef MNG_SKIP_MAXCANVAS
1218/* see _set_ */
1219MNG_EXT mng_uint32 MNG_DECL mng_get_maxcanvaswidth (mng_handle hHandle);
1220MNG_EXT mng_uint32 MNG_DECL mng_get_maxcanvasheight (mng_handle hHandle);
1221#endif
1222
1223/* see _set_ */
1224#ifdef MNG_INCLUDE_ZLIB
1225MNG_EXT mng_int32 MNG_DECL mng_get_zlib_level (mng_handle hHandle);
1226MNG_EXT mng_int32 MNG_DECL mng_get_zlib_method (mng_handle hHandle);
1227MNG_EXT mng_int32 MNG_DECL mng_get_zlib_windowbits (mng_handle hHandle);
1228MNG_EXT mng_int32 MNG_DECL mng_get_zlib_memlevel (mng_handle hHandle);
1229MNG_EXT mng_int32 MNG_DECL mng_get_zlib_strategy (mng_handle hHandle);
1230
1231MNG_EXT mng_uint32 MNG_DECL mng_get_zlib_maxidat (mng_handle hHandle);
1232#endif /* MNG_INCLUDE_ZLIB */
1233
1234/* see _set_ */
1235#ifdef MNG_INCLUDE_JNG
1236#ifdef MNG_INCLUDE_IJG6B
1237MNG_EXT mngjpeg_dctmethod
1238 MNG_DECL mng_get_jpeg_dctmethod (mng_handle hHandle);
1239#endif
1240MNG_EXT mng_int32 MNG_DECL mng_get_jpeg_quality (mng_handle hHandle);
1241MNG_EXT mng_int32 MNG_DECL mng_get_jpeg_smoothing (mng_handle hHandle);
1242MNG_EXT mng_bool MNG_DECL mng_get_jpeg_progressive(mng_handle hHandle);
1243MNG_EXT mng_bool MNG_DECL mng_get_jpeg_optimized (mng_handle hHandle);
1244
1245MNG_EXT mng_uint32 MNG_DECL mng_get_jpeg_maxjdat (mng_handle hHandle);
1246#endif /* MNG_INCLUDE_JNG */
1247
1248/* see _set_ */
1249#if defined(MNG_SUPPORT_READ)
1250MNG_EXT mng_bool MNG_DECL mng_get_suspensionmode (mng_handle hHandle);
1251#endif
1252
1253/* see _set_ */
1254#if defined(MNG_SUPPORT_DISPLAY)
1255MNG_EXT mng_speedtype
1256 MNG_DECL mng_get_speed (mng_handle hHandle);
1257#endif
1258
1259/* Image-level */
1260/* this can be used inside the processtext callback to determine the level of
1261 text of the image being processed; the value 1 is returned for top-level
1262 texts, and the value 2 for a text inside an embedded image inside a MNG */
1263MNG_EXT mng_uint32 MNG_DECL mng_get_imagelevel (mng_handle hHandle);
1264
1265/* BACK info */
1266/* can be used to retrieve the color & mandatory values for the last processed
1267 BACK chunk of a MNG (will fail for other image-types);
1268 if no BACK chunk was processed yet, it will return all zeroes */
1269#ifdef MNG_SUPPORT_DISPLAY
1270MNG_EXT mng_retcode MNG_DECL mng_get_lastbackchunk (mng_handle hHandle,
1271 mng_uint16* iRed,
1272 mng_uint16* iGreen,
1273 mng_uint16* iBlue,
1274 mng_uint8* iMandatory);
1275#endif
1276
1277/* SEEK info */
1278/* can be used to retrieve the segmentname of the last processed SEEK chunk;
1279 if no SEEK chunk was processed or its segmentname was empty, the function
1280 will return an empty string; the provided buffer must be at least 80 bytes!! */
1281#ifdef MNG_SUPPORT_DISPLAY
1282MNG_EXT mng_retcode MNG_DECL mng_get_lastseekname (mng_handle hHandle,
1283 mng_pchar zSegmentname);
1284#endif
1285
1286/* FRAM info */
1287/* can be used to retrieve the current FRAM delay; this may be useful when
1288 retrieving a stream of frames with their corresponding delays by "fake"
1289 reading and displaying the file */
1290#ifdef MNG_SUPPORT_DISPLAY
1291MNG_EXT mng_uint32 MNG_DECL mng_get_currframdelay (mng_handle hHandle);
1292#endif
1293
1294/* Display status variables */
1295/* these get filled & updated during display processing */
1296/* starttime is the tickcount at the start of displaying the animation */
1297/* runtime is the actual number of millisecs since the start of the animation */
1298/* currentframe, currentlayer & currentplaytime indicate the current
1299 frame/layer/playtime(msecs) in the animation (these keep increasing;
1300 even after the animation loops back to the TERM chunk) */
1301/* totalframes, totallayers & totalplaytime are filled after a complete run
1302 of an animation (eg. at MEND); they are also valid after just reading the MNG */
1303#ifdef MNG_SUPPORT_DISPLAY
1304MNG_EXT mng_uint32 MNG_DECL mng_get_starttime (mng_handle hHandle);
1305MNG_EXT mng_uint32 MNG_DECL mng_get_runtime (mng_handle hHandle);
1306#ifndef MNG_NO_CURRENT_INFO
1307MNG_EXT mng_uint32 MNG_DECL mng_get_currentframe (mng_handle hHandle);
1308MNG_EXT mng_uint32 MNG_DECL mng_get_currentlayer (mng_handle hHandle);
1309MNG_EXT mng_uint32 MNG_DECL mng_get_currentplaytime (mng_handle hHandle);
1310MNG_EXT mng_uint32 MNG_DECL mng_get_totalframes (mng_handle hHandle);
1311MNG_EXT mng_uint32 MNG_DECL mng_get_totallayers (mng_handle hHandle);
1312MNG_EXT mng_uint32 MNG_DECL mng_get_totalplaytime (mng_handle hHandle);
1313#endif
1314#endif
1315
1316/* Status variables */
1317/* these indicate the internal state of the library */
1318/* most indicate exactly what you would expect -
1319 status_error: true if the last function call returned an errorcode
1320 status_reading: true if the library is (still) reading an image
1321 status_suspendbreak: true if the library has suspended for "I/O"
1322 status_creating: true if the library is in the middle of creating an image
1323 status_writing: true if the library is in the middle of writing an image
1324 status_displaying: true if the library is displaying an image
1325 status_running: true if display processing is active (eg. not frozen or reset)
1326 status_timerbreak: true if the library has suspended for a "timer-break"
1327 status_dynamic: true if the library encountered an evNT chunk in the MNG
1328 status_runningevent: true if the library is processing an external event */
1329/* eg. mng_readdisplay() will turn the reading, displaying and running status on;
1330 when EOF is reached the reading status will be turned off */
1331MNG_EXT mng_bool MNG_DECL mng_status_error (mng_handle hHandle);
1332#ifdef MNG_SUPPORT_READ
1333MNG_EXT mng_bool MNG_DECL mng_status_reading (mng_handle hHandle);
1334MNG_EXT mng_bool MNG_DECL mng_status_suspendbreak (mng_handle hHandle);
1335#endif
1336#ifdef MNG_SUPPORT_WRITE
1337MNG_EXT mng_bool MNG_DECL mng_status_creating (mng_handle hHandle);
1338MNG_EXT mng_bool MNG_DECL mng_status_writing (mng_handle hHandle);
1339#endif
1340#ifdef MNG_SUPPORT_DISPLAY
1341MNG_EXT mng_bool MNG_DECL mng_status_displaying (mng_handle hHandle);
1342MNG_EXT mng_bool MNG_DECL mng_status_running (mng_handle hHandle);
1343MNG_EXT mng_bool MNG_DECL mng_status_timerbreak (mng_handle hHandle);
1344#endif
1345#ifdef MNG_SUPPORT_DYNAMICMNG
1346MNG_EXT mng_bool MNG_DECL mng_status_dynamic (mng_handle hHandle);
1347MNG_EXT mng_bool MNG_DECL mng_status_runningevent (mng_handle hHandle);
1348#endif
1349
1350/* ************************************************************************** */
1351/* * * */
1352/* * Chunk access functions * */
1353/* * * */
1354/* ************************************************************************** */
1355
1356#ifdef MNG_ACCESS_CHUNKS
1357
1358/* ************************************************************************** */
1359
1360/* use this to iterate the stored chunks */
1361/* requires MNG_ACCESS_CHUNKS & MNG_STORE_CHUNKS */
1362/* starts from the supplied chunk-index-nr; the first chunk has index 0!! */
1363MNG_EXT mng_retcode MNG_DECL mng_iterate_chunks (mng_handle hHandle,
1364 mng_uint32 iChunkseq,
1365 mng_iteratechunk fProc);
1366
1367/* use the next function inside your 'iteratechunk' callback to copy
1368 the given chunk to a new mng you are creating */
1369/* the 'out' handle should be in 'create' status! */
1370#ifdef MNG_SUPPORT_WRITE
1371MNG_EXT mng_retcode MNG_DECL mng_copy_chunk (mng_handle hHandle,
1372 mng_handle hChunk,
1373 mng_handle hHandleOut);
1374#endif
1375
1376/* ************************************************************************** */
1377
1378/* use these to get chunk data from within the callback in iterate_chunks */
1379MNG_EXT mng_retcode MNG_DECL mng_getchunk_ihdr (mng_handle hHandle,
1380 mng_handle hChunk,
1381 mng_uint32 *iWidth,
1382 mng_uint32 *iHeight,
1383 mng_uint8 *iBitdepth,
1384 mng_uint8 *iColortype,
1385 mng_uint8 *iCompression,
1386 mng_uint8 *iFilter,
1387 mng_uint8 *iInterlace);
1388
1389MNG_EXT mng_retcode MNG_DECL mng_getchunk_plte (mng_handle hHandle,
1390 mng_handle hChunk,
1391 mng_uint32 *iCount,
1392 mng_palette8 *aPalette);
1393
1394MNG_EXT mng_retcode MNG_DECL mng_getchunk_idat (mng_handle hHandle,
1395 mng_handle hChunk,
1396 mng_uint32 *iRawlen,
1397 mng_ptr *pRawdata);
1398
1399MNG_EXT mng_retcode MNG_DECL mng_getchunk_trns (mng_handle hHandle,
1400 mng_handle hChunk,
1401 mng_bool *bEmpty,
1402 mng_bool *bGlobal,
1403 mng_uint8 *iType,
1404 mng_uint32 *iCount,
1405 mng_uint8arr *aAlphas,
1406 mng_uint16 *iGray,
1407 mng_uint16 *iRed,
1408 mng_uint16 *iGreen,
1409 mng_uint16 *iBlue,
1410 mng_uint32 *iRawlen,
1411 mng_uint8arr *aRawdata);
1412
1413MNG_EXT mng_retcode MNG_DECL mng_getchunk_gama (mng_handle hHandle,
1414 mng_handle hChunk,
1415 mng_bool *bEmpty,
1416 mng_uint32 *iGamma);
1417
1418MNG_EXT mng_retcode MNG_DECL mng_getchunk_chrm (mng_handle hHandle,
1419 mng_handle hChunk,
1420 mng_bool *bEmpty,
1421 mng_uint32 *iWhitepointx,
1422 mng_uint32 *iWhitepointy,
1423 mng_uint32 *iRedx,
1424 mng_uint32 *iRedy,
1425 mng_uint32 *iGreenx,
1426 mng_uint32 *iGreeny,
1427 mng_uint32 *iBluex,
1428 mng_uint32 *iBluey);
1429
1430MNG_EXT mng_retcode MNG_DECL mng_getchunk_srgb (mng_handle hHandle,
1431 mng_handle hChunk,
1432 mng_bool *bEmpty,
1433 mng_uint8 *iRenderingintent);
1434
1435MNG_EXT mng_retcode MNG_DECL mng_getchunk_iccp (mng_handle hHandle,
1436 mng_handle hChunk,
1437 mng_bool *bEmpty,
1438 mng_uint32 *iNamesize,
1439 mng_pchar *zName,
1440 mng_uint8 *iCompression,
1441 mng_uint32 *iProfilesize,
1442 mng_ptr *pProfile);
1443
1444MNG_EXT mng_retcode MNG_DECL mng_getchunk_text (mng_handle hHandle,
1445 mng_handle hChunk,
1446 mng_uint32 *iKeywordsize,
1447 mng_pchar *zKeyword,
1448 mng_uint32 *iTextsize,
1449 mng_pchar *zText);
1450
1451MNG_EXT mng_retcode MNG_DECL mng_getchunk_ztxt (mng_handle hHandle,
1452 mng_handle hChunk,
1453 mng_uint32 *iKeywordsize,
1454 mng_pchar *zKeyword,
1455 mng_uint8 *iCompression,
1456 mng_uint32 *iTextsize,
1457 mng_pchar *zText);
1458
1459MNG_EXT mng_retcode MNG_DECL mng_getchunk_itxt (mng_handle hHandle,
1460 mng_handle hChunk,
1461 mng_uint32 *iKeywordsize,
1462 mng_pchar *zKeyword,
1463 mng_uint8 *iCompressionflag,
1464 mng_uint8 *iCompressionmethod,
1465 mng_uint32 *iLanguagesize,
1466 mng_pchar *zLanguage,
1467 mng_uint32 *iTranslationsize,
1468 mng_pchar *zTranslation,
1469 mng_uint32 *iTextsize,
1470 mng_pchar *zText);
1471
1472MNG_EXT mng_retcode MNG_DECL mng_getchunk_bkgd (mng_handle hHandle,
1473 mng_handle hChunk,
1474 mng_bool *bEmpty,
1475 mng_uint8 *iType,
1476 mng_uint8 *iIndex,
1477 mng_uint16 *iGray,
1478 mng_uint16 *iRed,
1479 mng_uint16 *iGreen,
1480 mng_uint16 *iBlue);
1481
1482MNG_EXT mng_retcode MNG_DECL mng_getchunk_phys (mng_handle hHandle,
1483 mng_handle hChunk,
1484 mng_bool *bEmpty,
1485 mng_uint32 *iSizex,
1486 mng_uint32 *iSizey,
1487 mng_uint8 *iUnit);
1488
1489MNG_EXT mng_retcode MNG_DECL mng_getchunk_sbit (mng_handle hHandle,
1490 mng_handle hChunk,
1491 mng_bool *bEmpty,
1492 mng_uint8 *iType,
1493 mng_uint8arr4 *aBits);
1494
1495MNG_EXT mng_retcode MNG_DECL mng_getchunk_splt (mng_handle hHandle,
1496 mng_handle hChunk,
1497 mng_bool *bEmpty,
1498 mng_uint32 *iNamesize,
1499 mng_pchar *zName,
1500 mng_uint8 *iSampledepth,
1501 mng_uint32 *iEntrycount,
1502 mng_ptr *pEntries);
1503
1504MNG_EXT mng_retcode MNG_DECL mng_getchunk_hist (mng_handle hHandle,
1505 mng_handle hChunk,
1506 mng_uint32 *iEntrycount,
1507 mng_uint16arr *aEntries);
1508
1509MNG_EXT mng_retcode MNG_DECL mng_getchunk_time (mng_handle hHandle,
1510 mng_handle hChunk,
1511 mng_uint16 *iYear,
1512 mng_uint8 *iMonth,
1513 mng_uint8 *iDay,
1514 mng_uint8 *iHour,
1515 mng_uint8 *iMinute,
1516 mng_uint8 *iSecond);
1517
1518MNG_EXT mng_retcode MNG_DECL mng_getchunk_mhdr (mng_handle hHandle,
1519 mng_handle hChunk,
1520 mng_uint32 *iWidth,
1521 mng_uint32 *iHeight,
1522 mng_uint32 *iTicks,
1523 mng_uint32 *iLayercount,
1524 mng_uint32 *iFramecount,
1525 mng_uint32 *iPlaytime,
1526 mng_uint32 *iSimplicity);
1527
1528MNG_EXT mng_retcode MNG_DECL mng_getchunk_loop (mng_handle hHandle,
1529 mng_handle hChunk,
1530 mng_uint8 *iLevel,
1531 mng_uint32 *iRepeat,
1532 mng_uint8 *iTermination,
1533 mng_uint32 *iItermin,
1534 mng_uint32 *iItermax,
1535 mng_uint32 *iCount,
1536 mng_uint32p *pSignals);
1537
1538MNG_EXT mng_retcode MNG_DECL mng_getchunk_endl (mng_handle hHandle,
1539 mng_handle hChunk,
1540 mng_uint8 *iLevel);
1541
1542MNG_EXT mng_retcode MNG_DECL mng_getchunk_defi (mng_handle hHandle,
1543 mng_handle hChunk,
1544 mng_uint16 *iObjectid,
1545 mng_uint8 *iDonotshow,
1546 mng_uint8 *iConcrete,
1547 mng_bool *bHasloca,
1548 mng_int32 *iXlocation,
1549 mng_int32 *iYlocation,
1550 mng_bool *bHasclip,
1551 mng_int32 *iLeftcb,
1552 mng_int32 *iRightcb,
1553 mng_int32 *iTopcb,
1554 mng_int32 *iBottomcb);
1555
1556MNG_EXT mng_retcode MNG_DECL mng_getchunk_basi (mng_handle hHandle,
1557 mng_handle hChunk,
1558 mng_uint32 *iWidth,
1559 mng_uint32 *iHeight,
1560 mng_uint8 *iBitdepth,
1561 mng_uint8 *iColortype,
1562 mng_uint8 *iCompression,
1563 mng_uint8 *iFilter,
1564 mng_uint8 *iInterlace,
1565 mng_uint16 *iRed,
1566 mng_uint16 *iGreen,
1567 mng_uint16 *iBlue,
1568 mng_uint16 *iAlpha,
1569 mng_uint8 *iViewable);
1570
1571MNG_EXT mng_retcode MNG_DECL mng_getchunk_clon (mng_handle hHandle,
1572 mng_handle hChunk,
1573 mng_uint16 *iSourceid,
1574 mng_uint16 *iCloneid,
1575 mng_uint8 *iClonetype,
1576 mng_uint8 *iDonotshow,
1577 mng_uint8 *iConcrete,
1578 mng_bool *bHasloca,
1579 mng_uint8 *iLocationtype,
1580 mng_int32 *iLocationx,
1581 mng_int32 *iLocationy);
1582
1583#ifndef MNG_SKIPCHUNK_PAST
1584MNG_EXT mng_retcode MNG_DECL mng_getchunk_past (mng_handle hHandle,
1585 mng_handle hChunk,
1586 mng_uint16 *iDestid,
1587 mng_uint8 *iTargettype,
1588 mng_int32 *iTargetx,
1589 mng_int32 *iTargety,
1590 mng_uint32 *iCount);
1591
1592MNG_EXT mng_retcode MNG_DECL mng_getchunk_past_src (mng_handle hHandle,
1593 mng_handle hChunk,
1594 mng_uint32 iEntry,
1595 mng_uint16 *iSourceid,
1596 mng_uint8 *iComposition,
1597 mng_uint8 *iOrientation,
1598 mng_uint8 *iOffsettype,
1599 mng_int32 *iOffsetx,
1600 mng_int32 *iOffsety,
1601 mng_uint8 *iBoundarytype,
1602 mng_int32 *iBoundaryl,
1603 mng_int32 *iBoundaryr,
1604 mng_int32 *iBoundaryt,
1605 mng_int32 *iBoundaryb);
1606#endif
1607
1608MNG_EXT mng_retcode MNG_DECL mng_getchunk_disc (mng_handle hHandle,
1609 mng_handle hChunk,
1610 mng_uint32 *iCount,
1611 mng_uint16p *pObjectids);
1612
1613MNG_EXT mng_retcode MNG_DECL mng_getchunk_back (mng_handle hHandle,
1614 mng_handle hChunk,
1615 mng_uint16 *iRed,
1616 mng_uint16 *iGreen,
1617 mng_uint16 *iBlue,
1618 mng_uint8 *iMandatory,
1619 mng_uint16 *iImageid,
1620 mng_uint8 *iTile);
1621
1622MNG_EXT mng_retcode MNG_DECL mng_getchunk_fram (mng_handle hHandle,
1623 mng_handle hChunk,
1624 mng_bool *bEmpty,
1625 mng_uint8 *iMode,
1626 mng_uint32 *iNamesize,
1627 mng_pchar *zName,
1628 mng_uint8 *iChangedelay,
1629 mng_uint8 *iChangetimeout,
1630 mng_uint8 *iChangeclipping,
1631 mng_uint8 *iChangesyncid,
1632 mng_uint32 *iDelay,
1633 mng_uint32 *iTimeout,
1634 mng_uint8 *iBoundarytype,
1635 mng_int32 *iBoundaryl,
1636 mng_int32 *iBoundaryr,
1637 mng_int32 *iBoundaryt,
1638 mng_int32 *iBoundaryb,
1639 mng_uint32 *iCount,
1640 mng_uint32p *pSyncids);
1641
1642MNG_EXT mng_retcode MNG_DECL mng_getchunk_move (mng_handle hHandle,
1643 mng_handle hChunk,
1644 mng_uint16 *iFirstid,
1645 mng_uint16 *iLastid,
1646 mng_uint8 *iMovetype,
1647 mng_int32 *iMovex,
1648 mng_int32 *iMovey);
1649
1650MNG_EXT mng_retcode MNG_DECL mng_getchunk_clip (mng_handle hHandle,
1651 mng_handle hChunk,
1652 mng_uint16 *iFirstid,
1653 mng_uint16 *iLastid,
1654 mng_uint8 *iCliptype,
1655 mng_int32 *iClipl,
1656 mng_int32 *iClipr,
1657 mng_int32 *iClipt,
1658 mng_int32 *iClipb);
1659
1660MNG_EXT mng_retcode MNG_DECL mng_getchunk_show (mng_handle hHandle,
1661 mng_handle hChunk,
1662 mng_bool *bEmpty,
1663 mng_uint16 *iFirstid,
1664 mng_uint16 *iLastid,
1665 mng_uint8 *iMode);
1666
1667MNG_EXT mng_retcode MNG_DECL mng_getchunk_term (mng_handle hHandle,
1668 mng_handle hChunk,
1669 mng_uint8 *iTermaction,
1670 mng_uint8 *iIteraction,
1671 mng_uint32 *iDelay,
1672 mng_uint32 *iItermax);
1673
1674MNG_EXT mng_retcode MNG_DECL mng_getchunk_save (mng_handle hHandle,
1675 mng_handle hChunk,
1676 mng_bool *bEmpty,
1677 mng_uint8 *iOffsettype,
1678 mng_uint32 *iCount);
1679
1680MNG_EXT mng_retcode MNG_DECL mng_getchunk_save_entry (mng_handle hHandle,
1681 mng_handle hChunk,
1682 mng_uint32 iEntry,
1683 mng_uint8 *iEntrytype,
1684 mng_uint32arr2 *iOffset,
1685 mng_uint32arr2 *iStarttime,
1686 mng_uint32 *iLayernr,
1687 mng_uint32 *iFramenr,
1688 mng_uint32 *iNamesize,
1689 mng_pchar *zName);
1690
1691MNG_EXT mng_retcode MNG_DECL mng_getchunk_seek (mng_handle hHandle,
1692 mng_handle hChunk,
1693 mng_uint32 *iNamesize,
1694 mng_pchar *zName);
1695
1696MNG_EXT mng_retcode MNG_DECL mng_getchunk_expi (mng_handle hHandle,
1697 mng_handle hChunk,
1698 mng_uint16 *iSnapshotid,
1699 mng_uint32 *iNamesize,
1700 mng_pchar *zName);
1701
1702MNG_EXT mng_retcode MNG_DECL mng_getchunk_fpri (mng_handle hHandle,
1703 mng_handle hChunk,
1704 mng_uint8 *iDeltatype,
1705 mng_uint8 *iPriority);
1706
1707MNG_EXT mng_retcode MNG_DECL mng_getchunk_need (mng_handle hHandle,
1708 mng_handle hChunk,
1709 mng_uint32 *iKeywordssize,
1710 mng_pchar *zKeywords);
1711
1712MNG_EXT mng_retcode MNG_DECL mng_getchunk_phyg (mng_handle hHandle,
1713 mng_handle hChunk,
1714 mng_bool *bEmpty,
1715 mng_uint32 *iSizex,
1716 mng_uint32 *iSizey,
1717 mng_uint8 *iUnit);
1718
1719MNG_EXT mng_retcode MNG_DECL mng_getchunk_jhdr (mng_handle hHandle,
1720 mng_handle hChunk,
1721 mng_uint32 *iWidth,
1722 mng_uint32 *iHeight,
1723 mng_uint8 *iColortype,
1724 mng_uint8 *iImagesampledepth,
1725 mng_uint8 *iImagecompression,
1726 mng_uint8 *iImageinterlace,
1727 mng_uint8 *iAlphasampledepth,
1728 mng_uint8 *iAlphacompression,
1729 mng_uint8 *iAlphafilter,
1730 mng_uint8 *iAlphainterlace);
1731
1732MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdat (mng_handle hHandle,
1733 mng_handle hChunk,
1734 mng_uint32 *iRawlen,
1735 mng_ptr *pRawdata);
1736
1737MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdaa (mng_handle hHandle,
1738 mng_handle hChunk,
1739 mng_uint32 *iRawlen,
1740 mng_ptr *pRawdata);
1741
1742MNG_EXT mng_retcode MNG_DECL mng_getchunk_dhdr (mng_handle hHandle,
1743 mng_handle hChunk,
1744 mng_uint16 *iObjectid,
1745 mng_uint8 *iImagetype,
1746 mng_uint8 *iDeltatype,
1747 mng_uint32 *iBlockwidth,
1748 mng_uint32 *iBlockheight,
1749 mng_uint32 *iBlockx,
1750 mng_uint32 *iBlocky);
1751
1752MNG_EXT mng_retcode MNG_DECL mng_getchunk_prom (mng_handle hHandle,
1753 mng_handle hChunk,
1754 mng_uint8 *iColortype,
1755 mng_uint8 *iSampledepth,
1756 mng_uint8 *iFilltype);
1757
1758MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt (mng_handle hHandle,
1759 mng_handle hChunk,
1760 mng_uint8 *iDeltatype,
1761 mng_uint32 *iCount);
1762
1763MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt_entry (mng_handle hHandle,
1764 mng_handle hChunk,
1765 mng_uint32 iEntry,
1766 mng_uint16 *iRed,
1767 mng_uint16 *iGreen,
1768 mng_uint16 *iBlue,
1769 mng_uint16 *iAlpha,
1770 mng_bool *bUsed);
1771
1772MNG_EXT mng_retcode MNG_DECL mng_getchunk_drop (mng_handle hHandle,
1773 mng_handle hChunk,
1774 mng_uint32 *iCount,
1775 mng_chunkidp *pChunknames);
1776
1777MNG_EXT mng_retcode MNG_DECL mng_getchunk_dbyk (mng_handle hHandle,
1778 mng_handle hChunk,
1779 mng_chunkid *iChunkname,
1780 mng_uint8 *iPolarity,
1781 mng_uint32 *iKeywordssize,
1782 mng_pchar *zKeywords);
1783
1784MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr (mng_handle hHandle,
1785 mng_handle hChunk,
1786 mng_uint32 *iCount);
1787
1788MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr_entry (mng_handle hHandle,
1789 mng_handle hChunk,
1790 mng_uint32 iEntry,
1791 mng_chunkid *iChunkname,
1792 mng_uint8 *iOrdertype);
1793
1794MNG_EXT mng_retcode MNG_DECL mng_getchunk_magn (mng_handle hHandle,
1795 mng_handle hChunk,
1796 mng_uint16 *iFirstid,
1797 mng_uint16 *iLastid,
1798 mng_uint16 *iMethodX,
1799 mng_uint16 *iMX,
1800 mng_uint16 *iMY,
1801 mng_uint16 *iML,
1802 mng_uint16 *iMR,
1803 mng_uint16 *iMT,
1804 mng_uint16 *iMB,
1805 mng_uint16 *iMethodY);
1806
1807#ifdef MNG_INCLUDE_MPNG_PROPOSAL
1808MNG_EXT mng_retcode MNG_DECL mng_getchunk_mpng (mng_handle hHandle,
1809 mng_handle hChunk,
1810 mng_uint32 *iFramewidth,
1811 mng_uint32 *iFrameheight,
1812 mng_uint16 *iNumplays,
1813 mng_uint16 *iTickspersec,
1814 mng_uint8 *iCompressionmethod,
1815 mng_uint32 *iCount);
1816MNG_EXT mng_retcode MNG_DECL mng_getchunk_mpng_frame (mng_handle hHandle,
1817 mng_handle hChunk,
1818 mng_uint32 iEntry,
1819 mng_uint32 *iX,
1820 mng_uint32 *iY,
1821 mng_uint32 *iWidth,
1822 mng_uint32 *iHeight,
1823 mng_int32 *iXoffset,
1824 mng_int32 *iYoffset,
1825 mng_uint16 *iTicks);
1826#endif
1827
1828MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt (mng_handle hHandle,
1829 mng_handle hChunk,
1830 mng_uint32 *iCount);
1831
1832MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt_entry (mng_handle hHandle,
1833 mng_handle hChunk,
1834 mng_uint32 iEntry,
1835 mng_uint8 *iEventtype,
1836 mng_uint8 *iMasktype,
1837 mng_int32 *iLeft,
1838 mng_int32 *iRight,
1839 mng_int32 *iTop,
1840 mng_int32 *iBottom,
1841 mng_uint16 *iObjectid,
1842 mng_uint8 *iIndex,
1843 mng_uint32 *iSegmentnamesize,
1844 mng_pchar *zSegmentname);
1845
1846MNG_EXT mng_retcode MNG_DECL mng_getchunk_unknown (mng_handle hHandle,
1847 mng_handle hChunk,
1848 mng_chunkid *iChunkname,
1849 mng_uint32 *iRawlen,
1850 mng_ptr *pRawdata);
1851
1852/* ************************************************************************** */
1853
1854#ifdef MNG_INCLUDE_WRITE_PROCS
1855
1856/* use these to create new chunks at the end of the chunk-list */
1857/* requires at least MNG_ACCESS_CHUNKS (MNG_SUPPORT_WRITE may be nice too) */
1858MNG_EXT mng_retcode MNG_DECL mng_putchunk_ihdr (mng_handle hHandle,
1859 mng_uint32 iWidth,
1860 mng_uint32 iHeight,
1861 mng_uint8 iBitdepth,
1862 mng_uint8 iColortype,
1863 mng_uint8 iCompression,
1864 mng_uint8 iFilter,
1865 mng_uint8 iInterlace);
1866
1867MNG_EXT mng_retcode MNG_DECL mng_putchunk_plte (mng_handle hHandle,
1868 mng_uint32 iCount,
1869 mng_palette8 aPalette);
1870
1871MNG_EXT mng_retcode MNG_DECL mng_putchunk_idat (mng_handle hHandle,
1872 mng_uint32 iRawlen,
1873 mng_ptr pRawdata);
1874
1875MNG_EXT mng_retcode MNG_DECL mng_putchunk_iend (mng_handle hHandle);
1876
1877MNG_EXT mng_retcode MNG_DECL mng_putchunk_trns (mng_handle hHandle,
1878 mng_bool bEmpty,
1879 mng_bool bGlobal,
1880 mng_uint8 iType,
1881 mng_uint32 iCount,
1882 mng_uint8arr aAlphas,
1883 mng_uint16 iGray,
1884 mng_uint16 iRed,
1885 mng_uint16 iGreen,
1886 mng_uint16 iBlue,
1887 mng_uint32 iRawlen,
1888 mng_uint8arr aRawdata);
1889
1890MNG_EXT mng_retcode MNG_DECL mng_putchunk_gama (mng_handle hHandle,
1891 mng_bool bEmpty,
1892 mng_uint32 iGamma);
1893
1894MNG_EXT mng_retcode MNG_DECL mng_putchunk_chrm (mng_handle hHandle,
1895 mng_bool bEmpty,
1896 mng_uint32 iWhitepointx,
1897 mng_uint32 iWhitepointy,
1898 mng_uint32 iRedx,
1899 mng_uint32 iRedy,
1900 mng_uint32 iGreenx,
1901 mng_uint32 iGreeny,
1902 mng_uint32 iBluex,
1903 mng_uint32 iBluey);
1904
1905MNG_EXT mng_retcode MNG_DECL mng_putchunk_srgb (mng_handle hHandle,
1906 mng_bool bEmpty,
1907 mng_uint8 iRenderingintent);
1908
1909MNG_EXT mng_retcode MNG_DECL mng_putchunk_iccp (mng_handle hHandle,
1910 mng_bool bEmpty,
1911 mng_uint32 iNamesize,
1912 mng_pchar zName,
1913 mng_uint8 iCompression,
1914 mng_uint32 iProfilesize,
1915 mng_ptr pProfile);
1916
1917MNG_EXT mng_retcode MNG_DECL mng_putchunk_text (mng_handle hHandle,
1918 mng_uint32 iKeywordsize,
1919 mng_pchar zKeyword,
1920 mng_uint32 iTextsize,
1921 mng_pchar zText);
1922
1923MNG_EXT mng_retcode MNG_DECL mng_putchunk_ztxt (mng_handle hHandle,
1924 mng_uint32 iKeywordsize,
1925 mng_pchar zKeyword,
1926 mng_uint8 iCompression,
1927 mng_uint32 iTextsize,
1928 mng_pchar zText);
1929
1930MNG_EXT mng_retcode MNG_DECL mng_putchunk_itxt (mng_handle hHandle,
1931 mng_uint32 iKeywordsize,
1932 mng_pchar zKeyword,
1933 mng_uint8 iCompressionflag,
1934 mng_uint8 iCompressionmethod,
1935 mng_uint32 iLanguagesize,
1936 mng_pchar zLanguage,
1937 mng_uint32 iTranslationsize,
1938 mng_pchar zTranslation,
1939 mng_uint32 iTextsize,
1940 mng_pchar zText);
1941
1942MNG_EXT mng_retcode MNG_DECL mng_putchunk_bkgd (mng_handle hHandle,
1943 mng_bool bEmpty,
1944 mng_uint8 iType,
1945 mng_uint8 iIndex,
1946 mng_uint16 iGray,
1947 mng_uint16 iRed,
1948 mng_uint16 iGreen,
1949 mng_uint16 iBlue);
1950
1951MNG_EXT mng_retcode MNG_DECL mng_putchunk_phys (mng_handle hHandle,
1952 mng_bool bEmpty,
1953 mng_uint32 iSizex,
1954 mng_uint32 iSizey,
1955 mng_uint8 iUnit);
1956
1957MNG_EXT mng_retcode MNG_DECL mng_putchunk_sbit (mng_handle hHandle,
1958 mng_bool bEmpty,
1959 mng_uint8 iType,
1960 mng_uint8arr4 aBits);
1961
1962MNG_EXT mng_retcode MNG_DECL mng_putchunk_splt (mng_handle hHandle,
1963 mng_bool bEmpty,
1964 mng_uint32 iNamesize,
1965 mng_pchar zName,
1966 mng_uint8 iSampledepth,
1967 mng_uint32 iEntrycount,
1968 mng_ptr pEntries);
1969
1970MNG_EXT mng_retcode MNG_DECL mng_putchunk_hist (mng_handle hHandle,
1971 mng_uint32 iEntrycount,
1972 mng_uint16arr aEntries);
1973
1974MNG_EXT mng_retcode MNG_DECL mng_putchunk_time (mng_handle hHandle,
1975 mng_uint16 iYear,
1976 mng_uint8 iMonth,
1977 mng_uint8 iDay,
1978 mng_uint8 iHour,
1979 mng_uint8 iMinute,
1980 mng_uint8 iSecond);
1981
1982MNG_EXT mng_retcode MNG_DECL mng_putchunk_mhdr (mng_handle hHandle,
1983 mng_uint32 iWidth,
1984 mng_uint32 iHeight,
1985 mng_uint32 iTicks,
1986 mng_uint32 iLayercount,
1987 mng_uint32 iFramecount,
1988 mng_uint32 iPlaytime,
1989 mng_uint32 iSimplicity);
1990
1991MNG_EXT mng_retcode MNG_DECL mng_putchunk_mend (mng_handle hHandle);
1992
1993MNG_EXT mng_retcode MNG_DECL mng_putchunk_loop (mng_handle hHandle,
1994 mng_uint8 iLevel,
1995 mng_uint32 iRepeat,
1996 mng_uint8 iTermination,
1997 mng_uint32 iItermin,
1998 mng_uint32 iItermax,
1999 mng_uint32 iCount,
2000 mng_uint32p pSignals);
2001
2002MNG_EXT mng_retcode MNG_DECL mng_putchunk_endl (mng_handle hHandle,
2003 mng_uint8 iLevel);
2004
2005MNG_EXT mng_retcode MNG_DECL mng_putchunk_defi (mng_handle hHandle,
2006 mng_uint16 iObjectid,
2007 mng_uint8 iDonotshow,
2008 mng_uint8 iConcrete,
2009 mng_bool bHasloca,
2010 mng_int32 iXlocation,
2011 mng_int32 iYlocation,
2012 mng_bool bHasclip,
2013 mng_int32 iLeftcb,
2014 mng_int32 iRightcb,
2015 mng_int32 iTopcb,
2016 mng_int32 iBottomcb);
2017
2018MNG_EXT mng_retcode MNG_DECL mng_putchunk_basi (mng_handle hHandle,
2019 mng_uint32 iWidth,
2020 mng_uint32 iHeight,
2021 mng_uint8 iBitdepth,
2022 mng_uint8 iColortype,
2023 mng_uint8 iCompression,
2024 mng_uint8 iFilter,
2025 mng_uint8 iInterlace,
2026 mng_uint16 iRed,
2027 mng_uint16 iGreen,
2028 mng_uint16 iBlue,
2029 mng_uint16 iAlpha,
2030 mng_uint8 iViewable);
2031
2032MNG_EXT mng_retcode MNG_DECL mng_putchunk_clon (mng_handle hHandle,
2033 mng_uint16 iSourceid,
2034 mng_uint16 iCloneid,
2035 mng_uint8 iClonetype,
2036 mng_uint8 iDonotshow,
2037 mng_uint8 iConcrete,
2038 mng_bool bHasloca,
2039 mng_uint8 iLocationtype,
2040 mng_int32 iLocationx,
2041 mng_int32 iLocationy);
2042
2043#ifndef MNG_SKIPCHUNK_PAST
2044MNG_EXT mng_retcode MNG_DECL mng_putchunk_past (mng_handle hHandle,
2045 mng_uint16 iDestid,
2046 mng_uint8 iTargettype,
2047 mng_int32 iTargetx,
2048 mng_int32 iTargety,
2049 mng_uint32 iCount);
2050
2051MNG_EXT mng_retcode MNG_DECL mng_putchunk_past_src (mng_handle hHandle,
2052 mng_uint32 iEntry,
2053 mng_uint16 iSourceid,
2054 mng_uint8 iComposition,
2055 mng_uint8 iOrientation,
2056 mng_uint8 iOffsettype,
2057 mng_int32 iOffsetx,
2058 mng_int32 iOffsety,
2059 mng_uint8 iBoundarytype,
2060 mng_int32 iBoundaryl,
2061 mng_int32 iBoundaryr,
2062 mng_int32 iBoundaryt,
2063 mng_int32 iBoundaryb);
2064#endif
2065
2066MNG_EXT mng_retcode MNG_DECL mng_putchunk_disc (mng_handle hHandle,
2067 mng_uint32 iCount,
2068 mng_uint16p pObjectids);
2069
2070MNG_EXT mng_retcode MNG_DECL mng_putchunk_back (mng_handle hHandle,
2071 mng_uint16 iRed,
2072 mng_uint16 iGreen,
2073 mng_uint16 iBlue,
2074 mng_uint8 iMandatory,
2075 mng_uint16 iImageid,
2076 mng_uint8 iTile);
2077
2078MNG_EXT mng_retcode MNG_DECL mng_putchunk_fram (mng_handle hHandle,
2079 mng_bool bEmpty,
2080 mng_uint8 iMode,
2081 mng_uint32 iNamesize,
2082 mng_pchar zName,
2083 mng_uint8 iChangedelay,
2084 mng_uint8 iChangetimeout,
2085 mng_uint8 iChangeclipping,
2086 mng_uint8 iChangesyncid,
2087 mng_uint32 iDelay,
2088 mng_uint32 iTimeout,
2089 mng_uint8 iBoundarytype,
2090 mng_int32 iBoundaryl,
2091 mng_int32 iBoundaryr,
2092 mng_int32 iBoundaryt,
2093 mng_int32 iBoundaryb,
2094 mng_uint32 iCount,
2095 mng_uint32p pSyncids);
2096
2097MNG_EXT mng_retcode MNG_DECL mng_putchunk_move (mng_handle hHandle,
2098 mng_uint16 iFirstid,
2099 mng_uint16 iLastid,
2100 mng_uint8 iMovetype,
2101 mng_int32 iMovex,
2102 mng_int32 iMovey);
2103
2104MNG_EXT mng_retcode MNG_DECL mng_putchunk_clip (mng_handle hHandle,
2105 mng_uint16 iFirstid,
2106 mng_uint16 iLastid,
2107 mng_uint8 iCliptype,
2108 mng_int32 iClipl,
2109 mng_int32 iClipr,
2110 mng_int32 iClipt,
2111 mng_int32 iClipb);
2112
2113MNG_EXT mng_retcode MNG_DECL mng_putchunk_show (mng_handle hHandle,
2114 mng_bool bEmpty,
2115 mng_uint16 iFirstid,
2116 mng_uint16 iLastid,
2117 mng_uint8 iMode);
2118
2119MNG_EXT mng_retcode MNG_DECL mng_putchunk_term (mng_handle hHandle,
2120 mng_uint8 iTermaction,
2121 mng_uint8 iIteraction,
2122 mng_uint32 iDelay,
2123 mng_uint32 iItermax);
2124
2125MNG_EXT mng_retcode MNG_DECL mng_putchunk_save (mng_handle hHandle,
2126 mng_bool bEmpty,
2127 mng_uint8 iOffsettype,
2128 mng_uint32 iCount);
2129
2130MNG_EXT mng_retcode MNG_DECL mng_putchunk_save_entry (mng_handle hHandle,
2131 mng_uint32 iEntry,
2132 mng_uint8 iEntrytype,
2133 mng_uint32arr2 iOffset,
2134 mng_uint32arr2 iStarttime,
2135 mng_uint32 iLayernr,
2136 mng_uint32 iFramenr,
2137 mng_uint32 iNamesize,
2138 mng_pchar zName);
2139
2140MNG_EXT mng_retcode MNG_DECL mng_putchunk_seek (mng_handle hHandle,
2141 mng_uint32 iNamesize,
2142 mng_pchar zName);
2143
2144MNG_EXT mng_retcode MNG_DECL mng_putchunk_expi (mng_handle hHandle,
2145 mng_uint16 iSnapshotid,
2146 mng_uint32 iNamesize,
2147 mng_pchar zName);
2148
2149MNG_EXT mng_retcode MNG_DECL mng_putchunk_fpri (mng_handle hHandle,
2150 mng_uint8 iDeltatype,
2151 mng_uint8 iPriority);
2152
2153MNG_EXT mng_retcode MNG_DECL mng_putchunk_need (mng_handle hHandle,
2154 mng_uint32 iKeywordssize,
2155 mng_pchar zKeywords);
2156
2157MNG_EXT mng_retcode MNG_DECL mng_putchunk_phyg (mng_handle hHandle,
2158 mng_bool bEmpty,
2159 mng_uint32 iSizex,
2160 mng_uint32 iSizey,
2161 mng_uint8 iUnit);
2162
2163MNG_EXT mng_retcode MNG_DECL mng_putchunk_jhdr (mng_handle hHandle,
2164 mng_uint32 iWidth,
2165 mng_uint32 iHeight,
2166 mng_uint8 iColortype,
2167 mng_uint8 iImagesampledepth,
2168 mng_uint8 iImagecompression,
2169 mng_uint8 iImageinterlace,
2170 mng_uint8 iAlphasampledepth,
2171 mng_uint8 iAlphacompression,
2172 mng_uint8 iAlphafilter,
2173 mng_uint8 iAlphainterlace);
2174
2175MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdat (mng_handle hHandle,
2176 mng_uint32 iRawlen,
2177 mng_ptr pRawdata);
2178
2179MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdaa (mng_handle hHandle,
2180 mng_uint32 iRawlen,
2181 mng_ptr pRawdata);
2182
2183MNG_EXT mng_retcode MNG_DECL mng_putchunk_jsep (mng_handle hHandle);
2184
2185MNG_EXT mng_retcode MNG_DECL mng_putchunk_dhdr (mng_handle hHandle,
2186 mng_uint16 iObjectid,
2187 mng_uint8 iImagetype,
2188 mng_uint8 iDeltatype,
2189 mng_uint32 iBlockwidth,
2190 mng_uint32 iBlockheight,
2191 mng_uint32 iBlockx,
2192 mng_uint32 iBlocky);
2193
2194MNG_EXT mng_retcode MNG_DECL mng_putchunk_prom (mng_handle hHandle,
2195 mng_uint8 iColortype,
2196 mng_uint8 iSampledepth,
2197 mng_uint8 iFilltype);
2198
2199MNG_EXT mng_retcode MNG_DECL mng_putchunk_ipng (mng_handle hHandle);
2200
2201MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt (mng_handle hHandle,
2202 mng_uint8 iDeltatype,
2203 mng_uint32 iCount);
2204
2205MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt_entry (mng_handle hHandle,
2206 mng_uint32 iEntry,
2207 mng_uint16 iRed,
2208 mng_uint16 iGreen,
2209 mng_uint16 iBlue,
2210 mng_uint16 iAlpha);
2211
2212MNG_EXT mng_retcode MNG_DECL mng_putchunk_jpng (mng_handle hHandle);
2213
2214MNG_EXT mng_retcode MNG_DECL mng_putchunk_drop (mng_handle hHandle,
2215 mng_uint32 iCount,
2216 mng_chunkidp pChunknames);
2217
2218MNG_EXT mng_retcode MNG_DECL mng_putchunk_dbyk (mng_handle hHandle,
2219 mng_chunkid iChunkname,
2220 mng_uint8 iPolarity,
2221 mng_uint32 iKeywordssize,
2222 mng_pchar zKeywords);
2223
2224MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr (mng_handle hHandle,
2225 mng_uint32 iCount);
2226
2227MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr_entry (mng_handle hHandle,
2228 mng_uint32 iEntry,
2229 mng_chunkid iChunkname,
2230 mng_uint8 iOrdertype);
2231
2232MNG_EXT mng_retcode MNG_DECL mng_putchunk_magn (mng_handle hHandle,
2233 mng_uint16 iFirstid,
2234 mng_uint16 iLastid,
2235 mng_uint16 iMethodX,
2236 mng_uint16 iMX,
2237 mng_uint16 iMY,
2238 mng_uint16 iML,
2239 mng_uint16 iMR,
2240 mng_uint16 iMT,
2241 mng_uint16 iMB,
2242 mng_uint16 iMethodY);
2243
2244#ifdef MNG_INCLUDE_MPNG_PROPOSAL
2245MNG_EXT mng_retcode MNG_DECL mng_putchunk_mpng (mng_handle hHandle,
2246 mng_uint32 iFramewidth,
2247 mng_uint32 iFrameheight,
2248 mng_uint16 iNumplays,
2249 mng_uint16 iTickspersec,
2250 mng_uint8 iCompressionmethod,
2251 mng_uint32 iCount);
2252MNG_EXT mng_retcode MNG_DECL mng_putchunk_mpng_frame (mng_handle hHandle,
2253 mng_uint32 iEntry,
2254 mng_uint32 iX,
2255 mng_uint32 iY,
2256 mng_uint32 iWidth,
2257 mng_uint32 iHeight,
2258 mng_int32 iXoffset,
2259 mng_int32 iYoffset,
2260 mng_uint16 iTicks);
2261#endif
2262
2263MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt (mng_handle hHandle,
2264 mng_uint32 iCount);
2265
2266MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt_entry (mng_handle hHandle,
2267 mng_uint32 iEntry,
2268 mng_uint8 iEventtype,
2269 mng_uint8 iMasktype,
2270 mng_int32 iLeft,
2271 mng_int32 iRight,
2272 mng_int32 iTop,
2273 mng_int32 iBottom,
2274 mng_uint16 iObjectid,
2275 mng_uint8 iIndex,
2276 mng_uint32 iSegmentnamesize,
2277 mng_pchar zSegmentname);
2278
2279MNG_EXT mng_retcode MNG_DECL mng_putchunk_unknown (mng_handle hHandle,
2280 mng_chunkid iChunkname,
2281 mng_uint32 iRawlen,
2282 mng_ptr pRawdata);
2283
2284#endif /* MNG_INCLUDE_WRITE_PROCS */
2285
2286/* ************************************************************************** */
2287
2288/* use these functions to access the actual image-data in stored chunks,
2289 as opposed to the IDAT/JDAT data */
2290/* to get accurate pixel-data the canvasstyle should seriously reflect the
2291 bitdepth/colortype combination of the preceding IHDR/JHDR/BASI/DHDR;
2292 all input can be converted to rgb(a)8 (rgb(a)16 for 16-bit images), but
2293 there are only limited conversions back (see below for putimgdata) */
2294
2295/* call this function if you want to extract the nth image from the list;
2296 the first image is designated seqnr 0! */
2297/* this function finds the IHDR/JHDR/BASI/DHDR with the appropriate seqnr,
2298 starting from the beginning of the chunk-list; this may tend to get a little
2299 slow for animations with a large number of chunks for images near the end */
2300/* supplying a seqnr past the last image in the animation will return with
2301 an errorcode */
2302MNG_EXT mng_retcode MNG_DECL mng_getimgdata_seq (mng_handle hHandle,
2303 mng_uint32 iSeqnr,
2304 mng_uint32 iCanvasstyle,
2305 mng_getcanvasline fGetcanvasline);
2306
2307/* both the following functions will search forward to find the first IDAT/JDAT,
2308 and then traverse back to find the start of the image (IHDR,JHDR,DHDR,BASI);
2309 note that this is very fast compared to decoding the IDAT/JDAT, so there's
2310 not really a need for optimization; either can be called from the
2311 iterate_chunks callback when a IHDR/JHDR is encountered; for BASI/DHDR there
2312 may not be real image-data so it's wisest to keep iterating till the IEND,
2313 and then call either of these functions if necessary (remember the correct seqnr!) */
2314
2315/* call this function if you want to extract the image starting at or after the nth
2316 position in the chunk-list; this number is returned in the iterate_chunks callback */
2317MNG_EXT mng_retcode MNG_DECL mng_getimgdata_chunkseq (mng_handle hHandle,
2318 mng_uint32 iSeqnr,
2319 mng_uint32 iCanvasstyle,
2320 mng_getcanvasline fGetcanvasline);
2321
2322/* call this function if you want to extract the image starting at or after the
2323 indicated chunk; the handle of a chunk is returned in the iterate_chunks callback */
2324MNG_EXT mng_retcode MNG_DECL mng_getimgdata_chunk (mng_handle hHandle,
2325 mng_handle hChunk,
2326 mng_uint32 iCanvasstyle,
2327 mng_getcanvasline fGetcanvasline);
2328
2329/* ************************************************************************** */
2330
2331#ifdef MNG_INCLUDE_WRITE_PROCS
2332
2333/* use the following functions to add image-data to the list of stored chunks */
2334/* note that this only adds the IDAT or JDAT chunks and no others; you must call
2335 one of these functions after you 'put' the initial chunks of the image and
2336 before you 'put' the closing chunks */
2337/* the canvasstyle should seriously reflect the bitdepth/colortype combination;
2338 eg. bitdepth=16 would expect a 16-bit canvasstyle,
2339 colortype=g or ga would expect a gray or gray+alpha style respectively
2340 and so on, and so forth ...
2341 (nb. the number of conversions will be extremely limited for the moment!) */
2342
2343MNG_EXT mng_retcode MNG_DECL mng_putimgdata_ihdr (mng_handle hHandle,
2344 mng_uint32 iWidth,
2345 mng_uint32 iHeight,
2346 mng_uint8 iColortype,
2347 mng_uint8 iBitdepth,
2348 mng_uint8 iCompression,
2349 mng_uint8 iFilter,
2350 mng_uint8 iInterlace,
2351 mng_uint32 iCanvasstyle,
2352 mng_getcanvasline fGetcanvasline);
2353
2354MNG_EXT mng_retcode MNG_DECL mng_putimgdata_jhdr (mng_handle hHandle,
2355 mng_uint32 iWidth,
2356 mng_uint32 iHeight,
2357 mng_uint8 iColortype,
2358 mng_uint8 iBitdepth,
2359 mng_uint8 iCompression,
2360 mng_uint8 iInterlace,
2361 mng_uint8 iAlphaBitdepth,
2362 mng_uint8 iAlphaCompression,
2363 mng_uint8 iAlphaFilter,
2364 mng_uint8 iAlphaInterlace,
2365 mng_uint32 iCanvasstyle,
2366 mng_getcanvasline fGetcanvasline);
2367
2368/* ************************************************************************** */
2369
2370/* use the following functions to set the framecount/layercount/playtime or
2371 simplicity of an animation you are creating; this may be useful if these
2372 variables are calculated during the creation-process */
2373
2374MNG_EXT mng_retcode MNG_DECL mng_updatemngheader (mng_handle hHandle,
2375 mng_uint32 iFramecount,
2376 mng_uint32 iLayercount,
2377 mng_uint32 iPlaytime);
2378
2379MNG_EXT mng_retcode MNG_DECL mng_updatemngsimplicity (mng_handle hHandle,
2380 mng_uint32 iSimplicity);
2381
2382/* ************************************************************************** */
2383
2384#endif /* MNG_INCLUDE_WRITE_PROCS */
2385
2386#endif /* MNG_ACCESS_CHUNKS */
2387
2388/* ************************************************************************** */
2389/* * * */
2390/* * Error-code structure * */
2391/* * * */
2392/* * 0b0000 00xx xxxx xxxx - basic errors; severity 9 (environment) * */
2393/* * 0b0000 01xx xxxx xxxx - chunk errors; severity 9 (image induced) * */
2394/* * 0b0000 10xx xxxx xxxx - severity 5 errors (application induced) * */
2395/* * 0b0001 00xx xxxx xxxx - severity 2 warnings (recoverable) * */
2396/* * 0b0010 00xx xxxx xxxx - severity 1 warnings (recoverable) * */
2397/* * * */
2398/* ************************************************************************** */
2399
2400#define MNG_NOERROR (mng_retcode)0 /* er.. indicates all's well */
2401
2402#define MNG_OUTOFMEMORY (mng_retcode)1 /* oops, buy some megabytes! */
2403#define MNG_INVALIDHANDLE (mng_retcode)2 /* call mng_initialize first */
2404#define MNG_NOCALLBACK (mng_retcode)3 /* set the callbacks please */
2405#define MNG_UNEXPECTEDEOF (mng_retcode)4 /* what'd ya do with the data? */
2406#define MNG_ZLIBERROR (mng_retcode)5 /* zlib burped */
2407#define MNG_JPEGERROR (mng_retcode)6 /* jpglib complained */
2408#define MNG_LCMSERROR (mng_retcode)7 /* little cms stressed out */
2409#define MNG_NOOUTPUTPROFILE (mng_retcode)8 /* no output-profile defined */
2410#define MNG_NOSRGBPROFILE (mng_retcode)9 /* no sRGB-profile defined */
2411#define MNG_BUFOVERFLOW (mng_retcode)10 /* zlib output-buffer overflow */
2412#define MNG_FUNCTIONINVALID (mng_retcode)11 /* ay, totally inappropriate */
2413#define MNG_OUTPUTERROR (mng_retcode)12 /* disk full ? */
2414#define MNG_JPEGBUFTOOSMALL (mng_retcode)13 /* can't handle buffer overflow*/
2415#define MNG_NEEDMOREDATA (mng_retcode)14 /* I'm hungry, give me more */
2416#define MNG_NEEDTIMERWAIT (mng_retcode)15 /* Sleep a while then wake me */
2417#define MNG_NEEDSECTIONWAIT (mng_retcode)16 /* just processed a SEEK */
2418#define MNG_LOOPWITHCACHEOFF (mng_retcode)17 /* LOOP when playback info off */
2419
2420#define MNG_DLLNOTLOADED (mng_retcode)99 /* late binding failed */
2421
2422#define MNG_APPIOERROR (mng_retcode)901 /* application I/O error */
2423#define MNG_APPTIMERERROR (mng_retcode)902 /* application timing error */
2424#define MNG_APPCMSERROR (mng_retcode)903 /* application CMS error */
2425#define MNG_APPMISCERROR (mng_retcode)904 /* application other error */
2426#define MNG_APPTRACEABORT (mng_retcode)905 /* application aborts on trace */
2427
2428#define MNG_INTERNALERROR (mng_retcode)999 /* internal inconsistancy */
2429
2430#define MNG_INVALIDSIG (mng_retcode)1025 /* invalid graphics file */
2431#define MNG_INVALIDCRC (mng_retcode)1027 /* crc check failed */
2432#define MNG_INVALIDLENGTH (mng_retcode)1028 /* chunklength mystifies me */
2433#define MNG_SEQUENCEERROR (mng_retcode)1029 /* invalid chunk sequence */
2434#define MNG_CHUNKNOTALLOWED (mng_retcode)1030 /* completely out-of-place */
2435#define MNG_MULTIPLEERROR (mng_retcode)1031 /* only one occurence allowed */
2436#define MNG_PLTEMISSING (mng_retcode)1032 /* indexed-color requires PLTE */
2437#define MNG_IDATMISSING (mng_retcode)1033 /* IHDR-block requires IDAT */
2438#define MNG_CANNOTBEEMPTY (mng_retcode)1034 /* must contain some data */
2439#define MNG_GLOBALLENGTHERR (mng_retcode)1035 /* global data incorrect */
2440#define MNG_INVALIDBITDEPTH (mng_retcode)1036 /* bitdepth out-of-range */
2441#define MNG_INVALIDCOLORTYPE (mng_retcode)1037 /* colortype out-of-range */
2442#define MNG_INVALIDCOMPRESS (mng_retcode)1038 /* compression method invalid */
2443#define MNG_INVALIDFILTER (mng_retcode)1039 /* filter method invalid */
2444#define MNG_INVALIDINTERLACE (mng_retcode)1040 /* interlace method invalid */
2445#define MNG_NOTENOUGHIDAT (mng_retcode)1041 /* ran out of compressed data */
2446#define MNG_PLTEINDEXERROR (mng_retcode)1042 /* palette-index out-of-range */
2447#define MNG_NULLNOTFOUND (mng_retcode)1043 /* couldn't find null-separator*/
2448#define MNG_KEYWORDNULL (mng_retcode)1044 /* keyword cannot be empty */
2449#define MNG_OBJECTUNKNOWN (mng_retcode)1045 /* the object can't be found */
2450#define MNG_OBJECTEXISTS (mng_retcode)1046 /* the object already exists */
2451#define MNG_TOOMUCHIDAT (mng_retcode)1047 /* got too much compressed data*/
2452#define MNG_INVSAMPLEDEPTH (mng_retcode)1048 /* sampledepth out-of-range */
2453#define MNG_INVOFFSETSIZE (mng_retcode)1049 /* invalid offset-size */
2454#define MNG_INVENTRYTYPE (mng_retcode)1050 /* invalid entry-type */
2455#define MNG_ENDWITHNULL (mng_retcode)1051 /* may not end with NULL */
2456#define MNG_INVIMAGETYPE (mng_retcode)1052 /* invalid image_type */
2457#define MNG_INVDELTATYPE (mng_retcode)1053 /* invalid delta_type */
2458#define MNG_INVALIDINDEX (mng_retcode)1054 /* index-value invalid */
2459#define MNG_TOOMUCHJDAT (mng_retcode)1055 /* got too much compressed data*/
2460#define MNG_JPEGPARMSERR (mng_retcode)1056 /* JHDR/JPEG parms do not match*/
2461#define MNG_INVFILLMETHOD (mng_retcode)1057 /* invalid fill_method */
2462#define MNG_OBJNOTCONCRETE (mng_retcode)1058 /* object must be concrete */
2463#define MNG_TARGETNOALPHA (mng_retcode)1059 /* object has no alpha-channel */
2464#define MNG_MNGTOOCOMPLEX (mng_retcode)1060 /* can't handle complexity */
2465#define MNG_UNKNOWNCRITICAL (mng_retcode)1061 /* unknown critical chunk found*/
2466#define MNG_UNSUPPORTEDNEED (mng_retcode)1062 /* nEED requirement unsupported*/
2467#define MNG_INVALIDDELTA (mng_retcode)1063 /* Delta operation illegal */
2468#define MNG_INVALIDMETHOD (mng_retcode)1064 /* invalid MAGN method */
2469#define MNG_IMPROBABLELENGTH (mng_retcode)1065 /* impropable chunk length */
2470#define MNG_INVALIDBLOCK (mng_retcode)1066 /* invalid delta block */
2471#define MNG_INVALIDEVENT (mng_retcode)1067 /* invalid event_type */
2472#define MNG_INVALIDMASK (mng_retcode)1068 /* invalid mask_type */
2473#define MNG_NOMATCHINGLOOP (mng_retcode)1069 /* ENDL without matching LOOP */
2474#define MNG_SEEKNOTFOUND (mng_retcode)1070 /* EvNT points to unknown SEEK */
2475#define MNG_OBJNOTABSTRACT (mng_retcode)1071 /* object must be abstract */
2476#define MNG_TERMSEQERROR (mng_retcode)1072 /* TERM in wrong place */
2477#define MNG_INVALIDFIELDVAL (mng_retcode)1073 /* invalid fieldvalue (generic)*/
2478#define MNG_INVALIDWIDTH (mng_retcode)1074 /* invalid frame/image width */
2479#define MNG_INVALIDHEIGHT (mng_retcode)1075 /* invalid frame/image height */
2480
2481#define MNG_INVALIDCNVSTYLE (mng_retcode)2049 /* can't make anything of this */
2482#define MNG_WRONGCHUNK (mng_retcode)2050 /* accessing the wrong chunk */
2483#define MNG_INVALIDENTRYIX (mng_retcode)2051 /* accessing the wrong entry */
2484#define MNG_NOHEADER (mng_retcode)2052 /* must have had header first */
2485#define MNG_NOCORRCHUNK (mng_retcode)2053 /* can't find parent chunk */
2486#define MNG_NOMHDR (mng_retcode)2054 /* no MNG header available */
2487
2488#define MNG_IMAGETOOLARGE (mng_retcode)4097 /* input-image way too big */
2489#define MNG_NOTANANIMATION (mng_retcode)4098 /* file not a MNG */
2490#define MNG_FRAMENRTOOHIGH (mng_retcode)4099 /* frame-nr out-of-range */
2491#define MNG_LAYERNRTOOHIGH (mng_retcode)4100 /* layer-nr out-of-range */
2492#define MNG_PLAYTIMETOOHIGH (mng_retcode)4101 /* playtime out-of-range */
2493#define MNG_FNNOTIMPLEMENTED (mng_retcode)4102 /* function not yet available */
2494
2495#define MNG_IMAGEFROZEN (mng_retcode)8193 /* stopped displaying */
2496
2497#define MNG_LCMS_NOHANDLE 1 /* LCMS returned NULL handle */
2498#define MNG_LCMS_NOMEM 2 /* LCMS returned NULL gammatab */
2499#define MNG_LCMS_NOTRANS 3 /* LCMS returned NULL transform*/
2500
2501/* ************************************************************************** */
2502/* * * */
2503/* * Canvas styles * */
2504/* * * */
2505/* * Note that the intentions are pretty darn good, but that the focus * */
2506/* * is currently on 8-bit color support * */
2507/* * * */
2508/* * The RGB8_A8 style is defined for apps that require a separate * */
2509/* * canvas for the color-planes and the alpha-plane (eg. mozilla) * */
2510/* * This requires for the app to supply the "getalphaline" callback!!! * */
2511/* * * */
2512/* ************************************************************************** */
2513
2514#define MNG_CANVAS_RGB8 0x00000000L
2515#define MNG_CANVAS_RGBA8 0x00001000L
2516#define MNG_CANVAS_RGBA8_PM 0x00009000L
2517#define MNG_CANVAS_ARGB8 0x00003000L
2518#define MNG_CANVAS_ARGB8_PM 0x0000B000L
2519#define MNG_CANVAS_RGB8_A8 0x00005000L
2520#define MNG_CANVAS_BGR8 0x00000001L
2521#define MNG_CANVAS_BGRX8 0x00010001L
2522#define MNG_CANVAS_BGRA8 0x00001001L
2523#define MNG_CANVAS_BGRA8PM 0x00009001L /* backward compatibility */
2524#define MNG_CANVAS_BGRA8_PM 0x00009001L
2525#define MNG_CANVAS_ABGR8 0x00003001L
2526#define MNG_CANVAS_ABGR8_PM 0x0000B001L
2527#define MNG_CANVAS_RGB16 0x00000100L /* not supported yet */
2528#define MNG_CANVAS_RGBA16 0x00001100L /* not supported yet */
2529#define MNG_CANVAS_ARGB16 0x00003100L /* not supported yet */
2530#define MNG_CANVAS_BGR16 0x00000101L /* not supported yet */
2531#define MNG_CANVAS_BGRA16 0x00001101L /* not supported yet */
2532#define MNG_CANVAS_ABGR16 0x00003101L /* not supported yet */
2533#define MNG_CANVAS_GRAY8 0x00000002L /* not supported yet */
2534#define MNG_CANVAS_GRAY16 0x00000102L /* not supported yet */
2535#define MNG_CANVAS_GRAYA8 0x00001002L /* not supported yet */
2536#define MNG_CANVAS_GRAYA16 0x00001102L /* not supported yet */
2537#define MNG_CANVAS_AGRAY8 0x00003002L /* not supported yet */
2538#define MNG_CANVAS_AGRAY16 0x00003102L /* not supported yet */
2539#define MNG_CANVAS_DX15 0x00000003L /* not supported yet */
2540#define MNG_CANVAS_DX16 0x00000004L /* not supported yet */
2541
2542#define MNG_CANVAS_RGB565 0x00000005L
2543#define MNG_CANVAS_RGBA565 0x00001005L
2544#define MNG_CANVAS_BGR565 0x00000006L
2545#define MNG_CANVAS_BGRA565 0x00001006L
2546#define MNG_CANVAS_BGR565_A8 0x00004006L
2547
2548#define MNG_CANVAS_RGB555 0x00000007L
2549#define MNG_CANVAS_BGR555 0x00000008L
2550
2551#define MNG_CANVAS_PIXELTYPE(C) (C & 0x000000FFL)
2552#define MNG_CANVAS_BITDEPTH(C) (C & 0x00000100L)
2553#define MNG_CANVAS_HASALPHA(C) (C & 0x00001000L)
2554#define MNG_CANVAS_ALPHAFIRST(C) (C & 0x00002000L)
2555#define MNG_CANVAS_ALPHASEPD(C) (C & 0x00004000L)
2556#define MNG_CANVAS_ALPHAPM(C) (C & 0x00008000L)
2557#define MNG_CANVAS_HASFILLER(C) (C & 0x00010000L)
2558
2559#define MNG_CANVAS_RGB(C) (MNG_CANVAS_PIXELTYPE (C) == 0)
2560#define MNG_CANVAS_BGR(C) (MNG_CANVAS_PIXELTYPE (C) == 1)
2561#define MNG_CANVAS_GRAY(C) (MNG_CANVAS_PIXELTYPE (C) == 2)
2562#define MNG_CANVAS_DIRECTX15(C) (MNG_CANVAS_PIXELTYPE (C) == 3)
2563#define MNG_CANVAS_DIRECTX16(C) (MNG_CANVAS_PIXELTYPE (C) == 4)
2564#define MNG_CANVAS_RGB_565(C) (MNG_CANVAS_PIXELTYPE (C) == 5)
2565#define MNG_CANVAS_BGR_565(C) (MNG_CANVAS_PIXELTYPE (C) == 6)
2566#define MNG_CANVAS_8BIT(C) (!MNG_CANVAS_BITDEPTH (C))
2567#define MNG_CANVAS_16BIT(C) (MNG_CANVAS_BITDEPTH (C))
2568#define MNG_CANVAS_PIXELFIRST(C) (!MNG_CANVAS_ALPHAFIRST (C))
2569
2570/* ************************************************************************** */
2571/* * * */
2572/* * Chunk names (idea adapted from libpng 1.1.0 - png.h) * */
2573/* * * */
2574/* ************************************************************************** */
2575
2576#define MNG_UINT_HUH 0x40404040L
2577
2578#define MNG_UINT_BACK 0x4241434bL
2579#define MNG_UINT_BASI 0x42415349L
2580#define MNG_UINT_CLIP 0x434c4950L
2581#define MNG_UINT_CLON 0x434c4f4eL
2582#define MNG_UINT_DBYK 0x4442594bL
2583#define MNG_UINT_DEFI 0x44454649L
2584#define MNG_UINT_DHDR 0x44484452L
2585#define MNG_UINT_DISC 0x44495343L
2586#define MNG_UINT_DROP 0x44524f50L
2587#define MNG_UINT_ENDL 0x454e444cL
2588#define MNG_UINT_FRAM 0x4652414dL
2589#define MNG_UINT_IDAT 0x49444154L
2590#define MNG_UINT_IEND 0x49454e44L
2591#define MNG_UINT_IHDR 0x49484452L
2592#define MNG_UINT_IJNG 0x494a4e47L
2593#define MNG_UINT_IPNG 0x49504e47L
2594#define MNG_UINT_JDAA 0x4a444141L
2595#define MNG_UINT_JDAT 0x4a444154L
2596#define MNG_UINT_JHDR 0x4a484452L
2597#define MNG_UINT_JSEP 0x4a534550L
2598#define MNG_UINT_JdAA 0x4a644141L
2599#define MNG_UINT_LOOP 0x4c4f4f50L
2600#define MNG_UINT_MAGN 0x4d41474eL
2601#define MNG_UINT_MEND 0x4d454e44L
2602#define MNG_UINT_MHDR 0x4d484452L
2603#define MNG_UINT_MOVE 0x4d4f5645L
2604#define MNG_UINT_ORDR 0x4f524452L
2605#define MNG_UINT_PAST 0x50415354L
2606#define MNG_UINT_PLTE 0x504c5445L
2607#define MNG_UINT_PPLT 0x50504c54L
2608#define MNG_UINT_PROM 0x50524f4dL
2609#define MNG_UINT_SAVE 0x53415645L
2610#define MNG_UINT_SEEK 0x5345454bL
2611#define MNG_UINT_SHOW 0x53484f57L
2612#define MNG_UINT_TERM 0x5445524dL
2613#define MNG_UINT_adAT 0x61644154L
2614#define MNG_UINT_ahDR 0x61684452L
2615#define MNG_UINT_bKGD 0x624b4744L
2616#define MNG_UINT_cHRM 0x6348524dL
2617#define MNG_UINT_eXPI 0x65585049L
2618#define MNG_UINT_evNT 0x65764e54L
2619#define MNG_UINT_fPRI 0x66505249L
2620#define MNG_UINT_gAMA 0x67414d41L
2621#define MNG_UINT_hIST 0x68495354L
2622#define MNG_UINT_iCCP 0x69434350L
2623#define MNG_UINT_iTXt 0x69545874L
2624#define MNG_UINT_mpNG 0x6d704e47L
2625#define MNG_UINT_nEED 0x6e454544L
2626#define MNG_UINT_oFFs 0x6f464673L
2627#define MNG_UINT_pCAL 0x7043414cL
2628#define MNG_UINT_pHYg 0x70444167L
2629#define MNG_UINT_pHYs 0x70485973L
2630#define MNG_UINT_sBIT 0x73424954L
2631#define MNG_UINT_sCAL 0x7343414cL
2632#define MNG_UINT_sPLT 0x73504c54L
2633#define MNG_UINT_sRGB 0x73524742L
2634#define MNG_UINT_tEXt 0x74455874L
2635#define MNG_UINT_tIME 0x74494d45L
2636#define MNG_UINT_tRNS 0x74524e53L
2637#define MNG_UINT_zTXt 0x7a545874L
2638
2639/* ************************************************************************** */
2640/* * * */
2641/* * Chunk property values * */
2642/* * * */
2643/* ************************************************************************** */
2644
2645#define MNG_BITDEPTH_1 1 /* IHDR, BASI, JHDR, PROM */
2646#define MNG_BITDEPTH_2 2
2647#define MNG_BITDEPTH_4 4
2648#define MNG_BITDEPTH_8 8 /* sPLT */
2649#define MNG_BITDEPTH_16 16
2650
2651#define MNG_COLORTYPE_GRAY 0 /* IHDR, BASI, PROM */
2652#define MNG_COLORTYPE_RGB 2
2653#define MNG_COLORTYPE_INDEXED 3
2654#define MNG_COLORTYPE_GRAYA 4
2655#define MNG_COLORTYPE_RGBA 6
2656
2657#define MNG_COMPRESSION_DEFLATE 0 /* IHDR, zTXt, iTXt, iCCP,
2658 BASI, JHDR */
2659
2660#define MNG_FILTER_ADAPTIVE 0 /* IHDR, BASI, JHDR */
2661/* #define MNG_FILTER_NO_ADAPTIVE 1
2662#define MNG_FILTER_NO_DIFFERING 0
2663#define MNG_FILTER_DIFFERING 0x40
2664#define MNG_FILTER_MASK (MNG_FILTER_NO_ADAPTIVE | MNG_FILTER_DIFFERING) */
2665#ifdef FILTER192
2666#define MNG_FILTER_DIFFERING 0xC0
2667#endif
2668#ifdef FILTER193
2669#define MNG_FILTER_NOFILTER 0xC1
2670#endif
2671
2672#define MNG_INTERLACE_NONE 0 /* IHDR, BASI, JHDR */
2673#define MNG_INTERLACE_ADAM7 1
2674
2675#define MNG_FILTER_NONE 0 /* IDAT */
2676#define MNG_FILTER_SUB 1
2677#define MNG_FILTER_UP 2
2678#define MNG_FILTER_AVERAGE 3
2679#define MNG_FILTER_PAETH 4
2680
2681#define MNG_INTENT_PERCEPTUAL 0 /* sRGB */
2682#define MNG_INTENT_RELATIVECOLORIMETRIC 1
2683#define MNG_INTENT_SATURATION 2
2684#define MNG_INTENT_ABSOLUTECOLORIMETRIC 3
2685 /* tEXt, zTXt, iTXt */
2686#define MNG_TEXT_TITLE "Title"
2687#define MNG_TEXT_AUTHOR "Author"
2688#define MNG_TEXT_DESCRIPTION "Description"
2689#define MNG_TEXT_COPYRIGHT "Copyright"
2690#define MNG_TEXT_CREATIONTIME "Creation Time"
2691#define MNG_TEXT_SOFTWARE "Software"
2692#define MNG_TEXT_DISCLAIMER "Disclaimer"
2693#define MNG_TEXT_WARNING "Warning"
2694#define MNG_TEXT_SOURCE "Source"
2695#define MNG_TEXT_COMMENT "Comment"
2696
2697#define MNG_FLAG_UNCOMPRESSED 0 /* iTXt */
2698#define MNG_FLAG_COMPRESSED 1
2699
2700#define MNG_UNIT_UNKNOWN 0 /* pHYs, pHYg */
2701#define MNG_UNIT_METER 1
2702 /* MHDR */
2703#define MNG_SIMPLICITY_VALID 0x00000001
2704#define MNG_SIMPLICITY_SIMPLEFEATURES 0x00000002
2705#define MNG_SIMPLICITY_COMPLEXFEATURES 0x00000004
2706#define MNG_SIMPLICITY_TRANSPARENCY 0x00000008
2707#define MNG_SIMPLICITY_JNG 0x00000010
2708#define MNG_SIMPLICITY_DELTAPNG 0x00000020
2709
2710#define MNG_TERMINATION_DECODER_NC 0 /* LOOP */
2711#define MNG_TERMINATION_USER_NC 1
2712#define MNG_TERMINATION_EXTERNAL_NC 2
2713#define MNG_TERMINATION_DETERMINISTIC_NC 3
2714#define MNG_TERMINATION_DECODER_C 4
2715#define MNG_TERMINATION_USER_C 5
2716#define MNG_TERMINATION_EXTERNAL_C 6
2717#define MNG_TERMINATION_DETERMINISTIC_C 7
2718
2719#define MNG_DONOTSHOW_VISIBLE 0 /* DEFI */
2720#define MNG_DONOTSHOW_NOTVISIBLE 1
2721
2722#define MNG_ABSTRACT 0 /* DEFI */
2723#define MNG_CONCRETE 1
2724
2725#define MNG_NOTVIEWABLE 0 /* BASI */
2726#define MNG_VIEWABLE 1
2727
2728#define MNG_FULL_CLONE 0 /* CLON */
2729#define MNG_PARTIAL_CLONE 1
2730#define MNG_RENUMBER 2
2731
2732#define MNG_CONCRETE_ASPARENT 0 /* CLON */
2733#define MNG_CONCRETE_MAKEABSTRACT 1
2734
2735#define MNG_LOCATION_ABSOLUTE 0 /* CLON, MOVE */
2736#define MNG_LOCATION_RELATIVE 1
2737
2738#ifndef MNG_SKIPCHUNK_PAST
2739#define MNG_TARGET_ABSOLUTE 0 /* PAST */
2740#define MNG_TARGET_RELATIVE_SAMEPAST 1
2741#define MNG_TARGET_RELATIVE_PREVPAST 2
2742
2743#define MNG_COMPOSITE_OVER 0 /* PAST */
2744#define MNG_COMPOSITE_REPLACE 1
2745#define MNG_COMPOSITE_UNDER 2
2746
2747#define MNG_ORIENTATION_SAME 0 /* PAST */
2748#define MNG_ORIENTATION_180DEG 2
2749#define MNG_ORIENTATION_FLIPHORZ 4
2750#define MNG_ORIENTATION_FLIPVERT 6
2751#define MNG_ORIENTATION_TILED 8
2752
2753#define MNG_OFFSET_ABSOLUTE 0 /* PAST */
2754#define MNG_OFFSET_RELATIVE 1
2755#endif
2756
2757#define MNG_BOUNDARY_ABSOLUTE 0 /* PAST, FRAM */
2758#define MNG_BOUNDARY_RELATIVE 1
2759
2760#define MNG_BACKGROUNDCOLOR_MANDATORY 0x01 /* BACK */
2761#define MNG_BACKGROUNDIMAGE_MANDATORY 0x02 /* BACK */
2762
2763#define MNG_BACKGROUNDIMAGE_NOTILE 0 /* BACK */
2764#define MNG_BACKGROUNDIMAGE_TILE 1
2765
2766#define MNG_FRAMINGMODE_NOCHANGE 0 /* FRAM */
2767#define MNG_FRAMINGMODE_1 1
2768#define MNG_FRAMINGMODE_2 2
2769#define MNG_FRAMINGMODE_3 3
2770#define MNG_FRAMINGMODE_4 4
2771
2772#define MNG_CHANGEDELAY_NO 0 /* FRAM */
2773#define MNG_CHANGEDELAY_NEXTSUBFRAME 1
2774#define MNG_CHANGEDELAY_DEFAULT 2
2775
2776#define MNG_CHANGETIMOUT_NO 0 /* FRAM */
2777#define MNG_CHANGETIMOUT_DETERMINISTIC_1 1
2778#define MNG_CHANGETIMOUT_DETERMINISTIC_2 2
2779#define MNG_CHANGETIMOUT_DECODER_1 3
2780#define MNG_CHANGETIMOUT_DECODER_2 4
2781#define MNG_CHANGETIMOUT_USER_1 5
2782#define MNG_CHANGETIMOUT_USER_2 6
2783#define MNG_CHANGETIMOUT_EXTERNAL_1 7
2784#define MNG_CHANGETIMOUT_EXTERNAL_2 8
2785
2786#define MNG_CHANGECLIPPING_NO 0 /* FRAM */
2787#define MNG_CHANGECLIPPING_NEXTSUBFRAME 1
2788#define MNG_CHANGECLIPPING_DEFAULT 2
2789
2790#define MNG_CHANGESYNCID_NO 0 /* FRAM */
2791#define MNG_CHANGESYNCID_NEXTSUBFRAME 1
2792#define MNG_CHANGESYNCID_DEFAULT 2
2793
2794#define MNG_CLIPPING_ABSOLUTE 0 /* CLIP */
2795#define MNG_CLIPPING_RELATIVE 1
2796
2797#define MNG_SHOWMODE_0 0 /* SHOW */
2798#define MNG_SHOWMODE_1 1
2799#define MNG_SHOWMODE_2 2
2800#define MNG_SHOWMODE_3 3
2801#define MNG_SHOWMODE_4 4
2802#define MNG_SHOWMODE_5 5
2803#define MNG_SHOWMODE_6 6
2804#define MNG_SHOWMODE_7 7
2805
2806#define MNG_TERMACTION_LASTFRAME 0 /* TERM */
2807#define MNG_TERMACTION_CLEAR 1
2808#define MNG_TERMACTION_FIRSTFRAME 2
2809#define MNG_TERMACTION_REPEAT 3
2810
2811#define MNG_ITERACTION_LASTFRAME 0 /* TERM */
2812#define MNG_ITERACTION_CLEAR 1
2813#define MNG_ITERACTION_FIRSTFRAME 2
2814
2815#define MNG_SAVEOFFSET_4BYTE 4 /* SAVE */
2816#define MNG_SAVEOFFSET_8BYTE 8
2817
2818#define MNG_SAVEENTRY_SEGMENTFULL 0 /* SAVE */
2819#define MNG_SAVEENTRY_SEGMENT 1
2820#define MNG_SAVEENTRY_SUBFRAME 2
2821#define MNG_SAVEENTRY_EXPORTEDIMAGE 3
2822
2823#define MNG_PRIORITY_ABSOLUTE 0 /* fPRI */
2824#define MNG_PRIORITY_RELATIVE 1
2825
2826#ifdef MNG_INCLUDE_JNG
2827#define MNG_COLORTYPE_JPEGGRAY 8 /* JHDR */
2828#define MNG_COLORTYPE_JPEGCOLOR 10
2829#define MNG_COLORTYPE_JPEGGRAYA 12
2830#define MNG_COLORTYPE_JPEGCOLORA 14
2831
2832#define MNG_BITDEPTH_JPEG8 8 /* JHDR */
2833#define MNG_BITDEPTH_JPEG12 12
2834#define MNG_BITDEPTH_JPEG8AND12 20
2835
2836#define MNG_COMPRESSION_BASELINEJPEG 8 /* JHDR */
2837
2838#define MNG_INTERLACE_SEQUENTIAL 0 /* JHDR */
2839#define MNG_INTERLACE_PROGRESSIVE 8
2840#endif /* MNG_INCLUDE_JNG */
2841
2842#define MNG_IMAGETYPE_UNKNOWN 0 /* DHDR */
2843#define MNG_IMAGETYPE_PNG 1
2844#define MNG_IMAGETYPE_JNG 2
2845
2846#define MNG_DELTATYPE_REPLACE 0 /* DHDR */
2847#define MNG_DELTATYPE_BLOCKPIXELADD 1
2848#define MNG_DELTATYPE_BLOCKALPHAADD 2
2849#define MNG_DELTATYPE_BLOCKCOLORADD 3
2850#define MNG_DELTATYPE_BLOCKPIXELREPLACE 4
2851#define MNG_DELTATYPE_BLOCKALPHAREPLACE 5
2852#define MNG_DELTATYPE_BLOCKCOLORREPLACE 6
2853#define MNG_DELTATYPE_NOCHANGE 7
2854
2855#define MNG_FILLMETHOD_LEFTBITREPLICATE 0 /* PROM */
2856#define MNG_FILLMETHOD_ZEROFILL 1
2857
2858#define MNG_DELTATYPE_REPLACERGB 0 /* PPLT */
2859#define MNG_DELTATYPE_DELTARGB 1
2860#define MNG_DELTATYPE_REPLACEALPHA 2
2861#define MNG_DELTATYPE_DELTAALPHA 3
2862#define MNG_DELTATYPE_REPLACERGBA 4
2863#define MNG_DELTATYPE_DELTARGBA 5
2864
2865#define MNG_POLARITY_ONLY 0 /* DBYK */
2866#define MNG_POLARITY_ALLBUT 1
2867
2868#define MNG_EVENT_NONE 0 /* evNT */
2869#define MNG_EVENT_MOUSEENTER 1
2870#define MNG_EVENT_MOUSEMOVE 2
2871#define MNG_EVENT_MOUSEEXIT 3
2872#define MNG_EVENT_MOUSEDOWN 4
2873#define MNG_EVENT_MOUSEUP 5
2874
2875#define MNG_MASK_NONE 0 /* evNT */
2876#define MNG_MASK_BOX 1
2877#define MNG_MASK_OBJECT 2
2878#define MNG_MASK_OBJECTIX 3
2879#define MNG_MASK_BOXOBJECT 4
2880#define MNG_MASK_BOXOBJECTIX 5
2881
2882/* ************************************************************************** */
2883/* * * */
2884/* * Processtext callback types * */
2885/* * * */
2886/* ************************************************************************** */
2887
2888#define MNG_TYPE_TEXT 0
2889#define MNG_TYPE_ZTXT 1
2890#define MNG_TYPE_ITXT 2
2891
2892/* ************************************************************************** */
2893/* * * */
2894/* * CRC processing masks * */
2895/* * * */
2896/* ************************************************************************** */
2897
2898#define MNG_CRC_INPUT 0x0000000f
2899#define MNG_CRC_INPUT_NONE 0x00000000
2900#define MNG_CRC_INPUT_PRESENT 0x00000001
2901#define MNG_CRC_OUTPUT 0x000000f0
2902#define MNG_CRC_OUTPUT_NONE 0x00000000
2903#define MNG_CRC_OUTPUT_GENERATE 0x00000020
2904#define MNG_CRC_OUTPUT_DUMMY 0x00000040
2905#define MNG_CRC_ANCILLARY 0x00000f00
2906#define MNG_CRC_ANCILLARY_IGNORE 0x00000000
2907#define MNG_CRC_ANCILLARY_DISCARD 0x00000100
2908#define MNG_CRC_ANCILLARY_WARNING 0x00000200
2909#define MNG_CRC_ANCILLARY_ERROR 0x00000300
2910#define MNG_CRC_CRITICAL 0x0000f000
2911#define MNG_CRC_CRITICAL_IGNORE 0x00000000
2912#define MNG_CRC_CRITICAL_WARNING 0x00002000
2913#define MNG_CRC_CRITICAL_ERROR 0x00003000
2914#define MNG_CRC_DEFAULT 0x00002121
2915
2916/* ************************************************************************** */
2917
2918#ifdef __cplusplus
2919}
2920#endif
2921
2922#endif /* _libmng_h_ */
2923
2924/* ************************************************************************** */
2925/* * end of file * */
2926/* ************************************************************************** */
2927
2928

Warning: That file was not part of the compilation database. It may have many parsing errors.