Subversion Repositories Kolibri OS

Rev

Rev 6733 | Rev 6780 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6733 IgorA 1
 
2
3
 
4
5
 
6
; (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
7
; (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
8
9
 
10
11
 
12
;   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
13
;   libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
14
;   libpng versions 0.97, January 1998, through 1.6.25, September 1, 2016:
15
;     Glenn Randers-Pehrson.
16
;   See also "Contributing Authors", below.
17
18
 
19
 
20
 
21
22
 
23
; this sentence.
24
25
 
26
27
 
28
; files that are distributed with libpng have other copyright owners and
29
; are released under other open source licenses.
30
31
 
32
; Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
33
; derived from libpng-1.0.6, and are distributed according to the same
34
; disclaimer and license as libpng-1.0.6 with the following individuals
35
; added to the list of Contributing Authors:
36
37
 
38
;    Eric S. Raymond
39
;    Mans Rullgard
40
;    Cosmin Truta
41
;    Gilles Vollant
42
;    James Yu
43
;    Mandar Sahastrabuddhe
44
45
 
46
47
 
48
;    library or against infringement.  There is no warranty that our
49
;    efforts or the library will fulfill any of your particular purposes
50
;    or needs.  This library is provided with all faults, and the entire
51
;    risk of satisfactory quality, performance, accuracy, and effort is with
52
;    the user.
53
54
 
55
; are released under other open source licenses.
56
57
 
58
 
59
; Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
60
; libpng-0.96, and are distributed according to the same disclaimer and
61
; license as libpng-0.96, with the following individuals added to the list
62
; of Contributing Authors:
63
64
 
65
;    Glenn Randers-Pehrson
66
;    Willem van Schaik
67
68
 
69
; but are also released under this license.
70
71
 
72
; Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
73
; and are distributed according to the same disclaimer and license as
74
; libpng-0.88, with the following individuals added to the list of
75
; Contributing Authors:
76
77
 
78
;    Kevin Bracey
79
;    Sam Bushell
80
;    Magnus Holmgren
81
;    Greg Roelofs
82
;    Tom Tanner
83
84
 
85
; but are released under this license.
86
87
 
88
; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
89
90
 
91
; is defined as the following set of individuals:
92
93
 
94
;    Dave Martindale
95
;    Guy Eric Schalnat
96
;    Paul Schmidt
97
;    Tim Wegner
98
99
 
100
; and Group 42, Inc. disclaim all warranties, expressed or implied,
101
; including, without limitation, the warranties of merchantability and of
102
; fitness for any purpose.  The Contributing Authors and Group 42, Inc.
103
; assume no liability for direct, indirect, incidental, special, exemplary,
104
; or consequential damages, which may result from the use of the PNG
105
; Reference Library, even if advised of the possibility of such damage.
106
107
 
108
; source code, or portions hereof, for any purpose, without fee, subject
109
; to the following restrictions:
110
111
 
112
113
 
114
;      be misrepresented as being the original source.
115
116
 
117
;      source or altered source distribution.
118
119
 
120
; fee, and encourage the use of this source code as a component to
121
; supporting the PNG file format in commercial products.  If you use this
122
; source code in a product, acknowledgment is not required but would be
123
; appreciated.
124
125
 
126
127
 
128
129
 
130
; as a trademark in any jurisdiction.  However, because libpng has
131
; been distributed and maintained world-wide, continually since 1995,
132
; the Copyright owner claims "common-law trademark protection" in any
133
; jurisdiction where common-law trademark is recognized.
134
135
 
136
137
 
138
; a certification mark of the Open Source Initiative. OSI has not addressed
139
; the additional disclaimers inserted at version 1.0.7.
140
141
 
142
143
 
144
; Number (ECCN) for libpng is EAR99, which means not subject to export
145
; controls or International Traffic in Arms Regulations (ITAR) because
146
; it is open source, publicly available software, that does not contain
147
; any encryption software.  See the EAR, paragraphs 734.3(b)(3) and
148
; 734.7(b).
149
150
 
151
 
152
 
153
; boxes and the like:
154
155
 
156
157
 
158
; files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
159
160
 
161
 
162
 
163
; with testing, bug fixes, and patience.  This wouldn't have been
164
; possible without all of you.
165
166
 
167
168
 
169
; Note about libpng version numbers:
170
;
171
;    Due to various miscommunications, unforeseen code incompatibilities
172
;    and occasional factors outside the authors' control, version numbering
173
;    on the library has not always been consistent and straightforward.
174
;    The following table summarizes matters since version 0.89c, which was
175
;    the first widely used release:
176
;
177
;    source                 png.h  png.h  shared-lib
178
;    version                string   int  version
179
;    -------                ------ -----  ----------
180
;    ...
181
;    1.2.56                  13    10256  12.so.0.56[.0]
182
;    ...
183
;    1.5.27                  15    10527  15.so.15.27[.0]
184
;    ...
185
;    1.6.25                  16    10625  16.so.16.25[.0]
186
187
 
188
;    and minor numbers; the shared-library major version number will be
189
;    used for changes in backward compatibility, as it is intended.  The
190
;    PNG_LIBPNG_VER macro, which is not used within libpng but is available
191
;    for applications, is an unsigned integer of the form xyyzz corresponding
192
;    to the source version x.y.z (leading zeros in y and z).  Beta versions
193
;    were given the previous public release number plus a letter, until
194
;    version 1.0.6j; from then on they were given the upcoming public
195
;    release number plus "betaNN" or "rcNN".
196
197
 
198
;    to the info_ptr or png_ptr members through png.h, and the compiled
199
;    application is loaded with a different version of the library.
200
201
 
202
;    in binary compatibility (e.g., when a new feature is added).
203
204
 
205
; is available as a W3C Recommendation and as an ISO Specification,
206
; 
207
208
 
209
 
210
 
211
; =========================
212
213
 
214
215
 
216
;    an official declaration.
217
218
 
219
;    upward through 1.6.25 are Y2K compliant.  It is my belief that
220
;    earlier versions were also Y2K compliant.
221
222
 
223
;    that will hold years up to 65535.  The other, which is deprecated,
224
;    holds the date in text format, and will hold years up to 9999.
225
226
 
227
;        "uint_16 year" in png_time_struct.
228
229
 
230
;        "char time_buffer[29]" in png_struct.  This is no longer used
231
;    in libpng-1.6.x and will be removed from libpng-1.7.0.
232
233
 
234
;        png.asm: png_convert_to_rfc_1123_buffer() in png.asm
235
;          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and
236
;          png_convert_to_rfc_1152() in error prior to libpng-0.98)
237
;        png_convert_from_struct_tm() in pngwrite.asm, called in pngwrite.asm
238
;        png_convert_from_time_t() in pngwrite.asm
239
;        png_get_tIME() in pngget.asm
240
;        png_handle_tIME() in pngrutil.asm, called in pngread.asm
241
;        png_set_tIME() in pngset.asm
242
;        png_write_tIME() in pngwutil.asm, called in pngwrite.asm
243
244
 
245
;    png_convert_from_time_t() function calls gmtime() to convert from system
246
;    clock time, which returns (year - 1900), which we properly convert to
247
;    the full 4-digit year.  There is a possibility that libpng applications
248
;    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()
249
;    function, or that they are incorrectly passing only a 2-digit year
250
;    instead of "year - 1900" into the png_convert_from_struct_tm() function,
251
;    but this is not under our control.  The libpng documentation has always
252
;    stated that it works with 4-digit years, and the APIs have been
253
;    documented as such.
254
255
 
256
;    integer to hold the year, and can hold years as large as 65535.
257
258
 
259
;    no date-related code.
260
261
 
262
;       libpng maintainer
263
;       PNG Development Group
264
265
 
266
 
267
; describes how to use libpng, and the file example.c summarizes it
268
; with some code on which to build.  This file is useful for looking
269
; at the actual function definitions and structure components.  If that
270
; file has been stripped from your copy of libpng, you can find it at
271
; 
272
273
 
274
; skip to the end of this file and read the section entitled 'simplified API'.
275
276
 
277
 
278
PNG_LIBPNG_VER_STRING db '1.6.25',0
279
PNG_HEADER_VERSION_STRING db ' libpng version 1.6.25 - September 1, 2016',13,10,0
280
281
 
282
PNG_LIBPNG_VER_DLLNUM equ 16
283
284
 
285
PNG_LIBPNG_VER_MAJOR  equ 1
286
PNG_LIBPNG_VER_MINOR  equ 6
287
PNG_LIBPNG_VER_RELEASE equ 25
288
289
 
290
; PNG_LIBPNG_VER_STRING, omitting any leading zero:
291
292
 
293
 
294
295
 
296
PNG_LIBPNG_BUILD_ALPHA   equ 1
297
PNG_LIBPNG_BUILD_BETA    equ 2
298
PNG_LIBPNG_BUILD_RC      equ 3
299
PNG_LIBPNG_BUILD_STABLE  equ 4
300
PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK equ 7
301
302
 
303
PNG_LIBPNG_BUILD_PATCH   equ  8 ;Can be OR'ed with PNG_LIBPNG_BUILD_STABLE only
304
PNG_LIBPNG_BUILD_PRIVATE equ 16 ;Cannot be OR'ed with PNG_LIBPNG_BUILD_SPECIAL
305
PNG_LIBPNG_BUILD_SPECIAL equ 32 ;Cannot be OR'ed with PNG_LIBPNG_BUILD_PRIVATE
306
307
 
308
309
 
310
; We must not include leading zeros.
311
; Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
312
; version 1.0.0 was mis-numbered 100 instead of 10000).  From
313
; version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
314
315
 
