VizKit  3.3.7
Classes | Public Member Functions | Private Member Functions | Private Attributes
VizKit::VisualTextureContainer Class Reference

A data container with a reference to an image texture. More...

#include <VisualTextureContainer.h>

List of all members.

Classes

struct  LogicalSize
 Logical size of a texture. More...

Public Member Functions

 VisualTextureContainer ()
 The constructor.
 ~VisualTextureContainer ()
 The destructor.
 VisualTextureContainer (const VisualTextureContainer &other)
 Copy constructor.
VisualTextureContaineroperator= (const VisualTextureContainer &other)
 Assignment operator.
bool initWithFile (VisualFile &aFile)
 Initializes a texture by passing a file.
bool initWithEncodedData (const char *const bufferData, size_t size)
 Initializes a texture by passing a data pointer to encoded image data.
bool initWithARGBPixelData (PixelColor *argbPixels, size_t imageWidth, size_t imageHeight, bool debug=false)
 Initializes a texture with a buffer of ARGB pixel data.
bool initWithBGRAPixelData (PixelColor *bgraPixels, size_t imageWidth, size_t imageHeight, bool debug=false)
 Initializes a texture with a buffer of BGRA pixel data.
bool initWithStyledString (VisualStyledString &styledString)
 Creates a texture of the passed string.
void clean (void)
 Cleans the texture data.
bool initWithFramebuffer (const BottomLeftPositionedPixelRect &clipRect)
 Creates a texture with contents of the current screen (framebuffer).
PixelColorcreateARGBImagePixels (bool debug=false) const
 Returns bitmap data of the texture.
uint32 getTextureName (void) const
 Returns the name/number/id of the current texture.
size_t getTextureWidth (void) const
 Returns the width of the texture.
size_t getTextureHeight (void) const
 Returns the height of the texture.
double getTextureLogicalWidth (void) const
 Returns the logical width of the texture.
double getTextureLogicalHeight (void) const
 Returns the logical height of the texture.
size_t getImageWidth (void) const
 Returns the number of pixels of image data in horizontal direction.
size_t getImageHeight (void) const
 Returns the number of pixels of image data in vertical direction.
bool getUseRectExtension (void) const
 Returns whether the texture is drawn with rectangular texture extension.
void releaseTextureData (void)
 Frees any resources possibly allocated for texture data.
void applyConvolutionFilter (const VisualConvolutionFilter &aConvolutionFilter)
 Applies a convolution filter to the texture.
void resampleTexturePixels (const PixelRect &pixelRect)
 Resamples the pixel data of the texture to the given dimensions of the pixelRect.

Private Member Functions

void copy (const VisualTextureContainer &other)
 Copy method for assignment operator and copy constructor.
PixelColorcreateReadPixels (const uint16 format, const uint16 type)
 Private method accessing the pixels via drawing and reading.

Private Attributes

uint32 textureName
 The name (number, id) of the texture.
PixelRect textureRect
 The dimensions of the texture.
LogicalSize logicalSize
 The logical size of the texture.
PixelRect imageRect
 The dimensions of the image data.
bool useRectExtension
 True if the texture is created with rectangular texture extension (npot texture).

Detailed Description

A data container with a reference to an image texture.


Constructor & Destructor Documentation

The constructor.

The destructor.

Copy constructor.

Parameters:
otherReference to another VisualTextureContainer.

Member Function Documentation

Applies a convolution filter to the texture.

Parameters:
aConvolutionFilterThe convolution filter to apply to the texture.

Cleans the texture data.

void VisualTextureContainer::copy ( const VisualTextureContainer other) [private]

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualTextureContainer.

Returns bitmap data of the texture.

Parameters:
debugIf true, canned sample data is returned.
Returns:
A pointer to the argb pixel data.
Remarks:
The pixel data is returned in dimensions of the image data (not necessarily the dimensions of the texture). The caller has to release the pixel data by calling free().
PixelColor * VisualTextureContainer::createReadPixels ( const uint16  format,
const uint16  type 
) [private]

Private method accessing the pixels via drawing and reading.

Parameters:
formatThe format of the requested pixels (kGL_RGBA, kGL_LUMINANCE).
typeThe data type of the pixel data (8-bit byte, float, etc.).
Remarks:
The caller has to release the pixel data by calling free().
size_t VisualTextureContainer::getImageHeight ( void  ) const

Returns the number of pixels of image data in vertical direction.

Returns:
The pixel height of the image data.
size_t VisualTextureContainer::getImageWidth ( void  ) const

Returns the number of pixels of image data in horizontal direction.

Returns:
The pixel width of the image data.

Returns the height of the texture.

Returns:
The height of the texture.

Returns the logical height of the texture.

Returns:
The logical height of the texture.

Returns the logical width of the texture.

Returns:
The logical width of the texture.

Returns the name/number/id of the current texture.

Returns:
The name/number/id of the current texture.
size_t VisualTextureContainer::getTextureWidth ( void  ) const

Returns the width of the texture.

Returns:
The width of the texture.

Returns whether the texture is drawn with rectangular texture extension.

Returns:
True if graphics system does support rectangular texture extension. False otherwise.
Remarks:
With rectangular texure extension non-power-of-2 (npot) rectangles can be stored in texture memory.
bool VisualTextureContainer::initWithARGBPixelData ( PixelColor argbPixels,
size_t  imageWidth,
size_t  imageHeight,
bool  debug = false 
)

Initializes a texture with a buffer of ARGB pixel data.

Parameters:
argbPixelsPointer to ARGB pixel data.
imageWidthThe width of the image data.
imageHeightThe height of the image data.
debugIf true, canned sample data is used.
Returns:
True on success, false on failure.
Remarks:
No reference to the pixel data is stored, pixel data can be savely disposed after the call.
bool VisualTextureContainer::initWithBGRAPixelData ( PixelColor bgraPixels,
size_t  imageWidth,
size_t  imageHeight,
bool  debug = false 
)

Initializes a texture with a buffer of BGRA pixel data.

Parameters:
bgraPixelsPointer to BGRA pixel data.
imageWidthThe width of the image data.
imageHeightThe height of the image data.
debugIf true, canned sample data is used.
Returns:
True on success, false on failure.
Remarks:
No reference to the pixel data is stored, pixel data can be savely disposed after the call.
bool VisualTextureContainer::initWithEncodedData ( const char *const  bufferData,
size_t  size 
)

Initializes a texture by passing a data pointer to encoded image data.

Parameters:
bufferDataA pointer to the data.
sizeThe size of the data pointed to in bytes.
Returns:
True on success, false on failure.

Initializes a texture by passing a file.

Parameters:
aFileReference to a file.
Returns:
True on success, false on failure.

Creates a texture with contents of the current screen (framebuffer).

Parameters:
clipRectThe dimensions and position of the clip rect.
Returns:
True on success, false on failure.

Creates a texture of the passed string.

Parameters:
styledStringThe styled string to plot to texture.
Returns:
True on success, false on failure.
VisualTextureContainer & VisualTextureContainer::operator= ( const VisualTextureContainer other)

Assignment operator.

Parameters:
otherReference to another VisualTextureContainer.

Frees any resources possibly allocated for texture data.

Resamples the pixel data of the texture to the given dimensions of the pixelRect.

Parameters:
pixelRectThe resampling dimensions.

Member Data Documentation

The dimensions of the image data.

The logical size of the texture.

The name (number, id) of the texture.

The dimensions of the texture.

True if the texture is created with rectangular texture extension (npot texture).

False otherwise.


The documentation for this class was generated from the following files:

Generated on Sun May 3 2015 20:26:32 for VizKit by doxygen 1.8.0