Ptex
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
PtexFilter Class Referenceabstract

Interface for filtered sampling of ptex data files. More...

#include <Ptexture.h>

Inheritance diagram for PtexFilter:
PtexPointFilter PtexPointFilterTri PtexSeparableFilter PtexTriangleFilter PtexBilinearFilter PtexBoxFilter PtexWidth4Filter PtexBicubicFilter PtexGaussianFilter

Classes

struct  Options
 Choose filter options. More...
 

Public Types

enum  FilterType {
  f_point , f_bilinear , f_box , f_gaussian ,
  f_bicubic , f_bspline , f_catmullrom , f_mitchell
}
 Filter types. More...
 

Public Member Functions

virtual void release ()=0
 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=1, float blur=0)=0
 Apply filter to a ptex data file.
 

Static Public Member Functions

static PtexFiltergetFilter (PtexTexture *tx, const Options &opts)
 

Protected Member Functions

virtual ~PtexFilter ()
 Destructor not for public use. Use release() instead.
 

Detailed Description

Interface for filtered sampling of ptex data files.

PtexFilter instances are obtained by calling one of the particular static methods. When finished using the filter, it must be returned to the library using release().

To apply the filter to a ptex data file, use the eval() method.

Definition at line 937 of file Ptexture.h.

Member Enumeration Documentation

◆ FilterType

Filter types.

Enumerator
f_point 

Point-sampled (no filtering)

f_bilinear 

Bi-linear interpolation.

f_box 

Box filter.

f_gaussian 

Gaussian filter.

f_bicubic 

General bi-cubic filter (uses sharpness option)

f_bspline 

BSpline (equivalent to bi-cubic w/ sharpness=0)

f_catmullrom 

Catmull-Rom (equivalent to bi-cubic w/ sharpness=1)

f_mitchell 

Mitchell (equivalent to bi-cubic w/ sharpness=2/3)

Definition at line 944 of file Ptexture.h.

Constructor & Destructor Documentation

◆ ~PtexFilter()

virtual PtexFilter::~PtexFilter ( )
inlineprotectedvirtual

Destructor not for public use. Use release() instead.

Definition at line 940 of file Ptexture.h.

Member Function Documentation

◆ eval()

virtual void PtexFilter::eval ( 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 
)
pure 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]

Implemented in PtexSeparableFilter, PtexTriangleFilter, PtexPointFilter, and PtexPointFilterTri.

◆ getFilter()

PtexFilter * PtexFilter::getFilter ( PtexTexture tx,
const Options opts 
)
static

◆ release()

virtual void PtexFilter::release ( )
pure virtual

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

Implemented in PtexPointFilter, PtexPointFilterTri, PtexSeparableFilter, and PtexTriangleFilter.


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