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

#include <PtexReader.h>

Inheritance diagram for PtexReader::PackedFace:
PtexReader::FaceData PtexFaceData PtexReader::ConstantFace PtexReader::ErrorFace

Public Member Functions

 PackedFace (Res resArg, int pixelsize, int size)
 
void * data ()
 
virtual bool isConstant ()
 True if this data block is constant.
 
virtual void getPixel (int u, int v, 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 FaceDatareduce (PtexReader *, Res newres, PtexUtils::ReduceFn, size_t &newMemUsed)
 
- Public Member Functions inherited from PtexReader::FaceData
 FaceData (Res resArg)
 
virtual ~FaceData ()
 
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 FaceDatareduce (PtexReader *, Res newres, PtexUtils::ReduceFn, size_t &newMemUsed)=0
 
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 Member Functions

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

Protected Attributes

int _pixelsize
 
char * _data
 
- Protected Attributes inherited from PtexReader::FaceData
Res _res
 

Detailed Description

Definition at line 377 of file PtexReader.h.

Constructor & Destructor Documentation

◆ PackedFace()

PtexReader::PackedFace::PackedFace ( Res  resArg,
int  pixelsize,
int  size 
)
inline

Definition at line 379 of file PtexReader.h.

◆ ~PackedFace()

virtual PtexReader::PackedFace::~PackedFace ( )
inlineprotectedvirtual

Definition at line 395 of file PtexReader.h.

References _data.

Member Function Documentation

◆ data()

void * PtexReader::PackedFace::data ( )
inline

Definition at line 382 of file PtexReader.h.

References _data.

Referenced by PtexReader::readFaceData().

◆ getData()

virtual void * PtexReader::PackedFace::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 388 of file PtexReader.h.

References _data.

◆ getPixel()

virtual void PtexReader::PackedFace::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.

Reimplemented in PtexReader::ConstantFace.

Definition at line 384 of file PtexReader.h.

References _data, _pixelsize, and PtexReader::FaceData::_res.

◆ getTile()

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

Access a tile from the data block.

Tiles are accessed in v-major order.

Implements PtexFaceData.

Definition at line 391 of file PtexReader.h.

◆ isConstant()

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

True if this data block is constant.

Implements PtexFaceData.

Reimplemented in PtexReader::ConstantFace.

Definition at line 383 of file PtexReader.h.

◆ isTiled()

virtual bool PtexReader::PackedFace::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 389 of file PtexReader.h.

◆ reduce()

PtexReader::FaceData * PtexReader::PackedFace::reduce ( PtexReader r,
Res  newres,
PtexUtils::ReduceFn  reducefn,
size_t &  newMemUsed 
)
virtual

◆ tileRes()

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

Resolution of each tile in this data block.

Implements PtexFaceData.

Definition at line 390 of file PtexReader.h.

References PtexReader::FaceData::_res.

Member Data Documentation

◆ _data

char* PtexReader::PackedFace::_data
protected

◆ _pixelsize

int PtexReader::PackedFace::_pixelsize
protected

Definition at line 397 of file PtexReader.h.

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


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