Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
png.c
Go to the documentation of this file.
1 
2 /* png.c - location for general purpose libpng functions
3  *
4  * Last changed in libpng 1.2.54 [November 12, 2015]
5  * Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
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  * This code is released under the libpng license.
10  * For conditions of distribution and use, see the disclaimer
11  * and license in png.h
12  */
13 
14 #define PNG_INTERNAL
15 #define PNG_NO_EXTERN
16 #define PNG_NO_PEDANTIC_WARNINGS
17 #include "png.h"
18 
19 /* Generate a compiler error if there is an old png.h in the search path. */
21 
22 /* Version information for C files. This had better match the version
23  * string defined in png.h.
24  */
25 
26 #ifdef PNG_USE_GLOBAL_ARRAYS
27 /* png_libpng_ver was changed to a function in version 1.0.5c */
29 
30 #ifdef PNG_READ_SUPPORTED
31 
32 /* png_sig was changed to a function in version 1.0.5c */
33 /* Place to hold the signature string for a PNG file. */
34 PNG_CONST png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
35 #endif /* PNG_READ_SUPPORTED */
36 
37 /* Invoke global declarations for constant strings for known chunk types */
59 
60 #ifdef PNG_READ_SUPPORTED
61 /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
62 
63 /* Start of interlace block */
64 PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
65 
66 /* Offset to next interlace block */
67 PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
68 
69 /* Start of interlace block in the y direction */
70 PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
71 
72 /* Offset to next interlace block in the y direction */
73 PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
74 
75 /* Height of interlace block. This is not currently used - if you need
76  * it, uncomment it here and in png.h
77 PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
78 */
79 
80 /* Mask to determine which pixels are valid in a pass */
82  {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
83 
84 /* Mask to determine which pixels to overwrite while displaying */
86  = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
87 
88 #endif /* PNG_READ_SUPPORTED */
89 #endif /* PNG_USE_GLOBAL_ARRAYS */
90 
91 /* Tells libpng that we have already handled the first "num_bytes" bytes
92  * of the PNG file signature. If the PNG data is embedded into another
93  * stream we can set num_bytes = 8 so that libpng will not attempt to read
94  * or write any of the magic bytes before it starts on the IHDR.
95  */
96 
97 #ifdef PNG_READ_SUPPORTED
98 void PNGAPI
100 {
101  png_debug(1, "in png_set_sig_bytes");
102 
103  if (png_ptr == NULL)
104  return;
105 
106  if (num_bytes > 8)
107  png_error(png_ptr, "Too many bytes for PNG signature.");
108 
109  png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes);
110 }
111 
112 /* Checks whether the supplied bytes match the PNG signature. We allow
113  * checking less than the full 8-byte signature so that those apps that
114  * already read the first few bytes of a file to determine the file type
115  * can simply check the remaining bytes for extra assurance. Returns
116  * an integer less than, equal to, or greater than zero if sig is found,
117  * respectively, to be less than, to match, or be greater than the correct
118  * PNG signature (this is the same behaviour as strcmp, memcmp, etc).
119  */
120 int PNGAPI
122 {
123  png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
124  if (num_to_check > 8)
125  num_to_check = 8;
126  else if (num_to_check < 1)
127  return (-1);
128 
129  if (start > 7)
130  return (-1);
131 
132  if (start + num_to_check > 8)
133  num_to_check = 8 - start;
134 
135  return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
136 }
137 
138 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
139 /* (Obsolete) function to check signature bytes. It does not allow one
140  * to check a partial signature. This function might be removed in the
141  * future - use png_sig_cmp(). Returns true (nonzero) if the file is PNG.
142  */
143 int PNGAPI
145 {
146  return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num));
147 }
148 #endif
149 #endif /* PNG_READ_SUPPORTED */
150 
151 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
152 /* Function to allocate memory for zlib and clear it to 0. */
153 #ifdef PNG_1_0_X
155 #else
156 voidpf /* PRIVATE */
157 #endif
158 png_zalloc(voidpf png_ptr, uInt items, uInt size)
159 {
160  png_voidp ptr;
161  png_structp p;
162  png_uint_32 save_flags;
164 
165  if (png_ptr == NULL)
166  return (NULL);
167 
168  p=(png_structp)png_ptr;
169  save_flags=p->flags;
170 
171  if (items > PNG_UINT_32_MAX/size)
172  {
173  png_warning (p, "Potential overflow in png_zalloc()");
174  return (NULL);
175  }
176  num_bytes = (png_uint_32)items * size;
177 
178  p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
179  ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
180  p->flags=save_flags;
181 
182 #if defined(PNG_1_0_X) && !defined(PNG_NO_ZALLOC_ZERO)
183  if (ptr == NULL)
184  return ((voidpf)ptr);
185 
186  if (num_bytes > (png_uint_32)0x8000L)
187  {
188  png_memset(ptr, 0, (png_size_t)0x8000L);
189  png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0,
190  (png_size_t)(num_bytes - (png_uint_32)0x8000L));
191  }
192  else
193  {
194  png_memset(ptr, 0, (png_size_t)num_bytes);
195  }
196 #endif
197  return ((voidpf)ptr);
198 }
199 
200 /* Function to free memory for zlib */
201 #ifdef PNG_1_0_X
202 void PNGAPI
203 #else
204 void /* PRIVATE */
205 #endif
207 {
208  png_free((png_structp)png_ptr, (png_voidp)ptr);
209 }
210 
211 /* Reset the CRC variable to 32 bits of 1's. Care must be taken
212  * in case CRC is > 32 bits to leave the top bits 0.
213  */
214 void /* PRIVATE */
216 {
217  png_ptr->crc = crc32(0, Z_NULL, 0);
218 }
219 
220 /* Calculate the CRC over a section of data. We can only pass as
221  * much data to this routine as the largest single buffer size. We
222  * also check that this data will actually be used before going to the
223  * trouble of calculating it.
224  */
225 void /* PRIVATE */
227 {
228  int need_crc = 1;
229 
230  if (png_ptr->chunk_name[0] & 0x20) /* ancillary */
231  {
232  if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
233  (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
234  need_crc = 0;
235  }
236  else /* critical */
237  {
238  if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE)
239  need_crc = 0;
240  }
241 
242  if (need_crc)
243  png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length);
244 }
245 
246 /* Allocate the memory for an info_struct for the application. We don't
247  * really need the png_ptr, but it could potentially be useful in the
248  * future. This should be used in favour of malloc(png_sizeof(png_info))
249  * and png_info_init() so that applications that want to use a shared
250  * libpng don't have to be recompiled if png_info changes size.
251  */
254 {
256 
257  png_debug(1, "in png_create_info_struct");
258 
259  if (png_ptr == NULL)
260  return (NULL);
261 
262 #ifdef PNG_USER_MEM_SUPPORTED
263  info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
264  png_ptr->malloc_fn, png_ptr->mem_ptr);
265 #else
266  info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
267 #endif
268  if (info_ptr != NULL)
269  png_info_init_3(&info_ptr, png_sizeof(png_info));
270 
271  return (info_ptr);
272 }
273 
274 /* This function frees the memory associated with a single info struct.
275  * Normally, one would use either png_destroy_read_struct() or
276  * png_destroy_write_struct() to free an info struct, but this may be
277  * useful for some applications.
278  */
279 void PNGAPI
281 {
283 
284  png_debug(1, "in png_destroy_info_struct");
285 
286  if (png_ptr == NULL)
287  return;
288 
289  if (info_ptr_ptr != NULL)
290  info_ptr = *info_ptr_ptr;
291 
292  if (info_ptr != NULL)
293  {
294  png_info_destroy(png_ptr, info_ptr);
295 
296 #ifdef PNG_USER_MEM_SUPPORTED
297  png_destroy_struct_2((png_voidp)info_ptr, png_ptr->free_fn,
298  png_ptr->mem_ptr);
299 #else
300  png_destroy_struct((png_voidp)info_ptr);
301 #endif
302  *info_ptr_ptr = NULL;
303  }
304 }
305 
306 /* Initialize the info structure. This is now an internal function (0.89)
307  * and applications using it are urged to use png_create_info_struct()
308  * instead.
309  */
310 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
311 #undef png_info_init
312 void PNGAPI
314 {
315  /* We only come here via pre-1.0.12-compiled applications */
316  png_info_init_3(&info_ptr, 0);
317 }
318 #endif
319 
320 void PNGAPI
322 {
323  png_infop info_ptr = *ptr_ptr;
324 
325  png_debug(1, "in png_info_init_3");
326 
327  if (info_ptr == NULL)
328  return;
329 
330  if (png_sizeof(png_info) > png_info_struct_size)
331  {
332  png_destroy_struct(info_ptr);
333  info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
334  *ptr_ptr = info_ptr;
335  if (info_ptr == NULL)
336  return;
337  }
338 
339  /* Set everything to 0 */
340  png_memset(info_ptr, 0, png_sizeof(png_info));
341 }
342 
343 #ifdef PNG_FREE_ME_SUPPORTED
344 void PNGAPI
346  int freer, png_uint_32 mask)
347 {
348  png_debug(1, "in png_data_freer");
349 
350  if (png_ptr == NULL || info_ptr == NULL)
351  return;
352 
353  if (freer == PNG_DESTROY_WILL_FREE_DATA)
354  info_ptr->free_me |= mask;
355  else if (freer == PNG_USER_WILL_FREE_DATA)
356  info_ptr->free_me &= ~mask;
357  else
358  png_warning(png_ptr,
359  "Unknown freer parameter in png_data_freer.");
360 }
361 #endif
362 
363 void PNGAPI
365  int num)
366 {
367  png_debug(1, "in png_free_data");
368 
369  if (png_ptr == NULL || info_ptr == NULL)
370  return;
371 
372 #ifdef PNG_TEXT_SUPPORTED
373  /* Free text item num or (if num == -1) all text items */
374 #ifdef PNG_FREE_ME_SUPPORTED
375  if ((mask & PNG_FREE_TEXT) & info_ptr->free_me)
376 #else
377  if (mask & PNG_FREE_TEXT)
378 #endif
379  {
380  if (num != -1)
381  {
382  if (info_ptr->text && info_ptr->text[num].key)
383  {
384  png_free(png_ptr, info_ptr->text[num].key);
385  info_ptr->text[num].key = NULL;
386  }
387  }
388  else
389  {
390  int i;
391  for (i = 0; i < info_ptr->num_text; i++)
392  png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, i);
393  png_free(png_ptr, info_ptr->text);
394  info_ptr->text = NULL;
395  info_ptr->num_text=0;
396  }
397  }
398 #endif
399 
400 #ifdef PNG_tRNS_SUPPORTED
401  /* Free any tRNS entry */
402 #ifdef PNG_FREE_ME_SUPPORTED
403  if ((mask & PNG_FREE_TRNS) & info_ptr->free_me)
404 #else
405  if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
406 #endif
407  {
408  png_free(png_ptr, info_ptr->trans);
409  info_ptr->trans = NULL;
410  info_ptr->valid &= ~PNG_INFO_tRNS;
411 #ifndef PNG_FREE_ME_SUPPORTED
412  png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
413 #endif
414  }
415 #endif
416 
417 #ifdef PNG_sCAL_SUPPORTED
418  /* Free any sCAL entry */
419 #ifdef PNG_FREE_ME_SUPPORTED
420  if ((mask & PNG_FREE_SCAL) & info_ptr->free_me)
421 #else
422  if (mask & PNG_FREE_SCAL)
423 #endif
424  {
425 #if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
426  png_free(png_ptr, info_ptr->scal_s_width);
427  png_free(png_ptr, info_ptr->scal_s_height);
428  info_ptr->scal_s_width = NULL;
429  info_ptr->scal_s_height = NULL;
430 #endif
431  info_ptr->valid &= ~PNG_INFO_sCAL;
432  }
433 #endif
434 
435 #ifdef PNG_pCAL_SUPPORTED
436  /* Free any pCAL entry */
437 #ifdef PNG_FREE_ME_SUPPORTED
438  if ((mask & PNG_FREE_PCAL) & info_ptr->free_me)
439 #else
440  if (mask & PNG_FREE_PCAL)
441 #endif
442  {
443  png_free(png_ptr, info_ptr->pcal_purpose);
444  png_free(png_ptr, info_ptr->pcal_units);
445  info_ptr->pcal_purpose = NULL;
446  info_ptr->pcal_units = NULL;
447  if (info_ptr->pcal_params != NULL)
448  {
449  int i;
450  for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
451  {
452  png_free(png_ptr, info_ptr->pcal_params[i]);
453  info_ptr->pcal_params[i] = NULL;
454  }
455  png_free(png_ptr, info_ptr->pcal_params);
456  info_ptr->pcal_params = NULL;
457  }
458  info_ptr->valid &= ~PNG_INFO_pCAL;
459  }
460 #endif
461 
462 #ifdef PNG_iCCP_SUPPORTED
463  /* Free any iCCP entry */
464 #ifdef PNG_FREE_ME_SUPPORTED
465  if ((mask & PNG_FREE_ICCP) & info_ptr->free_me)
466 #else
467  if (mask & PNG_FREE_ICCP)
468 #endif
469  {
470  png_free(png_ptr, info_ptr->iccp_name);
471  png_free(png_ptr, info_ptr->iccp_profile);
472  info_ptr->iccp_name = NULL;
473  info_ptr->iccp_profile = NULL;
474  info_ptr->valid &= ~PNG_INFO_iCCP;
475  }
476 #endif
477 
478 #ifdef PNG_sPLT_SUPPORTED
479  /* Free a given sPLT entry, or (if num == -1) all sPLT entries */
480 #ifdef PNG_FREE_ME_SUPPORTED
481  if ((mask & PNG_FREE_SPLT) & info_ptr->free_me)
482 #else
483  if (mask & PNG_FREE_SPLT)
484 #endif
485  {
486  if (num != -1)
487  {
488  if (info_ptr->splt_palettes)
489  {
490  png_free(png_ptr, info_ptr->splt_palettes[num].name);
491  png_free(png_ptr, info_ptr->splt_palettes[num].entries);
492  info_ptr->splt_palettes[num].name = NULL;
493  info_ptr->splt_palettes[num].entries = NULL;
494  }
495  }
496  else
497  {
498  if (info_ptr->splt_palettes_num)
499  {
500  int i;
501  for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
502  png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i);
503 
504  png_free(png_ptr, info_ptr->splt_palettes);
505  info_ptr->splt_palettes = NULL;
506  info_ptr->splt_palettes_num = 0;
507  }
508  info_ptr->valid &= ~PNG_INFO_sPLT;
509  }
510  }
511 #endif
512 
513 #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
514  if (png_ptr->unknown_chunk.data)
515  {
516  png_free(png_ptr, png_ptr->unknown_chunk.data);
517  png_ptr->unknown_chunk.data = NULL;
518  }
519 
520 #ifdef PNG_FREE_ME_SUPPORTED
521  if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
522 #else
523  if (mask & PNG_FREE_UNKN)
524 #endif
525  {
526  if (num != -1)
527  {
528  if (info_ptr->unknown_chunks)
529  {
530  png_free(png_ptr, info_ptr->unknown_chunks[num].data);
531  info_ptr->unknown_chunks[num].data = NULL;
532  }
533  }
534  else
535  {
536  int i;
537 
538  if (info_ptr->unknown_chunks_num)
539  {
540  for (i = 0; i < (int)info_ptr->unknown_chunks_num; i++)
541  png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i);
542 
543  png_free(png_ptr, info_ptr->unknown_chunks);
544  info_ptr->unknown_chunks = NULL;
545  info_ptr->unknown_chunks_num = 0;
546  }
547  }
548  }
549 #endif
550 
551 #ifdef PNG_hIST_SUPPORTED
552  /* Free any hIST entry */
553 #ifdef PNG_FREE_ME_SUPPORTED
554  if ((mask & PNG_FREE_HIST) & info_ptr->free_me)
555 #else
556  if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
557 #endif
558  {
559  png_free(png_ptr, info_ptr->hist);
560  info_ptr->hist = NULL;
561  info_ptr->valid &= ~PNG_INFO_hIST;
562 #ifndef PNG_FREE_ME_SUPPORTED
563  png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
564 #endif
565  }
566 #endif
567 
568  /* Free any PLTE entry that was internally allocated */
569 #ifdef PNG_FREE_ME_SUPPORTED
570  if ((mask & PNG_FREE_PLTE) & info_ptr->free_me)
571 #else
572  if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
573 #endif
574  {
575  png_zfree(png_ptr, info_ptr->palette);
576  info_ptr->palette = NULL;
577  info_ptr->valid &= ~PNG_INFO_PLTE;
578 #ifndef PNG_FREE_ME_SUPPORTED
579  png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
580 #endif
581  info_ptr->num_palette = 0;
582  }
583 
584 #ifdef PNG_INFO_IMAGE_SUPPORTED
585  /* Free any image bits attached to the info structure */
586 #ifdef PNG_FREE_ME_SUPPORTED
587  if ((mask & PNG_FREE_ROWS) & info_ptr->free_me)
588 #else
589  if (mask & PNG_FREE_ROWS)
590 #endif
591  {
592  if (info_ptr->row_pointers)
593  {
594  int row;
595  for (row = 0; row < (int)info_ptr->height; row++)
596  {
597  png_free(png_ptr, info_ptr->row_pointers[row]);
598  info_ptr->row_pointers[row] = NULL;
599  }
600  png_free(png_ptr, info_ptr->row_pointers);
601  info_ptr->row_pointers = NULL;
602  }
603  info_ptr->valid &= ~PNG_INFO_IDAT;
604  }
605 #endif
606 
607 #ifdef PNG_FREE_ME_SUPPORTED
608  if (num == -1)
609  info_ptr->free_me &= ~mask;
610  else
611  info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL);
612 #endif
613 }
614 
615 /* This is an internal routine to free any memory that the info struct is
616  * pointing to before re-using it or freeing the struct itself. Recall
617  * that png_free() checks for NULL pointers for us.
618  */
619 void /* PRIVATE */
621 {
622  png_debug(1, "in png_info_destroy");
623 
624  png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
625 
626 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
627  if (png_ptr->num_chunk_list)
628  {
629  png_free(png_ptr, png_ptr->chunk_list);
630  png_ptr->chunk_list = NULL;
631  png_ptr->num_chunk_list = 0;
632  }
633 #endif
634 
635  png_info_init_3(&info_ptr, png_sizeof(png_info));
636 }
637 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
638 
639 /* This function returns a pointer to the io_ptr associated with the user
640  * functions. The application should free any memory associated with this
641  * pointer before png_write_destroy() or png_read_destroy() are called.
642  */
645 {
646  if (png_ptr == NULL)
647  return (NULL);
648  return (png_ptr->io_ptr);
649 }
650 
651 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
652 #ifdef PNG_STDIO_SUPPORTED
653 /* Initialize the default input/output functions for the PNG file. If you
654  * use your own read or write routines, you can call either png_set_read_fn()
655  * or png_set_write_fn() instead of png_init_io(). If you have defined
656  * PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't
657  * necessarily available.
658  */
659 void PNGAPI
661 {
662  png_debug(1, "in png_init_io");
663 
664  if (png_ptr == NULL)
665  return;
666 
667  png_ptr->io_ptr = (png_voidp)fp;
668 }
669 #endif
670 
671 #ifdef PNG_TIME_RFC1123_SUPPORTED
672 /* Convert the supplied time into an RFC 1123 string suitable for use in
673  * a "Creation Time" or other text-based time string.
674  */
677 {
678  static PNG_CONST char short_months[12][4] =
679  {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
680  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
681 
682  if (png_ptr == NULL)
683  return (NULL);
684 
685  if (png_ptr->time_buffer == NULL)
686  {
687  png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29*
688  png_sizeof(char)));
689  }
690 
691 #ifdef _WIN32_WCE
692  {
693  wchar_t time_buf[29];
694  wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
695  ptime->day % 32, short_months[(ptime->month - 1U) % 12],
696  ptime->year, ptime->hour % 24, ptime->minute % 60,
697  ptime->second % 61);
698  WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer,
699  29, NULL, NULL);
700  }
701 #else
702 #ifdef USE_FAR_KEYWORD
703  {
704  char near_time_buf[29];
705  png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000",
706  ptime->day % 32, short_months[(ptime->month - 1U) % 12],
707  ptime->year, ptime->hour % 24, ptime->minute % 60,
708  ptime->second % 61);
709  png_memcpy(png_ptr->time_buffer, near_time_buf,
710  29*png_sizeof(char));
711  }
712 #else
713  png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000",
714  ptime->day % 32, short_months[(ptime->month - 1U) % 12],
715  ptime->year, ptime->hour % 24, ptime->minute % 60,
716  ptime->second % 61);
717 #endif
718 #endif /* _WIN32_WCE */
719  return ((png_charp)png_ptr->time_buffer);
720 }
721 #endif /* PNG_TIME_RFC1123_SUPPORTED */
722 
723 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
724 
727 {
728  PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
729 #ifdef PNG_STRING_COPYRIGHT
730  return PNG_STRING_COPYRIGHT
731 #else
732 #ifdef __STDC__
733  return ((png_charp) PNG_STRING_NEWLINE \
734  "libpng version 1.2.56 - December 17, 2015" PNG_STRING_NEWLINE \
735  "Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson" \
737  "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
738  "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
740 #else
741  return ((png_charp) "libpng version 1.2.56 - December 17, 2015\
742  Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson\
743  Copyright (c) 1996-1997 Andreas Dilger\
744  Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
745 #endif
746 #endif
747 }
748 
749 /* The following return the library version as a short string in the
750  * format 1.0.0 through 99.99.99zz. To get the version of *.h files
751  * used with your application, print out PNG_LIBPNG_VER_STRING, which
752  * is defined in png.h.
753  * Note: now there is no difference between png_get_libpng_ver() and
754  * png_get_header_ver(). Due to the version_nn_nn_nn typedef guard,
755  * it is guaranteed that png.c uses the correct version of png.h.
756  */
759 {
760  /* Version of *.c files used when building libpng */
761  PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
762  return ((png_charp) PNG_LIBPNG_VER_STRING);
763 }
764 
767 {
768  /* Version of *.h files used when building libpng */
769  PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
770  return ((png_charp) PNG_LIBPNG_VER_STRING);
771 }
772 
775 {
776  /* Returns longer string containing both version and date */
777  PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
778 #ifdef __STDC__
780 #ifndef PNG_READ_SUPPORTED
781  " (NO READ SUPPORT)"
782 #endif
784 #else
786 #endif
787 }
788 
789 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
790 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
791 int PNGAPI
793 {
794  /* Check chunk_name and return "keep" value if it's on the list, else 0 */
795  int i;
796  png_bytep p;
797  if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list<=0)
798  return 0;
799  p = png_ptr->chunk_list + png_ptr->num_chunk_list*5 - 5;
800  for (i = png_ptr->num_chunk_list; i; i--, p -= 5)
801  if (!png_memcmp(chunk_name, p, 4))
802  return ((int)*(p + 4));
803  return 0;
804 }
805 #endif
806 
807 /* This function, added to libpng-1.0.6g, is untested. */
808 int PNGAPI
810 {
811  if (png_ptr == NULL)
812  return Z_STREAM_ERROR;
813  return (inflateReset(&png_ptr->zstream));
814 }
815 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
816 
817 /* This function was added to libpng-1.0.7 */
820 {
821  /* Version of *.c files used when building libpng */
822  return((png_uint_32) PNG_LIBPNG_VER);
823 }
824 
825 
826 #if defined(PNG_READ_SUPPORTED) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
827 #ifndef PNG_1_0_X
828 /* This function was added to libpng 1.2.0 */
829 int PNGAPI
831 {
832  /* Obsolete, to be removed from libpng-1.4.0 */
833  return -1;
834 }
835 #endif /* PNG_1_0_X */
836 #endif /* PNG_READ_SUPPORTED && PNG_ASSEMBLER_CODE_SUPPORTED */
837 
838 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
839 #ifdef PNG_SIZE_T
840 /* Added at libpng version 1.2.6 */
841  PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
843 png_convert_size(size_t size)
844 {
845  if (size > (png_size_t)-1)
846  PNG_ABORT(); /* We haven't got access to png_ptr, so no png_error() */
847  return ((png_size_t)size);
848 }
849 #endif /* PNG_SIZE_T */
850 
851 /* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */
852 #ifdef PNG_cHRM_SUPPORTED
853 #ifdef PNG_CHECK_cHRM_SUPPORTED
854 
855 /*
856  * Multiply two 32-bit numbers, V1 and V2, using 32-bit
857  * arithmetic, to produce a 64 bit result in the HI/LO words.
858  *
859  * A B
860  * x C D
861  * ------
862  * AD || BD
863  * AC || CB || 0
864  *
865  * where A and B are the high and low 16-bit words of V1,
866  * C and D are the 16-bit words of V2, AD is the product of
867  * A and D, and X || Y is (X << 16) + Y.
868 */
869 
870 void /* PRIVATE */
871 png_64bit_product (long v1, long v2, unsigned long *hi_product,
872  unsigned long *lo_product)
873 {
874  int a, b, c, d;
875  long lo, hi, x, y;
876 
877  a = (v1 >> 16) & 0xffff;
878  b = v1 & 0xffff;
879  c = (v2 >> 16) & 0xffff;
880  d = v2 & 0xffff;
881 
882  lo = b * d; /* BD */
883  x = a * d + c * b; /* AD + CB */
884  y = ((lo >> 16) & 0xffff) + x;
885 
886  lo = (lo & 0xffff) | ((y & 0xffff) << 16);
887  hi = (y >> 16) & 0xffff;
888 
889  hi += a * c; /* AC */
890 
891  *hi_product = (unsigned long)hi;
892  *lo_product = (unsigned long)lo;
893 }
894 
895 int /* PRIVATE */
900 {
901  int ret = 1;
902  unsigned long xy_hi,xy_lo,yx_hi,yx_lo;
903 
904  png_debug(1, "in function png_check_cHRM_fixed");
905 
906  if (png_ptr == NULL)
907  return 0;
908 
909  if (white_x < 0 || white_y <= 0 ||
910  red_x < 0 || red_y < 0 ||
911  green_x < 0 || green_y < 0 ||
912  blue_x < 0 || blue_y < 0)
913  {
914  png_warning(png_ptr,
915  "Ignoring attempt to set negative chromaticity value");
916  ret = 0;
917  }
918  if (white_x > (png_fixed_point) PNG_UINT_31_MAX ||
919  white_y > (png_fixed_point) PNG_UINT_31_MAX ||
920  red_x > (png_fixed_point) PNG_UINT_31_MAX ||
921  red_y > (png_fixed_point) PNG_UINT_31_MAX ||
922  green_x > (png_fixed_point) PNG_UINT_31_MAX ||
923  green_y > (png_fixed_point) PNG_UINT_31_MAX ||
924  blue_x > (png_fixed_point) PNG_UINT_31_MAX ||
925  blue_y > (png_fixed_point) PNG_UINT_31_MAX )
926  {
927  png_warning(png_ptr,
928  "Ignoring attempt to set chromaticity value exceeding 21474.83");
929  ret = 0;
930  }
931  if (white_x > 100000L - white_y)
932  {
933  png_warning(png_ptr, "Invalid cHRM white point");
934  ret = 0;
935  }
936  if (red_x > 100000L - red_y)
937  {
938  png_warning(png_ptr, "Invalid cHRM red point");
939  ret = 0;
940  }
941  if (green_x > 100000L - green_y)
942  {
943  png_warning(png_ptr, "Invalid cHRM green point");
944  ret = 0;
945  }
946  if (blue_x > 100000L - blue_y)
947  {
948  png_warning(png_ptr, "Invalid cHRM blue point");
949  ret = 0;
950  }
951 
952  png_64bit_product(green_x - red_x, blue_y - red_y, &xy_hi, &xy_lo);
953  png_64bit_product(green_y - red_y, blue_x - red_x, &yx_hi, &yx_lo);
954 
955  if (xy_hi == yx_hi && xy_lo == yx_lo)
956  {
957  png_warning(png_ptr,
958  "Ignoring attempt to set cHRM RGB triangle with zero area");
959  ret = 0;
960  }
961 
962  return ret;
963 }
964 #endif /* PNG_CHECK_cHRM_SUPPORTED */
965 #endif /* PNG_cHRM_SUPPORTED */
966 
967 void /* PRIVATE */
970  int color_type, int interlace_type, int compression_type,
971  int filter_type)
972 {
973  int error = 0;
974 
975  /* Check for width and height valid values */
976  if (width == 0)
977  {
978  png_warning(png_ptr, "Image width is zero in IHDR");
979  error = 1;
980  }
981 
982  if (height == 0)
983  {
984  png_warning(png_ptr, "Image height is zero in IHDR");
985  error = 1;
986  }
987 
988 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
989  if (width > png_ptr->user_width_max || width > PNG_USER_WIDTH_MAX)
990 #else
991  if (width > PNG_USER_WIDTH_MAX)
992 #endif
993  {
994  png_warning(png_ptr, "Image width exceeds user limit in IHDR");
995  error = 1;
996  }
997 
998 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
999  if (height > png_ptr->user_height_max || height > PNG_USER_HEIGHT_MAX)
1000 #else
1001  if (height > PNG_USER_HEIGHT_MAX)
1002 #endif
1003  {
1004  png_warning(png_ptr, "Image height exceeds user limit in IHDR");
1005  error = 1;
1006  }
1007 
1008  if (width > PNG_UINT_31_MAX)
1009  {
1010  png_warning(png_ptr, "Invalid image width in IHDR");
1011  error = 1;
1012  }
1013 
1014  if ( height > PNG_UINT_31_MAX)
1015  {
1016  png_warning(png_ptr, "Invalid image height in IHDR");
1017  error = 1;
1018  }
1019 
1020  /* Check other values */
1021  if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
1022  bit_depth != 8 && bit_depth != 16)
1023  {
1024  png_warning(png_ptr, "Invalid bit depth in IHDR");
1025  error = 1;
1026  }
1027 
1028  if (color_type < 0 || color_type == 1 ||
1029  color_type == 5 || color_type > 6)
1030  {
1031  png_warning(png_ptr, "Invalid color type in IHDR");
1032  error = 1;
1033  }
1034 
1035  if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) ||
1036  ((color_type == PNG_COLOR_TYPE_RGB ||
1037  color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
1038  color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8))
1039  {
1040  png_warning(png_ptr, "Invalid color type/bit depth combination in IHDR");
1041  error = 1;
1042  }
1043 
1044  if (interlace_type >= PNG_INTERLACE_LAST)
1045  {
1046  png_warning(png_ptr, "Unknown interlace method in IHDR");
1047  error = 1;
1048  }
1049 
1050  if (compression_type != PNG_COMPRESSION_TYPE_BASE)
1051  {
1052  png_warning(png_ptr, "Unknown compression method in IHDR");
1053  error = 1;
1054  }
1055 
1056 #ifdef PNG_MNG_FEATURES_SUPPORTED
1057  /* Accept filter_method 64 (intrapixel differencing) only if
1058  * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
1059  * 2. Libpng did not read a PNG signature (this filter_method is only
1060  * used in PNG datastreams that are embedded in MNG datastreams) and
1061  * 3. The application called png_permit_mng_features with a mask that
1062  * included PNG_FLAG_MNG_FILTER_64 and
1063  * 4. The filter_method is 64 and
1064  * 5. The color_type is RGB or RGBA
1065  */
1066  if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) &&
1067  png_ptr->mng_features_permitted)
1068  png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
1069 
1070  if (filter_type != PNG_FILTER_TYPE_BASE)
1071  {
1072  if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
1073  (filter_type == PNG_INTRAPIXEL_DIFFERENCING) &&
1074  ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) == 0) &&
1075  (color_type == PNG_COLOR_TYPE_RGB ||
1076  color_type == PNG_COLOR_TYPE_RGB_ALPHA)))
1077  {
1078  png_warning(png_ptr, "Unknown filter method in IHDR");
1079  error = 1;
1080  }
1081 
1082  if (png_ptr->mode & PNG_HAVE_PNG_SIGNATURE)
1083  {
1084  png_warning(png_ptr, "Invalid filter method in IHDR");
1085  error = 1;
1086  }
1087  }
1088 
1089 #else
1090  if (filter_type != PNG_FILTER_TYPE_BASE)
1091  {
1092  png_warning(png_ptr, "Unknown filter method in IHDR");
1093  error = 1;
1094  }
1095 #endif
1096 
1097  if (error == 1)
1098  png_error(png_ptr, "Invalid IHDR data");
1099 }
1100 #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
GLenum GLuint GLenum GLsizei length
GLint GLint GLsizei GLsizei height
PNG_CONST char png_libpng_ver[18]
Definition: png.c:28
#define PNG_INTERLACE_LAST
Definition: png.h:889
#define PNG_FREE_TEXT
Definition: png.h:1944
#define PNG_USER_WIDTH_MAX
Definition: pngconf.h:873
PNG_tRNS
Definition: png.c:57
PNG_CONST int FARDATA png_pass_start[]
Definition: png.c:64
unsigned int uInt
Definition: zconf.h:221
void png_zfree(voidpf png_ptr, voidpf ptr)
Definition: png.c:206
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
Definition: png.c:364
png_voidp png_create_struct(int type)
Definition: pngmem.c:348
#define Z_STREAM_ERROR
Definition: zlib.h:136
#define PNG_FREE_HIST
Definition: png.h:1934
PNG_PLTE
Definition: png.c:41
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat p
void PNGAPI png_info_init(png_infop info_ptr)
Definition: png.c:313
GLfloat GLfloat GLfloat v2
PNG_sRGB
Definition: png.c:54
png_infop PNGAPI png_create_info_struct(png_structp png_ptr)
Definition: png.c:253
png_infop double double double double double double double double * blue_y
Definition: png.h:2100
png_infop double double double double double double double * blue_x
Definition: png.h:2100
#define NULL
Definition: ftobjs.h:61
#define PNG_INFO_hIST
Definition: png.h:938
GLint GLint GLint GLint GLint GLint y
#define PNG_UINT_31_MAX
Definition: png.h:853
png_infopp info_ptr_ptr
Definition: png.h:1669
png_voidp ptr
Definition: png.h:1908
#define PNG_COLOR_TYPE_RGB
Definition: png.h:870
PNG_sPLT
Definition: png.c:53
#define PNG_COLOR_TYPE_GRAY_ALPHA
Definition: png.h:872
#define png_memcmp
Definition: pngconf.h:1660
png_byte FAR * png_bytep
Definition: pngconf.h:1328
#define png_memset
Definition: pngconf.h:1662
char FAR * png_charp
Definition: pngconf.h:1334
#define PNG_COLOR_TYPE_PALETTE
Definition: png.h:869
PNG_CONST int FARDATA png_pass_yinc[]
Definition: png.c:73
#define PNG_UNUSED(param)
Definition: pngconf.h:97
#define PNG_LIBPNG_VER_STRING
Definition: png.h:273
png_size_t png_size_t num_to_check
Definition: png.h:1367
GLuint start
int PNGAPI png_check_sig(png_bytep sig, int num)
Definition: png.c:144
png_charp PNGAPI png_get_libpng_ver(png_structp png_ptr)
Definition: png.c:758
GLint GLint GLsizei width
png_structp version_1_2_56
Definition: png.h:1343
void PNGAPI png_set_sig_bytes(png_structp png_ptr, int num_bytes)
Definition: png.c:99
#define PNG_FREE_PLTE
Definition: png.h:1942
GLint GLint GLint GLint GLint x
PNG_bKGD
Definition: png.c:42
#define PNG_COLOR_TYPE_RGB_ALPHA
Definition: png.h:871
#define PNG_FREE_ICCP
Definition: png.h:1935
int ZEXPORT inflateReset(z_streamp strm)
Definition: dummy_inflate.c:8
int PNGAPI png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
Definition: png.c:792
PNG_sCAL
Definition: png.c:50
PNG_cHRM
Definition: png.c:43
PNG_CONST int FARDATA png_pass_ystart[]
Definition: png.c:70
#define PNG_USER_HEIGHT_MAX
Definition: pngconf.h:876
GLboolean GLboolean GLboolean b
GLfloat GLfloat v1
png_uint_32 i
Definition: png.h:2640
png_infop double double double double * red_y
Definition: png.h:2100
int num_bytes
Definition: png.h:1360
void PNGAPI png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
Definition: png.c:321
void PNGAPI png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
Definition: png.c:280
voidpf png_zalloc(voidpf png_ptr, uInt items, uInt size)
Definition: png.c:158
png_bytep chunk_name
Definition: png.h:1412
PNG_zTXt
Definition: png.c:58
#define PNGARG(arglist)
Definition: pngconf.h:334
void png_calculate_crc(png_structp png_ptr, png_bytep ptr, png_size_t length)
Definition: png.c:226
GLenum GLenum GLvoid * row
png_FILE_p fp
Definition: png.h:1791
png_infop png_charpp int * compression_type
Definition: png.h:2230
PNG_IDAT
Definition: png.c:39
#define PNG_USER_WILL_FREE_DATA
Definition: png.h:1932
#define png_debug(l, m)
Definition: png.h:2461
#define PNGAPI
Definition: pngconf.h:1517
void png_check_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type)
Definition: png.c:968
png_struct FAR * png_structp
Definition: png.h:973
#define PNG_FREE_ROWS
Definition: png.h:1937
#define png_error(s1, s2)
Definition: pngusr.h:25
#define PNG_FREE_ALL
Definition: png.h:1945
void png_info_destroy(png_structp png_ptr, png_infop info_ptr)
Definition: png.c:620
GLenum GLint GLuint mask
PNG_pHYs
Definition: png.c:51
PNG_tEXt
Definition: png.c:55
png_time FAR * png_timep
Definition: png.h:546
#define PNG_CONST
Definition: pngconf.h:503
void png_destroy_struct(png_voidp struct_ptr)
Definition: pngmem.c:402
FT_Error error
Definition: cffdrivr.c:411
#define PNG_FREE_SPLT
Definition: png.h:1936
PNG_sBIT
Definition: png.c:52
png_timep ptime
Definition: png.h:1455
PNG_IHDR
Definition: png.c:38
unsigned char png_byte
Definition: pngconf.h:1251
#define png_memcpy
Definition: pngconf.h:1661
Byte FAR * voidpf
Definition: zconf.h:239
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
Definition: pngerror.c:111
int png_check_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y)
Definition: png.c:896
png_voidp PNGAPI png_get_io_ptr(png_structp png_ptr)
Definition: png.c:644
PNG_CONST int FARDATA png_pass_dsp_mask[]
Definition: png.c:86
PNG_IEND
Definition: png.c:40
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
#define Z_NULL
Definition: zlib.h:164
const GLubyte * c
#define PNG_UINT_32_MAX
Definition: png.h:854
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
Definition: crc32.c:204
#define PNG_READ_SUPPORTED
Definition: pngconf.h:121
#define PNG_FREE_UNKN
Definition: png.h:1940
int PNGAPI png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
Definition: png.c:121
PNG_tIME
Definition: png.c:56
PNG_gAMA
Definition: png.c:44
#define PNG_DESTROY_WILL_FREE_DATA
Definition: png.h:1930
png_charp PNGAPI png_get_header_ver(png_structp png_ptr)
Definition: png.c:766
#define PNG_FLAG_MNG_FILTER_64
Definition: png.h:1026
#define PNG_INFO_PLTE
Definition: png.h:935
#define FARDATA
Definition: pngconf.h:1319
PNG_hIST
Definition: png.c:45
PNG_iTXt
Definition: png.c:47
#define PNG_FILTER_TYPE_BASE
Definition: png.h:882
#define PNG_LIBPNG_VER
Definition: png.h:313
typedef int
Definition: png.h:978
PNG_CONST int FARDATA png_pass_inc[]
Definition: png.c:67
PNG_CONST png_byte FARDATA png_sig[8]
Definition: png.c:34
png_voidp png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
Definition: pngmem.c:358
#define png_snprintf6
Definition: pngconf.h:1645
PNG_CONST int FARDATA png_pass_mask[]
Definition: png.c:81
void PNGAPI png_data_freer(png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask)
Definition: png.c:345
#define PNG_INFO_IDAT
Definition: png.h:947
void png_64bit_product(long v1, long v2, unsigned long *hi_product, unsigned long *lo_product)
Definition: png.c:871
#define PNG_COMPRESSION_TYPE_BASE
Definition: png.h:878
png_charp PNGAPI png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
Definition: png.c:676
#define PNG_INFO_tRNS
Definition: png.h:936
#define PNG_HEADER_VERSION_STRING
Definition: png.h:274
png_infop double double double double double double * green_y
Definition: png.h:2100
png_infop double double * white_y
Definition: png.h:2100
png_size_t png_info_struct_size
Definition: png.h:1439
GLuint GLuint num
void FAR * png_voidp
Definition: pngconf.h:1327
png_int_32 png_fixed_point
Definition: pngconf.h:1324
png_infop double double double * red_x
Definition: png.h:2100
#define PNG_FREE_PCAL
Definition: png.h:1938
void png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, png_voidp mem_ptr)
Definition: pngmem.c:410
version_1_2_56 Your_png_h_is_not_version_1_2_56
Definition: png.c:20
#define PNG_FREE_MUL
Definition: png.h:1946
int PNGAPI png_mmx_support(void)
Definition: png.c:830
size_t png_size_t
Definition: pngconf.h:1259
PNG_pCAL
Definition: png.c:49
#define PNG_INTRAPIXEL_DIFFERENCING
Definition: png.h:883
#define PNG_INFO_sPLT
Definition: png.h:945
png_infop info_ptr
Definition: png.h:1443
png_infop double double double double double * green_x
Definition: png.h:2100
unsigned long png_uint_32
Definition: pngconf.h:1247
PNG_iCCP
Definition: png.c:46
#define PNG_ABORT()
Definition: pngconf.h:1613
png_charp PNGAPI png_get_header_version(png_structp png_ptr)
Definition: png.c:774
FILE * png_FILE_p
Definition: pngconf.h:1341
png_charp PNGAPI png_get_copyright(png_structp png_ptr)
Definition: png.c:726
png_info FAR *FAR * png_infopp
Definition: png.h:850
int PNGAPI png_reset_zstream(png_structp png_ptr)
Definition: png.c:809
void PNGAPI png_free(png_structp png_ptr, png_voidp ptr)
Definition: pngmem.c:527
#define PNG_INFO_pCAL
Definition: png.h:942
#define PNG_FREE_SCAL
Definition: png.h:1939
#define PNG_STRING_NEWLINE
Definition: pngconf.h:903
png_infop double * white_x
Definition: png.h:2100
GLsizeiptr size
int bit_depth
Definition: readpng.c:72
png_infop int freer
Definition: png.h:1927
void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp)
Definition: png.c:660
int color_type
Definition: readpng.c:72
png_voidp PNGAPI png_malloc(png_structp png_ptr, png_uint_32 size)
Definition: pngmem.c:457
void png_reset_crc(png_structp png_ptr)
Definition: png.c:215
PNG_oFFs
Definition: png.c:48
#define PNG_INFO_iCCP
Definition: png.h:944
#define png_sizeof(x)
Definition: pngconf.h:1260
#define PNG_FREE_TRNS
Definition: png.h:1943
#define PNG_INFO_sCAL
Definition: png.h:946
png_uint_32 PNGAPI png_access_version_number(void)
Definition: png.c:819
png_info FAR * png_infop
Definition: png.h:849