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_INTERPOL_NEAREST_NEIGHBOR 0
00043
00048 #define MIFI_INTERPOL_BILINEAR 1
00049
00054 #define MIFI_INTERPOL_BICUBIC 2
00055
00067 #define MIFI_INTERPOL_COORD_NN 3
00068
00085 #define MIFI_INTERPOL_COORD_NN_KD 4
00086
00092 #define MIFI_INTERPOL_FORWARD_SUM 5
00093
00099 #define MIFI_INTERPOL_FORWARD_MEAN 6
00100
00106 #define MIFI_INTERPOL_FORWARD_MEDIAN 7
00107
00108
00114 #define MIFI_INTERPOL_FORWARD_MAX 8
00115
00121 #define MIFI_INTERPOL_FORWARD_MIN 9
00122
00128 #define MIFI_VECTOR_KEEP_SIZE 0
00129
00134 #define MIFI_VECTOR_RESIZE 1
00135
00136
00138 #define MIFI_UNDEFINED_F (nanf(""))
00139
00140 #define MIFI_UNDEFINED_D (nan(""))
00141
00143 #define MIFI_ERROR -1
00144
00145 #define MIFI_OK 1
00146
00148 #define MIFI_PROJ_AXIS 0
00149
00150 #define MIFI_LONGITUDE 1
00151
00152 #define MIFI_LATITUDE 2
00153
00155 #define MIFI_DEBUG 0
00156
00181 extern int mifi_interpolate_f(int method,
00182 const char* proj_input, const float* infield, const double* in_x_axis, const double* in_y_axis,
00183 const int in_x_axis_type, const int in_y_axis_type, const int ix, const int iy, const int iz,
00184 const char* proj_output, float* outfield, const double* out_x_axis, const double* out_y_axis,
00185 const int out_x_axis_type, const int out_y_axis_type, const int ox, const int oy);
00186
00193 extern int mifi_interpolate_d(int method,
00194 char* proj_input, double* infield, double* in_x_axis, double* in_y_axis,
00195 int in_x_axis_type, int in_y_axis_type, int ix, int iy, int iz,
00196 char* proj_output, double* outfield, double* out_x_axis, double* out_y_axis,
00197 int out_x_axis_type, int out_y_axis_type, int ox, int oy);
00198
00234 extern int mifi_vector_reproject_values_f(int method,
00235 const char* proj_input,
00236 const char* proj_output,
00237 float* u_out, float* v_out,
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, int oz);
00252 extern int mifi_vector_reproject_values_by_matrix_f(int method,
00253 const double* matrix,
00254 float* u_out, float* v_out,
00255 int ox, int oy, int oz);
00256
00272 extern int mifi_get_vector_reproject_matrix(const char* proj_input,
00273 const char* proj_output,
00274 const double* out_x_axis, const double* out_y_axis,
00275 int out_x_axis_type, int out_y_axis_type,
00276 int ox, int oy,
00277 double* matrix);
00278
00279
00286 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);
00287
00309 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);
00310
00311
00326 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);
00327
00342 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);
00343
00344
00356 extern int mifi_points2position(double* points, const int n, const double* axis, const int num, const int axis_type);
00357
00358
00364 extern int mifi_3d_array_position(int x, int y, int z, int ix, int iy, int iz);
00365
00366
00380 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);
00381
00398 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);
00399
00410 extern size_t mifi_bad2nanf(float* posPtr, float* endPtr, float badVal);
00419 extern size_t mifi_nanf2bad(float* posPtr, float* endPtr, float badVal);
00420
00421 #ifdef __cplusplus
00422 }
00423 #endif
00424
00425
00426 #endif