#include <image.h>
Public Types | |
enum | format { GREYSCALE = 1, RGB = 3, RGBA = 4 } |
Format the pixels are stored in. More... | |
enum | bpc { BYTE = 8, WORD = 32, DWORD = 64 } |
Bits per channel. More... | |
Public Methods | |
image_t (unsigned int width, unsigned int height, format fmat, unsigned int depth) | |
Constructor. More... | |
image_t (unsigned int width, unsigned int height, format fmat, unsigned int depth, const void *pixels) | |
Constructor. More... | |
~image_t (void) | |
unsigned int | get_width (void) const |
Returns the width of the image. | |
unsigned int | get_height (void) const |
Returns the height of the image. | |
format | get_format (void) const |
Returns the format of the image. | |
unsigned int | get_bpc (void) const |
Returns the bits per channel of the image. | |
const void * | get_pixels (void) const |
Returns a read-only pointer to pixel data. | |
bool | seek (unsigned int x, unsigned int y) |
Seeks to the pixel at x, y. More... | |
bool | read (unsigned char &gray) |
Reads the current pixel in the image. More... | |
bool | read (unsigned char &r, unsigned char &g, unsigned char &b) |
Reads the current pixel in the image. More... | |
bool | read (unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) |
Reads the current pixel in the image. More... | |
bool | write (unsigned char gray) |
Sets the current pixel in the image. More... | |
bool | write (unsigned char r, unsigned char g, unsigned char b) |
Sets the current pixel in the image. More... | |
bool | write (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
Sets the current pixel in the image. More... | |
bool | get_pixel (unsigned char &r, unsigned char &g, unsigned char &b, unsigned int x, unsigned int y) const |
Gets the pixel at x, y. More... | |
bool | get_pixel (unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a, unsigned int x, unsigned int y) const |
Gets the pixel at x, y. More... | |
bool | set_pixel (unsigned char r, unsigned char g, unsigned char b, unsigned int x, unsigned int y) |
Sets the pixel at x, y. More... | |
bool | set_pixel (unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned int x, unsigned int y) |
Sets the pixel at x, y. More... | |
bool | blend_pixel (unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned int x, unsigned int y) |
Alpha blends the color r, g, b, a to the pixel x, y. | |
void | flip_horizontal (void) |
Flips the image across the horizontal axis. | |
bool | blit (const image_t &img, const recti ®ion) |
Blits the image img onto the this image. More... | |
bool | blend (const image_t &img, const recti ®ion) |
Alpha blends the image img onto the this image. More... |
Definition at line 22 of file image.h.
|
Bits per channel.
|
|
Format the pixels are stored in.
|
|
Constructor.
Definition at line 8 of file image.cpp. References BYTE. |
|
Constructor.
Definition at line 41 of file image.cpp. References BYTE. |
|
Alpha blends the image img onto the this image.
Definition at line 572 of file image.cpp. References blend_pixel, rectangle::x, and rectangle::y. |
|
Blits the image img onto the this image.
Definition at line 553 of file image.cpp. References set_pixel, rectangle::x, and rectangle::y. Referenced by gl::ttf::load. |
|
Gets the pixel at x, y.
|
|
Gets the pixel at x, y.
|
|
Reads the current pixel in the image. Reads the pixel at the current seek position. After the read, the the current seek position is moved to the next pixel.
|
|
Reads the current pixel in the image. Reads the pixel at the current seek position. After the read, the the current seek position is moved to the next pixel.
|
|
Reads the current pixel in the image. Reads the pixel at the current seek position. After the read, the the current seek position is moved to the next pixel.
|
|
Seeks to the pixel at x, y.
Definition at line 84 of file image.cpp. Referenced by gl::ttf::load. |
|
Sets the pixel at x, y.
|
|
Sets the pixel at x, y.
Definition at line 405 of file image.cpp. Referenced by blit. |
|
Sets the current pixel in the image. Sets the pixel at the current seek position. After the write, the the current seek position is moved to the next pixel.
|
|
Sets the current pixel in the image. Sets the pixel at the current seek position. After the write, the the current seek position is moved to the next pixel.
|
|
Sets the current pixel in the image. Sets the pixel at the current seek position. After the write, the the current seek position is moved to the next pixel.
Definition at line 219 of file image.cpp. Referenced by gl::ttf::load. |