Ptex

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PtexSeparableFilter Class Referenceabstract

`#include <PtexSeparableFilter.h>`

Inheritance diagram for PtexSeparableFilter:

## Public Member Functions
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.

## Protected Member Functions
| PtexSeparableFilter (PtexTexture *tx, const PtexFilter::Options &opts)
virtual | ~PtexSeparableFilter ()
virtual void | buildKernel (PtexSeparableKernel &k, float u, float v, float uw, float vw, Res faceRes)=0
void | splitAndApply (PtexSeparableKernel &k, int faceid, const Ptex::FaceInfo &f)
void | applyAcrossEdge (PtexSeparableKernel &k, int faceid, const Ptex::FaceInfo &f, int eid)
void | applyToCorner (PtexSeparableKernel &k, int faceid, const Ptex::FaceInfo &f, int eid)
void | applyToCornerFace (PtexSeparableKernel &k, const Ptex::FaceInfo &f, int eid, int cfaceid, const Ptex::FaceInfo &cf, int ceid)
void | apply (PtexSeparableKernel &k, int faceid, const Ptex::FaceInfo &f)
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
BorderMode | _uMode
BorderMode | _vMode
EdgeFilterMode | _efm

## 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 45 of file PtexSeparableFilter.h.

## Constructor & Destructor Documentation

## ◆ PtexSeparableFilter()

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

Definition at line 55 of file PtexSeparableFilter.h.

References PtexFilter::Options::__structSize, _options, and PtexFilter::Options::noedgeblend.

## ◆ ~PtexSeparableFilter()

virtual PtexSeparableFilter::~PtexSeparableFilter | ( |  | ) |
| inline protected virtual

Definition at line 66 of file PtexSeparableFilter.h.

## Member Function Documentation

## ◆ apply()

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

Definition at line 348 of file PtexSeparableFilter.cpp.

References _dt, _efm, _firstChanOffset, _nchan, _ntxchan, _result, _tx, PtexSeparableKernel::apply(), PtexSeparableKernel::applyConst(), PtexSeparableKernel::downresU(), PtexSeparableKernel::downresV(), PtexTexture::getData(), PtexSeparableKernel::ku, PtexSeparableKernel::kv, PtexUtils::min(), PtexSeparableKernel::res, Ptex::FaceInfo::res, PtexSeparableKernel::rot, PtexSeparableKernel::u, Ptex::Res::u(), PtexSeparableKernel::uw, PtexSeparableKernel::v, Ptex::Res::v(), and PtexSeparableKernel::vw.

Referenced by applyAcrossEdge(), applyToCornerFace(), and splitAndApply().

## ◆ applyAcrossEdge()

void PtexSeparableFilter::applyAcrossEdge | ( | PtexSeparableKernel & | k,
|  | int | faceid,
|  | const Ptex::FaceInfo & | f,
|  | int | eid
| ) |  |
| protected

Definition at line 215 of file PtexSeparableFilter.cpp.

