Gosu::Bitmap Class Reference

Rectangular area of pixels, each represented by a Color value. More...

List of all members.

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 ()


Detailed Description

Rectangular area of pixels, each represented by a Color value.

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.


Constructor & Destructor Documentation

Gosu::Bitmap::Bitmap (  ) 


Member Function Documentation

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

Definition at line 29 of file Bitmap.hpp.

Referenced by Gosu::imagesFromTiledBitmap().

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::replace ( Color  oldColor,
Color  newColor 
)

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

Definition at line 28 of file Bitmap.hpp.

Referenced by Gosu::imagesFromTiledBitmap().


The documentation for this class was generated from the following file: