blob: da56273dcf1edca5e41d279ce7453ec0b87e3df2 [file] [log] [blame]
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -05001unit pngdef;
2
Glenn Randers-Pehrson1ef65b62000-05-12 06:19:53 -05003// Caution: this file is probably out of date.
4
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -05005interface
6
7const
Glenn Randers-Pehrsonfc4a1432000-05-17 17:39:34 -05008 PNG_LIBPNG_VER_STRING = '1.0.7beta14';
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -06009 PNG_LIBPNG_VER = 10007;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -050010
11type
12 png_uint_32 = Cardinal;
13 png_int_32 = Longint;
14 png_uint_16 = Word;
15 png_int_16 = Smallint;
16 png_byte = Byte;
17 png_size_t = png_uint_32;
18 png_charpp = ^png_charp;
19 png_charp = PChar;
20 float = single;
21 int = Integer;
22 png_bytepp = ^png_bytep;
23 png_bytep = ^png_byte;
24 png_uint_16p = ^png_uint_16;
25 png_uint_16pp = ^png_uint_16p;
26 png_voidp = pointer;
27 time_t = Longint;
28 png_doublep = ^png_double;
29 png_double = double;
30
31 user_error_ptr = Pointer;
32 png_error_ptrp = ^png_error_ptr;
33 png_error_ptr = procedure(png_ptr: Pointer; msg: Pointer);
34 stdcall;
35 png_rw_ptrp = ^png_rw_ptr;
36 png_rw_ptr = procedure(png_ptr: Pointer; data: Pointer;
37 length: png_size_t);
38 stdcall;
39 png_flush_ptrp = ^png_flush_ptr;
40 png_flush_ptr = procedure(png_ptr: Pointer);
41 stdcall;
42 png_progressive_info_ptrp = ^png_progressive_info_ptr;
43 png_progressive_info_ptr = procedure(png_ptr: Pointer;
44 info_ptr: Pointer);
45 stdcall;
46 png_progressive_end_ptrp = ^png_progressive_end_ptr;
47 png_progressive_end_ptr = procedure(png_ptr: Pointer;
48 info_ptr: Pointer);
49 stdcall;
50 png_progressive_row_ptrp = ^png_progressive_row_ptr;
51 png_progressive_row_ptr = procedure(png_ptr: Pointer;
52 data: Pointer; length: png_uint_32;
53 count: int);
54 stdcall;
55 png_read_status_ptr = procedure(png_ptr: Pointer;
56 row_number: png_uint_32; pass: int);
57 stdcall;
58 png_write_status_ptr = procedure(png_ptr: Pointer;
59 row_number: png_uint_32; pass: int);
60 stdcall;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -060061 png_user_chunk_ptr = procedure(png_ptr: Pointer;
62 data: png_unknown_chunkp);
63 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -050064 png_user_transform_ptr = procedure(png_ptr: Pointer;
65 row_info: Pointer; data: png_bytep);
66 stdcall;
67
68 png_colorpp = ^png_colorp;
69 png_colorp = ^png_color;
70 png_color = packed record
71 red, green, blue: png_byte;
72 end;
73
74 png_color_16pp = ^png_color_16p;
75 png_color_16p = ^png_color_16;
76 png_color_16 = packed record
77 index: png_byte; //used for palette files
78 red, green, blue: png_uint_16; //for use in red green blue files
79 gray: png_uint_16; //for use in grayscale files
80 end;
81
82 png_color_8pp = ^png_color_8p;
83 png_color_8p = ^png_color_8;
84 png_color_8 = packed record
85 red, green, blue: png_byte; //for use in red green blue files
86 gray: png_byte; //for use in grayscale files
87 alpha: png_byte; //for alpha channel files
88 end;
89
90 png_textpp = ^png_textp;
91 png_textp = ^png_text;
92 png_text = packed record
93 compression: int; //compression value
94 key: png_charp; //keyword, 1-79 character description of "text"
95 text: png_charp; //comment, may be empty ("")
96 text_length: png_size_t; //length of text field
97 end;
98
99 png_timepp = ^png_timep;
100 png_timep = ^png_time;
101 png_time = packed record
102 year: png_uint_16; //yyyy
103 month: png_byte; //1..12
104 day: png_byte; //1..31
105 hour: png_byte; //0..23
106 minute: png_byte; //0..59
107 second: png_byte; //0..60 (leap seconds)
108 end;
109
110 png_infopp = ^png_infop;
111 png_infop = Pointer;
112
113 png_row_infopp = ^png_row_infop;
114 png_row_infop = ^png_row_info;
115 png_row_info = packed record
116 width: png_uint_32; //width of row
117 rowbytes: png_size_t; //number of bytes in row
118 color_type: png_byte; //color type of row
119 bit_depth: png_byte; //bit depth of row
120 channels: png_byte; //number of channels (1, 2, 3, or 4)
121 pixel_depth: png_byte; //bits per pixel (depth * channels)
122 end;
123
124 png_structpp = ^png_structp;
125 png_structp = Pointer;
126
127const
128
129// Supported compression types for text in PNG files (tEXt, and zTXt).
130// The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed.
131
132 PNG_TEXT_COMPRESSION_NONE_WR = -3;
133 PNG_TEXT_COMPRESSION_zTXt_WR = -2;
134 PNG_TEXT_COMPRESSION_NONE = -1;
135 PNG_TEXT_COMPRESSION_zTXt = 0;
136
137// These describe the color_type field in png_info.
138// color type masks
139
140 PNG_COLOR_MASK_PALETTE = 1;
141 PNG_COLOR_MASK_COLOR = 2;
142 PNG_COLOR_MASK_ALPHA = 4;
143
144// color types. Note that not all combinations are legal
145
146 PNG_COLOR_TYPE_GRAY = 0;
147 PNG_COLOR_TYPE_PALETTE = PNG_COLOR_MASK_COLOR or
148 PNG_COLOR_MASK_PALETTE;
149 PNG_COLOR_TYPE_RGB = PNG_COLOR_MASK_COLOR;
150 PNG_COLOR_TYPE_RGB_ALPHA = PNG_COLOR_MASK_COLOR or
151 PNG_COLOR_MASK_ALPHA;
152 PNG_COLOR_TYPE_GRAY_ALPHA = PNG_COLOR_MASK_ALPHA;
153
154// This is for compression type. PNG 1.0 only defines the single type.
155
156 PNG_COMPRESSION_TYPE_BASE = 0; // Deflate method 8, 32K window
157 PNG_COMPRESSION_TYPE_DEFAULT = PNG_COMPRESSION_TYPE_BASE;
158
159// This is for filter type. PNG 1.0 only defines the single type.
160
161 PNG_FILTER_TYPE_BASE = 0; // Single row per-byte filtering
162 PNG_FILTER_TYPE_DEFAULT = PNG_FILTER_TYPE_BASE;
163
164// These are for the interlacing type. These values should NOT be changed.
165
166 PNG_INTERLACE_NONE = 0; // Non-interlaced image
167 PNG_INTERLACE_ADAM7 = 1; // Adam7 interlacing
168
169// These are for the oFFs chunk. These values should NOT be changed.
170
171 PNG_OFFSET_PIXEL = 0; // Offset in pixels
172 PNG_OFFSET_MICROMETER = 1; // Offset in micrometers (1/10^6 meter)
173
174// These are for the pCAL chunk. These values should NOT be changed.
175
176 PNG_EQUATION_LINEAR = 0; // Linear transformation
177 PNG_EQUATION_BASE_E = 1; // Exponential base e transform
178 PNG_EQUATION_ARBITRARY = 2; // Arbitrary base exponential transform
179 PNG_EQUATION_HYPERBOLIC = 3; // Hyperbolic sine transformation
180
181// These are for the pHYs chunk. These values should NOT be changed.
182
183 PNG_RESOLUTION_UNKNOWN = 0; // pixels/unknown unit (aspect ratio)
184 PNG_RESOLUTION_METER = 1; // pixels/meter
185
186// These are for the sRGB chunk. These values should NOT be changed.
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600187 PNG_sRGB_INTENT_PERCEPTUAL = 0;
188 PNG_sRGB_INTENT_RELATIVE = 1;
189 PNG_sRGB_INTENT_SATURATION = 2;
190 PNG_sRGB_INTENT_ABSOLUTE = 3;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500191
192// Handle alpha and tRNS by replacing with a background color.
193 PNG_BACKGROUND_GAMMA_UNKNOWN = 0;
194 PNG_BACKGROUND_GAMMA_SCREEN = 1;
195 PNG_BACKGROUND_GAMMA_FILE = 2;
196 PNG_BACKGROUND_GAMMA_UNIQUE = 3;
197
198// Values for png_set_crc_action() to say how to handle CRC errors in
199// ancillary and critical chunks, and whether to use the data contained
200// therein. Note that it is impossible to "discard" data in a critical
201// chunk. For versions prior to 0.90, the action was always error/quit,
202// whereas in version 0.90 and later, the action for CRC errors in ancillary
203// chunks is warn/discard. These values should NOT be changed.
204
205// value action:critical action:ancillary
206
207 PNG_CRC_DEFAULT = 0; // error/quit warn/discard data
208 PNG_CRC_ERROR_QUIT = 1; // error/quit error/quit
209 PNG_CRC_WARN_DISCARD = 2; // (INVALID) warn/discard data
210 PNG_CRC_WARN_USE = 3; // warn/use data warn/use data
211 PNG_CRC_QUIET_USE = 4; // quiet/use data quiet/use data
212 PNG_CRC_NO_CHANGE = 5; // use current value use current value
213
214// Flags for png_set_filter() to say which filters to use. The flags
215// are chosen so that they don't conflict with real filter types
216// below, in case they are supplied instead of the #defined constants.
217// These values should NOT be changed.
218
219 PNG_NO_FILTERS = $00;
220 PNG_FILTER_NONE = $08;
221 PNG_FILTER_SUB = $10;
222 PNG_FILTER_UP = $20;
223 PNG_FILTER_AVG = $40;
224 PNG_FILTER_PAETH = $80;
225 PNG_ALL_FILTERS = PNG_FILTER_NONE or PNG_FILTER_SUB or
226 PNG_FILTER_UP or PNG_FILTER_AVG or
227 PNG_FILTER_PAETH;
228
229// Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
230// These defines should NOT be changed.
231
232 PNG_FILTER_VALUE_NONE = 0;
233 PNG_FILTER_VALUE_SUB = 1;
234 PNG_FILTER_VALUE_UP = 2;
235 PNG_FILTER_VALUE_AVG = 3;
236 PNG_FILTER_VALUE_PAETH = 4;
237
238// Heuristic used for row filter selection. These defines should NOT be
239// changed.
240
241 PNG_FILTER_HEURISTIC_DEFAULT = 0; // Currently "UNWEIGHTED"
242 PNG_FILTER_HEURISTIC_UNWEIGHTED = 1; // Used by libpng < 0.95
243 PNG_FILTER_HEURISTIC_WEIGHTED = 2; // Experimental feature
244 PNG_FILTER_HEURISTIC_LAST = 3; // Not a valid value
245
246procedure png_build_grayscale_palette(bit_depth: int; palette: png_colorp);
247 stdcall;
248function png_check_sig(sig: png_bytep; num: int): int;
249 stdcall;
250procedure png_chunk_error(png_ptr: png_structp;
251 const mess: png_charp);
252 stdcall;
253procedure png_chunk_warning(png_ptr: png_structp;
254 const mess: png_charp);
255 stdcall;
256procedure png_convert_from_time_t(ptime: png_timep; ttime: time_t);
257 stdcall;
258function png_convert_to_rfc1123(png_ptr: png_structp; ptime: png_timep):
259 png_charp;
260 stdcall;
261function png_create_info_struct(png_ptr: png_structp): png_infop;
262 stdcall;
263function png_create_read_struct(user_png_ver: png_charp;
264 error_ptr: user_error_ptr; error_fn: png_error_ptr;
265 warn_fn: png_error_ptr): png_structp;
266 stdcall;
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600267function png_get_copyright(png_ptr: png_structp): png_charp;
268 stdcall;
Glenn Randers-Pehrson5379b241999-11-27 10:22:33 -0600269function png_get_header_ver(png_ptr: png_structp): png_charp;
270 stdcall;
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600271function png_get_header_version(png_ptr: png_structp): png_charp;
272 stdcall;
Glenn Randers-Pehrson5379b241999-11-27 10:22:33 -0600273function png_get_libpng_ver(png_ptr: png_structp): png_charp;
274 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500275function png_create_write_struct(user_png_ver: png_charp;
276 error_ptr: user_error_ptr; error_fn: png_error_ptr;
277 warn_fn: png_error_ptr): png_structp;
278 stdcall;
279procedure png_destroy_info_struct(png_ptr: png_structp;
280 info_ptr_ptr: png_infopp);
281 stdcall;
282procedure png_destroy_read_struct(png_ptr_ptr: png_structpp;
283 info_ptr_ptr, end_info_ptr_ptr: png_infopp);
284 stdcall;
285procedure png_destroy_write_struct(png_ptr_ptr: png_structpp;
286 info_ptr_ptr: png_infopp);
287 stdcall;
288function png_get_IHDR(png_ptr: png_structp; info_ptr: png_infop;
289 var width, height: png_uint_32; var bit_depth,
290 color_type, interlace_type, compression_type,
291 filter_type: int): png_uint_32;
292 stdcall;
293function png_get_PLTE(png_ptr: png_structp; info_ptr: png_infop;
294 var palette: png_colorp; var num_palette: int):
295 png_uint_32;
296 stdcall;
297function png_get_bKGD(png_ptr: png_structp; info_ptr: png_infop;
298 var background: png_color_16p): png_uint_32;
299 stdcall;
300function png_get_bit_depth(png_ptr: png_structp; info_ptr: png_infop):
301 png_byte;
302 stdcall;
303function png_get_cHRM(png_ptr: png_structp; info_ptr: png_infop;
304 var white_x, white_y, red_x, red_y, green_x, green_y,
305 blue_x, blue_y: double): png_uint_32;
306 stdcall;
307function png_get_channels(png_ptr: png_structp; info_ptr: png_infop):
308 png_byte;
309 stdcall;
310function png_get_color_type(png_ptr: png_structp; info_ptr: png_infop):
311 png_byte;
312 stdcall;
313function png_get_compression_type(png_ptr: png_structp;
314 info_ptr: png_infop): png_byte;
315 stdcall;
316function png_get_error_ptr(png_ptr: png_structp): png_voidp;
317 stdcall;
318function png_get_filter_type(png_ptr: png_structp; info_ptr: png_infop):
319 png_byte;
320 stdcall;
321function png_get_gAMA(png_ptr: png_structp; info_ptr: png_infop;
322 var file_gamma: double): png_uint_32;
323 stdcall;
324function png_get_hIST(png_ptr: png_structp; info_ptr: png_infop;
325 var hist: png_uint_16p): png_uint_32;
326 stdcall;
327function png_get_image_height(png_ptr: png_structp; info_ptr: png_infop):
328 png_uint_32;
329 stdcall;
330function png_get_image_width(png_ptr: png_structp; info_ptr: png_infop):
331 png_uint_32;
332 stdcall;
333function png_get_interlace_type(png_ptr: png_structp;
334 info_ptr: png_infop): png_byte;
335 stdcall;
336function png_get_io_ptr(png_ptr: png_structp): png_voidp;
337 stdcall;
338function png_get_oFFs(png_ptr: png_structp; info_ptr: png_infop;
339 var offset_x, offset_y: png_uint_32;
340 var unit_type: int): png_uint_32;
341 stdcall;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600342function png_get_sCAL(png_ptr: png_structp; info_ptr: png_infop;
343 var unit:int; var width: png_uint_32; height: png_uint_32):
344 png_uint_32;
345 stdcall
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500346function png_get_pCAL(png_ptr: png_structp; info_ptr: png_infop;
347 var purpose: png_charp; var X0, X1: png_int_32;
348 var typ, nparams: int; var units: png_charp;
349 var params: png_charpp): png_uint_32;
350 stdcall;
351function png_get_pHYs(png_ptr: png_structp; info_ptr: png_infop;
352 var res_x, res_y: png_uint_32; var unit_type: int):
353 png_uint_32;
354 stdcall;
355function png_get_pixel_aspect_ratio(png_ptr: png_structp;
356 info_ptr: png_infop): float;
357 stdcall;
358function png_get_pixels_per_meter(png_ptr: png_structp;
359 info_ptr: png_infop): png_uint_32;
360 stdcall;
361function png_get_progressive_ptr(png_ptr: png_structp): png_voidp;
362 stdcall;
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600363function png_get_rgb_to_gray_status(png_ptr: png_structp);
364 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500365function png_get_rowbytes(png_ptr: png_structp; info_ptr: png_infop):
366 png_uint_32;
367 stdcall;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600368function png_get_rows(png_ptr: png_structp; info_ptr: png_infop):
369 png_bytepp;
370 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500371function png_get_sBIT(png_ptr: png_structp; info_ptr: png_infop;
372 var sig_bits: png_color_8p): png_uint_32;
373 stdcall;
374function png_get_sRGB(png_ptr: png_structp; info_ptr: png_infop;
375 var file_srgb_intent: int): png_uint_32;
376 stdcall;
377function png_get_signature(png_ptr: png_structp; info_ptr: png_infop):
378 png_bytep;
379 stdcall;
380function png_get_tIME(png_ptr: png_structp; info_ptr: png_infop;
381 var mod_time: png_timep): png_uint_32;
382 stdcall;
383function png_get_tRNS(png_ptr: png_structp; info_ptr: png_infop;
384 var trans: png_bytep; var num_trans: int;
385 var trans_values: png_color_16p): png_uint_32;
386 stdcall;
387function png_get_text(png_ptr: png_structp; info_ptr: png_infop;
388 var text_ptr: png_textp; var num_text: int):
389 png_uint_32;
390 stdcall;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600391function png_get_user_chunk_ptr(png_ptr: png_structp):
392 png_voidp;
393 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500394function png_get_valid(png_ptr: png_structp; info_ptr: png_infop;
395 flag: png_uint_32): png_uint_32;
396 stdcall;
397function png_get_x_offset_microns(png_ptr: png_structp;
398 info_ptr: png_infop): png_uint_32;
399 stdcall;
400function png_get_x_offset_pixels(png_ptr: png_structp;
401 info_ptr: png_infop): png_uint_32;
402 stdcall;
403function png_get_x_pixels_per_meter(png_ptr: png_structp;
404 info_ptr: png_infop): png_uint_32;
405 stdcall;
406function png_get_y_offset_microns(png_ptr: png_structp;
407 info_ptr: png_infop): png_uint_32;
408 stdcall;
409function png_get_y_offset_pixels(png_ptr: png_structp;
410 info_ptr: png_infop): png_uint_32;
411 stdcall;
412function png_get_y_pixels_per_meter(png_ptr: png_structp;
413 info_ptr: png_infop): png_uint_32;
414 stdcall;
415procedure png_process_data(png_ptr: png_structp; info_ptr: png_infop;
416 buffer: png_bytep; buffer_size: png_size_t);
417 stdcall;
418procedure png_progressive_combine_row(png_ptr: png_structp;
419 old_row, new_row: png_bytep);
420 stdcall;
421procedure png_read_end(png_ptr: png_structp; info_ptr: png_infop);
422 stdcall;
423procedure png_read_image(png_ptr: png_structp; image: png_bytepp);
424 stdcall;
425procedure png_read_info(png_ptr: png_structp; info_ptr: png_infop);
426 stdcall;
427procedure png_read_row(png_ptr: png_structp; row, dsp_row: png_bytep);
428 stdcall;
429procedure png_read_rows(png_ptr: png_structp; row, display_row:
430 png_bytepp; num_rows: png_uint_32);
431 stdcall;
432procedure png_read_update_info(png_ptr: png_structp; info_ptr: png_infop);
433 stdcall;
434procedure png_set_IHDR(png_ptr: png_structp; info_ptr: png_infop;
435 width, height: png_uint_32; bit_depth, color_type,
436 interlace_type, compression_type, filter_type: int);
437 stdcall;
438procedure png_set_PLTE(png_ptr: png_structp; info_ptr: png_infop;
439 palette: png_colorp; num_palette: int);
440 stdcall;
441procedure png_set_bKGD(png_ptr: png_structp; info_ptr: png_infop;
442 background: png_color_16p);
443 stdcall;
444procedure png_set_background(png_ptr: png_structp;
445 background_color: png_color_16p;
446 background_gamma_code, need_expand: int;
447 background_gamma: double);
448 stdcall;
449procedure png_set_bgr(png_ptr: png_structp);
450 stdcall;
451procedure png_set_cHRM(png_ptr: png_structp; info_ptr: png_infop;
452 white_x, white_y, red_x, red_y, green_x, green_y,
453 blue_x, blue_y: double);
454 stdcall;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600455procedure png_set_cHRM_fixed(png_ptr: png_structp; info_ptr: png_infop;
456 white_x, white_y, red_x, red_y, green_x, green_y,
457 blue_x, blue_y: png_fixed_point);
458 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500459procedure png_set_compression_level(png_ptr: png_structp; level: int);
460 stdcall;
461procedure png_set_compression_mem_level(png_ptr: png_structp;
462 mem_level: int);
463 stdcall;
464procedure png_set_compression_method(png_ptr: png_structp; method: int);
465 stdcall;
466procedure png_set_compression_strategy(png_ptr: png_structp;
467 strategy: int);
468 stdcall;
469procedure png_set_compression_window_bits(png_ptr: png_structp;
470 window_bits: int);
471 stdcall;
472procedure png_set_crc_action(png_ptr: png_structp;
473 crit_action, ancil_action: int);
474 stdcall;
475procedure png_set_dither(png_ptr: png_structp; plaette: png_colorp;
476 num_palette, maximum_colors: int;
477 histogram: png_uint_16p; full_dither: int);
478 stdcall;
479procedure png_set_error_fn(png_ptr: png_structp; error_ptr: png_voidp;
480 error_fn, warning_fn: png_error_ptr);
481 stdcall;
482procedure png_set_expand(png_ptr: png_structp);
483 stdcall;
484procedure png_set_filler(png_ptr: png_structp; filler: png_uint_32;
485 filler_loc: int);
486 stdcall;
487procedure png_set_filter(png_ptr: png_structp; method, filters: int);
488 stdcall;
489procedure png_set_filter_heuristics(png_ptr: png_structp;
490 heuristic_method, num_weights: int;
491 filter_weights, filter_costs: png_doublep);
492 stdcall;
493procedure png_set_flush(png_ptr: png_structp; nrows: int);
494 stdcall;
495procedure png_set_gAMA(png_ptr: png_structp; info_ptr: png_infop;
496 file_gamma: double);
497 stdcall;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600498procedure png_set_gAMA_fixed(png_ptr: png_structp; info_ptr: png_infop;
499 file_gamma: png_fixed_point);
500 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500501procedure png_set_gamma(png_ptr: png_structp; screen_gamma,
502 default_file_gamma: double);
503 stdcall;
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500504procedure png_set_gray_1_2_4_to_8(png_ptr: png_structp);
505 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500506procedure png_set_gray_to_rgb(png_ptr: png_structp);
507 stdcall;
508procedure png_set_hIST(png_ptr: png_structp; info_ptr: png_infop;
509 hist: png_uint_16p);
510 stdcall;
511function png_set_interlace_handling(png_ptr: png_structp): int;
512 stdcall;
Glenn Randers-Pehrsonfc4a1432000-05-17 17:39:34 -0500513procedure png_set_invalid(png_ptr: png_structp; info_ptr:png_infop;
514 mask: int);
515 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500516procedure png_set_invert_alpha(png_ptr: png_structp);
517 stdcall;
518procedure png_set_invert_mono(png_ptr: png_structp);
519 stdcall;
520procedure png_set_oFFs(png_ptr: png_structp; info_ptr: png_infop;
521 offset_x, offset_y: png_uint_32; unit_type: int);
522 stdcall;
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500523procedure png_set_palette_to_rgb(png_ptr: png_structp);
524 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500525procedure png_set_pCAL(png_ptr: png_structp; info_ptr: png_infop;
526 purpose: png_charp; X0, X1: png_int_32;
527 typ, nparams: int; units: png_charp;
528 params: png_charpp);
529 stdcall;
530procedure png_set_pHYs(png_ptr: png_structp; info_ptr: png_infop;
531 res_x, res_y: png_uint_32; unit_type: int);
532 stdcall;
533procedure png_set_packing(png_ptr: png_structp);
534 stdcall;
535procedure png_set_packswap(png_ptr: png_structp);
536 stdcall;
537procedure png_set_progressive_read_fn(png_ptr: png_structp;
538 progressive_ptr: png_voidp;
539 info_fn: png_progressive_info_ptr;
540 row_fn: png_progressive_row_ptr;
541 end_fn: png_progressive_end_ptr);
542 stdcall;
543procedure png_set_read_fn(png_ptr: png_structp;
544 io_ptr: png_voidp; read_data_fn: png_rw_ptr);
545 stdcall;
546procedure png_set_read_status_fn(png_ptr: png_structp;
547 read_row_fn: png_read_status_ptr);
548 stdcall;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600549procedure png_set_read_user_chunk_fn(png_ptr: png_structp;
550 read_user_chunk_fn: png_user_chunk_ptr);
551 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500552procedure png_set_read_user_transform_fn(png_ptr: png_structp;
553 read_user_transform_fn: png_user_transform_ptr);
554 stdcall;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600555procedure png_set_rgb_to_gray(png_ptr: png_structp; int: error_action;
556 red_weight, green_weight: double);
557 stdcall;
558procedure png_set_rgb_to_gray_fixed(png_ptr: png_structp; int: error_action;
559 red_weight, green_weight: png_fixed_point);
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600560 stdcall;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600561procedure png_set_rows(png_ptr: png_structp; info_ptr: png_infop;
562 row_pointers: png_bytepp);
563 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500564procedure png_set_sBIT(png_ptr: png_structp; info_ptr: png_infop;
565 sig_bits: png_color_8p);
566 stdcall;
567procedure png_set_sRGB(png_ptr: png_structp; info_ptr: png_infop;
568 intent: int);
569 stdcall;
570procedure png_set_sRGB_gAMA_and_cHRM(png_ptr: png_structp;
571 info_ptr: png_infop; intent: int);
572 stdcall;
573procedure png_set_shift(png_ptr: png_structp; true_bits: png_color_8p);
574 stdcall;
575procedure png_set_sig_bytes(png_ptr: png_structp; num_bytes: int);
576 stdcall;
577procedure png_set_strip_16(png_ptr: png_structp);
578 stdcall;
579procedure png_set_strip_alpha(png_ptr: png_structp);
580 stdcall;
581procedure png_set_swap(png_ptr: png_structp);
582 stdcall;
583procedure png_set_swap_alpha(png_ptr: png_structp);
584 stdcall;
585procedure png_set_tIME(png_ptr: png_structp; info_ptr: png_infop;
586 mod_time: png_timep);
587 stdcall;
588procedure png_set_tRNS(png_ptr: png_structp; info_ptr: png_infop;
589 trans: png_bytep; num_trans: int;
590 trans_values: png_color_16p);
591 stdcall;
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500592procedure png_set_tRNS_to_alpha(png_ptr: png_structp);
593 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500594procedure png_set_text(png_ptr: png_structp; info_ptr: png_infop;
595 text_ptr: png_textp; num_text: int);
596 stdcall;
597procedure png_set_write_fn(png_ptr: png_structp;
598 io_ptr: png_voidp; write_data_fn: png_rw_ptr;
599 output_flush_fn: png_flush_ptr);
600 stdcall;
601procedure png_set_write_status_fn(png_ptr: png_structp;
602 write_row_fn: png_write_status_ptr);
603 stdcall;
604procedure png_set_write_user_transform_fn(png_ptr: png_structp;
605 write_user_transform_fn: png_user_transform_ptr);
606 stdcall;
607function png_sig_cmp(sig: png_bytep; start, num_to_check: png_size_t):
608 int;
609 stdcall;
610procedure png_start_read_image(png_ptr: png_structp);
611 stdcall;
612procedure png_write_chunk(png_ptr: png_structp;
613 chunk_name, data: png_bytep; length: png_size_t);
614 stdcall;
615procedure png_write_chunk_data(png_ptr: png_structp;
616 data: png_bytep; length: png_size_t);
617 stdcall;
618procedure png_write_chunk_end(png_ptr: png_structp);
619 stdcall;
620procedure png_write_chunk_start(png_ptr: png_structp;
621 chunk_name: png_bytep; length: png_uint_32);
622 stdcall;
623procedure png_write_end(png_ptr: png_structp; info_ptr: png_infop);
624 stdcall;
625procedure png_write_flush(png_ptr: png_structp);
626 stdcall;
627procedure png_write_image(png_ptr: png_structp; image: png_bytepp);
628 stdcall;
629procedure png_write_info(png_ptr: png_structp; info_ptr: png_infop);
630 stdcall;
Glenn Randers-Pehrson5379b241999-11-27 10:22:33 -0600631procedure png_write_info_before_PLTE(png_ptr: png_structp; info_ptr: png_infop);
632 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500633procedure png_write_row(png_ptr: png_structp; row: png_bytep);
634 stdcall;
635procedure png_write_rows(png_ptr: png_structp; row: png_bytepp;
636 num_rows: png_uint_32);
637 stdcall;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600638procedure png_get_iCCP(png_ptr: png_structp; info_ptr: png_infop;
639 name: png_charpp; compression_type: int *; profile: png_charpp;
640 proflen: png_int_32): png_bytep;
641 stdcall;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600642procedure png_get_sPLT(png_ptr: png_structp;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600643 info_ptr: png_infop; entries: png_spalette_pp): png_uint_32;
644 stdcall;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600645procedure png_set_iCCP(png_ptr: png_structp; info_ptr: png_infop;
646 name: png_charp; compression_type: int; profile: png_charp;
647 proflen: int);
648 stdcall;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600649procedure png_free_data(png_ptr: png_structp; info_ptr: png_infop; num: int);
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600650 stdcall;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600651procedure png_set_sPLT(png_ptr: png_structp; info_ptr: png_infop;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600652 entries: png_spalette_p; nentries: int);
653 stdcall;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500654
655implementation
656
657const
658 pngDLL = 'png32bd.dll';
659
660procedure png_build_grayscale_palette; external pngDLL;
661function png_check_sig; external pngDLL;
662procedure png_chunk_error; external pngDLL;
663procedure png_chunk_warning; external pngDLL;
664procedure png_convert_from_time_t; external pngDLL;
665function png_convert_to_rfc1123; external pngDLL;
666function png_create_info_struct; external pngDLL;
667function png_create_read_struct; external pngDLL;
668function png_create_write_struct; external pngDLL;
669procedure png_destroy_info_struct; external pngDLL;
670procedure png_destroy_read_struct; external pngDLL;
671procedure png_destroy_write_struct; external pngDLL;
672function png_get_IHDR; external pngDLL;
673function png_get_PLTE; external pngDLL;
674function png_get_bKGD; external pngDLL;
675function png_get_bit_depth; external pngDLL;
676function png_get_cHRM; external pngDLL;
677function png_get_channels; external pngDLL;
678function png_get_color_type; external pngDLL;
679function png_get_compression_type; external pngDLL;
680function png_get_error_ptr; external pngDLL;
681function png_get_filter_type; external pngDLL;
682function png_get_gAMA; external pngDLL;
683function png_get_hIST; external pngDLL;
684function png_get_image_height; external pngDLL;
685function png_get_image_width; external pngDLL;
686function png_get_interlace_type; external pngDLL;
687function png_get_io_ptr; external pngDLL;
688function png_get_oFFs; external pngDLL;
689function png_get_pCAL; external pngDLL;
690function png_get_pHYs; external pngDLL;
691function png_get_pixel_aspect_ratio; external pngDLL;
692function png_get_pixels_per_meter; external pngDLL;
693function png_get_progressive_ptr; external pngDLL;
694function png_get_rowbytes; external pngDLL;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600695function png_get_rows; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500696function png_get_sBIT; external pngDLL;
697function png_get_sRGB; external pngDLL;
698function png_get_signature; external pngDLL;
699function png_get_tIME; external pngDLL;
700function png_get_tRNS; external pngDLL;
701function png_get_text; external pngDLL;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600702function png_get_user_chunk_ptr; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500703function png_get_valid; external pngDLL;
704function png_get_x_offset_microns; external pngDLL;
705function png_get_x_offset_pixels; external pngDLL;
706function png_get_x_pixels_per_meter; external pngDLL;
707function png_get_y_offset_microns; external pngDLL;
708function png_get_y_offset_pixels; external pngDLL;
709function png_get_y_pixels_per_meter; external pngDLL;
710procedure png_process_data; external pngDLL;
711procedure png_progressive_combine_row; external pngDLL;
712procedure png_read_end; external pngDLL;
713procedure png_read_image; external pngDLL;
714procedure png_read_info; external pngDLL;
715procedure png_read_row; external pngDLL;
716procedure png_read_rows; external pngDLL;
717procedure png_read_update_info; external pngDLL;
718procedure png_set_IHDR; external pngDLL;
719procedure png_set_PLTE; external pngDLL;
720procedure png_set_bKGD; external pngDLL;
721procedure png_set_background; external pngDLL;
722procedure png_set_bgr; external pngDLL;
723procedure png_set_cHRM; external pngDLL;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600724procedure png_set_cHRM_fixed; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500725procedure png_set_compression_level; external pngDLL;
726procedure png_set_compression_mem_level; external pngDLL;
727procedure png_set_compression_method; external pngDLL;
728procedure png_set_compression_strategy; external pngDLL;
729procedure png_set_compression_window_bits; external pngDLL;
730procedure png_set_crc_action; external pngDLL;
731procedure png_set_dither; external pngDLL;
732procedure png_set_error_fn; external pngDLL;
733procedure png_set_expand; external pngDLL;
734procedure png_set_filler; external pngDLL;
735procedure png_set_filter; external pngDLL;
736procedure png_set_filter_heuristics; external pngDLL;
737procedure png_set_flush; external pngDLL;
738procedure png_set_gAMA; external pngDLL;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600739procedure png_set_gAMA_fixed; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500740procedure png_set_gamma; external pngDLL;
741procedure png_set_gray_to_rgb; external pngDLL;
742procedure png_set_hIST; external pngDLL;
743function png_set_interlace_handling; external pngDLL;
744procedure png_set_invert_alpha; external pngDLL;
745procedure png_set_invert_mono; external pngDLL;
746procedure png_set_oFFs; external pngDLL;
747procedure png_set_pCAL; external pngDLL;
748procedure png_set_pHYs; external pngDLL;
749procedure png_set_packing; external pngDLL;
750procedure png_set_packswap; external pngDLL;
751procedure png_set_progressive_read_fn; external pngDLL;
752procedure png_set_read_fn; external pngDLL;
753procedure png_set_read_status_fn; external pngDLL;
754procedure png_set_read_user_transform_fn; external pngDLL;
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -0600755procedure png_set_rgb_to_gray; external pngDLL;
756procedure png_set_rgb_to_gray_fixed; external pngDLL;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600757procedure png_set_rows; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500758procedure png_set_sBIT; external pngDLL;
759procedure png_set_sRGB; external pngDLL;
760procedure png_set_sRGB_gAMA_and_cHRM; external pngDLL;
761procedure png_set_shift; external pngDLL;
762procedure png_set_sig_bytes; external pngDLL;
763procedure png_set_strip_16; external pngDLL;
764procedure png_set_strip_alpha; external pngDLL;
765procedure png_set_swap; external pngDLL;
766procedure png_set_swap_alpha; external pngDLL;
767procedure png_set_tIME; external pngDLL;
768procedure png_set_tRNS; external pngDLL;
769procedure png_set_text; external pngDLL;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600770procedure png_set_user_chunk_fn; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500771procedure png_set_write_fn; external pngDLL;
772procedure png_set_write_status_fn; external pngDLL;
773procedure png_set_write_user_transform_fn; external pngDLL;
774function png_sig_cmp; external pngDLL;
775procedure png_start_read_image; external pngDLL;
776procedure png_write_chunk; external pngDLL;
777procedure png_write_chunk_data; external pngDLL;
778procedure png_write_chunk_end; external pngDLL;
779procedure png_write_chunk_start; external pngDLL;
780procedure png_write_end; external pngDLL;
781procedure png_write_flush; external pngDLL;
782procedure png_write_image; external pngDLL;
783procedure png_write_info; external pngDLL;
Glenn Randers-Pehrson5379b241999-11-27 10:22:33 -0600784procedure png_write_info_before_PLTE; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500785procedure png_write_row; external pngDLL;
786procedure png_write_rows; external pngDLL;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600787procedure png_get_iCCP; external pngDLL;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600788procedure png_get_sPLT; external pngDLL;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600789procedure png_set_iCCP; external pngDLL;
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600790procedure png_set_sPLT; external pngDLL;
791procedure png_free_data; external pngDLL;
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500792
793end.