zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
png.c File Reference
#include "pngpriv.h"

Go to the source code of this file.

Macros

#define APPEND(ch)
 
#define APPEND_NUMBER(format, value)   APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value)))
 
#define APPEND_STRING(string)
 
#define png_fp_add(state, flags)   ((state) |= (flags))
 
#define png_fp_set(state, value)   ((state) = (value) | ((state) & PNG_FP_STICKY))
 

Typedefs

typedef png_libpng_version_1_5_9 Your_png_h_is_not_version_1_5_9
 

Functions

void png_64bit_product (long v1, long v2, unsigned long *hi_product, unsigned long *lo_product)
 
png_uint_32 PNGAPI png_access_version_number (void)
 
void png_ascii_from_fixed (png_structp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp)
 
void png_ascii_from_fp (png_structp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision)
 
static void png_build_16bit_table (png_structp png_ptr, png_uint_16pp *ptable, PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
 
static void png_build_16to8_table (png_structp png_ptr, png_uint_16pp *ptable, PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val)
 
static void png_build_8bit_table (png_structp png_ptr, png_bytepp ptable, PNG_CONST png_fixed_point gamma_val)
 
void png_build_gamma_table (png_structp png_ptr, int bit_depth)
 
void png_calculate_crc (png_structp png_ptr, png_const_bytep ptr, png_size_t length)
 
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)
 
int png_check_fp_number (png_const_charp string, png_size_t size, int *statep, png_size_tp whereami)
 
int png_check_fp_string (png_const_charp string, png_size_t size)
 
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)
 
int png_chunk_unknown_handling (png_structp png_ptr, png_uint_32 chunk_name)
 
png_const_charp PNGAPI png_convert_to_rfc1123 (png_structp png_ptr, png_const_timep ptime)
 
void PNGAPI png_data_freer (png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask)
 
void png_destroy_gamma_table (png_structp png_ptr)
 
void PNGAPI png_destroy_info_struct (png_structp png_ptr, png_infopp info_ptr_ptr)
 
png_fixed_point png_fixed (png_structp png_ptr, double fp, png_const_charp text)
 
void PNGAPI png_free_data (png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
 
 PNG_FUNCTION (voidpf, png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED)
 
 PNG_FUNCTION (png_infop, PNGAPI png_create_info_struct,(png_structp png_ptr), PNG_ALLOCATED)
 
png_uint_16 png_gamma_16bit_correct (unsigned int value, png_fixed_point gamma_val)
 
png_byte png_gamma_8bit_correct (unsigned int value, png_fixed_point gamma_val)
 
png_uint_16 png_gamma_correct (png_structp png_ptr, unsigned int value, png_fixed_point gamma_val)
 
int png_gamma_significant (png_fixed_point gamma_val)
 
png_const_charp PNGAPI png_get_copyright (png_const_structp png_ptr)
 
png_const_charp PNGAPI png_get_header_ver (png_const_structp png_ptr)
 
png_const_charp PNGAPI png_get_header_version (png_const_structp png_ptr)
 
png_voidp PNGAPI png_get_io_ptr (png_structp png_ptr)
 
png_const_charp PNGAPI png_get_libpng_ver (png_const_structp png_ptr)
 
int PNGAPI png_handle_as_unknown (png_structp png_ptr, png_const_bytep chunk_name)
 
void png_info_destroy (png_structp png_ptr, png_infop info_ptr)
 
void PNGAPI png_info_init_3 (png_infopp ptr_ptr, png_size_t png_info_struct_size)
 
void PNGAPI png_init_io (png_structp png_ptr, png_FILE_p fp)
 
int png_muldiv (png_fixed_point_p res, png_fixed_point a, png_int_32 times, png_int_32 divisor)
 
png_fixed_point png_muldiv_warn (png_structp png_ptr, png_fixed_point a, png_int_32 times, png_int_32 divisor)
 
static double png_pow10 (int power)
 
static png_fixed_point png_product2 (png_fixed_point a, png_fixed_point b)
 
png_fixed_point png_reciprocal (png_fixed_point a)
 
png_fixed_point png_reciprocal2 (png_fixed_point a, png_fixed_point b)
 
void png_reset_crc (png_structp png_ptr)
 
int PNGAPI png_reset_zstream (png_structp png_ptr)
 
void PNGAPI png_set_sig_bytes (png_structp png_ptr, int num_bytes)
 
int PNGAPI png_sig_cmp (png_const_bytep sig, png_size_t start, png_size_t num_to_check)
 
int png_user_version_check (png_structp png_ptr, png_const_charp user_png_ver)
 
int png_xy_from_XYZ (png_xy *xy, png_XYZ XYZ)
 
int png_XYZ_from_xy (png_XYZ *XYZ, png_xy xy)
 
int png_XYZ_from_xy_checked (png_structp png_ptr, png_XYZ *XYZ, png_xy xy)
 
void png_zfree (voidpf png_ptr, voidpf ptr)
 

Macro Definition Documentation

#define APPEND (   ch)
Value:
if (pos < (sizeof png_ptr->time_buffer)-1)\
png_ptr->time_buffer[pos++] = (ch)

Referenced by png_convert_to_rfc1123().

#define APPEND_NUMBER (   format,
  value 
)    APPEND_STRING(PNG_FORMAT_NUMBER(number_buf, format, (value)))

