Public Member Functions
Image Class Reference

Encapsulates an image. More...

#include <Image.hh>

List of all members.

Public Member Functions

 Image ()
 Constructor.
virtual ~Image ()
 Destructor.
int Load (const std::string &filename)
 Load an image. Return 0 on success.
void SetFromData (const unsigned char *data, unsigned int width, unsigned int height, int scanline_bytes, unsigned int bpp)
 Set the image from raw data (R8G8B8)
void GetData (unsigned char **data, unsigned int &count)
 Get the image as a data array.
unsigned int GetWidth () const
 Get the width.
unsigned int GetHeight () const
 Get the height.
unsigned int GetBPP () const
 Get the size of one pixel in bits.
Color GetPixel (unsigned int x, unsigned int y)
 Get a pixel color value.
Color GetAvgColor ()
 Get the average color.
Color GetMaxColor ()
 Get the max color.
void Rescale (int width, int height)
 Rescale the image.
bool Valid () const
 Render this image using opengl.
std::string GetFilename () const
 Get the full filename of the image.

Detailed Description

Encapsulates an image.


Member Function Documentation

void GetData ( unsigned char **  data,
unsigned int &  count 
)

Get the image as a data array.

Parameters:
dataPointer to a NULL array of char.
countThe resulting data array size
void SetFromData ( const unsigned char *  data,
unsigned int  width,
unsigned int  height,
int  scanline_bytes,
unsigned int  bpp 
)

Set the image from raw data (R8G8B8)

Parameters:
dataPointer to the raw image data
widthWidth in pixels
heightHeight in pixels
scanline_bytesSize of a image row in bytes
bppBits per pixels, aka depth
bool Valid ( ) const

Render this image using opengl.

Returns whether this is a valid image


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