316
317
 
318
; the library has been built.
319
320
 
321
 
322
323
 
324
; VS_FF_PRIVATEBUILD File *was not* built using standard release
325
; procedures. If this value is given, the StringFileInfo block must
326
; contain a PrivateBuild string.
327
328
 
329
; standard release procedures but is a variation of the standard
330
; file of the same version number. If this value is given, the
331
; StringFileInfo block must contain a SpecialBuild string.
332
333
 
334
;#  define PNG_LIBPNG_BUILD_TYPE \
335
;       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
336
;#else
337
;#  ifdef PNG_LIBPNG_SPECIALBUILD
338
;#    define PNG_LIBPNG_BUILD_TYPE \
339
;         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
340
;#  else
341
;#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
342
;#  endif
343
;end if
344
345
 
346
347
 
348
; the version above.
349
350
 
351
352
 
353
354
 
355
; 2. Any configuration options that can be specified by for the application
356
;    code when it is built.  (Build time configuration is in pnglibconf.h)
357
; 3. Type definitions (base types are defined in pngconf.h), structure
358
;    definitions.
359
; 4. Exported library functions.
360
; 5. Simplified API.
361
; 6. Implementation options.
362
363
 
364
; allow configuration of the library.
365
366
 
367
 
368
369
 
370
; See pnglibconf.h for build time configuration
371
372
 
373
; implementations of certain arithmetic APIs.  The default is set
374
; at build time and recorded in pnglibconf.h, but it is safe to
375
; override these (and only these) settings.  Note that this won't
376
; change what the library does, only application code, and the
377
; settings can (and probably should) be made on a per-file basis
378
; by setting the #defines before including png.h
379
380
 
381
; functions?
382
;   PNG_USE_READ_MACROS: use the macros (see below)  Note that
383
;     the macros evaluate their argument multiple times.
384
;   PNG_NO_USE_READ_MACROS: call the relevant library function.
385
386
 
387
; does not use division?
388
;   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'
389
;      algorithm.
390
;   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.
391
392
 
393
; false?
394
;   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error
395
;      APIs to png_warning.
396
; Otherwise the calls are mapped to png_error.
397
398
 
399
 
400
; constants.
401
; See pngconf.h for base types that vary by machine/system
402
403
 
404
 
405
; do not agree upon the version number.
406
407
 
408
409
 
410
411
 
412
; PNG file.  One of these is always required, although the simplified API
413
; (below) hides the creation and destruction of it.
414
415
 
416
; or more of these must exist while reading or creating a PNG file.  The
417
; information is not used by libpng during read but is used to control what
418
; gets written when a PNG file is created.  "png_get_" function calls read
419
; information during read and "png_set_" functions calls write information
420
; when creating a PNG.
421
; been moved into a separate header file that is not accessible to
422
; applications.  Read libpng-manual.txt or libpng.3 for more info.
423
424
 
425
; names ending 'rp' are identical pointer types except that the pointer is
426
; marked 'restrict', which means that it is the only pointer to the object
427
; passed to the function.  Applications should not use the 'restrict' types;
428
; it is always valid to pass 'p' to a pointer with a function argument of the
429
; corresponding 'rp' type.  Different compilers have different rules with
430
; regard to type matching in the presence of 'restrict'.  For backward
431
; compatibility libpng callbacks never have 'restrict' in their parameters and,
432
; consequentially, writing portable application code is extremely difficult if
433
; an attempt is made to use 'restrict'.
434
435
 
436
; exact size) is not important, although the size of the fields need to
437
; be byte or uint_16 (as defined below).
438
439
 
440
	red   db ? ;byte
441
	green db ? ;byte
442
	blue  db ? ;byte
443
ends
444
445
 
446
	index db ? ;byte ;used for palette files
447
	red   dw ? ;uint_16 ;for use in red green blue files
448
	green dw ? ;uint_16
449
	blue  dw ? ;uint_16
450
	gray  dw ? ;uint_16 ;for use in grayscale files
451
ends
452
453
 
454
	red   db ? ;byte ;for use in red green blue files
455
	green db ? ;byte
456
	blue  db ? ;byte
457
	gray  db ? ;byte ;for use in grayscale files
458
	alpha db ? ;byte ;for alpha channel files
459
ends
460
461
 
462
 
463
; of sPLT chunks.
464
465
 
466
	red   dw ? ;uint_16
467
	green dw ? ;uint_16
468
	blue  dw ? ;uint_16
469
	alpha dw ? ;uint_16
470
	frequency dw ? ;uint_16
471
ends
472
473
 
474
; occupy the LSB of their respective members, and the MSB of each member
475
; is zero-filled.  The frequency member always occupies the full 16 bits.
476
477
 
478
 
479
	name    dd ? ;charp ;palette name
480
	depth   db ? ;byte ;depth of palette samples
481
	entries dd ? ;png_sPLT_entryp ;palette entries
482
	nentries dd ? ;int_32 ;number of palette entries
483
ends
484
485
 
486
; png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
487
; and whether that contents is compressed or not.  The "key" field
488
; points to a regular zero-terminated C string.  The "text" fields can be a
489
; regular C string, an empty string, or a NULL pointer.
490
; However, the structure returned by png_get_text() will always contain
491
; the "text" field as a regular zero-terminated C string (possibly
492
; empty), never a NULL pointer, so it can be safely used in printf() and
493
; other string-handling functions.  Note that the "itxt_length", "lang", and
494
; "lang_key" members of the structure only exist when the library is built
495
; with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by
496
; default without iTXt support. Also note that when iTXt *is* supported,
497
; the "lang" and "lang_key" fields contain NULL pointers when the
498
; "compression" field contains * PNG_TEXT_COMPRESSION_NONE or
499
; PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the
500
; same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag"
501
; which is always 0 or 1, or its "compression method" which is always 0.
502
503
 
504
	compression dd ? ;int ;compression value:
505
			;-1: tEXt, none
506
			; 0: zTXt, deflate
507
			; 1: iTXt, none
508
			; 2: iTXt, deflate
509
	key  dd ? ;charp ;keyword, 1-79 character description of "text"
510
	text dd ? ;charp ;comment, may be an empty string (ie "")
511
			; or a NULL pointer
512
	text_length dd ? ;png_size_t ;length of the text string
513
	itxt_length dd ? ;png_size_t ;length of the itxt string
514
	lang dd ? ;charp ;language code, 0-79 characters
515
			; or a NULL pointer
516
	lang_key dd ? ;charp ;keyword translated UTF-8 string, 0 or more
517
			; chars or a NULL pointer
518
ends
519
end if
520
521
 
522
; The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed.
523
PNG_TEXT_COMPRESSION_NONE_WR equ -3
524
PNG_TEXT_COMPRESSION_zTXt_WR equ -2
525
PNG_TEXT_COMPRESSION_NONE    equ -1
526
PNG_TEXT_COMPRESSION_zTXt    equ 0
527
PNG_ITXT_COMPRESSION_NONE    equ 1
528
PNG_ITXT_COMPRESSION_zTXt    equ 2
529
PNG_TEXT_COMPRESSION_LAST    equ 3 ;Not a valid value
530
531
 
532
; Two conversions are provided, both from time_t and struct tm.  There
533
; is no portable way to convert to either of these structures, as far
534
; as I know.  If you know of a portable way, send it to me.  As a side
535
; note - PNG has always been Year 2000 compliant!
536
537
 
538
	year  dw ? ;uint_16 ;full year, as in, 1995
539
	month db ? ;byte ;month of year, 1 - 12
540
	day   db ? ;byte ;day of month, 1 - 31
541
	hour  db ? ;byte ;hour of day, 0 - 23
542
	minute db ? ;byte ;minute of hour, 0 - 59
