Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuTFIntensity Class Reference

A base class for transfer functions operating only on the intensity of data. More...

#include <vuTFIntensity.h>

Inheritance diagram for vuTFIntensity:

Inheritance graph
[legend]
Collaboration diagram for vuTFIntensity:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuTFIntensity ()
 Default constructor initializing all colour components (+ alpha) to zero.
 vuTFIntensity (dword ncomp, dword range)
 vuTFIntensity (const vuTFIntensity &inst)
 Copy constructor.
virtual ~vuTFIntensity ()
 Destructor.
vuTFIntensityoperator= (const vuTFIntensity &rhs)
 Assignment operator.
const floatoperator[] (dword intensity) const
 Access operator for converting intensity to an rgba value.
dword getNComponents () const
 Returns number of components for colour model (RGBA -> 4).
dword getRange () const
 Returns range for which the LUT should be defined (8-bit -> 256).
virtual void getRGBa (dword i, vuColourRGBa &rgba) const
 returns an interpolated colour from the look-up table.
virtual float getOpacityAtPos (dword i)
 returns an interpolated opacity value according to the entry in the look-up table.
bool resize (dword ncomp, dword range)
 changes the size of the lookup table
floatgetLight ()
 returns a float* to the spectral components of the light.
void normalizeAlphaToOne ()
 Weight all colours by their alpha values and set alpha to one.
void fromMap (const vuMap &map)
 Create a transfer function from a given vuMap.
 vuTFIntensity ()
 Default constructor initializing all colour components (+ alpha) to zero.
 vuTFIntensity (dword ncomp, dword range)
 vuTFIntensity (const vuTFIntensity &inst)
 Copy constructor.
virtual ~vuTFIntensity ()
 Destructor.
vuTFIntensityoperator= (const vuTFIntensity &rhs)
 Assignment operator.
const floatoperator[] (dword intensity) const
 Access operator for converting intensity to an rgba value.
dword getNComponents () const
 Returns number of components for colour model (RGBA -> 4).
dword getRange () const
 Returns range for which the LUT should be defined (8-bit -> 256).
virtual void getRGBa (dword i, vuColourRGBa &rgba) const
 returns an interpolated colour from the look-up table.
virtual float getOpacityAtPos (dword i)
 returns an interpolated opacity value according to the entry in the look-up table.
bool resize (dword ncomp, dword range)
 changes the size of the lookup table
floatgetLight ()
 returns a float* to the spectral components of the light.
void normalizeAlphaToOne ()
 Weight all colours by their alpha values and set alpha to one.
void fromMap (const vuMap &map)
 Create a transfer function from a given vuMap.

Protected Member Functions

virtual bool init (dword ncomp, dword range)
 allocate memory for the LUT made virtual to allow extensions in the sub classes called during construction and in resize()
virtual void cleanup ()
 Free memory from the LUT.
virtual bool init (dword ncomp, dword range)
 allocate memory for the LUT made virtual to allow extensions in the sub classes called during construction and in resize()
virtual void cleanup ()
 Free memory from the LUT.

Protected Attributes

dword m_NComp
 number of components for colour model (RGBA -> 4)
dword m_Range
 range for which the LUT should be defined (8-bit -> 256)
dword m_TableLength
 results from m_NComp * m_Range
floatm_Table
 The function table for the transfer function.
floatm_Light
 The colour (or spectrum) of the illuminating light.
floatm_Table
 The function table for the transfer function.
floatm_Light
 The colour (or spectrum) of the illuminating light.

Detailed Description

A base class for transfer functions operating only on the intensity of data.

This class defines the way that intensity transfer functions are used by rendering methods. In this case, it is with a simple look-up function.

The class also sets up the data architecture for storing the transfer function, since this is uniform over all the transfer functions. To implement a transfer function, you only need to add methods which set up the transfer function. The data is stored in a float array of length (255*4). For each possible intensity value, from 0 to 255, four float values are stored, corresponding to the rgba for the intensity. The values for the points are stored sequentially, so the architecture is (rgba[0]rgba[1]...)

Without changing the above explanation this class has been modified to handle different colour models and value ranges. TODO: change the above explanation.

Definition at line 24 of file General/vuTFunc/vuTFIntensity.h.


Constructor & Destructor Documentation

vuTFIntensity::vuTFIntensity  ) 
 

Default constructor initializing all colour components (+ alpha) to zero.

Parameters:
ncomp number of components RGBA should be built with ncomp = 4
range range for which the look up table should be defined

Definition at line 14 of file General/vuTFunc/vuTFIntensity.cpp.

References init(), m_Light, and m_Table.

Here is the call graph for this function:

vuTFIntensity::vuTFIntensity dword  ncomp,
dword  range
 

Definition at line 24 of file General/vuTFunc/vuTFIntensity.cpp.

References init(), m_Light, and m_Table.

Here is the call graph for this function:

vuTFIntensity::vuTFIntensity const vuTFIntensity inst  ) 
 

