16 #define PNG_NO_PEDANTIC_WARNINGS 18 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) 23 if (png_ptr !=
NULL && info_ptr !=
NULL)
24 return(info_ptr->valid & flag);
33 if (png_ptr !=
NULL && info_ptr !=
NULL)
34 return(info_ptr->rowbytes);
40 #ifdef PNG_INFO_IMAGE_SUPPORTED 44 if (png_ptr !=
NULL && info_ptr !=
NULL)
45 return(info_ptr->row_pointers);
52 #ifdef PNG_EASY_ACCESS_SUPPORTED 57 if (png_ptr !=
NULL && info_ptr !=
NULL)
58 return info_ptr->width;
66 if (png_ptr !=
NULL && info_ptr !=
NULL)
67 return info_ptr->height;
75 if (png_ptr !=
NULL && info_ptr !=
NULL)
76 return info_ptr->bit_depth;
84 if (png_ptr !=
NULL && info_ptr !=
NULL)
85 return info_ptr->color_type;
93 if (png_ptr !=
NULL && info_ptr !=
NULL)
94 return info_ptr->filter_type;
102 if (png_ptr !=
NULL && info_ptr !=
NULL)
103 return info_ptr->interlace_type;
111 if (png_ptr !=
NULL && info_ptr !=
NULL)
112 return info_ptr->compression_type;
120 if (png_ptr !=
NULL && info_ptr !=
NULL)
121 #ifdef PNG_pHYs_SUPPORTED 124 png_debug1(1,
"in %s retrieval function",
"png_get_x_pixels_per_meter");
130 return (info_ptr->x_pixels_per_unit);
141 if (png_ptr !=
NULL && info_ptr !=
NULL)
142 #ifdef PNG_pHYs_SUPPORTED 145 png_debug1(1,
"in %s retrieval function",
"png_get_y_pixels_per_meter");
151 return (info_ptr->y_pixels_per_unit);
162 if (png_ptr !=
NULL && info_ptr !=
NULL)
163 #ifdef PNG_pHYs_SUPPORTED 166 png_debug1(1,
"in %s retrieval function",
"png_get_pixels_per_meter");
169 info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit)
173 return (info_ptr->x_pixels_per_unit);
181 #ifdef PNG_FLOATING_POINT_SUPPORTED 185 if (png_ptr !=
NULL && info_ptr !=
NULL)
186 #ifdef PNG_pHYs_SUPPORTED 190 png_debug1(1,
"in %s retrieval function",
"png_get_aspect_ratio");
192 if (info_ptr->x_pixels_per_unit == 0)
196 return ((
float)((
float)info_ptr->y_pixels_per_unit
197 /(
float)info_ptr->x_pixels_per_unit));
209 if (png_ptr !=
NULL && info_ptr !=
NULL)
210 #ifdef PNG_oFFs_SUPPORTED 214 png_debug1(1,
"in %s retrieval function",
"png_get_x_offset_microns");
220 return (info_ptr->x_offset);
231 if (png_ptr !=
NULL && info_ptr !=
NULL)
233 #ifdef PNG_oFFs_SUPPORTED 236 png_debug1(1,
"in %s retrieval function",
"png_get_y_offset_microns");
242 return (info_ptr->y_offset);
253 if (png_ptr !=
NULL && info_ptr !=
NULL)
255 #ifdef PNG_oFFs_SUPPORTED 258 png_debug1(1,
"in %s retrieval function",
"png_get_x_offset_microns");
264 return (info_ptr->x_offset);
275 if (png_ptr !=
NULL && info_ptr !=
NULL)
277 #ifdef PNG_oFFs_SUPPORTED 280 png_debug1(1,
"in %s retrieval function",
"png_get_y_offset_microns");
286 return (info_ptr->y_offset);
294 #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) 330 #ifdef PNG_pHYs_SUPPORTED 339 png_debug1(1,
"in %s retrieval function",
"pHYs");
351 if (unit_type !=
NULL)
374 if (png_ptr !=
NULL && info_ptr !=
NULL)
375 return(info_ptr->channels);
383 if (png_ptr !=
NULL && info_ptr !=
NULL)
384 return(info_ptr->signature);
389 #ifdef PNG_bKGD_SUPPORTED 395 && background !=
NULL)
397 png_debug1(1,
"in %s retrieval function",
"bKGD");
399 *background = &(info_ptr->background);
406 #ifdef PNG_cHRM_SUPPORTED 407 #ifdef PNG_FLOATING_POINT_SUPPORTED 415 png_debug1(1,
"in %s retrieval function",
"cHRM");
418 *white_x = (double)info_ptr->x_white;
420 *white_y = (double)info_ptr->y_white;
422 *red_x = (double)info_ptr->x_red;
424 *red_y = (double)info_ptr->y_red;
426 *green_x = (double)info_ptr->x_green;
428 *green_y = (double)info_ptr->y_green;
430 *blue_x = (double)info_ptr->x_blue;
432 *blue_y = (double)info_ptr->y_blue;
438 #ifdef PNG_FIXED_POINT_SUPPORTED 445 png_debug1(1,
"in %s retrieval function",
"cHRM");
450 *white_x = info_ptr->int_x_white;
452 *white_y = info_ptr->int_y_white;
454 *red_x = info_ptr->int_x_red;
456 *red_y = info_ptr->int_y_red;
458 *green_x = info_ptr->int_x_green;
460 *green_y = info_ptr->int_y_green;
462 *blue_x = info_ptr->int_x_blue;
464 *blue_y = info_ptr->int_y_blue;
472 #ifdef PNG_gAMA_SUPPORTED 473 #ifdef PNG_FLOATING_POINT_SUPPORTED 477 png_debug1(1,
"in %s retrieval function",
"gAMA");
480 && file_gamma !=
NULL)
482 *file_gamma = (double)info_ptr->gamma;
488 #ifdef PNG_FIXED_POINT_SUPPORTED 493 png_debug1(1,
"in %s retrieval function",
"gAMA");
496 && int_file_gamma !=
NULL)
498 *int_file_gamma = info_ptr->int_gamma;
506 #ifdef PNG_sRGB_SUPPORTED 510 png_debug1(1,
"in %s retrieval function",
"sRGB");
513 && file_srgb_intent !=
NULL)
515 *file_srgb_intent = (
int)info_ptr->srgb_intent;
522 #ifdef PNG_iCCP_SUPPORTED 528 png_debug1(1,
"in %s retrieval function",
"iCCP");
533 *name = info_ptr->iccp_name;
534 *profile = info_ptr->iccp_profile;
538 *proflen = (
int)info_ptr->iccp_proflen;
539 *compression_type = (
int)info_ptr->iccp_compression;
546 #ifdef PNG_sPLT_SUPPORTED 551 if (png_ptr !=
NULL && info_ptr !=
NULL && spalettes !=
NULL)
553 *spalettes = info_ptr->splt_palettes;
560 #ifdef PNG_hIST_SUPPORTED 564 png_debug1(1,
"in %s retrieval function",
"hIST");
569 *hist = info_ptr->hist;
583 png_debug1(1,
"in %s retrieval function",
"IHDR");
585 if (png_ptr ==
NULL || info_ptr ==
NULL || width ==
NULL ||
586 height ==
NULL || bit_depth ==
NULL || color_type ==
NULL)
589 *width = info_ptr->width;
590 *height = info_ptr->height;
591 *bit_depth = info_ptr->bit_depth;
592 *color_type = info_ptr->color_type;
594 if (compression_type !=
NULL)
595 *compression_type = info_ptr->compression_type;
597 if (filter_type !=
NULL)
598 *filter_type = info_ptr->filter_type;
600 if (interlace_type !=
NULL)
601 *interlace_type = info_ptr->interlace_type;
609 info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
610 info_ptr->compression_type, info_ptr->filter_type);
615 #ifdef PNG_oFFs_SUPPORTED 620 png_debug1(1,
"in %s retrieval function",
"oFFs");
623 && offset_x !=
NULL && offset_y !=
NULL && unit_type !=
NULL)
625 *offset_x = info_ptr->x_offset;
626 *offset_y = info_ptr->y_offset;
627 *unit_type = (
int)info_ptr->offset_unit_type;
634 #ifdef PNG_pCAL_SUPPORTED 640 png_debug1(1,
"in %s retrieval function",
"pCAL");
646 *purpose = info_ptr->pcal_purpose;
647 *X0 = info_ptr->pcal_X0;
648 *X1 = info_ptr->pcal_X1;
649 *type = (
int)info_ptr->pcal_type;
650 *nparams = (
int)info_ptr->pcal_nparams;
651 *units = info_ptr->pcal_units;
652 *params = info_ptr->pcal_params;
659 #ifdef PNG_sCAL_SUPPORTED 660 #ifdef PNG_FLOATING_POINT_SUPPORTED 665 if (png_ptr !=
NULL && info_ptr !=
NULL &&
668 *unit = info_ptr->scal_unit;
669 *width = info_ptr->scal_pixel_width;
670 *height = info_ptr->scal_pixel_height;
676 #ifdef PNG_FIXED_POINT_SUPPORTED 695 #ifdef PNG_pHYs_SUPPORTED 702 png_debug1(1,
"in %s retrieval function",
"pHYs");
704 if (png_ptr !=
NULL && info_ptr !=
NULL &&
709 *res_x = info_ptr->x_pixels_per_unit;
715 *res_y = info_ptr->y_pixels_per_unit;
719 if (unit_type !=
NULL)
721 *unit_type = (
int)info_ptr->phys_unit_type;
733 png_debug1(1,
"in %s retrieval function",
"PLTE");
738 *palette = info_ptr->palette;
739 *num_palette = info_ptr->num_palette;
740 png_debug1(3,
"num_palette = %d", *num_palette);
746 #ifdef PNG_sBIT_SUPPORTED 750 png_debug1(1,
"in %s retrieval function",
"sBIT");
755 *sig_bit = &(info_ptr->sig_bit);
762 #ifdef PNG_TEXT_SUPPORTED 767 if (png_ptr !=
NULL && info_ptr !=
NULL && info_ptr->num_text > 0)
770 (png_ptr->chunk_name[0] ==
'\0' ?
"text" 773 if (text_ptr !=
NULL)
774 *text_ptr = info_ptr->text;
776 if (num_text !=
NULL)
777 *num_text = info_ptr->num_text;
781 if (num_text !=
NULL)
787 #ifdef PNG_tIME_SUPPORTED 791 png_debug1(1,
"in %s retrieval function",
"tIME");
796 *mod_time = &(info_ptr->mod_time);
803 #ifdef PNG_tRNS_SUPPORTED 811 png_debug1(1,
"in %s retrieval function",
"tRNS");
817 *trans = info_ptr->trans;
821 if (trans_values !=
NULL)
822 *trans_values = &(info_ptr->trans_values);
826 if (trans_values !=
NULL)
828 *trans_values = &(info_ptr->trans_values);
835 if (num_trans !=
NULL)
837 *num_trans = info_ptr->num_trans;
845 #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED 850 if (png_ptr !=
NULL && info_ptr !=
NULL && unknowns !=
NULL)
852 *unknowns = info_ptr->unknown_chunks;
853 return ((
png_uint_32)info_ptr->unknown_chunks_num);
859 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED 863 return (
png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0);
867 #ifdef PNG_USER_CHUNKS_SUPPORTED 871 return (png_ptr? png_ptr->user_chunk_ptr :
NULL);
878 return (
png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
881 #ifdef PNG_ASSEMBLER_CODE_SUPPORTED 932 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 938 return (png_ptr? png_ptr->user_width_max : 0);
943 return (png_ptr? png_ptr->user_height_max : 0);
png_int_32 PNGAPI png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
png_infop png_charpp int png_charpp profile
png_uint_32 PNGAPI png_get_image_width(png_structp png_ptr, png_infop info_ptr)
GLint GLint GLsizei GLsizei height
png_infop png_charpp int png_charpp png_uint_32 * proflen
png_infop png_uint_32 * res_x
png_uint_32 PNGAPI png_get_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values)
png_uint_32 PNGAPI png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
png_uint_32 PNGAPI png_get_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
png_uint_32 PNGAPI png_get_cHRM(png_structp png_ptr, png_infop info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)
png_bytep PNGAPI png_get_signature(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
png_infop png_uint_32 png_uint_32 * res_y
png_uint_32 PNGAPI png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkpp unknowns)
png_infop double double double double double double double double * blue_y
png_infop png_textp * text_ptr
png_colorp int num_palette
png_infop double double double double double double double * blue_x
png_uint_32 PNGAPI png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
png_color_16 FAR * png_color_16p
png_infop png_color_16p * background
#define PNG_COLOR_TYPE_PALETTE
#define PNG_UNUSED(param)
png_uint_32 PNGAPI png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
png_infop png_charp png_int_32 png_int_32 * X1
GLint GLint GLsizei width
png_infop png_int_32 png_int_32 * offset_y
png_infop png_int_32 * offset_x
PNG_CONST char FAR * png_const_charp
float PNGAPI png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
png_infop double double double double * red_y
png_infop png_bytep * trans
png_unknown_chunk FAR *FAR * png_unknown_chunkpp
png_infop png_charp png_int_32 * X0
png_uint_32 PNGAPI png_get_mmx_flagmask(int flag_select, int *compilerID)
png_uint_32 PNGAPI png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point *int_file_gamma)
png_uint_32 PNGAPI png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, int *num_text)
png_uint_32 PNGAPI png_get_sCAL(png_structp png_ptr, png_infop info_ptr, int *unit, double *width, double *height)
png_infop png_bytep int png_color_16p * trans_values
png_byte PNGAPI png_get_mmx_bitdepth_threshold(png_structp png_ptr)
png_byte FAR *FAR * png_bytepp
png_infop png_charpp int * compression_type
png_uint_32 PNGAPI png_get_user_height_max(png_structp png_ptr)
png_infop png_uint_16p * hist
png_uint_32 PNGAPI png_get_compression_buffer_size(png_structp png_ptr)
png_uint_32 PNGAPI png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
png_byte PNGAPI png_get_interlace_type(png_structp png_ptr, png_infop info_ptr)
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)
png_struct FAR * png_structp
png_uint_32 PNGAPI png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette)
png_uint_32 PNGAPI png_get_cHRM_fixed(png_structp png_ptr, png_infop info_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)
png_uint_32 PNGAPI png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_type, int *compression_type, int *filter_type)
png_byte PNGAPI png_get_rgb_to_gray_status(png_structp png_ptr)
png_infop png_bytep int * num_trans
png_infop png_fixed_point * int_file_gamma
png_uint_32 PNGAPI png_get_user_width_max(png_structp png_ptr)
png_uint_32 PNGAPI png_get_mmx_rowbytes_threshold(png_structp png_ptr)
png_uint_16 FAR * png_uint_16p
#define PNG_RESOLUTION_METER
#define png_debug1(l, m, p1)
png_infop double * file_gamma
png_uint_32 PNGAPI png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_iCCP(png_structp png_ptr, png_infop info_ptr, png_charpp name, int *compression_type, png_charpp profile, png_uint_32 *proflen)
GLuint const GLchar * name
png_uint_32 PNGAPI png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_pCAL(png_structp png_ptr, png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)
png_infop png_textp int * num_text
if(!abbox) return FT_THROW(Invalid_Argument)
png_byte PNGAPI png_get_bit_depth(png_structp png_ptr, png_infop info_ptr)
GLenum const GLfloat * params
png_uint_32 PNGAPI png_get_asm_flags(png_structp png_ptr)
png_infop png_charp * purpose
png_int_32 PNGAPI png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
png_infop double double double double double double * green_y
png_infop double double * white_y
png_int_32 PNGAPI png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
png_byte PNGAPI png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p *background)
png_infop png_charp png_int_32 png_int_32 int int * nparams
#define PNG_OFFSET_MICROMETER
png_color_8 FAR * png_color_8p
png_uint_32 PNGAPI png_get_asm_flagmask(int flag_select)
png_int_32 png_fixed_point
png_infop double double double * red_x
char FAR *FAR * png_charpp
png_uint_32 PNGAPI png_get_sPLT(png_structp png_ptr, png_infop info_ptr, png_sPLT_tpp spalettes)
png_infop png_int_32 png_int_32 int * unit_type
png_uint_32 PNGAPI png_get_image_height(png_structp png_ptr, png_infop info_ptr)
png_sPLT_t FAR *FAR * png_sPLT_tpp
png_byte PNGAPI png_get_filter_type(png_structp png_ptr, png_infop info_ptr)
png_infop double double double double double * green_x
unsigned long png_uint_32
png_int_32 PNGAPI png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
png_bytepp PNGAPI png_get_rows(png_structp png_ptr, png_infop info_ptr)
png_infop png_uint_32 flag
png_uint_32 PNGAPI png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
png_voidp PNGAPI png_get_user_chunk_ptr(png_structp png_ptr)
png_infop double * white_x
png_infop png_timep * mod_time
png_byte PNGAPI png_get_color_type(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
png_byte PNGAPI png_get_channels(png_structp png_ptr, png_infop info_ptr)
png_infop png_unknown_chunkp unknowns
png_infop png_color_8p * sig_bit
png_color FAR * png_colorp