Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglTexture1D Class Reference

#include <sglTexture1D.hpp>

Inheritance diagram for sglTexture1D::

sglTexture sglTexturingStatelet sglStatelet sglObject List of all members.

Public Methods

 sglTexture1D ()
virtual ~sglTexture1D ()
bool setImage (void *image, ExternalFormatEnum format, TypeEnum type, unsigned int num_s, bool border=false)
void getImage (void *&image, ExternalFormatEnum &format, TypeEnum &type, unsigned int &num_s, bool &border) const
bool setMipmapLevels (const vector< void *> &images)
bool subloadImage (void *sub_image, GLint level, GLint offset_x, GLint width)
virtual bool replaceImage (void *new_image, GLint level=0)
void getSize (unsigned int &width) const
virtual unsigned int getIdealInternalSize () const
virtual unsigned int getLikelyInternalSize () const
void setWrapMode (WrapEnum s_repeat_flag)
void getWrapMode (WrapEnum &s_repeat_flag) const
virtual bool checkProxy ()
virtual void bind ()
bool copyTexSubImage (GLint level, GLint offset_x, GLint win_x, GLint win_y, GLint width)
virtual bool buildMipmaps (vector< void *> &mipmaps)
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Static Public Methods

bool resizeImage (sglTexture::ExternalFormatEnum format, sglTexture::TypeEnum type, unsigned int old_s, bool border, unsigned int new_s, void *old_image, void *&new_image)
bool halveImage (sglTexture::ExternalFormatEnum format, sglTexture::TypeEnum type, unsigned int &num_s, bool border, void *old_image, void *&new_image)

Detailed Description

container for 1D image data used for texturing

Definition at line 39 of file sglTexture1D.hpp.


Member Function Documentation

bool sglTexture1D::setImage ( void * image,
ExternalFormatEnum format,
TypeEnum type,
unsigned int num_s,
bool border = false )
 

Set the image to be textured (level zero).

bool sglTexture1D::setMipmapLevels ( const vector< void *> & images ) [virtual]
 

Set the mipmap images. Returns false if number of images is not correct or if the AutoMipmap feature is on. Assumes that the images are correct in size and format.

Reimplemented from sglTexture.

bool sglTexture1D::subloadImage ( void * sub_image,
GLint level,
GLint offset_x,
GLint width )
 

Replace all or part of a contiguous subregion of the current image.

bool sglTexture1D::replaceImage ( void * new_image,
GLint level = 0 ) [virtual]
 

Helper function to replace an entire image via subtexload funtionality. The new_image data must be the same size as the original image set by setImage, and the pointer to the old image data is lost. Returns false if the parameters are out of range.

Reimplemented from sglTexture.

void sglTexture1D::getSize ( unsigned int & width ) const [inline]
 

Get the size of the level zero image.

Definition at line 92 of file sglTexture1D.hpp.

unsigned int sglTexture1D::getIdealInternalSize ( ) const [virtual]
 

Returns the number of bytes of texture memory this texture will use if the requested internal format was honored.

Reimplemented from sglTexture.

unsigned int sglTexture1D::getLikelyInternalSize ( ) const [virtual]
 

Returns the number of bytes of texture memory this texture is most likely using. Must be called by a thread with a current rendering context.

Reimplemented from sglTexture.

void sglTexture1D::setWrapMode ( WrapEnum s_repeat_flag )
 

Get/set whether the texture repeats or is stretched by tex coords > 1.

bool sglTexture1D::checkProxy ( ) [virtual]
 

Use the GL_PROXY_TEXTURE mechanism to check if the texture is capable of being loaded into texture memory. Returns false if the texture is too large. Must be called by a thread with a current rendering context.

Reimplemented from sglTexture.

void sglTexture1D::bind ( ) [virtual]
 

Copy texture (and changes) into texture memory. If (getAutoBind() == false), this method must be called before before the texture can be applied. Must be called by a thread with a current rendering context.

Reimplemented from sglTexture.

bool sglTexture1D::copyTexSubImage ( GLint level,
GLint offset_x,
GLint win_x,
GLint win_y,
GLint width )
 

Replace all or part of a contiguous subregion of the current image.

bool sglTexture1D::buildMipmaps ( vector< void *> & mipmaps ) [virtual]
 

Generates a set of mipmaps from the level 0 image in this texture. Existing images in the given mipmaps vector will be resized (via realloc) and excess images will be free()'d. Returns false if the mipmaps could not be built.

Reimplemented from sglTexture.

bool sglTexture1D::resizeImage ( sglTexture::ExternalFormatEnum format,
sglTexture::TypeEnum type,
unsigned int old_s,
bool border,
unsigned int new_s,
void * old_image,
void *& new_image ) [static]
 

Creates a new image (using malloc) from another image, but with a different size. Note that the new and old sizes are NOT constrained to be a power of two. Also note that this method is slow.

Parameters:
format   the format of the image data
type   the type of each pixel
old_s   the width of the old image
border   true if the image has a one pixel border
new_s   the width of the new image
old_image   the old image
new_image   a pointer to the pointer to the new image; this pointer will be realloced to the appropriate size
Returns:
false on failure

bool sglTexture1D::halveImage ( sglTexture::ExternalFormatEnum format,
sglTexture::TypeEnum type,
unsigned int & num_s,
bool border,
void * old_image,
void *& new_image ) [static]
 

Creates a new image one half the size (num_s/2) of another image. This method is much faster than resizeImage(). Note that num_s must be divisible by two.

Parameters:
format   the format of the image data
type   the type of each pixel
num_s   should be called with the width of the old image, on return this is set the the width of the new image
border   true if the image has a one pixel border
old_image   the old image
new_image   a pointer to a pointer to the new image; this pointer will be realloced to the appropriate size
Returns:
false on failure

virtual void sglTexture1D::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglTexture.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:10 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001