Copy constructor.

Definition at line 35 of file General/vuTFunc/vuTFIntensity.cpp.

References dword, m_Light, m_NComp, m_Range, m_Table, and m_TableLength.

vuTFIntensity::~vuTFIntensity  )  [virtual]
 

Destructor.

Frees the memory for the LUT

Definition at line 48 of file General/vuTFunc/vuTFIntensity.cpp.

References cleanup().

Here is the call graph for this function:

vuTFIntensity::vuTFIntensity  ) 
 

Default constructor initializing all colour components (+ alpha) to zero.

Parameters:
ncomp number of components RGBA should be built with ncomp = 4
range range for which the look up table should be defined

vuTFIntensity::vuTFIntensity dword  ncomp,
dword  range
 

vuTFIntensity::vuTFIntensity const vuTFIntensity inst  ) 
 

Copy constructor.

virtual vuTFIntensity::~vuTFIntensity  )  [virtual]
 

Destructor.

Frees the memory for the LUT


Member Function Documentation

virtual void vuTFIntensity::cleanup  )  [protected, virtual]
 

Free memory from the LUT.

Made virtual to allow extensions in the sub classes. Called during construction and in resize().

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

void vuTFIntensity::cleanup  )  [protected, virtual]
 

Free memory from the LUT.

Made virtual to allow extensions in the sub classes. Called during construction and in resize().

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

Definition at line 125 of file General/vuTFunc/vuTFIntensity.cpp.

References m_Light, and m_Table.

Referenced by vuTFPreintegrated::cleanup(), resize(), and ~vuTFIntensity().

void vuTFIntensity::fromMap const vuMap map  ) 
 

Create a transfer function from a given vuMap.

The alpha values will all be set to one.

void vuTFIntensity::fromMap const vuMap map  ) 
 

Create a transfer function from a given vuMap.

The alpha values will all be set to one.

Definition at line 192 of file General/vuTFunc/vuTFIntensity.cpp.

References dword, and m_NComp.

Referenced by vu1112118::doSpectral().

float* vuTFIntensity::getLight  )  [inline]
 

returns a float* to the spectral components of the light.

getNComponents() tells how many components are used.

Definition at line 70 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

float* vuTFIntensity::getLight  )  [inline]
 

returns a float* to the spectral components of the light.

getNComponents() tells how many components are used.

Definition at line 70 of file General/vuTFunc/vuTFIntensity.h.

Referenced by vuSpectral::glRender(), vuSpecFVR::glRender(), and vu1112115::render().

dword vuTFIntensity::getNComponents  )  const [inline]
 

Returns number of components for colour model (RGBA -> 4).

Definition at line 56 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

References dword.

dword vuTFIntensity::getNComponents  )  const [inline]
 

Returns number of components for colour model (RGBA -> 4).

Definition at line 56 of file General/vuTFunc/vuTFIntensity.h.

References dword.

Referenced by VolumeSet::buildColourVolumes(), vuSplat::glRender(), and vuTFPreintegrated::vuTFPreintegrated().

virtual float vuTFIntensity::getOpacityAtPos dword  i  )  [virtual]
 

returns an interpolated opacity value according to the entry in the look-up table.

float vuTFIntensity::getOpacityAtPos dword  i  )  [virtual]
 

returns an interpolated opacity value according to the entry in the look-up table.

Definition at line 141 of file General/vuTFunc/vuTFIntensity.cpp.

References m_NComp, and m_Table.

Referenced by vu1112117::preprocess(), and vuTransferCanvas::render().

dword vuTFIntensity::getRange void   )  const [inline]
 

Returns range for which the LUT should be defined (8-bit -> 256).

Definition at line 58 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

References dword.

dword vuTFIntensity::getRange void   )  const [inline]
 

Returns range for which the LUT should be defined (8-bit -> 256).

Definition at line 58 of file General/vuTFunc/vuTFIntensity.h.

References dword.

Referenced by vuTFPreintegrated::vuTFPreintegrated().

virtual void vuTFIntensity::getRGBa dword  i,
vuColourRGBa rgba
const [virtual]
 

returns an interpolated colour from the look-up table.

void vuTFIntensity::getRGBa dword  i,
vuColourRGBa rgba
const [virtual]
 

returns an interpolated colour from the look-up table.

Definition at line 147 of file General/vuTFunc/vuTFIntensity.cpp.

References vuColour< S >::clampTo01(), vuColourRGBa::from(), m_Light, m_NComp, m_Table, and vuColour9a::to().

Referenced by vu1112119::convertVUD2VUF(), operator=(), and vuTransferCanvas::render().

Here is the call graph for this function:

virtual bool vuTFIntensity::init dword  ncomp,
dword  range
[protected, virtual]
 

allocate memory for the LUT made virtual to allow extensions in the sub classes called during construction and in resize()

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

bool vuTFIntensity::init dword  ncomp,
dword  range
[protected, virtual]
 