543
	second db ? ;byte ;second of minute, 0 - 60 (for leap seconds)
544
ends
545
546
 
547
; png_unknown_chunk is a structure to hold queued chunks for which there is
548
; no specific support.  The idea is that we can use this to queue
549
; up private chunks for output even though the library doesn't actually
550
; know about their semantics.
551
552
 
553
554
 
555
	name rb 5 ;byte[5] ;Textual chunk name with '\0' terminator
556
	podata dd ? ;byte* ;Data, should not be modified on read!
557
	size dd ? ;png_size_t
558
559
 
560
	; Notice that on read it is set by libpng however the values stored have
561
	; more bits set than are listed below.  Always treat the value as a
562
	; bitmask.  On write set only one bit - setting multiple bits may cause the
563
	; chunk to be written in multiple places.
564
565
 
566
ends
567
end if
568
569
 
570
PNG_HAVE_IHDR equ  0x01
571
PNG_HAVE_PLTE equ  0x02
572
PNG_AFTER_IDAT equ 0x08
573
574
 
575
PNG_UINT_31_MAX equ 0x7fffffff ;uint_32
576
PNG_UINT_32_MAX equ -1 ;uint_32
577
PNG_SIZE_MAX    equ 0x60000000 ;1.5 Gb
578
579
 
580
; PNG specification manner (x100000)
581
582
 
583
PNG_FP_HALF equ 50000
584
PNG_FP_MAX equ ((png_fixed_point)0x7fffffffL)
585
PNG_FP_MIN equ (-PNG_FP_MAX)
586
587
 
588
; color type masks
589
PNG_COLOR_MASK_PALETTE equ 1
590
PNG_COLOR_MASK_COLOR   equ 2
591
PNG_COLOR_MASK_ALPHA   equ 4
592
593
 
594
PNG_COLOR_TYPE_GRAY equ 0
595
PNG_COLOR_TYPE_PALETTE equ (PNG_COLOR_MASK_COLOR or PNG_COLOR_MASK_PALETTE)
596
PNG_COLOR_TYPE_RGB      equ (PNG_COLOR_MASK_COLOR)
597
PNG_COLOR_TYPE_RGB_ALPHA equ (PNG_COLOR_MASK_COLOR or PNG_COLOR_MASK_ALPHA)
598
PNG_COLOR_TYPE_GRAY_ALPHA equ (PNG_COLOR_MASK_ALPHA)
599
; aliases
600
PNG_COLOR_TYPE_RGBA equ PNG_COLOR_TYPE_RGB_ALPHA
601
PNG_COLOR_TYPE_GA equ PNG_COLOR_TYPE_GRAY_ALPHA
602
603
 
604
PNG_COMPRESSION_TYPE_BASE equ 0 ;Deflate method 8, 32K window
605
PNG_COMPRESSION_TYPE_DEFAULT equ PNG_COMPRESSION_TYPE_BASE
606
607
 
608
PNG_FILTER_TYPE_BASE     equ 0 ;Single row per-byte filtering
609
PNG_INTRAPIXEL_DIFFERENCING equ 64 ;Used only in MNG datastreams
610
PNG_FILTER_TYPE_DEFAULT  equ PNG_FILTER_TYPE_BASE
611
612
 
613
PNG_INTERLACE_NONE       equ 0 ;Non-interlaced image
614
PNG_INTERLACE_ADAM7      equ 1 ;Adam7 interlacing
615
PNG_INTERLACE_LAST       equ 2 ;Not a valid value
616
617
 
618
PNG_OFFSET_PIXEL         equ 0 ;Offset in pixels
619
PNG_OFFSET_MICROMETER    equ 1 ;Offset in micrometers (1/10^6 meter)
620
PNG_OFFSET_LAST          equ 2 ;Not a valid value
621
622
 
623
PNG_EQUATION_LINEAR      equ 0 ;Linear transformation
624
PNG_EQUATION_BASE_E      equ 1 ;Exponential base e transform
625
PNG_EQUATION_ARBITRARY   equ 2 ;Arbitrary base exponential transform
626
PNG_EQUATION_HYPERBOLIC  equ 3 ;Hyperbolic sine transformation
627
PNG_EQUATION_LAST        equ 4 ;Not a valid value
628
629
 
630
PNG_SCALE_UNKNOWN        equ 0 ;unknown unit (image scale)
631
PNG_SCALE_METER          equ 1 ;meters per pixel
632
PNG_SCALE_RADIAN         equ 2 ;radians per pixel
633
PNG_SCALE_LAST           equ 3 ;Not a valid value
634
635
 
636
PNG_RESOLUTION_UNKNOWN   equ 0 ;pixels/unknown unit (aspect ratio)
637
PNG_RESOLUTION_METER     equ 1 ;pixels/meter
638
PNG_RESOLUTION_LAST      equ 2 ;Not a valid value
639
640
 
641
PNG_sRGB_INTENT_PERCEPTUAL equ 0
642
PNG_sRGB_INTENT_RELATIVE   equ 1
643
PNG_sRGB_INTENT_SATURATION equ 2
644
PNG_sRGB_INTENT_ABSOLUTE   equ 3
645
PNG_sRGB_INTENT_LAST       equ 4 ;Not a valid value
646
647
 
648
PNG_KEYWORD_MAX_LENGTH equ 79
649
650
 
651
PNG_MAX_PALETTE_LENGTH equ 256
652
653
 
654
; from the PNG header, or if the application has filled in the corresponding
655
; data in the info_struct to be written into the output file.  The values
656
; of the PNG_INFO_ defines should NOT be changed.
657
658
 
659
PNG_INFO_sBIT equ 0x0002
660
PNG_INFO_cHRM equ 0x0004
661
PNG_INFO_PLTE equ 0x0008
662
PNG_INFO_tRNS equ 0x0010
663
PNG_INFO_bKGD equ 0x0020
664
PNG_INFO_hIST equ 0x0040
665
PNG_INFO_pHYs equ 0x0080
666
PNG_INFO_oFFs equ 0x0100
667
PNG_INFO_tIME equ 0x0200
668
PNG_INFO_pCAL equ 0x0400
669
PNG_INFO_sRGB equ 0x0800 ; GR-P, 0.96a
670
PNG_INFO_iCCP equ 0x1000 ; ESR, 1.0.6
671
PNG_INFO_sPLT equ 0x2000 ; ESR, 1.0.6
672
PNG_INFO_sCAL equ 0x4000 ; ESR, 1.0.6
673
PNG_INFO_IDAT equ 0x8000 ; ESR, 1.0.6
674
675
 
676
; change these values for the row.  It also should enable using
677
; the routines for other purposes.
678
679
 
680
	width      dd ? ;uint_32 ;width of row
681
	rowbytes   dd ? ;png_size_t ;number of bytes in row
682
	color_type db ? ;byte ;color type of row
683
	bit_depth  db ? ;byte ;bit depth of row
684
	channels   db ? ;byte ;number of channels (1, 2, 3, or 4)
685
	pixel_depth db ? ;byte ;bits per pixel (depth * channels)
686
ends
687
688
 
689
; This must match the function definition in , and the application
690
; must include this before png.h to obtain the definition of jmp_buf.  The
691
; function is required to be PNG_NORETURN, but this is not checked.  If the
692
; function does return the application will crash via an abort() or similar
693
; system level call.
694
695
 
696
; changes to ensure that pnglibconf.h records the calling convention used by
697
; your compiler.  This may be very difficult - try using a different compiler
698
; to build the library!
699
700
 
701
end if
702
703
 
704
PNG_TRANSFORM_IDENTITY      equ 0x0000 ; read and write
705
PNG_TRANSFORM_STRIP_16      equ 0x0001 ; read only
706
PNG_TRANSFORM_STRIP_ALPHA   equ 0x0002 ; read only
707
PNG_TRANSFORM_PACKING       equ 0x0004 ; read and write
708
PNG_TRANSFORM_PACKSWAP      equ 0x0008 ; read and write
709
PNG_TRANSFORM_EXPAND        equ 0x0010 ; read only
710
PNG_TRANSFORM_INVERT_MONO   equ 0x0020 ; read and write
711
PNG_TRANSFORM_SHIFT         equ 0x0040 ; read and write
712
PNG_TRANSFORM_BGR           equ 0x0080 ; read and write
713
PNG_TRANSFORM_SWAP_ALPHA    equ 0x0100 ; read and write
714
PNG_TRANSFORM_SWAP_ENDIAN   equ 0x0200 ; read and write
715
PNG_TRANSFORM_INVERT_ALPHA  equ 0x0400 ; read and write
716
PNG_TRANSFORM_STRIP_FILLER  equ 0x0800 ; write only
717
; Added to libpng-1.2.34
718
PNG_TRANSFORM_STRIP_FILLER_BEFORE equ PNG_TRANSFORM_STRIP_FILLER
719
PNG_TRANSFORM_STRIP_FILLER_AFTER equ 0x1000 ; write only
720
; Added to libpng-1.4.0
721
PNG_TRANSFORM_GRAY_TO_RGB  equ 0x2000 ; read only
722
; Added to libpng-1.5.4
723
PNG_TRANSFORM_EXPAND_16    equ 0x4000 ;read only
724
;if INT_MAX >= 0x8000 ;else this might break
725
PNG_TRANSFORM_SCALE_16     equ 0x8000 ;read only
726
;end if
727
728
 
