w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pngtopnm.c File Reference
#include <math.h>
#include <png.h>
#include "pnm.h"
Include dependency graph for pngtopnm.c:

Go to the source code of this file.

Classes

struct  _jmpbuf_wrapper
 

Macros

#define VERSION   "2.37.3 (13 July 1999) +netpbm"
 
#define NONE   0
 
#define get_png_val(p)   _get_png_val (&(p), info_ptr->bit_depth)
 
#define SIG_CHECK_SIZE   4
 

Typedefs

typedef struct _jmpbuf_wrapper jmpbuf_wrapper
 

Enumerations

enum  alpha_handling {
  none , alpha_only , mix , none ,
  alpha_only , mix_only , none_and_alpha
}
 

Functions

static png_uint_16 _get_png_val (png_byte **pp, int bit_depth)
 
static void store_pixel (xel *pix, png_uint_16 r, png_uint_16 g, png_uint_16 b, png_uint_16 a)
 
static png_uint_16 gamma_correct (png_uint_16 v, float g)
 
static int iscolor (png_color c)
 
static void save_text (png_info *info_ptr, FILE *tfp)
 
static void show_time (png_info *info_ptr)
 
static void pngtopnm_error_handler (png_structp png_ptr, png_const_charp msg)
 
static void convertpng (FILE *ifp, FILE *tfp)
 
int main (int argc, argv)
 

Variables

static png_uint_16 maxval
 
static png_uint_16 maxmaxval
 
static png_uint_16 bgr
 
static png_uint_16 bgg
 
static png_uint_16 bgb
 
static int verbose = ((bool)0)
 
static enum alpha_handling alpha = none
 
static int background = -1
 
static char * backstring
 
static float displaygamma = -1.0
 
static float totalgamma = -1.0
 
static int text = ((bool)0)
 
static char * text_file
 
static int mtime = ((bool)0)
 
static jmpbuf_wrapper pngtopnm_jmpbuf_struct
 

Macro Definition Documentation

◆ get_png_val

#define get_png_val (   p)    _get_png_val (&(p), info_ptr->bit_depth)

Definition at line 80 of file pngtopnm.c.

◆ NONE

#define NONE   0

Definition at line 48 of file pngtopnm.c.

◆ SIG_CHECK_SIZE

#define SIG_CHECK_SIZE   4

Definition at line 235 of file pngtopnm.c.

◆ VERSION

#define VERSION   "2.37.3 (13 July 1999) +netpbm"

Definition at line 19 of file pngtopnm.c.

Typedef Documentation

◆ jmpbuf_wrapper

Enumeration Type Documentation

◆ alpha_handling

Enumerator
none 
alpha_only 
mix 
none 
alpha_only 
mix_only 
none_and_alpha 

Definition at line 64 of file pngtopnm.c.

Function Documentation

◆ _get_png_val()

static png_uint_16 _get_png_val ( png_byte **  pp,
int  bit_depth 
)
static

Definition at line 85 of file pngtopnm.c.

References c, maxmaxval, and maxval.

◆ convertpng()

◆ gamma_correct()

static png_uint_16 gamma_correct ( png_uint_16  v,
float  g 
)
static

Definition at line 126 of file pngtopnm.c.

References g, maxval, pow(), and v.

Referenced by convertpng().

◆ iscolor()

static int iscolor ( png_color  c)
static

Definition at line 141 of file pngtopnm.c.

References c.

Referenced by convertpng().

◆ main()

◆ pngtopnm_error_handler()

static void pngtopnm_error_handler ( png_structp  png_ptr,
png_const_charp  msg 
)
static

Definition at line 205 of file pngtopnm.c.

References exit(), fflush, fprintf, _jmpbuf_wrapper::jmpbuf, NULL, png_get_error_ptr(), and png_ptr.

Referenced by convertpng().

◆ save_text()

static void save_text ( png_info info_ptr,
FILE tfp 
)
static

Definition at line 151 of file pngtopnm.c.

References fprintf, i, j, k, putc, and strlen().

Referenced by convertpng().

◆ show_time()

static void show_time ( png_info info_ptr)
static

Definition at line 186 of file pngtopnm.c.

References month, pm_message, and PNG_INFO_tIME.

Referenced by convertpng().

◆ store_pixel()

static void store_pixel ( xel pix,
png_uint_16  r,
png_uint_16  g,
png_uint_16  b,
png_uint_16  a 
)
static

Definition at line 106 of file pngtopnm.c.

References a, alpha, alpha_only, b, bgb, bgg, bgr, g, maxval, mix, pix, PNM_ASSIGN1, PPM_ASSIGN, and r.

Referenced by convertpng().

Variable Documentation

◆ alpha

enum alpha_handling alpha = none
static

Definition at line 69 of file pngtopnm.c.

