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)  

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

Go to the source code of this file.

Data Structures

struct  png_dsort_struct
 

Macros

#define CHOP(x)   (x)=((png_uint_16)PNG_DIV257(x))
 

Typedefs

typedef struct png_dsort_struct png_dsort
 
typedef png_dsortpng_dsortp
 
typedef png_dsort ** png_dsortpp
 

Functions

void png_set_crc_action (png_structrp png_ptr, int crit_action, int ancil_action)
 
static int png_rtran_ok (png_structrp png_ptr, int need_IHDR)
 
void png_set_background_fixed (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)
 
void png_set_background (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)
 
void png_set_scale_16 (png_structrp png_ptr)
 
void png_set_strip_16 (png_structrp png_ptr)
 
void png_set_strip_alpha (png_structrp png_ptr)
 
static png_fixed_point translate_gamma_flags (png_structrp png_ptr, png_fixed_point output_gamma, int is_screen)
 
static png_fixed_point convert_gamma_value (png_structrp png_ptr, double output_gamma)
 
void png_set_alpha_mode_fixed (png_structrp png_ptr, int mode, png_fixed_point output_gamma)
 
void png_set_alpha_mode (png_structrp png_ptr, int mode, double output_gamma)
 
void png_set_quantize (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)
 
void png_set_gamma_fixed (png_structrp png_ptr, png_fixed_point scrn_gamma, png_fixed_point file_gamma)
 
void png_set_gamma (png_structrp png_ptr, double scrn_gamma, double file_gamma)
 
void png_set_expand (png_structrp png_ptr)
 
void png_set_palette_to_rgb (png_structrp png_ptr)
 
void png_set_expand_gray_1_2_4_to_8 (png_structrp png_ptr)
 
void png_set_tRNS_to_alpha (png_structrp png_ptr)
 
void png_set_expand_16 (png_structrp png_ptr)
 
void png_set_gray_to_rgb (png_structrp png_ptr)
 
void png_set_rgb_to_gray_fixed (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)
 
void png_set_rgb_to_gray (png_structrp png_ptr, int error_action, double red, double green)
 
void png_set_read_user_transform_fn (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)
 
static int png_gamma_threshold (png_fixed_point screen_gamma, png_fixed_point file_gamma)
 
static void png_init_palette_transformations (png_structrp png_ptr)
 
static void png_init_rgb_transformations (png_structrp png_ptr)
 
void png_init_read_transformations (png_structrp png_ptr)
 
void png_read_transform_info (png_structrp png_ptr, png_inforp info_ptr)
 
static void png_do_unpack (png_row_infop row_info, png_bytep row)
 
static void png_do_unshift (png_row_infop row_info, png_bytep row, png_const_color_8p sig_bits)
 
static void png_do_scale_16_to_8 (png_row_infop row_info, png_bytep row)
 
static void png_do_chop (png_row_infop row_info, png_bytep row)
 
static void png_do_read_swap_alpha (png_row_infop row_info, png_bytep row)
 
static void png_do_read_invert_alpha (png_row_infop row_info, png_bytep row)
 
static void png_do_read_filler (png_row_infop row_info, png_bytep row, png_uint_32 filler, png_uint_32 flags)
 
static void png_do_gray_to_rgb (png_row_infop row_info, png_bytep row)
 
static int png_do_rgb_to_gray (png_structrp png_ptr, png_row_infop row_info, png_bytep row)
 
