#include <faith/image.h>
Public Types | |
| IgnoreEndian | |
| BigEndian | |
| LittleEndian | |
| enum | Endian { IgnoreEndian, BigEndian, LittleEndian } |
Public Member Functions | |
| Image () | |
| ~Image () | |
| Image (const Size &sz, int depth, int numColor=0, Endian bitOrder=IgnoreEndian) | |
| Image (int w, int h, int depth, int numColor=0, Endian bitOrder=IgnoreEndian) | |
| Image (const Image ©) | |
| Image (unsigned char *data, int w, int h, int depth, int pitch, Endian bitOrder) | |
| Image (const char *filename) | |
| void | create (int w, int h, int depth, int numColor=0, Endian bitOrder=IgnoreEndian) |
| Image & | operator= (const Image ©) |
| bool | operator== (const Image &other) const |
| bool | operator!= (const Image &other) const |
| void | detach () |
| bool | hasAlpha () const |
| void | setAlpha (bool enabled) |
| bool | isNull () const |
| Faith::Image | createAlphaMask () const |
| int | width () const |
| int | height () const |
| int | pitch () const |
| int | bytesPerLine () const |
| int | numBytes () const |
| int | depth () const |
| Size | size () const |
| Rect | rect () const |
| unsigned char * | scanLine (int i) |
| const unsigned char * | scanLine (int i) const |
| unsigned char * | bits () |
| const unsigned char * | bits () const |
| const unsigned char *const * | jumpTable () const |
| unsigned int | pixelIndex (int x, int y) const |
| Rgb | pixel (int x, int y) const |
| void | setPixel (int x, int y, unsigned int pixel) |
| void | reset () |
| Rgb | color (int i) const |
| void | setColor (int i, Rgb color) |
| void | save (const char *filename) const |
| enum Faith::Image::Endian |
| Faith::Image::Image | ( | ) |
| Faith::Image::~Image | ( | ) |
| Faith::Image::Image | ( | const Size & | sz, | |
| int | depth, | |||
| int | numColor = 0, |
|||
| Endian | bitOrder = IgnoreEndian | |||
| ) |
| Faith::Image::Image | ( | int | w, | |
| int | h, | |||
| int | depth, | |||
| int | numColor = 0, |
|||
| Endian | bitOrder = IgnoreEndian | |||
| ) |
| Faith::Image::Image | ( | const Image & | copy | ) |
| Faith::Image::Image | ( | unsigned char * | data, | |
| int | w, | |||
| int | h, | |||
| int | depth, | |||
| int | pitch, | |||
| Endian | bitOrder | |||
| ) |
construct an image from data. The data is used as is and is not copied nor destroyed, so you must make sure that it outlives the existance of this instance of Image, and is deleted by you.
| data | is the data that is maintained by you | |
| w | is the width of the image | |
| h | is the height of the image | |
| depth | is the number of bits per pixel, 1, 8, or 32 | |
| pitch | is the number of bytes per line. An 8 bit-per-pixel image usually has this as the same as w. The generation of the jumpTable() is dependant on this |
| Faith::Image::Image | ( | const char * | filename | ) |
| const unsigned char* Faith::Image::bits | ( | ) | const [inline] |
| unsigned char* Faith::Image::bits | ( | ) | [inline] |
| int Faith::Image::bytesPerLine | ( | ) | const [inline] |
| Rgb Faith::Image::color | ( | int | i | ) | const |
| void Faith::Image::create | ( | int | w, | |
| int | h, | |||
| int | depth, | |||
| int | numColor = 0, |
|||
| Endian | bitOrder = IgnoreEndian | |||
| ) |
| Faith::Image Faith::Image::createAlphaMask | ( | ) | const |
| int Faith::Image::depth | ( | ) | const |
| void Faith::Image::detach | ( | ) |
| bool Faith::Image::hasAlpha | ( | ) | const |
| int Faith::Image::height | ( | ) | const |
| bool Faith::Image::isNull | ( | ) | const |
| const unsigned char* const* Faith::Image::jumpTable | ( | ) | const |
| int Faith::Image::numBytes | ( | ) | const |
| bool Faith::Image::operator!= | ( | const Image & | other | ) | const [inline] |
| bool Faith::Image::operator== | ( | const Image & | other | ) | const |
| int Faith::Image::pitch | ( | ) | const |
| Rgb Faith::Image::pixel | ( | int | x, | |
| int | y | |||
| ) | const |
| unsigned int Faith::Image::pixelIndex | ( | int | x, | |
| int | y | |||
| ) | const |
| Rect Faith::Image::rect | ( | ) | const |
| void Faith::Image::reset | ( | ) |
nullifies the image. Deletes the data. isNull() returns true
| void Faith::Image::save | ( | const char * | filename | ) | const |
| const unsigned char* Faith::Image::scanLine | ( | int | i | ) | const |
| unsigned char* Faith::Image::scanLine | ( | int | i | ) |
| void Faith::Image::setAlpha | ( | bool | enabled | ) |
create or eliminate the alpha channel
| void Faith::Image::setColor | ( | int | i, | |
| Rgb | color | |||
| ) |
| void Faith::Image::setPixel | ( | int | x, | |
| int | y, | |||
| unsigned int | pixel | |||
| ) |
changes the color of the pixel at the given pixel
if the image has a depth of 8 bpp or less, the pixel is a position in the color table. The results are undefined if pixel is more than the last color
| Size Faith::Image::size | ( | ) | const |
| int Faith::Image::width | ( | ) | const |
1.4.7