Ptex
PtexWidth4Filter Class Reference

Separable filter with width=4 support. More...

Inheritance diagram for PtexWidth4Filter:
PtexSeparableFilter PtexFilter PtexBicubicFilter PtexGaussianFilter

Public Types

typedef float KernelFn(float x, const float *c)
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...

Public Member Functions

 PtexWidth4Filter (PtexTexture *tx, const PtexFilter::Options &opts, KernelFn k, const float *c=0)
virtual void buildKernel (PtexSeparableKernel &k, float u, float v, float uw, float vw, Res faceRes)
Public Member Functions inherited from PtexSeparableFilter
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.

Private Member Functions

float blur (float x)
void buildKernelAxis (int8_t &k_ureslog2, int &k_u, int &k_uw, float *ku, float u, float uw, int f_ureslog2)

Private Attributes

KernelFn_k
const float * _c

Additional Inherited Members

Static Public Member Functions inherited from PtexFilter
static PtexFiltergetFilter (PtexTexture *tx, const Options &opts)
Protected Member Functions inherited from PtexSeparableFilter
 PtexSeparableFilter (PtexTexture *tx, const PtexFilter::Options &opts)
virtual ~PtexSeparableFilter ()
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 inherited from PtexSeparableFilter
PtexTexture_tx
Options _options
float * _result
float _weight
int _firstChanOffset
int _nchan
int _ntxchan
DataType _dt
BorderMode _uMode
BorderMode _vMode
EdgeFilterMode _efm

Detailed Description

Separable filter with width=4 support.

The kernel width is calculated as a multiple of 4 times the filter width and the texture resolution is chosen such that each kernel axis has between 4 and 8.

For kernel widths too large to handle (because the kernel would extend significantly beyond both sides of the face), a special Hermite smoothstep is used to interpolate the two nearest 2 samples along the affected axis (or axes).

Definition at line 116 of file PtexFilters.cpp.

Member Typedef Documentation

◆ KernelFn

typedef float PtexWidth4Filter::KernelFn(float x, const float *c)

Definition at line 119 of file PtexFilters.cpp.

Constructor & Destructor Documentation

◆ PtexWidth4Filter()

PtexWidth4Filter::PtexWidth4Filter ( PtexTexture * tx,
const PtexFilter::Options & opts,
KernelFn k,
const float * c = 0 )
inline

Member Function Documentation

◆ blur()

float PtexWidth4Filter::blur ( float x)
inlineprivate

Definition at line 133 of file PtexFilters.cpp.

References PtexUtils::abs().

Referenced by buildKernelAxis().

◆ buildKernel()

virtual void PtexWidth4Filter::buildKernel ( PtexSeparableKernel & k,
float u,
float v,
float uw,
float vw,
Res faceRes )
inlinevirtual

◆ buildKernelAxis()

void PtexWidth4Filter::buildKernelAxis ( int8_t & k_ureslog2,
int & k_u,
int & k_uw,
float * ku,
float u,
float uw,
int f_ureslog2 )
inlineprivate

Member Data Documentation

◆ _c

const float* PtexWidth4Filter::_c
private

Definition at line 247 of file PtexFilters.cpp.

Referenced by buildKernelAxis(), and PtexWidth4Filter().

◆ _k

KernelFn* PtexWidth4Filter::_k
private

Definition at line 246 of file PtexFilters.cpp.

Referenced by buildKernelAxis(), and PtexWidth4Filter().


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