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

vuImage Class Reference

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

#include <vuImage.h>

Collaboration diagram for vuImage:

Collaboration graph
[legend]
List of all members.

Public Types

enum  vuImageFormat { vuBMP_RGBA, vuBMP_GREY }

Public Member Functions

 vuImage (dword width=0, dword height=0)
 constructor
virtual ~vuImage ()
 destructor
 vuImage (const vuImage &other)
 copy constructor
bool init (int sizx, int sizy)
 initialize spectral framebuffer of given size
void get_extents (int &sizx, int &sizy)
 get extents of vuImage
void set_extents (int sizx, int sizy)
 this will set the extents of the buffer spix, but it will not delete the memory pointed to by spix and will notallocate new memory at spix.
bool set_xy (int x, int y, const vuColourRGBa &col)
 set spectral color information for a point
bool set_xy (int x, int y, unsigned char r, unsigned char g, unsigned char b)
 This will set pixel (x, y) to have colour (r, g, b)...
bool get_xy (int x, int y, vuColourRGBa &col)
 get colour from specific point
const byteget_rgb () const
 returns the framebuffer
byteget_buffer ()
 returns the framebuffer for modification
bool set_rgb (byte *rgb)
 This will copy the contents of rgb into spix (make sure that rgb is of the appropriate size and dimensions first).
void set_rgb (int start, int number_copied, byte *rgb)
 This will set the buffer from start up to start + number_copied bytes from rgb.
void elim_data (byte *rgb)
 This will overwrite spix with rgb without first deleting the buffer spix.
bool set_data (byte *rgb)
 This will delete spix and set spix equal to rgb.
int getWidth () const
int getHeight () const
void blit (int x=0, int y=0)
 Blits the image to the screen.
void clear (const byte r=0, const byte g=0, const byte b=0)
 Clears the image with color(r,g,b) and blits it to the screen.
void initOpenGL ()
 openGl related methods
void glResize (dword width, dword height)
void glRender ()
bool writeToFile (const char *fileName, vuImageFormat fmt=vuBMP_RGBA)
 file write/read access
bool readFromFile (const char *fileName, vuImageFormat fmt=vuBMP_RGBA)
vuImage operator= (const vuImage &other)
vuImageoperator+= (vuImage &other)
vuImageoperator *= (float scale)

Private Member Functions

void _copy (const vuImage &other)

Private Attributes

bytespix
 pointer to spectral frame buffer
int maxx
 extent of the framebuffer in the x direction
int maxy
 extent of the framebuffer in the y direction

Friends

bool get_difference (vuImage &img1, vuImage &img2, int *temp)
 This will return the differences between img1 and img2 and store the signed difference in the array pointed to by temp.

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 34 of file vuImage.h.


Member Enumeration Documentation

enum vuImage::vuImageFormat
 

Enumeration values:
vuBMP_RGBA 
vuBMP_GREY 

Definition at line 37 of file vuImage.h.


Constructor & Destructor Documentation

vuImage::vuImage dword  width = 0,
dword  height = 0
 

constructor

Definition at line 16 of file vuImage.cpp.

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

Here is the call graph for this function:

vuImage::~vuImage  )  [virtual]
 

destructor

Definition at line 24 of file vuImage.cpp.

References spix.

vuImage::vuImage const vuImage other  ) 
 

copy constructor

Definition at line 32 of file vuImage.cpp.

References operator=().

Here is the call graph for this function:


Member Function Documentation

void vuImage::_copy const vuImage other  )  [private]
 

void vuImage::blit int  x = 0,
int  y = 0
 

Blits the image to the screen.

(to blit means kinda draw)

Definition at line 160 of file vuImage.cpp.

References GL_RGB, GL_UNPACK_ALIGNMENT, GL_UNSIGNED_BYTE, glDrawPixels(), glPixelStorei(), glRasterPos2i(), maxx, maxy, and spix.

Referenced by vu1512113::displayFromImage(), vu1112113::displayFromImage(), vu1512122::displayFromImage(), vu1112118::render(), vu1112116::render(), and vu1112117::render().

