Ptex
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
PtexUtils Struct Reference

#include <PtexUtils.h>

Inheritance diagram for PtexUtils:
Ptex

Classes

struct  VecAccum
 
struct  VecAccum< T, 0 >
 
struct  VecAccumN
 
struct  VecMult
 
struct  VecMult< T, 0 >
 
struct  VecMultN
 

Public Types

typedef void ReduceFn(const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
typedef void(* ApplyConstFn) (float weight, float *dst, void *data, int nChan)
 
- Public Types inherited from Ptex
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  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...
 

Static Public Member Functions

static bool isPowerOfTwo (int x)
 
static uint32_t ones (uint32_t x)
 
static uint32_t floor_log2 (uint32_t x)
 
static uint32_t ceil_log2 (uint32_t x)
 
static int calcResFromWidth (float w)
 
static float smoothstep (float x, float a, float b)
 
static float qsmoothstep (float x, float a, float b)
 
template<typename T >
static T cond (bool c, T a, T b)
 
template<typename T >
static T min (T a, T b)
 
template<typename T >
static T max (T a, T b)
 
template<typename T >
static T clamp (T x, T lo, T hi)
 
static bool isConstant (const void *data, int stride, int ures, int vres, int pixelSize)
 
static void interleave (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void deinterleave (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void encodeDifference (void *data, int size, DataType dt)
 
static void decodeDifference (void *data, int size, DataType dt)
 
static void reduce (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void reduceu (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void reducev (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void reduceTri (const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)
 
static void average (const void *src, int sstride, int ures, int vres, void *dst, DataType dt, int nchannels)
 
static void fill (const void *src, void *dst, int dstride, int ures, int vres, int pixelsize)
 
static void copy (const void *src, int sstride, void *dst, int dstride, int nrows, int rowlen)
 
static void blend (const void *src, float weight, void *dst, bool flip, int rowlen, DataType dt, int nchannels)
 
static void multalpha (void *data, int npixels, DataType dt, int nchannels, int alphachan)
 
static void divalpha (void *data, int npixels, DataType dt, int nchannels, int alphachan)
 
static void genRfaceids (const FaceInfo *faces, int nfaces, uint32_t *rfaceids, uint32_t *faceids)
 
static void applyConst (float weight, float *dst, void *data, Ptex::DataType dt, int nChan)
 
- Static Public Member Functions inherited from Ptex
static const char * MeshTypeName (MeshType mt)
 Look up name of given mesh type. More...
 
static const char * DataTypeName (DataType dt)
 Look up name of given data type. More...
 
static const char * BorderModeName (BorderMode m)
 Look up name of given border mode. More...
 
static const char * EdgeIdName (EdgeId eid)
 Look up name of given edge ID. More...
 
static const char * MetaDataTypeName (MetaDataType mdt)
 Look up name of given meta data type. More...
 
static int DataSize (DataType dt)
 Look up size of given data type (in bytes). More...
 
static float OneValue (DataType dt)
 Look up value of given data type that corresponds to the normalized value of 1.0. More...
 
static float OneValueInv (DataType dt)
 Lookup up inverse value of given data type that corresponds to the normalized value of 1.0. More...
 
static 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. More...
 
static 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. More...
 

Static Public Attributes

static ApplyConstFn applyConstFunctions [20]
 

Detailed Description

Definition at line 41 of file PtexUtils.h.

Member Typedef Documentation

typedef void(* PtexUtils::ApplyConstFn) (float weight, float *dst, void *data, int nChan)

Definition at line 202 of file PtexUtils.h.

typedef void PtexUtils::ReduceFn(const void *src, int sstride, int ures, int vres, void *dst, int dstride, DataType dt, int nchannels)

Definition at line 132 of file PtexUtils.h.

Member Function Documentation

static void PtexUtils::applyConst ( float  weight,
float *  dst,
void *  data,
Ptex::DataType  dt,
int  nChan 
)
inlinestatic
void PtexUtils::average ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
DataType  dt,
int  nchannels 
)
static
void PtexUtils::blend ( const void *  src,
float  weight,
void *  dst,
bool  flip,
int  rowlen,
DataType  dt,
int  nchannels 
)
static

Definition at line 463 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexReader::blendFaces().

static int PtexUtils::calcResFromWidth ( float  w)
inlinestatic

Definition at line 82 of file PtexUtils.h.

Referenced by PtexTriangleFilter::buildKernel().

static uint32_t PtexUtils::ceil_log2 ( uint32_t  x)
inlinestatic

Definition at line 70 of file PtexUtils.h.

References isPowerOfTwo(), and ones().

template<typename T >
static T PtexUtils::clamp ( x,
lo,
hi 
)
inlinestatic

Definition at line 122 of file PtexUtils.h.

References cond().

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

template<typename T >
static T PtexUtils::cond ( bool  c,
a,
b 
)
inlinestatic

Definition at line 113 of file PtexUtils.h.

Referenced by clamp(), max(), and min().

void PtexUtils::copy ( const void *  src,
int  sstride,
void *  dst,
int  dstride,
int  nrows,
int  rowlen 
)
static
void PtexUtils::decodeDifference ( void *  data,
int  size,
DataType  dt 
)
static

Definition at line 253 of file PtexUtils.cpp.

References Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexReader::readFaceData().

void PtexUtils::deinterleave ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static

Definition at line 208 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexWriterBase::writeFaceBlock().

void PtexUtils::divalpha ( void *  data,
int  npixels,
DataType  dt,
int  nchannels,
int  alphachan 
)
static
void PtexUtils::encodeDifference ( void *  data,
int  size,
DataType  dt 
)
static

Definition at line 233 of file PtexUtils.cpp.

References Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexWriterBase::writeFaceBlock().

void PtexUtils::fill ( const void *  src,
void *  dst,
int  dstride,
int  ures,
int  vres,
int  pixelsize 
)
static
static uint32_t PtexUtils::floor_log2 ( uint32_t  x)
inlinestatic

Definition at line 59 of file PtexUtils.h.

References ones().

Referenced by PtexWriterBase::calcTileRes().

void PtexUtils::genRfaceids ( const FaceInfo faces,
int  nfaces,
uint32_t *  rfaceids,
uint32_t *  faceids 
)
static

Definition at line 613 of file PtexUtils.cpp.

Referenced by PtexMainWriter::generateReductions(), and PtexReader::readFaceInfo().

void PtexUtils::interleave ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static

Definition at line 171 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexReader::readFaceData().

bool PtexUtils::isConstant ( const void *  data,
int  stride,
int  ures,
int  vres,
int  pixelSize 
)
static
static bool PtexUtils::isPowerOfTwo ( int  x)
inlinestatic

Definition at line 43 of file PtexUtils.h.

Referenced by ceil_log2().

template<typename T >
static T PtexUtils::max ( a,
b 
)
inlinestatic
template<typename T >
static T PtexUtils::min ( a,
b 
)
inlinestatic
void PtexUtils::multalpha ( void *  data,
int  npixels,
DataType  dt,
int  nchannels,
int  alphachan 
)
static
static uint32_t PtexUtils::ones ( uint32_t  x)
inlinestatic

Definition at line 48 of file PtexUtils.h.

Referenced by ceil_log2(), and floor_log2().

static float PtexUtils::qsmoothstep ( float  x,
float  a,
float  b 
)
inlinestatic

Definition at line 103 of file PtexUtils.h.

void PtexUtils::reduce ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static

Definition at line 282 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexWriterBase::PtexWriterBase().

void PtexUtils::reduceTri ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static
void PtexUtils::reduceu ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static

Definition at line 316 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexReader::getData().

void PtexUtils::reducev ( const void *  src,
int  sstride,
int  ures,
int  vres,
void *  dst,
int  dstride,
DataType  dt,
int  nchannels 
)
static

Definition at line 349 of file PtexUtils.cpp.

References Ptex::dt_float, Ptex::dt_half, Ptex::dt_uint16, and Ptex::dt_uint8.

Referenced by PtexReader::getData().

static float PtexUtils::smoothstep ( float  x,
float  a,
float  b 
)
inlinestatic

Definition at line 95 of file PtexUtils.h.

Member Data Documentation

PtexUtils::ApplyConstFn PtexUtils::applyConstFunctions
static
Initial value:
= {
ApplyConstN<uint8_t>, ApplyConstN<uint16_t>, ApplyConstN<PtexHalf>, ApplyConstN<float>,
ApplyConst<uint8_t,1>, ApplyConst<uint16_t,1>, ApplyConst<PtexHalf,1>, ApplyConst<float,1>,
ApplyConst<uint8_t,2>, ApplyConst<uint16_t,2>, ApplyConst<PtexHalf,2>, ApplyConst<float,2>,
ApplyConst<uint8_t,3>, ApplyConst<uint16_t,3>, ApplyConst<PtexHalf,3>, ApplyConst<float,3>,
ApplyConst<uint8_t,4>, ApplyConst<uint16_t,4>, ApplyConst<PtexHalf,4>, ApplyConst<float,4>,
}

Definition at line 203 of file PtexUtils.h.


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