LMMS
Loading...
Searching...
No Matches
png.c File Reference
#include "pngpriv.h"

Go to the source code of this file.

Macros

#define GCC_STRICT_OVERFLOW   0
#define APPEND_STRING(string)
#define APPEND_NUMBER(format, value)
#define APPEND(ch)
#define PNG_MD5(a, b, c, d)
#define PNG_ICC_CHECKSUM(adler, crc, md5, intent, broke, date, length, fname)
#define png_gt(a, b)
#define png_fp_add(state, flags)
#define png_fp_set(state, value)

Functions

void PNGAPI png_set_sig_bytes (png_structrp png_ptr, int num_bytes)
int PNGAPI png_sig_cmp (png_const_bytep sig, size_t start, size_t num_to_check)
 PNG_FUNCTION (voidpf, png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED)
void png_zfree (voidpf png_ptr, voidpf ptr)
void png_reset_crc (png_structrp png_ptr)
void png_calculate_crc (png_structrp png_ptr, png_const_bytep ptr, size_t length)
int png_user_version_check (png_structrp png_ptr, png_const_charp user_png_ver)
 PNG_FUNCTION (png_structp, png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED)
 PNG_FUNCTION (png_infop, PNGAPI png_create_info_struct,(png_const_structrp png_ptr), PNG_ALLOCATED)
void PNGAPI png_destroy_info_struct (png_const_structrp png_ptr, png_infopp info_ptr_ptr)
 PNG_FUNCTION (void, PNGAPI png_info_init_3,(png_infopp ptr_ptr, size_t png_info_struct_size), PNG_DEPRECATED)
void PNGAPI png_data_freer (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)
void PNGAPI png_free_data (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, int num)
png_voidp PNGAPI png_get_io_ptr (png_const_structrp png_ptr)
void PNGAPI png_init_io (png_structrp png_ptr, png_FILE_p fp)
void PNGAPI png_save_int_32 (png_bytep buf, png_int_32 i)
int PNGAPI png_convert_to_rfc1123_buffer (char out[29], png_const_timep ptime)
png_const_charp PNGAPI png_convert_to_rfc1123 (png_structrp png_ptr, png_const_timep ptime)
png_const_charp PNGAPI png_get_copyright (png_const_structrp png_ptr)
png_const_charp PNGAPI png_get_libpng_ver (png_const_structrp png_ptr)
png_const_charp PNGAPI png_get_header_ver (png_const_structrp png_ptr)
png_const_charp PNGAPI png_get_header_version (png_const_structrp png_ptr)
int PNGAPI png_handle_as_unknown (png_const_structrp png_ptr, png_const_bytep chunk_name)
int png_chunk_unknown_handling (png_const_structrp png_ptr, png_uint_32 chunk_name)
int PNGAPI png_reset_zstream (png_structrp png_ptr)
png_uint_32 PNGAPI png_access_version_number (void)
void png_zstream_error (png_structrp png_ptr, int ret)
static int png_colorspace_check_gamma (png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA, int from)
void png_colorspace_set_gamma (png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA)
void png_colorspace_sync_info (png_const_structrp png_ptr, png_inforp info_ptr)
void png_colorspace_sync (png_const_structrp png_ptr, png_inforp info_ptr)
static int png_xy_from_XYZ (png_xy *xy, const png_XYZ *XYZ)
static int png_XYZ_from_xy (png_XYZ *XYZ, const png_xy *xy)
static int png_XYZ_normalize (png_XYZ *XYZ)
static int png_colorspace_endpoints_match (const png_xy *xy1, const png_xy *xy2, int delta)
static int png_colorspace_check_xy (png_XYZ *XYZ, const png_xy *xy)
static int png_colorspace_check_XYZ (png_xy *xy, png_XYZ *XYZ)
static int png_colorspace_set_xy_and_XYZ (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ, int preferred)
int png_colorspace_set_chromaticities (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred)
int png_colorspace_set_endpoints (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred)
static char png_icc_tag_char (png_uint_32 byte)
static void png_icc_tag_name (char *name, png_uint_32 tag)
static int is_ICC_signature_char (png_alloc_size_t it)
static int is_ICC_signature (png_alloc_size_t it)
static int png_icc_profile_error (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_alloc_size_t value, png_const_charp reason)
int png_colorspace_set_sRGB (png_const_structrp png_ptr, png_colorspacerp colorspace, int intent)
static int icc_check_length (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length)
int png_icc_check_length (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length)
int png_icc_check_header (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type)
int png_icc_check_tag_table (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile)
static int png_compare_ICC_profile_with_sRGB (png_const_structrp png_ptr, png_const_bytep profile, uLong adler)
void png_icc_set_sRGB (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler)
int png_colorspace_set_ICC (png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type)
void png_colorspace_set_rgb_coefficients (png_structrp png_ptr)
void png_check_IHDR (png_const_structrp 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_check_fp_number (png_const_charp string, size_t size, int *statep, png_size_tp whereami)
int png_check_fp_string (png_const_charp string, size_t size)
static double png_pow10 (int power)
void png_ascii_from_fp (png_const_structrp png_ptr, png_charp ascii, size_t size, double fp, unsigned int precision)
void png_ascii_from_fixed (png_const_structrp png_ptr, png_charp ascii, size_t size, png_fixed_point fp)
png_fixed_point png_fixed (png_const_structrp png_ptr, double fp, png_const_charp text)
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_const_structrp png_ptr, png_fixed_point a, png_int_32 times, png_int_32 divisor)
png_fixed_point png_reciprocal (png_fixed_point a)
int png_gamma_significant (png_fixed_point gamma_val)
static png_fixed_point png_product2 (png_fixed_point a, png_fixed_point b)
png_fixed_point png_reciprocal2 (png_fixed_point a, png_fixed_point b)
png_byte png_gamma_8bit_correct (unsigned int value, png_fixed_point gamma_val)
png_uint_16 png_gamma_16bit_correct (unsigned int value, png_fixed_point gamma_val)
png_uint_16 png_gamma_correct (png_structrp png_ptr, unsigned int value, png_fixed_point gamma_val)
static void png_build_16bit_table (png_structrp png_ptr, png_uint_16pp *ptable, unsigned int shift, png_fixed_point gamma_val)
static void png_build_16to8_table (png_structrp png_ptr, png_uint_16pp *ptable, unsigned int shift, png_fixed_point gamma_val)
static void png_build_8bit_table (png_structrp png_ptr, png_bytepp ptable, png_fixed_point gamma_val)
void png_destroy_gamma_table (png_structrp png_ptr)
void png_build_gamma_table (png_structrp png_ptr, int bit_depth)

