apngasm
 All Classes Namespaces Functions Variables
Public Member Functions | Public Attributes | List of all members
apngasm::APNGFrame Class Reference

Public Member Functions

unsigned char * pixels (unsigned char *setPixels=NULL)
 
unsigned int width (unsigned int setWidth=0)
 
unsigned int height (unsigned int setHeight=0)
 
unsigned char colorType (unsigned char setColorType=255)
 
rgbpalette (rgb *setPalette=NULL)
 
unsigned char * transparency (unsigned char *setTransparency=NULL)
 
int paletteSize (int setPaletteSize=0)
 
int transparencySize (int setTransparencySize=0)
 
unsigned int delayNum (unsigned int setDelayNum=0)
 
unsigned int delayDen (unsigned int setDelayDen=0)
 
unsigned char ** rows (unsigned char **setRows=NULL)
 
 APNGFrame ()
 Creates an empty APNGFrame.
 
 APNGFrame (const std::string &filePath, unsigned delayNum=DEFAULT_FRAME_NUMERATOR, unsigned delayDen=DEFAULT_FRAME_DENOMINATOR)
 Creates an APNGFrame from a PNG file. More...
 
 APNGFrame (rgb *pixels, unsigned int width, unsigned int height, unsigned delayNum=DEFAULT_FRAME_NUMERATOR, unsigned delayDen=DEFAULT_FRAME_DENOMINATOR)
 Creates an APNGFrame from a bitmapped array of RBG pixel data. More...
 
 APNGFrame (rgb *pixels, unsigned int width, unsigned int height, rgb *trns_color=NULL, unsigned delayNum=DEFAULT_FRAME_NUMERATOR, unsigned delayDen=DEFAULT_FRAME_DENOMINATOR)
 Creates an APNGFrame from a bitmapped array of RBG pixel data. More...
 
 APNGFrame (rgba *pixels, unsigned int width, unsigned int height, unsigned delayNum=DEFAULT_FRAME_NUMERATOR, unsigned delayDen=DEFAULT_FRAME_DENOMINATOR)
 Creates an APNGFrame from a bitmapped array of RBGA pixel data. More...
 
bool save (const std::string &outPath) const
 Saves this frame as a single PNG file. More...
 

Public Attributes

unsigned char * _pixels
 
unsigned int _width
 
unsigned int _height
 
unsigned char _colorType
 
rgb _palette [256]
 
unsigned char _transparency [256]
 
int _paletteSize
 
int _transparencySize
 
unsigned int _delayNum
 
unsigned int _delayDen
 
unsigned char ** _rows
 

Constructor & Destructor Documentation

apngasm::APNGFrame::APNGFrame ( const std::string &  filePath,
unsigned  delayNum = DEFAULT_FRAME_NUMERATOR,
unsigned  delayDen = DEFAULT_FRAME_DENOMINATOR 
)

Creates an APNGFrame from a PNG file.

Parameters
filePathThe relative or absolute path to an image file.
delayNumThe delay numerator for this frame (defaults to DEFAULT_FRAME_NUMERATOR).
delayDenThe delay denominator for this frame (defaults to DEFAULT_FRAME_DENMINATOR).
apngasm::APNGFrame::APNGFrame ( rgb pixels,
unsigned int  width,
unsigned int  height,
unsigned  delayNum = DEFAULT_FRAME_NUMERATOR,
unsigned  delayDen = DEFAULT_FRAME_DENOMINATOR 
)

Creates an APNGFrame from a bitmapped array of RBG pixel data.

Parameters
pixelsThe RGB pixel data.
widthThe width of the pixel data.
heightThe height of the pixel data.
delayNumThe delay numerator for this frame (defaults to DEFAULT_FRAME_NUMERATOR).
delayDenThe delay denominator for this frame (defaults to DEFAULT_FRAME_DENMINATOR).
apngasm::APNGFrame::APNGFrame ( rgb pixels,
unsigned int  width,
unsigned int  height,
rgb trns_color = NULL,
unsigned  delayNum = DEFAULT_FRAME_NUMERATOR,
unsigned  delayDen = DEFAULT_FRAME_DENOMINATOR 
)

Creates an APNGFrame from a bitmapped array of RBG pixel data.

Parameters
pixelsThe RGB pixel data.
widthThe width of the pixel data.
heightThe height of the pixel data.
trns_colorAn array of transparency data.
delayNumThe delay numerator for this frame (defaults to DEFAULT_FRAME_NUMERATOR).
delayDenThe delay denominator for this frame (defaults to DEFAULT_FRAME_DENMINATOR).
apngasm::APNGFrame::APNGFrame ( rgba pixels,
unsigned int  width,
unsigned int  height,
unsigned  delayNum = DEFAULT_FRAME_NUMERATOR,
unsigned  delayDen = DEFAULT_FRAME_DENOMINATOR 
)

Creates an APNGFrame from a bitmapped array of RBGA pixel data.

Parameters
pixelsThe RGBA pixel data.
widthThe width of the pixel data.
heightThe height of the pixel data.
delayNumThe delay numerator for this frame (defaults to DEFAULT_FRAME_NUMERATOR).
delayDenThe delay denominator for this frame (defaults to DEFAULT_FRAME_DENMINATOR).

Member Function Documentation

bool apngasm::APNGFrame::save ( const std::string &  outPath) const

Saves this frame as a single PNG file.

Parameters
outPathThe relative or absolute path to save the image file to.
Returns
Returns true if save was successful.