Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

Bitmap_RLE8 Class Reference
[Graphics]

Inheritance diagram for Bitmap_RLE8:

Bitmap

List of all members.


Public Member Functions

 Bitmap_RLE8 ()
 Bitmap_RLE8 (const Asset &asset)
 Bitmap_RLE8 (const Image &image, bool dither=false)
 ~Bitmap_RLE8 ()
virtual StringId GetType ()
virtual unsigned short * GetColorData ()
virtual unsigned char * GetAlphaData ()
virtual void Clear ()
virtual void Fill (int x1, int y1, int x2, int y2, unsigned short color, unsigned char alpha=255)
virtual void Fill (unsigned short color, unsigned char alpha=255)
virtual int GetWidth (Transformation transformation=NoTransformation) const
virtual int GetHeight (Transformation transformation=NoTransformation) const
virtual unsigned short GetPixelColor (int x, int y, Transformation transformation=NoTransformation) const
virtual unsigned char GetPixelAlpha (int x, int y, Transformation transformation=NoTransformation) const
virtual void SetPixelColor (int x, int y, unsigned short color, Transformation transformation=NoTransformation)
virtual void SetPixelAlpha (int x, int y, unsigned char alpha, Transformation transformation=NoTransformation)
virtual void BlendPixel (int x, int y, unsigned short color, unsigned char alpha, Transformation transformation=NoTransformation)
virtual void Blit (Bitmap &target, int x, int y, unsigned short modulate=0xffff, unsigned char alpha=255, Transformation transformation=NoTransformation) const
virtual void Blit (int x1, int y1, int x2, int y2, Bitmap &target, int x, int y, unsigned short modulate=0xffff, unsigned char alpha=255, Transformation transformation=NoTransformation) const
virtual void Copy (Bitmap &target, int x, int y, unsigned short modulate=0xffff, Transformation transformation=NoTransformation) const
virtual void Copy (int x1, int y1, int x2, int y2, Bitmap &target, int x, int y, unsigned short modulate=0xffff, Transformation transformation=NoTransformation) const
virtual void Save (Asset &asset) const
virtual void Load (const Asset &asset)
virtual void WriteToAsset (Asset *asset) const
virtual void ReadFromAsset (const Asset *asset)

Friends

class GenerateRLE8
class GenerateRLE8old

Detailed Description

Author:
Mattias Gustavsson
Todo:
Refactor and clean up

Add methods to conform to Bitmap interface (Copy, transformations etc)

Definition at line 26 of file Bitmap_RLE8.h.


Constructor & Destructor Documentation

Bitmap_RLE8::Bitmap_RLE8 (  ) 

Definition at line 27 of file Bitmap_RLE8.cpp.

Bitmap_RLE8::Bitmap_RLE8 ( const Asset asset  ) 

Definition at line 72 of file Bitmap_RLE8.cpp.

Bitmap_RLE8::Bitmap_RLE8 ( const Image image,
bool  dither = false 
)

Definition at line 49 of file Bitmap_RLE8.cpp.

Bitmap_RLE8::~Bitmap_RLE8 (  ) 

Definition at line 95 of file Bitmap_RLE8.cpp.


Member Function Documentation

StringId Bitmap_RLE8::GetType (  )  [virtual]

The Bitmap class is an abstract interface, and is implemented by a number of different bitmap classes. The GetType method retrieves the name of the actual implementation for the Bitmap instance.

Returns:
A StringId containing the class name of this bitmaps implementation

Implements Bitmap.

Definition at line 18 of file Bitmap_RLE8.cpp.

unsigned short * Bitmap_RLE8::GetColorData (  )  [virtual]

Definition at line 171 of file Bitmap_RLE8.cpp.

unsigned char * Bitmap_RLE8::GetAlphaData (  )  [virtual]

Definition at line 179 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Clear (  )  [virtual]

Sets every pixel of the bitmap to black (0). Internally this just uses a memset for speed. If you want to clear to any other color, you need to use the Fill method, which is slightly slower. If the bitmap has an alpha channel, it will be cleared too.

Reimplemented from Bitmap.

Definition at line 187 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Fill ( int  x1,
int  y1,
int  x2,
int  y2,
unsigned short  color,
unsigned char  alpha = 255 
) [virtual]

