OGRE: Ogre::TextureBox Struct Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Public Member Functions | Public Attributes | List of all members
Ogre::TextureBox Struct Reference

For cubemaps, the face is in sliceStart, (see CubemapSide::CubemapSide) For cubemap arrays, the cubemaps are addressed as sliceStart * 6. More...

`#include <OgreTextureBox.h>`

## Public Member Functions
| TextureBox ()
| TextureBox (uint32 _width, uint32 _height, uint32 _depth, uint32 _numSlices, uint32 _bytesPerPixel, uint32 _bytesPerRow, uint32 _bytesPerImage)
void * | at (size_t xPos, size_t yPos, size_t zPos) const
| x, y & z are in pixels. More...
void * | atFromOffsettedOrigin (size_t xPos, size_t yPos, size_t zPos) const
void | copyFrom (const TextureBox &src)
void | copyFrom (void *srcData, uint32 _width, uint32 _height, uint32 _bytesPerRow)
bool | equalSize (const TextureBox &other) const
| Returns true if 'other' & 'this' have the same dimensions. More...
bool | fullyContains (const TextureBox &other) const
| Returns true if 'other' fits inside 'this' (fully, not partially) More...
ColourValue | getColourAt (size_t _x, size_t _y, size_t _z, PixelFormatGpu pixelFormat) const
| Get colour value from a certain location in the image. More...
PixelFormatGpu | getCompressedPixelFormat (void) const
uint32 | getDepthOrSlices (void) const
uint32 | getMaxSlice (void) const
uint32 | getMaxX (void) const
uint32 | getMaxY (void) const
uint32 | getMaxZ (void) const
size_t | getSizeBytes (void) const
uint32 | getZOrSlice (void) const
bool | isCompressed (void) const
bool | isSubtextureRegion (void) const
| Returns true if this TextureBox does not represent a contiguous region of a single slice of full texture, and is instead a 2D subregion of a larger texture. More...
bool | overlaps (const TextureBox &other) const
| Returns true if 'this' and 'other' are in partial or full collision. More...
void | setColourAt (const ColourValue &cv, size_t _x, size_t _y, size_t _z, PixelFormatGpu pixelFormat)
| Set colour value at a certain location in the image. More...
void | setCompressedPixelFormat (PixelFormatGpu pixelFormat)

## Public Attributes
size_t | bytesPerImage
size_t | bytesPerPixel
| When TextureBox contains a compressed format, bytesPerPixel contains the pixel format instead. More...
size_t | bytesPerRow
void * | data
| Pointer is never owned by us. More...
uint32 | depth
uint32 | height
uint32 | numSlices
uint32 | sliceStart
uint32 | width
uint32 | x
uint32 | y
uint32 | z

## Detailed Description

For cubemaps, the face is in sliceStart, (see CubemapSide::CubemapSide) For cubemap arrays, the cubemaps are addressed as sliceStart * 6.

## Constructor & Destructor Documentation

## ◆ TextureBox() [1/2]

Ogre::TextureBox::TextureBox | ( |  | ) |
| inline

## ◆ TextureBox() [2/2]

Ogre::TextureBox::TextureBox | ( | uint32 | _width,
|  | uint32 | _height,
|  | uint32 | _depth,
|  | uint32 | _numSlices,
|  | uint32 | _bytesPerPixel,
|  | uint32 | _bytesPerRow,
|  | uint32 | _bytesPerImage
| ) |  |
| inline

## Member Function Documentation

## ◆ at()

void* Ogre::TextureBox::at | ( | size_t | xPos,
|  | size_t | yPos,
|  | size_t | zPos
| ) |  | const
| inline

x, y & z are in pixels.

Only works for non-compressed formats. It can work for compressed formats if xPos & yPos are 0.

References Ogre::PixelFormatGpuUtils::getCompressedBlockHeight(), Ogre::PixelFormatGpuUtils::getCompressedBlockSize(), and Ogre::PixelFormatGpuUtils::getCompressedBlockWidth().

Referenced by copyFrom().

## ◆ atFromOffsettedOrigin()

void* Ogre::TextureBox::atFromOffsettedOrigin | ( | size_t | xPos,
|  | size_t | yPos,
|  | size_t | zPos
| ) |  | const
| inline

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

## ◆ copyFrom() [1/2]

void Ogre::TextureBox::copyFrom | ( | const TextureBox & | src | ) |
| inline

References at(), bytesPerImage, bytesPerRow, Ogre::PixelFormatGpuUtils::getCompressedBlockHeight(), getDepthOrSlices(), getZOrSlice(), height, isSubtextureRegion(), Ogre::min(), width, x, and y.

## ◆ copyFrom() [2/2]

void Ogre::TextureBox::copyFrom | ( | void * | srcData,
|  | uint32 | _width,
|  | uint32 | _height,
|  | uint32 | _bytesPerRow
| ) |  |
| inline

References data.

## ◆ equalSize()

bool Ogre::TextureBox::equalSize | ( | const TextureBox & | other | ) | const
| inline

