Ptex
|
#include <PtexTriangleFilter.h>
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 PtexFilter * | getFilter (PtexTexture *tx, const Options &opts) |
Definition at line 46 of file PtexTriangleFilter.h.
|
inline |
Definition at line 49 of file PtexTriangleFilter.h.
|
inlineprotectedvirtual |
Definition at line 69 of file PtexTriangleFilter.h.
|
protected |
Definition at line 200 of file PtexTriangleFilter.cpp.
References _tx, applyIter(), PtexTriangleKernel::clampExtent(), PtexTriangleKernel::clampRes(), PtexTexture::getData(), PtexTriangleKernel::getIterators(), PtexTriangleKernel::res, Ptex::FaceInfo::res, and PtexTriangleKernelIter::valid.
Referenced by splitAndApply().
|
protected |
Definition at line 190 of file PtexTriangleFilter.cpp.
References _tx, Ptex::FaceInfo::adjedge(), Ptex::FaceInfo::adjface(), PtexTexture::getFaceInfo(), PtexTriangleKernel::reorient(), and splitAndApply().
Referenced by splitAndApply().
|
protected |
Definition at line 220 of file PtexTriangleFilter.cpp.
References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _weight, PtexTriangleKernelIter::apply(), PtexTriangleKernelIter::applyConst(), PtexFaceData::getData(), PtexFaceData::getTile(), PtexFaceData::isConstant(), PtexFaceData::isTiled(), PtexUtils::max(), PtexUtils::min(), PtexTriangleKernelIter::rowlen, PtexFaceData::tileRes(), PtexTriangleKernelIter::u, Ptex::Res::u(), PtexTriangleKernelIter::u1, PtexTriangleKernelIter::u2, PtexTriangleKernelIter::v, Ptex::Res::v(), PtexTriangleKernelIter::v1, PtexTriangleKernelIter::v2, PtexTriangleKernelIter::w1, PtexTriangleKernelIter::w2, and PtexTriangleKernelIter::weight.
Referenced by apply().
|
protected |
Definition at line 105 of file PtexTriangleFilter.cpp.
References C, PtexUtils::calcResFromWidth(), PtexUtils::max(), PtexUtils::min(), PtexTriangleKernelWidth, and PtexTriangleKernel::set().
Referenced by eval().
|
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.
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 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().
|
inlinevirtual |
Release resources held by this pointer (pointer becomes invalid).
Implements PtexFilter.
Definition at line 53 of file PtexTriangleFilter.h.
|
protected |
Definition at line 167 of file PtexTriangleFilter.cpp.
References Ptex::FaceInfo::adjface(), apply(), applyAcrossEdge(), PtexTriangleKernel::splitU(), PtexTriangleKernel::splitV(), PtexTriangleKernel::splitW(), PtexTriangleKernel::u1, PtexTriangleKernel::v1, and PtexTriangleKernel::w1.
Referenced by applyAcrossEdge(), and eval().
|
protected |
Definition at line 78 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().
|
protected |
Definition at line 75 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().
|
protected |
Definition at line 76 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().
|
protected |
Definition at line 77 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().
|
protected |
Definition at line 72 of file PtexTriangleFilter.h.
|
protected |
Definition at line 73 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().
|
protected |
Definition at line 71 of file PtexTriangleFilter.h.
Referenced by apply(), applyAcrossEdge(), and eval().
|
protected |
Definition at line 74 of file PtexTriangleFilter.h.
Referenced by applyIter(), and eval().