Ptex
Public Member Functions | Protected Attributes | List of all members
PtexReader::ConstDataPtr Class Reference

#include <PtexReader.h>

Inheritance diagram for PtexReader::ConstDataPtr:
PtexFaceData

Public Member Functions

 ConstDataPtr (void *data, int pixelsize)
 
virtual void release ()
 Release resources held by this pointer (pointer becomes invalid).
 
virtual Ptex::Res res ()
 Resolution of the texture held by this data block.
 
virtual bool isConstant ()
 True if this data block is constant.
 
virtual void getPixel (int, int, void *result)
 Read a single texel from the data block.
 
virtual void * getData ()
 Access the data from this data block.
 
virtual bool isTiled ()
 True if this data block is tiled.
 
virtual Ptex::Res tileRes ()
 Resolution of each tile in this data block.
 
virtual PtexFaceDatagetTile (int)
 Access a tile from the data block.
 
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 PtexFaceDatagetTile (int tile)=0
 Access a tile from the data block.
 

Protected Attributes

void * _data
 
int _pixelsize
 

Additional Inherited Members

- Protected Member Functions inherited from PtexFaceData
virtual ~PtexFaceData ()
 Destructor not for public use. Use release() instead.
 

Detailed Description

Definition at line 345 of file PtexReader.h.

Constructor & Destructor Documentation

◆ ConstDataPtr()

PtexReader::ConstDataPtr::ConstDataPtr ( void *  data,
int  pixelsize 
)
inline

Definition at line 347 of file PtexReader.h.

Member Function Documentation

◆ getData()

virtual void * PtexReader::ConstDataPtr::getData ( )
inlinevirtual

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.

Implements PtexFaceData.

Definition at line 354 of file PtexReader.h.

References _data.

◆ getPixel()

virtual void PtexReader::ConstDataPtr::getPixel ( int  u,
int  v,
void *  result 
)
inlinevirtual

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.

Implements PtexFaceData.

Definition at line 352 of file PtexReader.h.

References _data, and _pixelsize.

◆ getTile()

virtual PtexFaceData * PtexReader::ConstDataPtr::getTile ( int  tile)
inlinevirtual

Access a tile from the data block.

Tiles are accessed in v-major order.

Implements PtexFaceData.

Definition at line 357 of file PtexReader.h.

◆ isConstant()

virtual bool PtexReader::ConstDataPtr::isConstant ( )
inlinevirtual

True if this data block is constant.

Implements PtexFaceData.

Definition at line 351 of file PtexReader.h.

◆ isTiled()

virtual bool PtexReader::ConstDataPtr::isTiled ( )
inlinevirtual

True if this data block is tiled.

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

Implements PtexFaceData.

Definition at line 355 of file PtexReader.h.

◆ release()

virtual void PtexReader::ConstDataPtr::release ( )
inlinevirtual

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

Implements PtexFaceData.

Definition at line 349 of file PtexReader.h.

◆ res()

virtual Ptex::Res PtexReader::ConstDataPtr::res ( )
inlinevirtual

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.

Implements PtexFaceData.

Definition at line 350 of file PtexReader.h.

◆ tileRes()

virtual Ptex::Res PtexReader::ConstDataPtr::tileRes ( )
inlinevirtual

Resolution of each tile in this data block.

Implements PtexFaceData.

Definition at line 356 of file PtexReader.h.

Member Data Documentation

◆ _data

void* PtexReader::ConstDataPtr::_data
protected

Definition at line 360 of file PtexReader.h.

Referenced by getData(), and getPixel().

◆ _pixelsize

int PtexReader::ConstDataPtr::_pixelsize
protected

Definition at line 361 of file PtexReader.h.

Referenced by getPixel().


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