Fills the specified area of the bitmap with the specified color. If an alpha value is specified, the filled area will be semi-transparent, and what was already in the bitmap will show through. Note that the filled area will include the x2 and y2 pixels as well (it won't leave the last pixel blank as for instance DirectX dies).

If the specified area is outside of the bitmap, it will be clipped to the extents of the bitmap. If the bitmap has an alpha channel, it won't be affected by Fill.

Reimplemented from Bitmap.

Definition at line 194 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Fill ( unsigned short  color,
unsigned char  alpha = 255 
) [virtual]

Fills the entire bitmap with the specified color. If an alpha value is specified, the fill will be semi-transparent, and what was already in the bitmap will show through. If the bitmap has an alpha channel, it won't be affected by Fill.

Reimplemented from Bitmap.

Definition at line 201 of file Bitmap_RLE8.cpp.

int Bitmap_RLE8::GetWidth ( Transformation  transformation = NoTransformation  )  const [virtual]

Gets the width of the bitmap

Returns:
The width of the bitmap in pixels

Reimplemented from Bitmap.

Definition at line 121 of file Bitmap_RLE8.cpp.

int Bitmap_RLE8::GetHeight ( Transformation  transformation = NoTransformation  )  const [virtual]

Gets the height of the bitmap

Returns:
The height of the bitmap in pixels

Reimplemented from Bitmap.

Definition at line 146 of file Bitmap_RLE8.cpp.

unsigned short Bitmap_RLE8::GetPixelColor ( int  x,
int  y,
Transformation  transformation = NoTransformation 
) const [virtual]

Gets the 16 bit (R5G6B5) pixel at the specified coordinate of the bitmap This version of GetPixel will take an Transformation parameters, so you can get pixels as if the bitmap was transformed.

Returns:
The pixel at the specified coordinate

Reimplemented from Bitmap.

Definition at line 216 of file Bitmap_RLE8.cpp.

unsigned char Bitmap_RLE8::GetPixelAlpha ( int  x,
int  y,
Transformation  transformation = NoTransformation 
) const [virtual]

Reimplemented from Bitmap.

Definition at line 237 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::SetPixelColor ( int  x,
int  y,
unsigned short  color,
Transformation  transformation = NoTransformation 
) [virtual]

Changes the pixel at the specified coordinate of the bitmap. This version of SetPixel will take an Transformation parameters, so you can set pixels as if the bitmap was transformed.

Reimplemented from Bitmap.

Definition at line 209 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::SetPixelAlpha ( int  x,
int  y,
unsigned char  alpha,
Transformation  transformation = NoTransformation 
) [virtual]

Reimplemented from Bitmap.

Definition at line 230 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::BlendPixel ( int  x,
int  y,
unsigned short  color,
unsigned char  alpha,
Transformation  transformation = NoTransformation 
) [virtual]

Blends the pixel at the specified coordinate with the specified color, using the specified alpha value as a blend factor. This version of BlenPixel will take an Transformation parameters, so you can blend pixels as if the bitmap was transformed.

Reimplemented from Bitmap.

Definition at line 251 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Blit ( Bitmap target,
int  x,
int  y,
unsigned short  modulate = 0xffff,
unsigned char  alpha = 255,
Transformation  transformation = NoTransformation 
) const [virtual]

This method will blit this bitmap onto the target bitmap at the specified coordinate. It will blit the entire bitmap onto the target, but it will perform clipping on the parts which are outside of the target.

Reimplemented from Bitmap.

Definition at line 258 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Blit ( int  x1,
int  y1,
int  x2,
int  y2,
Bitmap target,
int  x,
int  y,
unsigned short  modulate = 0xffff,
unsigned char  alpha = 255,
Transformation  transformation = NoTransformation 
) const [virtual]

This method will blit a section of this bitmap onto the target bitmap at the specified coordinate. You specify the top-left and bottom-right coordinates of a rectangle you want to blit onto the target. Clipping will be performed on the parts which are outside of the target.

Todo:
This test must take transformations into account

Reimplemented from Bitmap.

Definition at line 266 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Copy ( Bitmap target,
int  x,
int  y,
unsigned short  modulate = 0xffff,
Transformation  transformation = NoTransformation 
) const [virtual]

Reimplemented from Bitmap.

Definition at line 274 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Copy ( int  x1,
int  y1,
int  x2,
int  y2,
Bitmap target,
int  x,
int  y,
unsigned short  modulate = 0xffff,
Transformation  transformation = NoTransformation 
) const [virtual]

Reimplemented from Bitmap.

Definition at line 282 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Save ( Asset asset  )  const [virtual]

Implements Bitmap.

Definition at line 852 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::Load ( const Asset asset  )  [virtual]

Implements Bitmap.

Definition at line 869 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::WriteToAsset ( Asset asset  )  const [virtual]

Implements Bitmap.

Definition at line 319 of file Bitmap_RLE8.cpp.

void Bitmap_RLE8::ReadFromAsset ( const Asset asset  )  [virtual]

Implements Bitmap.

Definition at line 290 of file Bitmap_RLE8.cpp.


Friends And Related Function Documentation

friend class GenerateRLE8 [friend]

Definition at line 86 of file Bitmap_RLE8.h.

friend class GenerateRLE8old [friend]

Definition at line 87 of file Bitmap_RLE8.h.



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.