Ptex: PtexSeparableKernel Class Reference

Ptex

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Static Public Attributes | Private Types | Static Private Member Functions | Static Private Attributes | List of all members
PtexSeparableKernel Class Reference

`#include <PtexSeparableKernel.h>`

Inheritance diagram for PtexSeparableKernel:

## Public Member Functions
| PtexSeparableKernel ()
| PtexSeparableKernel (const PtexSeparableKernel &k)
PtexSeparableKernel & | operator= (const PtexSeparableKernel &k)
void | set (Res resVal, int uVal, int vVal, int uwVal, int vwVal, const float *kuVal, const float *kvVal)
void | stripZeros ()
float | weight () const
void | mergeL (BorderMode mode)
void | mergeR (BorderMode mode)
void | mergeB (BorderMode mode)
void | mergeT (BorderMode mode)
void | splitL (PtexSeparableKernel &k)
void | splitR (PtexSeparableKernel &k)
void | splitB (PtexSeparableKernel &k)
void | splitT (PtexSeparableKernel &k)
void | flipU ()
void | flipV ()
void | swapUV ()
void | rotate (int rot)
bool | adjustMainToSubface (int eid)
void | adjustSubfaceToMain (int eid)
void | downresU ()
void | downresV ()
void | upresU ()
void | upresV ()
float | makeSymmetric (float initialWeight)
void | apply (float *dst, void *data, DataType dt, int nChan, int nTxChan)
void | applyConst (float *dst, void *data, DataType dt, int nChan)

## Public Attributes
Res | res
int | u
int | v
int | uw
int | vw
float * | ku
float * | kv
float | kubuff [kmax]
float | kvbuff [kmax]

## Static Public Attributes
static const int | kmax = 10

## Private Types
typedef void(* | ApplyFn) (PtexSeparableKernel &k, float *dst, void *data, int nChan, int nTxChan)
typedef void(* | ApplyConstFn) (float weight, float *dst, void *data, int nChan)

## Static Private Member Functions
static float | accumulate (const float *p, int n)

## Static Private Attributes
static ApplyFn | applyFunctions [40]
static ApplyConstFn | applyConstFunctions [20]

## Additional Inherited Members
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 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...

## Detailed Description

Definition at line 46 of file PtexSeparableKernel.h.

## Member Typedef Documentation

typedef void(* PtexSeparableKernel::ApplyConstFn) (float weight, float *dst, void *data, int nChan)
| private

Definition at line 462 of file PtexSeparableKernel.h.

typedef void(* PtexSeparableKernel::ApplyFn) (PtexSeparableKernel &k, float *dst, void *data, int nChan, int nTxChan)
| private

Definition at line 461 of file PtexSeparableKernel.h.

## Constructor & Destructor Documentation

PtexSeparableKernel::PtexSeparableKernel | ( |  | ) |
| inline

Definition at line 57 of file PtexSeparableKernel.h.

PtexSeparableKernel::PtexSeparableKernel | ( | const PtexSeparableKernel & | k | ) |
| inline

Definition at line 60 of file PtexSeparableKernel.h.

References ku, kv, res, set(), u, uw, v, and vw.

## Member Function Documentation

static float PtexSeparableKernel::accumulate | ( | const float * | p,
|  | int | n
| ) |  |
| inlinestaticprivate

Definition at line 465 of file PtexSeparableKernel.h.

Referenced by mergeB(), mergeL(), mergeR(), mergeT(), and weight().

bool PtexSeparableKernel::adjustMainToSubface | ( | int | eid | ) |
| inline

Definition at line 257 of file PtexSeparableKernel.h.

References Ptex::e_bottom, Ptex::e_left, Ptex::e_right, Ptex::e_top, Ptex::Res::u(), Ptex::Res::ulog2, upresU(), upresV(), Ptex::Res::v(), and Ptex::Res::vlog2.

Referenced by PtexSeparableFilter::applyAcrossEdge(), and PtexSeparableFilter::applyToCornerFace().

void PtexSeparableKernel::adjustSubfaceToMain | ( | int | eid | ) |
| inline

Definition at line 293 of file PtexSeparableKernel.h.

References Ptex::e_bottom, Ptex::e_left, Ptex::e_right, Ptex::e_top, Ptex::Res::u(), Ptex::Res::ulog2, Ptex::Res::v(), and Ptex::Res::vlog2.

Referenced by PtexSeparableFilter::applyAcrossEdge(), PtexSeparableFilter::applyToCorner(), and PtexSeparableFilter::applyToCornerFace().

