HOME | DOWNLOAD | DOCS | DEVELOPMENT | LICENSE | CREDITS |
Reads / writes Portable Network Graphic (PNG) files. More...
#include <iPNG.h>
Public Types | |
enum | PNGInterlaceType { InterlaceNone, InterlaceAdam7 } |
PNG interlace type. More... | |
Public Member Functions | |
iPNG () | |
Constructs a null image. | |
iPNG (const iPNG &img) | |
Copy constructor. | |
iPNG (const iAbstractImage &img) | |
iAbstractImage copy constructor. | |
iPNG (int w, int h, iImageFormat f) | |
Constructs an image with the given size and format. | |
iPNG (Iubyte *d, int w, int h, iImageFormat f, int b) | |
Constructs an image using an existing memory buffer. | |
iPNG (const char *filename) | |
Loads a PNG image file from disk. | |
iPNG (Iubyte *buf, int len) | |
Loads a PNG image from an existing memory buffer. | |
iPNG (iDataStream *s) | |
Loads a PNG image using an existing data stream. | |
~iPNG () | |
Destructor. | |
void | clear () |
Detaches this image from the image data and resets all data members to their initial values. | |
bool | isFormatSupported (iImageFormat fmt) const |
Checks whether or not a given image color format is supported by this image type. | |
void | setCompressLevel (int lvl) |
Sets the level of compression when writing PNG images. | |
int | getCompressLevel () const |
Gets the level of compression when writing PNG images. | |
void | setInterlaceType (PNGInterlaceType type) |
Sets the type of interlacing to use when writing PNG images. | |
PNGInterlaceType | getInterlaceType () const |
Gets the type of interlacing to use when writing PNG images. | |
iPNG & | operator= (const iPNG &img) |
iPNG & | operator= (const iAbstractImage &img) |
Static Public Member Functions | |
static bool | isValid (iDataStream *s) |
Protected Member Functions | |
void | init () |
bool | loadImage () |
bool | saveImage () |
Reads / writes Portable Network Graphic (PNG) files.
Extensions:
.png
Image types:
Grayscale, indexed, and truecolor
Pixel Depths:
8-bit, 16-bit, 24-bit, and 32-bit
TODO:
Gamma correction.
ICC profiles.
Write custom chunks.
Constructs a null image.
imagen::iPNG::iPNG | ( | const iPNG & | img | ) |
Copy constructor.
This copies all image attributes, and attaches itself to img's shared data.
imagen::iPNG::iPNG | ( | const iAbstractImage & | img | ) |
iAbstractImage copy constructor.
imagen::iPNG::iPNG | ( | int | w, |
int | h, | ||
iImageFormat | f | ||
) |
Constructs an image with the given size and format.
The image data will be allocated, but not initialized.
w | : Image width. |
h | : Image height. |
f | : Image format. |
imagen::iPNG::iPNG | ( | Iubyte * | d, |
int | w, | ||
int | h, | ||
iImageFormat | f, | ||
int | b | ||
) |
Constructs an image using an existing memory buffer.
The memory buffer will not be deleted at destruction.
imagen::iPNG::iPNG | ( | const char * | filename | ) |
Loads a PNG image file from disk.
imagen::iPNG::iPNG | ( | Iubyte * | buf, |
int | len | ||
) |
Loads a PNG image from an existing memory buffer.
imagen::iPNG::iPNG | ( | iDataStream * | s | ) |
Loads a PNG image using an existing data stream.
Destructor.
void imagen::iPNG::clear | ( | ) | [virtual] |
Detaches this image from the image data and resets all data members to their initial values.
Reimplemented from imagen::iAbstractImage.
bool imagen::iPNG::isFormatSupported | ( | iImageFormat | fmt | ) | const [virtual] |
Checks whether or not a given image color format is supported by this image type.
Implements imagen::iAbstractImage.
static bool imagen::iPNG::isValid | ( | iDataStream * | s | ) | [static] |
void imagen::iPNG::setCompressLevel | ( | int | lvl | ) |
Sets the level of compression when writing PNG images.
The compression level must be between 0 and 9.
0 = No compression.
9 = Max compression.
The compression level is set to 9 by default.
int imagen::iPNG::getCompressLevel | ( | ) | const [inline] |
Gets the level of compression when writing PNG images.
void imagen::iPNG::setInterlaceType | ( | PNGInterlaceType | type | ) | [inline] |
Sets the type of interlacing to use when writing PNG images.
PNGInterlaceType imagen::iPNG::getInterlaceType | ( | ) | const [inline] |
Gets the type of interlacing to use when writing PNG images.
iPNG& imagen::iPNG::operator= | ( | const iAbstractImage & | img | ) |
Reimplemented from imagen::iAbstractImage.
void imagen::iPNG::init | ( | ) | [protected] |
Reimplemented from imagen::iAbstractImage.
bool imagen::iPNG::loadImage | ( | ) | [protected, virtual] |
Implements imagen::iAbstractImage.
bool imagen::iPNG::saveImage | ( | ) | [protected, virtual] |
Implements imagen::iAbstractImage.
API Documentation by Mark D. Procarione | Generated by |