[ < ] | [ Up ] | [ > ] |  |  |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 2.8.4 Pixel Formats

A pixel format described the storage format of pixel data. It defines the way pixels are encoded in memory. The following classes of pixel formats (PF_*) are defined:

Native endian formats (PF_A8R8G8B8 and other formats with bit counts)
  These are native endian (16, 24 and 32 bit) integers in memory. This means that an image with format PF_A8R8G8B8 can be seen as an array of 32 bit integers, defined as 0xAARRGGBB in hexadecimal. The meaning of the letters is described below.

Byte formats (PF_BYTE_*)
  These formats have one byte per channel, and their channels in memory are organized in the order they are specified in the format name. For example, PF_BYTE_RGBA consists of blocks of four bytes, one for red, one for green, one for blue, one for alpha.

Short formats (PF_SHORT_*)
  These formats have one unsigned short (16 bit integer) per channel, and their channels in memory are organized in the order they are specified in the format name. For example, PF_SHORT_RGBA consists of blocks of four 16 bit integers, one for red, one for green, one for blue, one for alpha.

Float16 formats (PF_FLOAT16_*)
  These formats have one 16 bit floating point number per channel, and their channels in memory are organized in the order they are specified in the format name. For example, PF_FLOAT16_RGBA consists of blocks of four 16 bit floats, one for red, one for green, one for blue, one for alpha. The 16 bit floats, also called half float) are very similar to the IEEE single-precision floating-point standard of the 32 bits floats, except that they have only 5 exponent bits and 10 mantissa. Note that there is no standard C++ data type or CPU support to work with these efficiently, but GPUs can calculate with these much more efficiently than with 32 bit floats.

Float32 formats (PF_FLOAT32_*)
  These formats have one 32 bit floating point number per channel, and their channels in memory are organized in the order they are specified in the format name. For example, PF_FLOAT32_RGBA consists of blocks of four 32 bit floats, one for red, one for green, one for blue, one for alpha. The C++ data type for these 32 bits floats is just "float".

Compressed formats (PF_DXT[1-5])
  S3TC compressed texture formats, a good description can be found at | Wikipedia (http://en.wikipedia.org/wiki/S3TC)

### Colour channels

The meaning of the channels R,G,B,A,L and X is defined as

R
  Red colour component, usually ranging from 0.0 (no red) to 1.0 (full red).
G
  Green colour component, usually ranging from 0.0 (no green) to 1.0 (full green).
B
  Blue colour component, usually ranging from 0.0 (no blue) to 1.0 (full blue).
A
  Alpha component, usually ranging from 0.0 (entire transparent) to 1.0 (opaque).
L
  Luminance component, usually ranging from 0.0 (black) to 1.0 (white). The luminance component is duplicated in the R, G, and B channels to achieve a greyscale image.
X
  This component is completely ignored.

If none of red, green and blue components, or luminance is defined in a format, these default to 0. For the alpha channel this is different; if no alpha is defined, it defaults to 1.

### Complete list of pixel formats

This pixel formats supported by the current version of Ogre are

Byte formats
  PF_BYTE_RGB, PF_BYTE_BGR, PF_BYTE_BGRA, PF_BYTE_RGBA, PF_BYTE_L, PF_BYTE_LA, PF_BYTE_A

Short formats
  PF_SHORT_RGBA

Float16 formats
  PF_FLOAT16_R, PF_FLOAT16_RGB, PF_FLOAT16_RGBA

Float32 formats
  PF_FLOAT32_R, PF_FLOAT32_RGB, PF_FLOAT32_RGBA

8 bit native endian formats
  PF_L8, PF_A8, PF_A4L4, PF_R3G3B2

16 bit native endian formats
  PF_L16, PF_R5G6B5, PF_B5G6R5, PF_A4R4G4B4, PF_A1R5G5B5

24 bit native endian formats
  PF_R8G8B8, PF_B8G8R8

32 bit native endian formats
  PF_A8R8G8B8, PF_A8B8G8R8, PF_B8G8R8A8, PF_R8G8B8A8, PF_X8R8G8B8, PF_X8B8G8R8, PF_A2R10G10B10 PF_A2B10G10R10

Compressed formats
  PF_DXT1, PF_DXT2, PF_DXT3, PF_DXT4, PF_DXT5

[ < ] | [ Up ] | [ > ] |  |  |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by steve on June 16 2008 using texi2html