Ptex
|
Per-face texture data accessor. More...
#include <Ptexture.h>
Public Member Functions | |
virtual void | release ()=0 |
Release resources held by this pointer (pointer becomes invalid). | |
virtual bool | isConstant ()=0 |
True if this data block is constant. | |
virtual Ptex::Res | res ()=0 |
Resolution of the texture held by this data block. | |
virtual void | getPixel (int u, int v, void *result)=0 |
Read a single texel from the data block. | |
virtual void * | getData ()=0 |
Access the data from this data block. | |
virtual bool | isTiled ()=0 |
True if this data block is tiled. | |
virtual Ptex::Res | tileRes ()=0 |
Resolution of each tile in this data block. | |
virtual PtexFaceData * | getTile (int tile)=0 |
Access a tile from the data block. | |
Protected Member Functions | |
virtual | ~PtexFaceData () |
Destructor not for public use. Use release() instead. |
Per-face texture data accessor.
Per-face texture data is acquired from PtexTexture and accessed through this interface. This interface provides low-level access to the data as stored on disk for maximum efficiency. If this isn't needed, face data can be more conveniently read directly from PtexTexture.
virtual void* PtexFaceData::getData | ( | ) | [pure virtual] |
Access the data from this data block.
If the data block is constant, getData will return a pointer to a single texel's data value.
If the data block is tiled, then getData will return null and the data must be accessed per-tile via the getTile() function.
virtual void PtexFaceData::getPixel | ( | int | u, |
int | v, | ||
void * | result | ||
) | [pure virtual] |
Read a single texel from the data block.
The texel coordinates, u and v, have a range of [0..ures-1, 0..vres-1]. Note: this method will work correctly even if the face is constant or tiled.
virtual PtexFaceData* PtexFaceData::getTile | ( | int | tile | ) | [pure virtual] |
Access a tile from the data block.
Tiles are accessed in v-major order.
virtual bool PtexFaceData::isConstant | ( | ) | [pure virtual] |
True if this data block is constant.
virtual bool PtexFaceData::isTiled | ( | ) | [pure virtual] |
True if this data block is tiled.
If tiled, the data must be access per-tile via getTile().
virtual Ptex::Res PtexFaceData::res | ( | ) | [pure virtual] |
Resolution of the texture held by this data block.
Note: the indicated texture res may be larger than 1x1 even if the texture data is constant.
virtual Ptex::Res PtexFaceData::tileRes | ( | ) | [pure virtual] |
Resolution of each tile in this data block.