Class storing collection of differently-sized buffers. More...
#include <MipMap.hpp>
Public Member Functions | |
MipMap () | |
A constructor. More... | |
MipMap (unsigned int width, unsigned int height, PixelData format, unsigned int tileExtent, bool allocateTiles=true) | |
A constructor. More... | |
MipMap (const MipMap &other) | |
Create a new mipmap with content specified by the parameter. More... | |
MipMap (ImageBufferBase *buffer) | |
Create a new mipmap with content set to buffer. More... | |
~MipMap () | |
Frees all buffers. More... | |
MipMap & | operator= (const MipMap &other) |
Assignment operator. | |
ImageBufferBase * | operator[] (int level) |
Subscript operator overload. More... | |
const ImageBufferBase * | operator[] (int level) const |
const PixelData | getPixelData () const |
Obtain the PixelData format used for buffers in the MipMap. More... | |
const long | newStamp () |
Create a new stamp for use with ImageOperation. More... | |
Static Public Attributes | |
static const int | MIPMAP_LEVELS = 3 |
Number of mipmap levels. | |
Class storing collection of differently-sized buffers.
The MipMap class stores a collection of MIPMAP_LEVELS buffers, where the 0th bufer is a full-size buffer and every other is half the resolution of a previous buffer.
FotoSHOCKcore::MipMap::MipMap | ( | ) |
A constructor.
Creates an empty (uninitialized) MipMap.
FotoSHOCKcore::MipMap::MipMap | ( | unsigned int | width, |
unsigned int | height, | ||
PixelData | format, | ||
unsigned int | tileExtent, | ||
bool | allocateTiles = true |
||
) |
A constructor.
Create a new mipmap using a specified settings.
width | width of the full-sized buffer |
height | height of the full-sized buffer |
format | format of buffers in the MipMap |
tileExtent | tile extent used for all buffers |
allocateTiles | same as the the allocateTiles options in the ImageBuffer constructor. Applies to all buffers. |
FotoSHOCKcore::MipMap::MipMap | ( | const MipMap & | other) |
FotoSHOCKcore::MipMap::MipMap | ( | ImageBufferBase * | buffer) |
Create a new mipmap with content set to buffer.
Creates a new MipMap which will use the buffer parameter as the full resolution buffer. The other buffers are filled with the properly scaled copies of the buffer.
The buffer is automatically freed upon MipMap desctruction. That means the buffer must be dynamically allocated.
buffer | pointer to a dynamically allocated buffer |
FotoSHOCKcore::MipMap::~MipMap | ( | ) |
Frees all buffers.
The buffers are freed by GraphNode::cleanBuffer() if the GraphNode objects has m_cache = true, otherwise buffers are left intact.
const PixelData FotoSHOCKcore::MipMap::getPixelData | ( | ) | const |
const long int FotoSHOCKcore::MipMap::newStamp | ( | ) |
Create a new stamp for use with ImageOperation.
ImageBufferBase * FotoSHOCKcore::MipMap::operator[] | ( | int | level) |
Subscript operator overload.
Access buffer at a specified index.
level | mipmap level |