24 template <
class RT,
class PT,
class T>
31 xsize_ = arr_->info().getSize(0);
32 ysize_ = arr_->info().getSize(1);
36 inline RT getValue(PT,PT)
const;
38 {
return getValue(p[0],p[1]); }
49 template <
class RT,
class PT,
class T>
inline 54 if ( ix0<0 || ix0>=xsize_-1 )
return mUdf(
RT);
58 if ( iy0<0 || iy0>=ysize_-1)
return mUdf(
RT);
60 if ( xsize_<4 || ysize_<4 || !ix0 || !iy0 ||
61 ix0>=xsize_-2 || iy0>=ysize_-2 )
65 return Interpolate::linearReg2DWithUdf<T>(
66 arr_->get( ix0, iy0 ),
67 arr_->get( ix0, iy0+1 ),
68 arr_->get( ix0+1, iy0 ),
69 arr_->get( ix0+1, iy0+1),
73 return Interpolate::linearReg2D<T>(
74 arr_->get( ix0, iy0 ),
75 arr_->get( ix0, iy0+1 ),
76 arr_->get( ix0+1, iy0 ),
77 arr_->get( ix0+1, iy0+1 ),
83 return Interpolate::polyReg2DWithUdf<T>(
84 arr_->get( ix0-1, iy0 ),
85 arr_->get( ix0-1, iy0+1 ),
86 arr_->get( ix0, iy0-1 ),
87 arr_->get( ix0, iy0 ),
88 arr_->get( ix0, iy0+1 ),
89 arr_->get( ix0, iy0+2 ),
90 arr_->get( ix0+1, iy0-1 ),
91 arr_->get( ix0+1, iy0 ),
92 arr_->get( ix0+1, iy0+1 ),
93 arr_->get( ix0+1, iy0+2 ),
94 arr_->get( ix0+2, iy0 ),
95 arr_->get( ix0+2, iy0+1 ),
100 return Interpolate::polyReg2D<T>( arr_->get( ix0-1, iy0 ),
101 arr_->get( ix0-1, iy0+1 ),
102 arr_->get( ix0, iy0-1 ),
103 arr_->get( ix0, iy0 ),
104 arr_->get( ix0, iy0+1 ),
105 arr_->get( ix0, iy0+2 ),
106 arr_->get( ix0+1, iy0-1 ),
107 arr_->get( ix0+1, iy0 ),
108 arr_->get( ix0+1, iy0+1 ),
109 arr_->get( ix0+1, iy0+2 ),
110 arr_->get( ix0+2, iy0 ),
111 arr_->get( ix0+2, iy0+1 ),
int xsize_
Definition: array2dfunc.h:43
RT getValue(PT, PT) const
Definition: array2dfunc.h:50
int ysize_
Definition: array2dfunc.h:44
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
RT getValue(const PT *p) const
Definition: array2dfunc.h:37
A Math Function as in F(x,y).
Definition: mathfunc.h:105
bool hasudfs_
Definition: array2dfunc.h:45
#define mClass(module)
Definition: commondefs.h:164
const Array2D< T > * arr_
Definition: array2dfunc.h:42
int getArrIdxPosition(const float farridx, const int arrsz, float &relpos, const float eps=1e-4)
Definition: simpnumer.h:29
Adaptor to make an Array2D behave like a MathXYFunction. Will do linear interpolation at the edges...
Definition: array2dfunc.h:25