Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

Bitmap_RLE16 Class Reference
[Graphics]

Inheritance diagram for Bitmap_RLE16:

Bitmap

List of all members.


Public Member Functions

 Bitmap_RLE16 ()
 Bitmap_RLE16 (const Asset &asset)
 Bitmap_RLE16 (const Image &image, bool dither=false)
 ~Bitmap_RLE16 ()
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 GenerateRLE16

Detailed Description

Author:
Mattias Gustavsson
Todo:
Clipping

Optimize for masked/unmasked/clipped/unclipped

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

Move blit implementations to BlitterRLE16/CopperRLE16

Rendering bug when hPitch!=width. Rewrite the renderer to make it work properly. Row-by-row storage?

Definition at line 26 of file Bitmap_RLE16.h.


Constructor & Destructor Documentation

Bitmap_RLE16::Bitmap_RLE16 (  ) 

Definition at line 22 of file Bitmap_RLE16.cpp.

Bitmap_RLE16::Bitmap_RLE16 ( const Asset asset  ) 

Definition at line 33 of file Bitmap_RLE16.cpp.

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

Parameters:
image Image to create bitmap from

Definition at line 45 of file Bitmap_RLE16.cpp.

Bitmap_RLE16::~Bitmap_RLE16 (  ) 

Definition at line 59 of file Bitmap_RLE16.cpp.


Member Function Documentation

StringId Bitmap_RLE16::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 13 of file Bitmap_RLE16.cpp.

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

Definition at line 260 of file Bitmap_RLE16.cpp.

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

Definition at line 268 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 276 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 283 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 290 of file Bitmap_RLE16.cpp.

int Bitmap_RLE16::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 210 of file Bitmap_RLE16.cpp.

int Bitmap_RLE16::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 235 of file Bitmap_RLE16.cpp.

unsigned short Bitmap_RLE16::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 305 of file Bitmap_RLE16.cpp.

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

Reimplemented from Bitmap.

Definition at line 326 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 298 of file Bitmap_RLE16.cpp.

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

Reimplemented from Bitmap.

Definition at line 319 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 340 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 347 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 355 of file Bitmap_RLE16.cpp.

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

Reimplemented from Bitmap.

Definition at line 363 of file Bitmap_RLE16.cpp.

void Bitmap_RLE16::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 370 of file Bitmap_RLE16.cpp.

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

Implements Bitmap.

Definition at line 75 of file Bitmap_RLE16.cpp.

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

Implements Bitmap.

Definition at line 93 of file Bitmap_RLE16.cpp.

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

Implements Bitmap.

Definition at line 187 of file Bitmap_RLE16.cpp.

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

Implements Bitmap.

Definition at line 162 of file Bitmap_RLE16.cpp.


Friends And Related Function Documentation

friend class GenerateRLE16 [friend]

Definition at line 79 of file Bitmap_RLE16.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.