OGRE  1.9.0
Ogre::PixelBox Class Reference

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

#include <OgrePixelFormat.h>

Inheritance diagram for Ogre::PixelBox:

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 ()
 
bool contains (const Box &def) const
 Return true if the other box is a part of this one.
 
ColourValue getColourAt (size_t x, size_t y, size_t z)
 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.
 
uint32 getDepth () const
 Get the depth of this box.
 
uint32 getHeight () const
 Get the height of this box.
 
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) const
 Return a subvolume of this PixelBox.
 
void * getTopLeftFrontPixelPtr () const
 Return a data pointer pointing to top left front pixel of the pixel box.
 
uint32 getWidth () const
 Get the width of this box.
 
bool isConsecutive () const
 Return whether this buffer is laid out consecutive in memory (ie the pitches are equal to the dimensions)
 
void operator delete (void *ptr)
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz)
 
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, const char *file, int line, const char *func)
 operator new, with debug line info
 
void * operator new (size_t sz, void *ptr)
 placement operator new
 
void * operator new (size_t sz, void *ptr)
 placement operator new
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz)
 
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, const char *file, int line, const char *func)
 array operator new, with debug line info
 
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 Attributes

uint32 back
 
uint32 bottom
 
void * data
 The data pointer.
 
PixelFormat format
 The pixel format.
 
uint32 front
 
uint32 left
 
uint32 right
 
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.
 
uint32 top
 

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 304 of file OgrePixelFormat.h.

Constructor & Destructor Documentation

◆ PixelBox() [1/3]

Ogre::PixelBox::PixelBox ( )

Parameter constructor for setting the members manually.

Definition at line 307 of file OgrePixelFormat.h.

Referenced by getSubVolume().

◆ ~PixelBox()

Ogre::PixelBox::~PixelBox ( )

Definition at line 308 of file OgrePixelFormat.h.

◆ PixelBox() [2/3]

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
extentsExtents of the region defined by data
pixelFormatFormat of this buffer
pixelDataPointer to the actual data

Definition at line 316 of file OgrePixelFormat.h.

References Ogre::Box::Box(), data, format, and setConsecutive().

◆ PixelBox() [3/3]

Ogre::PixelBox::PixelBox ( uint32 width,
uint32 height,
uint32 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
widthWidth of the region
heightHeight of the region
depthDepth of the region
pixelFormatFormat of this buffer
pixelDataPointer to the actual data

Definition at line 330 of file OgrePixelFormat.h.

References Ogre::Box::Box(), data, format, and setConsecutive().

Member Function Documentation

◆ contains()

bool Ogre::Box::contains ( const Box & def) const
inherited

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

Definition at line 709 of file OgreCommon.h.

References Box(), back, bottom, front, left, right, and top.

◆ getColourAt()

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.

◆ getConsecutiveSize()

size_t Ogre::PixelBox::getConsecutiveSize ( ) const

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

◆ getDepth()

uint32 Ogre::Box::getDepth ( ) const
inherited

◆ getHeight()

◆ getRowSkip()

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 365 of file OgrePixelFormat.h.

References Ogre::Box::getWidth(), and rowPitch.

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

◆ getSliceSkip()

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 370 of file OgrePixelFormat.h.

References Ogre::Box::getHeight(), rowPitch, and slicePitch.

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

◆ getSubVolume()

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

Return a subvolume of this PixelBox.

Parameters
defDefines 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

References Ogre::Box::Box(), and PixelBox().

◆ getTopLeftFrontPixelPtr()

void * Ogre::PixelBox::getTopLeftFrontPixelPtr ( ) const

Return a data pointer pointing to top left front pixel of the pixel box.

Remarks
Non consecutive pixel boxes are supported.

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

◆ getWidth()

◆ isConsecutive()

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 375 of file OgrePixelFormat.h.

References Ogre::Box::getHeight(), Ogre::Box::getWidth(), rowPitch, and slicePitch.

◆ operator delete() [1/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr)
inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [2/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr)
inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [3/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [4/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [5/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
void *  )
inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [6/6]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete ( void * ptr,
void *  )
inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [1/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr)
inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [2/4]

void Ogre::AllocatedObject< GeneralAllocPolicy >::operator delete[] ( void * ptr)
inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [3/4]

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

Definition at line 119 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [4/4]

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

Definition at line 119 of file OgreMemoryAllocatedObject.h.

◆ operator new() [1/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz)
inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

◆ operator new() [2/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz)
inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

◆ operator new() [3/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
const char * file,
int line,
const char * func )
inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

◆ operator new() [4/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
const char * file,
int line,
const char * func )
inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

◆ operator new() [5/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
void * ptr )
inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

◆ operator new() [6/6]

void * Ogre::AllocatedObject< GeneralAllocPolicy >::operator new ( size_t sz,
void * ptr )
inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [1/4]

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [2/4]

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [3/4]

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

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [4/4]

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

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

◆ setColourAt()

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.

◆ setConsecutive()

void Ogre::PixelBox::setConsecutive ( )

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

Definition at line 356 of file OgrePixelFormat.h.

References Ogre::Box::getHeight(), Ogre::Box::getWidth(), rowPitch, and slicePitch.

Referenced by PixelBox(), and PixelBox().

Member Data Documentation

◆ back

◆ bottom

◆ data

void* Ogre::PixelBox::data

The data pointer.

Definition at line 338 of file OgrePixelFormat.h.

Referenced by PixelBox(), and PixelBox().

◆ format

PixelFormat Ogre::PixelBox::format

The pixel format.

Definition at line 340 of file OgrePixelFormat.h.

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

◆ front

◆ left

◆ right

◆ rowPitch

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 345 of file OgrePixelFormat.h.

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

◆ slicePitch

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 351 of file OgrePixelFormat.h.

Referenced by getSliceSkip(), isConsecutive(), Ogre::NearestResampler< elemsize >::scale(), and setConsecutive().

◆ top


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