apps/png/libpng/pngwutil.c File Reference

#include "png.h"

Include dependency graph for pngwutil.c:

Go to the source code of this file.

Data Structures

struct  compression_state

Defines

#define PNG_INTERNAL
#define PNG_MAXSUM   (((png_uint_32)(-1)) >> 1)
#define PNG_HISHIFT   10
#define PNG_LOMASK   ((png_uint_32)0xffffL)
#define PNG_HIMASK   ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT))

Functions

void png_save_uint_32 (png_bytep buf, png_uint_32 i)
void png_save_int_32 (png_bytep buf, png_int_32 i)
void png_save_uint_16 (png_bytep buf, unsigned int i)
void PNGAPI png_write_chunk (png_structp png_ptr, png_bytep chunk_name, png_bytep data, png_size_t length)
void PNGAPI png_write_chunk_start (png_structp png_ptr, png_bytep chunk_name, png_uint_32 length)
void PNGAPI png_write_chunk_data (png_structp png_ptr, png_bytep data, png_size_t length)
void PNGAPI png_write_chunk_end (png_structp png_ptr)
void png_write_sig (png_structp png_ptr)
static int png_text_compress (png_structp png_ptr, png_charp text, png_size_t text_len, int compression, compression_state *comp)
static void png_write_compressed_data_out (png_structp png_ptr, compression_state *comp)
void png_write_IHDR (png_structp 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_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
void png_write_IDAT (png_structp png_ptr, png_bytep data, png_size_t length)
void png_write_IEND (png_structp png_ptr)
void png_write_gAMA (png_structp png_ptr, double file_gamma)
void png_write_gAMA_fixed (png_structp png_ptr, png_fixed_point file_gamma)
void png_write_sRGB (png_structp png_ptr, int srgb_intent)
void png_write_iCCP (png_structp png_ptr, png_charp name, int compression_type, png_charp profile, int profile_len)
void png_write_sPLT (png_structp png_ptr, png_sPLT_tp spalette)
void png_write_sBIT (png_structp png_ptr, png_color_8p sbit, int color_type)
void png_write_cHRM (png_structp png_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)
void png_write_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)
void png_write_tRNS (png_structp png_ptr, png_bytep trans, png_color_16p tran, int num_trans, int color_type)
void png_write_bKGD (png_structp png_ptr, png_color_16p back, int color_type)
void png_write_hIST (png_structp png_ptr, png_uint_16p hist, int num_hist)
png_size_t png_check_keyword (png_structp png_ptr, png_charp key, png_charpp new_key)
void png_write_tEXt (png_structp png_ptr, png_charp key, png_charp text, png_size_t text_len)
void png_write_zTXt (png_structp png_ptr, png_charp key, png_charp text, png_size_t text_len, int compression)
void png_write_oFFs (png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type)
void png_write_pCAL (png_structp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)
void png_write_sCAL (png_structp png_ptr, int unit, double width, double height)
void png_write_pHYs (png_structp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type)
void png_write_tIME (png_structp png_ptr, png_timep mod_time)
void png_write_start_row (png_structp png_ptr)
void png_write_finish_row (png_structp png_ptr)
void png_do_write_interlace (png_row_infop row_info, png_bytep row, int pass)
void png_write_find_filter (png_structp png_ptr, png_row_infop row_info)
void png_write_filtered_row (png_structp png_ptr, png_bytep filtered_row)


Define Documentation

#define PNG_HIMASK   ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT))

Definition at line 2058 of file pngwutil.c.

Referenced by png_write_find_filter().

#define PNG_HISHIFT   10

Definition at line 2056 of file pngwutil.c.

Referenced by png_write_find_filter().

#define PNG_INTERNAL

Definition at line 11 of file pngwutil.c.

#define PNG_LOMASK   ((png_uint_32)0xffffL)

Definition at line 2057 of file pngwutil.c.

Referenced by png_write_find_filter().

#define PNG_MAXSUM   (((png_uint_32)(-1)) >> 1)

Definition at line 2055 of file pngwutil.c.

Referenced by png_write_find_filter().


Function Documentation

png_size_t png_check_keyword ( png_structp  png_ptr,
png_charp  key,
png_charpp  new_key 
)

Definition at line 1174 of file pngwutil.c.

References png_debug, png_debug1, png_free(), png_malloc_warn(), png_size_t, png_strlen, png_uint_32, and png_warning().

Referenced by png_write_iCCP(), png_write_pCAL(), png_write_sPLT(), png_write_tEXt(), and png_write_zTXt().

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

Definition at line 1889 of file pngwutil.c.

References d, int, png_bytep, png_debug, png_memcpy, png_pass_inc, png_pass_start, png_size_t, png_uint_32, and value.

Referenced by png_write_row().

void png_save_int_32 ( png_bytep  buf,
png_int_32  i 
)