allocate memory for the LUT made virtual to allow extensions in the sub classes called during construction and in resize()

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

Definition at line 95 of file General/vuTFunc/vuTFIntensity.cpp.

References dword, m_Light, m_NComp, m_Range, m_Table, and m_TableLength.

Referenced by vuTFPreintegrated::init(), vuTFDesign::readNComp(), resize(), and vuTFIntensity().

void vuTFIntensity::normalizeAlphaToOne  ) 
 

Weight all colours by their alpha values and set alpha to one.

This can be used if you don't want to use alpha values but, still want to have weighted colours, eg. for coloured FVR.

void vuTFIntensity::normalizeAlphaToOne  ) 
 

Weight all colours by their alpha values and set alpha to one.

This can be used if you don't want to use alpha values but, still want to have weighted colours, eg. for coloured FVR.

Definition at line 180 of file General/vuTFunc/vuTFIntensity.cpp.

References dword, and m_NComp.

Referenced by vu1112119::convertVUD2VUF(), and vu1112118::preprocess().

vuTFIntensity& vuTFIntensity::operator= const vuTFIntensity rhs  ) 
 

Assignment operator.

If the transfer function specified in rhs has a different number of components, a conversion to RGBa is performed. By now this conversion is only implemented for 31 -> RGB. If the ranges (default 256) don't match, the function does nothing.

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

vuTFIntensity & vuTFIntensity::operator= const vuTFIntensity rhs  ) 
 

Assignment operator.

If the transfer function specified in rhs has a different number of components, a conversion to RGBa is performed. By now this conversion is only implemented for 31 -> RGB. If the ranges (default 256) don't match, the function does nothing.

Reimplemented in vuTFPreintegrated, and vuTFPreintegrated.

Definition at line 57 of file General/vuTFunc/vuTFIntensity.cpp.

References dword, vuColour7a::from(), getRGBa(), m_Light, m_NComp, m_Range, and m_Table.

Referenced by vuTFPreintegrated::operator=().

Here is the call graph for this function:

const float* vuTFIntensity::operator[] dword  intensity  )  const [inline]
 

Access operator for converting intensity to an rgba value.

Parameters:
intensity An intensity value, from 0 to 255.
Returns:
A pointer to the rgba values for the intensity, stored as an rgba array.

Definition at line 50 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

const float* vuTFIntensity::operator[] dword  intensity  )  const [inline]
 

Access operator for converting intensity to an rgba value.

Parameters:
intensity An intensity value, from 0 to 255.
Returns:
A pointer to the rgba values for the intensity, stored as an rgba array.

Definition at line 50 of file General/vuTFunc/vuTFIntensity.h.

bool vuTFIntensity::resize dword  ncomp,
dword  range
 

changes the size of the lookup table

bool vuTFIntensity::resize dword  ncomp,
dword  range
 

changes the size of the lookup table

Definition at line 134 of file General/vuTFunc/vuTFIntensity.cpp.

References cleanup(), and init().

Referenced by vu1112118::doSpectral(), ns_vu1112112::vu1112112::vu1112112(), vu1112115::vu1112115(), and vu1112118::vu1112118().

Here is the call graph for this function:


Member Data Documentation

float* vuTFIntensity::m_Light [protected]
 

The colour (or spectrum) of the illuminating light.

For spectral to RGBa converted transfer functions the light is already contained in the colour of the LUT.

Definition at line 102 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

float* vuTFIntensity::m_Light [protected]
 

The colour (or spectrum) of the illuminating light.

For spectral to RGBa converted transfer functions the light is already contained in the colour of the LUT.

Definition at line 102 of file General/vuTFunc/vuTFIntensity.h.

Referenced by cleanup(), getRGBa(), init(), operator=(), and vuTFIntensity().

dword vuTFIntensity::m_NComp [protected]
 

number of components for colour model (RGBA -> 4)

Definition at line 93 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

Referenced by fromMap(), getOpacityAtPos(), getRGBa(), init(), normalizeAlphaToOne(), operator=(), and vuTFIntensity().

dword vuTFIntensity::m_Range [protected]
 

range for which the LUT should be defined (8-bit -> 256)

Definition at line 94 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

Referenced by init(), operator=(), and vuTFIntensity().

float* vuTFIntensity::m_Table [protected]
 

The function table for the transfer function.

Definition at line 98 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

float* vuTFIntensity::m_Table [protected]
 

The function table for the transfer function.

Definition at line 98 of file General/vuTFunc/vuTFIntensity.h.

Referenced by cleanup(), getOpacityAtPos(), getRGBa(), init(), operator=(), and vuTFIntensity().

dword vuTFIntensity::m_TableLength [protected]
 

results from m_NComp * m_Range

Definition at line 95 of file Volume/Regular/Unimodal/3d/1B/Intensity/vuTFIntensity.h.

Referenced by init(), and vuTFIntensity().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:07 2004 for vuVolume by  doxygen 1.3.9.1