Ptex

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

`#include <PtexReader.h>`

Inheritance diagram for PtexReader::TiledFaceBase:

## Public Member Functions
| TiledFaceBase (PtexReader *reader, Res resArg, Res tileresArg)
virtual void | release ()
| Release resources held by this pointer (pointer becomes invalid).
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 FaceData * | reduce (PtexReader *, Res newres, PtexUtils::ReduceFn, size_t &newMemUsed)
Res | tileres () const
int | ntilesu () const
int | ntilesv () const
int | ntiles () const
Public Member Functions inherited from PtexReader::FaceData
| FaceData (Res resArg)
virtual | ~FaceData ()
virtual Ptex::Res | res ()
| Resolution of the texture held by this data block.
Public Member Functions inherited from PtexFaceData
virtual PtexFaceData * | getTile (int tile)=0
| Access a tile from the data block.

## Protected Member Functions
size_t | baseExtraMemUsed ()
virtual | ~TiledFaceBase ()
Protected Member Functions inherited from PtexFaceData
virtual | ~PtexFaceData ()
| Destructor not for public use. Use release() instead.

## Protected Attributes
PtexReader * | _reader
Res | _tileres
DataType | _dt
int | _nchan
int | _ntilesu
int | _ntilesv
int | _ntiles
int | _pixelsize
std::vector< FaceData * > | _tiles
Protected Attributes inherited from PtexReader::FaceData
Res | _res

## Detailed Description

Definition at line 424 of file PtexReader.h.

## Constructor & Destructor Documentation

## ◆ TiledFaceBase()

PtexReader::TiledFaceBase::TiledFaceBase | ( | PtexReader * | reader,
|  | Res | resArg,
|  | Res | tileresArg )
| inline

Definition at line 426 of file PtexReader.h.

References _dt, _nchan, _ntiles, _ntilesu, _ntilesv, _pixelsize, _reader, PtexReader::FaceData::_res, _tileres, _tiles, PtexReader::datatype(), PtexReader::FaceData::FaceData(), PtexReader::nchannels(), and PtexReader::PtexReader().

Referenced by PtexReader::TiledFace::TiledFace(), and PtexReader::TiledReducedFace::TiledReducedFace().

## ◆ ~TiledFaceBase()

virtual PtexReader::TiledFaceBase::~TiledFaceBase | ( |  | ) |
| inline protected virtual

Definition at line 455 of file PtexReader.h.

References _tiles.

## Member Function Documentation

## ◆ baseExtraMemUsed()

size_t PtexReader::TiledFaceBase::baseExtraMemUsed | ( |  | ) |
| inline protected

Definition at line 453 of file PtexReader.h.

References _tiles.

Referenced by PtexReader::TiledFace::memUsed(), and PtexReader::TiledReducedFace::memUsed().

## ◆ getData()

virtual void * PtexReader::TiledFaceBase::getData | ( |  | ) |
| inline 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.

Implements PtexFaceData.

Definition at line 443 of file PtexReader.h.

## ◆ getPixel()

void PtexReader::TiledFaceBase::getPixel | ( | int | u,
|  | int | v,
|  | void * | result )
| 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.

Implements PtexFaceData.

Definition at line 1088 of file PtexReader.cpp.

References _ntilesu, _tileres, and PtexFaceData::getTile().

## ◆ isConstant()

virtual bool PtexReader::TiledFaceBase::isConstant | ( |  | ) |
| inline virtual

True if this data block is constant.

Implements PtexFaceData.

Definition at line 441 of file PtexReader.h.

## ◆ isTiled()

virtual bool PtexReader::TiledFaceBase::isTiled | ( |  | ) |
| inline virtual

True if this data block is tiled.

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

Implements PtexFaceData.

Definition at line 444 of file PtexReader.h.

## ◆ ntiles()

int PtexReader::TiledFaceBase::ntiles | ( |  | ) | const
| inline

Definition at line 450 of file PtexReader.h.

References _ntiles.

## ◆ ntilesu()

int PtexReader::TiledFaceBase::ntilesu | ( |  | ) | const
| inline

Definition at line 448 of file PtexReader.h.

References _ntilesu.

