VizKit
3.3.7
|
A data container with a reference to an image texture. More...
#include <VisualTextureContainer.h>
Classes | |
struct | LogicalSize |
Logical size of a texture. More... | |
Public Member Functions | |
VisualTextureContainer () | |
The constructor. | |
~VisualTextureContainer () | |
The destructor. | |
VisualTextureContainer (const VisualTextureContainer &other) | |
Copy constructor. | |
VisualTextureContainer & | operator= (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). | |
PixelColor * | createARGBImagePixels (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. | |
PixelColor * | createReadPixels (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). |
A data container with a reference to an image texture.
The constructor.
The destructor.
VisualTextureContainer::VisualTextureContainer | ( | const VisualTextureContainer & | other | ) |
Copy constructor.
other | Reference to another VisualTextureContainer. |
void VisualTextureContainer::applyConvolutionFilter | ( | const VisualConvolutionFilter & | aConvolutionFilter | ) |
Applies a convolution filter to the texture.
aConvolutionFilter | The convolution filter to apply to the texture. |
void VisualTextureContainer::clean | ( | void | ) |
Cleans the texture data.
void VisualTextureContainer::copy | ( | const VisualTextureContainer & | other | ) | [private] |
Copy method for assignment operator and copy constructor.
other | Another VisualTextureContainer. |
PixelColor * VisualTextureContainer::createARGBImagePixels | ( | bool | debug = false | ) | const |
Returns bitmap data of the texture.
debug | If true, canned sample data is returned. |
PixelColor * VisualTextureContainer::createReadPixels | ( | const uint16 | format, |
const uint16 | type | ||
) | [private] |
Private method accessing the pixels via drawing and reading.
format | The format of the requested pixels (kGL_RGBA, kGL_LUMINANCE). |
type | The data type of the pixel data (8-bit byte, float, etc.). |
size_t VisualTextureContainer::getImageHeight | ( | void | ) | const |
Returns the number of pixels of image data in vertical direction.
size_t VisualTextureContainer::getImageWidth | ( | void | ) | const |
Returns the number of pixels of image data in horizontal direction.
size_t VisualTextureContainer::getTextureHeight | ( | void | ) | const |
Returns the height of the texture.
double VisualTextureContainer::getTextureLogicalHeight | ( | void | ) | const |
Returns the logical height of the texture.
double VisualTextureContainer::getTextureLogicalWidth | ( | void | ) | const |
Returns the logical width of the texture.
uint32 VisualTextureContainer::getTextureName | ( | void | ) | const |
Returns the name/number/id of the current texture.
size_t VisualTextureContainer::getTextureWidth | ( | void | ) | const |
Returns the width of the texture.
bool VisualTextureContainer::getUseRectExtension | ( | void | ) | const |
Returns whether the texture is drawn with rectangular texture extension.
bool VisualTextureContainer::initWithARGBPixelData | ( | PixelColor * | argbPixels, |
size_t | imageWidth, | ||
size_t | imageHeight, | ||
bool | debug = false |
||
) |
Initializes a texture with a buffer of ARGB pixel data.
argbPixels | Pointer to ARGB pixel data. |
imageWidth | The width of the image data. |
imageHeight | The height of the image data. |
debug | If true, canned sample data is used. |
bool VisualTextureContainer::initWithBGRAPixelData | ( | PixelColor * | bgraPixels, |
size_t | imageWidth, | ||
size_t | imageHeight, | ||
bool | debug = false |
||
) |
Initializes a texture with a buffer of BGRA pixel data.
bgraPixels | Pointer to BGRA pixel data. |
imageWidth | The width of the image data. |
imageHeight | The height of the image data. |
debug | If true, canned sample data is used. |
bool VisualTextureContainer::initWithEncodedData | ( | const char *const | bufferData, |
size_t | size | ||
) |
Initializes a texture by passing a data pointer to encoded image data.
bufferData | A pointer to the data. |
size | The size of the data pointed to in bytes. |
bool VisualTextureContainer::initWithFile | ( | VisualFile & | aFile | ) |
Initializes a texture by passing a file.
aFile | Reference to a file. |
bool VisualTextureContainer::initWithFramebuffer | ( | const BottomLeftPositionedPixelRect & | clipRect | ) |
Creates a texture with contents of the current screen (framebuffer).
clipRect | The dimensions and position of the clip rect. |
bool VisualTextureContainer::initWithStyledString | ( | VisualStyledString & | styledString | ) |
Creates a texture of the passed string.
styledString | The styled string to plot to texture. |
VisualTextureContainer & VisualTextureContainer::operator= | ( | const VisualTextureContainer & | other | ) |
Assignment operator.
other | Reference to another VisualTextureContainer. |
void VisualTextureContainer::releaseTextureData | ( | void | ) |
Frees any resources possibly allocated for texture data.
void VisualTextureContainer::resampleTexturePixels | ( | const PixelRect & | pixelRect | ) |
Resamples the pixel data of the texture to the given dimensions of the pixelRect.
pixelRect | The resampling dimensions. |
The dimensions of the image data.
The logical size of the texture.
The name (number, id) of the texture.
The dimensions of the texture.
bool VizKit::VisualTextureContainer::useRectExtension [private] |
True if the texture is created with rectangular texture extension (npot texture).
False otherwise.