Ptex: PtexSeparableFilter Class Reference

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

## Constructor & Destructor Documentation

## ◆ PtexSeparableFilter()

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

Definition at line 55 of file PtexSeparableFilter.h.

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

Referenced by PtexBilinearFilter::PtexBilinearFilter(), PtexBoxFilter::PtexBoxFilter(), and PtexWidth4Filter::PtexWidth4Filter().

## ◆ ~PtexSeparableFilter()

virtual PtexSeparableFilter::~PtexSeparableFilter | ( |  | ) |
| inlineprotectedvirtual

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 345 of file PtexSeparableFilter.cpp.

References _dt, _efm, _firstChanOffset, _nchan, _ntxchan, _result, _tx, PtexSeparableKernel::apply(), PtexSeparableKernel::applyConst(), PtexSeparableKernel::downresU(), PtexSeparableKernel::downresV(), Ptex::FaceInfo::isConstant(), PtexSeparableKernel::ku, PtexSeparableKernel::kv, Ptex::FaceInfo::res, PtexSeparableKernel::res, PtexSeparableKernel::rot, Ptex::Res::u(), PtexSeparableKernel::u, Ptex::Res::ulog2, PtexSeparableKernel::uw, Ptex::Res::v(), PtexSeparableKernel::v, Ptex::Res::vlog2, 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 212 of file PtexSeparableFilter.cpp.

References _tx, Ptex::FaceInfo::adjedge(), Ptex::FaceInfo::adjface(), PtexSeparableKernel::adjustMainToSubface(), PtexSeparableKernel::adjustSubfaceToMain(), apply(), 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 254 of file PtexSeparableFilter.cpp.

References _tx, _weight, PtexSeparableKernel::adjustSubfaceToMain(), applyToCornerFace(), 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 328 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 )
| protectedpure virtual

Implemented in PtexBilinearFilter, PtexBoxFilter, and PtexWidth4Filter.

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.

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

References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _tx, _uMode, _vMode, _weight, buildKernel(), Ptex::ConvertToFloat(), PtexSeparableKernel::kmax, PtexSeparableKernel::res, splitAndApply(), PtexSeparableKernel::stripZeros(), PtexSeparableKernel::upresU(), PtexSeparableKernel::upresV(), PtexSeparableKernel::uw, PtexSeparableKernel::vw, and PtexSeparableKernel::weight().

Referenced by PtexFilter::eval().

## ◆ release()

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

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 132 of file PtexSeparableFilter.cpp.

References _options, _uMode, _vMode, Ptex::FaceInfo::adjface(), apply(), applyAcrossEdge(), applyToCorner(), PtexSeparableKernel::mergeB(), PtexSeparableKernel::mergeL(), PtexSeparableKernel::mergeR(), PtexSeparableKernel::mergeT(), 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(), eval(), and PtexSeparableFilter().

## ◆ _efm

EdgeFilterMode PtexSeparableFilter::_efm
| protected

Definition at line 87 of file PtexSeparableFilter.h.

Referenced by apply(), and PtexSeparableFilter().

## ◆ _firstChanOffset

int PtexSeparableFilter::_firstChanOffset
| protected

Definition at line 82 of file PtexSeparableFilter.h.

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

## ◆ _nchan

int PtexSeparableFilter::_nchan
| protected

Definition at line 83 of file PtexSeparableFilter.h.

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

## ◆ _ntxchan

int PtexSeparableFilter::_ntxchan
| protected

Definition at line 84 of file PtexSeparableFilter.h.

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

## ◆ _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(), eval(), and PtexSeparableFilter().

## ◆ _tx

PtexTexture* PtexSeparableFilter::_tx
| protected

Definition at line 78 of file PtexSeparableFilter.h.

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

## ◆ _uMode

BorderMode PtexSeparableFilter::_uMode
| protected

Definition at line 86 of file PtexSeparableFilter.h.

Referenced by eval(), PtexSeparableFilter(), and splitAndApply().

## ◆ _vMode

BorderMode PtexSeparableFilter::_vMode
| protected

Definition at line 86 of file PtexSeparableFilter.h.

Referenced by eval(), PtexSeparableFilter(), and splitAndApply().

## ◆ _weight

float PtexSeparableFilter::_weight
| protected

Definition at line 81 of file PtexSeparableFilter.h.

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

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

- PtexSeparableFilter.h
- PtexSeparableFilter.cpp