StuBS
|
Portable Network Graphics file format. More...
#include <utils/png.h>
Public Types | |
enum | error { PNG_EOK = 0 , PNG_ENOMEM = 1 , PNG_ENOTFOUND = 2 , PNG_ENOTPNG = 3 , PNG_EMALFORMED = 4 , PNG_EUNSUPPORTED = 5 , PNG_EUNINTERLACED = 6 , PNG_EUNFORMAT = 7 , PNG_EPARAM = 8 , PNG_EIOERROR = 9 } |
enum | format { BADFORMAT , RGB8 , RGB16 , RGBA8 , RGBA16 , LUMINANCE1 , LUMINANCE2 , LUMINANCE4 , LUMINANCE8 , LUMINANCE_ALPHA1 , LUMINANCE_ALPHA2 , LUMINANCE_ALPHA4 , LUMINANCE_ALPHA8 } |
Public Member Functions | |
PNG (const unsigned char *buffer, unsigned long size) | |
Load PNG image from memory. More... | |
PNG (const char *path) | |
Load PNG image from file system. More... | |
~PNG () | |
Free memory reserved for PNG image. | |
unsigned | get_width () const |
Width of image (pixels) | |
unsigned | get_height () const |
Height of image (pixels) | |
unsigned | get_bpp () const |
Bits per pixel. | |
unsigned | get_bitdepth () const |
Depth of color (bits pro color channel) | |
unsigned | get_components () const |
Number of components per pixel. | |
unsigned | get_pixelsize () const |
Number of bytes per pixel. | |
enum format | get_format () const |
Retrieve the format. | |
const unsigned char * | get_buffer () |
Image buffer address. More... | |
unsigned | get_size () |
Size of image buffer. More... | |
Protected Member Functions | |
enum error | header () |
Extract header (image attributes) | |
enum error | decode () |
Decode whole image. | |
Protected Attributes | |
enum error | error |
unsigned | error_line |
Portable Network Graphics file format.
!
enum PNG::error |
enum PNG::format |
PNG::PNG | ( | const unsigned char * | buffer, |
unsigned long | size | ||
) |
Load PNG image from memory.
buffer | pointer to memory buffer |
size | size of memory buffer |
|
explicit |
Load PNG image from file system.
path | path to file |
|
inline |
Image buffer address.
|
inline |
Size of image buffer.