PtexReader::PackedFace Class Reference

`#include <PtexReader.h>`

Inheritance diagram for PtexReader::PackedFace:

## 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 PtexFaceData * | getTile (int)
| Access a tile from the data block.
virtual FaceData * | reduce (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.

## 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 | ( |  | ) |

inline protected virtual

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 | ( |  | ) |

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 388 of file PtexReader.h.

References _data.

## getPixel()

virtual void PtexReader::PackedFace::getPixel | ( | int | u,
|  | int | v,
|  | void * | result )

inline 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.

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 | ) |

inline virtual

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 | ( |  | ) |

inline virtual

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 | ( |  | ) |

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 389 of file PtexReader.h.

## reduce()

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

virtual

Implements PtexReader::FaceData.

Reimplemented in PtexReader::ConstantFace.

Definition at line 949 of file PtexReader.cpp.

References _data, PtexReader::_pixelsize, PtexReader::datatype(), and PtexReader::nchannels().

## tileRes()

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

inline virtual

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

Definition at line 398 of file PtexReader.h.

Referenced by data(), PtexReader::ErrorFace::ErrorFace(), getData(), PtexReader::ConstantFace::getPixel(), getPixel(), PtexReader::ConstantFace::reduce(), reduce(), and ~PackedFace().

## _pixelsize

int PtexReader::PackedFace::_pixelsize

protected

Definition at line 397 of file PtexReader.h.

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

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

- PtexReader.h
- PtexReader.cpp