Referenced by png_convert_to_rfc1123().

#define APPEND_STRING (   string)
Value:
pos = png_safecat(png_ptr->time_buffer, sizeof png_ptr->time_buffer,\
pos, (string))
size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string)
Definition: pngerror.c:110

Referenced by png_convert_to_rfc1123().

#define png_fp_add (   state,
  flags 
)    ((state) |= (flags))

Definition at line 1317 of file png.c.

Referenced by png_check_fp_number().

#define png_fp_set (   state,
  value 
)    ((state) = (value) | ((state) & PNG_FP_STICKY))

Definition at line 1318 of file png.c.

Referenced by png_check_fp_number().

Typedef Documentation

Function Documentation

void png_64bit_product ( long  v1,
long  v2,
unsigned long *  hi_product,
unsigned long *  lo_product 
)

Definition at line 2132 of file png.c.

References d, cordic::hi, and cordic::lo.

Referenced by png_check_cHRM_fixed().

png_uint_32 PNGAPI png_access_version_number ( void  )

Definition at line 763 of file png.c.

References PNG_LIBPNG_VER.

Referenced by main().

void png_ascii_from_fixed ( png_structp  png_ptr,
png_charp  ascii,
png_size_t  size,
png_fixed_point  fp 
)

Definition at line 1818 of file png.c.

References i, and png_error().

Referenced by png_set_sCAL_fixed().

void png_ascii_from_fp ( png_structp  png_ptr,
png_charp  ascii,
png_size_t  size,
double  fp,
unsigned int  precision 
)

Definition at line 1504 of file png.c.

References d, floor(), png_error(), and png_pow10().

Referenced by png_set_sCAL().

static void png_build_16bit_table ( png_structp  png_ptr,
png_uint_16pp ptable,
PNG_CONST unsigned int  shift,
PNG_CONST png_fixed_point  gamma_val 
)
static

Definition at line 2531 of file png.c.

References d, floor(), i, j, max, PNG_CONST, png_gamma_16bit_correct(), png_gamma_significant(), and png_sizeof.

Referenced by png_build_gamma_table().

static void png_build_16to8_table ( png_structp  png_ptr,
png_uint_16pp ptable,
PNG_CONST unsigned int  shift,
PNG_CONST png_fixed_point  gamma_val 
)
static

Definition at line 2599 of file png.c.

References i, max, PNG_CONST, png_gamma_16bit_correct(), and png_sizeof.

Referenced by png_build_gamma_table().

static void png_build_8bit_table ( png_structp  png_ptr,
png_bytepp  ptable,
PNG_CONST png_fixed_point  gamma_val 
)
static

