Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Texture Class Reference

Class representing the a texture. More...

#include <texture.h>

List of all members.

Public Member Functions

 Texture (int _width, int _height, int _bits=32)
void upload (float4 *data)
void download (float4 *data)
void clear (float4 *val=NULL)
float4 reduce (FragmentProgram *prg)
float4 max ()
float4 min ()
float4 avg ()
float4 sum ()
void show ()


Detailed Description

Class representing the a texture.


Constructor & Destructor Documentation

Texture::Texture int  _width,
int  _height,
int  _bits = 32
 

Constructor

Parameters:
_width The width of the texture.
_height The height of the texture.
_bits The number of bits per entry, defaults to 32.


Member Function Documentation

float4 Texture::avg  ) 
 

Calculate the average of the values in the texture.

Returns:
The 1x1 texture result as a float4.

void Texture::clear float4 val = NULL  ) 
 

Clear the texture.

Parameters:
val A pointer to a float4 containing the clear value. If unset, the texture is cleared to 0.0f.

void Texture::download float4 data  ) 
 

Download data from the texture.

Parameters:
data A float4 pointer to an array of float4s. The array *must* be the same size as the texture.

float4 Texture::max  ) 
 

Find the maximum value in the texture.

Returns:
The 1x1 texture result as a float4.

float4 Texture::min  ) 
 

Find the minimum value in the texture.

Returns:
The 1x1 texture result as a float4.

float4 Texture::reduce FragmentProgram prg  ) 
 

Reduces the texture according to at program. The program must contain two parameters: a texture called texture and a float called I, these will be fed to the program.

Parameters:
prg The program to be run on the textures recursively.
Returns:
The 1x1 texture result as a float4.

void Texture::show  ) 
 

Show the texture on screen for debugging.

float4 Texture::sum  ) 
 

Sum the values in the texture.

Returns:
The 1x1 texture result as a float4.

void Texture::upload float4 data  ) 
 

Upload data to the texture.

Parameters:
data A float4 pointer to an array of float4s. The array *must* be the same size as the texture.


Generated on Sun Jan 9 19:22:07 2005 for libGPGPU by doxygen 1.3.6