Public Member Functions | |
Bitmap () | |
unsigned | width () const |
unsigned | height () const |
void | swap (Bitmap &other) |
void | resize (unsigned width, unsigned height, Color c=Color::NONE) |
void | fill (Color c) |
void | replace (Color oldColor, Color newColor) |
Color | getPixel (unsigned x, unsigned y) const |
Returns the color at the specified position. | |
void | setPixel (unsigned x, unsigned y, Color c) |
Sets the pixel at the specified position to a color. | |
void | insert (const Bitmap &source, int x, int y) |
Inserts a bitmap at the given position. | |
void | insert (const Bitmap &source, int x, int y, unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight) |
Inserts a portion of a bitmap at the given position. | |
const unsigned * | data () const |
Direct access to the array of color values. | |
unsigned * | data () |
Provides minimal drawing functionality and serves as a temporary holder for graphical resources which are usually turned into Images later. Has (expensive) value semantics.
Definition at line 20 of file Bitmap.hpp.
Gosu::Bitmap::Bitmap | ( | ) |
unsigned* Gosu::Bitmap::data | ( | ) |
Definition at line 60 of file Bitmap.hpp.
const unsigned* Gosu::Bitmap::data | ( | ) | const |
Direct access to the array of color values.
May be useful for optimized OpenGL operations.
Definition at line 59 of file Bitmap.hpp.
void Gosu::Bitmap::fill | ( | Color | c | ) |
Color Gosu::Bitmap::getPixel | ( | unsigned | x, | |
unsigned | y | |||
) | const |
Returns the color at the specified position.
x and y must be on the bitmap.
Definition at line 40 of file Bitmap.hpp.
unsigned Gosu::Bitmap::height | ( | ) | const |
void Gosu::Bitmap::insert | ( | const Bitmap & | source, | |
int | x, | |||
int | y, | |||
unsigned | srcX, | |||
unsigned | srcY, | |||
unsigned | srcWidth, | |||
unsigned | srcHeight | |||
) |
Inserts a portion of a bitmap at the given position.
Parts of the inserted bitmap that would be outside of the target bitmap will be clipped away.
void Gosu::Bitmap::insert | ( | const Bitmap & | source, | |
int | x, | |||
int | y | |||
) |
Inserts a bitmap at the given position.
Parts of the inserted bitmap that would be outside of the target bitmap will be clipped away.
void Gosu::Bitmap::resize | ( | unsigned | width, | |
unsigned | height, | |||
Color | c = Color::NONE | |||
) |
void Gosu::Bitmap::setPixel | ( | unsigned | x, | |
unsigned | y, | |||
Color | c | |||
) |
Sets the pixel at the specified position to a color.
x and y must be on the bitmap.
Definition at line 44 of file Bitmap.hpp.
void Gosu::Bitmap::swap | ( | Bitmap & | other | ) |
unsigned Gosu::Bitmap::width | ( | ) | const |