FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Attributes | List of all members
FotoSHOCKcore::MipMap Class Reference

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...
 
MipMapoperator= (const MipMap &other)
 Assignment operator.
 
ImageBufferBaseoperator[] (int level)
 Subscript operator overload. More...
 
const ImageBufferBaseoperator[] (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.
 

Detailed Description

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.

Examples:
BWconversion_direct/BWconversion_direct.hpp.

Constructor & Destructor Documentation

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.

Parameters
widthwidth of the full-sized buffer
heightheight of the full-sized buffer
formatformat of buffers in the MipMap
tileExtenttile extent used for all buffers
allocateTilessame as the the allocateTiles options in the ImageBuffer constructor. Applies to all buffers.
FotoSHOCKcore::MipMap::MipMap ( const MipMap other)

Create a new mipmap with content specified by the parameter.

The buffers are NOT shared. The contructed MipMap will contain a new set of buffers whose content will be initialized to the content the other MipMap.

Parameters
othercopied object
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.

Warning
the buffer is not copied, ie. the MipMap will contain the buffer passed as the parameter itself, not its copy.
Parameters
bufferpointer 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.

Member Function Documentation

const PixelData FotoSHOCKcore::MipMap::getPixelData ( ) const

Obtain the PixelData format used for buffers in the MipMap.

Returns
format of buffers in the mipmap
const long int FotoSHOCKcore::MipMap::newStamp ( )

Create a new stamp for use with ImageOperation.

Warning
the stamps obtained from this function can't be used together with the stamps obtained from ImageBufferBase::newStamp()
ImageBufferBase * FotoSHOCKcore::MipMap::operator[] ( int  level)

Subscript operator overload.

Access buffer at a specified index.

Parameters
levelmipmap level
Returns
ImageBuffer at a specified mipmap level

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