#include <resampling_kernels.h>
|
class | BicubicKernel |
| Precomputes kernel coefficients in function of bicubic kernel parameter. More...
|
|
template<class in_t, class out_t>
class Kernels::BicubicResampling< in_t, out_t >
Definition at line 189 of file resampling_kernels.h.
◆ process()
template<class in_t , class out_t >
Resamples a rectangle from an input bitmap to a rectangle in an output bitmap applying a bicubic kernel.
Definition at line 232 of file resampling_kernels.h.
237 srcW =
src.width(), srcH =
src.height(),
239 shiftX = (srcW - dstW) / 2,
240 shiftY = (srcH - dstH) / 2;
247 BicubicKernel kx(alpha), ky(alpha);
249 for (
int y = sliceStart;
y < sliceStop; ++
y) {
251 const float fsy = (float)(
y * srcH + shiftY) / dstH;
252 const int isy = (int)fsy;
253 const float fy = fsy - (float)isy;
254 const int sy =
src.a.y + isy;
256 const int lineJump[3] = {
258 sy < srcH - 1 ? srcW : 0,
259 sy < srcH - 2 ? srcW : 0
265 typename out_t::pixtype acc;
266 for (
int x = 0;
x < dstW; ++
x) {
268 const float fsx = (float)(
x * srcW + shiftX) / dstW;
269 const int isx = (int)fsx;
270 const float fx = fsx - (float)isx;
271 const int sx =
src.a.x + isx;
275 const int pixJump[3] = {
277 sx < srcW - 1 ? +1 : 0,
278 sx < srcW - 2 ? +2 : 0
281 in.goTo(sx, sy > 0 ? sy - 1 : 0);
282 acc = in[pixJump[0]] * kx[0] * ky[0] + in() * kx[1] * ky[0] + in[pixJump[1]] * kx[2] * ky[0] + in[pixJump[2]] * kx[3] * ky[0];
284 acc = acc + in[pixJump[0]] * kx[0] * ky[1] + in() * kx[1] * ky[1] + in[pixJump[1]] * kx[2] * ky[1] + in[pixJump[2]] * kx[3] * ky[1];
286 acc = acc + in[pixJump[0]] * kx[0] * ky[2] + in() * kx[1] * ky[2] + in[pixJump[1]] * kx[2] * ky[2] + in[pixJump[2]] * kx[3] * ky[2];
288 acc = acc + in[pixJump[0]] * kx[0] * ky[3] + in() * kx[1] * ky[3] + in[pixJump[1]] * kx[2] * ky[3] + in[pixJump[2]] * kx[3] * ky[3];
virtual ThreadIndex numThreads() const =0
ThreadIndex currentThread() const
virtual bool isTaskAborted() const =0
Returns true if the task is asked to stop from outside.
jobject jlong jint jint y
return(jlong) new Beatmup jlong jstring src
The documentation for this class was generated from the following file: