PtexFaceData Class Referenceabstract

Per-face texture data accessor. More...

`#include <Ptexture.h>`

Inheritance diagram for PtexFaceData:

## Public Member Functions

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 PtexFaceData * | getTile (int tile)=0
| Access a tile from the data block.

## Protected Member Functions

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

## 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 406 of file Ptexture.h.

## Constructor & Destructor Documentation

## ~PtexFaceData()

virtual PtexFaceData::~PtexFaceData | ( |  | ) |

inlineprotectedvirtual

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

Definition at line 409 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::ConstDataPtr, PtexReader::PackedFace, and PtexReader::TiledFaceBase.

Referenced by PtexTriangleFilter::applyIter(), 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::PackedFace, PtexReader::TiledFaceBase, PtexReader::ConstDataPtr, and PtexReader::ConstantFace.

## getTile()

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

pure virtual

Access a tile from the data block.

Tiles are accessed in v-major order.

Implemented in PtexReader::TiledFace, PtexReader::TiledReducedFace, PtexReader::ConstDataPtr, and PtexReader::PackedFace.

Referenced by PtexTriangleFilter::applyIter(), and PtexReader::TiledReducedFace::getTile().

## isConstant()

virtual bool PtexFaceData::isConstant | ( |  | ) |

pure virtual

True if this data block is constant.

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

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

## 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::ConstDataPtr, PtexReader::PackedFace, and PtexReader::TiledFaceBase.

Referenced by PtexTriangleFilter::applyIter().

## release()

virtual void PtexFaceData::release | ( |  | ) |

pure virtual

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

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

## 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::ConstDataPtr, and PtexReader::FaceData.

## tileRes()

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

pure virtual

Resolution of each tile in this data block.

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

Referenced by PtexTriangleFilter::applyIter().

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

- Ptexture.h