Ptex

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PtexTriangleFilter Class Reference

`#include <PtexTriangleFilter.h>`

Inheritance diagram for PtexTriangleFilter:

## Public Member Functions
| PtexTriangleFilter (PtexTexture *tx, const PtexFilter::Options &opts)
virtual void | release ()
| Release resources held by this pointer (pointer becomes invalid).
virtual void | eval (float *result, int firstchan, int nchannels, int faceid, float u, float v, float uw1, float vw1, float uw2, float vw2, float width, float blur)
| Apply filter to a ptex data file.
virtual | ~PtexTriangleFilter ()

## Protected Member Functions
void | buildKernel (PtexTriangleKernel &k, float u, float v, float uw1, float vw1, float uw2, float vw2, float width, float blur, Res faceRes)
void | splitAndApply (PtexTriangleKernel &k, int faceid, const Ptex::FaceInfo &f)
void | applyAcrossEdge (PtexTriangleKernel &k, const Ptex::FaceInfo &f, int eid)
void | apply (PtexTriangleKernel &k, int faceid, const Ptex::FaceInfo &f)
void | applyIter (PtexTriangleKernelIter &k, PtexFaceData *dh)
Protected Member Functions inherited from PtexFilter
virtual | ~PtexFilter ()
| Destructor not for public use. Use release() instead.

## Protected Attributes
PtexTexture * | _tx
Options | _options
float * | _result
float | _weight
int | _firstChanOffset
int | _nchan
int | _ntxchan
DataType | _dt

## Additional Inherited Members
Public Types inherited from PtexFilter
enum | FilterType { f_point , f_bilinear , f_box , f_gaussian , f_bicubic , f_bspline , f_catmullrom , f_mitchell }
| Filter types. More...
Static Public Member Functions inherited from PtexFilter
static void | eval (PtexTexture *tx, const Options &opts, float *result, int firstchan, int nchannels, int faceid, float u, float v, float uw1, float vw1, float uw2, float vw2, float width=1, float blur=0)
static PtexFilter * | getFilter (PtexTexture *tx, const Options &opts)

## Detailed Description

Definition at line 46 of file PtexTriangleFilter.h.

## Constructor & Destructor Documentation

## ◆ PtexTriangleFilter()

PtexTriangleFilter::PtexTriangleFilter | ( | PtexTexture * | tx,
|  | const PtexFilter::Options & | opts )
| inline

Definition at line 49 of file PtexTriangleFilter.h.

References _dt, _firstChanOffset, _nchan, _ntxchan, _options, _result, _tx, and _weight.

## ◆ ~PtexTriangleFilter()

virtual PtexTriangleFilter::~PtexTriangleFilter | ( |  | ) |
| inline virtual

Definition at line 58 of file PtexTriangleFilter.h.

## Member Function Documentation

## ◆ apply()

void PtexTriangleFilter::apply | ( | PtexTriangleKernel & | k,
|  | int | faceid,
|  | const Ptex::FaceInfo & | f )
| protected

Definition at line 197 of file PtexTriangleFilter.cpp.

References _dt, _firstChanOffset, _nchan, _result, _tx, _weight, PtexTriangleKernelIter::applyConst(), applyIter(), PtexTriangleKernel::clampExtent(), PtexTriangleKernel::clampRes(), PtexTriangleKernel::getIterators(), Ptex::FaceInfo::isConstant(), Ptex::FaceInfo::res, PtexTriangleKernel::res, PtexTriangleKernelIter::valid, and PtexTriangleKernelIter::weight.

Referenced by splitAndApply().

## ◆ applyAcrossEdge()

void PtexTriangleFilter::applyAcrossEdge | ( | PtexTriangleKernel & | k,
|  | const Ptex::FaceInfo & | f,
|  | int | eid )
| protected

Definition at line 187 of file PtexTriangleFilter.cpp.

References _tx, Ptex::FaceInfo::adjedge(), Ptex::FaceInfo::adjface(), PtexTriangleKernel::reorient(), and splitAndApply().

Referenced by splitAndApply().

## ◆ applyIter()

void PtexTriangleFilter::applyIter | ( | PtexTriangleKernelIter & | k,
|  | PtexFaceData * | dh )
| protected

Definition at line 231 of file PtexTriangleFilter.cpp.

References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _weight, PtexTriangleKernelIter::apply(), PtexTriangleKernelIter::applyConst(), PtexFaceData::getData(), PtexFaceData::getTile(), PtexFaceData::isConstant(), PtexFaceData::isTiled(), PtexTriangleKernelIter::rowlen, PtexFaceData::tileRes(), Ptex::Res::u(), PtexTriangleKernelIter::u, PtexTriangleKernelIter::u1, PtexTriangleKernelIter::u2, Ptex::Res::v(), PtexTriangleKernelIter::v, PtexTriangleKernelIter::v1, PtexTriangleKernelIter::v2, PtexTriangleKernelIter::w1, PtexTriangleKernelIter::w2, and PtexTriangleKernelIter::weight.

