X3DTK::Image Class Reference
[image]

Class declared in <X3DTK/kernel.h> providing an abstract factory for the different image formats. More...

List of all members.

Public Member Functions

Static Public Member Functions


Detailed Description

Class declared in <X3DTK/kernel.h> providing an abstract factory for the different image formats.

This class is defined to be user friendly for loading texture images in OpenGL.


Constructor & Destructor Documentation

X3DTK::Image::Image  ) 
 

Constructor.

X3DTK::Image::Image const char *  fileName  ) 
 

Constructor with parameter.

X3DTK::Image::~Image  ) 
 

Destructor.


Member Function Documentation

bool X3DTK::Image::allocate unsigned short  width,
unsigned short  height,
GLenum  GLFormat,
GLenum  GLType
 

Allocates a memory block. Used for reading pixels from buffer.

int X3DTK::Image::computePixelSize GLenum  GLFormat,
GLenum  GLType
[static]
 

Computes the pixel size.

unsigned char* X3DTK::Image::getData  )  const [inline]
 

Gets the data array.

GLenum X3DTK::Image::getGLFormat  )  const [inline]
 

Gets the GL type of pixels.

GLenum X3DTK::Image::getGLType  )  const [inline]
 

Gets the data type of each element.

unsigned short X3DTK::Image::getHeight  )  const [inline]
 

Gets the height.

int X3DTK::Image::getPixelSize  )  const [inline]
 

Gets the size of pixels in bytes.

unsigned short X3DTK::Image::getWidth  )  const [inline]
 

Gets the width.

bool X3DTK::Image::isLoaded  )  const [inline]
 

Returns TRUE if the image is loaded.

void X3DTK::Image::release  ) 
 

releases the memory.

void X3DTK::Image::resize unsigned short  width,
unsigned short  height,
GLenum  GLType = GL_NONE
 

Resizes the memory array to width*height and GLType.

unsigned char* X3DTK::Image::resizeData unsigned short  width,
unsigned short  height,
GLenum  GLType = GL_NONE
 

Resizes the memory array to width*height and GLType and returns the array pointer.

void X3DTK::Image::resizeGL float &  textureTransform[16]  ) 
 

Resizes the memory array to a power of two and fills textureTransform, the transformation to apply in OpenGL to draw the good texture.

void X3DTK::Image::saveAs const char *  fileName,
float  quality = 1.0f
 

Saves the image.


Generated on Fri Jul 30 12:02:34 2004 for X3DToolKit by doxygen 1.3.6