References _tx, Ptex::FaceInfo::adjedge(), Ptex::FaceInfo::adjface(), PtexSeparableKernel::adjustMainToSubface(), PtexSeparableKernel::adjustSubfaceToMain(), apply(), PtexTexture::getFaceInfo(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::rotate(), and splitAndApply().

Referenced by splitAndApply().

## ◆ applyToCorner()

void PtexSeparableFilter::applyToCorner | ( | PtexSeparableKernel & | k,
|  | int | faceid,
|  | const Ptex::FaceInfo & | f,
|  | int | eid
| ) |  |
| protected

Definition at line 257 of file PtexSeparableFilter.cpp.

References _tx, _weight, PtexSeparableKernel::adjustSubfaceToMain(), applyToCornerFace(), PtexTexture::getFaceInfo(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::makeSymmetric(), PtexSeparableKernel::rotate(), splitAndApply(), and PtexSeparableKernel::weight().

Referenced by splitAndApply().

## ◆ applyToCornerFace()

void PtexSeparableFilter::applyToCornerFace | ( | PtexSeparableKernel & | k,
|  | const Ptex::FaceInfo & | f,
|  | int | eid,
|  | int | cfaceid,
|  | const Ptex::FaceInfo & | cf,
|  | int | ceid
| ) |  |
| protected

Definition at line 331 of file PtexSeparableFilter.cpp.

References PtexSeparableKernel::adjustMainToSubface(), PtexSeparableKernel::adjustSubfaceToMain(), apply(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::rotate(), and splitAndApply().

Referenced by applyToCorner().

## ◆ buildKernel()

virtual void PtexSeparableFilter::buildKernel | ( | PtexSeparableKernel & | k,
|  | float | u,
|  | float | v,
|  | float | uw,
|  | float | vw,
|  | Res | faceRes
| ) |  |
| protected pure virtual

Implemented in PtexWidth4Filter, PtexBoxFilter, and PtexBilinearFilter.

Referenced by eval().

## ◆ eval()

PTEX_NAMESPACE_BEGIN void PtexSeparableFilter::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 47 of file PtexSeparableFilter.cpp.

References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _tx, _uMode, _vMode, _weight, PtexUtils::abs(), buildKernel(), PtexUtils::clamp(), Ptex::ConvertToFloat(), PtexTexture::getData(), PtexTexture::getFaceInfo(), PtexSeparableKernel::kmax, PtexUtils::min(), PtexTexture::numFaces(), PtexSeparableKernel::res, splitAndApply(), PtexSeparableKernel::stripZeros(), PtexSeparableKernel::upresU(), PtexSeparableKernel::upresV(), PtexSeparableKernel::uw, PtexSeparableKernel::vw, and PtexSeparableKernel::weight().

## ◆ release()

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

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

Implements PtexFilter.

Definition at line 48 of file PtexSeparableFilter.h.

## ◆ splitAndApply()

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

Definition at line 135 of file PtexSeparableFilter.cpp.

References _options, _uMode, _vMode, Ptex::FaceInfo::adjface(), apply(), applyAcrossEdge(), applyToCorner(), PtexSeparableKernel::mergeB(), PtexSeparableKernel::mergeL(), PtexSeparableKernel::mergeR(), PtexSeparableKernel::mergeT(), PtexFilter::Options::noedgeblend, PtexSeparableKernel::res, PtexSeparableKernel::splitB(), PtexSeparableKernel::splitL(), PtexSeparableKernel::splitR(), PtexSeparableKernel::splitT(), PtexSeparableKernel::u, PtexSeparableKernel::uw, PtexSeparableKernel::v, and PtexSeparableKernel::vw.

Referenced by applyAcrossEdge(), applyToCorner(), applyToCornerFace(), and eval().

## Member Data Documentation

## ◆ _dt

DataType PtexSeparableFilter::_dt
| protected

Definition at line 85 of file PtexSeparableFilter.h.

Referenced by apply(), and eval().

## ◆ _efm

EdgeFilterMode PtexSeparableFilter::_efm
| protected

Definition at line 87 of file PtexSeparableFilter.h.

Referenced by apply().

## ◆ _firstChanOffset

int PtexSeparableFilter::_firstChanOffset
| protected

Definition at line 82 of file PtexSeparableFilter.h.

Referenced by apply(), and eval().

## ◆ _nchan

int PtexSeparableFilter::_nchan
| protected

Definition at line 83 of file PtexSeparableFilter.h.

Referenced by apply(), and eval().

## ◆ _ntxchan

int PtexSeparableFilter::_ntxchan
| protected

Definition at line 84 of file PtexSeparableFilter.h.

Referenced by apply(), and eval().

## ◆ _options

Options PtexSeparableFilter::_options
| protected

Definition at line 79 of file PtexSeparableFilter.h.

Referenced by PtexWidth4Filter::buildKernelAxis(), PtexSeparableFilter(), and splitAndApply().

## ◆ _result

float* PtexSeparableFilter::_result
| protected

Definition at line 80 of file PtexSeparableFilter.h.

Referenced by apply(), and eval().

## ◆ _tx

PtexTexture* PtexSeparableFilter::_tx
| protected

Definition at line 78 of file PtexSeparableFilter.h.

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

## ◆ _uMode

BorderMode PtexSeparableFilter::_uMode
| protected

Definition at line 86 of file PtexSeparableFilter.h.

Referenced by eval(), and splitAndApply().

## ◆ _vMode

BorderMode PtexSeparableFilter::_vMode
| protected

Definition at line 86 of file PtexSeparableFilter.h.

Referenced by eval(), and splitAndApply().

## ◆ _weight

float PtexSeparableFilter::_weight
| protected

Definition at line 81 of file PtexSeparableFilter.h.

Referenced by applyToCorner(), and eval().

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

- PtexSeparableFilter.h
- PtexSeparableFilter.cpp