Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Bitmap Class Reference

#include <Bitmap.h>

Inheritance diagram for Bitmap:
Resource

List of all members.

Public Types

enum  BMP_TYPES { BMP_SOLID, BMP_TRANSPARENT, BMP_TRANSLUCENT }

Public Member Functions

 Bitmap ()
 Bitmap (int w, int h, ColorIndex *p=0, int t=BMP_SOLID)
 Bitmap (int w, int h, Color *p, int t=BMP_SOLID)
virtual ~Bitmap ()
int IsIndexed () const
int IsHighColor () const
int IsDual () const
void SetType (int t)
int Type () const
bool IsSolid () const
bool IsTransparent () const
bool IsTranslucent () const
int Width () const
int Height () const
ColorIndexPixels () const
ColorHiPixels () const
int BmpSize () const
int RowSize () const
ColorIndex GetIndex (int x, int y) const
Color GetColor (int x, int y) const
void SetIndex (int x, int y, ColorIndex c)
void SetColor (int x, int y, Color c)
void FillColor (Color c)
void ClearImage ()
void BitBlt (int x, int y, const Bitmap &srcImage, int sx, int sy, int w, int h, bool blend=false)
void CopyBitmap (const Bitmap &rhs)
void CopyImage (int w, int h, BYTE *p, int t=BMP_SOLID)
void CopyHighColorImage (int w, int h, DWORD *p, int t=BMP_SOLID)
void CopyAlphaImage (int w, int h, BYTE *p)
void CopyAlphaRedChannel (int w, int h, DWORD *p)
void AutoMask (DWORD mask=0)
virtual BYTE * GetSurface ()
virtual int Pitch () const
virtual int PixSize () const
bool ClipLine (int &x1, int &y1, int &x2, int &y2)
bool ClipLine (double &x1, double &y1, double &x2, double &y2)
void DrawLine (int x1, int y1, int x2, int y2, Color color)
void DrawRect (int x1, int y1, int x2, int y2, Color color)
void DrawRect (const Rect &r, Color color)
void FillRect (int x1, int y1, int x2, int y2, Color color)
void FillRect (const Rect &r, Color color)
void DrawEllipse (int x1, int y1, int x2, int y2, Color color, BYTE quad=0x0f)
void DrawEllipsePoints (int x0, int y0, int x, int y, Color c, BYTE quad)
void ScaleTo (int w, int h)
void MakeIndexed ()
void MakeHighColor ()
void MakeTexture ()
bool IsTexture () const
void TakeOwnership ()
const char * GetFilename () const
void SetFilename (const char *s)
DWORD LastModified () const
- Public Member Functions inherited from Resource
 Resource ()
virtual ~Resource ()
int operator== (const Resource &r) const
HANDLE Handle () const

Static Public Member Functions

static const char * TYPENAME ()
static BitmapDefault ()
static BitmapGetBitmapByID (HANDLE bmp_id)
static BitmapCheckCache (const char *filename)
static void AddToCache (Bitmap *bmp)
static void CacheUpdate ()
static void ClearCache ()
static DWORD CacheMemoryFootprint ()

Protected Attributes

int type
int width
int height
int mapsize
bool ownpix
bool alpha_loaded
bool texture
ColorIndexpix
Colorhipix
DWORD last_modified
char filename [64]
- Protected Attributes inherited from Resource
HANDLE id

Detailed Description

Definition at line 27 of file Bitmap.h.


Member Enumeration Documentation

Enumerator:
BMP_SOLID 
BMP_TRANSPARENT 
BMP_TRANSLUCENT 

Definition at line 32 of file Bitmap.h.


Constructor & Destructor Documentation

Bitmap::Bitmap ( )

Definition at line 64 of file Bitmap.cpp.

Bitmap::Bitmap ( int  w,
int  h,
ColorIndex p = 0,
int  t = BMP_SOLID 
)

Definition at line 73 of file Bitmap.cpp.

Bitmap::Bitmap ( int  w,
int  h,
Color p,
int  t = BMP_SOLID 
)

Definition at line 82 of file Bitmap.cpp.

