OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory. More...
#include <OgrePixelFormat.h>
Public Member Functions | |
PixelBox () | |
Parameter constructor for setting the members manually. | |
PixelBox (const Box &extents, PixelFormat pixelFormat, void *pixelData=0) | |
Constructor providing extents in the form of a Box object. | |
PixelBox (uint32 width, uint32 height, uint32 depth, PixelFormat pixelFormat, void *pixelData=0) | |
Constructor providing width, height and depth. | |
~PixelBox () | |
ColourValue | getColourAt (size_t x, size_t y, size_t z) const |
Get colour value from a certain location in the PixelBox. | |
size_t | getConsecutiveSize () const |
Return the size (in bytes) this image would take if it was laid out consecutive in memory. | |
size_t | getRowSkip () const |
Get the number of elements between one past the rightmost pixel of one row and the leftmost pixel of the next row. | |
size_t | getSliceSkip () const |
Get the number of elements between one past the right bottom pixel of one slice and the left top pixel of the next slice. | |
PixelBox | getSubVolume (const Box &def, bool resetOrigin=true) const |
Return a subvolume of this PixelBox. | |
uchar * | getTopLeftFrontPixelPtr () const |
Return a data pointer pointing to top left front pixel of the pixel box. | |
bool | isConsecutive () const |
Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensions) | |
void | setColourAt (ColourValue const &cv, size_t x, size_t y, size_t z) |
Set colour value at a certain location in the PixelBox. | |
void | setConsecutive () |
Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory. | |
Public Member Functions inherited from Ogre::Box | |
Box () | |
Parameterless constructor for setting the members manually. | |
template<typename T > | |
Box (const TRect< T > &r) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Box (const Vector3i &size) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Box (uint32 l, uint32 t, uint32 ff, uint32 r, uint32 b, uint32 bb) | |
Define a box from left, top, front, right, bottom and back coordinates. | |
Box (uint32 l, uint32 t, uint32 r, uint32 b) | |
Define a box from left, top, right and bottom coordinates This box will have depth one (front=0 and back=1). | |
bool | contains (const Box &def) const |
Return true if the other box is a part of this one. | |
uint32 | getDepth () const |
Get the depth of this box. | |
uint32 | getHeight () const |
Get the height of this box. | |
Vector3i | getOrigin () const |
origin (top, left, front) of the box | |
Vector3i | getSize () const |
size (width, height, depth) of the box | |
uint32 | getWidth () const |
Get the width of this box. | |
Public Attributes | |
uchar * | data |
The data pointer. | |
PixelFormat | format |
The pixel format. | |
size_t | rowPitch |
Number of elements between the leftmost pixel of one row and the left pixel of the next. | |
size_t | slicePitch |
Number of elements between the top left pixel of one (depth) slice and the top left pixel of the next. | |
Public Attributes inherited from Ogre::Box | |
uint32 | back |
uint32 | bottom |
uint32 | front |
uint32 | left |
uint32 | right |
uint32 | top |
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
In case of a rectangle, depth must be 1. Pixels are stored as a succession of "depth" slices, each containing "height" rows of "width" pixels.
Note that the left, top, and front edges are included but the right, bottom and back ones are not.
|
inline |
Parameter constructor for setting the members manually.
|
inline |
|
inline |
Constructor providing extents in the form of a Box object.
This constructor assumes the pixel data is laid out consecutively in memory. (this means row after row, slice after slice, with no space in between)
extents | Extents of the region defined by data |
pixelFormat | Format of this buffer |
pixelData | Pointer to the actual data |
|
inline |
Constructor providing width, height and depth.
This constructor assumes the pixel data is laid out consecutively in memory. (this means row after row, slice after slice, with no space in between)
width | Width of the region |
height | Height of the region |
depth | Depth of the region |
pixelFormat | Format of this buffer |
pixelData | Pointer to the actual data |
|
inline |
Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory.
|
inline |
Get the number of elements between one past the rightmost pixel of one row and the leftmost pixel of the next row.
(IE this is zero if rows are consecutive).
|
inline |
Get the number of elements between one past the right bottom pixel of one slice and the left top pixel of the next slice.
(IE this is zero if slices are consecutive).
|
inline |
Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensions)
size_t Ogre::PixelBox::getConsecutiveSize | ( | ) | const |
Return the size (in bytes) this image would take if it was laid out consecutive in memory.
Return a subvolume of this PixelBox.
def | Defines the bounds of the subregion to return |
resetOrigin | Whether to reset left/top/front of returned PixelBox to zero together with adjusting data pointer to compensate this, or do nothing so that returned PixelBox will have left/top/front of requested Box |
Exception(ERR_INVALIDPARAMS) | if def is not fully contained |
uchar * Ogre::PixelBox::getTopLeftFrontPixelPtr | ( | ) | const |
Return a data pointer pointing to top left front pixel of the pixel box.
ColourValue Ogre::PixelBox::getColourAt | ( | size_t | x, |
size_t | y, | ||
size_t | z | ||
) | const |
Get colour value from a certain location in the PixelBox.
The z coordinate is only valid for cubemaps and volume textures. This uses the first (largest) mipmap.
Set colour value at a certain location in the PixelBox.
The z coordinate is only valid for cubemaps and volume textures. This uses the first (largest) mipmap.
uchar* Ogre::PixelBox::data |
The data pointer.
size_t Ogre::PixelBox::rowPitch |
Number of elements between the leftmost pixel of one row and the left pixel of the next.
This value must always be equal to getWidth() (consecutive) for compressed formats.
size_t Ogre::PixelBox::slicePitch |
Number of elements between the top left pixel of one (depth) slice and the top left pixel of the next.
This can be a negative value. Must be a multiple of rowPitch. This value must always be equal to getWidth()*getHeight() (consecutive) for compressed formats.
PixelFormat Ogre::PixelBox::format |
The pixel format.