ImageBitmap Class Reference

#include <ImageBitmap.h>

Inheritance diagram for ImageBitmap:

Image

List of all members.

Public Member Functions

 ImageBitmap ()
 ImageBitmap (int width, int height, bool alpha=false, unsigned char fill=255)
virtual ~ImageBitmap ()
void clear ()
virtual unsigned char * getBits ()
virtual int getWidth ()
virtual int getHeight ()
virtual int getAlignment ()
virtual int getComponents ()
virtual bool getAlpha ()
void setBits (unsigned char *bits)
bool loadFromFile (const char *filename, bool alpha=false)
bool loadFromFile (const char *filename, const char *alphafilename, bool invert)
virtual void removeOwnership ()

Protected Member Functions

void createBlankInternal (int width, int height, bool alpha=false, unsigned char fill=255)

Protected Attributes

bool owner_
unsigned char * newbits_
int width_
int height_
bool alpha_

Private Member Functions

 ImageBitmap (ImageBitmap &other)
ImageBitmapoperator= (ImageBitmap &other)


Detailed Description

A class that wraps the loading of windows .bmp image data into a format that can be easily consumed by a GLTexture object. The bitmap data is unpacked and is stored in either RGB or RGBA format. One ubyte per component. No attempt is made to ensure the bitmap conforms to the GLTexture specification (sizes == pow(2, x))

Definition at line 34 of file ImageBitmap.h.


Constructor & Destructor Documentation

ImageBitmap::ImageBitmap (  ) 

Definition at line 28 of file ImageBitmap.cpp.

ImageBitmap::ImageBitmap ( int  width,
int  height,
bool  alpha = false,
unsigned char  fill = 255 
)

Definition at line 35 of file ImageBitmap.cpp.

References createBlankInternal().

ImageBitmap::~ImageBitmap (  )  [virtual]

Definition at line 42 of file ImageBitmap.cpp.

References clear().

ImageBitmap::ImageBitmap ( ImageBitmap other  )  [private]


Member Function Documentation

void ImageBitmap::clear (  ) 

Definition at line 47 of file ImageBitmap.cpp.

References height_, newbits_, owner_, and width_.

Referenced by createBlankInternal(), and ~ImageBitmap().

virtual unsigned char* ImageBitmap::getBits (  )  [inline, virtual]

Implements Image.

Definition at line 43 of file ImageBitmap.h.

References newbits_.

Referenced by loadFromFile().

virtual int ImageBitmap::getWidth (  )  [inline, virtual]

Implements Image.

Definition at line 44 of file ImageBitmap.h.

References width_.

Referenced by loadFromFile().

virtual int ImageBitmap::getHeight (  )  [inline, virtual]

Implements Image.

Definition at line 45 of file ImageBitmap.h.

References height_.

Referenced by loadFromFile().

virtual int ImageBitmap::getAlignment (  )  [inline, virtual]

Implements Image.

Definition at line 46 of file ImageBitmap.h.

virtual int ImageBitmap::getComponents (  )  [inline, virtual]

Implements Image.

Definition at line 47 of file ImageBitmap.h.

References alpha_.

Referenced by createBlankInternal(), and loadFromFile().

virtual bool ImageBitmap::getAlpha (  )  [inline, virtual]

Definition at line 48 of file ImageBitmap.h.

References alpha_.

void ImageBitmap::setBits ( unsigned char *  bits  )  [inline]

Definition at line 50 of file ImageBitmap.h.

References newbits_.

bool ImageBitmap::loadFromFile ( const char *  filename,
bool  alpha = false 
)

Overwrite the bitmap with the contents of the given file. If alpha is true then any black areas in the bitmap have full opacity. When creating an alpha bitmap the bitmap is created in RGBA format, otherwise in RGB format.

Definition at line 98 of file ImageBitmap.cpp.

References createBlankInternal(), S3D::dialogExit(), S3D::formatStringBuffer(), from, getComponents(), height_, newbits_, and width_.

Referenced by ImageFactory::loadAlphaImage(), loadFromFile(), and ImageFactory::loadImage().

bool ImageBitmap::loadFromFile ( const char *  filename,
const char *  alphafilename,
bool  invert 
)

Definition at line 55 of file ImageBitmap.cpp.

References createBlankInternal(), getBits(), getHeight(), getWidth(), and loadFromFile().

virtual void ImageBitmap::removeOwnership (  )  [inline, virtual]

Implements Image.

Definition at line 61 of file ImageBitmap.h.

References owner_.

void ImageBitmap::createBlankInternal ( int  width,
int  height,
bool  alpha = false,
unsigned char  fill = 255 
) [protected]

Definition at line 139 of file ImageBitmap.cpp.

References alpha_, clear(), getComponents(), height_, newbits_, and width_.

Referenced by ImageBitmap(), and loadFromFile().

ImageBitmap& ImageBitmap::operator= ( ImageBitmap other  )  [private]


Member Data Documentation

bool ImageBitmap::owner_ [protected]

Definition at line 64 of file ImageBitmap.h.

Referenced by clear(), and removeOwnership().

unsigned char* ImageBitmap::newbits_ [protected]

Definition at line 65 of file ImageBitmap.h.

Referenced by clear(), createBlankInternal(), getBits(), loadFromFile(), and setBits().

int ImageBitmap::width_ [protected]

Definition at line 66 of file ImageBitmap.h.

Referenced by clear(), createBlankInternal(), getWidth(), and loadFromFile().

int ImageBitmap::height_ [protected]

Definition at line 67 of file ImageBitmap.h.

Referenced by clear(), createBlankInternal(), getHeight(), and loadFromFile().

bool ImageBitmap::alpha_ [protected]

Definition at line 68 of file ImageBitmap.h.

Referenced by createBlankInternal(), getAlpha(), and getComponents().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:03 2009 for Scorched3D by  doxygen 1.5.3