void PtexSeparableKernel::apply | ( | float * | dst,
|  | void * | data,
|  | DataType | dt,
|  | int | nChan,
|  | int | nTxChan
| ) |  |
| inline

Definition at line 448 of file PtexSeparableKernel.h.

References applyFunctions.

Referenced by PtexSeparableFilter::apply().

void PtexSeparableKernel::applyConst | ( | float * | dst,
|  | void * | data,
|  | DataType | dt,
|  | int | nChan
| ) |  |
| inline

Definition at line 455 of file PtexSeparableKernel.h.

References PtexUtils::applyConst(), and weight().

Referenced by PtexSeparableFilter::apply().

void PtexSeparableKernel::downresU | ( |  | ) |
| inline

Definition at line 304 of file PtexSeparableKernel.h.

References ku, and Ptex::Res::ulog2.

Referenced by PtexSeparableFilter::apply(), and makeSymmetric().

void PtexSeparableKernel::downresV | ( |  | ) |
| inline

Definition at line 333 of file PtexSeparableKernel.h.

References kv, and Ptex::Res::vlog2.

Referenced by PtexSeparableFilter::apply(), and makeSymmetric().

void PtexSeparableKernel::flipU | ( |  | ) |
| inline

Definition at line 226 of file PtexSeparableKernel.h.

References Ptex::Res::u(), and uw.

Referenced by rotate().

void PtexSeparableKernel::flipV | ( |  | ) |
| inline

Definition at line 232 of file PtexSeparableKernel.h.

References Ptex::Res::v(), and vw.

Referenced by rotate().

float PtexSeparableKernel::makeSymmetric | ( | float | initialWeight | ) |
| inline

Definition at line 388 of file PtexSeparableKernel.h.

References downresU(), downresV(), PtexUtils::min(), Ptex::Res::ulog2, uw, and Ptex::Res::vlog2.

Referenced by PtexSeparableFilter::applyToCorner().

void PtexSeparableKernel::mergeB | ( | BorderMode | mode | ) |
| inline

Definition at line 121 of file PtexSeparableKernel.h.

References accumulate(), Ptex::m_black, and v.

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::mergeL | ( | BorderMode | mode | ) |
| inline

Definition at line 102 of file PtexSeparableKernel.h.

References accumulate(), Ptex::m_black, and u.

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::mergeR | ( | BorderMode | mode | ) |
| inline

Definition at line 112 of file PtexSeparableKernel.h.

References accumulate(), Ptex::m_black, and Ptex::Res::u().

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::mergeT | ( | BorderMode | mode | ) |
| inline

Definition at line 131 of file PtexSeparableKernel.h.

References accumulate(), Ptex::m_black, and Ptex::Res::v().

Referenced by PtexSeparableFilter::splitAndApply().

PtexSeparableKernel& PtexSeparableKernel::operator= | ( | const PtexSeparableKernel & | k | ) |
| inline

Definition at line 65 of file PtexSeparableKernel.h.

References ku, kv, res, set(), u, uw, v, and vw.

void PtexSeparableKernel::rotate | ( | int | rot | ) |
| inline

Definition at line 246 of file PtexSeparableKernel.h.

References flipU(), flipV(), and swapUV().

Referenced by PtexSeparableFilter::applyAcrossEdge(), PtexSeparableFilter::applyToCorner(), and PtexSeparableFilter::applyToCornerFace().

void PtexSeparableKernel::set | ( | Res | resVal,
|  | int | uVal,
|  | int | vVal,
|  | int | uwVal,
|  | int | vwVal,
|  | const float * | kuVal,
|  | const float * | kvVal
| ) |  |
| inline

Definition at line 71 of file PtexSeparableKernel.h.

References kubuff, and kvbuff.

Referenced by operator=(), PtexSeparableKernel(), splitB(), splitL(), splitR(), and splitT().

void PtexSeparableKernel::splitB | ( | PtexSeparableKernel & | k | ) |
| inline

Definition at line 184 of file PtexSeparableKernel.h.

References ku, kv, set(), uw, v, and Ptex::Res::v().

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::splitL | ( | PtexSeparableKernel & | k | ) |
| inline

Definition at line 140 of file PtexSeparableKernel.h.

References ku, kv, set(), u, Ptex::Res::u(), v, and vw.

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::splitR | ( | PtexSeparableKernel & | k | ) |
| inline

Definition at line 163 of file PtexSeparableKernel.h.

References set(), u, and Ptex::Res::u().

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::splitT | ( | PtexSeparableKernel & | k | ) |
| inline

Definition at line 206 of file PtexSeparableKernel.h.

References set(), v, and Ptex::Res::v().