Definition at line 2666 of file png.c.

References i, png_gamma_8bit_correct(), and png_gamma_significant().

Referenced by png_build_gamma_table().

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 at line 780 of file png.c.

References NULL, png_64bit_product(), png_debug, PNG_FP_1, png_warning(), and ret.

Referenced by png_set_cHRM_fixed(), and png_write_cHRM_fixed().

int png_check_fp_string ( png_const_charp  string,
png_size_t  size 
)

Definition at line 1448 of file png.c.

References png_check_fp_number().

Referenced by png_set_pCAL(), and png_set_sCAL_s().

int png_chunk_unknown_handling ( png_structp  png_ptr,
png_uint_32  chunk_name 
)
png_const_charp PNGAPI png_convert_to_rfc1123 ( png_structp  png_ptr,
png_const_timep  ptime 
)
void PNGAPI png_data_freer ( png_structp  png_ptr,
png_infop  info_ptr,
int  freer,
png_uint_32  mask 
)

Definition at line 310 of file png.c.

References NULL, png_debug, PNG_DESTROY_WILL_FREE_DATA, PNG_USER_WILL_FREE_DATA, and png_warning().

void png_destroy_gamma_table ( png_structp  png_ptr)

Definition at line 2683 of file png.c.

References i, NULL, and png_free().

Referenced by png_build_gamma_table(), and png_read_destroy().

void PNGAPI png_destroy_info_struct ( png_structp  png_ptr,
png_infopp  info_ptr_ptr 
)

Definition at line 257 of file png.c.

References NULL, png_debug, png_destroy_struct(), png_destroy_struct_2(), and png_info_destroy().

Referenced by test_one_file().