Variables

static const png_xy sRGB_xy
static const png_byte D50_nCIEXYZ [12]
struct { 
   png_uint_32   adler 
   png_uint_32   crc 
   png_uint_32   length 
   png_uint_32   md5 [4] 
   png_byte   have_md5 
   png_byte   is_broken 
   png_uint_16   intent 
png_sRGB_checks []

Macro Definition Documentation

◆ APPEND

#define APPEND ( ch)
Value:
if (pos < 28) out[pos++] = (ch)
float out
Definition lilv_test.c:1461

◆ APPEND_NUMBER

#define APPEND_NUMBER ( format,
value )
Value:
static PuglViewHint int value
Definition pugl.h:1708
#define PNG_FORMAT_NUMBER(buffer, format, number)
#define APPEND_STRING(string)
_WDL_CSTRING_PREFIX void INT_PTR const char * format
Definition wdlcstring.h:263

◆ APPEND_STRING

#define APPEND_STRING ( string)
Value:
pos = png_safecat(out, 29, pos, (string))
size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string)
Definition pngerror.c:112

◆ GCC_STRICT_OVERFLOW

#define GCC_STRICT_OVERFLOW   0

◆ png_fp_add

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

◆ png_fp_set

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

◆ png_gt

#define png_gt ( a,
b )
Value:
((a) > (b))
uint8_t a
Definition Spc_Cpu.h:141
b
Definition crypt.c:628

◆ PNG_ICC_CHECKSUM

#define PNG_ICC_CHECKSUM ( adler,
crc,
md5,
intent,
broke,
date,
length,
fname )
Value:
{ adler, crc, length, md5, broke, intent },
png_uint_32 length
Definition png.c:2247
png_uint_32 md5[4]
Definition png.c:2248
png_uint_32 crc
Definition png.c:2247
png_uint_32 adler
Definition png.c:2247
png_uint_16 intent
Definition png.c:2251

◆ PNG_MD5

#define PNG_MD5 ( a,
b,
c,
d )
Value:
{ a, b, c, d }, (a!=0)||(b!=0)||(c!=0)||(d!=0)
unsigned d
Definition inflate.c:940
return c
Definition crypt.c:175

Function Documentation

◆ icc_check_length()

int icc_check_length ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_uint_32 profile_length )
static

◆ is_ICC_signature()

int is_ICC_signature ( png_alloc_size_t it)
static

◆ is_ICC_signature_char()

int is_ICC_signature_char ( png_alloc_size_t it)
static

◆ png_access_version_number()

png_uint_32 PNGAPI png_access_version_number ( void )

◆ png_ascii_from_fixed()

void png_ascii_from_fixed ( png_const_structrp png_ptr,
png_charp ascii,
size_t size,
png_fixed_point fp )

◆ png_ascii_from_fp()

void png_ascii_from_fp ( png_const_structrp png_ptr,
png_charp ascii,
size_t size,
double fp,
unsigned int precision )

◆ png_build_16bit_table()