static void png_do_compose (png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 
static void png_do_gamma (png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 
static void png_do_encode_alpha (png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 
static void png_do_expand_palette (png_row_infop row_info, png_bytep row, png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
 
static void png_do_expand (png_row_infop row_info, png_bytep row, png_const_color_16p trans_color)
 
static void png_do_expand_16 (png_row_infop row_info, png_bytep row)
 
static void png_do_quantize (png_row_infop row_info, png_bytep row, png_const_bytep palette_lookup, png_const_bytep quantize_lookup)
 
void png_do_read_transformations (png_structrp png_ptr, png_row_infop row_info)
 

Macro Definition Documentation

◆ CHOP

#define CHOP (   x)    (x)=((png_uint_16)PNG_DIV257(x))

Typedef Documentation

◆ png_dsort

typedef struct png_dsort_struct png_dsort

◆ png_dsortp

Definition at line 413 of file pngrtran.c.

◆ png_dsortpp

typedef png_dsort* * png_dsortpp

Definition at line 414 of file pngrtran.c.

Function Documentation

◆ convert_gamma_value()

static png_fixed_point convert_gamma_value ( png_structrp  png_ptr,
double  output_gamma 
)
static

Definition at line 251 of file pngrtran.c.

References png_fixed_error(), PNG_FP_1, PNG_FP_MAX, and PNG_FP_MIN.

Referenced by png_set_alpha_mode(), and png_set_gamma().

◆ png_do_chop()

◆ png_do_compose()

◆ png_do_encode_alpha()

◆ png_do_expand()

◆ png_do_expand_16()

◆ png_do_expand_palette()

◆ png_do_gamma()

◆ png_do_gray_to_rgb()

◆ png_do_quantize()

◆ png_do_read_filler()

◆ png_do_read_invert_alpha()

◆ png_do_read_swap_alpha()

◆ png_do_read_transformations()

void png_do_read_transformations ( png_structrp  png_ptr,
png_row_infop  row_info 
)

Definition at line 4715 of file pngrtran.c.

References png_struct_def::channels, png_struct_def::color_type, png_row_info_struct::color_type, png_struct_def::flags, png_struct_def::mode, png_struct_def::num_trans, png_struct_def::palette, png_struct_def::pixel_depth, PNG_16_TO_8, PNG_BACKGROUND_IS_GRAY, PNG_BGR, PNG_COLOR_MASK_ALPHA, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB_ALPHA, PNG_COMPOSE, png_debug, png_do_bgr(), png_do_check_palette_indexes(), png_do_chop(), png_do_compose(), png_do_encode_alpha(), png_do_expand(), png_do_expand_16(), png_do_expand_palette(), png_do_gamma(), png_do_gray_to_rgb(), png_do_invert(), png_do_packswap(), png_do_quantize(), png_do_read_filler(), png_do_read_invert_alpha(), png_do_read_swap_alpha(), png_do_rgb_to_gray(), png_do_scale_16_to_8(), png_do_strip_channel(), png_do_swap(), png_do_unpack(), png_do_unshift(), PNG_ENCODE_ALPHA, png_error(), PNG_EXPAND, PNG_EXPAND_16, PNG_EXPAND_tRNS, PNG_FILLER, PNG_FLAG_DETECT_UNINITIALIZED, PNG_FLAG_ROW_INIT, PNG_GAMMA, PNG_GRAY_TO_RGB, PNG_INVERT_ALPHA, PNG_INVERT_MONO, PNG_PACK, PNG_PACKSWAP, PNG_QUANTIZE, PNG_READ_ALPHA_MODE_SUPPORTED, PNG_READ_BACKGROUND_SUPPORTED, PNG_READ_RGB_TO_GRAY_SUPPORTED, PNG_RGB_TO_GRAY, PNG_RGB_TO_GRAY_ERR, PNG_RGB_TO_GRAY_WARN, PNG_ROWBYTES, PNG_SCALE_16_TO_8, PNG_SHIFT, PNG_STRIP_ALPHA, PNG_SWAP_ALPHA, PNG_SWAP_BYTES, PNG_USER_TRANSFORM, png_warning(), png_struct_def::row_buf, png_row_info_struct::rowbytes, and png_struct_def::transformations.

Referenced by png_push_process_row(), and png_read_row().

◆ png_do_rgb_to_gray()

◆ png_do_scale_16_to_8()

◆ png_do_unpack()

◆ png_do_unshift()

◆ png_gamma_threshold()

static int png_gamma_threshold ( png_fixed_point  screen_gamma,
png_fixed_point  file_gamma 
)
static

Definition at line 1079 of file pngrtran.c.

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

Referenced by png_init_read_transformations().

◆ png_init_palette_transformations()

◆ png_init_read_transformations()

◆ png_init_rgb_transformations()

◆ png_read_transform_info()

◆ png_rtran_ok()

◆ png_set_alpha_mode()

void png_set_alpha_mode ( png_structrp  png_ptr,
int  mode,
double  output_gamma 
)

Definition at line 389 of file pngrtran.c.

References convert_gamma_value(), and png_set_alpha_mode_fixed().

◆ png_set_alpha_mode_fixed()

◆ png_set_background()

void png_set_background ( png_structrp  png_ptr,
png_const_color_16p  background_color,
int  background_gamma_code,
int  need_expand,
double  background_gamma 
)

Definition at line 156 of file pngrtran.c.

References png_fixed(), and png_set_background_fixed().

◆ png_set_background_fixed()

void png_set_background_fixed ( png_structrp  png_ptr,
png_const_color_16p  background_color,
int  background_gamma_code,
int  need_expand,
png_fixed_point  background_gamma 
)

◆ png_set_crc_action()

◆ png_set_expand()

void png_set_expand ( png_structrp  png_ptr)

◆ png_set_expand_16()

void png_set_expand_16 ( png_structrp  png_ptr)

◆ png_set_expand_gray_1_2_4_to_8()

void png_set_expand_gray_1_2_4_to_8 ( png_structrp  png_ptr)

Definition at line 901 of file pngrtran.c.

References png_debug, PNG_EXPAND, png_rtran_ok(), and png_struct_def::transformations.

Referenced by png_set_gray_to_rgb().

◆ png_set_gamma()

void png_set_gamma ( png_structrp  png_ptr,
double  scrn_gamma,
double  file_gamma 
)

Definition at line 845 of file pngrtran.c.

References convert_gamma_value(), and png_set_gamma_fixed().

◆ png_set_gamma_fixed()

void png_set_gamma_fixed ( png_structrp  png_ptr,
png_fixed_point  scrn_gamma,
png_fixed_point  file_gamma 
)

Definition at line 805 of file pngrtran.c.

References png_struct_def::flags, png_debug, png_error(), png_rtran_ok(), and translate_gamma_flags().

Referenced by png_set_gamma().

◆ png_set_gray_to_rgb()

void png_set_gray_to_rgb ( png_structrp  png_ptr)

◆ png_set_palette_to_rgb()

void png_set_palette_to_rgb ( png_structrp  png_ptr)

◆ png_set_quantize()

◆ png_set_read_user_transform_fn()

void png_set_read_user_transform_fn ( png_structrp  png_ptr,
png_user_transform_ptr  read_user_transform_fn 
)

Definition at line 1060 of file pngrtran.c.

References png_debug, PNG_USER_TRANSFORM, and png_struct_def::transformations.

Referenced by main().

◆ png_set_rgb_to_gray()

void png_set_rgb_to_gray ( png_structrp  png_ptr,
int  error_action,
double  red,
double  green 
)

Definition at line 1046 of file pngrtran.c.

References png_fixed(), and png_set_rgb_to_gray_fixed().

Referenced by main().

◆ png_set_rgb_to_gray_fixed()

◆ png_set_scale_16()

void png_set_scale_16 ( png_structrp  png_ptr)

◆ png_set_strip_16()

void png_set_strip_16 ( png_structrp  png_ptr)

Definition at line 186 of file pngrtran.c.

References PNG_16_TO_8, png_debug, png_rtran_ok(), and png_struct_def::transformations.

Referenced by main(), and png_read_png().

◆ png_set_strip_alpha()

void png_set_strip_alpha ( png_structrp  png_ptr)

◆ png_set_tRNS_to_alpha()

void png_set_tRNS_to_alpha ( png_structrp  png_ptr)

◆ translate_gamma_flags()