Bitmap::~Bitmap ( )
virtual

Definition at line 93 of file Bitmap.cpp.


Member Function Documentation

void Bitmap::AddToCache ( Bitmap bmp)
static

Definition at line 860 of file Bitmap.cpp.

void Bitmap::AutoMask ( DWORD  mask = 0)

Definition at line 435 of file Bitmap.cpp.

void Bitmap::BitBlt ( int  x,
int  y,
const Bitmap srcImage,
int  sx,
int  sy,
int  w,
int  h,
bool  blend = false 
)

Definition at line 149 of file Bitmap.cpp.

int Bitmap::BmpSize ( ) const

Definition at line 104 of file Bitmap.cpp.

DWORD Bitmap::CacheMemoryFootprint ( )
static

Definition at line 883 of file Bitmap.cpp.

void Bitmap::CacheUpdate ( )
static

Definition at line 866 of file Bitmap.cpp.

Bitmap * Bitmap::CheckCache ( const char *  filename)
static

Definition at line 848 of file Bitmap.cpp.

void Bitmap::ClearCache ( )
static

Definition at line 877 of file Bitmap.cpp.

void Bitmap::ClearImage ( )

Definition at line 301 of file Bitmap.cpp.

bool Bitmap::ClipLine ( int &  x1,
int &  y1,
int &  x2,
int &  y2 
)

Definition at line 904 of file Bitmap.cpp.

bool Bitmap::ClipLine ( double &  x1,
double &  y1,
double &  x2,
double &  y2 
)

Definition at line 963 of file Bitmap.cpp.

void Bitmap::CopyAlphaImage ( int  w,
int  h,
BYTE *  p 
)

Definition at line 393 of file Bitmap.cpp.

void Bitmap::CopyAlphaRedChannel ( int  w,
int  h,
DWORD *  p 
)

Definition at line 413 of file Bitmap.cpp.

void Bitmap::CopyBitmap ( const Bitmap rhs)

Definition at line 249 of file Bitmap.cpp.

void Bitmap::CopyHighColorImage ( int  w,
int  h,
DWORD *  p,
int  t = BMP_SOLID 
)

Definition at line 358 of file Bitmap.cpp.

void Bitmap::CopyImage ( int  w,
int  h,
BYTE *  p,
int  t = BMP_SOLID 
)

Definition at line 323 of file Bitmap.cpp.

Bitmap * Bitmap::Default ( )
static

Definition at line 799 of file Bitmap.cpp.

void Bitmap::DrawEllipse ( int  x1,
int  y1,
int  x2,
int  y2,
Color  color,
BYTE  quad = 0x0f 
)

Definition at line 1402 of file Bitmap.cpp.

void Bitmap::DrawEllipsePoints ( int  x0,
int  y0,
int  x,
int  y,
Color  c,
BYTE  quad 
)

Definition at line 1481 of file Bitmap.cpp.

void Bitmap::DrawLine ( int  x1,
int  y1,
int  x2,
int  y2,
Color  color 
)

Definition at line 1022 of file Bitmap.cpp.

void Bitmap::DrawRect ( int  x1,
int  y1,
int  x2,
int  y2,
Color  color 
)

Definition at line 1280 of file Bitmap.cpp.

void Bitmap::DrawRect ( const Rect r,
Color  color 
)

Definition at line 1312 of file Bitmap.cpp.

void Bitmap::FillColor ( Color  c)

Definition at line 461 of file Bitmap.cpp.

void Bitmap::FillRect ( int  x1,
int  y1,
int  x2,
int  y2,
Color  color 
)

Definition at line 1343 of file Bitmap.cpp.

void Bitmap::FillRect ( const Rect r,
Color  color 
)

Definition at line 1370 of file Bitmap.cpp.

Bitmap * Bitmap::GetBitmapByID ( HANDLE  bmp_id)
static

Definition at line 836 of file Bitmap.cpp.

Color Bitmap::GetColor ( int  x,
int  y 
) const

Definition at line 722 of file Bitmap.cpp.