Returns true if 'other' & 'this' have the same dimensions.

References depth, height, numSlices, and width.

## ◆ fullyContains()

bool Ogre::TextureBox::fullyContains | ( | const TextureBox & | other | ) | const
| inline

Returns true if 'other' fits inside 'this' (fully, not partially)

References getMaxSlice(), getMaxX(), getMaxY(), getMaxZ(), sliceStart, x, y, and z.

## ◆ getColourAt()

ColourValue Ogre::TextureBox::getColourAt | ( | size_t | _x,
|  | size_t | _y,
|  | size_t | _z,
|  | PixelFormatGpu | pixelFormat
| ) |  | const

Get colour value from a certain location in the image.

## ◆ getCompressedPixelFormat()

PixelFormatGpu Ogre::TextureBox::getCompressedPixelFormat | ( | void |  | ) | const
| inline

References Ogre::PFG_UNKNOWN.

## ◆ getDepthOrSlices()

uint32 Ogre::TextureBox::getDepthOrSlices | ( | void |  | ) | const
| inline

References Ogre::max().

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

## ◆ getMaxSlice()

uint32 Ogre::TextureBox::getMaxSlice | ( | void |  | ) | const
| inline

Referenced by fullyContains(), and overlaps().

## ◆ getMaxX()

uint32 Ogre::TextureBox::getMaxX | ( | void |  | ) | const
| inline

Referenced by fullyContains(), and overlaps().

## ◆ getMaxY()

uint32 Ogre::TextureBox::getMaxY | ( | void |  | ) | const
| inline

Referenced by fullyContains(), and overlaps().

## ◆ getMaxZ()

uint32 Ogre::TextureBox::getMaxZ | ( | void |  | ) | const
| inline

Referenced by fullyContains(), and overlaps().

## ◆ getSizeBytes()

size_t Ogre::TextureBox::getSizeBytes | ( | void |  | ) | const
| inline

References Ogre::max().

## ◆ getZOrSlice()

uint32 Ogre::TextureBox::getZOrSlice | ( | void |  | ) | const
| inline

References Ogre::max().

Referenced by copyFrom().

## ◆ isCompressed()

bool Ogre::TextureBox::isCompressed | ( | void |  | ) | const
| inline

## ◆ isSubtextureRegion()

bool Ogre::TextureBox::isSubtextureRegion | ( | void |  | ) | const
| inline

Returns true if this TextureBox does not represent a contiguous region of a single slice of full texture, and is instead a 2D subregion of a larger texture.

References Ogre::PixelFormatGpuUtils::getCompressedBlockHeight(), Ogre::PixelFormatGpuUtils::getCompressedBlockSize(), and Ogre::PixelFormatGpuUtils::getCompressedBlockWidth().

Referenced by copyFrom().

## ◆ overlaps()

bool Ogre::TextureBox::overlaps | ( | const TextureBox & | other | ) | const
| inline

Returns true if 'this' and 'other' are in partial or full collision.

References getMaxSlice(), getMaxX(), getMaxY(), getMaxZ(), sliceStart, x, y, and z.

## ◆ setColourAt()

void Ogre::TextureBox::setColourAt | ( | const ColourValue & | cv,
|  | size_t | _x,
|  | size_t | _y,
|  | size_t | _z,
|  | PixelFormatGpu | pixelFormat
| ) |  |

Set colour value at a certain location in the image.

## ◆ setCompressedPixelFormat()

void Ogre::TextureBox::setCompressedPixelFormat | ( | PixelFormatGpu | pixelFormat | ) |
| inline

References Ogre::PixelFormatGpuUtils::isCompressed().

## Member Data Documentation

## ◆ bytesPerImage

size_t Ogre::TextureBox::bytesPerImage

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

## ◆ bytesPerPixel

size_t Ogre::TextureBox::bytesPerPixel

When TextureBox contains a compressed format, bytesPerPixel contains the pixel format instead.

See getCompressedPixelFormat.

## ◆ bytesPerRow

size_t Ogre::TextureBox::bytesPerRow

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

## ◆ data

void* Ogre::TextureBox::data

Pointer is never owned by us.

Do not alter where data points to (e.g. do not increment it)

Referenced by copyFrom().

## ◆ depth

uint32 Ogre::TextureBox::depth

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

## ◆ height

uint32 Ogre::TextureBox::height

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

## ◆ numSlices

uint32 Ogre::TextureBox::numSlices

Referenced by equalSize().

## ◆ sliceStart

uint32 Ogre::TextureBox::sliceStart

Referenced by fullyContains(), and overlaps().

## ◆ width

uint32 Ogre::TextureBox::width

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

## ◆ x

uint32 Ogre::TextureBox::x

Referenced by copyFrom(), fullyContains(), and overlaps().

## ◆ y

uint32 Ogre::TextureBox::y

Referenced by copyFrom(), fullyContains(), and overlaps().

## ◆ z

uint32 Ogre::TextureBox::z

Referenced by fullyContains(), and overlaps().

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

- OgreTextureBox.h