a class defining a 2D texture according to OpenGL
![]() | read_texture (char *name, unsigned int *width, unsigned int *height, unsigned int *components) reads an RGB color image of format SGI Iris from its name and returns a pointer on the allocated buffer |
![]() | drawGenericTexture (GenericTexture type, const double exponent=1.0, const double radius=1.0) draw a texture of a given type |
![]() | updateTexture () const update the OpenGL texture based on the new texture buffer |
![]() | getNbRows () const return the nb of texture rows |
![]() | getNbColumns () const return the nb of texture columns |
![]() | getNbRealRows () const return the nb of meaningful texture rows |
![]() | getNbRealColumns () const return the nb of meaningful texture columns |
![]() | getColor (const unsigned int row, const unsigned int col, unsigned char *color) const get the RGBA color of a texture pixel |
![]() | getId () const return the texture ID |
![]() | enableTextureCoordinatesGeneration () const enable texture coordinates generation |
![]() | disableTextureCoordinatesGeneration () const disable texture coordinates generation |
![]() | enableTexture (TextureMode m) use this texture |
![]() | disableTexture (TextureMode m) const stop using this texture |
![]() | interpolateTexture (TextureInterpolation i) const set the type of texture interpolation |
![]() | extrapolateTexture (TextureExtrapolation i) const set the type of texture extrapolation |
![]() | applyTextureMode (TextureMode i, const double s[4], const double t[4]) const set the type of texture interpolation |
![]() | constructors
| ||||||
![]() | destructor
|
![]() | binded if the texture has been binded |
![]() | id the texture ID |
![]() | buffer texture buffer |
![]() | nrows number of rows: must be a power of two |
![]() | ncols number of columns: must be a power of two |
![]() | nbRealRows the number of rows that are really meaningful |
![]() | nbRealColumns the number of columns that are really meaningful |
![]() | format pixel format |
![]() | useMipmapping if mipmapping should be used |
![]() | mipmapLevel the number of levels of the mipmapping |
![]() | updateDisplayList if the display list should be update |
a class defining a 2D texture according to OpenGL
enum Format
enum TextureInterpolation
enum TextureExtrapolation
enum TextureMode
bool binded
GLuint id
void* buffer
unsigned int nrows
unsigned int ncols
unsigned int nbRealRows
unsigned int nbRealColumns
Format format
bool useMipmapping
unsigned int mipmapLevel
bool updateDisplayList
constructors
Texture2D(unsigned int *b, const unsigned int nr, const unsigned int nc, Format f=TEXTURE_RGBA)
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 Texture2D(GenericTexture type, const unsigned int size, const double exponent=1.0, const double radius=1.0)
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 ) Texture2D(char *filename)
destructor
void enlargeTexture(const void *b, const unsigned int nr, const unsigned int nc)
void createTexture()
void init()
static unsigned int* read_texture(char *name, unsigned int *width, unsigned int *height, unsigned int *components)
width - the X size of the image
height - the Y size of the image
components - the number of components (1 for bw, 3 for RGB and 4 for RGBA) void drawGenericTexture(GenericTexture type, const double exponent=1.0, const double radius=1.0)
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
unsigned int getNbRows() const
unsigned int getNbColumns() const
unsigned int getNbRealRows() const
unsigned int getNbRealColumns() const
void getColor(const unsigned int row, const unsigned int col, unsigned char *color) const
col - the column index of a pixel
color - the array of Red Green Blue and Alpha value GLuint getId() const
void enableTextureCoordinatesGeneration() const
void disableTextureCoordinatesGeneration() const
void enableTexture(TextureMode m)
void disableTexture(TextureMode m) const
void interpolateTexture(TextureInterpolation i) const
void extrapolateTexture(TextureExtrapolation i) const
void applyTextureMode(TextureMode i, const double s[4], const double t[4]) const
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