47 return (
float)exp(scale * x_squared);
52 template<
class T,
int nChan>
57 for (
int vi = k.
v1; vi != k.
v2; vi++) {
61 float U = (float)x1 - k.
u;
62 float V = (
float)vi - k.
v;
63 float DQ = k.
A*(2.0f*U+1.0f)+k.
B*V;
64 float Q = k.
A*U*U + (k.
B*U + k.
C*V)*V;
65 T* p =
static_cast<T*
>(data) + (vi * k.
rowlen + x1) * nTxChan;
66 T* pEnd = p + (x2-x1)*nTxChan;
67 for (; p < pEnd; p += nTxChan) {
80 template<
class T,
int nChan>
84 for (
int vi = k.
v1; vi != k.
v2; vi++) {
88 float U = (float)x1 - k.
u;
89 float V = (
float)vi - k.
v;
90 float DQ = k.
A*(2.0f*U+1.0f)+k.
B*V;
91 float Q = k.
A*U*U + (k.
B*U + k.
C*V)*V;
92 T* p =
static_cast<T*
>(data) + (vi * k.
rowlen + x1) * nTxChan;
93 T* pEnd = p + (x2-x1)*nTxChan;
94 for (; p < pEnd; p += nTxChan) {
110 float DDQ = 2.0f*k.
A;
111 for (
int vi = k.
v1; vi != k.
v2; vi++) {
115 float U = (float)x1 - k.
u;
116 float V = (
float)vi - k.
v;
117 float DQ = k.
A*(2.0f*U+1.0f)+k.
B*V;
118 float Q = k.
A*U*U + (k.
B*U + k.
C*V)*V;
119 T* p =
static_cast<T*
>(data) + (vi * k.
rowlen + x1) * nTxChan;
120 T* pEnd = p + (x2-x1)*nTxChan;
121 for (; p < pEnd; p += nTxChan) {
138 ApplyN<uint8_t>, ApplyN<uint16_t>, ApplyN<PtexHalf>, ApplyN<float>,
139 Apply<uint8_t,1>, Apply<uint16_t,1>, Apply<PtexHalf,1>, Apply<float,1>,
140 Apply<uint8_t,2>, Apply<uint16_t,2>, Apply<PtexHalf,2>, Apply<float,2>,
141 Apply<uint8_t,3>, Apply<uint16_t,3>, Apply<PtexHalf,3>, Apply<float,3>,
142 Apply<uint8_t,4>, Apply<uint16_t,4>, Apply<PtexHalf,4>, Apply<float,4>,
145 ApplyN<uint8_t>, ApplyN<uint16_t>, ApplyN<PtexHalf>, ApplyN<float>,
146 ApplyS<uint8_t,1>, ApplyS<uint16_t,1>, ApplyS<PtexHalf,1>, ApplyS<float,1>,
147 ApplyS<uint8_t,2>, ApplyS<uint16_t,2>, ApplyS<PtexHalf,2>, ApplyS<float,2>,
148 ApplyS<uint8_t,3>, ApplyS<uint16_t,3>, ApplyS<PtexHalf,3>, ApplyS<float,3>,
149 ApplyS<uint8_t,4>, ApplyS<uint16_t,4>, ApplyS<PtexHalf,4>, ApplyS<float,4>,
157 for (
int vi =
v1; vi !=
v2; vi++) {
161 float U = (float)x1 -
u;
162 float V = (float)vi -
v;
163 float DQ =
A*(2.0f*U+1.0f)+
B*V;
164 float Q =
A*U*U + (
B*U +
C*V)*V;
165 for (
int x = x1; x < x2; x++) {