Beatmup
Kernels::BicubicResampling< in_t, out_t >::BicubicKernel Class Reference

Precomputes kernel coefficients in function of bicubic kernel parameter. More...

Public Member Functions

 BicubicKernel (const float alpha)
 
void operator() (float x)
 Computes the kernel itself for a given phase. More...
 
const float operator[] (const int i) const
 

Private Attributes

float c0 [2]
 
float c1 [2]
 
float c2 [3]
 
float coeff [4]
 

Detailed Description

template<class in_t, class out_t>
class Kernels::BicubicResampling< in_t, out_t >::BicubicKernel

Precomputes kernel coefficients in function of bicubic kernel parameter.

Definition at line 194 of file resampling_kernels.h.

Constructor & Destructor Documentation

◆ BicubicKernel()

template<class in_t , class out_t >
Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::BicubicKernel ( const float  alpha)
inline

Definition at line 199 of file resampling_kernels.h.

199  {
200  // alpha*x**3 - 2*alpha*x**2 + alpha*x
201  c0[0] = alpha;
202  c0[1] = -2 * alpha;
203  //alpha*x**3 - alpha*x**2 + 2*x**3 - 3*x**2 + 1
204  c1[0] = - alpha - 3;
205  c1[1] = alpha + 2;
206  // -alpha*x**3 + 2*alpha*x**2 - alpha*x - 2*x**3 + 3*x**2
207  c2[0] = -alpha;
208  c2[1] = 2 * alpha + 3;
209  c2[2] = - alpha - 2;
210  }

Member Function Documentation

◆ operator()()

template<class in_t , class out_t >
void Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::operator() ( float  x)
inline

Computes the kernel itself for a given phase.

Definition at line 215 of file resampling_kernels.h.

215  {
216  const float xx = x * x, xxx = xx * x;
217  coeff[0] = c0[0] * (xxx + x) + c0[1] * xx;
218  coeff[1] = c1[1] * xxx + c1[0] * xx + 1;
219  coeff[2] = c2[2] * xxx + c2[1] * xx + c2[0] * x;
220  coeff[3] = 1 - coeff[0] - coeff[1] - coeff[2];
221  }
jobject jlong jint x

◆ operator[]()

template<class in_t , class out_t >
const float Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::operator[] ( const int  i) const
inline

Definition at line 223 of file resampling_kernels.h.

223  {
224  return coeff[i];
225  }

Member Data Documentation

◆ c0

template<class in_t , class out_t >
float Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::c0[2]
private

Definition at line 196 of file resampling_kernels.h.

◆ c1

template<class in_t , class out_t >
float Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::c1[2]
private

Definition at line 196 of file resampling_kernels.h.

◆ c2

template<class in_t , class out_t >
float Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::c2[3]
private

Definition at line 196 of file resampling_kernels.h.

◆ coeff

template<class in_t , class out_t >
float Kernels::BicubicResampling< in_t, out_t >::BicubicKernel::coeff[4]
private

Definition at line 197 of file resampling_kernels.h.


The documentation for this class was generated from the following file: