Wt::SDLColor Class Reference

#include <sdlcolor.h>

Inherited by Wt::Color.

List of all members.

Public Types

 Transparent = SDL_ALPHA_TRANSPARENT
 Opaque = SDL_ALPHA_OPAQUE
enum  { Transparent = SDL_ALPHA_TRANSPARENT, Opaque = SDL_ALPHA_OPAQUE }
 The alpha channel values for transparent and opaque. More...

Public Member Functions

 SDLColor ()
 Default constructor (opaque black).
 SDLColor (int red, int green, int blue, int alpha=Opaque)
 Construct from a triple/quadruple. (R, G, B, A).
 SDLColor (const SDL_Color &color)
 constructor from a base object
SDLColoroperator= (const SDL_Color &color)
 assign operator
 operator const SDL_Color & () const
 operator SDL_Color & ()
int red () const
int green () const
int blue () const
int alpha () const
void setRed (int red)
void setGreen (int green)
void setBlue (int blue)
void setAlpha (int alpha)
void setColor (int red, int green, int blue, int alpha)
bool equals (const SDLColor &other) const
 Compares colors (without alpha channel !).
bool operator== (const SDLColor &other) const
bool operator!= (const SDLColor &other) const
 Inequality comparison.

Static Public Member Functions

static void calcBlendFactors (int factor, int &new_factor, int &old_factor)
static SDLColor blend (const SDLColor &old_color, int old_factor, const SDLColor &new_color, int new_factor, int new_alpha_factor=Transparent, int old_alpha_factor=Opaque)


Detailed Description

Note:
don't change object size to keep SDL_Color compatibility. that means:


Member Enumeration Documentation

anonymous enum

The alpha channel values for transparent and opaque.

Enumerator:
Transparent 
Opaque 


Constructor & Destructor Documentation

Wt::SDLColor::SDLColor (  )  [inline]

Default constructor (opaque black).

Wt::SDLColor::SDLColor ( int  red,
int  green,
int  blue,
int  alpha = Opaque 
) [inline]

Construct from a triple/quadruple. (R, G, B, A).

Wt::SDLColor::SDLColor ( const SDL_Color &  color  )  [inline]

constructor from a base object


Member Function Documentation

int Wt::SDLColor::alpha (  )  const [inline]

static SDLColor Wt::SDLColor::blend ( const SDLColor old_color,
int  old_factor,
const SDLColor new_color,
int  new_factor,
int  new_alpha_factor = Transparent,
int  old_alpha_factor = Opaque 
) [inline, static]

int Wt::SDLColor::blue (  )  const [inline]

static void Wt::SDLColor::calcBlendFactors ( int  factor,
int &  new_factor,
int &  old_factor 
) [inline, static]

bool Wt::SDLColor::equals ( const SDLColor other  )  const [inline]

Compares colors (without alpha channel !).

int Wt::SDLColor::green (  )  const [inline]

Wt::SDLColor::operator const SDL_Color & (  )  const [inline]

Wt::SDLColor::operator SDL_Color & (  )  [inline]

bool Wt::SDLColor::operator!= ( const SDLColor other  )  const [inline]

Inequality comparison.

SDLColor& Wt::SDLColor::operator= ( const SDL_Color &  color  )  [inline]

assign operator

bool Wt::SDLColor::operator== ( const SDLColor other  )  const [inline]

int Wt::SDLColor::red (  )  const [inline]

void Wt::SDLColor::setAlpha ( int  alpha  )  [inline]

void Wt::SDLColor::setBlue ( int  blue  )  [inline]

void Wt::SDLColor::setColor ( int  red,
int  green,
int  blue,
int  alpha 
) [inline]

void Wt::SDLColor::setGreen ( int  green  )  [inline]

void Wt::SDLColor::setRed ( int  red  )  [inline]


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

Generated Fri Jul 28 19:22:38 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.