Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <PixelFormat.h>
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] |
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] |
Gives the number of bits (RGBA) for a format.
References resource::PixelFormatDescription::abits, resource::PixelFormatDescription::bbits, resource::PixelFormatDescription::gbits, getDescriptionFor(), and resource::PixelFormatDescription::rbits.
void resource::PixelUtil::getBitMasks | ( | PixelFormat | format, |
u32 | rgba[4] | ||
) | [static] |
Gives the masks for the R, G, B and A component.
References resource::PixelFormatDescription::amask, resource::PixelFormatDescription::bmask, getDescriptionFor(), resource::PixelFormatDescription::gmask, and resource::PixelFormatDescription::rmask.
const PixelFormatDescription & resource::PixelUtil::getDescriptionFor | ( | const PixelFormat | format | ) | [static] |
References resource::PF_COUNT, resource::PF_UNKNOWN, and pixelFormats.
Referenced by getBitDepths(), getBitMasks(), getFlags(), getNumElemBits(), getNumElemBytes(), packColor(), and unpackColor().
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] |
References resource::PixelFormatDescription::abits, resource::PixelFormatDescription::amask, resource::PixelFormatDescription::ashift, resource::PixelFormatDescription::bbits, resource::PixelFormatDescription::bmask, resource::PixelFormatDescription::bshift, resource::PixelFormatDescription::elemBytes, resource::PixelFormatDescription::flags, core::floatToFixed(), core::floatToHalf(), resource::PixelFormatDescription::gbits, getDescriptionFor(), resource::PixelFormatDescription::gmask, resource::PixelFormatDescription::gshift, resource::PF_BYTE_LA, resource::PF_FLOAT16_GR, resource::PF_FLOAT16_R, resource::PF_FLOAT16_RGB, resource::PF_FLOAT16_RGBA, resource::PF_FLOAT32_GR, resource::PF_FLOAT32_R, resource::PF_FLOAT32_RGB, resource::PF_FLOAT32_RGBA, resource::PF_SHORT_RGB, resource::PF_SHORT_RGBA, resource::PFF_NATIVEENDIAN, resource::PixelFormatDescription::rbits, resource::PixelFormatDescription::rmask, and resource::PixelFormatDescription::rshift.
void resource::PixelUtil::unpackColor | ( | f32 * | r, |
f32 * | g, | ||
f32 * | b, | ||
f32 * | a, | ||
PixelFormat | pf, | ||
const void * | src | ||
) | [static] |
References resource::PixelFormatDescription::abits, resource::PixelFormatDescription::amask, resource::PixelFormatDescription::ashift, resource::PixelFormatDescription::bbits, resource::PixelFormatDescription::bmask, resource::PixelFormatDescription::bshift, resource::PixelFormatDescription::elemBytes, core::fixedToFloat(), resource::PixelFormatDescription::flags, resource::PixelFormatDescription::gbits, getDescriptionFor(), resource::PixelFormatDescription::gmask, resource::PixelFormatDescription::gshift, core::halfToFloat(), resource::PF_BYTE_LA, resource::PF_FLOAT16_GR, resource::PF_FLOAT16_R, resource::PF_FLOAT16_RGB, resource::PF_FLOAT16_RGBA, resource::PF_FLOAT32_GR, resource::PF_FLOAT32_R, resource::PF_FLOAT32_RGB, resource::PF_FLOAT32_RGBA, resource::PF_SHORT_RGB, resource::PF_SHORT_RGBA, resource::PFF_HASALPHA, resource::PFF_LUMINANCE, resource::PFF_NATIVEENDIAN, resource::PixelFormatDescription::rbits, resource::PixelFormatDescription::rmask, and resource::PixelFormatDescription::rshift.
PixelFormatDescription resource::PixelUtil::pixelFormats [static, private] |
Referenced by getDescriptionFor().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:10 by
Doxygen
(1.7.4)
|