Ptex
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PtexTriangleFilter Class Reference

#include <PtexTriangleFilter.h>

Inheritance diagram for PtexTriangleFilter:
PtexFilter

Public Member Functions

 PtexTriangleFilter (PtexTexture *tx, const PtexFilter::Options &opts)
 
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.
 
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.
 

Protected Member Functions

void buildKernel (PtexTriangleKernel &k, float u, float v, float uw1, float vw1, float uw2, float vw2, float width, float blur, Res faceRes)
 
void splitAndApply (PtexTriangleKernel &k, int faceid, const Ptex::FaceInfo &f)
 
void applyAcrossEdge (PtexTriangleKernel &k, const Ptex::FaceInfo &f, int eid)
 
void apply (PtexTriangleKernel &k, int faceid, const Ptex::FaceInfo &f)
 
void applyIter (PtexTriangleKernelIter &k, PtexFaceData *dh)
 
virtual ~PtexTriangleFilter ()
 
- 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
 

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 46 of file PtexTriangleFilter.h.

Constructor & Destructor Documentation

◆ PtexTriangleFilter()

PtexTriangleFilter::PtexTriangleFilter ( PtexTexture tx,
const PtexFilter::Options opts 
)
inline

Definition at line 49 of file PtexTriangleFilter.h.

◆ ~PtexTriangleFilter()

virtual PtexTriangleFilter::~PtexTriangleFilter ( )
inlineprotectedvirtual

Definition at line 69 of file PtexTriangleFilter.h.

Member Function Documentation

◆ apply()

void PtexTriangleFilter::apply ( PtexTriangleKernel k,
int  faceid,
const Ptex::FaceInfo f 
)
protected

◆ applyAcrossEdge()

void PtexTriangleFilter::applyAcrossEdge ( PtexTriangleKernel k,
const Ptex::FaceInfo f,
int  eid 
)
protected

◆ applyIter()

void PtexTriangleFilter::applyIter ( PtexTriangleKernelIter k,
PtexFaceData dh 
)
protected

◆ buildKernel()

void PtexTriangleFilter::buildKernel ( PtexTriangleKernel k,
float  u,
float  v,
float  uw1,
float  vw1,
float  uw2,
float  vw2,
float  width,
float  blur,
Res  faceRes 
)
protected

◆ eval()

PTEX_NAMESPACE_BEGIN void PtexTriangleFilter::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 50 of file PtexTriangleFilter.cpp.

References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _tx, _weight, buildKernel(), PtexUtils::clamp(), Ptex::ConvertToFloat(), PtexTexture::dataType(), PtexTexture::getData(), PtexTexture::getFaceInfo(), PtexUtils::min(), PtexTexture::numChannels(), PtexTexture::numFaces(), PtexTriangleKernel::res, and splitAndApply().

◆ release()

virtual void PtexTriangleFilter::release ( )
inlinevirtual

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

Implements PtexFilter.

Definition at line 53 of file PtexTriangleFilter.h.

◆ splitAndApply()

void PtexTriangleFilter::splitAndApply ( PtexTriangleKernel k,
int  faceid,
const Ptex::FaceInfo f 
)
protected

Member Data Documentation

◆ _dt

DataType PtexTriangleFilter::_dt
protected

Definition at line 78 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

◆ _firstChanOffset

int PtexTriangleFilter::_firstChanOffset
protected

Definition at line 75 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

◆ _nchan

int PtexTriangleFilter::_nchan
protected

Definition at line 76 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

◆ _ntxchan

int PtexTriangleFilter::_ntxchan
protected

Definition at line 77 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

◆ _options

Options PtexTriangleFilter::_options
protected

Definition at line 72 of file PtexTriangleFilter.h.

◆ _result

float* PtexTriangleFilter::_result
protected

Definition at line 73 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().

◆ _tx

PtexTexture* PtexTriangleFilter::_tx
protected

Definition at line 71 of file PtexTriangleFilter.h.

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

◆ _weight

float PtexTriangleFilter::_weight
protected

Definition at line 74 of file PtexTriangleFilter.h.

Referenced by applyIter(), and eval().


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