|
virtual void | release ()=0 |
| Release resources held by this pointer (pointer becomes invalid).
|
|
virtual const char * | path ()=0 |
| Path that file was opened with. More...
|
|
virtual Ptex::MeshType | meshType ()=0 |
| Type of mesh for which texture data is defined. More...
|
|
virtual Ptex::DataType | dataType ()=0 |
| Type of data stored in file. More...
|
|
virtual Ptex::BorderMode | uBorderMode ()=0 |
| Mode for filtering texture access beyond mesh border. More...
|
|
virtual Ptex::BorderMode | vBorderMode ()=0 |
| Mode for filtering texture access beyond mesh border. More...
|
|
virtual int | alphaChannel ()=0 |
| Index of alpha channel (if any). More...
|
|
virtual int | numChannels ()=0 |
| Number of channels stored in file. More...
|
|
virtual int | numFaces ()=0 |
| Number of faces stored in file. More...
|
|
virtual bool | hasEdits ()=0 |
| True if the file has edit blocks. More...
|
|
virtual bool | hasMipMaps ()=0 |
| True if the file has mipmaps. More...
|
|
virtual PtexMetaData * | getMetaData ()=0 |
| Access meta data. More...
|
|
virtual const Ptex::FaceInfo & | getFaceInfo (int faceid)=0 |
| Access resolution and adjacency information about a face. More...
|
|
virtual void | getData (int faceid, void *buffer, int stride)=0 |
| Access texture data for a face at highest-resolution. More...
|
|
virtual void | getData (int faceid, void *buffer, int stride, Ptex::Res res)=0 |
| Access texture data for a face at a specific resolution. More...
|
|
virtual PtexFaceData * | getData (int faceid)=0 |
| Access texture data for a face at highest-resolution as stored on disk. More...
|
|
virtual PtexFaceData * | getData (int faceid, Ptex::Res res)=0 |
| Access texture data for a face at a specific resolution as stored on disk. More...
|
|
virtual void | getPixel (int faceid, int u, int v, float *result, int firstchan, int nchannels)=0 |
| Access a single texel from the highest resolution texture . More...
|
|
virtual void | getPixel (int faceid, int u, int v, float *result, int firstchan, int nchannels, Ptex::Res res)=0 |
| Access a single texel for a face at a particular resolution. More...
|
|
Interface for reading data from a ptex file.
PtexTexture instances can be acquired via the static open() method, or via the PtexCache interface.
Data access through this interface is returned in v-major order with all data channels interleaved per texel.
virtual void PtexTexture::getData |
( |
int |
faceid, |
|
|
void * |
buffer, |
|
|
int |
stride |
|
) |
| |
|
pure virtual |
Access texture data for a face at highest-resolution.
The texture data is copied into the user-supplied buffer. The buffer must be at least this size (in bytes): DataSize(dataType()) * numChannels() * getFaceInfo(faceid).res.size().
If a stride is given, then (stride-row_length) bytes will be skipped after each row. If stride is zero, then no bytes will be skipped. Note: the image can be flipped vertically by using an appropriate negative stride value.
- Parameters
-
faceid | Face index [0..numFaces-1] |
buffer | User-supplied buffer |
stride | Size of each row in user buffer (in bytes) |
virtual void PtexTexture::getData |
( |
int |
faceid, |
|
|
void * |
buffer, |
|
|
int |
stride, |
|
|
Ptex::Res |
res |
|
) |
| |
|
pure virtual |
Access texture data for a face at a specific resolution.
The specified resolution may be lower than the full resolution for the face. If it is lower, then the texture data is accessed from the stored mip-maps. If the requested resolution doesn't match a stored resolution, the desired resolution will be generated from the nearest available resolution.
See previous getData() method for interface details.
virtual void PtexTexture::getPixel |
( |
int |
faceid, |
|
|
int |
u, |
|
|
int |
v, |
|
|
float * |
result, |
|
|
int |
firstchan, |
|
|
int |
nchannels, |
|
|
Ptex::Res |
res |
|
) |
| |
|
pure virtual |
Access a single texel for a face at a particular resolution.
The specified resolution may be lower (but not higher) than the full resolution for the face. If it is lower, then the texture data is accessed from the stored mip-maps. If the requested resolution doesn't match a stored resolution, the desired resolution will be generated from the nearest available resolution.
See previous getPixel() method for details.
Open a ptex file for reading.
If an error occurs, an error message will be stored in the error string param and the a pointer will be returned.
If the premultiply param is set to true and the texture file has a specified alpha channel, then all data stored in the file will be multiplied by alpha when read from disk. If premultiply is false, then the full-resolution textures will be returned as stored on disk which is assumed to be unmultiplied. Reductions (both stored mip-maps and dynamically generated reductions) are always premultiplied with alpha. See PtexWriter for more information about alpha channels.