png_fixed_point png_fixed ( png_structp  png_ptr,
double  fp,
png_const_charp  text 
)
PNG_FUNCTION ( voidpf  ,
png_zalloc  ,
(voidpf png_ptr, uInt items, uInt size ,
PNG_ALLOCATED   
)

Definition at line 72 of file png.c.

References NULL, PNG_FLAG_MALLOC_NULL_MEM_OK, PNG_UINT_32_MAX, and png_warning().

PNG_FUNCTION ( png_infop  ,
PNGAPI  png_create_info_struct,
(png_structp png_ptr)  ,
PNG_ALLOCATED   
)

Definition at line 229 of file png.c.

References NULL, png_debug, png_info_init_3(), png_sizeof, and PNG_STRUCT_INFO.

png_uint_16 png_gamma_16bit_correct ( unsigned int  value,
png_fixed_point  gamma_val 
)

Definition at line 2474 of file png.c.

References floor(), PNG_FP_1, and png_muldiv().

Referenced by png_build_16bit_table(), png_build_16to8_table(), and png_gamma_correct().

png_byte png_gamma_8bit_correct ( unsigned int  value,
png_fixed_point  gamma_val 
)

Definition at line 2451 of file png.c.

References floor(), PNG_FP_1, and png_muldiv().

Referenced by png_build_8bit_table(), png_gamma_correct(), and png_init_read_transformations().

png_uint_16 png_gamma_correct ( png_structp  png_ptr,
unsigned int  value,
png_fixed_point  gamma_val 
)

Definition at line 2502 of file png.c.

References png_gamma_16bit_correct(), and png_gamma_8bit_correct().

Referenced by png_init_read_transformations().

int png_gamma_significant ( png_fixed_point  gamma_val)
png_const_charp PNGAPI png_get_copyright ( png_const_structp  png_ptr)

Definition at line 650 of file png.c.

References PNG_STRING_NEWLINE, and PNG_UNUSED.

Referenced by main().

png_const_charp PNGAPI png_get_header_ver ( png_const_structp  png_ptr)

Definition at line 688 of file png.c.

References PNG_LIBPNG_VER_STRING, and PNG_UNUSED.

Referenced by png_get_libpng_ver().

png_const_charp PNGAPI png_get_header_version ( png_const_structp  png_ptr)

Definition at line 696 of file png.c.

References PNG_HEADER_VERSION_STRING, PNG_STRING_NEWLINE, and PNG_UNUSED.

Referenced by main().

png_voidp PNGAPI png_get_io_ptr ( png_structp  png_ptr)

Definition at line 560 of file png.c.

References NULL.

png_const_charp PNGAPI png_get_libpng_ver ( png_const_structp  png_ptr)

Definition at line 681 of file png.c.

References png_get_header_ver().

int PNGAPI png_handle_as_unknown ( png_structp  png_ptr,
png_const_bytep  chunk_name 
)
void png_info_destroy ( png_structp  png_ptr,
png_infop  info_ptr 
)
void PNGAPI png_info_init_3 ( png_infopp  ptr_ptr,
png_size_t  png_info_struct_size 
)

Definition at line 289 of file png.c.

References NULL, png_debug, png_destroy_struct(), png_memset, png_sizeof, and PNG_STRUCT_INFO.

Referenced by PNG_FUNCTION(), and png_info_destroy().

void PNGAPI png_init_io ( png_structp  png_ptr,
png_FILE_p  fp 
)

Definition at line 577 of file png.c.

References NULL, and png_debug.

Referenced by Zeni::Image::Image(), and test_one_file().

png_fixed_point png_muldiv_warn ( png_structp  png_ptr,
png_fixed_point  a,
png_int_32  times,
png_int_32  divisor 
)

Definition at line 2030 of file png.c.

References png_muldiv(), and png_warning().

Referenced by png_fixed_inches_from_microns().

static double png_pow10 ( int  power)
static

Definition at line 1467 of file png.c.

References d.

Referenced by png_ascii_from_fp().

static png_fixed_point png_product2 ( png_fixed_point  a,
png_fixed_point  b 
)
static

Definition at line 2065 of file png.c.

References floor(), and png_muldiv().

Referenced by png_build_gamma_table(), and png_reciprocal2().

png_fixed_point png_reciprocal2 ( png_fixed_point  a,
png_fixed_point  b 
)

Definition at line 2087 of file png.c.

References floor(), png_product2(), and png_reciprocal().

Referenced by png_build_gamma_table(), and png_init_read_transformations().

void png_reset_crc ( png_structp  png_ptr)

Definition at line 108 of file png.c.

References crc32(), and Z_NULL.

Referenced by png_push_read_chunk(), png_push_read_IDAT(), png_read_chunk_header(), and png_write_chunk_header().

int PNGAPI png_reset_zstream ( png_structp  png_ptr)

Definition at line 752 of file png.c.

References inflateReset(), NULL, and Z_STREAM_ERROR.

void PNGAPI png_set_sig_bytes ( png_structp  png_ptr,
int  num_bytes 
)

Definition at line 27 of file png.c.

References NULL, png_debug, and png_error().

Referenced by Zeni::Image::Image().

int PNGAPI png_sig_cmp ( png_const_bytep  sig,
png_size_t  start,
png_size_t  num_to_check 
)

Definition at line 49 of file png.c.

References png_memcmp.

Referenced by Zeni::Image::Image(), png_push_read_sig(), and png_read_sig().

int png_user_version_check ( png_structp  png_ptr,
png_const_charp  user_png_ver 
)

Definition at line 172 of file png.c.

References i, NULL, PNG_FLAG_LIBRARY_MISMATCH, png_libpng_ver, png_safecat(), and png_warning().

Referenced by PNG_FUNCTION().

int png_XYZ_from_xy_checked ( png_structp  png_ptr,
png_XYZ XYZ,
png_xy  xy 
)

Definition at line 1139 of file png.c.

References png_error(), png_warning(), and png_XYZ_from_xy().

Referenced by png_get_cHRM_XYZ_fixed(), and png_handle_cHRM().

void png_zfree ( voidpf  png_ptr,
voidpf  ptr 
)

Definition at line 99 of file png.c.

References png_free().

Referenced by png_free_data(), PNG_FUNCTION(), png_read_destroy(), and png_write_IHDR().