52 #ifndef __PCL_BilinearInterpolation_h
53 #define __PCL_BilinearInterpolation_h
58 #include <pcl/Diagnostics.h>
68 #define m_width this->m_width
69 #define m_height this->m_height
70 #define m_fillBorder this->m_fillBorder
71 #define m_fillValue this->m_fillValue
72 #define m_data this->m_data
116 PCL_PRECONDITION( m_data !=
nullptr )
117 PCL_PRECONDITION( m_width > 0 && m_height > 0 )
125 double p00, p10, p01, p11;
126 const T* fp = m_data + (
int64( i0 )*m_width + j0);
129 p10 = (j1 < m_width) ? fp[1] : (m_fillBorder ? m_fillValue : *fp);
133 else if ( m_fillBorder )
135 p01 = p11 = m_fillValue;
140 p11 = (j1 < m_width) ? fp[1] : (m_fillBorder ? m_fillValue : *fp);
143 double dx = x - j0, dx1 = 1 - dx;
144 double dy = y - i0, dy1 = 1 - dy;
145 return p00*dx1*dy1 + p10*dx*dy1 + p01*dx1*dy + p11*dx*dy;
A generic interface to two-dimensional interpolation algorithms.
Bilinear interpolation algorithm.
~BilinearInterpolation() override
double operator()(double x, double y) const override
BilinearInterpolation(const BilinearInterpolation &)=default
BilinearInterpolation()=default
int TruncInt(T x) noexcept
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept