Gosu::Bitmap Class Reference

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

List of all members.

Public Member Functions

unsigned width () const
unsigned height () const
void swap (Bitmap &other)
void resize (unsigned width, unsigned height, Color c=Colors::none)
void fill (Color c)
void replace (Color oldColor, Color newColor)
Color getPixel (unsigned x, unsigned y) const
void setPixel (unsigned x, unsigned y, Color c)
void insert (const Bitmap &source, int x, int y)
void insert (const Bitmap &source, int x, int y, unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight)
const unsigned * glCompatibleData () const


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.


Member Function Documentation

Color Gosu::Bitmap::getPixel ( unsigned  x,
unsigned  y 
) const [inline]

Returns the color at the specified position.

x and y must be on the bitmap.

void Gosu::Bitmap::setPixel ( unsigned  x,
unsigned  y,
Color  c 
) [inline]

Sets the pixel at the specified position to a color.

x and y must be on the bitmap.

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::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.

const unsigned* Gosu::Bitmap::glCompatibleData (  )  const [inline]

Undocumented optimization for Image creation; to be changed.


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

Generated on Sat Feb 7 22:34:53 2009 for Gosu by  doxygen 1.5.5