46static std::map<InterpolationMethod2D, std::string>
47 interpolation_method_2d_as_string = {{
DELAUNAY,
"Delaunay linear"},
73 float a10 = f10 - f00;
74 float a01 = f01 - f00;
75 float a11 = f11 - f10 - f01 + f00;
76 return f00 + a10 * u + a01 * v + a11 * u * v;
81 return p[1] + 0.5 * x *
83 x * (2.0 * p[0] - 5.0 * p[1] + 4.0 * p[2] - p[3] +
84 x * (3.0 * (p[1] - p[2]) + p[3] - p[0])));
121 const Array &mask_fixed_values,
122 int iterations_max = 10000,
123 float tolerance = 1e-3f,
150 const std::vector<float> &x,
151 const std::vector<float> &y,
152 const std::vector<float> &values,
154 const Array *p_noise_x =
nullptr,
155 const Array *p_noise_y =
nullptr,
156 const Array *p_stretching =
nullptr,
157 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f});
179 const std::vector<float> &x,
180 const std::vector<float> &y,
181 const std::vector<float> &values,
182 const Array *p_noise_x =
nullptr,
183 const Array *p_noise_y =
nullptr,
184 const Array *p_stretching =
nullptr,
185 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f});
208 const std::vector<float> &x,
209 const std::vector<float> &y,
210 const std::vector<float> &values,
211 const Array *p_noise_x =
nullptr,
212 const Array *p_noise_y =
nullptr,
213 const Array *p_stretching =
nullptr,
214 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f});
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:28
InterpolationMethod2D
Enumeration of 2D interpolation methods.
Definition interpolate2d.hpp:34
@ DELAUNAY
Delaunay triangulation method for 2D interpolation.
Definition interpolate2d.hpp:35
@ NEAREST
Nearest point method for 2D interpolation.
Definition interpolate2d.hpp:36
Array interpolate2d_nearest(Vec2< int > shape, const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &values, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
2D interpolation using the nearest neighbor method.
Definition interpolate2d.cpp:51
Array interpolate2d(Vec2< int > shape, const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &values, InterpolationMethod2D interpolation_method, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
Generic 2D interpolation function.
Definition interpolate2d.cpp:16
Array interpolate2d_delaunay(Vec2< int > shape, const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &values, const Array *p_noise_x=nullptr, const Array *p_noise_y=nullptr, const Array *p_stretching=nullptr, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
2D interpolation using the Delaunay triangulation method.
Definition interpolate2d.cpp:90
Array harmonic_interpolation(const Array &array, const Array &mask_fixed_values, int iterations_max=10000, float tolerance=1e-3f, float omega=1.8f)
Perform harmonic interpolation on a 2D array using the Successive Over-Relaxation (SOR) method.
Definition harmonic_interpolation.cpp:11
float bilinear_interp(float f00, float f10, float f01, float f11, float u, float v)
Compute the bilinear interpolated value from four input values.
Definition interpolate2d.hpp:66
float cubic_interpolate(float p[4], float x)
Definition interpolate2d.hpp:79