1#ifndef PtexTriangleKernel_h
2#define PtexTriangleKernel_h
65 void apply(
float* dst,
void* data, DataType dt,
int nChan,
int nTxChan)
69 fn(*
this, dst, data, nChan, nTxChan);
72 void applyConst(
float* dst,
void* data, DataType dt,
int nChan);
90 void set(Res resVal,
float uVal,
float vVal,
91 float u1Val,
float v1Val,
float w1Val,
92 float u2Val,
float v2Val,
float w2Val,
93 float AVal,
float BVal,
float CVal)
97 u1 = u1Val;
v1 = v1Val;
w1 = w1Val;
98 u2 = u2Val;
v2 = v2Val;
w2 = w2Val;
99 A = AVal;
B = BVal;
C = CVal;
102 void set(
float uVal,
float vVal,
103 float u1Val,
float v1Val,
float w1Val,
104 float u2Val,
float v2Val,
float w2Val)
107 u1 = u1Val;
v1 = v1Val;
w1 = w1Val;
108 u2 = u2Val;
v2 = v2Val;
w2 = w2Val;
111 void setABC(
float AVal,
float BVal,
float CVal)
113 A = AVal;
B = BVal;
C = CVal;
155#define C(eid, aeid) (eid*3 + aeid)
156 switch (
C(eid, aeid)) {
162 case C(1, 1):
set(1.0f-
u, 1.0f-
v, 1.0f-
u2, 1.0f-
v2, -
w2, 1.0f-
u1, 1.0f-
v1, -
w1);
break;
193 float Finv = 1.0f/((float)resu*(
float)resu*(
A*
C - 0.25f *
B *
B));
194 float Ak =
A*Finv, Bk =
B*Finv, Ck =
C*Finv;
198 ke.
wscale = 1.0f/((float)resu*(
float)resu);
199 float scale = (float)ke.
rowlen;
200 ke.
u =
u * scale - float(1/3.0);
201 ke.
v =
v * scale - float(1/3.0);
202 ke.
u1 = int(PtexUtils::ceil(
u1 * scale -
float(1/3.0)));
203 ke.
v1 = int(PtexUtils::ceil(
v1 * scale -
float(1/3.0)));
204 ke.
w1 = int(PtexUtils::ceil(
w1 * scale -
float(1/3.0)));
205 ke.
u2 = int(PtexUtils::ceil(
u2 * scale -
float(1/3.0)));
206 ke.
v2 = int(PtexUtils::ceil(
v2 * scale -
float(1/3.0)));
207 ke.
w2 = int(PtexUtils::ceil(
w2 * scale -
float(1/3.0)));
208 ke.
A = Ak; ke.
B = Bk; ke.
C = Ck;
215 ko.
u = (1.0f-
v) * scale -
float(1/3.0);
216 ko.
v = (1.0f-
u) * scale -
float(1/3.0);
217 ko.
u1 = int(PtexUtils::ceil((1.0f-
v2) * scale -
float(1/3.0)));
218 ko.
v1 = int(PtexUtils::ceil((1.0f-
u2) * scale -
float(1/3.0)));
219 ko.
w1 = int(PtexUtils::ceil((-
w2) * scale -
float(1/3.0)));
220 ko.
u2 = int(PtexUtils::ceil((1.0f-
v1) * scale -
float(1/3.0)));
221 ko.
v2 = int(PtexUtils::ceil((1.0f-
u1) * scale -
float(1/3.0)));
222 ko.
w2 = int(PtexUtils::ceil((-
w1) * scale -
float(1/3.0)));
223 ko.
A = Ck; ko.
B = Bk; ko.
C = Ak;
PTEX_NAMESPACE_BEGIN const float PtexTriangleKernelWidth
#define PTEX_NAMESPACE_END
Public API classes for reading, writing, caching, and filtering Ptex files.
Triangle filter kernel iterator (in texel coords)
static ApplyFn applyFunctions[40]
void(* ApplyFn)(PtexTriangleKernelIter &k, float *dst, void *data, int nChan, int nTxChan)
void apply(float *dst, void *data, DataType dt, int nChan, int nTxChan)
void applyConst(float *dst, void *data, DataType dt, int nChan)
Triangle filter kernel (in normalized triangle coords)
void reorient(int eid, int aeid)
void set(Res resVal, float uVal, float vVal, float u1Val, float v1Val, float w1Val, float u2Val, float v2Val, float w2Val, float AVal, float BVal, float CVal)
void set(float uVal, float vVal, float u1Val, float v1Val, float w1Val, float u2Val, float v2Val, float w2Val)
void splitW(PtexTriangleKernel &ka)
void splitV(PtexTriangleKernel &ka)
void splitU(PtexTriangleKernel &ka)
void getIterators(PtexTriangleKernelIter &ke, PtexTriangleKernelIter &ko)
void setABC(float AVal, float BVal, float CVal)