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)  

pngwrite.c File Reference
#include "pngpriv.h"
#include <errno.h>
Include dependency graph for pngwrite.c:

Go to the source code of this file.

Data Structures

struct  png_image_write_control
 

Macros

#define UNP_RECIPROCAL(alpha)   ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)
 

Functions

static void write_unknown_chunks (png_structrp png_ptr, png_const_inforp info_ptr, unsigned int where)
 
void png_write_info_before_PLTE (png_structrp png_ptr, png_const_inforp info_ptr)
 
void png_write_info (png_structrp png_ptr, png_const_inforp info_ptr)
 
void png_write_end (png_structrp png_ptr, png_inforp info_ptr)
 
void png_convert_from_struct_tm (png_timep ptime, const struct tm *ttime)
 
void png_convert_from_time_t (png_timep ptime, time_t ttime)
 
png_structp png_create_write_struct (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
 
png_structp png_create_write_struct_2 (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)
 
void png_write_rows (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)
 
void png_write_image (png_structrp png_ptr, png_bytepp image)
 
static void png_do_write_intrapixel (png_row_infop row_info, png_bytep row)
 
void png_write_row (png_structrp png_ptr, png_const_bytep row)
 
void png_set_flush (png_structrp png_ptr, int nrows)
 
void png_write_flush (png_structrp png_ptr)
 
static void png_write_destroy (png_structrp png_ptr)
 
void png_destroy_write_struct (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
 
void png_set_filter (png_structrp png_ptr, int method, int filters)
 
void png_set_filter_heuristics (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)
 
void png_set_filter_heuristics_fixed (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)
 
void png_set_compression_level (png_structrp png_ptr, int level)
 
void png_set_compression_mem_level (png_structrp png_ptr, int mem_level)
 
void png_set_compression_strategy (png_structrp png_ptr, int strategy)
 
void png_set_compression_window_bits (png_structrp png_ptr, int window_bits)
 
void png_set_compression_method (png_structrp png_ptr, int method)
 
void png_set_text_compression_level (png_structrp png_ptr, int level)
 
void png_set_text_compression_mem_level (png_structrp png_ptr, int mem_level)
 
void png_set_text_compression_strategy (png_structrp png_ptr, int strategy)
 
void png_set_text_compression_window_bits (png_structrp png_ptr, int window_bits)
 
void png_set_text_compression_method (png_structrp png_ptr, int method)
 
void png_set_write_status_fn (png_structrp png_ptr, png_write_status_ptr write_row_fn)
 
void png_set_write_user_transform_fn (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)
 
void png_write_png (png_structrp png_ptr, png_inforp info_ptr, int transforms, voidp params)
 
static int png_image_write_init (png_imagep image)
 
static int png_write_image_16bit (png_voidp argument)
 
static png_byte png_unpremultiply (png_uint_32 component, png_uint_32 alpha, png_uint_32 reciprocal)
 
static int png_write_image_8bit (png_voidp argument)
 
static void png_image_set_PLTE (png_image_write_control *display)
 
static int png_image_write_main (png_voidp argument)
 
static void() image_memory_write (png_structp png_ptr, png_bytep data, png_size_t size)
 
static void() image_memory_flush (png_structp png_ptr)
 
static int png_image_write_memory (png_voidp argument)
 
int png_image_write_to_memory (png_imagep image, void *memory, png_alloc_size_t *memory_bytes, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)
 
int png_image_write_to_stdio (png_imagep image, FILE *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)
 
int png_image_write_to_file (png_imagep image, const char *file_name, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)
 

Macro Definition Documentation

◆ UNP_RECIPROCAL

#define UNP_RECIPROCAL (   alpha)    ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)

Definition at line 1639 of file pngwrite.c.

Function Documentation

◆ image_memory_flush()

static void() image_memory_flush ( png_structp  png_ptr)
static

Definition at line 2191 of file pngwrite.c.

References PNG_UNUSED.

Referenced by png_image_write_memory().

◆ image_memory_write()

static void() image_memory_write ( png_structp  png_ptr,
png_bytep  data,
png_size_t  size 
)
static

◆ png_convert_from_struct_tm()

void png_convert_from_struct_tm ( png_timep  ptime,
const struct tm *  ttime 
)

◆ png_convert_from_time_t()

void png_convert_from_time_t ( png_timep  ptime,
time_t  ttime 
)

Definition at line 485 of file pngwrite.c.

References png_convert_from_struct_tm(), and png_debug.

◆ png_create_write_struct()

png_structp png_create_write_struct ( png_const_charp  user_png_ver,
png_voidp  error_ptr,
png_error_ptr  error_fn,
png_error_ptr  warn_fn 
)

Definition at line 499 of file pngwrite.c.

References png_create_png_struct(), and png_create_write_struct_2().

Referenced by main(), and png_image_write_init().

◆ png_create_write_struct_2()

◆ png_destroy_write_struct()

void png_destroy_write_struct ( png_structpp  png_ptr_ptr,
png_infopp  info_ptr_ptr 
)

◆ png_do_write_intrapixel()

static void png_do_write_intrapixel ( png_row_infop  row_info,
png_bytep  row 
)
static

◆ png_image_set_PLTE()

◆ png_image_write_init()

◆ png_image_write_main()

◆ png_image_write_memory()

static int png_image_write_memory ( png_voidp  argument)
static

◆ png_image_write_to_file()

int png_image_write_to_file ( png_imagep  image,
const char *  file_name,
int  convert_to_8bit,
const void *  buffer,
png_int_32  row_stride,
const void *  colormap 
)

Definition at line 2329 of file pngwrite.c.

References buffer, png_image_error(), and png_image_write_to_stdio().

◆ png_image_write_to_memory()

◆ png_image_write_to_stdio()

int png_image_write_to_stdio ( png_imagep  image,
FILE *  file,
int  convert_to_8bit,
const void *  buffer,
png_int_32  row_stride,
const void *  colormap 
)

◆ png_set_compression_level()

void png_set_compression_level ( png_structrp  png_ptr,
int  level 
)

Definition at line 1158 of file pngwrite.c.

References png_debug.

Referenced by main(), and png_image_write_main().

◆ png_set_compression_mem_level()

void png_set_compression_mem_level ( png_structrp  png_ptr,
int  mem_level 
)

Definition at line 1169 of file pngwrite.c.

References png_debug.

Referenced by main().

◆ png_set_compression_method()

void png_set_compression_method ( png_structrp  png_ptr,
int  method 
)

Definition at line 1224 of file pngwrite.c.

References method, png_debug, and png_warning().

◆ png_set_compression_strategy()

void png_set_compression_strategy ( png_structrp  png_ptr,
int  strategy 
)

Definition at line 1180 of file pngwrite.c.

References png_struct_def::flags, png_debug, and PNG_FLAG_ZLIB_CUSTOM_STRATEGY.

Referenced by main().

◆ png_set_compression_window_bits()

void png_set_compression_window_bits ( png_structrp  png_ptr,
int  window_bits 
)

Definition at line 1197 of file pngwrite.c.

References png_warning().

Referenced by main().

◆ png_set_filter()

◆ png_set_filter_heuristics()

void png_set_filter_heuristics ( png_structrp  png_ptr,
int  heuristic_method,
int  num_weights,
png_const_doublep  filter_weights,
png_const_doublep  filter_costs 
)

Definition at line 1129 of file pngwrite.c.

References PNG_UNUSED.

◆ png_set_filter_heuristics_fixed()

void png_set_filter_heuristics_fixed ( png_structrp  png_ptr,
int  heuristic_method,
int  num_weights,
png_const_fixed_point_p  filter_weights,
png_const_fixed_point_p  filter_costs 
)

Definition at line 1143 of file pngwrite.c.

References PNG_UNUSED.

◆ png_set_flush()

void png_set_flush ( png_structrp  png_ptr,
int  nrows 
)

Definition at line 908 of file pngwrite.c.

References png_debug.

◆ png_set_text_compression_level()

void png_set_text_compression_level ( png_structrp  png_ptr,
int  level 
)

Definition at line 1244 of file pngwrite.c.

References png_debug.

◆ png_set_text_compression_mem_level()

void png_set_text_compression_mem_level ( png_structrp  png_ptr,
int  mem_level 
)

Definition at line 1255 of file pngwrite.c.

References png_debug.

◆ png_set_text_compression_method()

void png_set_text_compression_method ( png_structrp  png_ptr,
int  method 
)

Definition at line 1301 of file pngwrite.c.

References method, png_debug, and png_warning().

◆ png_set_text_compression_strategy()

void png_set_text_compression_strategy ( png_structrp  png_ptr,
int  strategy 
)

Definition at line 1266 of file pngwrite.c.

References png_debug.

◆ png_set_text_compression_window_bits()

void png_set_text_compression_window_bits ( png_structrp  png_ptr,
int  window_bits 
)

Definition at line 1280 of file pngwrite.c.

References png_warning().

◆ png_set_write_status_fn()

void png_set_write_status_fn ( png_structrp  png_ptr,
png_write_status_ptr  write_row_fn 
)

Definition at line 1317 of file pngwrite.c.

References png_struct_def::write_row_fn.

◆ png_set_write_user_transform_fn()

void png_set_write_user_transform_fn ( png_structrp  png_ptr,
png_user_transform_ptr  write_user_transform_fn 
)

Definition at line 1327 of file pngwrite.c.

References png_debug, PNG_USER_TRANSFORM, and png_struct_def::transformations.

◆ png_unpremultiply()

static png_byte png_unpremultiply ( png_uint_32  component,
png_uint_32  alpha,
png_uint_32  reciprocal 
)
static

Definition at line 1642 of file pngwrite.c.

References PNG_sRGB_FROM_LINEAR.

Referenced by png_image_set_PLTE(), and png_write_image_8bit().

◆ png_write_destroy()

◆ png_write_end()

◆ png_write_flush()

void png_write_flush ( png_structrp  png_ptr)

◆ png_write_image()

void png_write_image ( png_structrp  png_ptr,
png_bytepp  image 
)

Definition at line 601 of file pngwrite.c.

References png_struct_def::height, png_debug, png_set_interlace_handling(), and png_write_row().

Referenced by png_write_png().

◆ png_write_image_16bit()

◆ png_write_image_8bit()

◆ png_write_info()

◆ png_write_info_before_PLTE()

◆ png_write_png()

◆ png_write_row()

◆ png_write_rows()

void png_write_rows ( png_structrp  png_ptr,
png_bytepp  row,
png_uint_32  num_rows 
)

Definition at line 579 of file pngwrite.c.

References png_debug, and png_write_row().

Referenced by main().

◆ write_unknown_chunks()

static void write_unknown_chunks ( png_structrp  png_ptr,
png_const_inforp  info_ptr,
unsigned int  where 
)
static