CIvfImage Class Reference

#include <ivf/IvfImage.h>

Inheritance diagram for CIvfImage:

CIvfBase CIvfRefCountBase CIvfRTTIBase CIvfFileImage CIvfBmpImage CIvfJpegImage CIvfPngImage CIvfPngImage CIvfSgiImage CIvfTgaImage List of all members.

Public Member Functions

 CIvfImage ()
virtual ~CIvfImage ()
 IvfClassInfo ("CIvfImage", CIvfBase)
void clear ()
bool valid (int x, int y)
void setPixel (int x, int y, GLubyte red, GLubyte green, GLubyte blue)
void setValue (int x, int y, int channel, GLubyte value)
void setPixelAlpha (int x, int y, GLubyte alpha)
void getPixel (int x, int y, GLubyte &red, GLubyte &green, GLubyte &blue)
GLubyte getPixelAlpha (int x, int y)
void fillColor (GLubyte red, GLubyte green, GLubyte blue)
void fillColorAlpha (GLubyte alpha)
void fillRect (int x1, int y1, int x2, int y2, GLubyte red, GLubyte green, GLubyte blue)
void fillRectAlpha (int x1, int y1, int x2, int y2, GLubyte alpha)
void drawFrame (int x1, int y1, int x2, int y2, GLubyte red, GLubyte green, GLubyte blue)
void drawFrameAlpha (int x1, int y1, int x2, int y2, GLubyte alpha)
void replaceColor (GLubyte srcRed, GLubyte srcGreen, GLubyte srcBlue, GLubyte tgtRed, GLubyte tgtGreen, GLubyte tgtBlue)
void createAlphaMask (int treshold, int component, int over, int under)
void createAlphaFromColor ()
void setChannels (int channels)
int getChannels ()
void setInternalFormat (GLint format)
GLint getInternalFormat ()
void setSize (int width, int height)
int getHeight ()
int getWidth ()
double getRatio ()
void setImageMap (void *image)
GLubyte * getImageMap ()
GLint getFormat ()

Detailed Description

Image class

The CIvfImage class implements a OpenGL compatible 2D image. The class is used as a base class for the image loaders in the ivfimage library.

Definition at line 40 of file IvfImage.h.


Constructor & Destructor Documentation

CIvfImage::CIvfImage  ) 
 

CIvfImage constructor

virtual CIvfImage::~CIvfImage  )  [virtual]
 

CIvfImage destructor


Member Function Documentation

void CIvfImage::clear  ) 
 

Clear image

Fills entire image with black(=0) and if alpha channel present it is filled with 255

void CIvfImage::createAlphaFromColor  ) 
 

Assigns alpha channel values from mean color values.

void CIvfImage::createAlphaMask int  treshold,
int  component,
int  over,
int  under
 

Creates an alpha mask using a color component in the image

Parameters:
treshold - color component treshold value.
component - color component to compare with.
over - alpha value if component>treshold.
under - alpha value if component<treshold.

void CIvfImage::drawFrame int  x1,
int  y1,
int  x2,
int  y2,
GLubyte  red,
GLubyte  green,
GLubyte  blue
 

Draw a frame with specified color

void CIvfImage::drawFrameAlpha int  x1,
int  y1,
int  x2,
int  y2,
GLubyte  alpha
 

Draw a frame width specified alpha value

void CIvfImage::fillColor GLubyte  red,
GLubyte  green,
GLubyte  blue
 

Fill image with specified color

void CIvfImage::fillColorAlpha GLubyte  alpha  ) 
 

Fill image alpha channel with value

void CIvfImage::fillRect int  x1,
int  y1,
int  x2,
int  y2,
GLubyte  red,
GLubyte  green,
GLubyte  blue
 

Fill a rectangular area of image with color

void CIvfImage::fillRectAlpha int  x1,
int  y1,
int  x2,
int  y2,
GLubyte  alpha
 

Fill a rectangular area of image width specified alpha value

int CIvfImage::getChannels  ) 
 

Returns the number of channels in the image

GLint CIvfImage::getFormat  ) 
 

Returns the image format.

int CIvfImage::getHeight  ) 
 

Return height of image

GLubyte* CIvfImage::getImageMap  ) 
 

Return pointer to image map

This pointer can be used with OpenGL functions

GLint CIvfImage::getInternalFormat  ) 
 

Returns the internal image format for use with OpenGL

void CIvfImage::getPixel int  x,
int  y,
GLubyte &  red,
GLubyte &  green,
GLubyte &  blue
 

Get pixel values

GLubyte CIvfImage::getPixelAlpha int  x,
int  y
 

Return pixel alpha values

double CIvfImage::getRatio  ) 
 

Return image ratio

int CIvfImage::getWidth  ) 
 

Return width of image

void CIvfImage::replaceColor GLubyte  srcRed,
GLubyte  srcGreen,
GLubyte  srcBlue,
GLubyte  tgtRed,
GLubyte  tgtGreen,
GLubyte  tgtBlue
 

Replace a color in the image with another

Parameters:
srcRed - red color component of color to replace.
srcGreen - green color component of color to replace.
srgBlue - blue color component of color to replace.
tgtRed - red color component of replacing color.
tgtGreen - green color component of replacing color.
tgtBlue - blue color component of replacing color.

void CIvfImage::setChannels int  channels  ) 
 

Set number of channels in image

If image is allocated calling setChannels() will deallocate it. setChannels() should be called before setSize(), to avoid unnesseccary allocation.

void CIvfImage::setImageMap void *  image  ) 
 

Sets the image map used by the image class

void CIvfImage::setInternalFormat GLint  format  ) 
 

Sets the internal format of the image

This method should not be neccessary to call because the internal format is automatically set.

void CIvfImage::setPixel int  x,
int  y,
GLubyte  red,
GLubyte  green,
GLubyte  blue
 

Set an image pixel

void CIvfImage::setPixelAlpha int  x,
int  y,
GLubyte  alpha
 

Set alpha value of image pixel

void CIvfImage::setSize int  width,
int  height
 

Sets the image size

If channels are not set a 3 channel image will be created.

void CIvfImage::setValue int  x,
int  y,
int  channel,
GLubyte  value
 

Set an image pixel by specifying channel and value

bool CIvfImage::valid int  x,
int  y
 

Validate image coordinate

Returns:
true if
Parameters:
x and
y are valid image coordinates


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 15:36:52 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO