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

#include <Color.h>

List of all members.

Public Types

enum  Misc { SHADE_LEVELS = 64 }
enum  Mask {
  RMask = 0x00ff0000, GMask = 0x0000ff00, BMask = 0x000000ff, AMask = 0xff000000,
  RGBMask = 0x00ffffff
}
enum  Shift { RShift = 16, GShift = 8, BShift = 0, AShift = 24 }

Public Member Functions

 Color ()
 Color (const Color &c)
 Color (BYTE r, BYTE g, BYTE b, BYTE a=255)
 Color (BYTE index)
Coloroperator= (const Color &c)
int operator== (const Color &c) const
int operator!= (const Color &c) const
Coloroperator+= (const Color &c)
Color operator+ (DWORD d) const
Color operator+ (const Color &c) const
Color operator* (const Color &c) const
Color operator* (double scale) const
Color dim (double scale) const
void Set (DWORD value)
void Set (BYTE r, BYTE g, BYTE b, BYTE a=255)
DWORD Value () const
void SetRed (BYTE r)
void SetGreen (BYTE g)
void SetBlue (BYTE b)
void SetAlpha (BYTE a)
DWORD Red () const
DWORD Green () const
DWORD Blue () const
DWORD Alpha () const
float fRed () const
float fGreen () const
float fBlue () const
float fAlpha () const
BYTE Index () const
BYTE IndexedBlend (BYTE dst) const
DWORD TextureFormat (int keep_alpha=0) const
DWORD Formatted () const
DWORD Unfaded () const
Color ShadeColor (int shade) const
DWORD Shaded (int shade) const
Color Faded () const

Static Public Member Functions

static const char * TYPENAME ()
static DWORD FormattedBlend (DWORD c1, DWORD c2)
static void UseVideo (Video *v)
static void UseFormat (const ColorFormat &cf)
static void UseTextureFormat (const ColorFormat &cf, int alpha_level=0)
static void WithTextureFormat (int alpha_level=0)
static void SetPalette (PALETTEENTRY *pal, int palsize, BYTE *invpal=0)
static void SavePalette (const char *basename)
static void SetFade (double f, Color c=Black, int build_shade=false)
static const ColorFormatGetTextureFormat (int alpha_level=0)
static const ColorFormatGetScreenFormat ()
static void BuildShadeTable ()
static void SaveShadeTable (const char *basename)
static void BuildBlendTable ()
static double GetFade ()
static Color GetFadeColor ()
static Color Scale (const Color &c1, const Color &c2, double scale)
static Color Unformat (DWORD formatted_color)

Static Public Attributes

static Color White = Color(255,255,255)
static Color Black = Color( 0, 0, 0)
static Color Gray = Color(128,128,128)
static Color LightGray = Color(192,192,192)
static Color DarkGray = Color( 64, 64, 64)
static Color BrightRed = Color(255, 0, 0)
static Color BrightBlue = Color( 0, 0,255)
static Color BrightGreen = Color( 0,255, 0)
static Color DarkRed = Color(128, 0, 0)
static Color DarkBlue = Color( 0, 0,128)
static Color DarkGreen = Color( 0,128, 0)
static Color Yellow = Color(255,255, 0)
static Color Cyan = Color( 0,255,255)
static Color Magenta = Color(255, 0,255)
static Color Tan = Color(180,150,120)
static Color Brown = Color(128,100, 80)
static Color Violet = Color(128, 0,128)
static Color Orange = Color(255,150, 20)

Friends

class ColorIndex
class ColorValue

Detailed Description

Definition at line 57 of file Color.h.


Member Enumeration Documentation

Enumerator:
RMask 
GMask 
BMask 
AMask 
RGBMask 

Definition at line 66 of file Color.h.

Enumerator:
SHADE_LEVELS 

Definition at line 65 of file Color.h.

Enumerator:
RShift 
GShift 
BShift 
AShift 

Definition at line 71 of file Color.h.


Constructor & Destructor Documentation

Color::Color ( )
inline

Definition at line 76 of file Color.h.

Color::Color ( const Color c)
inline

Definition at line 77 of file Color.h.

Color::Color ( BYTE  r,
BYTE  g,
BYTE  b,
BYTE  a = 255 
)
inline

Definition at line 78 of file Color.h.

Color::Color ( BYTE  index)

Definition at line 62 of file Color.cpp.


Member Function Documentation

DWORD Color::Alpha ( ) const
inline

Definition at line 109 of file Color.h.

DWORD Color::Blue ( ) const
inline

Definition at line 108 of file Color.h.

void Color::BuildBlendTable ( )
static

Definition at line 574 of file Color.cpp.

void Color::BuildShadeTable ( )
static

Definition at line 564 of file Color.cpp.

Color Color::dim ( double  scale) const

Definition at line 133 of file Color.cpp.

Color Color::Faded ( ) const

Definition at line 182 of file Color.cpp.

float Color::fAlpha ( ) const
inline

Definition at line 114 of file Color.h.

float Color::fBlue ( ) const
inline

Definition at line 113 of file Color.h.

float Color::fGreen ( ) const
inline

Definition at line 112 of file Color.h.

DWORD Color::Formatted ( ) const

Definition at line 145 of file Color.cpp.

DWORD Color::FormattedBlend ( DWORD  c1,
DWORD  c2 
)
static

Definition at line 339 of file Color.cpp.

float Color::fRed ( ) const
inline

Definition at line 111 of file Color.h.

static double Color::GetFade ( )
inlinestatic

Definition at line 166 of file Color.h.

static Color Color::GetFadeColor ( )
inlinestatic

Definition at line 167 of file Color.h.

static const ColorFormat& Color::GetScreenFormat ( )
inlinestatic