void png_build_16bit_table ( png_structrp png_ptr,
png_uint_16pp * ptable,
unsigned int shift,
png_fixed_point gamma_val )
static

◆ png_build_16to8_table()

void png_build_16to8_table ( png_structrp png_ptr,
png_uint_16pp * ptable,
unsigned int shift,
png_fixed_point gamma_val )
static

◆ png_build_8bit_table()

void png_build_8bit_table ( png_structrp png_ptr,
png_bytepp ptable,
png_fixed_point gamma_val )
static

◆ png_build_gamma_table()

void png_build_gamma_table ( png_structrp png_ptr,
int bit_depth )

◆ png_calculate_crc()

void png_calculate_crc ( png_structrp png_ptr,
png_const_bytep ptr,
size_t length )

◆ png_check_fp_number()

int png_check_fp_number ( png_const_charp string,
size_t size,
int * statep,
png_size_tp whereami )

◆ png_check_fp_string()

int png_check_fp_string ( png_const_charp string,
size_t size )

◆ png_check_IHDR()

void png_check_IHDR ( png_const_structrp 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_chunk_unknown_handling()

int png_chunk_unknown_handling ( png_const_structrp png_ptr,
png_uint_32 chunk_name )

◆ png_colorspace_check_gamma()

int png_colorspace_check_gamma ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_fixed_point gAMA,
int from )
static

◆ png_colorspace_check_xy()

int png_colorspace_check_xy ( png_XYZ * XYZ,
const png_xy * xy )
static

◆ png_colorspace_check_XYZ()

int png_colorspace_check_XYZ ( png_xy * xy,
png_XYZ * XYZ )
static

◆ png_colorspace_endpoints_match()

int png_colorspace_endpoints_match ( const png_xy * xy1,
const png_xy * xy2,
int delta )
static

◆ png_colorspace_set_chromaticities()

int png_colorspace_set_chromaticities ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
const png_xy * xy,
int preferred )

◆ png_colorspace_set_endpoints()

int png_colorspace_set_endpoints ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
const png_XYZ * XYZ_in,
int preferred )

◆ png_colorspace_set_gamma()

void png_colorspace_set_gamma ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_fixed_point gAMA )

◆ png_colorspace_set_ICC()

int png_colorspace_set_ICC ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_uint_32 profile_length,
png_const_bytep profile,
int color_type )

◆ png_colorspace_set_rgb_coefficients()

void png_colorspace_set_rgb_coefficients ( png_structrp png_ptr)

◆ png_colorspace_set_sRGB()

int png_colorspace_set_sRGB ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
int intent )

◆ png_colorspace_set_xy_and_XYZ()

int png_colorspace_set_xy_and_XYZ ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
const png_xy * xy,
const png_XYZ * XYZ,
int preferred )
static

◆ png_colorspace_sync()

void png_colorspace_sync ( png_const_structrp png_ptr,
png_inforp info_ptr )

◆ png_colorspace_sync_info()

void png_colorspace_sync_info ( png_const_structrp png_ptr,
png_inforp info_ptr )

◆ png_compare_ICC_profile_with_sRGB()

int png_compare_ICC_profile_with_sRGB ( png_const_structrp png_ptr,
png_const_bytep profile,
uLong adler )
static

◆ png_convert_to_rfc1123()

png_const_charp PNGAPI png_convert_to_rfc1123 ( png_structrp png_ptr,
png_const_timep ptime )

◆ png_convert_to_rfc1123_buffer()

int PNGAPI png_convert_to_rfc1123_buffer ( char out[29],
png_const_timep ptime )

◆ png_data_freer()

void PNGAPI png_data_freer ( png_const_structrp png_ptr,
png_inforp info_ptr,
int freer,
png_uint_32 mask )

◆ png_destroy_gamma_table()

void png_destroy_gamma_table ( png_structrp png_ptr)

◆ png_destroy_info_struct()

void PNGAPI png_destroy_info_struct ( png_const_structrp png_ptr,
png_infopp info_ptr_ptr )

◆ png_fixed()

png_fixed_point png_fixed ( png_const_structrp png_ptr,
double fp,
png_const_charp text )

◆ png_free_data()

void PNGAPI png_free_data ( png_const_structrp png_ptr,
png_inforp info_ptr,
png_uint_32 mask,
int num )

◆ PNG_FUNCTION() [1/4]

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

◆ PNG_FUNCTION() [2/4]

PNG_FUNCTION ( png_structp ,
png_create_png_struct ,
(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn) ,
PNG_ALLOCATED  )

◆ PNG_FUNCTION() [3/4]

PNG_FUNCTION ( void ,
PNGAPI png_info_init_3,
(png_infopp ptr_ptr, size_t png_info_struct_size) ,
PNG_DEPRECATED  )

◆ PNG_FUNCTION() [4/4]

