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

#include <PtexSeparableFilter.h>

Inheritance diagram for PtexSeparableFilter:
PtexFilter PtexBilinearFilter PtexBoxFilter PtexWidth4Filter PtexBicubicFilter PtexGaussianFilter

Public Member Functions

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

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

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 PtexFiltergetFilter (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

◆ ~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

◆ applyAcrossEdge()

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

◆ applyToCorner()

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

◆ applyToCornerFace()

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

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

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
resultBuffer to hold filter result. Must be large enough to hold nchannels worth of data.
firstchanFirst channel to evaluate [0..tx->numChannels()-1]
nchannelsNumber of channels to evaluate
faceidFace index [0..tx->numFaces()-1]
uU coordinate, normalized [0..1]
vV coordinate, normalized [0..1]
uw1U filter width 1, normalized [0..1]
vw1V filter width 1, normalized [0..1]
uw2U filter width 2, normalized [0..1]
vw2V filter width 2, normalized [0..1]
widthscale factor for filter width
bluramount 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(), Ptex::DataSize(), PtexFaceData::getData(), PtexTexture::getData(), PtexTexture::getFaceInfo(), PtexSeparableKernel::kmax, Ptex::m_black, Ptex::m_clamp, Ptex::m_periodic, PtexUtils::min(), PtexTexture::numFaces(), Ptex::OneValue(), PtexSeparableKernel::res, splitAndApply(), PtexSeparableKernel::stripZeros(), PtexSeparableKernel::upresU(), PtexSeparableKernel::upresV(), PtexSeparableKernel::uw, PtexSeparableKernel::vw, and PtexSeparableKernel::weight().

◆ 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

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

◆ _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: