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

ns_vu1112112::SpectralImage Class Reference

Hold a spectrum for each pixel on the screen. More...

#include <SpectralImage.h>

Collaboration diagram for ns_vu1112112::SpectralImage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const ColourTypeget_light () const
bool get_xy (int x, int y, ColourType &col)
 get colour from specific point
void get_extents (int &sizx, int &sizy)
 get extents of image
bool init (int sizx, int sizy)
 initialize spectral framebuffer of given size
void set_light (ColourType light)
 set a specific light source this source is used to apply post illumination
bool get_rgb (byte *buf, int size) const
 performs post illumination This functions applies the light source given by set_light() and transforms the resulting colors to RGB which is written into the buffer.
bool set_xy (int x, int y, const ColourType col)
 set spectral color information for a point
 SpectralImage ()
 constructor
virtual ~SpectralImage ()
 destructor
void set_mask (bool value=true)
 set mask to value
void create_black_mask ()
 create a mask to deactivate all pixels with a zero spectrum

Private Attributes

ColourType light
 stores the light source
ColourTypespix
 pointer to spectral frame buffer
boolmask
 mask to avoid calculating black points
int maxx
 extents of the framebuffer
int maxy
 extents of the framebuffer

Detailed Description

Hold a spectrum for each pixel on the screen.

Is used to apply post-illumination. The reference to ColourType is a typecast that stands for the color model used in the currently compiled version.

Todo:
relate it more to the framebuffer provided by a future version of vuDrawTools

Definition at line 18 of file SpectralImage.h.


Constructor & Destructor Documentation

ns_vu1112112::SpectralImage::SpectralImage  ) 
 

constructor

Definition at line 15 of file SpectralImage.cpp.

References init(), mask, maxx, maxy, and spix.

Here is the call graph for this function:

ns_vu1112112::SpectralImage::~SpectralImage  )  [virtual]
 

destructor

Definition at line 23 of file SpectralImage.cpp.

References mask, and spix.


Member Function Documentation

void ns_vu1112112::SpectralImage::create_black_mask  ) 
 

create a mask to deactivate all pixels with a zero spectrum

Definition at line 63 of file SpectralImage.cpp.

References mask, vuColour< S >::maxComponent(), maxx, and spix.

Here is the call graph for this function:

void ns_vu1112112::SpectralImage::get_extents int &  sizx,
int &  sizy
 

get extents of image

Definition at line 119 of file SpectralImage.cpp.

const ColourType & ns_vu1112112::SpectralImage::get_light  )  const
 

Returns:
light source currently used for illumination

Definition at line 125 of file SpectralImage.cpp.

References ColourType.

bool ns_vu1112112::SpectralImage::get_rgb byte buf,
int  size
const
 

performs post illumination This functions applies the light source given by set_light() and transforms the resulting colors to RGB which is written into the buffer.

Parameters:
buf pointer to byte buffer
size of buffer in byte (unsigned char)
Returns:
if(buf == NULL || size<3*maxx*maxy) return false

Definition at line 70 of file SpectralImage.cpp.

References byte, vuColour< S >::clampTo01(), vuColour< S >::clampTo1(), ColourType, vuColourRGBa::from(), ns_vu1112112::light, light, mask, maxx, NULL, size, and spix.

Here is the call graph for this function:

bool ns_vu1112112::SpectralImage::get_xy int  x,
int  y,
ColourType col
 

get colour from specific point

Returns:
false if xy out of range

bool ns_vu1112112::SpectralImage::init int  sizx,
int  sizy
 

initialize spectral framebuffer of given size

Todo:
meaningful concept for framebuffer resize

Definition at line 31 of file SpectralImage.cpp.

References ColourType, mask, maxx, maxy, set_mask(), and spix.

Referenced by SpectralImage().

Here is the call graph for this function:

void ns_vu1112112::SpectralImage::set_light ColourType  light  ) 
 

set a specific light source this source is used to apply post illumination

Definition at line 113 of file SpectralImage.cpp.

References ColourType, and ns_vu1112112::light.

void ns_vu1112112::SpectralImage::set_mask bool  value = true  ) 
 

set mask to value

Definition at line 56 of file SpectralImage.cpp.

References mask, and maxx.

Referenced by init().

bool ns_vu1112112::SpectralImage::set_xy int  x,
int  y,
const ColourType  col
[inline]
 

set spectral color information for a point

Definition at line 44 of file SpectralImage.h.

References ColourType.


Member Data Documentation

ColourType ns_vu1112112::SpectralImage::light [private]
 

stores the light source

Definition at line 59 of file SpectralImage.h.

Referenced by get_rgb().

bool* ns_vu1112112::SpectralImage::mask [private]
 

mask to avoid calculating black points

Definition at line 63 of file SpectralImage.h.

Referenced by create_black_mask(), get_rgb(), init(), set_mask(), SpectralImage(), and ~SpectralImage().

int ns_vu1112112::SpectralImage::maxx [private]
 

extents of the framebuffer

Definition at line 65 of file SpectralImage.h.

Referenced by create_black_mask(), get_rgb(), init(), set_mask(), and SpectralImage().

int ns_vu1112112::SpectralImage::maxy [private]
 

extents of the framebuffer

Definition at line 65 of file SpectralImage.h.

Referenced by init(), and SpectralImage().

ColourType* ns_vu1112112::SpectralImage::spix [private]
 

pointer to spectral frame buffer

Definition at line 61 of file SpectralImage.h.

Referenced by create_black_mask(), get_rgb(), init(), SpectralImage(), and ~SpectralImage().


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