Definition at line 34 of file pngwutil.c.

Referenced by png_write_oFFs(), and png_write_pCAL().

void png_save_uint_16 ( png_bytep  buf,
unsigned int  i 
)

Definition at line 48 of file pngwutil.c.

Referenced by png_write_bKGD(), png_write_hIST(), png_write_sPLT(), png_write_tIME(), and png_write_tRNS().

void png_save_uint_32 ( png_bytep  buf,
png_uint_32  i 
)

Definition at line 20 of file pngwutil.c.

Referenced by png_write_cHRM(), png_write_cHRM_fixed(), png_write_chunk_end(), png_write_chunk_start(), png_write_gAMA(), png_write_gAMA_fixed(), png_write_IHDR(), and png_write_pHYs().

static int png_text_compress ( png_structp  png_ptr,
png_charp  text,
png_size_t  text_len,
int  compression,
compression_state comp 
) [static]

Definition at line 158 of file pngwutil.c.

References compression_state::input, compression_state::input_len, compression_state::max_output_ptr, compression_state::num_output_ptr, compression_state::output_ptr, png_error(), png_free(), png_malloc(), png_memcpy, png_size_t, png_sizeof, PNG_TEXT_COMPRESSION_LAST, PNG_TEXT_COMPRESSION_NONE, png_uint_32, and png_warning().

Referenced by png_write_iCCP(), and png_write_zTXt().

void png_write_bKGD ( png_structp  png_ptr,
png_color_16p  back,
int  color_type 
)

Definition at line 1081 of file pngwutil.c.

References buf, PNG_bKGD, png_bytep, PNG_COLOR_MASK_COLOR, PNG_COLOR_TYPE_PALETTE, png_debug, PNG_FLAG_MNG_EMPTY_PLTE, png_save_uint_16(), png_size_t, png_warning(), and png_write_chunk().

Referenced by png_write_info().

void png_write_cHRM ( png_structp  png_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 
)

Definition at line 907 of file pngwutil.c.

References buf, png_bytep, PNG_cHRM, png_debug, png_save_uint_32(), png_size_t, png_uint_32, png_warning(), png_write_chunk(), and stderr.

Referenced by png_write_info_before_PLTE().

void png_write_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 971 of file pngwutil.c.

References buf, png_bytep, PNG_cHRM, png_debug, png_save_uint_32(), png_size_t, png_uint_32, png_warning(), png_write_chunk(), and stderr.

Referenced by png_write_info_before_PLTE().

void PNGAPI png_write_chunk ( png_structp  png_ptr,
png_bytep  chunk_name,
png_bytep  data,
png_size_t  length 
)

Definition at line 64 of file pngwutil.c.

References png_uint_32, png_write_chunk_data(), png_write_chunk_end(), and png_write_chunk_start().

Referenced by png_write_bKGD(), png_write_cHRM(), png_write_cHRM_fixed(), png_write_gAMA(), png_write_gAMA_fixed(), png_write_IDAT(), png_write_IEND(), png_write_IHDR(), png_write_info_before_PLTE(), png_write_oFFs(), png_write_pHYs(), png_write_sBIT(), png_write_sRGB(), png_write_tIME(), and png_write_tRNS().

void PNGAPI png_write_chunk_data ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)

Definition at line 100 of file pngwutil.c.

References png_calculate_crc(), and png_write_data().

Referenced by png_write_chunk(), png_write_compressed_data_out(), png_write_hIST(), png_write_iCCP(), png_write_pCAL(), png_write_PLTE(), png_write_sCAL(), png_write_sPLT(), png_write_tEXt(), and png_write_zTXt().

void PNGAPI png_write_chunk_end ( png_structp  png_ptr  ) 

Definition at line 112 of file pngwutil.c.

References buf, png_save_uint_32(), png_size_t, and png_write_data().

Referenced by png_write_chunk(), png_write_hIST(), png_write_iCCP(), png_write_pCAL(), png_write_PLTE(), png_write_sCAL(), png_write_tEXt(), and png_write_zTXt().

void PNGAPI png_write_chunk_start ( png_structp  png_ptr,
png_bytep  chunk_name,
png_uint_32  length 
)

Definition at line 77 of file pngwutil.c.

References buf, png_calculate_crc(), png_debug2, png_reset_crc(), png_save_uint_32(), png_size_t, and png_write_data().

Referenced by png_write_chunk(), png_write_hIST(), png_write_iCCP(), png_write_pCAL(), png_write_PLTE(), png_write_sCAL(), png_write_sPLT(), png_write_tEXt(), and png_write_zTXt().

static void png_write_compressed_data_out ( png_structp  png_ptr,
compression_state comp 
) [static]

Definition at line 332 of file pngwutil.c.