Definition at line 159 of file Color.h.

static const ColorFormat& Color::GetTextureFormat ( int  alpha_level = 0)
inlinestatic

Definition at line 158 of file Color.h.

DWORD Color::Green ( ) const
inline

Definition at line 107 of file Color.h.

BYTE Color::Index ( ) const
inline

Definition at line 116 of file Color.h.

BYTE Color::IndexedBlend ( BYTE  dst) const
inline

Definition at line 292 of file Color.h.

int Color::operator!= ( const Color c) const
inline

Definition at line 85 of file Color.h.

Color Color::operator* ( const Color c) const

Definition at line 110 of file Color.cpp.

Color Color::operator* ( double  scale) const

Definition at line 122 of file Color.cpp.

Color Color::operator+ ( DWORD  d) const

Definition at line 83 of file Color.cpp.

Color Color::operator+ ( const Color c) const

Definition at line 95 of file Color.cpp.

Color & Color::operator+= ( const Color c)

Definition at line 72 of file Color.cpp.

Color& Color::operator= ( const Color c)
inline

Definition at line 83 of file Color.h.

int Color::operator== ( const Color c) const
inline

Definition at line 84 of file Color.h.

DWORD Color::Red ( ) const
inline

Definition at line 106 of file Color.h.

void Color::SavePalette ( const char *  basename)
static

Definition at line 502 of file Color.cpp.

void Color::SaveShadeTable ( const char *  basename)
static

Definition at line 597 of file Color.cpp.

Color Color::Scale ( const Color c1,
const Color c2,
double  scale 
)
static

Definition at line 326 of file Color.cpp.

void Color::Set ( DWORD  value)
inline

Definition at line 95 of file Color.h.

void Color::Set ( BYTE  r,
BYTE  g,
BYTE  b,
BYTE  a = 255 
)
inline

Definition at line 96 of file Color.h.

void Color::SetAlpha ( BYTE  a)
inline

Definition at line 104 of file Color.h.

void Color::SetBlue ( BYTE  b)
inline

Definition at line 103 of file Color.h.

void Color::SetFade ( double  f,
Color  c = Black,
int  build_shade = false 
)
static

Definition at line 518 of file Color.cpp.

void Color::SetGreen ( BYTE  g)
inline

Definition at line 102 of file Color.h.

void Color::SetPalette ( PALETTEENTRY *  pal,
int  palsize,
BYTE *  invpal = 0 
)
static

Definition at line 462 of file Color.cpp.

void Color::SetRed ( BYTE  r)
inline

Definition at line 101 of file Color.h.

Color Color::ShadeColor ( int  shade) const

Definition at line 268 of file Color.cpp.

DWORD Color::Shaded ( int  shade) const

Definition at line 295 of file Color.cpp.

DWORD Color::TextureFormat ( int  keep_alpha = 0) const

Definition at line 226 of file Color.cpp.

static const char* Color::TYPENAME ( )
inlinestatic

Definition at line 63 of file Color.h.

DWORD Color::Unfaded ( ) const

Definition at line 204 of file Color.cpp.

Color Color::Unformat ( DWORD  formatted_color)
static

Definition at line 303 of file Color.cpp.

void Color::UseFormat ( const ColorFormat cf)
static

Definition at line 370 of file Color.cpp.

void Color::UseTextureFormat ( const ColorFormat cf,
int  alpha_level = 0 
)
static

Definition at line 401 of file Color.cpp.

void Color::UseVideo ( Video v)
static

Definition at line 362 of file Color.cpp.

DWORD Color::Value ( ) const
inline

Definition at line 99 of file Color.h.

void Color::WithTextureFormat ( int  alpha_level = 0)
static

Definition at line 425 of file Color.cpp.


Friends And Related Function Documentation

friend class ColorIndex
friend

Definition at line 59 of file Color.h.

friend class ColorValue
friend

Definition at line 60 of file Color.h.


Member Data Documentation

Color Color::Black = Color( 0, 0, 0)
static

Definition at line 132 of file Color.h.

Color Color::BrightBlue = Color( 0, 0,255)
static

Definition at line 137 of file Color.h.

Color Color::BrightGreen = Color( 0,255, 0)
static

Definition at line 138 of file Color.h.

Color Color::BrightRed = Color(255, 0, 0)
static

Definition at line 136 of file Color.h.

Color Color::Brown = Color(128,100, 80)
static

Definition at line 146 of file Color.h.

Color Color::Cyan = Color( 0,255,255)
static

Definition at line 143 of file Color.h.

Color Color::DarkBlue = Color( 0, 0,128)
static

Definition at line 140 of file Color.h.

Color Color::DarkGray = Color( 64, 64, 64)
static

Definition at line 135 of file Color.h.

Color Color::DarkGreen = Color( 0,128, 0)
static

Definition at line 141 of file Color.h.

Color Color::DarkRed = Color(128, 0, 0)
static

Definition at line 139 of file Color.h.

Color Color::Gray = Color(128,128,128)
static

Definition at line 133 of file Color.h.

Color Color::LightGray = Color(192,192,192)
static

Definition at line 134 of file Color.h.

Color Color::Magenta = Color(255, 0,255)
static

Definition at line 144 of file Color.h.

Color Color::Orange = Color(255,150, 20)
static

Definition at line 148 of file Color.h.

Color Color::Tan = Color(180,150,120)
static

Definition at line 145 of file Color.h.

Color Color::Violet = Color(128, 0,128)
static

Definition at line 147 of file Color.h.

Color Color::White = Color(255,255,255)
static

Definition at line 131 of file Color.h.

Color Color::Yellow = Color(255,255, 0)
static

Definition at line 142 of file Color.h.


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