~ubuntu-branches/ubuntu/oneiric/libmng/oneiric

« back to all changes in this revision

Viewing changes to libmng.h

  • Committer: Bazaar Package Importer
  • Author(s): Shiju p. Nair
  • Date: 2006-04-07 09:49:11 UTC
  • mfrom: (0.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060407094911-ay3179o63gvlh4ll
Tags: 1.0.9-1
* New upstream release. (closes: #303968, #271979)
* Patch from Aurelien Jarno <aurel32@debian.org> to support GNU/kFreeBSD.
  Closes: #314696)
* Patch from Christopher Bodenstein <cb@physicman.net> to support
  hurd-i386. (closes: #361103)
* README.Debian provide information on what options are compiled in to
  libmng.(closes: #174523)

Show diffs side-by-side

added added

removed removed

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