CVR-Lib last update 20 Sep 2009

cvr::viewer2DPainter::viewer2DPainter::cacheManager Class Reference

A manager for all statistic blocks, computed (only if necessary) for the red, green, blue, hue and intensity channels of the data. More...

#include <cvrViewer2DPainter.h>

Collaboration diagram for cvr::viewer2DPainter::viewer2DPainter::cacheManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 cacheManager (histogramEqualization *&histoEq)
bool update (const void *data, const eChannelType chnlType, const matrix< float > &chnl, const eMappingType mapping)
bool update (const ubyte *data, const eChannelType chnlType, const matrix< ubyte > &chnl, const eMappingType mapping)
bool update (const int32 *data, const eChannelType chnlType, const matrix< int32 > &chnl, const eMappingType mapping)
bool updateSignature (const matrix< ubyte > &data)
bool updateSignature (const matrix< int32 > &data)
bool checkCacheMiss (const void *data, const eChannelType chnlType, const ipoint &size, const eMappingType mapping) const
bool checkCacheMiss (const ubyte *data, const ipoint &size, const int cacheIdx) const
bool checkCacheMiss (const int *data, const ipoint &size, const int cacheIdx) const
void invalidate ()

Public Attributes

cacheBlock blocks_ [NumCacheBlocks]
std::pair< ivector, bool > clut_ [ClutSize]
bool tooManyLabels_

Protected Attributes

histogramEqualization *& histoEq_
Signature data
const void * dataPtr_
ipoint dataSize_


Detailed Description

A manager for all statistic blocks, computed (only if necessary) for the red, green, blue, hue and intensity channels of the data.

Constructor & Destructor Documentation

cvr::viewer2DPainter::viewer2DPainter::cacheManager::cacheManager ( histogramEqualization *&  histoEq  ) 

Constructor.


Member Function Documentation

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::checkCacheMiss ( const int *  data,
const ipoint size,
const int  cacheIdx 
) const

Verify if there will be a cache miss with the given data of a channel32 or equivalent matrix.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::checkCacheMiss ( const ubyte data,
const ipoint size,
const int  cacheIdx 
) const

Verify if there will be a cache miss with the given data of a channel8 or equivalent matrix.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::checkCacheMiss ( const void *  data,
const eChannelType  chnlType,
const ipoint size,
const eMappingType  mapping 
) const

Verify if there will be a cache miss with the given data.

Mapping is used to determine if the statistics have to be recomputed or are not necessary at all.

void cvr::viewer2DPainter::viewer2DPainter::cacheManager::invalidate (  ) 

Invalidate the cache.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::update ( const int32 data,
const eChannelType  chnlType,
const matrix< int32 > &  chnl,
const eMappingType  mapping 
)

Update the internal cache blocks if necessary.

Parameters:
data pointer to the data block from which chnl32 was extracted.
chnlType type of color channel being analyzed (red, hue, etc).
chnl the channel for which the statistics are required. It has to be exactly of the same size than the original data, or the statistics will be wrong!
mapping the transformation desired is used to detect which statistics have to be computed.
Returns:
false if nothing had to be updated, or true if changes were done.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::update ( const ubyte data,
const eChannelType  chnlType,
const matrix< ubyte > &  chnl,
const eMappingType  mapping 
)

Update the internal cache blocks if necessary.

Parameters:
data pointer to the data block from which chnl was extracted.
chnlType type of color channel being analyzed (red, hue, etc).
chnl the channel for which the statistics are required. It has to be exactly of the same size than the original data, or the statistics will be wrong!
mapping the transformation desired is used to detect which statistics have to be computed.
Returns:
false if nothing had to be updated, or true if changes were done.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::update ( const void *  data,
const eChannelType  chnlType,
const matrix< float > &  chnl,
const eMappingType  mapping 
)

Update the internal cache blocks if necessary.

Parameters:
data pointer to the data block from which chnl was extracted.
chnlType type of color channel being analyzed (red, hue, etc).
chnl the channel for which the statistics are required. It has to be exactly of the same size than the original data, or the statistics will be wrong!
mapping the transformation desired is used to detect which statistics have to be computed.
Returns:
false if nothing had to be updated, or true if changes were done.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::updateSignature ( const matrix< int32 > &  data  ) 

Update the internal signature to the given matrix.

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::updateSignature ( const matrix< ubyte > &  data  ) 

Update the internal signature to the given matrix.


Member Data Documentation

cacheBlock cvr::viewer2DPainter::viewer2DPainter::cacheManager::blocks_[NumCacheBlocks]

All cached blocks.

std::pair<ivector,bool> cvr::viewer2DPainter::viewer2DPainter::cacheManager::clut_[ClutSize]

Cached palettes used by channel8 and channel32 The boolean is a flag to indicate that the palette has been computed.

The first (UserDefMap+1) entries are for normal display and the last 4 are used by the label adjacency LUT

const void* cvr::viewer2DPainter::viewer2DPainter::cacheManager::dataPtr_ [protected]

Pointer to the data block of the matrix.

Note that this is the pointer to the data block itself, and NOT to the container matrix, i.e. it will be a rgbaPixel*, int*, ubyte* or float*.

ipoint cvr::viewer2DPainter::viewer2DPainter::cacheManager::dataSize_ [protected]

Size of the matrix.

Even if dataPtr_ is almost perfect for the task, a second check cannot hurt!

histogramEqualization*& cvr::viewer2DPainter::viewer2DPainter::cacheManager::histoEq_ [protected]

histogram equalizer

bool cvr::viewer2DPainter::viewer2DPainter::cacheManager::tooManyLabels_

Flag that indicates if a labeled channel32 has too many labels.


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

Generated on Sun Sep 20 22:08:42 2009 for CVR-Lib by Doxygen 1.5.8