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

vuSpectralImage Class Reference

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

#include <vuSpectralImage.h>

Collaboration diagram for vuSpectralImage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuSpectralImage ()
 constructor
virtual ~vuSpectralImage ()
 destructor
const vuColour7aget_light () const
bool get_xy (int x, int y, vuColour7a &col) const
 get colour from specific point
floatget_xy_data (int x, int y)
 direct read access to the float array at position (x,y)
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 (vuColour7a 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 getRGBImage (vuImage &img) const
 returns a post-illuminated image in img
bool set_xy (int x, int y, const vuColour7a col)
 set spectral color information for a point
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

vuColour7a light
 stores the light source
vuColour7aspix
 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 vuColour7a 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 15 of file vuSpectralImage.h.


Constructor & Destructor Documentation

vuSpectralImage::vuSpectralImage  ) 
 

constructor

Definition at line 8 of file vuSpectralImage.cpp.

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

Here is the call graph for this function:

vuSpectralImage::~vuSpectralImage  )  [virtual]
 

destructor

Definition at line 16 of file vuSpectralImage.cpp.

References mask, and spix.


Member Function Documentation

void vuSpectralImage::create_black_mask  ) 
 

create a mask to deactivate all pixels with a zero spectrum

Definition at line 56 of file vuSpectralImage.cpp.

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

Referenced by ns_vu1112112::vu1112112::render(), and vu1112118::updateSImage().

Here is the call graph for this function:

void vuSpectralImage::get_extents int &  sizx,
int &  sizy
 

get extents of image

Definition at line 102 of file vuSpectralImage.cpp.

Referenced by ns_vu1112112::vu1112112::render().

const vuColour7a & vuSpectralImage::get_light  )  const
 

Returns:
light source currently used for illumination

Definition at line 108 of file vuSpectralImage.cpp.

Referenced by ns_vu1112112::vu1112112::shootRays().

bool vuSpectralImage::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 63 of file vuSpectralImage.cpp.

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

Referenced by getRGBImage(), and ns_vu1112112::vu1112112::render().

Here is the call graph for this function:

bool vuSpectralImage::get_xy int  x,
int  y,
vuColour7a col
const [inline]
 

get colour from specific point

Returns:
false if xy out of range

Definition at line 26 of file vuSpectralImage.h.

float* vuSpectralImage::get_xy_data int  x,
int  y
[inline]
 

direct read access to the float array at position (x,y)

Definition at line 32 of file vuSpectralImage.h.

References vuColour< S >::getData().

Referenced by vu1112118::updateSImage().

Here is the call graph for this function:

bool vuSpectralImage::getRGBImage vuImage img  )  const
 

returns a post-illuminated image in img

Definition at line 85 of file vuSpectralImage.cpp.

References vuImage::get_buffer(), get_rgb(), vuImage::getHeight(), vuImage::getWidth(), vuImage::init(), maxx, and maxy.

Referenced by vu1112118::render().

Here is the call graph for this function:

bool vuSpectralImage::init int  sizx,
int  sizy
 

initialize spectral framebuffer of given size

Todo:
meaningful concept for framebuffer resize

Definition at line 24 of file vuSpectralImage.cpp.

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

Referenced by vu1112118::resize(), ns_vu1112112::vu1112112::setImageSize(), and vuSpectralImage().

Here is the call graph for this function:

void vuSpectralImage::set_light vuColour7a  light  ) 
 

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

Definition at line 96 of file vuSpectralImage.cpp.

Referenced by ns_vu1112112::vu1112112::setLight(), and vu1112118::setLight().

void vuSpectralImage::set_mask bool  value = true  ) 
 

set mask to value

Definition at line 49 of file vuSpectralImage.cpp.

References mask, and maxx.

Referenced by init().

bool vuSpectralImage::set_xy int  x,
int  y,
const vuColour7a  col
[inline]
 

set spectral color information for a point

Definition at line 55 of file vuSpectralImage.h.

Referenced by ns_vu1112112::vu1112112::shootRays().


Member Data Documentation

vuColour7a vuSpectralImage::light [private]
 

stores the light source

Definition at line 66 of file vuSpectralImage.h.

Referenced by get_rgb().

bool* vuSpectralImage::mask [private]
 

mask to avoid calculating black points

Definition at line 70 of file vuSpectralImage.h.

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

int vuSpectralImage::maxx [private]
 

extents of the framebuffer

Definition at line 72 of file vuSpectralImage.h.

Referenced by create_black_mask(), get_rgb(), getRGBImage(), init(), set_mask(), and vuSpectralImage().

int vuSpectralImage::maxy [private]
 

extents of the framebuffer

Definition at line 72 of file vuSpectralImage.h.

Referenced by getRGBImage(), init(), and vuSpectralImage().

vuColour7a* vuSpectralImage::spix [private]
 

pointer to spectral frame buffer

Definition at line 68 of file vuSpectralImage.h.

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


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