729
PNG_FLAG_MNG_EMPTY_PLTE    equ 0x01
730
PNG_FLAG_MNG_FILTER_64     equ 0x04
731
PNG_ALL_MNG_FEATURES       equ 0x05
732
733
 
734
; this allowed the zlib default functions to be used on Windows
735
; platforms.  In 1.5 the zlib default malloc (which just calls malloc and
736
; ignores the first argument) should be completely compatible with the
737
; following.
738
739
 
740
; Here are the function definitions most commonly used.  This is not
741
; the place to find out how to use libpng.  See libpng-manual.txt for the
742
; full explanation, see example.c for the summary.  This just provides
743
; a simple one line description of the use of each function.
744
745
 
746
; pngconf.h and in the *.dfn files in the scripts directory.
747
748
 
749
750
 
751
;                   *.def files. The ordinal value is only
752
;                   relevant when preprocessing png.h with
753
;                   the *.dfn files for building symbol table
754
;                   entries, and are removed by pngconf.h.
755
;       type:       return type of the function
756
;       name:       function name
757
;       args:       function arguments, with types
758
759
 
760
; the PNG_EXPORTA() macro instead.
761
762
 
763
764
 
765
;       attributes: function attributes
766
767
 
768
{
769
align 4
770
nam:
771
local .end_t
772
local .m_txt
773
jmp .end_t
774
	.m_txt db `nam,13,10,0
775
.end_t:
776
	stdcall dbg_print,txt_zv,.m_txt
777
ret
778
}
779
780
 
781
; png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
782
783
 
784
785
 
786
{
787
local .end0
788
	and eax,0xff
789
if PNG_USE_ABS eq 1
790
	add sum,128
791
	sub al,128 ;v - 128
792
	cmp al,128
793
	jl @f
794
		neg al
795
		inc al ;abs(v - 128)
796
	@@:
797
	sub sum,eax
798
else
799
	cmp eax,128
800
	jl @f
801
		add sum,256
802
		sub sum,eax
803
		jmp .end0
804
	@@:
805
		add sum,eax
806
	.end0:
807
end if
808
}
809
810
 
811
PNG_ERROR_ACTION_NONE equ 1
812
PNG_ERROR_ACTION_WARN equ 2
813
PNG_ERROR_ACTION_ERROR equ 3
814
PNG_RGB_TO_GRAY_DEFAULT equ (-1) ;for red/green coefficients
815
816
 
817
; of a PNG file are returned to the calling application when an alpha channel,
818
; or a tRNS chunk in a palette file, is present.
819
820
 
821
; datastream. The color samples in a PNG datastream are never premultiplied
822
; with the alpha samples.
823
824
 
825
; channel is a linear measure of the contribution of the pixel to the
826
; corresponding composited pixel, and the color channels are unassociated
827
; (not premultiplied).  The gamma encoded color channels must be scaled
828
; according to the contribution and to do this it is necessary to undo
829
; the encoding, scale the color values, perform the composition and reencode
830
; the values.  This is the 'PNG' mode.
831
832
 
833
; storing color channel values that have been scaled by the alpha.
834
; image.  These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes
835
; (the latter being the two common names for associated alpha color channels).
836
837
 
838
; value is equal to the maximum value.
839
840
 
841
; broken because, in practice, no implementation that uses this choice
842
; correctly undoes the encoding before handling alpha composition.  Use this
843
; choice only if other serious errors in the software or hardware you use
844
; mandate it; the typical serious error is for dark halos to appear around
845
; opaque areas of the composited PNG image because of arithmetic overflow.
846
847
 
848
; with an enumerated 'mode' value and the gamma of the required output:
849
850
 
851
PNG_ALPHA_STANDARD     equ 1 ;according to Porter/Duff
852
PNG_ALPHA_ASSOCIATED   equ 1 ;as above; this is the normal practice
853
PNG_ALPHA_PREMULTIPLIED equ 1 ;as above
854
PNG_ALPHA_OPTIMIZED    equ 2 ;'PNG' for opaque pixels, else 'STANDARD'
855
PNG_ALPHA_BROKEN       equ 3 ;the alpha channel is gamma encoded
856
857
 
858
; The output_gamma value is a screen gamma in libpng terminology: it expresses
859
; how to decode the output values, not how they are encoded.
860
861
 
862
PNG_GAMMA_MAC_18 equ -2       ;Old Mac '1.8' gamma and color space
863
PNG_GAMMA_sRGB   equ 220000   ;Television standards--matches sRGB gamma
864
PNG_GAMMA_LINEAR equ PNG_FP_1 ;Linear
865
end if
866
867
 
868
PNG_FILLER_BEFORE equ 0
869
PNG_FILLER_AFTER equ 1
870
871
 
872
873
 
874
; libpng-1.5.4 this API must not be called before the PNG file header has been
875
; read.  Doing so will result in unexpected behavior and possible warnings or
876
; errors if the PNG file contains a bKGD chunk.
877
878
 
879
PNG_BACKGROUND_GAMMA_UNKNOWN equ 0
880
PNG_BACKGROUND_GAMMA_SCREEN equ 1
881
PNG_BACKGROUND_GAMMA_FILE   equ 2
882
PNG_BACKGROUND_GAMMA_UNIQUE equ 3
883
end if
884
885
 
6779 IgorA 886
6733 IgorA 887
 
888
; library.  The following is the floating point variant.
889
890
 
6779 IgorA 891
6733 IgorA 892
 
893
; NOTE: this API simply sets the screen and file gamma values. It will
894
; therefore override the value for gamma in a PNG file if it is called after
895
; the file header has been read - use with care  - call before reading the PNG
896
; file for best results!
897
898
 
899
 
900
; ancillary and critical chunks, and whether to use the data contained
901
; therein.  Note that it is impossible to "discard" data in a critical
902
; chunk.  For versions prior to 0.90, the action was always error/quit,
903
; whereas in version 0.90 and later, the action for CRC errors in ancillary
904
; chunks is warn/discard.  These values should NOT be changed.
905
906
 
907
908
 
909
PNG_CRC_ERROR_QUIT   equ 1 ;error/quit          error/quit
910
PNG_CRC_WARN_DISCARD equ 2 ;(INVALID)           warn/discard data
911
PNG_CRC_WARN_USE     equ 3 ;warn/use data       warn/use data
912
PNG_CRC_QUIET_USE    equ 4 ;quiet/use data      quiet/use data
913
PNG_CRC_NO_CHANGE    equ 5 ;use current value   use current value
914
915
 
916
; are chosen so that they don't conflict with real filter types
917
; below, in case they are supplied instead of the #defined constants.
918
; These values should NOT be changed.
919
920
 
921
PNG_FILTER_NONE  equ 0x08
922
PNG_FILTER_SUB   equ 0x10
923
PNG_FILTER_UP    equ 0x20
924
PNG_FILTER_AVG   equ 0x40
925
PNG_FILTER_PAETH equ 0x80
926
PNG_FAST_FILTERS equ (PNG_FILTER_NONE or PNG_FILTER_SUB or PNG_FILTER_UP)
927
PNG_ALL_FILTERS  equ (PNG_FAST_FILTERS or PNG_FILTER_AVG or PNG_FILTER_PAETH)
928
929
 
930
; These defines should NOT be changed.
931
932
 
933
PNG_FILTER_VALUE_SUB  equ 1
934
PNG_FILTER_VALUE_UP   equ 2
935
PNG_FILTER_VALUE_AVG  equ 3
936
PNG_FILTER_VALUE_PAETH equ 4
937
PNG_FILTER_VALUE_LAST equ 5
938
939
 
940
PNG_FILTER_HEURISTIC_DEFAULT   equ 0 ;Currently "UNWEIGHTED"
941
PNG_FILTER_HEURISTIC_UNWEIGHTED equ 1 ;Used by libpng < 0.95
942
PNG_FILTER_HEURISTIC_WEIGHTED  equ 2 ;Experimental feature
943
PNG_FILTER_HEURISTIC_LAST      equ 3 ;Not a valid value
944
945
 
946
; handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,
947
; and call standard C I/O routines such as fread(), fwrite(), and
948
; fprintf().  These functions can be made to use other I/O routines
949
; at run time for those applications that need to handle I/O in a
950
; different manner by calling png_set_???_fn().  See libpng-manual.txt for
951
; more information.
952
953
 
954
 
955
PNG_EXPORT 78, void, png_set_read_fn, '(png_structrp png_ptr, voidp io_ptr, png_rw_ptr read_data_fn)'
956
957
 
958
 
959
; by libpng or by the application; this works on the png_info structure passed
960
; in, it does not change the state for other png_info structures.
961
962
 
963
; may result either in memory leaks or double free of allocated data.
964
965
 
966
PNG_DESTROY_WILL_FREE_DATA equ 1
967
PNG_SET_WILL_FREE_DATA equ 1
968
PNG_USER_WILL_FREE_DATA equ 2
969
; Flags for png_ptr->free_me and info_ptr->free_me
970
PNG_FREE_HIST equ 0x0008
971
PNG_FREE_ICCP equ 0x0010
972
PNG_FREE_SPLT equ 0x0020
973
PNG_FREE_ROWS equ 0x0040
974
PNG_FREE_PCAL equ 0x0080
975
PNG_FREE_SCAL equ 0x0100
976
if PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED eq 1
977
	PNG_FREE_UNKN equ 0x0200
978
end if
979
PNG_FREE_LIST equ 0x0400 ;removed in 1.6.0 because it is ignored
980
PNG_FREE_PLTE equ 0x1000
981
PNG_FREE_TRNS equ 0x2000
982
PNG_FREE_TEXT equ 0x4000
983
PNG_FREE_ALL  equ 0x7fff
984
PNG_FREE_MUL  equ 0x4220 ;PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN
985
986
 
987
; The same, but the chunk name is prepended to the error string.
988
;PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,
989
;    charp error_message), PNG_NORETURN);
990
991
 
992
; Fatal error in PNG image of libpng - can't continue
993
;PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);
994
;#  define png_chunk_error(s1,s2) png_err(s1)
995
;end if
996
997
 
998
PNG_EXPORT 106, void, png_chunk_warning, '(png_const_structrp png_ptr, charp warning_message)'
999
;#else
1000
;#  define png_warning(s1,s2) ((void)(s1))
1001
;#  define png_chunk_warning(s1,s2) ((void)(s1))
1002
1003
 
1004
; User can choose whether to handle as a fatal error or as a warning.
1005
PNG_EXPORT 107, void, png_benign_error, '(png_const_structrp png_ptr, charp warning_message)'
1006
1007
 
1008
; Same, chunk name is prepended to message (only during read)
1009
PNG_EXPORT 108, void, png_chunk_benign_error, '(png_const_structrp png_ptr, charp warning_message)'
1010
1011
 
1012
;#  ifdef PNG_ALLOW_BENIGN_ERRORS
1013
macro png_benign_error h,txt
1014
{
1015
	png_warning h,txt
1016
}
1017
;#    define png_chunk_benign_error png_chunk_warning
1018
;#  else
1019
;#    define png_benign_error png_error
1020
;#    define png_chunk_benign_error png_chunk_error
1021
;#  endif
1022
;end if
1023
1024
 
1025
 
1026
; specific unknown chunks.
1027
1028
 
1029
; ignored and the default was used, the per-chunk setting only had an effect on
1030
; write.  If you wish to have chunk-specific handling on read in code that must
1031
; work on earlier versions you must use a user chunk callback to specify the
1032
; desired handling (keep or discard.)
1033
1034
 
1035
; parameter is interpreted as follows:
1036
1037
 
1038
;    PNG_HANDLE_CHUNK_AS_DEFAULT:
1039
;       Known chunks: do normal libpng processing, do not keep the chunk (but
1040
;          see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
1041
;       Unknown chunks: for a specific chunk use the global default, when used
1042
;          as the default discard the chunk data.
1043
;    PNG_HANDLE_CHUNK_NEVER:
1044
;       Discard the chunk data.
1045
;    PNG_HANDLE_CHUNK_IF_SAFE:
1046
;       Keep the chunk data if the chunk is not critical else raise a chunk
1047
;       error.
1048
;    PNG_HANDLE_CHUNK_ALWAYS:
1049
;       Keep the chunk data.
1050
1051
 
1052
; below.  Notice that specifying "AS_DEFAULT" as a global default is equivalent
1053
; to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks
1054
; it simply resets the behavior to the libpng default.
1055
1056
 
1057
; The per-chunk handling is always used when there is a png_user_chunk_ptr
1058
; callback and the callback returns 0; the chunk is then always stored *unless*
1059
; it is critical and the per-chunk setting is other than ALWAYS.  Notice that
1060
; the global default is *not* used in this case.  (In effect the per-chunk
1061
; value is incremented to at least IF_SAFE.)
1062
1063
 
1064
; per-chunk defaults will be honored.  If you want to preserve the current
1065
; behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE
1066
; as the default - if you don't do this libpng 1.6 will issue a warning.
1067
1068
 
1069
; earlier simply return '1' (handled).
1070
1071
 
1072
;    If this is *not* set known chunks will always be handled by libpng and
1073
;    will never be stored in the unknown chunk list.  Known chunks listed to
1074
;    png_set_keep_unknown_chunks will have no effect.  If it is set then known
1075
;    chunks listed with a keep other than AS_DEFAULT will *never* be processed
1076
;    by libpng, in addition critical chunks must either be processed by the
1077
;    callback or saved.
1078
1079
 
1080
;    default handling for chunks that would otherwise be recognized the
1081
;    behavior of libpng transformations may well become incorrect!
1082
1083
 
1084
;    When writing chunks the options only apply to the chunks specified by
1085
;    png_set_unknown_chunks (below), libpng will *always* write known chunks
1086
;    required by png_set_ calls and will always write the core critical chunks
1087
;    (as required for PLTE).
1088
1089
 
1090
;    png_set_keep_unknown_chunks list to find the keep setting, this is then
1091
;    interpreted as follows:
1092
1093
 
1094
;       Write safe-to-copy chunks and write other chunks if the global
1095
;       default is set to _ALWAYS, otherwise don't write this chunk.
1096
;    PNG_HANDLE_CHUNK_NEVER:
1097
;       Do not write the chunk.
1098
;    PNG_HANDLE_CHUNK_IF_SAFE:
1099
;       Write the chunk if it is safe-to-copy, otherwise do not write it.
1100
;    PNG_HANDLE_CHUNK_ALWAYS:
1101
;       Write the chunk.
1102
1103
 
1104
; in read unknown chunks are not stored by default, in write they are written
1105
; by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different
1106
; - on write the safe-to-copy bit is checked, on read the critical bit is
1107
; checked and on read if the chunk is critical an error will be raised.
1108
1109
 
1110
; ===========
1111
;    If num_chunks is positive, then the "keep" parameter specifies the manner
1112
;    for handling only those chunks appearing in the chunk_list array,
1113
;    otherwise the chunk list array is ignored.
1114
1115
 
1116
;    unknown chunks, as described above.
1117
1118
 
1119
;    for handling all unknown chunks plus all chunks recognized by libpng
1120
;    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to
1121
;    be processed by libpng.
1122
1123
 
1124
 
1125
PNG_HANDLE_CHUNK_AS_DEFAULT  equ 0
1126
PNG_HANDLE_CHUNK_NEVER       equ 1
1127
PNG_HANDLE_CHUNK_IF_SAFE     equ 2
1128
PNG_HANDLE_CHUNK_ALWAYS      equ 3
1129
PNG_HANDLE_CHUNK_LAST        equ 4
1130
1131
 
1132
;PNG_REMOVED(200, bytep, png_get_io_chunk_name, (png_structrp png_ptr),
1133
;    PNG_DEPRECATED)
1134
1135
 
1136
PNG_IO_NONE        equ 0x0000 ; no I/O at this moment
1137
PNG_IO_READING     equ 0x0001 ; currently reading
1138
PNG_IO_WRITING     equ 0x0002 ; currently writing
1139
PNG_IO_SIGNATURE   equ 0x0010 ; currently at the file signature
1140
PNG_IO_CHUNK_HDR   equ 0x0020 ; currently at the chunk header
1141
PNG_IO_CHUNK_DATA  equ 0x0040 ; currently at the chunk data
1142
PNG_IO_CHUNK_CRC   equ 0x0080 ; currently at the chunk crc
1143
PNG_IO_MASK_OP     equ 0x000f ; current operation: reading/writing
1144
PNG_IO_MASK_LOC    equ 0x00f0 ; current location: sig/hdr/data/crc
1145
;end if /* IO_STATE */
1146
1147
 
1148
; libpng interlace handling is turned off the macros may be used to handle
1149
; interlaced images within the application.
1150
1151
 
6779 IgorA 1152
6733 IgorA 1153
 
1154
; full, image which appears in a given pass.  'pass' is in the range 0
1155
; to 6 and the result is in the range 0 to 7.
1156
1157
 
1158
{
1159
	push ebx ecx
1160
	mov eax,pass
1161
	mov ebx,eax
6779 IgorA 1162
	not eax
6733 IgorA 1163
	and eax,1
1164
	shr ebx,1
1165
	mov ecx,3
1166
	sub ecx,ebx
1167
	shl eax,cl
1168
	and eax,7
1169
	pop ecx ebx
1170
}
1171
macro PNG_PASS_START_COL pass
1172
{
1173
	push ebx ecx
1174
	mov eax,pass
1175
	mov ebx,eax
6779 IgorA 1176
	and eax,1
6733 IgorA 1177
	inc ebx
1178
	shr ebx,1
1179
	mov ecx,3
1180
	sub ecx,ebx
1181
	shl eax,cl
1182
	and eax,7
1183
	pop ecx ebx
1184
}
1185
1186
 
1187
; pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that
1188
; follows.  Note that ROW_OFFSET is the offset from one row to the next whereas
1189
; COL_OFFSET is from one column to the next, within a row.
1190
1191
 
1192
;#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))
1193
1194
 
1195
; pass.  This is expressed as a shift - effectively log2 of the number or
1196
; rows or columns in each 8x8 tile of the original image.
1197
1198
 
1199
{
1200
local .end0
1201
	mov eax,3
1202
	cmp pass,2
1203
	jle .end0
1204
		mov eax,8
1205
		sub eax,pass
1206
		shr eax,1
1207
	.end0:
1208
}
1209
macro PNG_PASS_COL_SHIFT pass
1210
{
1211
local .end0
1212
	mov eax,3
1213
	cmp pass,1
1214
	jle .end0
1215
		mov eax,7
1216
		sub eax,pass
1217
		shr eax,1
1218
	.end0:
1219
}
1220
1221
 
1222
; pass of an image given its height or width.  In fact these macros may
1223
; return non-zero even though the sub-image is empty, because the other
1224
; dimension may be empty for a small image.
1225
1226
 
1227
{
1228
push ecx
1229
push ebx
1230
	PNG_PASS_START_ROW pass
1231
	mov ebx,eax
1232
	PNG_PASS_ROW_SHIFT pass
1233
	mov ecx,eax
1234
	xor eax,eax
1235
	inc eax
1236
	shl eax,cl
1237
	dec eax
1238
	sub eax,ebx
1239
pop ebx
1240
	add eax,height
1241
	shr eax,cl
1242
pop ecx
1243
}
1244
macro PNG_PASS_COLS width, pass
1245
{
1246
push ecx
1247
push ebx
1248
	PNG_PASS_START_COL pass
1249
	mov ebx,eax
1250
	PNG_PASS_COL_SHIFT pass
1251
	mov ecx,eax
1252
	xor eax,eax
1253
	inc eax
1254
	shl eax,cl
1255
	dec eax
1256
	sub eax,ebx
1257
pop ebx
1258
	add eax,width
1259
	shr eax,cl
1260
pop ecx
1261
}
1262
1263
 
1264
; necessary to find the row in the output image given a row in an interlaced
1265
; image, so two more macros:
1266
1267
 
1268
;   (((y_in)<
1269
;#define PNG_COL_FROM_PASS_COL(x_in, pass) \
1270
;   (((x_in)<
1271
1272
 
1273
; or column is in a particular pass.  These use a common utility macro that
1274
; returns a mask for a given pass - the offset 'off' selects the row or
1275
; column version.  The mask has the appropriate bit set for each column in
1276
; the tile.
1277
1278
 
1279
;   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \
1280
;   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))
1281
1282
 
1283
;   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)
1284
;#define PNG_COL_IN_INTERLACE_PASS(x, pass) \
1285
;   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)
1286
1287
 
1288
; With these routines we avoid an integer divide, which will be slower on
1289
; most machines.  However, it does take more operations than the corresponding
1290
; divide method, so it may be slower on a few RISC systems.  There are two
1291
; shifts (by 8 or 16 bits) and an addition, versus a single integer divide.
1292
1293
 
1294
; 32768 are correct for the NODIV code; 127 and 32767 are correct for the
1295
; standard method.
1296
1297
 
1298
1299
 
1300
 
1301
1302
 
1303
;   {                                                     \
1304
;      uint_16 temp = (uint_16)((uint_16)(fg) \
1305
;          * (uint_16)(alpha)                         \
1306
;          + (uint_16)(bg)*(uint_16)(255          \
1307
;          - (uint_16)(alpha)) + 128);                \
1308
;      (composite) = (byte)(((temp + (temp >> 8)) >> 8) & 0xff); \
1309
;   }
1310
1311
 
1312
;   {                                                     \
1313
;      uint_32 temp = (uint_32)((uint_32)(fg) \
1314
;          * (uint_32)(alpha)                         \
1315
;          + (uint_32)(bg)*(65535                     \
1316
;          - (uint_32)(alpha)) + 32768);              \
1317
;      (composite) = (uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \
1318
;   }
1319
1320
 
1321
1322
 
1323
;   (composite) =                                                       \
1324
;       (byte)(0xff & (((uint_16)(fg) * (uint_16)(alpha) +  \
1325
;       (uint_16)(bg) * (uint_16)(255 - (uint_16)(alpha)) + \
1326
;       127) / 255))
1327
1328
 
1329
;   (composite) =                                                           \
1330
;       (uint_16)(0xffff & (((uint_32)(fg) * (uint_32)(alpha) + \
1331
;       (uint_32)(bg)*(uint_32)(65535 - (uint_32)(alpha)) +     \
1332
;       32767) / 65535))
1333
;end if /* READ_COMPOSITE_NODIV */
1334
1335
 
6779 IgorA 1336
; Inline macros to do direct reads of bytes from the input buffer.
6733 IgorA 1337
; The png_get_int_32() routine assumes we are using two's complement
1338
; format for negative values, which is almost certainly true.
1339
1340
 
1341
;   (((uint_32)(*(buf)) << 24) + \
1342
;    ((uint_32)(*((buf) + 1)) << 16) + \
1343
;    ((uint_32)(*((buf) + 2)) << 8) + \
1344
;    ((uint_32)(*((buf) + 3))))
1345
1346
 
1347
	; function) incorrectly returned a value of type uint_32.
1348
1349
 
1350
;   ((uint_16) \
1351
;    (((unsigned int)(*(buf)) << 8) + \
1352
;    ((unsigned int)(*((buf) + 1)))))
1353
1354
 
1355
;   ((int_32)((*(buf) & 0x80) \
1356
;    ? -((int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \
1357
;    : (int_32)png_get_uint_32(buf)))
1358
end if
6779 IgorA 1359
6733 IgorA 1360
 
1361
; Section 5: SIMPLIFIED API
1362
; *******************************************************************************
1363
1364
 
1365
; documentation) if you don't understand what follows.
1366
1367
 
1368
; itself.  It allows PNG files to be read into a very limited number of
1369
; in-memory bitmap formats or to be written from the same formats.  If these
1370
; formats do not accomodate your needs then you can, and should, use the more
1371
; sophisticated APIs above - these support a wide variety of in-memory formats
1372
; and a wide variety of sophisticated transformations to those formats as well
1373
; as a wide variety of APIs to manipulate ancillary information.
1374
1375
 
1376
1377
 
1378
;    version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL
1379
;    (this is REQUIRED, your program may crash if you don't do it.)
1380
; 2) Call the appropriate png_image_begin_read... function.
1381
; 3) Set the png_image 'format' member to the required sample format.
1382
; 4) Allocate a buffer for the image and, if required, the color-map.
1383
; 5) Call png_image_finish_read to read the image and, if required, the
1384
;    color-map into your buffers.
1385
1386
 
1387
; color types, bit depths, and interlace methods are acceptable, and the
1388
; input image is transformed as necessary to the requested in-memory format
1389
; during the png_image_finish_read() step.  The only caveat is that if you
1390
; request a color-mapped image from a PNG that is full-color or makes
1391
; complex use of an alpha channel the transformation is extremely lossy and the
1392
; result may look terrible.
1393
1394
 
1395
1396
 
1397
; 2) Initialize the members of the structure that describe the image, setting
1398
;    the 'format' member to the format of the image samples.
1399
; 3) Call the appropriate png_image_write... function with a pointer to the
1400
;    image and, if necessary, the color-map to write the PNG data.
1401
1402
 
1403
; when it is being read or defines the in-memory format of an image that you
1404
; need to write:
1405
1406
 
1407
;    defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
1408
1409
 
1410
1411
 
1412
	opaque  dd ? ;png_controlp ;Initialize to NULL, free with png_image_free
1413
	version dd ? ;uint_32  ;Set to PNG_IMAGE_VERSION
1414
	width   dd ? ;uint_32  ;Image width in pixels (columns)
1415
	height  dd ? ;uint_32  ;Image height in pixels (rows)
1416
	format  dd ? ;uint_32  ;Image format as defined below
1417
	flags   dd ? ;uint_32  ;A bit mask containing informational flags
1418
	colormap_entries dd ? ;uint_32 ;Number of entries in the color-map
1419
1420
 
1421
	; non-zero value and the 'message' field will contain a '\0' terminated
1422
	; string with the libpng error or warning message.  If both warnings and
1423
	; an error were encountered, only the error is recorded.  If there
1424
	; are multiple warnings, only the first one is recorded.
1425
1426
 
1427
	; a value as follows:
1428
1429
 
1430
PNG_IMAGE_ERROR equ 2
1431
1432
 
1433
; a failure in the API just called:
1434
1435
 
1436
;    1 - warning
1437
;    2 - error
1438
;    3 - error preceded by warning
1439
1440
 
1441
1442
 
1443
	message rb 64 ;char[64]
1444
ends
1445
1446
 
1447
; original values in the range 0 to 1.0:
1448
1449
 
1450
; 2: A gray/luminance channel and an alpha channel (GA).
1451
; 3: Three red, green, blue color channels (RGB).
1452
; 4: Three color channels and an alpha channel (RGBA).
1453
1454
 
1455
1456
 
1457
; alpha channel the original value is simply value/255.  For the color or
1458
; luminance channels the value is encoded according to the sRGB specification
1459
; and matches the 8-bit format expected by typical display devices.
1460
1461
 
1462
; channel and are suitable for passing to color management software.
1463
1464
 
1465
; channels can be converted to the original value by dividing by 65535; all
1466
; channels are linear.  Color channels use the RGB encoding (RGB end-points) of
1467
; the sRGB specification.  This encoding is identified by the
1468
; PNG_FORMAT_FLAG_LINEAR flag below.
1469
1470
 
1471
; the actual sRGB transfer curve defined in the sRGB specification (see the
1472
; article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
1473
; approximation used elsewhere in libpng.
1474
1475
 
1476
; of the color or luminance channels and is returned as an associated alpha
1477
; channel: the color/gray channels are scaled (pre-multiplied) by the alpha
1478
; value.
1479
1480
 
1481
; bytes per pixel according to the encoding, or are held in a color-map indexed
1482
; by bytes in the image data.  In the case of a color-map the color-map entries
1483
; are individual samples, encoded as above, and the image data has one byte per
1484
; pixel to select the relevant sample from the color-map.
1485
1486
 
1487
 
1488
1489
 
1490
; particular layout of sample data and, if present, alpha values.  There are
1491
; separate defines for each of the two component encodings.
1492
1493
 
1494
; valid.  Formats can be built up from the flag values or you can use one of
1495
; the predefined values below.  When testing formats always use the FORMAT_FLAG
1496
; macros to test for individual features - future versions of the library may
1497
; add new flags.
1498
1499
 
1500
; format of the entries in the color-map then png_image_{read,write}_colormap
1501
; called to read or write the color-map and set the format correctly for the
1502
; image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!
1503
1504
 
1505
; compiler errors because the definition of one of the following flags has been
1506
; compiled out it is because libpng does not have the required support.  It is
1507
; possible, however, for the libpng configuration to enable the format on just
1508
; read or just write; in that case you may see an error at run time.  You can
1509
; guard against this by checking for the definition of the appropriate
1510
; "_SUPPORTED" macro, one of:
1511
1512
 
1513
1514
 
1515
PNG_FORMAT_FLAG_COLOR    equ 0x02 ;color format: otherwise grayscale
1516
PNG_FORMAT_FLAG_LINEAR   equ 0x04 ;2-byte channels else 1-byte
1517
PNG_FORMAT_FLAG_COLORMAP equ 0x08 ;image data is color-mapped
1518
1519
 
1520
1521
 
1522
1523
 
1524
1525
 
1526
1527
 
1528
PNG_FORMAT_GA  equ PNG_FORMAT_FLAG_ALPHA
1529
PNG_FORMAT_AG  equ (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)
1530
PNG_FORMAT_RGB equ PNG_FORMAT_FLAG_COLOR
1531
PNG_FORMAT_BGR equ (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)
1532
PNG_FORMAT_RGBA equ (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)
1533
PNG_FORMAT_ARGB equ (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)
1534
PNG_FORMAT_BGRA equ (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)
1535
PNG_FORMAT_ABGR equ (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)
1536
1537
 
1538
; indicate a luminance (gray) channel.
1539
1540
 
1541
PNG_FORMAT_LINEAR_Y_ALPHA equ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)
1542
PNG_FORMAT_LINEAR_RGB equ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)
1543
PNG_FORMAT_LINEAR_RGB_ALPHA equ\
1544
	(PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)
1545
1546
 
1547
; is an index into the color-map which is formatted as above.  To obtain a
1548
; color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP
1549
; to one of the above definitions, or you can use one of the definitions below.
1550
1551
 
1552
PNG_FORMAT_BGR_COLORMAP equ (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)
1553
PNG_FORMAT_RGBA_COLORMAP equ (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)
1554
PNG_FORMAT_ARGB_COLORMAP equ (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)
1555
PNG_FORMAT_BGRA_COLORMAP equ (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)
1556
PNG_FORMAT_ABGR_COLORMAP equ (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)
1557
1558
 
1559
1560
 
1561
; structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the
1562
; actual image sample values - either the entries in the color-map or the
1563
; pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values
1564
; for the pixels and will always return 1 for color-mapped formats.  The
1565
; remaining macros return information about the rows in the image and the
1566
; complete image.
1567
1568
 
1569
; constants if the format parameter is, itself, a constant.  Therefore these
1570
; macros can be used in array declarations and case labels where required.
1571
; Similarly the macros are also pre-processor constants (sizeof is not used) so
1572
; they can be used in #if tests.
1573
1574
 
1575
1576
 
1577
{
1578
	mov eax,fmt
1579
	and eax,PNG_FORMAT_FLAG_COLOR or PNG_FORMAT_FLAG_ALPHA
1580
	inc eax
1581
}
1582
; Return the total number of channels in a given format: 1..4
1583
1584
 
1585
;   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)
1586
;   /* Return the size in bytes of a single component of a pixel or color-map
1587
; entry (as appropriate) in the image: 1 or 2.
1588
1589
 
1590
 
1591
;   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))
1592
;   /* This is the size of the sample data for one sample.  If the image is
1593
; color-mapped it is the size of one color-map entry (and image pixels are
1594
; one byte in size), otherwise it is the size of one image pixel.
1595
1596
 
1597
 
1598
;   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)
1599
;   /* The maximum size of the color-map required by the format expressed in a
1600
; count of components.  This can be used to compile-time allocate a
1601
; color-map:
1602
1603
 
1604
1605
 
1606
1607
 
1608
; information from one of the png_image_begin_read_ APIs and dynamically
1609
; allocate the required memory.
1610
1611
 
1612
 
1613
macro PNG_IMAGE_PIXEL_ p1,fmt
1614
{
1615
local .end0
1616
local .end1
1617
	mov eax,fmt
1618
	and eax,PNG_FORMAT_FLAG_COLORMAP
1619
	cmp eax,0
1620
	je .end0
1621
		xor eax,eax
1622
		inc eax
1623
		jmp .end1
1624
	.end0:
1625
		p1 fmt
1626
	.end1:
1627
}
1628
1629
 
1630
{
1631
	PNG_IMAGE_PIXEL_ PNG_IMAGE_SAMPLE_CHANNELS,fmt
1632
}
1633
; The number of separate channels (components) in a pixel; 1 for a
1634
; color-mapped image.
1635
1636
 
1637
 
1638
;   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)
1639
;   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped
1640
; image.
1641
1642
 
1643
 
1644
;   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */
1645
1646
 
1647
;#define PNG_IMAGE_ROW_STRIDE(image)\
1648
;   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)
1649
; Return the total number of components in a single row of the image; this
1650
; is the minimum 'row stride', the minimum count of components between each
1651
; row.  For a color-mapped image this is the minimum number of bytes in a
1652
; row.
1653
1654
 
1655
; and very large image widths.  libpng will refuse to process an image where
1656
; this macro would overflow.
1657
1658
 
1659
 
1660
;   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))
1661
; Return the size, in bytes, of an image buffer given a png_image and a row
1662
; stride - the number of components to leave space for in each row.
1663
1664
 
1665
; libpng will refuse to process an image where such an overflow would occur.
1666
1667
 
1668
 
1669
;   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))
1670
; Return the size, in bytes, of the image in memory given just a png_image;
1671
; the row stride is the minimum stride required for the image.
1672
1673
 
1674
 
1675
;   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)
1676
; Return the size, in bytes, of the color-map of this image.  If the image
1677
; format is not a color-map format this will return a size sufficient for
1678
; 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if
1679
; you don't want to allocate a color-map in this case.
1680
1681
 
1682
 
1683
1684
 
1685
; 'flags' field of png_image.
1686
1687
 
1688
; This indicates the the RGB values of the in-memory bitmap do not
1689
; correspond to the red, green and blue end-points defined by sRGB.
1690
1691
 
1692
; On write emphasise speed over compression; the resultant PNG file will be
1693
; larger but will be produced significantly faster, particular for large
1694
; images.  Do not use this option for images which will be distributed, only
1695
; used it when producing intermediate files that will be read back in
1696
; repeatedly.  For a typical 24-bit image the option will double the read
1697
; speed at the cost of increasing the image size by 25%, however for many
1698
; more compressible images the PNG file can be 10 times larger with only a
1699
; slight speed gain.
1700
1701
 
1702
; On read if the image is a 16-bit per component image and there is no gAMA
1703
; or sRGB chunk assume that the components are sRGB encoded.  Notice that
1704
; images output by the simplified API always have gamma information; setting
1705
; this flag only affects the interpretation of 16-bit images from an
1706
; external source.  It is recommended that the application expose this flag
1707
; to the user; the user can normally easily recognize the difference between
1708
; linear and sRGB encoding.  This flag has no effect on write - the data
1709
; passed to the write APIs must have the correct encoding (as defined
1710
; above.)
1711
1712
 
1713
; assumed to be linear.
1714
1715
 
1716
; because that call initializes the 'flags' field.
1717
1718
 
6779 IgorA 1719
; WRITE APIS
1720
; ----------
6733 IgorA 1721
; For write you must initialize a png_image structure to describe the image to
1722
; be written.  To do this use memset to set the whole structure to 0 then
1723
; initialize fields describing your image.
1724
1725
 
1726
; opaque: must be initialized to NULL
1727
; width: image width in pixels
1728
; height: image height in rows
1729
; format: the format of the data (image and color-map) you wish to write
1730
; flags: set to 0 unless one of the defined flags applies; set
1731
;    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB
1732
;    values do not correspond to the colors in sRGB.
1733
; colormap_entries: set to the number of entries in the color-map (0 to 256)
1734
1735
 
1736
; data then setting convert_to_8_bit will cause the output to be an 8-bit PNG
1737
; gamma encoded according to the sRGB specification, otherwise a 16-bit linear
1738
; encoded PNG file is written.
1739
1740
 
1741
; with at least image->colormap_entries encoded in the specified format.  If
1742
; the format is linear the written PNG color-map will be converted to sRGB
1743
; regardless of the convert_to_8_bit flag.
1744
1745
 
1746
; from one row to the next in component sized units (1 or 2 bytes) and if
1747
; negative indicates a bottom-up row layout in the buffer.  If row_stride is
1748
; zero, libpng will calculate it for you from the image width and number of
1749
; channels.
1750
1751
 
1752
; most ancillary chunks.  If you need to write text chunks (e.g. for copyright
1753
; notices) you need to use one of the other APIs.
1754
1755
 
1756
 
1757
;   row_stride, colormap)\
1758
;   png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\
1759
;         row_stride, colormap)
1760
; Return the amount of memory in 'size' required to compress this image.
1761
; The png_image structure 'image' must be filled in as in the above
1762
; function and must not be changed before the actual write call, the buffer
1763
; and all other parameters must also be identical to that in the final
1764
; write call.  The 'size' variable need not be initialized.
1765
1766
 
1767
; set to zero and the write failed and probably will fail if tried again.
1768
1769
 
1770
; regardless of the amount of compression achieved.  The buffer size will
1771
; always be bigger than the original image and it will never be filled.  The
1772
; following macros are provided to assist in allocating the buffer.
1773
1774
 
1775
; The number of uncompressed bytes in the PNG byte encoding of the image;
1776
; uncompressing the PNG IDAT data will give this number of bytes.
1777
1778
 
1779
; macro can because of the extra bytes used in the PNG byte encoding.  You
1780
; need to avoid this macro if your image size approaches 2^30 in width or
1781
; height.  The same goes for the remainder of these macros; they all produce
1782
; bigger numbers than the actual in-memory image size.
1783
1784
 
1785
;#  define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U)
1786
; An upper bound on the number of compressed bytes given 'b' uncompressed
1787
; bytes.  This is based on deflateBounds() in zlib; different
1788
; implementations of zlib compression may conceivably produce more data so
1789
; if your zlib implementation is not zlib itself redefine this macro
1790
; appropriately.
1791
1792
 
1793
1794
 
1795
;   PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image))
1796
	; An upper bound on the size of the data in the PNG IDAT chunks.
6779 IgorA 1797
1798
 
6733 IgorA 1799
;   ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\
1800
;    (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\
1801
;    12U+3U*(image).colormap_entries/*PLTE data*/+\
1802
;    (((image).format&PNG_FORMAT_FLAG_ALPHA)?\
1803
;    12U/*tRNS*/+(image).colormap_entries:0U):0U)+\
1804
;    12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size))
1805
6779 IgorA 1806
 
1807
; following macro use this one with the result of
6733 IgorA 1808
; PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most
1809
; compilers should handle this just fine.)
1810
1811
 
1812
;   PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image))
1813
; An upper bound on the total length of the PNG data stream for 'image'.
1814
; The result is of type png_alloc_size_t, on 32-bit systems this may
1815
; overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will
1816
; run out of buffer space but return a corrected size which should work.
1817
1818
 
6779 IgorA 1819
;/*******************************************************************************
6733 IgorA 1820
;  END OF SIMPLIFIED API
1821
; ******************************************************************************/
1822
;end if /* SIMPLIFIED_{READ|WRITE} */
1823
1824
 
1825
; Section 6: IMPLEMENTATION OPTIONS
1826
; *******************************************************************************
1827
1828
 
1829
; particular options to be turned on or off.  'Option' is the number of the
1830
; option and 'onoff' is 0 (off) or non-0 (on).  The value returned is given
1831
; by the PNG_OPTION_ defines below.
1832
1833
 
1834
;           are detected at run time, however sometimes it may be impossible
1835
;           to do this in user mode, in which case it is necessary to discover
1836
;           the capabilities in an OS specific way.  Such capabilities are
1837
;           listed here when libpng has support for them and must be turned
1838
;           ON by the application if present.
1839
1840
 
1841
;           decrease on some architectures or systems, or with some sets of
1842
;           PNG images.  'Software' options allow such optimizations to be
1843
;           selected at run time.
1844
1845
 
1846
if PNG_ARM_NEON_API_SUPPORTED eq 1
1847
	PNG_ARM_NEON  equ 0 ;HARDWARE: ARM Neon SIMD instructions supported
1848
end if
1849
PNG_MAXIMUM_INFLATE_WINDOW equ 2 ;SOFTWARE: force maximum window
1850
PNG_SKIP_sRGB_CHECK_PROFILE equ 4 ;SOFTWARE: Check ICC profile for sRGB
1851
if PNG_MIPS_MSA_API_SUPPORTED eq 1
1852
	PNG_MIPS_MSA  equ 6 ;HARDWARE: MIPS Msa SIMD instructions supported
1853
end if
1854
PNG_OPTION_NEXT equ 8 ;Next option - numbers must be even
1855
1856
 
1857
PNG_OPTION_UNSET  equ 0 ;Unset - defaults to off
1858
PNG_OPTION_INVALID equ 1 ;Option number out of range
1859
PNG_OPTION_OFF    equ 2
1860
PNG_OPTION_ON     equ 3
1861
end if ;SET_OPTION
1862
1863
 
1864
;  END OF HARDWARE AND SOFTWARE OPTIONS
1865
; ******************************************************************************/
1866
1867
 
1868
; defs, and in scripts/symbols.def.
1869
1870
 
1871
 
1872
; one to use is one more than this.)
1873
1874
 
1875
; Do not put anything past this line
1876