const char* Bitmap::GetFilename ( ) const
inline

Definition at line 93 of file Bitmap.h.

ColorIndex Bitmap::GetIndex ( int  x,
int  y 
) const

Definition at line 702 of file Bitmap.cpp.

BYTE * Bitmap::GetSurface ( )
virtual

Definition at line 134 of file Bitmap.cpp.

int Bitmap::Height ( ) const
inline

Definition at line 51 of file Bitmap.h.

Color* Bitmap::HiPixels ( ) const
inline

Definition at line 53 of file Bitmap.h.

int Bitmap::IsDual ( ) const
inline

Definition at line 41 of file Bitmap.h.

int Bitmap::IsHighColor ( ) const
inline

Definition at line 40 of file Bitmap.h.

int Bitmap::IsIndexed ( ) const
inline

Definition at line 39 of file Bitmap.h.

bool Bitmap::IsSolid ( ) const
inline

Definition at line 46 of file Bitmap.h.

bool Bitmap::IsTexture ( ) const
inline

Definition at line 90 of file Bitmap.h.

bool Bitmap::IsTranslucent ( ) const
inline

Definition at line 48 of file Bitmap.h.

bool Bitmap::IsTransparent ( ) const
inline

Definition at line 47 of file Bitmap.h.

DWORD Bitmap::LastModified ( ) const
inline

Definition at line 96 of file Bitmap.h.

void Bitmap::MakeHighColor ( )

Definition at line 593 of file Bitmap.cpp.

void Bitmap::MakeIndexed ( )

Definition at line 564 of file Bitmap.cpp.

void Bitmap::MakeTexture ( )

Definition at line 648 of file Bitmap.cpp.

int Bitmap::Pitch ( ) const
virtual

Definition at line 116 of file Bitmap.cpp.

ColorIndex* Bitmap::Pixels ( ) const
inline

Definition at line 52 of file Bitmap.h.

int Bitmap::PixSize ( ) const
virtual

Definition at line 122 of file Bitmap.cpp.

int Bitmap::RowSize ( ) const

Definition at line 110 of file Bitmap.cpp.

void Bitmap::ScaleTo ( int  w,
int  h 
)

Definition at line 490 of file Bitmap.cpp.

void Bitmap::SetColor ( int  x,
int  y,
Color  c 
)

Definition at line 760 of file Bitmap.cpp.

void Bitmap::SetFilename ( const char *  s)

Definition at line 778 of file Bitmap.cpp.

void Bitmap::SetIndex ( int  x,
int  y,
ColorIndex  c 
)

Definition at line 742 of file Bitmap.cpp.

void Bitmap::SetType ( int  t)
inline

Definition at line 44 of file Bitmap.h.

void Bitmap::TakeOwnership ( )
inline

Definition at line 91 of file Bitmap.h.

int Bitmap::Type ( ) const
inline

Definition at line 45 of file Bitmap.h.

static const char* Bitmap::TYPENAME ( )
inlinestatic

Definition at line 30 of file Bitmap.h.

int Bitmap::Width ( ) const
inline

Definition at line 50 of file Bitmap.h.


Member Data Documentation

bool Bitmap::alpha_loaded
protected

Definition at line 114 of file Bitmap.h.

char Bitmap::filename[64]
protected

Definition at line 120 of file Bitmap.h.

int Bitmap::height
protected

Definition at line 110 of file Bitmap.h.

Color* Bitmap::hipix
protected

Definition at line 118 of file Bitmap.h.

DWORD Bitmap::last_modified
protected

Definition at line 119 of file Bitmap.h.

int Bitmap::mapsize
protected

Definition at line 111 of file Bitmap.h.

bool Bitmap::ownpix
protected

Definition at line 113 of file Bitmap.h.

ColorIndex* Bitmap::pix
protected

Definition at line 117 of file Bitmap.h.

bool Bitmap::texture
protected

Definition at line 115 of file Bitmap.h.

int Bitmap::type
protected

Definition at line 108 of file Bitmap.h.

int Bitmap::width
protected

Definition at line 109 of file Bitmap.h.


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