00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef INTERPOLATION_H_
00025 #define INTERPOLATION_H_
00026
00027 #include <proj_api.h>
00028 #include <math.h>
00029
00030 #define PI 3.1415926535897932384626433832795
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036
00042 #define MIFI_NEAREST_NEIGHBOR 0
00043
00048 #define MIFI_BILINEAR 1
00049
00054 #define MIFI_BICUBIC 2
00055
00067 #define MIFI_COORD_NN 3
00068
00085 #define MIFI_COORD_NN_KD 4
00086
00092 #define MIFI_VECTOR_KEEP_SIZE 0
00093
00098 #define MIFI_VECTOR_RESIZE 1
00099
00100
00102 #define MIFI_UNDEFINED_F (nanf(""))
00103
00104 #define MIFI_UNDEFINED_D (nan(""))
00105
00107 #define MIFI_ERROR -1
00108
00109 #define MIFI_OK 1
00110
00112 #define MIFI_PROJ_AXIS 0
00113
00114 #define MIFI_LONGITUDE 1
00115
00116 #define MIFI_LATITUDE 2
00117
00119 #define MIFI_DEBUG 0
00120
00145 extern int mifi_interpolate_f(int method,
00146 const char* proj_input, const float* infield, const double* in_x_axis, const double* in_y_axis,
00147 const int in_x_axis_type, const int in_y_axis_type, const int ix, const int iy, const int iz,
00148 const char* proj_output, float* outfield, const double* out_x_axis, const double* out_y_axis,
00149 const int out_x_axis_type, const int out_y_axis_type, const int ox, const int oy);
00150
00157 extern int mifi_interpolate_d(int method,
00158 char* proj_input, double* infield, double* in_x_axis, double* in_y_axis,
00159 int in_x_axis_type, int in_y_axis_type, int ix, int iy, int iz,
00160 char* proj_output, double* outfield, double* out_x_axis, double* out_y_axis,
00161 int out_x_axis_type, int out_y_axis_type, int ox, int oy);
00162
00198 extern int mifi_vector_reproject_values_f(int method,
00199 const char* proj_input,
00200 const char* proj_output,
00201 float* u_out, float* v_out,
00202 const double* out_x_axis, const double* out_y_axis,
00203 int out_x_axis_type, int out_y_axis_type,
00204 int ox, int oy, int oz);
00216 extern int mifi_vector_reproject_values_by_matrix_f(int method,
00217 const double* matrix,
00218 float* u_out, float* v_out,
00219 int ox, int oy, int oz);
00220
00236 extern int mifi_get_vector_reproject_matrix(const char* proj_input,
00237 const char* proj_output,
00238 const double* out_x_axis, const double* out_y_axis,
00239 int out_x_axis_type, int out_y_axis_type,
00240 int ox, int oy,
00241 double* matrix);
00242
00243
00250 extern int mifi_get_values_f(const float* infield, float* outfield, const double x, const double y, const int ix, const int iy, const int iz);
00251
00273 extern int mifi_get_values_bilinear_f(const float* infield, float* outvalues, const double x, const double y, const int ix, const int iy, const int iz);
00274
00275
00290 extern int mifi_get_values_bicubic_f(const float* infield, float* outvalues, const double x, const double y, const int ix, const int iy, const int iz);
00291
00307 extern void mifi_get_values_linear_f(const float* infieldA, const float* infieldB, float* outfield, const size_t n, const double a, const double b, const double x);
00308
00309
00321 extern int mifi_points2position(double* points, const int n, const double* axis, const int num, const int axis_type);
00322
00323
00329 extern int mifi_3d_array_position(int x, int y, int z, int ix, int iy, int iz);
00330
00331
00345 int mifi_project_values(const char* proj_input, const char* proj_output, double* in_out_x_vals, double* in_out_y_vals, const int num);
00346
00363 extern int mifi_project_axes(const char* proj_input, const char* proj_output, const double* in_x_axis, const double* in_y_axis, const int ix, const int iy, double* out_xproj_axis, double* out_yproj_axis);
00364
00375 extern size_t mifi_bad2nanf(float* posPtr, float* endPtr, float badVal);
00384 extern size_t mifi_nanf2bad(float* posPtr, float* endPtr, float badVal);
00385
00386 #ifdef __cplusplus
00387 }
00388 #endif
00389
00390
00391 #endif