1
/* ************************************************************************** */
3
/* * COPYRIGHT NOTICE: * */
5
/* * Copyright (c) 2000-2004 Gerard Juyn * */
6
/* * [You may insert additional notices after this sentence if you modify * */
9
/* * For the purposes of this copyright and license, "Contributing Authors" * */
10
/* * is defined as the following set of individuals: * */
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 - * */
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. * */
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: * */
29
/* * 1. The origin of this source code must not be misrepresented; * */
30
/* * you must not claim that you wrote the original software. * */
32
/* * 2. Altered versions must be plainly marked as such and must not be * */
33
/* * misrepresented as being the original source. * */
35
/* * 3. This Copyright notice may not be removed or altered from any source * */
36
/* * or altered source distribution. * */
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. * */
43
/* ************************************************************************** */
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. * */
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) * */
59
/* ************************************************************************** */
61
/* ************************************************************************** */
63
/* * Version numbering * */
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) * */
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) * */
73
/* * x.1.x = test version * */
74
/* * x.2.x = production version * */
75
/* * x.3.x = test version * */
76
/* * x.4.x = production version * */
79
/* ************************************************************************** */
81
/* * Identifier naming conventions throughout this library * */
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 * */
94
/* * Macros & defines are in all uppercase. * */
95
/* * Functions & typedefs in all lowercase. * */
96
/* * Exported stuff is prefixed with MNG_ or mng_ respectively. * */
98
/* * (I may have missed a couple; don't hesitate to let me know!) * */
100
/* ************************************************************************** */
102
/* ************************************************************************** */
104
/* * project : libmng * */
105
/* * file : libmng.h copyright (c) 2000-2004 G.Juyn * */
106
/* * version : 1.0.8 * */
108
/* * purpose : main application interface * */
110
/* * author : G.Juyn * */
112
/* * comment : The main application interface. An application should not * */
113
/* * need access to any of the other modules! * */
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 * */
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 * */
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 * */
158
/* * 0.9.0 - 06/30/2000 - G.Juyn * */
159
/* * - changed refresh parameters to 'x,y,width,height' * */
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 * */
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 * */
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 * */
209
/* * 0.9.4 - 01/18/2001 - G.Juyn * */
210
/* * - added errorcode for MAGN methods * */
211
/* * - removed test filter-methods 1 & 65 * */
213
/* * 1.0.0 - 02/05/2001 - G.Juyn * */
214
/* * - version numbers (obviously) * */
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!) * */
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 * */
230
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
231
/* * - added get function for last processed BACK chunk * */
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() * */
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 * */
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 * */
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 * */
283
/* ************************************************************************** */
285
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
286
#pragma option -A /* force ANSI-C */
292
/* ************************************************************************** */
294
#include "libmng_conf.h" /* user-specific configuration options */
296
/* ************************************************************************** */
298
#define MNG_CHECK_BAD_ICCP /* let's catch that sucker !!! */
300
#ifdef MNG_SUPPORT_READ /* dependencies based on user-configuration */
301
#define MNG_INCLUDE_READ_PROCS
304
#ifdef MNG_SUPPORT_WRITE
305
#define MNG_INCLUDE_WRITE_PROCS
308
#ifdef MNG_USE_ZLIB_CRC
309
#define MNG_INCLUDE_ZLIB
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
321
#ifdef MNG_STORE_CHUNKS
322
#define MNG_INCLUDE_ZLIB
325
#ifdef MNG_SUPPORT_IJG6B
326
#define MNG_INCLUDE_JNG
327
#define MNG_INCLUDE_IJG6B
328
#define MNG_USE_SETJMP
331
#ifdef MNG_INCLUDE_JNG
332
#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
333
#define MNG_INCLUDE_JNG_READ
335
#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
336
#define MNG_INCLUDE_JNG_WRITE
341
#define MNG_INCLUDE_LCMS
344
#ifdef MNG_AUTO_DITHER
345
#define MNG_INCLUDE_DITHERING
348
#ifdef MNG_SUPPORT_TRACE
349
#define MNG_INCLUDE_TRACE_PROCS
350
#ifdef MNG_TRACE_TELLTALE
351
#define MNG_INCLUDE_TRACE_STRINGS
355
#ifdef MNG_ERROR_TELLTALE
356
#define MNG_INCLUDE_ERROR_STRINGS
359
/* ************************************************************************** */
361
#include "libmng_types.h" /* platform-specific definitions
362
and other assorted stuff */
364
/* ************************************************************************** */
370
/* ************************************************************************** */
372
/* * Versioning control * */
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 !!! * */
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 * */
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 * */
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 * */
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 * */
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 * */
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 * */
423
/* ************************************************************************** */
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
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);
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,
451
mng_uint8* iRelease);
454
/* ************************************************************************** */
456
/* * MNG/PNG specification level conformance * */
458
/* ************************************************************************** */
460
#define MNG_PNG_VERSION "1.2"
461
#define MNG_PNG_VERSION_MAJ 1
462
#define MNG_PNG_VERSION_MIN 2
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" */
470
/* ************************************************************************** */
472
/* * High-level application functions * */
474
/* ************************************************************************** */
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);
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
488
MNG_EXT mng_retcode MNG_DECL mng_reset (mng_handle hHandle);
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);
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);
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
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,
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,
549
mng_bool bTakeownership);
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);
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);
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);
588
#endif /* MNG_SUPPORT_DISPLAY */
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,
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,
606
mng_chunkid* iChunkname,
607
mng_uint32* iChunkseq,
610
mng_pchar* zErrortext);
612
/* ************************************************************************** */
614
/* * Callback set functions * */
616
/* ************************************************************************** */
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,
623
MNG_EXT mng_retcode MNG_DECL mng_setcb_memfree (mng_handle hHandle,
625
#endif /* MNG_INTERNAL_MEMMNGMT */
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);
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,
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);
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);
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);
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:
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);
706
/* callbacks for display processing */
707
/* getcanvasline is called to get an access-pointer to a line on the
709
/* getbkgdline is called to get an access-pointer to a line from the
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:
722
if your implementation requires inclusive points, simply subtract 1 from
723
both the right & bottom values calculated above.
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,
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,
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 */
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 */
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);
771
/* ************************************************************************** */
773
/* * Callback get functions * */
775
/* ************************************************************************** */
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);
784
#ifdef MNG_SUPPORT_READ
785
MNG_EXT mng_releasedata MNG_DECL mng_getcb_releasedata (mng_handle hHandle);
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);
797
#ifdef MNG_SUPPORT_READ
798
MNG_EXT mng_readdata MNG_DECL mng_getcb_readdata (mng_handle hHandle);
802
#ifdef MNG_SUPPORT_WRITE
803
MNG_EXT mng_writedata MNG_DECL mng_getcb_writedata (mng_handle hHandle);
807
MNG_EXT mng_errorproc MNG_DECL mng_getcb_errorproc (mng_handle hHandle);
810
#ifdef MNG_SUPPORT_TRACE
811
MNG_EXT mng_traceproc MNG_DECL mng_getcb_traceproc (mng_handle hHandle);
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);
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);
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);
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 */
846
/* ************************************************************************** */
848
/* * Property set functions * */
850
/* ************************************************************************** */
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,
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,
862
MNG_EXT mng_retcode MNG_DECL mng_set_bkgdstyle (mng_handle hHandle,
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,
873
/* Indicates preferred use of the bKGD chunk for PNG images */
874
MNG_EXT mng_retcode MNG_DECL mng_set_usebkgd (mng_handle hHandle,
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);
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);
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);
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);
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
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
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
935
MNG_EXT mng_retcode MNG_DECL mng_set_crcmode (mng_handle hHandle,
936
mng_uint32 iCrcmode);
938
/* Color-management necessaries */
940
*************************************************************************
941
!!!!!!!! THIS NEXT BIT IS IMPORTANT !!!!!!!!!
942
*************************************************************************
944
If you have defined MNG_FULL_CMS (and are using lcms), you will have to
945
think hard about the following routines.
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)
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)
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.
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.
966
TO RECAP: for sRGB systems (Windows, Linux) no action required!
967
for non-sRGB systems (SGI, Mac, Next) ACTION REQUIRED!
969
Please visit http://www.srgb.com, http://www.color.org and
970
http://www.littlecms.com for more info.
972
*************************************************************************
973
!!!!!!!! THE BIT ABOVE IS IMPORTANT !!!!!!!!!
974
*************************************************************************
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,
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,
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,
1000
MNG_EXT mng_retcode MNG_DECL mng_set_srgbimplicit (mng_handle hHandle);
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,
1008
MNG_EXT mng_retcode MNG_DECL mng_set_displaygamma (mng_handle hHandle,
1010
MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggamma (mng_handle hHandle,
1012
MNG_EXT mng_retcode MNG_DECL mng_set_viewgammaint (mng_handle hHandle,
1014
MNG_EXT mng_retcode MNG_DECL mng_set_displaygammaint (mng_handle hHandle,
1016
MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggammaint (mng_handle hHandle,
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);
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,
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);
1054
MNG_EXT mng_retcode MNG_DECL mng_set_zlib_maxidat (mng_handle hHandle,
1055
mng_uint32 iMaxIDAT);
1056
#endif /* MNG_INCLUDE_ZLIB */
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);
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);
1077
MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_maxjdat (mng_handle hHandle,
1078
mng_uint32 iMaxJDAT);
1079
#endif /* MNG_INCLUDE_JNG */
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);
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);
1097
/* ************************************************************************** */
1099
/* * Property get functions * */
1101
/* ************************************************************************** */
1104
MNG_EXT mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle);
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);
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);
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);
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);
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);
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);
1162
MNG_EXT mng_retcode MNG_DECL mng_get_bgcolor (mng_handle hHandle,
1168
MNG_EXT mng_bool MNG_DECL mng_get_usebkgd (mng_handle hHandle);
1171
MNG_EXT mng_bool MNG_DECL mng_get_storechunks (mng_handle hHandle);
1174
MNG_EXT mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle);
1177
MNG_EXT mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle);
1180
MNG_EXT mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle);
1183
MNG_EXT mng_uint32 MNG_DECL mng_get_crcmode (mng_handle hHandle);
1186
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_FULL_CMS)
1187
MNG_EXT mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle);
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);
1198
#ifndef MNG_SKIP_MAXCANVAS
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);
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);
1212
MNG_EXT mng_uint32 MNG_DECL mng_get_zlib_maxidat (mng_handle hHandle);
1213
#endif /* MNG_INCLUDE_ZLIB */
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);
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);
1226
MNG_EXT mng_uint32 MNG_DECL mng_get_jpeg_maxjdat (mng_handle hHandle);
1227
#endif /* MNG_INCLUDE_JNG */
1230
#if defined(MNG_SUPPORT_READ)
1231
MNG_EXT mng_bool MNG_DECL mng_get_suspensionmode (mng_handle hHandle);
1235
#if defined(MNG_SUPPORT_DISPLAY)
1236
MNG_EXT mng_speedtype
1237
MNG_DECL mng_get_speed (mng_handle hHandle);
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);
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,
1255
mng_uint8* iMandatory);
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);
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);
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);
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);
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);
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);
1323
/* ************************************************************************** */
1325
/* * Chunk access functions * */
1327
/* ************************************************************************** */
1329
#ifdef MNG_ACCESS_CHUNKS
1331
/* ************************************************************************** */
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);
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,
1346
mng_handle hHandleOut);
1349
/* ************************************************************************** */
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,
1355
mng_uint32 *iHeight,
1356
mng_uint8 *iBitdepth,
1357
mng_uint8 *iColortype,
1358
mng_uint8 *iCompression,
1360
mng_uint8 *iInterlace);
1362
MNG_EXT mng_retcode MNG_DECL mng_getchunk_plte (mng_handle hHandle,
1365
mng_palette8 *aPalette);
1367
MNG_EXT mng_retcode MNG_DECL mng_getchunk_idat (mng_handle hHandle,
1369
mng_uint32 *iRawlen,
1372
MNG_EXT mng_retcode MNG_DECL mng_getchunk_trns (mng_handle hHandle,
1378
mng_uint8arr *aAlphas,
1383
mng_uint32 *iRawlen,
1384
mng_uint8arr *aRawdata);
1386
MNG_EXT mng_retcode MNG_DECL mng_getchunk_gama (mng_handle hHandle,
1389
mng_uint32 *iGamma);
1391
MNG_EXT mng_retcode MNG_DECL mng_getchunk_chrm (mng_handle hHandle,
1394
mng_uint32 *iWhitepointx,
1395
mng_uint32 *iWhitepointy,
1398
mng_uint32 *iGreenx,
1399
mng_uint32 *iGreeny,
1401
mng_uint32 *iBluey);
1403
MNG_EXT mng_retcode MNG_DECL mng_getchunk_srgb (mng_handle hHandle,
1406
mng_uint8 *iRenderingintent);
1408
MNG_EXT mng_retcode MNG_DECL mng_getchunk_iccp (mng_handle hHandle,
1411
mng_uint32 *iNamesize,
1413
mng_uint8 *iCompression,
1414
mng_uint32 *iProfilesize,
1417
MNG_EXT mng_retcode MNG_DECL mng_getchunk_text (mng_handle hHandle,
1419
mng_uint32 *iKeywordsize,
1420
mng_pchar *zKeyword,
1421
mng_uint32 *iTextsize,
1424
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ztxt (mng_handle hHandle,
1426
mng_uint32 *iKeywordsize,
1427
mng_pchar *zKeyword,
1428
mng_uint8 *iCompression,
1429
mng_uint32 *iTextsize,
1432
MNG_EXT mng_retcode MNG_DECL mng_getchunk_itxt (mng_handle hHandle,
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,
1445
MNG_EXT mng_retcode MNG_DECL mng_getchunk_bkgd (mng_handle hHandle,
1455
MNG_EXT mng_retcode MNG_DECL mng_getchunk_phys (mng_handle hHandle,
1462
MNG_EXT mng_retcode MNG_DECL mng_getchunk_sbit (mng_handle hHandle,
1466
mng_uint8arr4 *aBits);
1468
MNG_EXT mng_retcode MNG_DECL mng_getchunk_splt (mng_handle hHandle,
1471
mng_uint32 *iNamesize,
1473
mng_uint8 *iSampledepth,
1474
mng_uint32 *iEntrycount,
1477
MNG_EXT mng_retcode MNG_DECL mng_getchunk_hist (mng_handle hHandle,
1479
mng_uint32 *iEntrycount,
1480
mng_uint16arr *aEntries);
1482
MNG_EXT mng_retcode MNG_DECL mng_getchunk_time (mng_handle hHandle,
1489
mng_uint8 *iSecond);
1491
MNG_EXT mng_retcode MNG_DECL mng_getchunk_mhdr (mng_handle hHandle,
1494
mng_uint32 *iHeight,
1496
mng_uint32 *iLayercount,
1497
mng_uint32 *iFramecount,
1498
mng_uint32 *iPlaytime,
1499
mng_uint32 *iSimplicity);
1501
MNG_EXT mng_retcode MNG_DECL mng_getchunk_loop (mng_handle hHandle,
1504
mng_uint32 *iRepeat,
1505
mng_uint8 *iTermination,
1506
mng_uint32 *iItermin,
1507
mng_uint32 *iItermax,
1509
mng_uint32p *pSignals);
1511
MNG_EXT mng_retcode MNG_DECL mng_getchunk_endl (mng_handle hHandle,
1515
MNG_EXT mng_retcode MNG_DECL mng_getchunk_defi (mng_handle hHandle,
1517
mng_uint16 *iObjectid,
1518
mng_uint8 *iDonotshow,
1519
mng_uint8 *iConcrete,
1521
mng_int32 *iXlocation,
1522
mng_int32 *iYlocation,
1525
mng_int32 *iRightcb,
1527
mng_int32 *iBottomcb);
1529
MNG_EXT mng_retcode MNG_DECL mng_getchunk_basi (mng_handle hHandle,
1532
mng_uint32 *iHeight,
1533
mng_uint8 *iBitdepth,
1534
mng_uint8 *iColortype,
1535
mng_uint8 *iCompression,
1537
mng_uint8 *iInterlace,
1542
mng_uint8 *iViewable);
1544
MNG_EXT mng_retcode MNG_DECL mng_getchunk_clon (mng_handle hHandle,
1546
mng_uint16 *iSourceid,
1547
mng_uint16 *iCloneid,
1548
mng_uint8 *iClonetype,
1549
mng_uint8 *iDonotshow,
1550
mng_uint8 *iConcrete,
1552
mng_uint8 *iLocationtype,
1553
mng_int32 *iLocationx,
1554
mng_int32 *iLocationy);
1556
#ifndef MNG_SKIPCHUNK_PAST
1557
MNG_EXT mng_retcode MNG_DECL mng_getchunk_past (mng_handle hHandle,
1559
mng_uint16 *iDestid,
1560
mng_uint8 *iTargettype,
1561
mng_int32 *iTargetx,
1562
mng_int32 *iTargety,
1563
mng_uint32 *iCount);
1565
MNG_EXT mng_retcode MNG_DECL mng_getchunk_past_src (mng_handle hHandle,
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);
1581
MNG_EXT mng_retcode MNG_DECL mng_getchunk_disc (mng_handle hHandle,
1584
mng_uint16p *pObjectids);
1586
MNG_EXT mng_retcode MNG_DECL mng_getchunk_back (mng_handle hHandle,
1591
mng_uint8 *iMandatory,
1592
mng_uint16 *iImageid,
1595
MNG_EXT mng_retcode MNG_DECL mng_getchunk_fram (mng_handle hHandle,
1599
mng_uint32 *iNamesize,
1601
mng_uint8 *iChangedelay,
1602
mng_uint8 *iChangetimeout,
1603
mng_uint8 *iChangeclipping,
1604
mng_uint8 *iChangesyncid,
1606
mng_uint32 *iTimeout,
1607
mng_uint8 *iBoundarytype,
1608
mng_int32 *iBoundaryl,
1609
mng_int32 *iBoundaryr,
1610
mng_int32 *iBoundaryt,
1611
mng_int32 *iBoundaryb,
1613
mng_uint32p *pSyncids);
1615
MNG_EXT mng_retcode MNG_DECL mng_getchunk_move (mng_handle hHandle,
1617
mng_uint16 *iFirstid,
1618
mng_uint16 *iLastid,
1619
mng_uint8 *iMovetype,
1623
MNG_EXT mng_retcode MNG_DECL mng_getchunk_clip (mng_handle hHandle,
1625
mng_uint16 *iFirstid,
1626
mng_uint16 *iLastid,
1627
mng_uint8 *iCliptype,
1633
MNG_EXT mng_retcode MNG_DECL mng_getchunk_show (mng_handle hHandle,
1636
mng_uint16 *iFirstid,
1637
mng_uint16 *iLastid,
1640
MNG_EXT mng_retcode MNG_DECL mng_getchunk_term (mng_handle hHandle,
1642
mng_uint8 *iTermaction,
1643
mng_uint8 *iIteraction,
1645
mng_uint32 *iItermax);
1647
MNG_EXT mng_retcode MNG_DECL mng_getchunk_save (mng_handle hHandle,
1650
mng_uint8 *iOffsettype,
1651
mng_uint32 *iCount);
1653
MNG_EXT mng_retcode MNG_DECL mng_getchunk_save_entry (mng_handle hHandle,
1656
mng_uint8 *iEntrytype,
1657
mng_uint32arr2 *iOffset,
1658
mng_uint32arr2 *iStarttime,
1659
mng_uint32 *iLayernr,
1660
mng_uint32 *iFramenr,
1661
mng_uint32 *iNamesize,
1664
MNG_EXT mng_retcode MNG_DECL mng_getchunk_seek (mng_handle hHandle,
1666
mng_uint32 *iNamesize,
1669
MNG_EXT mng_retcode MNG_DECL mng_getchunk_expi (mng_handle hHandle,
1671
mng_uint16 *iSnapshotid,
1672
mng_uint32 *iNamesize,
1675
MNG_EXT mng_retcode MNG_DECL mng_getchunk_fpri (mng_handle hHandle,
1677
mng_uint8 *iDeltatype,
1678
mng_uint8 *iPriority);
1680
MNG_EXT mng_retcode MNG_DECL mng_getchunk_need (mng_handle hHandle,
1682
mng_uint32 *iKeywordssize,
1683
mng_pchar *zKeywords);
1685
MNG_EXT mng_retcode MNG_DECL mng_getchunk_phyg (mng_handle hHandle,
1692
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jhdr (mng_handle hHandle,
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);
1705
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdat (mng_handle hHandle,
1707
mng_uint32 *iRawlen,
1710
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdaa (mng_handle hHandle,
1712
mng_uint32 *iRawlen,
1715
MNG_EXT mng_retcode MNG_DECL mng_getchunk_dhdr (mng_handle hHandle,
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);
1725
MNG_EXT mng_retcode MNG_DECL mng_getchunk_prom (mng_handle hHandle,
1727
mng_uint8 *iColortype,
1728
mng_uint8 *iSampledepth,
1729
mng_uint8 *iFilltype);
1731
MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt (mng_handle hHandle,
1733
mng_uint32 *iCount);
1735
MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt_entry (mng_handle hHandle,
1744
MNG_EXT mng_retcode MNG_DECL mng_getchunk_drop (mng_handle hHandle,
1747
mng_chunkidp *pChunknames);
1749
MNG_EXT mng_retcode MNG_DECL mng_getchunk_dbyk (mng_handle hHandle,
1751
mng_chunkid *iChunkname,
1752
mng_uint8 *iPolarity,
1753
mng_uint32 *iKeywordssize,
1754
mng_pchar *zKeywords);
1756
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr (mng_handle hHandle,
1758
mng_uint32 *iCount);
1760
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr_entry (mng_handle hHandle,
1763
mng_chunkid *iChunkname,
1764
mng_uint8 *iOrdertype);
1766
MNG_EXT mng_retcode MNG_DECL mng_getchunk_magn (mng_handle hHandle,
1768
mng_uint16 *iFirstid,
1769
mng_uint16 *iLastid,
1770
mng_uint16 *iMethodX,
1777
mng_uint16 *iMethodY);
1779
MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt (mng_handle hHandle,
1781
mng_uint32 *iCount);
1783
MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt_entry (mng_handle hHandle,
1786
mng_uint8 *iEventtype,
1787
mng_uint8 *iMasktype,
1792
mng_uint16 *iObjectid,
1794
mng_uint32 *iSegmentnamesize,
1795
mng_pchar *zSegmentname);
1797
MNG_EXT mng_retcode MNG_DECL mng_getchunk_unknown (mng_handle hHandle,
1799
mng_chunkid *iChunkname,
1800
mng_uint32 *iRawlen,
1803
/* ************************************************************************** */
1805
#ifdef MNG_INCLUDE_WRITE_PROCS
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,
1812
mng_uint8 iBitdepth,
1813
mng_uint8 iColortype,
1814
mng_uint8 iCompression,
1816
mng_uint8 iInterlace);
1818
MNG_EXT mng_retcode MNG_DECL mng_putchunk_plte (mng_handle hHandle,
1820
mng_palette8 aPalette);
1822
MNG_EXT mng_retcode MNG_DECL mng_putchunk_idat (mng_handle hHandle,
1826
MNG_EXT mng_retcode MNG_DECL mng_putchunk_iend (mng_handle hHandle);
1828
MNG_EXT mng_retcode MNG_DECL mng_putchunk_trns (mng_handle hHandle,
1833
mng_uint8arr aAlphas,
1839
mng_uint8arr aRawdata);
1841
MNG_EXT mng_retcode MNG_DECL mng_putchunk_gama (mng_handle hHandle,
1845
MNG_EXT mng_retcode MNG_DECL mng_putchunk_chrm (mng_handle hHandle,
1847
mng_uint32 iWhitepointx,
1848
mng_uint32 iWhitepointy,
1856
MNG_EXT mng_retcode MNG_DECL mng_putchunk_srgb (mng_handle hHandle,
1858
mng_uint8 iRenderingintent);
1860
MNG_EXT mng_retcode MNG_DECL mng_putchunk_iccp (mng_handle hHandle,
1862
mng_uint32 iNamesize,
1864
mng_uint8 iCompression,
1865
mng_uint32 iProfilesize,
1868
MNG_EXT mng_retcode MNG_DECL mng_putchunk_text (mng_handle hHandle,
1869
mng_uint32 iKeywordsize,
1871
mng_uint32 iTextsize,
1874
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ztxt (mng_handle hHandle,
1875
mng_uint32 iKeywordsize,
1877
mng_uint8 iCompression,
1878
mng_uint32 iTextsize,
1881
MNG_EXT mng_retcode MNG_DECL mng_putchunk_itxt (mng_handle hHandle,
1882
mng_uint32 iKeywordsize,
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,
1893
MNG_EXT mng_retcode MNG_DECL mng_putchunk_bkgd (mng_handle hHandle,
1902
MNG_EXT mng_retcode MNG_DECL mng_putchunk_phys (mng_handle hHandle,
1908
MNG_EXT mng_retcode MNG_DECL mng_putchunk_sbit (mng_handle hHandle,
1911
mng_uint8arr4 aBits);
1913
MNG_EXT mng_retcode MNG_DECL mng_putchunk_splt (mng_handle hHandle,
1915
mng_uint32 iNamesize,
1917
mng_uint8 iSampledepth,
1918
mng_uint32 iEntrycount,
1921
MNG_EXT mng_retcode MNG_DECL mng_putchunk_hist (mng_handle hHandle,
1922
mng_uint32 iEntrycount,
1923
mng_uint16arr aEntries);
1925
MNG_EXT mng_retcode MNG_DECL mng_putchunk_time (mng_handle hHandle,
1933
MNG_EXT mng_retcode MNG_DECL mng_putchunk_mhdr (mng_handle hHandle,
1937
mng_uint32 iLayercount,
1938
mng_uint32 iFramecount,
1939
mng_uint32 iPlaytime,
1940
mng_uint32 iSimplicity);
1942
MNG_EXT mng_retcode MNG_DECL mng_putchunk_mend (mng_handle hHandle);
1944
MNG_EXT mng_retcode MNG_DECL mng_putchunk_loop (mng_handle hHandle,
1947
mng_uint8 iTermination,
1948
mng_uint32 iItermin,
1949
mng_uint32 iItermax,
1951
mng_uint32p pSignals);
1953
MNG_EXT mng_retcode MNG_DECL mng_putchunk_endl (mng_handle hHandle,
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,
1961
mng_int32 iXlocation,
1962
mng_int32 iYlocation,
1967
mng_int32 iBottomcb);
1969
MNG_EXT mng_retcode MNG_DECL mng_putchunk_basi (mng_handle hHandle,
1972
mng_uint8 iBitdepth,
1973
mng_uint8 iColortype,
1974
mng_uint8 iCompression,
1976
mng_uint8 iInterlace,
1981
mng_uint8 iViewable);
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,
1990
mng_uint8 iLocationtype,
1991
mng_int32 iLocationx,
1992
mng_int32 iLocationy);
1994
#ifndef MNG_SKIPCHUNK_PAST
1995
MNG_EXT mng_retcode MNG_DECL mng_putchunk_past (mng_handle hHandle,
1997
mng_uint8 iTargettype,
2002
MNG_EXT mng_retcode MNG_DECL mng_putchunk_past_src (mng_handle hHandle,
2004
mng_uint16 iSourceid,
2005
mng_uint8 iComposition,
2006
mng_uint8 iOrientation,
2007
mng_uint8 iOffsettype,
2010
mng_uint8 iBoundarytype,
2011
mng_int32 iBoundaryl,
2012
mng_int32 iBoundaryr,
2013
mng_int32 iBoundaryt,
2014
mng_int32 iBoundaryb);
2017
MNG_EXT mng_retcode MNG_DECL mng_putchunk_disc (mng_handle hHandle,
2019
mng_uint16p pObjectids);
2021
MNG_EXT mng_retcode MNG_DECL mng_putchunk_back (mng_handle hHandle,
2025
mng_uint8 iMandatory,
2026
mng_uint16 iImageid,
2029
MNG_EXT mng_retcode MNG_DECL mng_putchunk_fram (mng_handle hHandle,
2032
mng_uint32 iNamesize,
2034
mng_uint8 iChangedelay,
2035
mng_uint8 iChangetimeout,
2036
mng_uint8 iChangeclipping,
2037
mng_uint8 iChangesyncid,
2039
mng_uint32 iTimeout,
2040
mng_uint8 iBoundarytype,
2041
mng_int32 iBoundaryl,
2042
mng_int32 iBoundaryr,
2043
mng_int32 iBoundaryt,
2044
mng_int32 iBoundaryb,
2046
mng_uint32p pSyncids);
2048
MNG_EXT mng_retcode MNG_DECL mng_putchunk_move (mng_handle hHandle,
2049
mng_uint16 iFirstid,
2051
mng_uint8 iMovetype,
2055
MNG_EXT mng_retcode MNG_DECL mng_putchunk_clip (mng_handle hHandle,
2056
mng_uint16 iFirstid,
2058
mng_uint8 iCliptype,
2064
MNG_EXT mng_retcode MNG_DECL mng_putchunk_show (mng_handle hHandle,
2066
mng_uint16 iFirstid,
2070
MNG_EXT mng_retcode MNG_DECL mng_putchunk_term (mng_handle hHandle,
2071
mng_uint8 iTermaction,
2072
mng_uint8 iIteraction,
2074
mng_uint32 iItermax);
2076
MNG_EXT mng_retcode MNG_DECL mng_putchunk_save (mng_handle hHandle,
2078
mng_uint8 iOffsettype,
2081
MNG_EXT mng_retcode MNG_DECL mng_putchunk_save_entry (mng_handle hHandle,
2083
mng_uint8 iEntrytype,
2084
mng_uint32arr2 iOffset,
2085
mng_uint32arr2 iStarttime,
2086
mng_uint32 iLayernr,
2087
mng_uint32 iFramenr,
2088
mng_uint32 iNamesize,
2091
MNG_EXT mng_retcode MNG_DECL mng_putchunk_seek (mng_handle hHandle,
2092
mng_uint32 iNamesize,
2095
MNG_EXT mng_retcode MNG_DECL mng_putchunk_expi (mng_handle hHandle,
2096
mng_uint16 iSnapshotid,
2097
mng_uint32 iNamesize,
2100
MNG_EXT mng_retcode MNG_DECL mng_putchunk_fpri (mng_handle hHandle,
2101
mng_uint8 iDeltatype,
2102
mng_uint8 iPriority);
2104
MNG_EXT mng_retcode MNG_DECL mng_putchunk_need (mng_handle hHandle,
2105
mng_uint32 iKeywordssize,
2106
mng_pchar zKeywords);
2108
MNG_EXT mng_retcode MNG_DECL mng_putchunk_phyg (mng_handle hHandle,
2114
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jhdr (mng_handle hHandle,
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);
2126
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdat (mng_handle hHandle,
2130
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdaa (mng_handle hHandle,
2134
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jsep (mng_handle hHandle);
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,
2143
mng_uint32 iBlocky);
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);
2150
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ipng (mng_handle hHandle);
2152
MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt (mng_handle hHandle,
2155
MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt_entry (mng_handle hHandle,
2163
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jpng (mng_handle hHandle);
2165
MNG_EXT mng_retcode MNG_DECL mng_putchunk_drop (mng_handle hHandle,
2167
mng_chunkidp pChunknames);
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);
2175
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr (mng_handle hHandle,
2178
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr_entry (mng_handle hHandle,
2180
mng_chunkid iChunkname,
2181
mng_uint8 iOrdertype);
2183
MNG_EXT mng_retcode MNG_DECL mng_putchunk_magn (mng_handle hHandle,
2184
mng_uint16 iFirstid,
2186
mng_uint16 iMethodX,
2193
mng_uint16 iMethodY);
2195
MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt (mng_handle hHandle,
2198
MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt_entry (mng_handle hHandle,
2200
mng_uint8 iEventtype,
2201
mng_uint8 iMasktype,
2206
mng_uint16 iObjectid,
2208
mng_uint32 iSegmentnamesize,
2209
mng_pchar zSegmentname);
2211
MNG_EXT mng_retcode MNG_DECL mng_putchunk_unknown (mng_handle hHandle,
2212
mng_chunkid iChunkname,
2216
#endif /* MNG_INCLUDE_WRITE_PROCS */
2218
/* ************************************************************************** */
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) */
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
2234
MNG_EXT mng_retcode MNG_DECL mng_getimgdata_seq (mng_handle hHandle,
2236
mng_uint32 iCanvasstyle,
2237
mng_getcanvasline fGetcanvasline);
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!) */
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,
2251
mng_uint32 iCanvasstyle,
2252
mng_getcanvasline fGetcanvasline);
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,
2258
mng_uint32 iCanvasstyle,
2259
mng_getcanvasline fGetcanvasline);
2261
/* ************************************************************************** */
2263
#ifdef MNG_INCLUDE_WRITE_PROCS
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!) */
2275
MNG_EXT mng_retcode MNG_DECL mng_putimgdata_ihdr (mng_handle hHandle,
2278
mng_uint8 iColortype,
2279
mng_uint8 iBitdepth,
2280
mng_uint8 iCompression,
2282
mng_uint8 iInterlace,
2283
mng_uint32 iCanvasstyle,
2284
mng_getcanvasline fGetcanvasline);
2286
MNG_EXT mng_retcode MNG_DECL mng_putimgdata_jhdr (mng_handle hHandle,
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);
2300
/* ************************************************************************** */
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 */
2306
MNG_EXT mng_retcode MNG_DECL mng_updatemngheader (mng_handle hHandle,
2307
mng_uint32 iFramecount,
2308
mng_uint32 iLayercount,
2309
mng_uint32 iPlaytime);
2311
MNG_EXT mng_retcode MNG_DECL mng_updatemngsimplicity (mng_handle hHandle,
2312
mng_uint32 iSimplicity);
2314
/* ************************************************************************** */
2316
#endif /* MNG_INCLUDE_WRITE_PROCS */
2318
#endif /* MNG_ACCESS_CHUNKS */
2320
/* ************************************************************************** */
2322
/* * Error-code structure * */
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) * */
2330
/* ************************************************************************** */
2332
#define MNG_NOERROR (mng_retcode)0 /* er.. indicates all's well */
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 */
2352
#define MNG_DLLNOTLOADED (mng_retcode)99 /* late binding failed */
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 */
2360
#define MNG_INTERNALERROR (mng_retcode)999 /* internal inconsistancy */
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 */
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 */
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 */
2424
#define MNG_IMAGEFROZEN (mng_retcode)8193 /* stopped displaying */
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*/
2430
/* ************************************************************************** */
2432
/* * Canvas styles * */
2434
/* * Note that the intentions are pretty darn good, but that the focus * */
2435
/* * is currently on 8-bit color support * */
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!!! * */
2441
/* ************************************************************************** */
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 */
2471
#define MNG_CANVAS_RGB565 0x00000005L
2472
#define MNG_CANVAS_RGBA565 0x00001005L
2473
#define MNG_CANVAS_BGR565 0x00000006L
2474
#define MNG_CANVAS_BGRA565 0x00001006L
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)
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))
2495
/* ************************************************************************** */
2497
/* * Chunk names (idea adapted from libpng 1.1.0 - png.h) * */
2499
/* ************************************************************************** */
2501
#define MNG_UINT_HUH 0x40404040L
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
2560
#define MNG_UINT_evNT 0x65764e54L
2562
/* ************************************************************************** */
2564
/* * Chunk property values * */
2566
/* ************************************************************************** */
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
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
2580
#define MNG_COMPRESSION_DEFLATE 0 /* IHDR, zTXt, iTXt, iCCP,
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) */
2589
#define MNG_FILTER_DIFFERING 0xC0
2592
#define MNG_FILTER_NOFILTER 0xC1
2595
#define MNG_INTERLACE_NONE 0 /* IHDR, BASI, JHDR */
2596
#define MNG_INTERLACE_ADAM7 1
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
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"
2620
#define MNG_FLAG_UNCOMPRESSED 0 /* iTXt */
2621
#define MNG_FLAG_COMPRESSED 1
2623
#define MNG_UNIT_UNKNOWN 0 /* pHYs, pHYg */
2624
#define MNG_UNIT_METER 1
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
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
2642
#define MNG_DONOTSHOW_VISIBLE 0 /* DEFI */
2643
#define MNG_DONOTSHOW_NOTVISIBLE 1
2645
#define MNG_ABSTRACT 0 /* DEFI */
2646
#define MNG_CONCRETE 1
2648
#define MNG_NOTVIEWABLE 0 /* BASI */
2649
#define MNG_VIEWABLE 1
2651
#define MNG_FULL_CLONE 0 /* CLON */
2652
#define MNG_PARTIAL_CLONE 1
2653
#define MNG_RENUMBER 2
2655
#define MNG_CONCRETE_ASPARENT 0 /* CLON */
2656
#define MNG_CONCRETE_MAKEABSTRACT 1
2658
#define MNG_LOCATION_ABSOLUTE 0 /* CLON, MOVE */
2659
#define MNG_LOCATION_RELATIVE 1
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
2666
#define MNG_COMPOSITE_OVER 0 /* PAST */
2667
#define MNG_COMPOSITE_REPLACE 1
2668
#define MNG_COMPOSITE_UNDER 2
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
2676
#define MNG_OFFSET_ABSOLUTE 0 /* PAST */
2677
#define MNG_OFFSET_RELATIVE 1
2680
#define MNG_BOUNDARY_ABSOLUTE 0 /* PAST, FRAM */
2681
#define MNG_BOUNDARY_RELATIVE 1
2683
#define MNG_BACKGROUNDCOLOR_MANDATORY 0x01 /* BACK */
2684
#define MNG_BACKGROUNDIMAGE_MANDATORY 0x02 /* BACK */
2686
#define MNG_BACKGROUNDIMAGE_NOTILE 0 /* BACK */
2687
#define MNG_BACKGROUNDIMAGE_TILE 1
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
2695
#define MNG_CHANGEDELAY_NO 0 /* FRAM */
2696
#define MNG_CHANGEDELAY_NEXTSUBFRAME 1
2697
#define MNG_CHANGEDELAY_DEFAULT 2
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
2709
#define MNG_CHANGECLIPPING_NO 0 /* FRAM */
2710
#define MNG_CHANGECLIPPING_NEXTSUBFRAME 1
2711
#define MNG_CHANGECLIPPING_DEFAULT 2
2713
#define MNG_CHANGESYNCID_NO 0 /* FRAM */
2714
#define MNG_CHANGESYNCID_NEXTSUBFRAME 1
2715
#define MNG_CHANGESYNCID_DEFAULT 2
2717
#define MNG_CLIPPING_ABSOLUTE 0 /* CLIP */
2718
#define MNG_CLIPPING_RELATIVE 1
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
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
2734
#define MNG_ITERACTION_LASTFRAME 0 /* TERM */
2735
#define MNG_ITERACTION_CLEAR 1
2736
#define MNG_ITERACTION_FIRSTFRAME 2
2738
#define MNG_SAVEOFFSET_4BYTE 4 /* SAVE */
2739
#define MNG_SAVEOFFSET_8BYTE 8
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
2746
#define MNG_PRIORITY_ABSOLUTE 0 /* fPRI */
2747
#define MNG_PRIORITY_RELATIVE 1
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
2755
#define MNG_BITDEPTH_JPEG8 8 /* JHDR */
2756
#define MNG_BITDEPTH_JPEG12 12
2757
#define MNG_BITDEPTH_JPEG8AND12 20
2759
#define MNG_COMPRESSION_BASELINEJPEG 8 /* JHDR */
2761
#define MNG_INTERLACE_SEQUENTIAL 0 /* JHDR */
2762
#define MNG_INTERLACE_PROGRESSIVE 8
2763
#endif /* MNG_INCLUDE_JNG */
2765
#define MNG_IMAGETYPE_UNKNOWN 0 /* DHDR */
2766
#define MNG_IMAGETYPE_PNG 1
2767
#define MNG_IMAGETYPE_JNG 2
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
2778
#define MNG_FILLMETHOD_LEFTBITREPLICATE 0 /* PROM */
2779
#define MNG_FILLMETHOD_ZEROFILL 1
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
2788
#define MNG_POLARITY_ONLY 0 /* DBYK */
2789
#define MNG_POLARITY_ALLBUT 1
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
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
2805
/* ************************************************************************** */
2807
/* * Processtext callback types * */
2809
/* ************************************************************************** */
2811
#define MNG_TYPE_TEXT 0
2812
#define MNG_TYPE_ZTXT 1
2813
#define MNG_TYPE_ITXT 2
2815
/* ************************************************************************** */
2817
/* * CRC processing masks * */
2819
/* ************************************************************************** */
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
2839
/* ************************************************************************** */
2845
#endif /* _libmng_h_ */
2847
/* ************************************************************************** */
2848
/* * end of file * */
2849
/* ************************************************************************** */
1
/* ************************************************************************** */
3
/* * COPYRIGHT NOTICE: * */
5
/* * Copyright (c) 2000-2005 Gerard Juyn * */
6
/* * [You may insert additional notices after this sentence if you modify * */
9
/* * For the purposes of this copyright and license, "Contributing Authors" * */
10
/* * is defined as the following set of individuals: * */
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 - * */
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. * */
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: * */
29
/* * 1. The origin of this source code must not be misrepresented; * */
30
/* * you must not claim that you wrote the original software. * */
32
/* * 2. Altered versions must be plainly marked as such and must not be * */
33
/* * misrepresented as being the original source. * */
35
/* * 3. This Copyright notice may not be removed or altered from any source * */
36
/* * or altered source distribution. * */
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. * */
43
/* ************************************************************************** */
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. * */
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) * */
59
/* ************************************************************************** */
61
/* ************************************************************************** */
63
/* * Version numbering * */
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) * */
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) * */
73
/* * x.1.x = test version * */
74
/* * x.2.x = production version * */
75
/* * x.3.x = test version * */
76
/* * x.4.x = production version * */
79
/* ************************************************************************** */
81
/* * Identifier naming conventions throughout this library * */
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 * */
94
/* * Macros & defines are in all uppercase. * */
95
/* * Functions & typedefs in all lowercase. * */
96
/* * Exported stuff is prefixed with MNG_ or mng_ respectively. * */
98
/* * (I may have missed a couple; don't hesitate to let me know!) * */
100
/* ************************************************************************** */
102
/* ************************************************************************** */
104
/* * project : libmng * */
105
/* * file : libmng.h copyright (c) 2000-2005 G.Juyn * */
106
/* * version : 1.0.9 * */
108
/* * purpose : main application interface * */
110
/* * author : G.Juyn * */
112
/* * comment : The main application interface. An application should not * */
113
/* * need access to any of the other modules! * */
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 * */
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 * */
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 * */
158
/* * 0.9.0 - 06/30/2000 - G.Juyn * */
159
/* * - changed refresh parameters to 'x,y,width,height' * */
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 * */
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 * */
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 * */
209
/* * 0.9.4 - 01/18/2001 - G.Juyn * */
210
/* * - added errorcode for MAGN methods * */
211
/* * - removed test filter-methods 1 & 65 * */
213
/* * 1.0.0 - 02/05/2001 - G.Juyn * */
214
/* * - version numbers (obviously) * */
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!) * */
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 * */
230
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
231
/* * - added get function for last processed BACK chunk * */
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() * */
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 * */
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 * */
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 * */
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 * */
290
/* ************************************************************************** */
292
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
293
#pragma option -A /* force ANSI-C */
299
/* ************************************************************************** */
301
#include "libmng_conf.h" /* user-specific configuration options */
303
/* ************************************************************************** */
305
#define MNG_CHECK_BAD_ICCP /* let's catch that sucker !!! */
307
#ifdef MNG_SUPPORT_READ /* dependencies based on user-configuration */
308
#define MNG_INCLUDE_READ_PROCS
311
#ifdef MNG_SUPPORT_WRITE
312
#define MNG_INCLUDE_WRITE_PROCS
315
#ifdef MNG_USE_ZLIB_CRC
316
#define MNG_INCLUDE_ZLIB
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
328
#ifdef MNG_STORE_CHUNKS
329
#define MNG_INCLUDE_ZLIB
332
#ifdef MNG_SUPPORT_IJG6B
333
#define MNG_INCLUDE_JNG
334
#define MNG_INCLUDE_IJG6B
335
#define MNG_USE_SETJMP
338
#ifdef MNG_INCLUDE_JNG
339
#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
340
#define MNG_INCLUDE_JNG_READ
342
#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
343
#define MNG_INCLUDE_JNG_WRITE
348
#define MNG_INCLUDE_LCMS
351
#ifdef MNG_AUTO_DITHER
352
#define MNG_INCLUDE_DITHERING
355
#ifdef MNG_SUPPORT_TRACE
356
#define MNG_INCLUDE_TRACE_PROCS
357
#ifdef MNG_TRACE_TELLTALE
358
#define MNG_INCLUDE_TRACE_STRINGS
362
#ifdef MNG_ERROR_TELLTALE
363
#define MNG_INCLUDE_ERROR_STRINGS
366
#ifdef MNG_OPTIMIZE_CHUNKINITFREE
367
#ifndef MNG_OPTIMIZE_CHUNKACCESS
368
#define MNG_OPTIMIZE_CHUNKACCESS
371
#ifdef MNG_OPTIMIZE_CHUNKACCESS
372
#undef MNG_OPTIMIZE_CHUNKACCESS
376
/* ************************************************************************** */
378
#include "libmng_types.h" /* platform-specific definitions
379
and other assorted stuff */
381
/* ************************************************************************** */
387
/* ************************************************************************** */
389
/* * Versioning control * */
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 !!! * */
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 * */
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 * */
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 * */
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 * */
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 * */
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 * */
440
/* ************************************************************************** */
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
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);
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,
468
mng_uint8* iRelease);
471
/* ************************************************************************** */
473
/* * MNG/PNG specification level conformance * */
475
/* ************************************************************************** */
477
#define MNG_PNG_VERSION "1.2"
478
#define MNG_PNG_VERSION_MAJ 1
479
#define MNG_PNG_VERSION_MIN 2
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" */
487
/* ************************************************************************** */
489
/* * High-level application functions * */
491
/* ************************************************************************** */
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);
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
505
MNG_EXT mng_retcode MNG_DECL mng_reset (mng_handle hHandle);
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);
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);
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
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,
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,
566
mng_bool bTakeownership);
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);
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);
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);
605
#endif /* MNG_SUPPORT_DISPLAY */
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,
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,
623
mng_chunkid* iChunkname,
624
mng_uint32* iChunkseq,
627
mng_pchar* zErrortext);
629
/* ************************************************************************** */
631
/* * Callback set functions * */
633
/* ************************************************************************** */
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,
640
MNG_EXT mng_retcode MNG_DECL mng_setcb_memfree (mng_handle hHandle,
642
#endif /* MNG_INTERNAL_MEMMNGMT */
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);
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,
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);
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);
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);
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:
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);
723
/* callbacks for display processing */
724
/* getcanvasline is called to get an access-pointer to a line on the
726
/* getbkgdline is called to get an access-pointer to a line from the
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:
739
if your implementation requires inclusive points, simply subtract 1 from
740
both the right & bottom values calculated above.
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,
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,
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 */
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 */
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);
788
/* ************************************************************************** */
790
/* * Callback get functions * */
792
/* ************************************************************************** */
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);
801
#ifdef MNG_SUPPORT_READ
802
MNG_EXT mng_releasedata MNG_DECL mng_getcb_releasedata (mng_handle hHandle);
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);
814
#ifdef MNG_SUPPORT_READ
815
MNG_EXT mng_readdata MNG_DECL mng_getcb_readdata (mng_handle hHandle);
819
#ifdef MNG_SUPPORT_WRITE
820
MNG_EXT mng_writedata MNG_DECL mng_getcb_writedata (mng_handle hHandle);
824
MNG_EXT mng_errorproc MNG_DECL mng_getcb_errorproc (mng_handle hHandle);
827
#ifdef MNG_SUPPORT_TRACE
828
MNG_EXT mng_traceproc MNG_DECL mng_getcb_traceproc (mng_handle hHandle);
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);
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);
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);
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 */
863
/* ************************************************************************** */
865
/* * Property set functions * */
867
/* ************************************************************************** */
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,
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,
879
MNG_EXT mng_retcode MNG_DECL mng_set_bkgdstyle (mng_handle hHandle,
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,
890
/* Indicates preferred use of the bKGD chunk for PNG images */
891
MNG_EXT mng_retcode MNG_DECL mng_set_usebkgd (mng_handle hHandle,
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);
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);
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);
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);
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
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
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
952
MNG_EXT mng_retcode MNG_DECL mng_set_crcmode (mng_handle hHandle,
953
mng_uint32 iCrcmode);
955
/* Color-management necessaries */
957
*************************************************************************
958
!!!!!!!! THIS NEXT BIT IS IMPORTANT !!!!!!!!!
959
*************************************************************************
961
If you have defined MNG_FULL_CMS (and are using lcms), you will have to
962
think hard about the following routines.
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)
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)
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.
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.
983
TO RECAP: for sRGB systems (Windows, Linux) no action required!
984
for non-sRGB systems (SGI, Mac, Next) ACTION REQUIRED!
986
Please visit http://www.srgb.com, http://www.color.org and
987
http://www.littlecms.com for more info.
989
*************************************************************************
990
!!!!!!!! THE BIT ABOVE IS IMPORTANT !!!!!!!!!
991
*************************************************************************
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,
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,
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,
1017
MNG_EXT mng_retcode MNG_DECL mng_set_srgbimplicit (mng_handle hHandle);
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,
1025
MNG_EXT mng_retcode MNG_DECL mng_set_displaygamma (mng_handle hHandle,
1027
MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggamma (mng_handle hHandle,
1029
MNG_EXT mng_retcode MNG_DECL mng_set_viewgammaint (mng_handle hHandle,
1031
MNG_EXT mng_retcode MNG_DECL mng_set_displaygammaint (mng_handle hHandle,
1033
MNG_EXT mng_retcode MNG_DECL mng_set_dfltimggammaint (mng_handle hHandle,
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);
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,
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);
1071
MNG_EXT mng_retcode MNG_DECL mng_set_zlib_maxidat (mng_handle hHandle,
1072
mng_uint32 iMaxIDAT);
1073
#endif /* MNG_INCLUDE_ZLIB */
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);
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);
1094
MNG_EXT mng_retcode MNG_DECL mng_set_jpeg_maxjdat (mng_handle hHandle,
1095
mng_uint32 iMaxJDAT);
1096
#endif /* MNG_INCLUDE_JNG */
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);
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);
1114
/* ************************************************************************** */
1116
/* * Property get functions * */
1118
/* ************************************************************************** */
1121
MNG_EXT mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle);
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);
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);
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);
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);
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);
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);
1179
MNG_EXT mng_retcode MNG_DECL mng_get_bgcolor (mng_handle hHandle,
1185
MNG_EXT mng_bool MNG_DECL mng_get_usebkgd (mng_handle hHandle);
1188
MNG_EXT mng_bool MNG_DECL mng_get_storechunks (mng_handle hHandle);
1191
MNG_EXT mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle);
1194
MNG_EXT mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle);
1197
MNG_EXT mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle);
1200
MNG_EXT mng_uint32 MNG_DECL mng_get_crcmode (mng_handle hHandle);
1203
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_FULL_CMS)
1204
MNG_EXT mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle);
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);
1215
#ifndef MNG_SKIP_MAXCANVAS
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);
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);
1229
MNG_EXT mng_uint32 MNG_DECL mng_get_zlib_maxidat (mng_handle hHandle);
1230
#endif /* MNG_INCLUDE_ZLIB */
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);
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);
1243
MNG_EXT mng_uint32 MNG_DECL mng_get_jpeg_maxjdat (mng_handle hHandle);
1244
#endif /* MNG_INCLUDE_JNG */
1247
#if defined(MNG_SUPPORT_READ)
1248
MNG_EXT mng_bool MNG_DECL mng_get_suspensionmode (mng_handle hHandle);
1252
#if defined(MNG_SUPPORT_DISPLAY)
1253
MNG_EXT mng_speedtype
1254
MNG_DECL mng_get_speed (mng_handle hHandle);
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);
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,
1272
mng_uint8* iMandatory);
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);
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);
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);
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);
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);
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);
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);
1348
/* ************************************************************************** */
1350
/* * Chunk access functions * */
1352
/* ************************************************************************** */
1354
#ifdef MNG_ACCESS_CHUNKS
1356
/* ************************************************************************** */
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);
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,
1371
mng_handle hHandleOut);
1374
/* ************************************************************************** */
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,
1380
mng_uint32 *iHeight,
1381
mng_uint8 *iBitdepth,
1382
mng_uint8 *iColortype,
1383
mng_uint8 *iCompression,
1385
mng_uint8 *iInterlace);
1387
MNG_EXT mng_retcode MNG_DECL mng_getchunk_plte (mng_handle hHandle,
1390
mng_palette8 *aPalette);
1392
MNG_EXT mng_retcode MNG_DECL mng_getchunk_idat (mng_handle hHandle,
1394
mng_uint32 *iRawlen,
1397
MNG_EXT mng_retcode MNG_DECL mng_getchunk_trns (mng_handle hHandle,
1403
mng_uint8arr *aAlphas,
1408
mng_uint32 *iRawlen,
1409
mng_uint8arr *aRawdata);
1411
MNG_EXT mng_retcode MNG_DECL mng_getchunk_gama (mng_handle hHandle,
1414
mng_uint32 *iGamma);
1416
MNG_EXT mng_retcode MNG_DECL mng_getchunk_chrm (mng_handle hHandle,
1419
mng_uint32 *iWhitepointx,
1420
mng_uint32 *iWhitepointy,
1423
mng_uint32 *iGreenx,
1424
mng_uint32 *iGreeny,
1426
mng_uint32 *iBluey);
1428
MNG_EXT mng_retcode MNG_DECL mng_getchunk_srgb (mng_handle hHandle,
1431
mng_uint8 *iRenderingintent);
1433
MNG_EXT mng_retcode MNG_DECL mng_getchunk_iccp (mng_handle hHandle,
1436
mng_uint32 *iNamesize,
1438
mng_uint8 *iCompression,
1439
mng_uint32 *iProfilesize,
1442
MNG_EXT mng_retcode MNG_DECL mng_getchunk_text (mng_handle hHandle,
1444
mng_uint32 *iKeywordsize,
1445
mng_pchar *zKeyword,
1446
mng_uint32 *iTextsize,
1449
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ztxt (mng_handle hHandle,
1451
mng_uint32 *iKeywordsize,
1452
mng_pchar *zKeyword,
1453
mng_uint8 *iCompression,
1454
mng_uint32 *iTextsize,
1457
MNG_EXT mng_retcode MNG_DECL mng_getchunk_itxt (mng_handle hHandle,
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,
1470
MNG_EXT mng_retcode MNG_DECL mng_getchunk_bkgd (mng_handle hHandle,
1480
MNG_EXT mng_retcode MNG_DECL mng_getchunk_phys (mng_handle hHandle,
1487
MNG_EXT mng_retcode MNG_DECL mng_getchunk_sbit (mng_handle hHandle,
1491
mng_uint8arr4 *aBits);
1493
MNG_EXT mng_retcode MNG_DECL mng_getchunk_splt (mng_handle hHandle,
1496
mng_uint32 *iNamesize,
1498
mng_uint8 *iSampledepth,
1499
mng_uint32 *iEntrycount,
1502
MNG_EXT mng_retcode MNG_DECL mng_getchunk_hist (mng_handle hHandle,
1504
mng_uint32 *iEntrycount,
1505
mng_uint16arr *aEntries);
1507
MNG_EXT mng_retcode MNG_DECL mng_getchunk_time (mng_handle hHandle,
1514
mng_uint8 *iSecond);
1516
MNG_EXT mng_retcode MNG_DECL mng_getchunk_mhdr (mng_handle hHandle,
1519
mng_uint32 *iHeight,
1521
mng_uint32 *iLayercount,
1522
mng_uint32 *iFramecount,
1523
mng_uint32 *iPlaytime,
1524
mng_uint32 *iSimplicity);
1526
MNG_EXT mng_retcode MNG_DECL mng_getchunk_loop (mng_handle hHandle,
1529
mng_uint32 *iRepeat,
1530
mng_uint8 *iTermination,
1531
mng_uint32 *iItermin,
1532
mng_uint32 *iItermax,
1534
mng_uint32p *pSignals);
1536
MNG_EXT mng_retcode MNG_DECL mng_getchunk_endl (mng_handle hHandle,
1540
MNG_EXT mng_retcode MNG_DECL mng_getchunk_defi (mng_handle hHandle,
1542
mng_uint16 *iObjectid,
1543
mng_uint8 *iDonotshow,
1544
mng_uint8 *iConcrete,
1546
mng_int32 *iXlocation,
1547
mng_int32 *iYlocation,
1550
mng_int32 *iRightcb,
1552
mng_int32 *iBottomcb);
1554
MNG_EXT mng_retcode MNG_DECL mng_getchunk_basi (mng_handle hHandle,
1557
mng_uint32 *iHeight,
1558
mng_uint8 *iBitdepth,
1559
mng_uint8 *iColortype,
1560
mng_uint8 *iCompression,
1562
mng_uint8 *iInterlace,
1567
mng_uint8 *iViewable);
1569
MNG_EXT mng_retcode MNG_DECL mng_getchunk_clon (mng_handle hHandle,
1571
mng_uint16 *iSourceid,
1572
mng_uint16 *iCloneid,
1573
mng_uint8 *iClonetype,
1574
mng_uint8 *iDonotshow,
1575
mng_uint8 *iConcrete,
1577
mng_uint8 *iLocationtype,
1578
mng_int32 *iLocationx,
1579
mng_int32 *iLocationy);
1581
#ifndef MNG_SKIPCHUNK_PAST
1582
MNG_EXT mng_retcode MNG_DECL mng_getchunk_past (mng_handle hHandle,
1584
mng_uint16 *iDestid,
1585
mng_uint8 *iTargettype,
1586
mng_int32 *iTargetx,
1587
mng_int32 *iTargety,
1588
mng_uint32 *iCount);
1590
MNG_EXT mng_retcode MNG_DECL mng_getchunk_past_src (mng_handle hHandle,
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);
1606
MNG_EXT mng_retcode MNG_DECL mng_getchunk_disc (mng_handle hHandle,
1609
mng_uint16p *pObjectids);
1611
MNG_EXT mng_retcode MNG_DECL mng_getchunk_back (mng_handle hHandle,
1616
mng_uint8 *iMandatory,
1617
mng_uint16 *iImageid,
1620
MNG_EXT mng_retcode MNG_DECL mng_getchunk_fram (mng_handle hHandle,
1624
mng_uint32 *iNamesize,
1626
mng_uint8 *iChangedelay,
1627
mng_uint8 *iChangetimeout,
1628
mng_uint8 *iChangeclipping,
1629
mng_uint8 *iChangesyncid,
1631
mng_uint32 *iTimeout,
1632
mng_uint8 *iBoundarytype,
1633
mng_int32 *iBoundaryl,
1634
mng_int32 *iBoundaryr,
1635
mng_int32 *iBoundaryt,
1636
mng_int32 *iBoundaryb,
1638
mng_uint32p *pSyncids);
1640
MNG_EXT mng_retcode MNG_DECL mng_getchunk_move (mng_handle hHandle,
1642
mng_uint16 *iFirstid,
1643
mng_uint16 *iLastid,
1644
mng_uint8 *iMovetype,
1648
MNG_EXT mng_retcode MNG_DECL mng_getchunk_clip (mng_handle hHandle,
1650
mng_uint16 *iFirstid,
1651
mng_uint16 *iLastid,
1652
mng_uint8 *iCliptype,
1658
MNG_EXT mng_retcode MNG_DECL mng_getchunk_show (mng_handle hHandle,
1661
mng_uint16 *iFirstid,
1662
mng_uint16 *iLastid,
1665
MNG_EXT mng_retcode MNG_DECL mng_getchunk_term (mng_handle hHandle,
1667
mng_uint8 *iTermaction,
1668
mng_uint8 *iIteraction,
1670
mng_uint32 *iItermax);
1672
MNG_EXT mng_retcode MNG_DECL mng_getchunk_save (mng_handle hHandle,
1675
mng_uint8 *iOffsettype,
1676
mng_uint32 *iCount);
1678
MNG_EXT mng_retcode MNG_DECL mng_getchunk_save_entry (mng_handle hHandle,
1681
mng_uint8 *iEntrytype,
1682
mng_uint32arr2 *iOffset,
1683
mng_uint32arr2 *iStarttime,
1684
mng_uint32 *iLayernr,
1685
mng_uint32 *iFramenr,
1686
mng_uint32 *iNamesize,
1689
MNG_EXT mng_retcode MNG_DECL mng_getchunk_seek (mng_handle hHandle,
1691
mng_uint32 *iNamesize,
1694
MNG_EXT mng_retcode MNG_DECL mng_getchunk_expi (mng_handle hHandle,
1696
mng_uint16 *iSnapshotid,
1697
mng_uint32 *iNamesize,
1700
MNG_EXT mng_retcode MNG_DECL mng_getchunk_fpri (mng_handle hHandle,
1702
mng_uint8 *iDeltatype,
1703
mng_uint8 *iPriority);
1705
MNG_EXT mng_retcode MNG_DECL mng_getchunk_need (mng_handle hHandle,
1707
mng_uint32 *iKeywordssize,
1708
mng_pchar *zKeywords);
1710
MNG_EXT mng_retcode MNG_DECL mng_getchunk_phyg (mng_handle hHandle,
1717
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jhdr (mng_handle hHandle,
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);
1730
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdat (mng_handle hHandle,
1732
mng_uint32 *iRawlen,
1735
MNG_EXT mng_retcode MNG_DECL mng_getchunk_jdaa (mng_handle hHandle,
1737
mng_uint32 *iRawlen,
1740
MNG_EXT mng_retcode MNG_DECL mng_getchunk_dhdr (mng_handle hHandle,
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);
1750
MNG_EXT mng_retcode MNG_DECL mng_getchunk_prom (mng_handle hHandle,
1752
mng_uint8 *iColortype,
1753
mng_uint8 *iSampledepth,
1754
mng_uint8 *iFilltype);
1756
MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt (mng_handle hHandle,
1758
mng_uint8 *iDeltatype,
1759
mng_uint32 *iCount);
1761
MNG_EXT mng_retcode MNG_DECL mng_getchunk_pplt_entry (mng_handle hHandle,
1770
MNG_EXT mng_retcode MNG_DECL mng_getchunk_drop (mng_handle hHandle,
1773
mng_chunkidp *pChunknames);
1775
MNG_EXT mng_retcode MNG_DECL mng_getchunk_dbyk (mng_handle hHandle,
1777
mng_chunkid *iChunkname,
1778
mng_uint8 *iPolarity,
1779
mng_uint32 *iKeywordssize,
1780
mng_pchar *zKeywords);
1782
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr (mng_handle hHandle,
1784
mng_uint32 *iCount);
1786
MNG_EXT mng_retcode MNG_DECL mng_getchunk_ordr_entry (mng_handle hHandle,
1789
mng_chunkid *iChunkname,
1790
mng_uint8 *iOrdertype);
1792
MNG_EXT mng_retcode MNG_DECL mng_getchunk_magn (mng_handle hHandle,
1794
mng_uint16 *iFirstid,
1795
mng_uint16 *iLastid,
1796
mng_uint16 *iMethodX,
1803
mng_uint16 *iMethodY);
1805
MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt (mng_handle hHandle,
1807
mng_uint32 *iCount);
1809
MNG_EXT mng_retcode MNG_DECL mng_getchunk_evnt_entry (mng_handle hHandle,
1812
mng_uint8 *iEventtype,
1813
mng_uint8 *iMasktype,
1818
mng_uint16 *iObjectid,
1820
mng_uint32 *iSegmentnamesize,
1821
mng_pchar *zSegmentname);
1823
MNG_EXT mng_retcode MNG_DECL mng_getchunk_unknown (mng_handle hHandle,
1825
mng_chunkid *iChunkname,
1826
mng_uint32 *iRawlen,
1829
/* ************************************************************************** */
1831
#ifdef MNG_INCLUDE_WRITE_PROCS
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,
1838
mng_uint8 iBitdepth,
1839
mng_uint8 iColortype,
1840
mng_uint8 iCompression,
1842
mng_uint8 iInterlace);
1844
MNG_EXT mng_retcode MNG_DECL mng_putchunk_plte (mng_handle hHandle,
1846
mng_palette8 aPalette);
1848
MNG_EXT mng_retcode MNG_DECL mng_putchunk_idat (mng_handle hHandle,
1852
MNG_EXT mng_retcode MNG_DECL mng_putchunk_iend (mng_handle hHandle);
1854
MNG_EXT mng_retcode MNG_DECL mng_putchunk_trns (mng_handle hHandle,
1859
mng_uint8arr aAlphas,
1865
mng_uint8arr aRawdata);
1867
MNG_EXT mng_retcode MNG_DECL mng_putchunk_gama (mng_handle hHandle,
1871
MNG_EXT mng_retcode MNG_DECL mng_putchunk_chrm (mng_handle hHandle,
1873
mng_uint32 iWhitepointx,
1874
mng_uint32 iWhitepointy,
1882
MNG_EXT mng_retcode MNG_DECL mng_putchunk_srgb (mng_handle hHandle,
1884
mng_uint8 iRenderingintent);
1886
MNG_EXT mng_retcode MNG_DECL mng_putchunk_iccp (mng_handle hHandle,
1888
mng_uint32 iNamesize,
1890
mng_uint8 iCompression,
1891
mng_uint32 iProfilesize,
1894
MNG_EXT mng_retcode MNG_DECL mng_putchunk_text (mng_handle hHandle,
1895
mng_uint32 iKeywordsize,
1897
mng_uint32 iTextsize,
1900
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ztxt (mng_handle hHandle,
1901
mng_uint32 iKeywordsize,
1903
mng_uint8 iCompression,
1904
mng_uint32 iTextsize,
1907
MNG_EXT mng_retcode MNG_DECL mng_putchunk_itxt (mng_handle hHandle,
1908
mng_uint32 iKeywordsize,
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,
1919
MNG_EXT mng_retcode MNG_DECL mng_putchunk_bkgd (mng_handle hHandle,
1928
MNG_EXT mng_retcode MNG_DECL mng_putchunk_phys (mng_handle hHandle,
1934
MNG_EXT mng_retcode MNG_DECL mng_putchunk_sbit (mng_handle hHandle,
1937
mng_uint8arr4 aBits);
1939
MNG_EXT mng_retcode MNG_DECL mng_putchunk_splt (mng_handle hHandle,
1941
mng_uint32 iNamesize,
1943
mng_uint8 iSampledepth,
1944
mng_uint32 iEntrycount,
1947
MNG_EXT mng_retcode MNG_DECL mng_putchunk_hist (mng_handle hHandle,
1948
mng_uint32 iEntrycount,
1949
mng_uint16arr aEntries);
1951
MNG_EXT mng_retcode MNG_DECL mng_putchunk_time (mng_handle hHandle,
1959
MNG_EXT mng_retcode MNG_DECL mng_putchunk_mhdr (mng_handle hHandle,
1963
mng_uint32 iLayercount,
1964
mng_uint32 iFramecount,
1965
mng_uint32 iPlaytime,
1966
mng_uint32 iSimplicity);
1968
MNG_EXT mng_retcode MNG_DECL mng_putchunk_mend (mng_handle hHandle);
1970
MNG_EXT mng_retcode MNG_DECL mng_putchunk_loop (mng_handle hHandle,
1973
mng_uint8 iTermination,
1974
mng_uint32 iItermin,
1975
mng_uint32 iItermax,
1977
mng_uint32p pSignals);
1979
MNG_EXT mng_retcode MNG_DECL mng_putchunk_endl (mng_handle hHandle,
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,
1987
mng_int32 iXlocation,
1988
mng_int32 iYlocation,
1993
mng_int32 iBottomcb);
1995
MNG_EXT mng_retcode MNG_DECL mng_putchunk_basi (mng_handle hHandle,
1998
mng_uint8 iBitdepth,
1999
mng_uint8 iColortype,
2000
mng_uint8 iCompression,
2002
mng_uint8 iInterlace,
2007
mng_uint8 iViewable);
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,
2016
mng_uint8 iLocationtype,
2017
mng_int32 iLocationx,
2018
mng_int32 iLocationy);
2020
#ifndef MNG_SKIPCHUNK_PAST
2021
MNG_EXT mng_retcode MNG_DECL mng_putchunk_past (mng_handle hHandle,
2023
mng_uint8 iTargettype,
2028
MNG_EXT mng_retcode MNG_DECL mng_putchunk_past_src (mng_handle hHandle,
2030
mng_uint16 iSourceid,
2031
mng_uint8 iComposition,
2032
mng_uint8 iOrientation,
2033
mng_uint8 iOffsettype,
2036
mng_uint8 iBoundarytype,
2037
mng_int32 iBoundaryl,
2038
mng_int32 iBoundaryr,
2039
mng_int32 iBoundaryt,
2040
mng_int32 iBoundaryb);
2043
MNG_EXT mng_retcode MNG_DECL mng_putchunk_disc (mng_handle hHandle,
2045
mng_uint16p pObjectids);
2047
MNG_EXT mng_retcode MNG_DECL mng_putchunk_back (mng_handle hHandle,
2051
mng_uint8 iMandatory,
2052
mng_uint16 iImageid,
2055
MNG_EXT mng_retcode MNG_DECL mng_putchunk_fram (mng_handle hHandle,
2058
mng_uint32 iNamesize,
2060
mng_uint8 iChangedelay,
2061
mng_uint8 iChangetimeout,
2062
mng_uint8 iChangeclipping,
2063
mng_uint8 iChangesyncid,
2065
mng_uint32 iTimeout,
2066
mng_uint8 iBoundarytype,
2067
mng_int32 iBoundaryl,
2068
mng_int32 iBoundaryr,
2069
mng_int32 iBoundaryt,
2070
mng_int32 iBoundaryb,
2072
mng_uint32p pSyncids);
2074
MNG_EXT mng_retcode MNG_DECL mng_putchunk_move (mng_handle hHandle,
2075
mng_uint16 iFirstid,
2077
mng_uint8 iMovetype,
2081
MNG_EXT mng_retcode MNG_DECL mng_putchunk_clip (mng_handle hHandle,
2082
mng_uint16 iFirstid,
2084
mng_uint8 iCliptype,
2090
MNG_EXT mng_retcode MNG_DECL mng_putchunk_show (mng_handle hHandle,
2092
mng_uint16 iFirstid,
2096
MNG_EXT mng_retcode MNG_DECL mng_putchunk_term (mng_handle hHandle,
2097
mng_uint8 iTermaction,
2098
mng_uint8 iIteraction,
2100
mng_uint32 iItermax);
2102
MNG_EXT mng_retcode MNG_DECL mng_putchunk_save (mng_handle hHandle,
2104
mng_uint8 iOffsettype,
2107
MNG_EXT mng_retcode MNG_DECL mng_putchunk_save_entry (mng_handle hHandle,
2109
mng_uint8 iEntrytype,
2110
mng_uint32arr2 iOffset,
2111
mng_uint32arr2 iStarttime,
2112
mng_uint32 iLayernr,
2113
mng_uint32 iFramenr,
2114
mng_uint32 iNamesize,
2117
MNG_EXT mng_retcode MNG_DECL mng_putchunk_seek (mng_handle hHandle,
2118
mng_uint32 iNamesize,
2121
MNG_EXT mng_retcode MNG_DECL mng_putchunk_expi (mng_handle hHandle,
2122
mng_uint16 iSnapshotid,
2123
mng_uint32 iNamesize,
2126
MNG_EXT mng_retcode MNG_DECL mng_putchunk_fpri (mng_handle hHandle,
2127
mng_uint8 iDeltatype,
2128
mng_uint8 iPriority);
2130
MNG_EXT mng_retcode MNG_DECL mng_putchunk_need (mng_handle hHandle,
2131
mng_uint32 iKeywordssize,
2132
mng_pchar zKeywords);
2134
MNG_EXT mng_retcode MNG_DECL mng_putchunk_phyg (mng_handle hHandle,
2140
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jhdr (mng_handle hHandle,
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);
2152
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdat (mng_handle hHandle,
2156
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jdaa (mng_handle hHandle,
2160
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jsep (mng_handle hHandle);
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,
2169
mng_uint32 iBlocky);
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);
2176
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ipng (mng_handle hHandle);
2178
MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt (mng_handle hHandle,
2179
mng_uint8 iDeltatype,
2182
MNG_EXT mng_retcode MNG_DECL mng_putchunk_pplt_entry (mng_handle hHandle,
2189
MNG_EXT mng_retcode MNG_DECL mng_putchunk_jpng (mng_handle hHandle);
2191
MNG_EXT mng_retcode MNG_DECL mng_putchunk_drop (mng_handle hHandle,
2193
mng_chunkidp pChunknames);
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);
2201
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr (mng_handle hHandle,
2204
MNG_EXT mng_retcode MNG_DECL mng_putchunk_ordr_entry (mng_handle hHandle,
2206
mng_chunkid iChunkname,
2207
mng_uint8 iOrdertype);
2209
MNG_EXT mng_retcode MNG_DECL mng_putchunk_magn (mng_handle hHandle,
2210
mng_uint16 iFirstid,
2212
mng_uint16 iMethodX,
2219
mng_uint16 iMethodY);
2221
MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt (mng_handle hHandle,
2224
MNG_EXT mng_retcode MNG_DECL mng_putchunk_evnt_entry (mng_handle hHandle,
2226
mng_uint8 iEventtype,
2227
mng_uint8 iMasktype,
2232
mng_uint16 iObjectid,
2234
mng_uint32 iSegmentnamesize,
2235
mng_pchar zSegmentname);
2237
MNG_EXT mng_retcode MNG_DECL mng_putchunk_unknown (mng_handle hHandle,
2238
mng_chunkid iChunkname,
2242
#endif /* MNG_INCLUDE_WRITE_PROCS */
2244
/* ************************************************************************** */
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) */
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
2260
MNG_EXT mng_retcode MNG_DECL mng_getimgdata_seq (mng_handle hHandle,
2262
mng_uint32 iCanvasstyle,
2263
mng_getcanvasline fGetcanvasline);
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!) */
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,
2277
mng_uint32 iCanvasstyle,
2278
mng_getcanvasline fGetcanvasline);
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,
2284
mng_uint32 iCanvasstyle,
2285
mng_getcanvasline fGetcanvasline);
2287
/* ************************************************************************** */
2289
#ifdef MNG_INCLUDE_WRITE_PROCS
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!) */
2301
MNG_EXT mng_retcode MNG_DECL mng_putimgdata_ihdr (mng_handle hHandle,
2304
mng_uint8 iColortype,
2305
mng_uint8 iBitdepth,
2306
mng_uint8 iCompression,
2308
mng_uint8 iInterlace,
2309
mng_uint32 iCanvasstyle,
2310
mng_getcanvasline fGetcanvasline);
2312
MNG_EXT mng_retcode MNG_DECL mng_putimgdata_jhdr (mng_handle hHandle,
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);
2326
/* ************************************************************************** */
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 */
2332
MNG_EXT mng_retcode MNG_DECL mng_updatemngheader (mng_handle hHandle,
2333
mng_uint32 iFramecount,
2334
mng_uint32 iLayercount,
2335
mng_uint32 iPlaytime);
2337
MNG_EXT mng_retcode MNG_DECL mng_updatemngsimplicity (mng_handle hHandle,
2338
mng_uint32 iSimplicity);
2340
/* ************************************************************************** */
2342
#endif /* MNG_INCLUDE_WRITE_PROCS */
2344
#endif /* MNG_ACCESS_CHUNKS */
2346
/* ************************************************************************** */
2348
/* * Error-code structure * */
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) * */
2356
/* ************************************************************************** */
2358
#define MNG_NOERROR (mng_retcode)0 /* er.. indicates all's well */
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 */
2378
#define MNG_DLLNOTLOADED (mng_retcode)99 /* late binding failed */
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 */
2386
#define MNG_INTERNALERROR (mng_retcode)999 /* internal inconsistancy */
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)*/
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 */
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 */
2451
#define MNG_IMAGEFROZEN (mng_retcode)8193 /* stopped displaying */
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*/
2457
/* ************************************************************************** */
2459
/* * Canvas styles * */
2461
/* * Note that the intentions are pretty darn good, but that the focus * */
2462
/* * is currently on 8-bit color support * */
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!!! * */
2468
/* ************************************************************************** */
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 */
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
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)
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))
2523
/* ************************************************************************** */
2525
/* * Chunk names (idea adapted from libpng 1.1.0 - png.h) * */
2527
/* ************************************************************************** */
2529
#define MNG_UINT_HUH 0x40404040L
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
2588
#define MNG_UINT_evNT 0x65764e54L
2590
/* ************************************************************************** */
2592
/* * Chunk property values * */
2594
/* ************************************************************************** */
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
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
2608
#define MNG_COMPRESSION_DEFLATE 0 /* IHDR, zTXt, iTXt, iCCP,
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) */
2617
#define MNG_FILTER_DIFFERING 0xC0
2620
#define MNG_FILTER_NOFILTER 0xC1
2623
#define MNG_INTERLACE_NONE 0 /* IHDR, BASI, JHDR */
2624
#define MNG_INTERLACE_ADAM7 1
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
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"
2648
#define MNG_FLAG_UNCOMPRESSED 0 /* iTXt */
2649
#define MNG_FLAG_COMPRESSED 1
2651
#define MNG_UNIT_UNKNOWN 0 /* pHYs, pHYg */
2652
#define MNG_UNIT_METER 1
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
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
2670
#define MNG_DONOTSHOW_VISIBLE 0 /* DEFI */
2671
#define MNG_DONOTSHOW_NOTVISIBLE 1
2673
#define MNG_ABSTRACT 0 /* DEFI */
2674
#define MNG_CONCRETE 1
2676
#define MNG_NOTVIEWABLE 0 /* BASI */
2677
#define MNG_VIEWABLE 1
2679
#define MNG_FULL_CLONE 0 /* CLON */
2680
#define MNG_PARTIAL_CLONE 1
2681
#define MNG_RENUMBER 2
2683
#define MNG_CONCRETE_ASPARENT 0 /* CLON */
2684
#define MNG_CONCRETE_MAKEABSTRACT 1
2686
#define MNG_LOCATION_ABSOLUTE 0 /* CLON, MOVE */
2687
#define MNG_LOCATION_RELATIVE 1
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
2694
#define MNG_COMPOSITE_OVER 0 /* PAST */
2695
#define MNG_COMPOSITE_REPLACE 1
2696
#define MNG_COMPOSITE_UNDER 2
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
2704
#define MNG_OFFSET_ABSOLUTE 0 /* PAST */
2705
#define MNG_OFFSET_RELATIVE 1
2708
#define MNG_BOUNDARY_ABSOLUTE 0 /* PAST, FRAM */
2709
#define MNG_BOUNDARY_RELATIVE 1
2711
#define MNG_BACKGROUNDCOLOR_MANDATORY 0x01 /* BACK */
2712
#define MNG_BACKGROUNDIMAGE_MANDATORY 0x02 /* BACK */
2714
#define MNG_BACKGROUNDIMAGE_NOTILE 0 /* BACK */
2715
#define MNG_BACKGROUNDIMAGE_TILE 1
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
2723
#define MNG_CHANGEDELAY_NO 0 /* FRAM */
2724
#define MNG_CHANGEDELAY_NEXTSUBFRAME 1
2725
#define MNG_CHANGEDELAY_DEFAULT 2
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
2737
#define MNG_CHANGECLIPPING_NO 0 /* FRAM */
2738
#define MNG_CHANGECLIPPING_NEXTSUBFRAME 1
2739
#define MNG_CHANGECLIPPING_DEFAULT 2
2741
#define MNG_CHANGESYNCID_NO 0 /* FRAM */
2742
#define MNG_CHANGESYNCID_NEXTSUBFRAME 1
2743
#define MNG_CHANGESYNCID_DEFAULT 2
2745
#define MNG_CLIPPING_ABSOLUTE 0 /* CLIP */
2746
#define MNG_CLIPPING_RELATIVE 1
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
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
2762
#define MNG_ITERACTION_LASTFRAME 0 /* TERM */
2763
#define MNG_ITERACTION_CLEAR 1
2764
#define MNG_ITERACTION_FIRSTFRAME 2
2766
#define MNG_SAVEOFFSET_4BYTE 4 /* SAVE */
2767
#define MNG_SAVEOFFSET_8BYTE 8
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
2774
#define MNG_PRIORITY_ABSOLUTE 0 /* fPRI */
2775
#define MNG_PRIORITY_RELATIVE 1
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
2783
#define MNG_BITDEPTH_JPEG8 8 /* JHDR */
2784
#define MNG_BITDEPTH_JPEG12 12
2785
#define MNG_BITDEPTH_JPEG8AND12 20
2787
#define MNG_COMPRESSION_BASELINEJPEG 8 /* JHDR */
2789
#define MNG_INTERLACE_SEQUENTIAL 0 /* JHDR */
2790
#define MNG_INTERLACE_PROGRESSIVE 8
2791
#endif /* MNG_INCLUDE_JNG */
2793
#define MNG_IMAGETYPE_UNKNOWN 0 /* DHDR */
2794
#define MNG_IMAGETYPE_PNG 1
2795
#define MNG_IMAGETYPE_JNG 2
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
2806
#define MNG_FILLMETHOD_LEFTBITREPLICATE 0 /* PROM */
2807
#define MNG_FILLMETHOD_ZEROFILL 1
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
2816
#define MNG_POLARITY_ONLY 0 /* DBYK */
2817
#define MNG_POLARITY_ALLBUT 1
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
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
2833
/* ************************************************************************** */
2835
/* * Processtext callback types * */
2837
/* ************************************************************************** */
2839
#define MNG_TYPE_TEXT 0
2840
#define MNG_TYPE_ZTXT 1
2841
#define MNG_TYPE_ITXT 2
2843
/* ************************************************************************** */
2845
/* * CRC processing masks * */
2847
/* ************************************************************************** */
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
2867
/* ************************************************************************** */
2873
#endif /* _libmng_h_ */
2875
/* ************************************************************************** */
2876
/* * end of file * */
2877
/* ************************************************************************** */