References compression_state::input, compression_state::input_len, compression_state::max_output_ptr, compression_state::num_output_ptr, compression_state::output_ptr, png_bytep, png_free(), png_size_t, png_uint_32, and png_write_chunk_data().

Referenced by png_write_iCCP(), and png_write_zTXt().

void png_write_filtered_row ( png_structp  png_ptr,
png_bytep  filtered_row 
)

Definition at line 2672 of file pngwutil.c.

References png_debug, png_debug1, png_error(), and png_write_IDAT().

void png_write_find_filter ( png_structp  png_ptr,
png_row_infop  row_info 
)

Definition at line 2060 of file pngwutil.c.

References int, png_bytep, png_debug, PNG_FILTER_HEURISTIC_WEIGHTED, PNG_FILTER_NONE, PNG_FILTER_VALUE_NONE, PNG_HIMASK, PNG_HISHIFT, PNG_LOMASK, PNG_MAXSUM, png_uint_32, and rp.

Referenced by png_write_row().

void png_write_finish_row ( png_structp  png_ptr  ) 

Definition at line 1772 of file pngwutil.c.

References png_debug, png_error(), png_memset, png_pass_inc, png_pass_start, png_pass_yinc, png_pass_ystart, png_size_t, and png_write_IDAT().

Referenced by png_write_row().

void png_write_gAMA ( png_structp  png_ptr,
double  file_gamma 
)

Definition at line 668 of file pngwutil.c.

References buf, png_bytep, png_debug, PNG_gAMA, png_save_uint_32(), png_size_t, png_uint_32, and png_write_chunk().

Referenced by png_write_info_before_PLTE().

void png_write_gAMA_fixed ( png_structp  png_ptr,
png_fixed_point  file_gamma 
)

Definition at line 685 of file pngwutil.c.

References buf, png_bytep, png_debug, PNG_gAMA, png_save_uint_32(), png_size_t, png_uint_32, and png_write_chunk().

Referenced by png_write_info_before_PLTE().

void png_write_hIST ( png_structp  png_ptr,
png_uint_16p  hist,
int  num_hist 
)

Definition at line 1134 of file pngwutil.c.

References buf, png_bytep, png_debug, png_debug2, PNG_hIST, png_save_uint_16(), png_size_t, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), and png_write_chunk_start().

Referenced by png_write_info().

void png_write_iCCP ( png_structp  png_ptr,
png_charp  name,
int  compression_type,
png_charp  profile,
int  profile_len 
)

Definition at line 722 of file pngwutil.c.

References png_bytep, png_check_keyword(), PNG_COMPRESSION_TYPE_BASE, png_debug, png_free(), PNG_iCCP, png_size_t, png_text_compress(), png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), png_write_chunk_start(), and png_write_compressed_data_out().

Referenced by png_write_info_before_PLTE().

void png_write_IDAT ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)

Definition at line 601 of file pngwutil.c.

References png_bytep, PNG_COMPRESSION_TYPE_BASE, png_debug, png_error(), PNG_IDAT, png_uint_32, and png_write_chunk().

Referenced by png_write_filtered_row(), png_write_finish_row(), and png_write_flush().

void png_write_IEND ( png_structp  png_ptr  ) 

Definition at line 653 of file pngwutil.c.

References png_bytep, png_bytep_NULL, png_debug, PNG_IEND, png_size_t, and png_write_chunk().

void png_write_IHDR ( png_structp  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 
)

Definition at line 371 of file pngwutil.c.

References buf, PNG_ALL_FILTERS, png_bytep, PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, PNG_COLOR_TYPE_RGB_ALPHA, PNG_COMPRESSION_TYPE_BASE, png_debug, png_error(), PNG_FILTER_NONE, PNG_FILTER_TYPE_BASE, PNG_FLAG_MNG_FILTER_64, PNG_IHDR, PNG_INTERLACE_ADAM7, PNG_INTERLACE_NONE, PNG_INTRAPIXEL_DIFFERENCING, png_save_uint_32(), png_size_t, png_warning(), png_write_chunk(), png_zalloc(), and png_zfree().

Referenced by png_write_info_before_PLTE().

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

Definition at line 1471 of file pngwutil.c.

References buf, png_bytep, png_debug, PNG_oFFs, PNG_OFFSET_LAST, png_save_int_32(), png_size_t, png_warning(), and png_write_chunk().

Referenced by png_write_info().

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

Definition at line 1494 of file pngwutil.c.

References buf, png_bytep, png_check_keyword(), png_debug1, png_debug2, PNG_EQUATION_LAST, png_free(), png_malloc(), PNG_pCAL, png_save_int_32(), png_size_t, png_sizeof, png_strlen, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), and png_write_chunk_start().

Referenced by png_write_info().

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

Definition at line 1623 of file pngwutil.c.

