src/pngHelper.h File Reference

#include <png.h>
#include <cstdio>
#include <iostream>

Include dependency graph for pngHelper.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  std

Defines

#define PNG_NO_TYPECAST_NULL
 I/O Helper Methods that provide a more convenient interface between the libpng I/O and a general purpose image buffer repreentation.

Functions

int check_if_png (const char *file_name, FILE **fp)
void read_png (const char *file_name, unsigned char *&buffer, int &width, int &height, int &channels, int &bit_depth, int &color_type, bool flip_vert)
void write_png (const char *file_name, unsigned char *buffer, int width, int height, int channels, int bit_depth, png_uint_32 color_type, bool flip_vert)

Variables

static unsigned const int PNG_BYTES_TO_CHECK = 8


Define Documentation

#define PNG_NO_TYPECAST_NULL

I/O Helper Methods that provide a more convenient interface between the libpng I/O and a general purpose image buffer repreentation.

by Christian Theobalt 2005

Definition at line 12 of file pngHelper.h.


Function Documentation

int check_if_png ( const char *  file_name,
FILE **  fp 
)

Definition at line 25 of file pngHelper.h.

References PNG_BYTES_TO_CHECK.

Referenced by read_png().

void read_png ( const char *  file_name,
unsigned char *&  buffer,
int &  width,
int &  height,
int &  channels,
int &  bit_depth,
int &  color_type,
bool  flip_vert 
)

Definition at line 46 of file pngHelper.h.

References check_if_png().

Referenced by PNGImage::read().

void write_png ( const char *  file_name,
unsigned char *  buffer,
int  width,
int  height,
int  channels,
int  bit_depth,
png_uint_32  color_type,
bool  flip_vert 
)

Parameters:
file_name the file name
buffer image buffer
witdh width of the image
height height of the image
channels number of channels in the image
bit_depth per-channel bit depth
color_type can be PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, PNG_COLOR_TYPE_RGBA, PNG_COLOR_TYPE_GA
flip_vert flip buffer vertically ?

Definition at line 168 of file pngHelper.h.

Referenced by PNGImage::write().


Variable Documentation

unsigned const int PNG_BYTES_TO_CHECK = 8 [static]

Definition at line 18 of file pngHelper.h.

Referenced by check_if_png().


Generated on Fri Feb 1 00:01:56 2008 for Grayfall by  doxygen 1.5.1