Ptex: Ptex Namespace Reference

Ptex

Classes | Enumerations | Functions
Ptex Namespace Reference

Common data structures and enums used throughout the API. More...

## Classes
struct | Res
| Pixel resolution of a given texture. More...
struct | FaceInfo
| Information about a face, as stored in the Ptex file header. More...
class | String
| Memory-managed string. More...

## Enumerations
enum | MeshType { mt_triangle , mt_quad }
| Type of base mesh for which the textures are defined. More...
enum | DataType { dt_uint8 , dt_uint16 , dt_half , dt_float }
| Type of data stored in texture file. More...
enum | EdgeFilterMode { efm_none , efm_tanvec }
| How to handle transformation across edges when filtering. More...
enum | BorderMode { m_clamp , m_black , m_periodic }
| How to handle mesh border when filtering. More...
enum | EdgeId { e_bottom , e_right , e_top , e_left }
| Edge IDs used in adjacency data in the Ptex::FaceInfo struct. More...
enum | MetaDataType { mdt_string , mdt_int8 , mdt_int16 , mdt_int32 , mdt_float , mdt_double }
| Type of meta data entry. More...

## Functions
const char * | MeshTypeName (MeshType mt)
| Look up name of given mesh type.
const char * | DataTypeName (DataType dt)
| Look up name of given data type.
const char * | BorderModeName (BorderMode m)
| Look up name of given border mode.
const char * | EdgeFilterModeName (EdgeFilterMode m)
| Look up name of given edge filter mode.
const char * | EdgeIdName (EdgeId eid)
| Look up name of given edge ID.
const char * | MetaDataTypeName (MetaDataType mdt)
| Look up name of given meta data type.
int | DataSize (DataType dt)
| Look up size of given data type (in bytes).
float | OneValue (DataType dt)
| Look up value of given data type that corresponds to the normalized value of 1.0.
float | OneValueInv (DataType dt)
| Lookup up inverse value of given data type that corresponds to the normalized value of 1.0.
void | ConvertToFloat (float *dst, const void *src, Ptex::DataType dt, int numChannels)
| Convert a number of data values from the given data type to float.
void | ConvertFromFloat (void *dst, const float *src, Ptex::DataType dt, int numChannels)
| Convert a number of data values from float to the given data type.
std::ostream & | operator<< (std::ostream &stream, const Ptex::String &str)
| std::stream output operator.

## Detailed Description

Common data structures and enums used throughout the API.

## Enumeration Type Documentation

## ◆ BorderMode

enum Ptex::BorderMode

How to handle mesh border when filtering.

Enumerator
m_clamp | texel access is clamped to border
m_black | texel beyond border are assumed to be black
m_periodic | texel access wraps to other side of face

Definition at line 86 of file Ptexture.h.

## ◆ DataType

enum Ptex::DataType

Type of data stored in texture file.

Enumerator
dt_uint8 | Unsigned, 8-bit integer.
dt_uint16 | Unsigned, 16-bit integer.
dt_half | Half-precision (16-bit) floating point.
dt_float | Single-precision (32-bit) floating point.

Definition at line 72 of file Ptexture.h.

## ◆ EdgeFilterMode

enum Ptex::EdgeFilterMode

How to handle transformation across edges when filtering.

Enumerator
efm_none | Don't do anything with the values.
efm_tanvec | Values are vectors in tangent space; rotate values.

Definition at line 80 of file Ptexture.h.

## ◆ EdgeId

enum Ptex::EdgeId

Edge IDs used in adjacency data in the Ptex::FaceInfo struct.

Edge ID usage for triangle meshes is TBD.

Enumerator
e_bottom | Bottom edge, from UV (0,0) to (1,0).
e_right | Right edge, from UV (1,0) to (1,1).
e_top | Top edge, from UV (1,1) to (0,1).
e_left | Left edge, from UV (0,1) to (0,0).

Definition at line 94 of file Ptexture.h.

## ◆ MeshType

enum Ptex::MeshType

Type of base mesh for which the textures are defined.

A mesh can be triangle-based (with triangular textures) or quad-based (with rectangular textures).

Enumerator
mt_triangle | Mesh is triangle-based.
mt_quad | Mesh is quad-based.

Definition at line 66 of file Ptexture.h.

## ◆ MetaDataType

enum Ptex::MetaDataType

Type of meta data entry.

Enumerator
mdt_string | Null-terminated string.
mdt_int8 | Signed 8-bit integer.
mdt_int16 | Signed 16-bit integer.
mdt_int32 | Signed 32-bit integer.
mdt_float | Single-precision (32-bit) floating point.
mdt_double | Double-precision (32-bit) floating point.

Definition at line 102 of file Ptexture.h.

## Function Documentation

## ◆ BorderModeName()

const char * Ptex::BorderModeName | ( | BorderMode | m | ) |

Look up name of given border mode.

References BorderModeName(), and PTEXAPI.

Referenced by BorderModeName().

## ◆ ConvertFromFloat()

void Ptex::ConvertFromFloat | ( | void * | dst,
|  | const float * | src,
|  | Ptex::DataType | dt,
|  | int | numChannels )

Convert a number of data values from float to the given data type.

References ConvertFromFloat(), and PTEXAPI.

Referenced by ConvertFromFloat().

## ◆ ConvertToFloat()

void Ptex::ConvertToFloat | ( | float * | dst,
|  | const void * | src,
|  | Ptex::DataType | dt,
|  | int | numChannels )

Convert a number of data values from the given data type to float.

References ConvertToFloat(), and PTEXAPI.

Referenced by ConvertToFloat(), PtexSeparableFilter::eval(), and PtexTriangleFilter::eval().

## ◆ DataSize()

int Ptex::DataSize | ( | DataType | dt | ) |
| inline

Look up size of given data type (in bytes).

Definition at line 130 of file Ptexture.h.

References DataSize().

Referenced by DataSize().

## ◆ DataTypeName()

const char * Ptex::DataTypeName | ( | DataType | dt | ) |

Look up name of given data type.

References DataTypeName(), and PTEXAPI.

Referenced by DataTypeName().

## ◆ EdgeFilterModeName()

const char * Ptex::EdgeFilterModeName | ( | EdgeFilterMode | m | ) |

Look up name of given edge filter mode.

References EdgeFilterModeName(), and PTEXAPI.

Referenced by EdgeFilterModeName().

## ◆ EdgeIdName()

const char * Ptex::EdgeIdName | ( | EdgeId | eid | ) |

Look up name of given edge ID.

References EdgeIdName(), and PTEXAPI.

Referenced by EdgeIdName().

## ◆ MeshTypeName()

const char * Ptex::MeshTypeName | ( | MeshType | mt | ) |

Look up name of given mesh type.

References MeshTypeName(), and PTEXAPI.

Referenced by MeshTypeName().

## ◆ MetaDataTypeName()

const char * Ptex::MetaDataTypeName | ( | MetaDataType | mdt | ) |

Look up name of given meta data type.

References MetaDataTypeName(), and PTEXAPI.

Referenced by MetaDataTypeName().

## ◆ OneValue()

float Ptex::OneValue | ( | DataType | dt | ) |
| inline

Look up value of given data type that corresponds to the normalized value of 1.0.

Definition at line 136 of file Ptexture.h.

References OneValue().

Referenced by OneValue().

## ◆ OneValueInv()

float Ptex::OneValueInv | ( | DataType | dt | ) |
| inline

Lookup up inverse value of given data type that corresponds to the normalized value of 1.0.

Definition at line 142 of file Ptexture.h.

References OneValueInv().

Referenced by OneValueInv().