## ◆ ntilesv()

int PtexReader::TiledFaceBase::ntilesv | ( |  | ) | const
| inline

Definition at line 449 of file PtexReader.h.

References _ntilesv.

## ◆ reduce()

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

Implements PtexReader::FaceData.

Definition at line 963 of file PtexReader.cpp.

References _dt, PtexReader::_header, _nchan, _ntiles, _ntilesu, _ntilesv, _pixelsize, _reader, PtexReader::FaceData::_res, _tileres, PtexUtils::copy(), PtexReader::FaceData::FaceData(), PtexUtils::fill(), PtexFaceData::getData(), PtexReader::getData(), PtexFaceData::getTile(), PtexFaceData::isConstant(), PtexReader::TiledReducedFace::memUsed(), Header::meshtype, PtexReader::PtexReader(), and PtexReader::release().

## ◆ release()

virtual void PtexReader::TiledFaceBase::release | ( |  | ) |
| inline virtual

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

Reimplemented from PtexReader::FaceData.

Definition at line 440 of file PtexReader.h.

## ◆ tileRes()

virtual Ptex::Res PtexReader::TiledFaceBase::tileRes | ( |  | ) |
| inline virtual

Resolution of each tile in this data block.

Implements PtexFaceData.

Definition at line 445 of file PtexReader.h.

References _tileres.

## ◆ tileres()

Res PtexReader::TiledFaceBase::tileres | ( |  | ) | const
| inline

Definition at line 447 of file PtexReader.h.

References _tileres.

## Member Data Documentation

## ◆ _dt

DataType PtexReader::TiledFaceBase::_dt
| protected

Definition at line 463 of file PtexReader.h.

Referenced by PtexReader::TiledReducedFace::getTile(), reduce(), and TiledFaceBase().

## ◆ _nchan

int PtexReader::TiledFaceBase::_nchan
| protected

Definition at line 464 of file PtexReader.h.

Referenced by PtexReader::TiledReducedFace::getTile(), reduce(), and TiledFaceBase().

## ◆ _ntiles

int PtexReader::TiledFaceBase::_ntiles
| protected

Definition at line 467 of file PtexReader.h.

Referenced by ntiles(), PtexReader::readFaceData(), reduce(), PtexReader::TiledFace::TiledFace(), and TiledFaceBase().

## ◆ _ntilesu

int PtexReader::TiledFaceBase::_ntilesu
| protected

Definition at line 465 of file PtexReader.h.

Referenced by getPixel(), PtexReader::TiledReducedFace::getTile(), ntilesu(), reduce(), and TiledFaceBase().

## ◆ _ntilesv

int PtexReader::TiledFaceBase::_ntilesv
| protected

Definition at line 466 of file PtexReader.h.

Referenced by PtexReader::TiledReducedFace::getTile(), ntilesv(), reduce(), and TiledFaceBase().

## ◆ _pixelsize

int PtexReader::TiledFaceBase::_pixelsize
| protected

Definition at line 468 of file PtexReader.h.

Referenced by PtexReader::TiledReducedFace::getTile(), reduce(), and TiledFaceBase().

## ◆ _reader

PtexReader* PtexReader::TiledFaceBase::_reader
| protected

Definition at line 461 of file PtexReader.h.

Referenced by PtexReader::TiledReducedFace::getTile(), PtexReader::TiledFace::readTile(), reduce(), and TiledFaceBase().

## ◆ _tileres

Res PtexReader::TiledFaceBase::_tileres
| protected

Definition at line 462 of file PtexReader.h.

Referenced by getPixel(), PtexReader::TiledReducedFace::getTile(), PtexReader::TiledFace::readTile(), reduce(), TiledFaceBase(), tileRes(), and tileres().

## ◆ _tiles

std::vector<FaceData*> PtexReader::TiledFaceBase::_tiles
| protected

Definition at line 469 of file PtexReader.h.

Referenced by baseExtraMemUsed(), PtexReader::TiledFace::getTile(), PtexReader::TiledReducedFace::getTile(), TiledFaceBase(), and ~TiledFaceBase().

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

- PtexReader.h
- PtexReader.cpp