Ptex: PtexTriangleFilter Class Reference

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). More...
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. More...

## 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)
virtual | ~PtexTriangleFilter ()
Protected Member Functions inherited from PtexFilter
virtual | ~PtexFilter ()
| Destructor not for public use. Use release() instead. More...

## 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 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.

## ◆ ~PtexTriangleFilter()

virtual PtexTriangleFilter::~PtexTriangleFilter | ( |  | ) |
| inlineprotectedvirtual

Definition at line 69 of file PtexTriangleFilter.h.

## Member Function Documentation

## ◆ apply()

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

Definition at line 200 of file PtexTriangleFilter.cpp.

References _tx, applyIter(), PtexTriangleKernel::clampExtent(), PtexTriangleKernel::clampRes(), PtexTexture::getData(), PtexTriangleKernel::getIterators(), PtexTriangleKernel::res, Ptex::FaceInfo::res, and PtexTriangleKernelIter::valid.

Referenced by release(), and splitAndApply().

## ◆ applyAcrossEdge()

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

Definition at line 190 of file PtexTriangleFilter.cpp.

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

Referenced by release(), and splitAndApply().

## ◆ applyIter()

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

Definition at line 220 of file PtexTriangleFilter.cpp.

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

Referenced by apply(), and release().

## ◆ 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 105 of file PtexTriangleFilter.cpp.

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

Referenced by eval(), and release().

## ◆ 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.

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(), PtexUtils::clamp(), Ptex::ConvertToFloat(), Ptex::DataSize(), PtexTexture::dataType(), PtexTexture::getData(), PtexTexture::getFaceInfo(), PtexUtils::min(), PtexTexture::numChannels(), PtexTexture::numFaces(), Ptex::OneValue(), PtexTriangleKernel::res, and splitAndApply().

Referenced by release().

## ◆ release()

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

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

Implements PtexFilter.

Definition at line 53 of file PtexTriangleFilter.h.

References apply(), applyAcrossEdge(), applyIter(), buildKernel(), eval(), and splitAndApply().

## ◆ splitAndApply()

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

Definition at line 167 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(), eval(), and release().

## Member Data Documentation

## ◆ _dt

DataType PtexTriangleFilter::_dt
| protected

Definition at line 78 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

## ◆ _firstChanOffset

int PtexTriangleFilter::_firstChanOffset
| protected

Definition at line 75 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

## ◆ _nchan

int PtexTriangleFilter::_nchan
| protected

Definition at line 76 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

## ◆ _ntxchan

int PtexTriangleFilter::_ntxchan
| protected

Definition at line 77 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

## ◆ _options

Options PtexTriangleFilter::_options
| protected

Definition at line 72 of file PtexTriangleFilter.h.

## ◆ _result

float* PtexTriangleFilter::_result
| protected

Definition at line 73 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

## ◆ _tx

PtexTexture* PtexTriangleFilter::_tx
| protected

Definition at line 71 of file PtexTriangleFilter.h.

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

## ◆ _weight

float PtexTriangleFilter::_weight
| protected

Definition at line 74 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

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

- PtexTriangleFilter.h
- PtexTriangleFilter.cpp