Referenced by PtexSeparableFilter::splitAndApply().

void PtexSeparableKernel::stripZeros | ( |  | ) |
| inline

Definition at line 88 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::eval().

void PtexSeparableKernel::swapUV | ( |  | ) |
| inline

Definition at line 238 of file PtexSeparableKernel.h.

References Ptex::Res::swapuv().

Referenced by rotate().

void PtexSeparableKernel::upresU | ( |  | ) |
| inline

Definition at line 362 of file PtexSeparableKernel.h.

References Ptex::Res::ulog2.

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

void PtexSeparableKernel::upresV | ( |  | ) |
| inline

Definition at line 375 of file PtexSeparableKernel.h.

References Ptex::Res::vlog2.

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

float PtexSeparableKernel::weight | ( |  | ) | const
| inline

Definition at line 97 of file PtexSeparableKernel.h.

References accumulate().

Referenced by applyConst(), PtexSeparableFilter::applyToCorner(), and PtexSeparableFilter::eval().

## Member Data Documentation

ApplyConstFn PtexSeparableKernel::applyConstFunctions[20]
| staticprivate

Definition at line 464 of file PtexSeparableKernel.h.

PtexSeparableKernel::ApplyFn PtexSeparableKernel::applyFunctions
| staticprivate

Initial value:
= {
ApplyN<uint8_t>, ApplyN<uint16_t>, ApplyN<PtexHalf>, ApplyN<float>,
Apply<uint8_t,1>, Apply<uint16_t,1>, Apply<PtexHalf,1>, Apply<float,1>,
Apply<uint8_t,2>, Apply<uint16_t,2>, Apply<PtexHalf,2>, Apply<float,2>,
Apply<uint8_t,3>, Apply<uint16_t,3>, Apply<PtexHalf,3>, Apply<float,3>,
Apply<uint8_t,4>, Apply<uint16_t,4>, Apply<PtexHalf,4>, Apply<float,4>,
ApplyN<uint8_t>, ApplyN<uint16_t>, ApplyN<PtexHalf>, ApplyN<float>,
ApplyS<uint8_t,1>, ApplyS<uint16_t,1>, ApplyS<PtexHalf,1>, ApplyS<float,1>,
ApplyS<uint8_t,2>, ApplyS<uint16_t,2>, ApplyS<PtexHalf,2>, ApplyS<float,2>,
ApplyS<uint8_t,3>, ApplyS<uint16_t,3>, ApplyS<PtexHalf,3>, ApplyS<float,3>,
ApplyS<uint8_t,4>, ApplyS<uint16_t,4>, ApplyS<PtexHalf,4>, ApplyS<float,4>,
}

Definition at line 463 of file PtexSeparableKernel.h.

Referenced by apply().

const int PtexSeparableKernel::kmax = 10
| static

Definition at line 53 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::eval().

float* PtexSeparableKernel::ku

Definition at line 51 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), downresU(), operator=(), PtexSeparableKernel(), splitB(), and splitL().

float PtexSeparableKernel::kubuff[kmax]

Definition at line 54 of file PtexSeparableKernel.h.

Referenced by set().

float* PtexSeparableKernel::kv

Definition at line 52 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), downresV(), operator=(), PtexSeparableKernel(), splitB(), and splitL().

float PtexSeparableKernel::kvbuff[kmax]

Definition at line 55 of file PtexSeparableKernel.h.

Referenced by set().

Res PtexSeparableKernel::res

Definition at line 48 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), PtexSeparableFilter::eval(), operator=(), PtexSeparableKernel(), and PtexSeparableFilter::splitAndApply().

int PtexSeparableKernel::u

Definition at line 49 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), mergeL(), operator=(), PtexSeparableKernel(), PtexSeparableFilter::splitAndApply(), splitL(), and splitR().

int PtexSeparableKernel::uw

Definition at line 50 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), PtexSeparableFilter::eval(), flipU(), makeSymmetric(), operator=(), PtexSeparableKernel(), PtexSeparableFilter::splitAndApply(), and splitB().

int PtexSeparableKernel::v

Definition at line 49 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), mergeB(), operator=(), PtexSeparableKernel(), PtexSeparableFilter::splitAndApply(), splitB(), splitL(), and splitT().

int PtexSeparableKernel::vw

Definition at line 50 of file PtexSeparableKernel.h.

Referenced by PtexSeparableFilter::apply(), PtexSeparableFilter::eval(), flipV(), operator=(), PtexSeparableKernel(), PtexSeparableFilter::splitAndApply(), and splitL().

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

- PtexSeparableKernel.h
- PtexSeparableKernel.cpp