pngcrush  1.8.13
About: Pngcrush is an optimizer for PNG (Portable Network Graphics) files.
  Fossies Dox: pngcrush-1.8.13.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

pngwutil.c File Reference
#include "pngpriv.h"
Include dependency graph for pngwutil.c:

Go to the source code of this file.

Data Structures

struct  compression_state
 

Functions

void png_save_uint_32 (png_bytep buf, png_uint_32 i)
 
void png_save_uint_16 (png_bytep buf, unsigned int i)
 
void png_write_sig (png_structrp png_ptr)
 
static void png_write_chunk_header (png_structrp png_ptr, png_uint_32 chunk_name, png_uint_32 length)
 
void png_write_chunk_start (png_structrp png_ptr, png_const_bytep chunk_string, png_uint_32 length)
 
void png_write_chunk_data (png_structrp png_ptr, png_const_bytep data, png_size_t length)
 
void png_write_chunk_end (png_structrp png_ptr)
 
static void png_write_complete_chunk (png_structrp png_ptr, png_uint_32 chunk_name, png_const_bytep data, png_size_t length)
 
void png_write_chunk (png_structrp png_ptr, png_const_bytep chunk_string, png_const_bytep data, png_size_t length)
 
static png_alloc_size_t png_image_size (png_structrp png_ptr)
 
static void optimize_cmf (png_bytep data, png_alloc_size_t data_size)
 
static int png_deflate_claim (png_structrp png_ptr, png_uint_32 owner, png_alloc_size_t data_size)
 
void png_free_buffer_list (png_structrp png_ptr, png_compression_bufferp *listp)
 
static void png_text_compress_init (compression_state *comp, png_const_bytep input, png_alloc_size_t input_len)
 
static int png_text_compress (png_structrp png_ptr, png_uint_32 chunk_name, compression_state *comp, png_uint_32 prefix_len)
 
static void png_write_compressed_data_out (png_structrp png_ptr, compression_state *comp)
 
void png_write_IHDR (png_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_type, int filter_type, int interlace_type)
 
void png_write_PLTE (png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal)
 
void png_compress_IDAT (png_structrp png_ptr, png_const_bytep input, png_alloc_size_t input_len, int flush)
 
void png_write_IEND (png_structrp png_ptr)
 
void png_write_gAMA_fixed (png_structrp png_ptr, png_fixed_point file_gamma)
 
void png_write_sRGB (png_structrp png_ptr, int srgb_intent)
 
void png_write_iCCP (png_structrp png_ptr, png_const_charp name, png_const_bytep profile)
 
void png_write_sPLT (png_structrp png_ptr, png_const_sPLT_tp spalette)
 
void png_write_sBIT (png_structrp png_ptr, png_const_color_8p sbit, int color_type)
 
void png_write_cHRM_fixed (png_structrp png_ptr, const png_xy *xy)
 
void png_write_tRNS (png_structrp png_ptr, png_const_bytep trans_alpha, png_const_color_16p tran, int num_trans, int color_type)
 
void png_write_bKGD (png_structrp png_ptr, png_const_color_16p back, int color_type)
 
void png_write_eXIf (png_structrp png_ptr, png_bytep exif, int num_exif)
 
void png_write_hIST (png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
 
void png_write_tEXt (png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len)
 
void png_write_zTXt (png_structrp png_ptr, png_const_charp key, png_const_charp text, int compression)
 
void png_write_iTXt (png_structrp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text)
 
void png_write_oFFs (png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type)
 
void png_write_pCAL (png_structrp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)
 
void png_write_sCAL_s (png_structrp png_ptr, int unit, png_const_charp width, png_const_charp height)
 
void png_write_pHYs (png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type)
 
void png_write_tIME (png_structrp png_ptr, png_const_timep mod_time)
 
void png_write_start_row (png_structrp png_ptr)
 
void png_write_finish_row (png_structrp png_ptr)
 
void png_do_write_interlace (png_row_infop row_info, png_bytep row, int pass)
 
static void png_write_filtered_row (png_structrp png_ptr, png_bytep filtered_row, png_size_t row_bytes)
 
static png_size_t png_setup_sub_row (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes, const png_size_t lmins)
 
static void png_setup_sub_row_only (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes)
 
static png_size_t png_setup_up_row (png_structrp png_ptr, const png_size_t row_bytes, const png_size_t lmins)
 
static void png_setup_up_row_only (png_structrp png_ptr, const png_size_t row_bytes)
 
static png_size_t png_setup_avg_row (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes, const png_size_t lmins)
 
static void png_setup_avg_row_only (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes)
 
static png_size_t png_setup_paeth_row (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes, const png_size_t lmins)
 
static void png_setup_paeth_row_only (png_structrp png_ptr, const png_uint_32 bpp, const png_size_t row_bytes)
 
void png_write_find_filter (png_structrp png_ptr, png_row_infop row_info)
 

Function Documentation

◆ optimize_cmf()

static void optimize_cmf ( png_bytep  data,
png_alloc_size_t  data_size 
)
static

Definition at line 251 of file pngwutil.c.

Referenced by png_compress_IDAT(), and png_text_compress().

◆ png_compress_IDAT()

◆ png_deflate_claim()

◆ png_do_write_interlace()

void png_do_write_interlace ( png_row_infop  row_info,
png_bytep  row,
int  pass 
)

◆ png_free_buffer_list()

void png_free_buffer_list ( png_structrp  png_ptr,
png_compression_bufferp *  listp 
)

Definition at line 440 of file pngwutil.c.

References png_free().

Referenced by png_compress_IDAT(), png_set_compression_buffer_size(), and png_write_destroy().

◆ png_image_size()

◆ png_save_uint_16()

void png_save_uint_16 ( png_bytep  buf,
unsigned int  i 
)

◆ png_save_uint_32()

void png_save_uint_32 ( png_bytep  buf,
png_uint_32  i 
)

◆ png_setup_avg_row()

static png_size_t png_setup_avg_row ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes,
const png_size_t  lmins 
)
static