Referenced by _cairo_color_get_rgba(), _cairo_color_get_rgba_premultiplied(), _cairo_color_init_rgba(), _cairo_color_multiply_alpha(), _cairo_default_context_paint_with_alpha(), _cairo_default_context_set_source_rgba(), _cairo_gl_composite_emit_alpha_vertex(), _cairo_gl_composite_emit_solid_span(), _cairo_gl_composite_emit_span(), _cairo_gstate_mask(), _cairo_image_compute_transparency(), _cairo_mesh_pattern_set_corner_color(), _cairo_pattern_add_color_stop(), _cairo_pattern_alpha_range(), _cairo_pattern_is_constant_alpha(), _cairo_pdf_surface_add_alpha(), _cairo_pdf_surface_emit_group_resources(), _cairo_pdf_surface_emit_recording_surface(), _cairo_pdf_surface_emit_smask(), _cairo_pdf_surface_mask(), _cairo_pdf_surface_paint_gradient(), _cairo_pdf_surface_paint_pattern(), _cairo_pdf_surface_paint_surface_pattern(), _cairo_pdf_surface_select_pattern(), _cairo_quartz_cg_mask_with_solid(), _current_source_matches_solid(), _vg_surface_mask(), TextPage::addChar(), alpha_blend_boxes(), alpha_source(), SplashOutputDev::alphaImageSrc(), altersingle(), atfilt_setup(), TileCompositor::blit(), bmeps_configure(), bmeps_setup(), bmp_read_direct(), cairo_mesh_pattern_get_corner_color_rgba(), cairo_mesh_pattern_set_corner_color_rgba(), cairo_paint_with_alpha(), cairo_pattern_add_color_stop_rgba(), cairo_pattern_create_rgba(), cairo_pattern_get_color_stop_rgba(), cairo_pattern_get_rgba(), cairo_set_source_rgba(), Splash::clear(), cmsGDBCompute(), Splash::composite(), Splash::compositeBackground(), convertpng(), dest_get_scanline_narrow(), dest_get_scanline_wide(), Gfx::doRadialShFill(), Gfx::doSoftMask(), Gfx::drawForm(), AnnotAppearanceBuilder::drawLineEndArrow(), fetch_pixel_general_float(), Splash::fillGlyph2(), Splash::fillWithPattern(), FindNearSectors(), gdAlphaBlend(), gdImageColor(), gdImageCopyResampled(), gdImageScaleBicubicFixed(), gdImageScaleBilinearPalette(), gdImageScaleBilinearTC(), gdImageSquareToCircle(), gdImageSubSharpen(), gdImageTrueColorToPaletteBody(), GetPoint(), gimpts_indexed_packpal(), gtStripSeparate(), gtTileSeparate(), i915_span_constant(), i915_span_generic(), i915_span_linear(), i915_span_texture(), i915_span_texture16(), i915_unbounded_spans_mono(), i965_span_rectangle(), i965_unbounded_spans_mono(), in_over_1x128(), JPXStream::init(), InterpolateMissingSector(), learn(), load_lines(), load_tiles(), loadAATfont(), loadfont(), main(), mix_colors(), multiply_alpha(), newfontdesc(), Gfx::opSetExtGState(), opti_penalty(), opticurve(), out_tiff_work(), over_1x128(), over_rev_non_pre_1x128(), pix_multiply_1x128(), pixEmbedForRotation(), png_colormap_compose(), png_create_colormap_entry(), png_image_read_and_map(), png_image_read_background(), png_image_read_colormap(), png_image_read_composite(), png_image_set_PLTE(), png_image_write_main(), png_run(), png_unpremultiply(), png_write_image_16bit(), png_write_image_8bit(), png_write_sPLT(), premultiply_argb(), premultiply_bgra(), premultiply_data(), ptstiff3_load_image(), ptstiff3_save_image(), QuantizeToSector(), PSOutputDev::radialShadedFill(), read_16bit(), read_8bit(), read_default(), read_rgb_a(), read_separate(), read_tfm_info(), readpreamble(), scaled_bilinear_scanline_sse2_8888_n_8888_OVER(), scaled_nearest_scanline_sse2_8888_n_8888_OVER(), Splash::scaleImageYdownXdown(), Splash::scaleImageYdownXup(), Splash::scaleImageYupXdown(), Splash::scaleImageYupXup(), Splash::setFillAlpha(), SetGlyph(), CairoOutputDev::setSoftMask(), SplashOutputDev::setSoftMask(), Splash::setStrokeAlpha(), Splash::shadedFill(), SplashOutputDev::softMaskMatteImageSrc(), spc_html__img_empty(), sqxfw(), sse2_composite_over_8888_n_8888(), sse2_composite_over_x888_n_8888(), store_pixel(), store_scaled_f(), tfmload(), ToCartesian(), trans_rotate(), unpremultiply_bgra(), unpremultiply_data(), vfontdef(), virtualfont(), and writePNGData().

◆ background

◆ backstring

char* backstring
static

Definition at line 72 of file pngtopnm.c.

Referenced by convertpng(), and main().

◆ bgb

png_uint_16 bgb
static

Definition at line 68 of file pngtopnm.c.

Referenced by convertpng(), and store_pixel().

◆ bgg

png_uint_16 bgg
static

Definition at line 68 of file pngtopnm.c.

Referenced by convertpng(), and store_pixel().

◆ bgr

◆ displaygamma

float displaygamma = -1.0
static

Definition at line 73 of file pngtopnm.c.

Referenced by convertpng(), and main().

◆ maxmaxval

png_uint_16 maxmaxval
static

Definition at line 67 of file pngtopnm.c.

Referenced by _get_png_val(), convertpng(), and convertpnm().

◆ maxval

png_uint_16 maxval
static

Definition at line 67 of file pngtopnm.c.

Referenced by _get_png_val(), convertpng(), gamma_correct(), and store_pixel().

◆ mtime

int mtime = ((bool)0)
static

◆ pngtopnm_jmpbuf_struct

jmpbuf_wrapper pngtopnm_jmpbuf_struct
static

Definition at line 78 of file pngtopnm.c.

Referenced by convertpng().

◆ text

int text = ((bool)0)
static

Definition at line 75 of file pngtopnm.c.

◆ text_file

char* text_file
static

Definition at line 76 of file pngtopnm.c.

◆ totalgamma

float totalgamma = -1.0
static

Definition at line 74 of file pngtopnm.c.

Referenced by convertpng().

◆ verbose

int verbose = ((bool)0)
static

Definition at line 69 of file pngtopnm.c.

Referenced by convertpng(), and main().