Cafu Engine
cf::SceneGraph::SHLMapManT Class Reference

This class manages SHL maps, e.g. by "allocating" rectangular areas in larger coefficient maps. More...

#include "SHLMapMan.hpp"

Classes

struct  SHLMapT
 

Public Member Functions

 SHLMapManT ()
 The constructor. More...
 
 ~SHLMapManT ()
 The destructor. More...
 
void ReadSHLCoeffsTable (std::istream &InFile)
 Reads the lookup-table the indices are referring to (nothing is written when NrOfRepres==0 (uncompressed data)). More...
 
void WriteSHLCoeffsTable (std::ostream &OutFile) const
 Write the lookup-table the indices are referring to (nothing is written when NrOfRepres==0 (uncompressed data)). More...
 
bool Allocate (unsigned long SizeS, unsigned long SizeT, unsigned long &BitmapNr, unsigned long &PosS, unsigned long &PosT)
 Finds a position for a rectangular SHLMap within SHLMaps[SHLMaps.Size()-1].Coeff. More...
 
void InitTextures ()
 Initializes the MatSys textures. More...
 

Public Attributes

ArrayT< SHLMapT * > SHLMaps
 
ArrayT< float > SHLCoeffsTable
 The lookup-table of representatives (NrOfRepres * (NrOfBands^2) many) the SHLMaps::Indices refer to. More...
 
ArrayT< ArrayT
< MatSys::TextureMapI * > > 
SHLMapTextures
 For uncompressed SHL coeffs, for each SHLMap we store an array of texture objects, where each texture contains four SHL coeffs (in its RGBA components). More...
 
MatSys::TextureMapISHLRepresentativesTexture
 
unsigned long SHLRepresentativesTexWidth
 

Static Public Attributes

static const unsigned long SIZE_S =256
 
static const unsigned long SIZE_T =256
 
static char NrOfBands =0
 Number n of bands for which we have computed and stored coefficients (n^2 many). More...
 
static unsigned int NrOfRepres =0
 Number of representatives of SH vectors. If >0, the SHL coeffs are compressed, uncompressed otherwise. More...
 

Detailed Description

This class manages SHL maps, e.g. by "allocating" rectangular areas in larger coefficient maps.

Constructor & Destructor Documentation

SHLMapManT::SHLMapManT ( )

The constructor.

SHLMapManT::~SHLMapManT ( )

The destructor.

Member Function Documentation

bool SHLMapManT::Allocate ( unsigned long  SizeS,
unsigned long  SizeT,
unsigned long &  BitmapNr,
unsigned long &  PosS,
unsigned long &  PosT 
)

Finds a position for a rectangular SHLMap within SHLMaps[SHLMaps.Size()-1].Coeff.

If no such position exists, a new, empty SHLMapT is created and appended to the SHLMaps. Returns true on success, false on failure (i.e. if SizeS>MAX_SIZE_S || SizeT>MAX_SIZE_T).

void SHLMapManT::InitTextures ( )

Initializes the MatSys textures.

void SHLMapManT::ReadSHLCoeffsTable ( std::istream &  InFile)

Reads the lookup-table the indices are referring to (nothing is written when NrOfRepres==0 (uncompressed data)).

void SHLMapManT::WriteSHLCoeffsTable ( std::ostream &  OutFile) const

Write the lookup-table the indices are referring to (nothing is written when NrOfRepres==0 (uncompressed data)).

This writes a total of NrOfRepres*NR_OF_SH_COEFFS coefficients.

Member Data Documentation

char cf::SceneGraph::SHLMapManT::NrOfBands =0
static

Number n of bands for which we have computed and stored coefficients (n^2 many).

unsigned int cf::SceneGraph::SHLMapManT::NrOfRepres =0
static

Number of representatives of SH vectors. If >0, the SHL coeffs are compressed, uncompressed otherwise.

ArrayT<float> cf::SceneGraph::SHLMapManT::SHLCoeffsTable

The lookup-table of representatives (NrOfRepres * (NrOfBands^2) many) the SHLMaps::Indices refer to.

ArrayT< ArrayT<MatSys::TextureMapI*> > cf::SceneGraph::SHLMapManT::SHLMapTextures

For uncompressed SHL coeffs, for each SHLMap we store an array of texture objects, where each texture contains four SHL coeffs (in its RGBA components).

Thus, for 16 SHL coeffs (uncompressed), we keep 16/4 == 4 textures per SHLMap. For compressed SHL coeffs, each SHLMap only requires a single texture object (that is, the size of the inner arrays is always 1), because in this case, we only store SHL vector indices (16 bit precision) that only require the R and G components (8 bits each) of a single texture.


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