Here is the call graph for this function:

void vuImage::clear const byte  r = 0,
const byte  g = 0,
const byte  b = 0
 

Clears the image with color(r,g,b) and blits it to the screen.

Definition at line 148 of file vuImage.cpp.

References byte, and maxx.

Referenced by vu1112117::drawImageFromSlices().

void vuImage::elim_data byte rgb  ) 
 

This will overwrite spix with rgb without first deleting the buffer spix.

Definition at line 133 of file vuImage.cpp.

References byte, and spix.

byte * vuImage::get_buffer  ) 
 

returns the framebuffer for modification

Definition at line 95 of file vuImage.cpp.

References byte.

Referenced by vuSpectralImage::getRGBImage(), operator *=(), operator+=(), operator=(), and vu1112117::scaleAndBias().

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

get extents of vuImage

Definition at line 100 of file vuImage.cpp.

Referenced by vu1512113::displayFromImage(), vu1112113::displayFromImage(), vu1512122::displayFromImage(), vuKeyFramerDialog::PlayNextImage(), vuPPM::ReadCompressedImage(), vuPPM::ReadImage(), vuPPM::ReadImageFromBuffer(), vu1112116::render(), vuPPM::SaveCompressedImage(), and vuPPM::SaveImage().

const byte * vuImage::get_rgb  )  const
 

returns the framebuffer

Definition at line 90 of file vuImage.cpp.

References byte.

Referenced by Scanner::_renderView(), vuPPM::CompressToBuffer(), vu1112111::drawPic(), vu1112115::drawPic(), vu111211a::drawPic(), operator=(), vuPPM::ReadCompressedImage(), vuPPM::ReadImage(), vu1112115::render(), vu1112116::render(), vuPPM::SaveImage(), and vu111211a::writeImgBuffer().

bool vuImage::get_xy int  x,
int  y,
vuColourRGBa col
 

get colour from specific point

Returns:
false if xy out of range

Definition at line 81 of file vuImage.cpp.

References maxx, and spix.

int vuImage::getHeight  )  const
 

Definition at line 143 of file vuImage.cpp.

Referenced by vu1112111::drawPic(), vu1112115::drawPic(), vu111211a::drawPic(), vu1112117::getImageHeight(), vuSpectralImage::getRGBImage(), operator *=(), operator+=(), operator=(), vu1112115::render(), vu1112117::scaleAndBias(), vu1112117::setOversampling(), vu1112117::setViewVectors(), and vu111211a::writeImgBuffer().

int vuImage::getWidth  )  const
 

Definition at line 138 of file vuImage.cpp.

Referenced by vu1112111::drawPic(), vu1112115::drawPic(), vu111211a::drawPic(), vu1112117::getImageWidth(), vuSpectralImage::getRGBImage(), operator *=(), operator+=(), operator=(), vu1112115::render(), vu1112117::scaleAndBias(), vu1112117::setOversampling(), vu1112117::setViewVectors(), and vu111211a::writeImgBuffer().

void vuImage::glRender  ) 
 

Definition at line 191 of file vuImage.cpp.

References GL_RGB, GL_UNSIGNED_BYTE, glDrawPixels(), maxx, maxy, and spix.

Here is the call graph for this function:

void vuImage::glResize dword  width,
dword  height
 

Definition at line 184 of file vuImage.cpp.

References dword, glPixelZoom(), maxx, and maxy.

Here is the call graph for this function:

bool vuImage::init int  sizx,
int  sizy
 

initialize spectral framebuffer of given size

Definition at line 38 of file vuImage.cpp.

References byte, maxx, maxy, and spix.

Referenced by vu1112117::_init(), vuSpectralImage::getRGBImage(), vuPPM::OpenImage(), operator=(), vu1112116::read(), vuPPM::ReadCompressedImage(), vuPPM::ReadImage(), vuPPM::ReadImageFromBuffer(), vu1112116::readRaw(), vu1112115::render(), vu1512113::renderImage(), vu1512122::renderImage(), vu1112118::resize(), vuPPM::set_xy(), vu1512113::setImageSize(), vu1112113::setImageSize(), vu1512122::setImageSize(), vu1112113::shootRays(), vuImage(), and vu111211a::writeImgBuffer().

