In file graphics3D/Texture1D.h:

namespace yav class Texture1D : public Pointed<Texture1D>

a class defining a 2D texture according to OpenGL

Inheritance:


Public Classes

enum GenericTexture
the generic texture that can be created directly
enum Format
the two different ways of coding each pixel of a texture
enum TextureInterpolation
the two different types of texture interpolation
enum TextureExtrapolation
the two different types of texture interpolation
enum TextureMode
the four different types of texture mapping

Public Methods

void drawGenericTexture (GenericTexture type)
draw a texture of a given type
void updateTexture () const
update the OpenGL texture based on the new texture buffer
unsigned int getNbColumns () const
return the nb of texture columns
unsigned int getNbRealColumns () const
return the nb of meaningful texture columns
void getColor (const unsigned int col, unsigned char *color) const
get the RGBA color of a texture pixel
GLuint getId () const
return the texture ID
void enableTextureCoordinatesGeneration () const
enable texture coordinates generation
void disableTextureCoordinatesGeneration () const
disable texture coordinates generation
void enableTexture (TextureMode m)
use this texture
void disableTexture (TextureMode m) const
stop using this texture
void interpolateTexture (TextureInterpolation i) const
set the type of texture interpolation
void extrapolateTexture (TextureExtrapolation i) const
set the type of texture extrapolation
void applyTextureMode (TextureMode i, const double s[4], const double t[4]) const
set the type of texture interpolation

Public

constructors
Texture1D (unsigned int *b, const unsigned int nc, Format f=TEXTURE_RGBA)
build a texture from a buffer
Texture1D (GenericTexture type, const unsigned int size)
build a texture of a given type
Texture1D (char *filename)
build a texture from a GIF image file
destructor
virtual ~Texture1D ()
delete a 2D Texture

Protected Fields

bool binded
if the texture has been binded
GLuint id
the texture ID
void* buffer
texture buffer
unsigned int ncols
number of columns: must be a power of two
unsigned int nbRealColumns
the number of columns that are really meaningful
Format format
pixel format
bool updateDisplayList
if the display list should be update

Protected Methods

void enlargeTexture (const void *b, const unsigned int nc)
enlarge a given texture such that its size is a power of 2 and store it in the texture buffer
void createTexture ()
create the display list associated with the texture
void init ()
initialize variables

Documentation

a class defining a 2D texture according to OpenGL
enum GenericTexture
the generic texture that can be created directly

enum Format
the two different ways of coding each pixel of a texture

enum TextureInterpolation
the two different types of texture interpolation

enum TextureExtrapolation
the two different types of texture interpolation

enum TextureMode
the four different types of texture mapping

bool binded
if the texture has been binded

GLuint id
the texture ID

void* buffer
texture buffer

unsigned int ncols
number of columns: must be a power of two

unsigned int nbRealColumns
the number of columns that are really meaningful

Format format
pixel format

bool updateDisplayList
if the display list should be update

constructors

Texture1D(unsigned int *b, const unsigned int nc, Format f=TEXTURE_RGBA)
build a texture from a buffer
Parameters:
b - a buffer where each pixel is each coded with RGBA or ABGR
nr - the number of rows (may not be a power of 2)
nc - the number of columns (may not be a power of 2)
f - the format of each pixel

Texture1D(GenericTexture type, const unsigned int size)
build a texture of a given type
Parameters:
the - type of generic texture
size - the number of rows and columns of the texture
exponent - for the gaussian and halo texture controls the spread of the gaussian
radius - for the halo texture controls the radius of the halo (as default it is a quarter of the size )

Texture1D(char *filename)
build a texture from a GIF image file
Parameters:
filename - file name of a GIF file

destructor

virtual ~Texture1D()
delete a 2D Texture

void enlargeTexture(const void *b, const unsigned int nc)
enlarge a given texture such that its size is a power of 2 and store it in the texture buffer

void createTexture()
create the display list associated with the texture

void init()
initialize variables

void drawGenericTexture(GenericTexture type)
draw a texture of a given type
Parameters:
the - type of generic texture
exponent - for the gaussian and halo texture controls the spread of the gaussian
radius - for the halo texture controls the radius of the halo (as default it is a quarter of the size )

void updateTexture() const
update the OpenGL texture based on the new texture buffer

unsigned int getNbColumns() const
return the nb of texture columns

unsigned int getNbRealColumns() const
return the nb of meaningful texture columns

void getColor(const unsigned int col, unsigned char *color) const
get the RGBA color of a texture pixel
Parameters:
row - the row index of a pixel
col - the column index of a pixel
color - the array of Red Green Blue and Alpha value

GLuint getId() const
return the texture ID

void enableTextureCoordinatesGeneration() const
enable texture coordinates generation

void disableTextureCoordinatesGeneration() const
disable texture coordinates generation

void enableTexture(TextureMode m)
use this texture

void disableTexture(TextureMode m) const
stop using this texture

void interpolateTexture(TextureInterpolation i) const
set the type of texture interpolation

void extrapolateTexture(TextureExtrapolation i) const
set the type of texture extrapolation

void applyTextureMode(TextureMode i, const double s[4], const double t[4]) const
set the type of texture interpolation


Direct child classes:
TclTexture1D

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de