28 #ifndef _PixelFormat_H__
29 #define _PixelFormat_H__
88 #if OGRE_ENDIAN == OGRE_ENDIAN_BIG
211 Box(extents), data(pixelData), format(pixelFormat)
225 Box(0, 0, 0, width, height, depth),
226 data(pixelData), format(pixelFormat)
252 rowPitch = getWidth();
253 slicePitch = getWidth()*getHeight();
264 size_t getSliceSkip()
const {
return slicePitch - (getHeight() * rowPitch); }
271 return rowPitch == getWidth() && slicePitch == getWidth()*getHeight();
276 size_t getConsecutiveSize()
const;
292 ColourValue getColourAt(
size_t x,
size_t y,
size_t z);
299 void setColourAt(
ColourValue const &cv,
size_t x,
size_t y,
size_t z);
314 static size_t getNumElemBytes(
PixelFormat format );
322 static size_t getNumElemBits(
PixelFormat format );
341 static size_t getMemorySize(
size_t width,
size_t height,
size_t depth,
PixelFormat format);
350 static unsigned int getFlags(
PixelFormat format );
377 static bool isValidExtent(
size_t width,
size_t height,
size_t depth,
PixelFormat format);
382 static void getBitDepths(
PixelFormat format,
int rgba[4]);
392 static void getBitShifts(
PixelFormat format,
unsigned char rgba[4]);
425 static PixelFormat getFormatFromName(
const String& name,
bool accessibleOnly =
false,
bool caseSensitive =
false);
434 static String getBNFExpressionOfPixelFormats(
bool accessibleOnly =
false);
466 static void packColour(
const float r,
const float g,
const float b,
const float a,
const PixelFormat pf,
void* dest);
488 static void unpackColour(
float *r,
float *g,
float *b,
float *a,
PixelFormat pf,
const void* src);
498 static void bulkPixelConversion(
void *src,
PixelFormat srcFormat,
void *dest,
PixelFormat dstFormat,
unsigned int count);
16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
Short per component (16 bit fixed 0.0..1.0))
8-bit pixel format, 4 bits alpha, 4 bits luminance.
size_t rowPitch
Number of elements between the leftmost pixel of one row and the left pixel of the next...
32-bit pixel format, 8 bits for alpha, red, green and blue.
16-bit pixel format, 8 bits red, 8 bits green.
Class representing colour.
DDS (DirectDraw Surface) DXT5 format.
size_t getSliceSkip() const
Get the number of elements between one past the right bottom pixel of one slice and the left top pixe...
PixelFormatFlags
Flags defining some on/off properties of pixel formats.
3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
PVRTC (PowerVR) RGBA 4 bpp.
32-bit pixel format, 8 bits for blue, green, red and alpha.
void * data
The data pointer.
PVRTC (PowerVR) RGBA 2 bpp.
Byte per component (8 bit fixed 0.0..1.0)
Some utility functions for packing and unpacking pixel data.
32-bit pixel format, 8 bits for red, green, blue and alpha.
DDS (DirectDraw Surface) DXT3 format.
PixelFormat format
The pixel format.
PixelComponentType
Pixel component format.
4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha ...
16 bit float per component
24-bit pixel format, 8 bits for blue, green and red.
DDS (DirectDraw Surface) DXT1 format.
Structure used to define a box in a 3-D integer space.
3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
PVRTC (PowerVR) RGB 2 bpp.
32-bit pixel format, 10 bits for blue, green and red, 2 bits for alpha.
32-bit pixel format, 8 bits for blue, green, red and alpha.
DDS (DirectDraw Surface) DXT2 format.
8-bit pixel format, all bits luminance.
16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
PixelFormat
The pixel format used for images, textures, and render surfaces.
32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue like PF_A8R8G8B8, but alpha will get discarded
PixelBox()
Parameter constructor for setting the members manually.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
16-bit pixel format, 4 bits for alpha, red, green and blue.
size_t slicePitch
Number of elements between the top left pixel of one (depth) slice and the top left pixel of the next...
16-bit pixel format, 5 bits for blue, green, red and 1 for alpha.
PixelBox(size_t width, size_t height, size_t depth, PixelFormat pixelFormat, void *pixelData=0)
Constructor providing width, height and depth.
4 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red and one byte for alpha ...
vector< PixelFormat >::type PixelFormatList
32-bit pixel format, 2 bits for alpha, 10 bits for red, green and blue.
DDS (DirectDraw Surface) DXT4 format.
8-bit pixel format, all bits alpha.
24-bit pixel format, 8 bits for red, green and blue.
8-bit pixel format, all bits red.
bool isConsecutive() const
Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensi...
32 bit float per component
16-bit pixel format, all bits luminance.
PixelBox(const Box &extents, PixelFormat pixelFormat, void *pixelData=0)
Constructor providing extents in the form of a Box object.
void setConsecutive()
Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory.
32-bit pixel format, 8 bits for blue, 8 bits for green, 8 bits for red like PF_A8B8G8R8, but alpha will get discarded
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
8-bit pixel format, 2 bits blue, 3 bits green, 3 bits red.
size_t getRowSkip() const
Get the number of elements between one past the rightmost pixel of one row and the leftmost pixel of ...
2 byte pixel format, 1 byte luminance, 1 byte alpha
PVRTC (PowerVR) RGB 4 bpp.