void vuImage::initOpenGL  ) 
 

openGl related methods

Definition at line 179 of file vuImage.cpp.

References GL_LIGHTING, and glDisable().

Here is the call graph for this function:

vuImage & vuImage::operator *= float  scale  ) 
 

Definition at line 342 of file vuImage.cpp.

References byte, get_buffer(), getHeight(), and getWidth().

Here is the call graph for this function:

vuImage & vuImage::operator+= vuImage other  ) 
 

Definition at line 311 of file vuImage.cpp.

References byte, get_buffer(), getHeight(), and getWidth().

Here is the call graph for this function:

vuImage vuImage::operator= const vuImage other  ) 
 

Definition at line 289 of file vuImage.cpp.

References byte, get_buffer(), get_rgb(), getHeight(), getWidth(), and init().

Referenced by vuImage().

Here is the call graph for this function:

bool vuImage::readFromFile const char *  fileName,
vuImageFormat  fmt = vuBMP_RGBA
 

bool vuImage::set_data byte rgb  ) 
 

This will delete spix and set spix equal to rgb.

Definition at line 124 of file vuImage.cpp.

References byte, and spix.

Referenced by ns_vu1112112::vu1112112::getImage(), and vuPPM::ReadImageFromBuffer().

void vuImage::set_extents int  sizx,
int  sizy
 

this will set the extents of the buffer spix, but it will not delete the memory pointed to by spix and will notallocate new memory at spix.

Definition at line 106 of file vuImage.cpp.

References maxx, and maxy.

void vuImage::set_rgb int  start,
int  number_copied,
byte rgb
 

This will set the buffer from start up to start + number_copied bytes from rgb.

Definition at line 119 of file vuImage.cpp.

References byte, and spix.

bool vuImage::set_rgb byte rgb  ) 
 

This will copy the contents of rgb into spix (make sure that rgb is of the appropriate size and dimensions first).

Definition at line 112 of file vuImage.cpp.

References byte, maxx, maxy, and spix.

Referenced by vuPPM::Readnext64KB().

bool vuImage::set_xy int  x,
int  y,
unsigned char  r,
unsigned char  g,
unsigned char  b
 

This will set pixel (x, y) to have colour (r, g, b)...

I added this since it would be faster than the previous method since then I wouldn't have to divide and multiply each pixel to get the proper value, and this would save me time.

Definition at line 71 of file vuImage.cpp.

References byte, maxx, and spix.

bool vuImage::set_xy int  x,
int  y,
const vuColourRGBa col
 

set spectral color information for a point

Definition at line 56 of file vuImage.cpp.

References byte, vuColour< S >::clampTo01(), maxx, and spix.

Referenced by vu1512113::renderImage(), vu1512122::renderImage(), and vu1112113::shootRays().

Here is the call graph for this function:

bool vuImage::writeToFile const char *  fileName,
vuImageFormat  fmt = vuBMP_RGBA
 

file write/read access


Friends And Related Function Documentation

bool get_difference vuImage img1,
vuImage img2,
int *  temp
[friend]
 

This will return the differences between img1 and img2 and store the signed difference in the array pointed to by temp.


Member Data Documentation

int vuImage::maxx [private]
 

extent of the framebuffer in the x direction

Definition at line 116 of file vuImage.h.

Referenced by blit(), clear(), get_xy(), glRender(), glResize(), init(), set_extents(), set_rgb(), set_xy(), and vuImage().

int vuImage::maxy [private]
 

extent of the framebuffer in the y direction

Definition at line 119 of file vuImage.h.

Referenced by blit(), glRender(), glResize(), init(), set_extents(), set_rgb(), and vuImage().

byte* vuImage::spix [private]
 

pointer to spectral frame buffer

Definition at line 113 of file vuImage.h.

Referenced by blit(), elim_data(), get_xy(), glRender(), init(), set_data(), set_rgb(), set_xy(), vuImage(), and ~vuImage().


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