CL_PixelFormat Class Reference
[clanDisplay Display]

Pixel data format description. More...

#include <pixel_format.h>

List of all members.

Statics

static int get_mask_shift (unsigned int mask)
 Returns the shift of a color mask.
static int get_mask_bits (unsigned int mask)
 Returns the bit count of a color mask.
static unsigned int get_bitmask (int bits, int shift)
 Returns the color mask based on bit count and shift.
static CL_PixelFormat rgba8888
 Pixel format with 32 bit depth, 8 bits per color mask.
static CL_PixelFormat argb8888
 Pixel format with 32 bit depth, 8 bits per color mask.
static CL_PixelFormat rgb888
 Pixel format with 24 bit depth, 8 bits per color mask, no alpha.
static CL_PixelFormat rgba4444
 Pixel format with 16 bit depth, 4 bits per color mask.
static CL_PixelFormat rgb555
 Pixel format with 16 bit depth, 5 bits per color mask, one bit unused.
static CL_PixelFormat rgb565
 Pixel format with 16 bit depth, 5 bits for red and blue, 6 bits for green.
static CL_PixelFormat abgr8888
 Pixel format with 32 bit depth, 8 bits per color mask.
static CL_PixelFormat bgr888
 Pixel format with 24 bit depth, 8 bits per color mask, no alpha.
static CL_PixelFormat abgr4444
 Pixel format with 16 bit depth, 4 bits per color mask.
static CL_PixelFormat bgr555
 Pixel format with 16 bit depth, 5 bits per color mask, one bit unused.
static CL_PixelFormat bgr565
 Pixel format with 16 bit depth, 5 bits for red and blue, 6 bits for green.

Public Member Functions

Construction
 CL_PixelFormat ()
 Constructs a pixel format description.
 CL_PixelFormat (const CL_PixelFormat &copy)
 Constructs a PixelFormat.
 CL_PixelFormat (int depth, unsigned int red_mask, unsigned int green_mask, unsigned int blue_mask, unsigned int alpha_mask=0, bool use_colorkey=false, unsigned int colorkey=0, CL_PixelFormatType type=pixelformat_rgba)
Attributes
bool operator== (const CL_PixelFormat &other) const
 Returns true if this pixel format is the same as the other one.
bool operator!= (const CL_PixelFormat &other) const
 Returns true if this pixel format is not the same as the other one.
CL_PixelFormatType get_type () const
 Returns the pixel format type (RGB or Indexed).
bool has_colorkey () const
 Returns true if format uses a source color key.
int get_depth () const
 Returns the depth of the pixel format.
unsigned int get_colorkey () const
 Returns the source color key.
unsigned int get_red_mask () const
 Returns the red component color mask.
unsigned int get_green_mask () const
 Returns the green component color mask.
unsigned int get_blue_mask () const
 Returns the blue component color mask.
unsigned int get_alpha_mask () const
 Returns the alpha component color mask.
Operations
void set_type (CL_PixelFormatType new_type)
 Sets the pixel format type (RGB or Indexed).
void enable_colorkey (bool enable=true)
 Enable/disable color key.
void set_colorkey (unsigned int i)
 Sets the color key.
void set_depth (int i)
 Sets the depth of the pixel format.
void set_red_mask (unsigned int i)
 Sets the red component color mask.
void set_green_mask (unsigned int i)
 Sets the green component color mask.
void set_blue_mask (unsigned int i)
 Sets the blue component color mask.
void set_alpha_mask (unsigned int i)
 Sets the alpha component color mask.


Detailed Description

Pixel data format description.


Constructor & Destructor Documentation

CL_PixelFormat::CL_PixelFormat  ) 
 

Constructs a pixel format description.

Parameters:
depth Bits per pixel.
red_mask Red color mask.
green_mask Green color mask.
blue_mask Blue color mask.
alpha_mask Alpha transparency mask.
use_colorkey True if source color key transparency is used (single color transparency).
colorkey Source color key (pixel value that means transparent).

CL_PixelFormat::CL_PixelFormat const CL_PixelFormat copy  ) 
 

Constructs a PixelFormat.

Parameters:
copy = Pixel Format

CL_PixelFormat::CL_PixelFormat int  depth,
unsigned int  red_mask,
unsigned int  green_mask,
unsigned int  blue_mask,
unsigned int  alpha_mask = 0,
bool  use_colorkey = false,
unsigned int  colorkey = 0,
CL_PixelFormatType  type = pixelformat_rgba
 


Member Function Documentation

void CL_PixelFormat::enable_colorkey bool  enable = true  )  [inline]
 

Enable/disable color key.

unsigned int CL_PixelFormat::get_alpha_mask  )  const [inline]
 

Returns the alpha component color mask.

static unsigned int CL_PixelFormat::get_bitmask int  bits,
int  shift
[static]
 

Returns the color mask based on bit count and shift.

unsigned int CL_PixelFormat::get_blue_mask  )  const [inline]
 