PNG_FUNCTION ( voidpf ,
png_zalloc ,
(voidpf png_ptr, uInt items, uInt size) ,
PNG_ALLOCATED  )

◆ png_gamma_16bit_correct()

png_uint_16 png_gamma_16bit_correct ( unsigned int value,
png_fixed_point gamma_val )

◆ png_gamma_8bit_correct()

png_byte png_gamma_8bit_correct ( unsigned int value,
png_fixed_point gamma_val )

◆ png_gamma_correct()

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

◆ png_gamma_significant()

int png_gamma_significant ( png_fixed_point gamma_val)

◆ png_get_copyright()

png_const_charp PNGAPI png_get_copyright ( png_const_structrp png_ptr)

◆ png_get_header_ver()

png_const_charp PNGAPI png_get_header_ver ( png_const_structrp png_ptr)

◆ png_get_header_version()

png_const_charp PNGAPI png_get_header_version ( png_const_structrp png_ptr)

◆ png_get_io_ptr()

png_voidp PNGAPI png_get_io_ptr ( png_const_structrp png_ptr)

◆ png_get_libpng_ver()

png_const_charp PNGAPI png_get_libpng_ver ( png_const_structrp png_ptr)

◆ png_handle_as_unknown()

int PNGAPI png_handle_as_unknown ( png_const_structrp png_ptr,
png_const_bytep chunk_name )

◆ png_icc_check_header()

int png_icc_check_header ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_uint_32 profile_length,
png_const_bytep profile,
int color_type )

◆ png_icc_check_length()

int png_icc_check_length ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_uint_32 profile_length )

◆ png_icc_check_tag_table()

int png_icc_check_tag_table ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_uint_32 profile_length,
png_const_bytep profile )

◆ png_icc_profile_error()

int png_icc_profile_error ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_charp name,
png_alloc_size_t value,
png_const_charp reason )
static

◆ png_icc_set_sRGB()

void png_icc_set_sRGB ( png_const_structrp png_ptr,
png_colorspacerp colorspace,
png_const_bytep profile,
uLong adler )

◆ png_icc_tag_char()

char png_icc_tag_char ( png_uint_32 byte)
static

◆ png_icc_tag_name()

void png_icc_tag_name ( char * name,
png_uint_32 tag )
static

◆ png_init_io()

void PNGAPI png_init_io ( png_structrp png_ptr,
png_FILE_p fp )

◆ png_muldiv()

int png_muldiv ( png_fixed_point_p res,
png_fixed_point a,
png_int_32 times,
png_int_32 divisor )

◆ png_muldiv_warn()

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

◆ png_pow10()

double png_pow10 ( int power)
static

◆ png_product2()

png_fixed_point png_product2 ( png_fixed_point a,
png_fixed_point b )
static

◆ png_reciprocal()

png_fixed_point png_reciprocal ( png_fixed_point a)

◆ png_reciprocal2()

png_fixed_point png_reciprocal2 ( png_fixed_point a,
png_fixed_point b )

◆ png_reset_crc()

void png_reset_crc ( png_structrp png_ptr)

◆ png_reset_zstream()

int PNGAPI png_reset_zstream ( png_structrp png_ptr)

◆ png_save_int_32()

void PNGAPI png_save_int_32 ( png_bytep buf,
png_int_32 i )

◆ png_set_sig_bytes()

void PNGAPI png_set_sig_bytes ( png_structrp png_ptr,
int num_bytes )

◆ png_sig_cmp()

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

◆ png_user_version_check()

int png_user_version_check ( png_structrp png_ptr,
png_const_charp user_png_ver )

◆ png_xy_from_XYZ()

int png_xy_from_XYZ ( png_xy * xy,
const png_XYZ * XYZ )
static

◆ png_XYZ_from_xy()

int png_XYZ_from_xy ( png_XYZ * XYZ,
const png_xy * xy )
static

◆ png_XYZ_normalize()

int png_XYZ_normalize ( png_XYZ * XYZ)
static

◆ png_zfree()

void png_zfree ( voidpf png_ptr,
voidpf ptr )

◆ png_zstream_error()

void png_zstream_error ( png_structrp png_ptr,
int ret )

Variable Documentation

◆ adler

png_uint_32 adler

◆ crc

◆ D50_nCIEXYZ

const png_byte D50_nCIEXYZ[12]
static
Initial value:
=
{ 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d }

◆ have_md5

png_byte have_md5

◆ intent

png_uint_16 intent

◆ is_broken

png_byte is_broken

◆ length

png_uint_32 length

◆ md5

png_uint_32 md5[4]

◆ [struct]

const struct { ... } png_sRGB_checks[]

◆ sRGB_xy

const png_xy sRGB_xy
static
Initial value:
=
{
64000, 33000,
30000, 60000,
15000, 6000,
31270, 32900
}