Referenced by apply().

## ◆ buildKernel()

void PtexTriangleFilter::buildKernel | ( | PtexTriangleKernel & | k,
|  | float | u,
|  | float | v,
|  | float | uw1,
|  | float | vw1,
|  | float | uw2,
|  | float | vw2,
|  | float | width,
|  | float | blur,
|  | Res | faceRes )
| protected

Definition at line 102 of file PtexTriangleFilter.cpp.

References C, PtexUtils::calcResFromWidth(), PtexTriangleKernelWidth, and PtexTriangleKernel::set().

Referenced by eval().

## ◆ eval()

PTEX_NAMESPACE_BEGIN void PtexTriangleFilter::eval | ( | float * | result,
|  | int | firstchan,
|  | int | nchannels,
|  | int | faceid,
|  | float | u,
|  | float | v,
|  | float | uw1,
|  | float | vw1,
|  | float | uw2,
|  | float | vw2,
|  | float | width,
|  | float | blur )
| virtual

Apply filter to a ptex data file.

Deprecated. (use static eval method)

The filter region is a parallelogram centered at the given (u,v) coordinate with sides defined by two vectors [uw1, vw1] and [uw2, vw2]. For an axis-aligned rectangle, the vectors are [uw, 0] and [0, vw]. See Filter Footprint for details.

Parameters

  result | Buffer to hold filter result. Must be large enough to hold nchannels worth of data.
  firstchan | First channel to evaluate [0..tx->numChannels()-1]
  nchannels | Number of channels to evaluate
  faceid | Face index [0..tx->numFaces()-1]
  u | U coordinate, normalized [0..1]
  v | V coordinate, normalized [0..1]
  uw1 | U filter width 1, normalized [0..1]
  vw1 | V filter width 1, normalized [0..1]
  uw2 | U filter width 2, normalized [0..1]
  vw2 | V filter width 2, normalized [0..1]
  width | scale factor for filter width
  blur | amount to add to filter width [0..1]

Implements PtexFilter.

Definition at line 50 of file PtexTriangleFilter.cpp.

References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _tx, _weight, buildKernel(), Ptex::ConvertToFloat(), PtexTriangleKernel::res, and splitAndApply().

Referenced by PtexFilter::eval().

## ◆ release()

virtual void PtexTriangleFilter::release | ( |  | ) |
| inline virtual

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

Implements PtexFilter.

Definition at line 53 of file PtexTriangleFilter.h.

## ◆ splitAndApply()

void PtexTriangleFilter::splitAndApply | ( | PtexTriangleKernel & | k,
|  | int | faceid,
|  | const Ptex::FaceInfo & | f )
| protected

Definition at line 164 of file PtexTriangleFilter.cpp.

References Ptex::FaceInfo::adjface(), apply(), applyAcrossEdge(), PtexTriangleKernel::splitU(), PtexTriangleKernel::splitV(), PtexTriangleKernel::splitW(), PtexTriangleKernel::u1, PtexTriangleKernel::v1, and PtexTriangleKernel::w1.

Referenced by applyAcrossEdge(), and eval().

## Member Data Documentation

## ◆ _dt

DataType PtexTriangleFilter::_dt
| protected

Definition at line 77 of file PtexTriangleFilter.h.

Referenced by apply(), applyIter(), eval(), and PtexTriangleFilter().

## ◆ _firstChanOffset

int PtexTriangleFilter::_firstChanOffset
| protected

Definition at line 74 of file PtexTriangleFilter.h.

Referenced by apply(), applyIter(), eval(), and PtexTriangleFilter().

## ◆ _nchan

int PtexTriangleFilter::_nchan
| protected

Definition at line 75 of file PtexTriangleFilter.h.

Referenced by apply(), applyIter(), eval(), and PtexTriangleFilter().

## ◆ _ntxchan

int PtexTriangleFilter::_ntxchan
| protected

Definition at line 76 of file PtexTriangleFilter.h.

Referenced by applyIter(), eval(), and PtexTriangleFilter().

## ◆ _options

Options PtexTriangleFilter::_options
| protected

Definition at line 71 of file PtexTriangleFilter.h.

Referenced by PtexTriangleFilter().

## ◆ _result

float* PtexTriangleFilter::_result
| protected

Definition at line 72 of file PtexTriangleFilter.h.

Referenced by apply(), applyIter(), eval(), and PtexTriangleFilter().

## ◆ _tx

PtexTexture* PtexTriangleFilter::_tx
| protected

Definition at line 70 of file PtexTriangleFilter.h.

Referenced by apply(), applyAcrossEdge(), eval(), and PtexTriangleFilter().

## ◆ _weight

float PtexTriangleFilter::_weight
| protected

Definition at line 73 of file PtexTriangleFilter.h.

Referenced by apply(), applyIter(), eval(), and PtexTriangleFilter().

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

- PtexTriangleFilter.h
- PtexTriangleFilter.cpp