Ptex
|
#include <PtexSeparableFilter.h>
Public Member Functions | |
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 | |
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. | |
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 PtexFilter * | getFilter (PtexTexture *tx, const Options &opts) |
Definition at line 45 of file PtexSeparableFilter.h.
|
inlineprotected |
Definition at line 55 of file PtexSeparableFilter.h.
References PtexFilter::Options::__structSize, _options, and PtexFilter::Options::noedgeblend.
|
inlineprotectedvirtual |
Definition at line 66 of file PtexSeparableFilter.h.
|
protected |
Definition at line 348 of file PtexSeparableFilter.cpp.
References _dt, _efm, _firstChanOffset, _nchan, _ntxchan, _result, _tx, PtexSeparableKernel::apply(), PtexSeparableKernel::applyConst(), PtexSeparableKernel::downresU(), PtexSeparableKernel::downresV(), PtexTexture::getData(), PtexSeparableKernel::ku, PtexSeparableKernel::kv, PtexUtils::min(), PtexSeparableKernel::res, Ptex::FaceInfo::res, PtexSeparableKernel::rot, PtexSeparableKernel::u, Ptex::Res::u(), PtexSeparableKernel::uw, PtexSeparableKernel::v, Ptex::Res::v(), and PtexSeparableKernel::vw.
Referenced by applyAcrossEdge(), applyToCornerFace(), and splitAndApply().
|
protected |
Definition at line 215 of file PtexSeparableFilter.cpp.
References _tx, Ptex::FaceInfo::adjedge(), Ptex::FaceInfo::adjface(), PtexSeparableKernel::adjustMainToSubface(), PtexSeparableKernel::adjustSubfaceToMain(), apply(), PtexTexture::getFaceInfo(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::rotate(), and splitAndApply().
Referenced by splitAndApply().
|
protected |
Definition at line 257 of file PtexSeparableFilter.cpp.
References _tx, _weight, PtexSeparableKernel::adjustSubfaceToMain(), applyToCornerFace(), PtexTexture::getFaceInfo(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::makeSymmetric(), PtexSeparableKernel::rotate(), splitAndApply(), and PtexSeparableKernel::weight().
Referenced by splitAndApply().
|
protected |
Definition at line 331 of file PtexSeparableFilter.cpp.
References PtexSeparableKernel::adjustMainToSubface(), PtexSeparableKernel::adjustSubfaceToMain(), apply(), Ptex::FaceInfo::isSubface(), PtexSeparableKernel::rotate(), and splitAndApply().
Referenced by applyToCorner().
|
protectedpure virtual |
Implemented in PtexWidth4Filter, PtexBoxFilter, and PtexBilinearFilter.
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 47 of file PtexSeparableFilter.cpp.
References _dt, _firstChanOffset, _nchan, _ntxchan, _result, _tx, _uMode, _vMode, _weight, PtexUtils::abs(), buildKernel(), PtexUtils::clamp(), Ptex::ConvertToFloat(), PtexTexture::getData(), PtexTexture::getFaceInfo(), PtexSeparableKernel::kmax, PtexUtils::min(), PtexTexture::numFaces(), PtexSeparableKernel::res, splitAndApply(), PtexSeparableKernel::stripZeros(), PtexSeparableKernel::upresU(), PtexSeparableKernel::upresV(), PtexSeparableKernel::uw, PtexSeparableKernel::vw, and PtexSeparableKernel::weight().
|
inlinevirtual |
Release resources held by this pointer (pointer becomes invalid).
Implements PtexFilter.
Definition at line 48 of file PtexSeparableFilter.h.
|
protected |
Definition at line 135 of file PtexSeparableFilter.cpp.
References _options, _uMode, _vMode, Ptex::FaceInfo::adjface(), apply(), applyAcrossEdge(), applyToCorner(), PtexSeparableKernel::mergeB(), PtexSeparableKernel::mergeL(), PtexSeparableKernel::mergeR(), PtexSeparableKernel::mergeT(), PtexFilter::Options::noedgeblend, PtexSeparableKernel::res, PtexSeparableKernel::splitB(), PtexSeparableKernel::splitL(), PtexSeparableKernel::splitR(), PtexSeparableKernel::splitT(), PtexSeparableKernel::u, PtexSeparableKernel::uw, PtexSeparableKernel::v, and PtexSeparableKernel::vw.
Referenced by applyAcrossEdge(), applyToCorner(), applyToCornerFace(), and eval().
|
protected |
Definition at line 85 of file PtexSeparableFilter.h.
|
protected |
Definition at line 87 of file PtexSeparableFilter.h.
Referenced by apply().
|
protected |
Definition at line 82 of file PtexSeparableFilter.h.
|
protected |
Definition at line 83 of file PtexSeparableFilter.h.
|
protected |
Definition at line 84 of file PtexSeparableFilter.h.
|
protected |
Definition at line 79 of file PtexSeparableFilter.h.
Referenced by PtexWidth4Filter::buildKernelAxis(), PtexSeparableFilter(), and splitAndApply().
|
protected |
Definition at line 80 of file PtexSeparableFilter.h.
|
protected |
Definition at line 78 of file PtexSeparableFilter.h.
Referenced by apply(), applyAcrossEdge(), applyToCorner(), and eval().
|
protected |
Definition at line 86 of file PtexSeparableFilter.h.
Referenced by eval(), and splitAndApply().
|
protected |
Definition at line 86 of file PtexSeparableFilter.h.
Referenced by eval(), and splitAndApply().
|
protected |
Definition at line 81 of file PtexSeparableFilter.h.
Referenced by applyToCorner(), and eval().