# Ogre::PixelBox Class Reference
Image

A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory. More...

`#include <OgrePixelFormat.h>`

Inheritance diagram for Ogre::PixelBox:
[legend]

List of all members.

## Public Member Functions

| PixelBox ()
| Parameter constructor for setting the members manually.
| ~PixelBox ()
| PixelBox (const Box &extents, PixelFormat pixelFormat, void *pixelData=0)
| Constructor providing extents in the form of a Box object.
| PixelBox (size_t width, size_t height, size_t depth, PixelFormat pixelFormat, void *pixelData=0)
| Constructor providing width, height and depth.
void | setConsecutive ()
| Set the rowPitch and slicePitch so that the buffer is 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.
bool | isConsecutive () const
| Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensions)
size_t | getConsecutiveSize () const
| Return the size (in bytes) this image would take if it was laid out consecutive in memory.
PixelBox | getSubVolume (const Box &def) const
| Return a subvolume of this PixelBox.
ColourValue | getColourAt (size_t x, size_t y, size_t z)
| Get colour value from a certain location in the PixelBox.
void | setColourAt (ColourValue const &cv, size_t x, size_t y, size_t z)
| Set colour value at a certain location in the PixelBox.
bool | contains (const Box &def) const
| Return true if the other box is a part of this one.
size_t | getWidth () const
| Get the width of this box.
size_t | getHeight () const
| Get the height of this box.
size_t | getDepth () const
| Get the depth of this box.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)

## Public Attributes

void * | 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.
size_t | left
size_t | top
size_t | right
size_t | bottom
size_t | front
size_t | back

## Detailed Description

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.

Definition at line 193 of file OgrePixelFormat.h.

## Constructor & Destructor Documentation

Ogre::PixelBox::PixelBox | ( |  | ) |

Parameter constructor for setting the members manually.

Definition at line 196 of file OgrePixelFormat.h.

Ogre::PixelBox::~PixelBox | ( |  | ) |

Definition at line 197 of file OgrePixelFormat.h.

Ogre::PixelBox::PixelBox | ( | const Box & | extents,
|  | PixelFormat | pixelFormat,
|  | void * | pixelData = `0`
| ) |  |

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)

Parameters:

  extents | Extents of the region defined by data
  pixelFormat | Format of this buffer
  pixelData | Pointer to the actual data

Definition at line 205 of file OgrePixelFormat.h.

Ogre::PixelBox::PixelBox | ( | size_t | width,
|  | size_t | height,
|  | size_t | depth,
|  | PixelFormat | pixelFormat,
|  | void * | pixelData = `0`
| ) |  |

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)

Parameters:

  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

Definition at line 219 of file OgrePixelFormat.h.

## Member Function Documentation

bool Ogre::Box::contains | ( | const Box & | def | ) | const`[inherited]`

Return true if the other box is a part of this one.

Definition at line 683 of file OgreCommon.h.

References Ogre::Box::back, Ogre::Box::bottom, Ogre::Box::front, Ogre::Box::left, Ogre::Box::right, and Ogre::Box::top.

ColourValue Ogre::PixelBox::getColourAt | ( | size_t | x,
|  | size_t | y,
|  | size_t | z
| ) |  |

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.

size_t Ogre::PixelBox::getConsecutiveSize | ( |  | ) | const

Return the size (in bytes) this image would take if it was laid out consecutive in memory.

size_t Ogre::Box::getDepth | ( |  | ) | const`[inherited]`

Get the depth of this box.

Definition at line 694 of file OgreCommon.h.

References Ogre::Box::back, and Ogre::Box::front.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::Box::getHeight | ( |  | ) | const`[inherited]`

Get the height of this box.

Definition at line 692 of file OgreCommon.h.

References Ogre::Box::bottom, and Ogre::Box::top.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::PixelBox::getRowSkip | ( |  | ) | const

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).

Definition at line 254 of file OgrePixelFormat.h.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::PixelBox::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.

(IE this is zero if slices are consecutive).

Definition at line 259 of file OgrePixelFormat.h.

Referenced by Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

PixelBox Ogre::PixelBox::getSubVolume | ( | const Box & | def | ) | const

Return a subvolume of this PixelBox.

Parameters:

  def | Defines the bounds of the subregion to return

Returns:
  A pixel box describing the region and the data in it

Remarks:
  This function does not copy any data, it just returns a PixelBox object with a data pointer pointing somewhere inside the data of object.

Exceptions:

  Exception(ERR_INVALIDPARAMS) | if def is not fully contained

size_t Ogre::Box::getWidth | ( |  | ) | const`[inherited]`

Get the width of this box.

Definition at line 690 of file OgreCommon.h.

References Ogre::Box::left, and Ogre::Box::right.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

bool Ogre::PixelBox::isConsecutive | ( |  | ) | const

Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensions)

Definition at line 264 of file OgrePixelFormat.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

void Ogre::PixelBox::setColourAt | ( | ColourValue const & | cv,
|  | size_t | x,
|  | size_t | y,
|  | size_t | z
| ) |  |

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.

void Ogre::PixelBox::setConsecutive | ( |  | ) |

Set the rowPitch and slicePitch so that the buffer is laid out consecutive in memory.

Definition at line 245 of file OgrePixelFormat.h.

## Member Data Documentation

size_t Ogre::Box::back`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getDepth(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::Box::bottom`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getHeight(), Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

void* Ogre::PixelBox::data

The data pointer.

Definition at line 227 of file OgrePixelFormat.h.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

PixelFormat Ogre::PixelBox::format

The pixel format.

Definition at line 229 of file OgrePixelFormat.h.

Referenced by Ogre::LinearResampler_Float32::scale(), and Ogre::LinearResampler::scale().

size_t Ogre::Box::front`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getDepth(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::Box::left`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getWidth(), Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::Box::right`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getWidth(), Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

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.

Definition at line 234 of file OgrePixelFormat.h.

Referenced by Ogre::LinearResampler_Byte< channels >::scale(), and Ogre::NearestResampler< elemsize >::scale().

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.

Definition at line 240 of file OgrePixelFormat.h.

Referenced by Ogre::NearestResampler< elemsize >::scale().

size_t Ogre::Box::top`[inherited]`

Definition at line 635 of file OgreCommon.h.

Referenced by Ogre::Box::Box(), Ogre::Box::contains(), Ogre::Box::getHeight(), Ogre::LinearResampler_Byte< channels >::scale(), Ogre::LinearResampler_Float32::scale(), Ogre::LinearResampler::scale(), and Ogre::NearestResampler< elemsize >::scale().

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

- OgrePixelFormat.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:15