Ptex
Public Member Functions | Protected Member Functions | List of all members
PtexFaceData Class Referenceabstract

Per-face texture data accessor. More...

#include <Ptexture.h>

Inheritance diagram for PtexFaceData:
PtexReader::ConstDataPtr PtexReader::FaceData PtexReader::PackedFace PtexReader::TiledFaceBase PtexReader::ConstantFace PtexReader::TiledFace PtexReader::TiledReducedFace PtexReader::ErrorFace

Public Member Functions

virtual void release ()=0
 Release resources held by this pointer (pointer becomes invalid). More...
 
virtual bool isConstant ()=0
 True if this data block is constant. More...
 
virtual Ptex::Res res ()=0
 Resolution of the texture held by this data block. More...
 
virtual void getPixel (int u, int v, void *result)=0
 Read a single texel from the data block. More...
 
virtual void * getData ()=0
 Access the data from this data block. More...
 
virtual bool isTiled ()=0
 True if this data block is tiled. More...
 
virtual Ptex::Res tileRes ()=0
 Resolution of each tile in this data block. More...
 
virtual PtexFaceDatagetTile (int tile)=0
 Access a tile from the data block. More...
 

Protected Member Functions

virtual ~PtexFaceData ()
 Destructor not for public use. Use release() instead. More...
 

Detailed Description

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.

Definition at line 419 of file Ptexture.h.

Constructor & Destructor Documentation

◆ ~PtexFaceData()

virtual PtexFaceData::~PtexFaceData ( )
inlineprotectedvirtual

Destructor not for public use. Use release() instead.

Definition at line 422 of file Ptexture.h.

Member Function Documentation

◆ getData()

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.

Implemented in PtexReader::TiledFaceBase, PtexReader::PackedFace, and PtexReader::ConstDataPtr.

Referenced by PtexSeparableFilter::apply(), PtexTriangleFilter::applyIter(), PtexSeparableFilter::eval(), PtexTriangleFilter::eval(), PtexMainWriter::finish(), PtexReader::getData(), PtexReader::TiledReducedFace::getTile(), and PtexReader::TiledFaceBase::reduce().

◆ getPixel()

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.

Implemented in PtexReader::ConstantFace, PtexReader::ConstDataPtr, PtexReader::TiledFaceBase, and PtexReader::PackedFace.

Referenced by PtexReader::getPixel(), and PtexReader::TiledFaceBase::getPixel().

◆ getTile()

virtual PtexFaceData* PtexFaceData::getTile ( int  tile)
pure virtual

◆ isConstant()

virtual bool PtexFaceData::isConstant ( )
pure virtual

◆ isTiled()

virtual bool PtexFaceData::isTiled ( )
pure virtual

True if this data block is tiled.

If tiled, the data must be access per-tile via getTile().

Implemented in PtexReader::TiledFaceBase, PtexReader::PackedFace, and PtexReader::ConstDataPtr.

Referenced by PtexSeparableFilter::apply(), PtexTriangleFilter::applyIter(), and PtexReader::getData().

◆ release()

virtual void PtexFaceData::release ( )
pure virtual

Release resources held by this pointer (pointer becomes invalid).

Implemented in PtexReader::TiledFaceBase, PtexReader::ErrorFace, PtexReader::FaceData, and PtexReader::ConstDataPtr.

◆ res()

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.

Implemented in PtexReader::FaceData, and PtexReader::ConstDataPtr.

◆ tileRes()

virtual Ptex::Res PtexFaceData::tileRes ( )
pure virtual

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