ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Graphics::PixelFormat Struct Reference

A pixel format description. More...

#include <pixelformat.h>

List of all members.

Public Member Functions

 PixelFormat ()
 PixelFormat (byte BytesPerPixel, byte RBits, byte GBits, byte BBits, byte ABits, byte RShift, byte GShift, byte BShift, byte AShift)
bool operator== (const PixelFormat &fmt) const
bool operator!= (const PixelFormat &fmt) const
uint32 RGBToColor (uint8 r, uint8 g, uint8 b) const
uint32 ARGBToColor (uint8 a, uint8 r, uint8 g, uint8 b) const
void colorToRGB (uint32 color, uint8 &r, uint8 &g, uint8 &b) const
void colorToARGB (uint32 color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const
byte rBits () const
byte gBits () const
byte bBits () const
byte aBits () const
byte bpp () const
uint rMax () const
uint gMax () const
uint bMax () const
uint aMax () const
Common::String toString () const

Static Public Member Functions

static PixelFormat createFormatCLUT8 ()
static uint expand (uint bits, uint color)
 Expand a given bit-depth component to a full 8-bit component.

Public Attributes

byte bytesPerPixel
 Number of bytes used in the pixel format.
byte rLoss
byte gLoss
byte bLoss
byte aLoss
 Precision loss of each color component.
byte rShift
byte gShift
byte bShift
byte aShift
 Binary left shift of each color component in the pixel value.

Detailed Description

A pixel format description.

Like ColorMasks it includes the given values to create colors from RGB values and to retrieve RGB values from colors.

Unlike ColorMasks it is not dependend on knowing the exact pixel format on compile time.

A minor difference between ColorMasks and PixelFormat is that ColorMasks stores the bit count per channel in 'kFooBits', while PixelFormat stores the loss compared to 8 bits per channel in 'Loss'. It also doesn't contain mask values.

Definition at line 136 of file pixelformat.h.


Constructor & Destructor Documentation

Graphics::PixelFormat::PixelFormat (  )  [inline]

Definition at line 142 of file pixelformat.h.

Graphics::PixelFormat::PixelFormat ( byte  BytesPerPixel,
byte  RBits,
byte  GBits,
byte  BBits,
byte  ABits,
byte  RShift,
byte  GShift,
byte  BShift,
byte  AShift 
) [inline]

Definition at line 148 of file pixelformat.h.


Member Function Documentation

byte Graphics::PixelFormat::aBits (  )  const [inline]

Definition at line 228 of file pixelformat.h.

uint Graphics::PixelFormat::aMax (  )  const [inline]

Definition at line 252 of file pixelformat.h.

uint32 Graphics::PixelFormat::ARGBToColor ( uint8  a,
uint8  r,
uint8  g,
uint8  b 
) const [inline]

Definition at line 191 of file pixelformat.h.

byte Graphics::PixelFormat::bBits (  )  const [inline]

Definition at line 224 of file pixelformat.h.

uint Graphics::PixelFormat::bMax (  )  const [inline]

Definition at line 248 of file pixelformat.h.

byte Graphics::PixelFormat::bpp (  )  const [inline]

Definition at line 232 of file pixelformat.h.

void Graphics::PixelFormat::colorToARGB ( uint32  color,
uint8 a,
uint8 r,
uint8 g,
uint8 b 
) const [inline]

Definition at line 205 of file pixelformat.h.

void Graphics::PixelFormat::colorToRGB ( uint32  color,
uint8 r,
uint8 g,
uint8 b 
) const [inline]

Definition at line 199 of file pixelformat.h.

static PixelFormat Graphics::PixelFormat::createFormatCLUT8 (  )  [inline, static]

Definition at line 162 of file pixelformat.h.

static uint Graphics::PixelFormat::expand ( uint  bits,
uint  color 
) [inline, static]

Expand a given bit-depth component to a full 8-bit component.

Definition at line 257 of file pixelformat.h.

byte Graphics::PixelFormat::gBits (  )  const [inline]

Definition at line 220 of file pixelformat.h.

uint Graphics::PixelFormat::gMax (  )  const [inline]

Definition at line 244 of file pixelformat.h.

bool Graphics::PixelFormat::operator!= ( const PixelFormat fmt  )  const [inline]

Definition at line 179 of file pixelformat.h.

bool Graphics::PixelFormat::operator== ( const PixelFormat fmt  )  const [inline]

Definition at line 166 of file pixelformat.h.

byte Graphics::PixelFormat::rBits (  )  const [inline]

Definition at line 216 of file pixelformat.h.

uint32 Graphics::PixelFormat::RGBToColor ( uint8  r,
uint8  g,
uint8  b 
) const [inline]

Definition at line 183 of file pixelformat.h.

uint Graphics::PixelFormat::rMax (  )  const [inline]

Definition at line 240 of file pixelformat.h.

Common::String Graphics::PixelFormat::toString (  )  const

Definition at line 28 of file pixelformat.cpp.


Member Data Documentation

Precision loss of each color component.

Definition at line 139 of file pixelformat.h.

Binary left shift of each color component in the pixel value.

Definition at line 140 of file pixelformat.h.

Definition at line 139 of file pixelformat.h.

Definition at line 140 of file pixelformat.h.

Number of bytes used in the pixel format.

Definition at line 137 of file pixelformat.h.

Definition at line 139 of file pixelformat.h.

Definition at line 140 of file pixelformat.h.

Definition at line 139 of file pixelformat.h.

Definition at line 140 of file pixelformat.h.


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


Generated on Sat Sep 14 2019 05:04:12 for ResidualVM by doxygen 1.7.1
curved edge   curved edge