Ptex
|
Interface for reading data from a ptex file. More...
#include <Ptexture.h>
Classes | |
struct | Info |
Get most commonly used info in a single call for convenience / efficiency. More... | |
Public Member Functions | |
virtual void | release ()=0 |
Release resources held by this pointer (pointer becomes invalid). | |
virtual const char * | path ()=0 |
Path that file was opened with. | |
virtual Info | getInfo ()=0 |
virtual Ptex::MeshType | meshType ()=0 |
Type of mesh for which texture data is defined. | |
virtual Ptex::DataType | dataType ()=0 |
Type of data stored in file. | |
virtual Ptex::BorderMode | uBorderMode ()=0 |
Mode for filtering texture access beyond mesh border. | |
virtual Ptex::BorderMode | vBorderMode ()=0 |
Mode for filtering texture access beyond mesh border. | |
virtual Ptex::EdgeFilterMode | edgeFilterMode ()=0 |
Mode for filtering textures across edges. | |
virtual int | alphaChannel ()=0 |
Index of alpha channel (if any). | |
virtual int | numChannels ()=0 |
Number of channels stored in file. | |
virtual int | numFaces ()=0 |
Number of faces stored in file. | |
virtual bool | hasEdits ()=0 |
True if the file has edit blocks. | |
virtual bool | hasMipMaps ()=0 |
True if the file has mipmaps. | |
virtual PtexMetaData * | getMetaData ()=0 |
Access meta data. | |
virtual const Ptex::FaceInfo & | getFaceInfo (int faceid)=0 |
Access resolution and adjacency information about a face. | |
virtual void | getData (int faceid, void *buffer, int stride)=0 |
Access texture data for a face at highest-resolution. | |
virtual void | getData (int faceid, void *buffer, int stride, Ptex::Res res)=0 |
Access texture data for a face at a specific resolution. | |
virtual PtexFaceData * | getData (int faceid)=0 |
Access texture data for a face at highest-resolution as stored on disk. | |
virtual PtexFaceData * | getData (int faceid, Ptex::Res res)=0 |
Access texture data for a face at a specific resolution as stored on disk. | |
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 . | |
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. | |
Static Public Member Functions | |
static PtexTexture * | open (const char *path, Ptex::String &error, bool premultiply=0) |
Open a ptex file for reading. | |
Protected Member Functions | |
virtual | ~PtexTexture () |
Destructor not for public use. Use release() instead. | |
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.
Definition at line 457 of file Ptexture.h.
|
inlineprotectedvirtual |
Destructor not for public use. Use release() instead.
Definition at line 460 of file Ptexture.h.
|
pure virtual |
Index of alpha channel (if any).
One channel in the file can be flagged to be the alpha channel. If no channel is acting as the alpha channel, -1 is returned. See PtexWriter for more details.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits(), and PtexWriter::edit().
|
pure virtual |
Type of data stored in file.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits(), PtexWriter::edit(), and PtexTriangleFilter::eval().
|
pure virtual |
Mode for filtering textures across edges.
Implemented in PtexReader.
Referenced by PtexMainWriter::PtexMainWriter().
|
pure virtual |
Access texture data for a face at highest-resolution as stored on disk.
Implemented in PtexReader.
|
pure virtual |
Access texture data for a face at a specific resolution as stored on disk.
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.
|
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.
faceid | Face index [0..numFaces-1] |
buffer | User-supplied buffer |
stride | Size of each row in user buffer (in bytes) |
Implemented in PtexReader.
Referenced by PtexSeparableFilter::apply(), PtexTriangleFilter::apply(), PtexSeparableFilter::eval(), and PtexTriangleFilter::eval().
|
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.
|
pure virtual |
Access resolution and adjacency information about a face.
Implemented in PtexReader.
Referenced by PtexSeparableFilter::applyAcrossEdge(), PtexTriangleFilter::applyAcrossEdge(), PtexSeparableFilter::applyToCorner(), PtexSeparableFilter::eval(), PtexTriangleFilter::eval(), PtexPointFilter::eval(), and PtexPointFilterTri::eval().
|
pure virtual |
Implemented in PtexReader.
|
pure virtual |
Access meta data.
Implemented in PtexReader.
|
pure virtual |
Access a single texel from the highest resolution texture .
The texel data is converted to floating point (integer types are normalized 0.0 to 1.0). A subset of the available channels may be accessed.
faceid | Face index [0..numFaces-1] |
u | U coordinate [0..ures-1] |
v | V coordinate [0..vres-1] |
result | Result data |
firstchan | First channel to access [0..numChannels-1] |
nchannels | Number of channels to access. |
Implemented in PtexReader.
Referenced by PtexPointFilter::eval(), and PtexPointFilterTri::eval().
|
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.
Implemented in PtexReader.
|
pure virtual |
True if the file has edit blocks.
See PtexWriter for more details.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits().
|
pure virtual |
True if the file has mipmaps.
See PtexWriter for more details.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits().
|
pure virtual |
Type of mesh for which texture data is defined.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits(), PtexWriter::edit(), and PtexFilter::getFilter().
|
pure virtual |
Number of channels stored in file.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits(), PtexWriter::edit(), and PtexTriangleFilter::eval().
|
pure virtual |
Number of faces stored in file.
Implemented in PtexReader.
Referenced by PtexWriter::applyEdits(), PtexWriter::edit(), PtexSeparableFilter::eval(), PtexTriangleFilter::eval(), PtexPointFilter::eval(), and PtexPointFilterTri::eval().
|
static |
Open a ptex file for reading.
If an error occurs, an error message will be stored in the error string param and a null 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.
Definition at line 59 of file PtexReader.cpp.
References PtexReader::open(), path(), and PtexReader::release().
Referenced by PtexWriter::applyEdits(), and PtexWriter::edit().
|
pure virtual |
Path that file was opened with.
If the file was opened using a search path (via PtexCache), the the path will be the path as found in the search path. Otherwise, the path will be the path as supplied to open.
Implemented in PtexReader.
Referenced by open().
|
pure virtual |
Release resources held by this pointer (pointer becomes invalid).
Implemented in PtexCachedReader, and PtexReader.
|
pure virtual |
Mode for filtering texture access beyond mesh border.
Implemented in PtexReader.
Referenced by PtexMainWriter::PtexMainWriter().
|
pure virtual |
Mode for filtering texture access beyond mesh border.
Implemented in PtexReader.
Referenced by PtexMainWriter::PtexMainWriter().