gedi::RGBAImage Class Reference

#include <RGBAImage.h>

Inherited by gedi::DynRGBAImage.

Inheritance diagram for gedi::RGBAImage:

[legend]
List of all members.

Public Member Functions

 RGBAImage (void)
 ~RGBAImage (void)
RGBAImageoperator= (gedi::RGBAImage &rkImage)
gedi::Error32 LoadFromBitmap (LPSTR lpszFilename)
gedi::Error32 LoadFromTarga (LPSTR lpszFilename)
void SetColorKey (gedi::UInt8 iRed, gedi::UInt8 iGreen, gedi::UInt8 iBlue)
void SetWidth (gedi::UInt32 width)
void SetHeight (gedi::UInt32 height)
void SetColor (gedi::UInt32 iX, gedi::UInt32 iY, gedi::UInt8 iRed, gedi::UInt8 iGreen, gedi::UInt8 iBlue, gedi::UInt8 iAlpha)
void SetImageBuffer (gedi::UInt32 *pImage)
gedi::UInt32 GetWidth (void)
gedi::UInt32 GetHeight (void)
gedi::UInt32 GetColor (gedi::UInt32 iX, gedi::UInt32 iY)
gedi::UInt32 * GetImageBuffer (void)

Detailed Description

This class is reponsible for loading .bmp or targa files.

This is a base class from the Mirus distribution for loading .bmp or targa files. The class does NOT handle animations. This is handled by the ABO class which contains an RGBAImage object. Also, this class is general. It does not check nor require that the image is 2^n x 2^n.


Constructor & Destructor Documentation

gedi::RGBAImage::RGBAImage ( void   ) 

Constructor

gedi::RGBAImage::~RGBAImage ( void   ) 

Destructor


Member Function Documentation

gedi::RGBAImage & gedi::RGBAImage::operator= ( gedi::RGBAImage rkImage  ) 

Assign one image to another.

Parameters:
rkImage Reference to the image being assinged.
Returns:
The assinged image.

gedi::Error32 gedi::RGBAImage::LoadFromBitmap ( LPSTR  lpszFilename  ) 

Load image from Windows bitmap (BMP) file

Parameters:
lpszFilename 

gedi::Error32 gedi::RGBAImage::LoadFromTarga ( LPSTR  lpszFilename  ) 

Load image from targa-type file

Parameters:
lpszFilename 

void gedi::RGBAImage::SetColorKey ( gedi::UInt8  iRed,
gedi::UInt8  iGreen,
gedi::UInt8  iBlue 
)

Set the color key according to the RGB parameters.

This method sets the alpha component to zero for every pixel which is the same as the color key. As such, only the background color shows.

Parameters:
iRed Red component of the color key.
iGreen Green component of the color key.
iBlue Blue component of the color key.

void gedi::RGBAImage::SetWidth ( gedi::UInt32  width  ) 

Set the image width.

Use of this method is somewhat dangerous since the width of the image is determined by the loaded image. Using this method does not affect the image.

Parameters:
width Width of the image.

void gedi::RGBAImage::SetHeight ( gedi::UInt32  height  ) 

Set the image height.

Use of this method is somewhat dangerous since the height of the image is determined by the loaded image. Using this method does not affect the image.

Parameters:
height Height of the image.

void gedi::RGBAImage::SetColor ( gedi::UInt32  iX,
gedi::UInt32  iY,
gedi::UInt8  iRed,
gedi::UInt8  iGreen,
gedi::UInt8  iBlue,
gedi::UInt8  iAlpha 
)

Set a pixel color a coordinate iX,iY.

Parameters:
iX X coordinate.
iY Y coordinate.
iRed Red component.
iGreen Green component.
iBlue Blue component.
iAlpha Alpha component.

void gedi::RGBAImage::SetImageBuffer ( gedi::UInt32 *  pImage  ) 

Set (ie,replace) the image buffer to a new one.

New and old buffer must be same w x h dimension.

Parameters:
pImage Pointer to the new buffer.

gedi::UInt32 gedi::RGBAImage::GetWidth ( void   ) 

Get the width of the image.

Returns:
Image width in RGBA pixels.

gedi::UInt32 gedi::RGBAImage::GetHeight ( void   ) 

Get the height of the image.

Returns:
Image height in RGBA pixels

gedi::UInt32 gedi::RGBAImage::GetColor ( gedi::UInt32  iX,
gedi::UInt32  iY 
)

Get the RGBA color at X,Y coordinate.

Returns:
RGBA color

Reimplemented in gedi::DynRGBAImage.

gedi::UInt32 * gedi::RGBAImage::GetImageBuffer ( void   ) 

Get pointer to image buffer.

Returns:
Pointer to image buffer.


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