Ptex

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

`#include <PtexReader.h>`

Inheritance diagram for PtexReader::ConstDataPtr:

## 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 PtexFaceData * | getTile (int)
| 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 348 of file PtexReader.h.

## Constructor & Destructor Documentation

## ◆ ConstDataPtr()

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

Definition at line 350 of file PtexReader.h.

References _data, _pixelsize, and PtexReader::pixelsize().

## Member Function Documentation

## ◆ getData()

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

References _data.

## ◆ getPixel()

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

Definition at line 355 of file PtexReader.h.

References _data, and _pixelsize.

## ◆ getTile()

virtual PtexFaceData * PtexReader::ConstDataPtr::getTile | ( | int | tile | ) |
| inline virtual

Access a tile from the data block.

Tiles are accessed in v-major order.

Implements PtexFaceData.

Definition at line 360 of file PtexReader.h.

## ◆ isConstant()

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

True if this data block is constant.

Implements PtexFaceData.

Definition at line 354 of file PtexReader.h.

## ◆ isTiled()

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

## ◆ release()

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

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

Implements PtexFaceData.

Definition at line 352 of file PtexReader.h.

## ◆ res()

virtual Ptex::Res PtexReader::ConstDataPtr::res | ( |  | ) |
| inline 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.

Implements PtexFaceData.

Definition at line 353 of file PtexReader.h.

## ◆ tileRes()

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

Resolution of each tile in this data block.

Implements PtexFaceData.

Definition at line 359 of file PtexReader.h.

## Member Data Documentation

## ◆ _data

void* PtexReader::ConstDataPtr::_data
| protected

Definition at line 363 of file PtexReader.h.

Referenced by ConstDataPtr(), getData(), and getPixel().

## ◆ _pixelsize

int PtexReader::ConstDataPtr::_pixelsize
| protected

Definition at line 364 of file PtexReader.h.

Referenced by ConstDataPtr(), and getPixel().

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

- PtexReader.h