References buf, png_bytep, png_debug, PNG_pHYs, PNG_RESOLUTION_LAST, png_save_uint_32(), png_size_t, png_warning(), and png_write_chunk().

Referenced by png_write_info().

void png_write_PLTE ( png_structp  png_ptr,
png_colorp  palette,
png_uint_32  num_pal 
)

Definition at line 538 of file pngwutil.c.

References buf, png_bytep, PNG_COLOR_MASK_COLOR, PNG_COLOR_TYPE_PALETTE, png_debug, png_debug1, png_error(), PNG_FLAG_MNG_EMPTY_PLTE, PNG_PLTE, png_size_t, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), png_write_chunk_start(), and red.

Referenced by png_write_info().

void png_write_sBIT ( png_structp  png_ptr,
png_color_8p  sbit,
int  color_type 
)

Definition at line 850 of file pngwutil.c.

References buf, png_bytep, PNG_COLOR_MASK_ALPHA, PNG_COLOR_MASK_COLOR, PNG_COLOR_TYPE_PALETTE, png_debug, PNG_sBIT, png_size_t, png_warning(), png_write_chunk(), and size.

Referenced by png_write_info_before_PLTE().

void png_write_sCAL ( png_structp  png_ptr,
int  unit,
double  width,
double  height 
)

Definition at line 1555 of file pngwutil.c.

References png_bytep, png_debug, png_debug1, PNG_sCAL, png_size_t, png_strlen, png_uint_32, png_write_chunk_data(), png_write_chunk_end(), png_write_chunk_start(), and wbuf.

Referenced by png_write_info().

void png_write_sig ( png_structp  png_ptr  ) 

Definition at line 129 of file pngwutil.c.

References png_size_t, and png_write_data().

Referenced by png_write_info_before_PLTE().

void png_write_sPLT ( png_structp  png_ptr,
png_sPLT_tp  spalette 
)

Definition at line 767 of file pngwutil.c.

References entries, green, png_bytep, png_check_keyword(), png_debug, png_save_uint_16(), png_size_t, PNG_sPLT, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_start(), and red.

Referenced by png_write_info().

void png_write_sRGB ( png_structp  png_ptr,
int  srgb_intent 
)

Definition at line 703 of file pngwutil.c.

References buf, png_bytep, png_debug, png_size_t, PNG_sRGB, PNG_sRGB_INTENT_LAST, png_warning(), and png_write_chunk().

Referenced by png_write_info_before_PLTE().

void png_write_start_row ( png_structp  png_ptr  ) 

Definition at line 1678 of file pngwutil.c.

References buf_size, png_bytep, png_debug, PNG_FILTER_AVG, PNG_FILTER_PAETH, PNG_FILTER_SUB, PNG_FILTER_UP, PNG_FILTER_VALUE_AVG, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_PAETH, PNG_FILTER_VALUE_SUB, PNG_FILTER_VALUE_UP, png_malloc(), png_memset, png_pass_inc, png_pass_start, png_pass_yinc, png_pass_ystart, png_size_t, and png_uint_32.

Referenced by png_write_row().

void png_write_tEXt ( png_structp  png_ptr,
png_charp  key,
png_charp  text,
png_size_t  text_len 
)

Definition at line 1293 of file pngwutil.c.

References png_bytep, png_check_keyword(), png_debug, png_free(), png_size_t, png_strlen, PNG_tEXt, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), and png_write_chunk_start().

Referenced by png_write_end(), and png_write_zTXt().

void png_write_tIME ( png_structp  png_ptr,
png_timep  mod_time 
)

Definition at line 1649 of file pngwutil.c.

References buf, png_bytep, png_debug, png_save_uint_16(), png_size_t, PNG_tIME, png_warning(), and png_write_chunk().

Referenced by png_write_end(), and png_write_info().

void png_write_tRNS ( png_structp  png_ptr,
png_bytep  trans,
png_color_16p  tran,
int  num_trans,
int  color_type 
)

Definition at line 1026 of file pngwutil.c.

References buf, png_bytep, PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, png_debug, png_save_uint_16(), png_size_t, PNG_tRNS, png_warning(), and png_write_chunk().

Referenced by png_write_info().

void png_write_zTXt ( png_structp  png_ptr,
png_charp  key,
png_charp  text,
png_size_t  text_len,
int  compression 
)

Definition at line 1334 of file pngwutil.c.

References buf, png_bytep, png_check_keyword(), png_debug, png_free(), png_size_t, png_strlen, png_text_compress(), PNG_TEXT_COMPRESSION_NONE, png_uint_32, png_warning(), png_write_chunk_data(), png_write_chunk_end(), png_write_chunk_start(), png_write_compressed_data_out(), png_write_tEXt(), and PNG_zTXt.

Referenced by png_write_end(), and png_write_info().


Generated on Fri Nov 28 00:07:21 2008 for elphel by  doxygen 1.5.1