Returns the blue component color mask.

unsigned int CL_PixelFormat::get_colorkey  )  const [inline]
 

Returns the source color key.

int CL_PixelFormat::get_depth  )  const [inline]
 

Returns the depth of the pixel format.

unsigned int CL_PixelFormat::get_green_mask  )  const [inline]
 

Returns the green component color mask.

static int CL_PixelFormat::get_mask_bits unsigned int  mask  )  [static]
 

Returns the bit count of a color mask.

static int CL_PixelFormat::get_mask_shift unsigned int  mask  )  [static]
 

Returns the shift of a color mask.

unsigned int CL_PixelFormat::get_red_mask  )  const [inline]
 

Returns the red component color mask.

CL_PixelFormatType CL_PixelFormat::get_type  )  const [inline]
 

Returns the pixel format type (RGB or Indexed).

bool CL_PixelFormat::has_colorkey  )  const [inline]
 

Returns true if format uses a source color key.

bool CL_PixelFormat::operator!= const CL_PixelFormat other  )  const
 

Returns true if this pixel format is not the same as the other one.

bool CL_PixelFormat::operator== const CL_PixelFormat other  )  const
 

Returns true if this pixel format is the same as the other one.

void CL_PixelFormat::set_alpha_mask unsigned int  i  )  [inline]
 

Sets the alpha component color mask.

void CL_PixelFormat::set_blue_mask unsigned int  i  )  [inline]
 

Sets the blue component color mask.

void CL_PixelFormat::set_colorkey unsigned int  i  )  [inline]
 

Sets the color key.

void CL_PixelFormat::set_depth int  i  )  [inline]
 

Sets the depth of the pixel format.

void CL_PixelFormat::set_green_mask unsigned int  i  )  [inline]
 

Sets the green component color mask.

void CL_PixelFormat::set_red_mask unsigned int  i  )  [inline]
 

Sets the red component color mask.

void CL_PixelFormat::set_type CL_PixelFormatType  new_type  )  [inline]
 

Sets the pixel format type (RGB or Indexed).


Member Data Documentation

CL_PixelFormat CL_PixelFormat::abgr4444 [static]
 

Pixel format with 16 bit depth, 4 bits per color mask.

red mask =0x000f
green mask=0x00f0
blue mask =0x0f00
alpha mask=0xf000

CL_PixelFormat CL_PixelFormat::abgr8888 [static]
 

Pixel format with 32 bit depth, 8 bits per color mask.

red mask =0x000000ff
green mask=0x0000ff00
blue mask =0x00ff0000
alpha mask=0xff000000

CL_PixelFormat CL_PixelFormat::argb8888 [static]
 

Pixel format with 32 bit depth, 8 bits per color mask.

alpha mask =0xff000000
red mask=0x00ff0000
green mask =0x0000ff00
blue mask=0x000000ff

CL_PixelFormat CL_PixelFormat::bgr555 [static]
 

Pixel format with 16 bit depth, 5 bits per color mask, one bit unused.

red mask =0x001f
green mask=0x03e0
blue mask =0x7c00
alpha mask=0x0000

CL_PixelFormat CL_PixelFormat::bgr565 [static]
 

Pixel format with 16 bit depth, 5 bits for red and blue, 6 bits for green.

red mask =0x001f
green mask=0x07e0
blue mask =0xf800
alpha mask=0x0000

CL_PixelFormat CL_PixelFormat::bgr888 [static]
 

Pixel format with 24 bit depth, 8 bits per color mask, no alpha.

red mask =0x0000ff
green mask=0x00ff00
blue mask =0xff0000

CL_PixelFormat CL_PixelFormat::rgb555 [static]
 

Pixel format with 16 bit depth, 5 bits per color mask, one bit unused.

red mask =0x7c00
green mask=0x03e0
blue mask =0x001f
alpha mask=0x0000

CL_PixelFormat CL_PixelFormat::rgb565 [static]
 

Pixel format with 16 bit depth, 5 bits for red and blue, 6 bits for green.

red mask =0xf800
green mask=0x07e0
blue mask =0x001f
alpha mask=0x0000

CL_PixelFormat CL_PixelFormat::rgb888 [static]
 

Pixel format with 24 bit depth, 8 bits per color mask, no alpha.

red mask =0xff0000
green mask=0x00ff00
blue mask =0x0000ff

CL_PixelFormat CL_PixelFormat::rgba4444 [static]
 

Pixel format with 16 bit depth, 4 bits per color mask.

red mask =0xf000
green mask=0x0f00
blue mask =0x00f0
alpha mask=0x000f

CL_PixelFormat CL_PixelFormat::rgba8888 [static]
 

Pixel format with 32 bit depth, 8 bits per color mask.

red mask =0xff000000
green mask=0x00ff0000
blue mask =0x0000ff00
alpha mask=0x000000ff


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:39 2009 for ClanLib by  doxygen 1.4.6