◆ png_setup_avg_row_only()

static void png_setup_avg_row_only ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes 
)
static

◆ png_setup_paeth_row()

static png_size_t png_setup_paeth_row ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes,
const png_size_t  lmins 
)
static

◆ png_setup_paeth_row_only()

static void png_setup_paeth_row_only ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes 
)
static

◆ png_setup_sub_row()

static png_size_t png_setup_sub_row ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes,
const png_size_t  lmins 
)
static

Definition at line 2281 of file pngwutil.c.

References PNG_FILTER_VALUE_SUB, and png_struct_def::row_buf.

Referenced by png_write_find_filter().

◆ png_setup_sub_row_only()

static void png_setup_sub_row_only ( png_structrp  png_ptr,
const png_uint_32  bpp,
const png_size_t  row_bytes 
)
static

Definition at line 2320 of file pngwutil.c.

References PNG_FILTER_VALUE_SUB, and png_struct_def::row_buf.

Referenced by png_write_find_filter().

◆ png_setup_up_row()

static png_size_t png_setup_up_row ( png_structrp  png_ptr,
const png_size_t  row_bytes,
const png_size_t  lmins 
)
static

◆ png_setup_up_row_only()

static void png_setup_up_row_only ( png_structrp  png_ptr,
const png_size_t  row_bytes 
)
static

◆ png_text_compress()

◆ png_text_compress_init()

static void png_text_compress_init ( compression_state comp,
png_const_bytep  input,
png_alloc_size_t  input_len 
)
static

◆ png_write_bKGD()

◆ png_write_cHRM_fixed()

void png_write_cHRM_fixed ( png_structrp  png_ptr,
const png_xy *  xy 
)

Definition at line 1324 of file pngwutil.c.

References png_cHRM, png_debug, png_save_int_32(), and png_write_complete_chunk().

Referenced by png_write_info_before_PLTE().

◆ png_write_chunk()

void png_write_chunk ( png_structrp  png_ptr,
png_const_bytep  chunk_string,
png_const_bytep  data,
png_size_t  length 
)

◆ png_write_chunk_data()

◆ png_write_chunk_end()

◆ png_write_chunk_header()

◆ png_write_chunk_start()

void png_write_chunk_start ( png_structrp  png_ptr,
png_const_bytep  chunk_string,
png_uint_32  length 
)

Definition at line 115 of file pngwutil.c.

References length, PNG_CHUNK_FROM_STRING, and png_write_chunk_header().

◆ png_write_complete_chunk()

◆ png_write_compressed_data_out()

static void png_write_compressed_data_out ( png_structrp  png_ptr,
compression_state comp 
)
static

◆ png_write_eXIf()

void png_write_eXIf ( png_structrp  png_ptr,
png_bytep  exif,
int  num_exif 
)

◆ png_write_filtered_row()

static void png_write_filtered_row ( png_structrp  png_ptr,
png_bytep  filtered_row,
png_size_t  row_bytes 
)
static

◆ png_write_find_filter()

◆ png_write_finish_row()

◆ png_write_gAMA_fixed()

void png_write_gAMA_fixed ( png_structrp  png_ptr,
png_fixed_point  file_gamma 
)

Definition at line 1085 of file pngwutil.c.

References png_debug, png_gAMA, png_save_uint_32(), and png_write_complete_chunk().

Referenced by png_write_info_before_PLTE().

◆ png_write_hIST()

void png_write_hIST ( png_structrp  png_ptr,
png_const_uint_16p  hist,
int  num_hist 
)

◆ png_write_iCCP()

◆ png_write_IEND()

void png_write_IEND ( png_structrp  png_ptr)

Definition at line 1074 of file pngwutil.c.

References png_struct_def::mode, png_debug, PNG_HAVE_IEND, png_IEND, and png_write_complete_chunk().

Referenced by png_write_end().

◆ png_write_IHDR()

◆ png_write_iTXt()

◆ png_write_oFFs()

void png_write_oFFs ( png_structrp  png_ptr,
png_int_32  x_offset,
png_int_32  y_offset,
int  unit_type 
)

◆ png_write_pCAL()

void png_write_pCAL ( png_structrp  png_ptr,
png_charp  purpose,
png_int_32  X0,
png_int_32  X1,
int  type,
int  nparams,
png_const_charp  units,
png_charpp  params 
)

◆ png_write_pHYs()

void png_write_pHYs ( png_structrp  png_ptr,
png_uint_32  x_pixels_per_unit,
png_uint_32  y_pixels_per_unit,
int  unit_type 
)

◆ png_write_PLTE()

◆ png_write_sBIT()

◆ png_write_sCAL_s()

void png_write_sCAL_s ( png_structrp  png_ptr,
int  unit,
png_const_charp  width,
png_const_charp  height 
)

Definition at line 1811 of file pngwutil.c.

References height, png_debug, png_debug1, png_sCAL, png_warning(), png_write_complete_chunk(), and width.

Referenced by png_write_info().

◆ png_write_sig()

void png_write_sig ( png_structrp  png_ptr)

◆ png_write_sPLT()

◆ png_write_sRGB()

void png_write_sRGB ( png_structrp  png_ptr,
int  srgb_intent 
)

◆ png_write_start_row()

◆ png_write_tEXt()

◆ png_write_tIME()

void png_write_tIME ( png_structrp  png_ptr,
png_const_timep  mod_time 
)

◆ png_write_tRNS()

◆ png_write_zTXt()