Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Static Public Member Functions | Static Private Attributes
resource::PixelUtil Class Reference

#include <PixelFormat.h>

List of all members.

Static Public Member Functions

static u32 calculateSize (u32 mipmaps, u32 faces, u32 width, u32 height, u32 depth, PixelFormat format)
static void getBitDepths (PixelFormat format, s32 rgba[4])
 Gives the number of bits (RGBA) for a format.
static void getBitMasks (PixelFormat format, u32 rgba[4])
 Gives the masks for the R, G, B and A component.
static const
PixelFormatDescription
getDescriptionFor (const PixelFormat format)
static u32 getFlags (PixelFormat format)
 Returns the property flags for this pixel format.
static u32 getMemorySize (u32 width, u32 height, u32 depth, PixelFormat format)
 Returns the size in memory of a region with the given extents and pixel.
static u32 getNumElemBits (PixelFormat format)
 Returns the size in bits of an element of the given pixel format.
static u32 getNumElemBytes (PixelFormat format)
 Returns the size in bytes of an element of the given pixel format.
static bool hasAlpha (PixelFormat format)
 Determine if the format has an alpha component.
static bool isCompressed (PixelFormat format)
 Determine if the format is compressed.
static bool isDepth (PixelFormat format)
 Determine if the format is a depth format.
static bool isFloatingPoint (PixelFormat format)
 Determine if the format is floating point.
static bool isLuminance (PixelFormat format)
 Determine if the format is a luminance format.
static bool isNativeEndian (PixelFormat format)
 Determine if the format is in native endian format.
static void packColor (const f32 r, const f32 g, const f32 b, const f32 a, const PixelFormat pf, void *dest)
static void unpackColor (f32 *r, f32 *g, f32 *b, f32 *a, PixelFormat pf, const void *src)

Static Private Attributes

static PixelFormatDescription pixelFormats [PF_COUNT]

Member Function Documentation

u32 resource::PixelUtil::calculateSize ( u32  mipmaps,
u32  faces,
u32  width,
u32  height,
u32  depth,
PixelFormat  format 
) [static]

References getMemorySize().

void resource::PixelUtil::getBitDepths ( PixelFormat  format,
s32  rgba[4] 
) [static]
void resource::PixelUtil::getBitMasks ( PixelFormat  format,
u32  rgba[4] 
) [static]
const PixelFormatDescription & resource::PixelUtil::getDescriptionFor ( const PixelFormat  format) [static]
u32 resource::PixelUtil::getFlags ( PixelFormat  format) [static]

Returns the property flags for this pixel format.

References resource::PixelFormatDescription::flags, and getDescriptionFor().

Referenced by hasAlpha(), isCompressed(), isDepth(), isFloatingPoint(), isLuminance(), and isNativeEndian().

u32 resource::PixelUtil::getMemorySize ( u32  width,
u32  height,
u32  depth,
PixelFormat  format 
) [static]

Returns the size in memory of a region with the given extents and pixel.

References getNumElemBytes(), isCompressed(), resource::PF_DXT1, resource::PF_DXT2, resource::PF_DXT3, resource::PF_DXT4, and resource::PF_DXT5.

Referenced by calculateSize().

u32 resource::PixelUtil::getNumElemBits ( PixelFormat  format) [static]

Returns the size in bits of an element of the given pixel format.

References resource::PixelFormatDescription::elemBytes, and getDescriptionFor().

u32 resource::PixelUtil::getNumElemBytes ( PixelFormat  format) [static]

Returns the size in bytes of an element of the given pixel format.

References resource::PixelFormatDescription::elemBytes, and getDescriptionFor().

Referenced by getMemorySize(), and render::PixelBuffer::PixelBuffer().

bool resource::PixelUtil::hasAlpha ( PixelFormat  format) [static]

Determine if the format has an alpha component.

References getFlags(), and resource::PFF_HASALPHA.

bool resource::PixelUtil::isCompressed ( PixelFormat  format) [static]

Determine if the format is compressed.

References getFlags(), and resource::PFF_COMPRESSED.

Referenced by getMemorySize().

bool resource::PixelUtil::isDepth ( PixelFormat  format) [static]

Determine if the format is a depth format.

References getFlags(), and resource::PFF_DEPTH.

bool resource::PixelUtil::isFloatingPoint ( PixelFormat  format) [static]

Determine if the format is floating point.

References getFlags(), and resource::PFF_FLOAT.

bool resource::PixelUtil::isLuminance ( PixelFormat  format) [static]

Determine if the format is a luminance format.

References getFlags(), and resource::PFF_LUMINANCE.

bool resource::PixelUtil::isNativeEndian ( PixelFormat  format) [static]

Determine if the format is in native endian format.

References getFlags(), and resource::PFF_NATIVEENDIAN.

void resource::PixelUtil::packColor ( const f32  r,
const f32  g,
const f32  b,
const f32  a,
const PixelFormat  pf,
void *  dest 
) [static]
void resource::PixelUtil::unpackColor ( f32 r,
f32 g,
f32 b,
f32 a,
PixelFormat  pf,
const void *  src 
) [static]

Member Data Documentation

Referenced by getDescriptionFor().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by Doxygen (1.7.4)