00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef SINFO_UTILITIES_H
00028 #define SINFO_UTILITIES_H
00029
00030 #ifdef HAVE_CONFIG_H
00031 # include <config.h>
00032 #endif
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #define sinfo_skip_if(CONDITION) \
00084 do if (CONDITION) { \
00085 if (cpl_error_get_code()) { \
00086 cpl_msg_debug("", "Skip in %s line %d due to '%s' with error '%s' " \
00087 "at %s", __FILE__, __LINE__, #CONDITION, \
00088 cpl_error_get_message(), cpl_error_get_where()); \
00089 if (strstr(cpl_error_get_where(), "visir") == NULL) \
00090 cpl_error_set_where(""); \
00091 } else { \
00092 cpl_msg_debug("", "Skip in %s line %d due to '%s'", \
00093 __FILE__, __LINE__, #CONDITION); \
00094 cpl_error_set("", CPL_ERROR_UNSPECIFIED); \
00095 } \
00096 goto cleanup; \
00097 } else { \
00098 if (cpl_error_get_code()) \
00099 cpl_msg_debug("", "No skip in %s line %d due to '%s' with error '%s' " \
00100 "at %s", __FILE__, __LINE__, #CONDITION, \
00101 cpl_error_get_message(), cpl_error_get_where()); \
00102 else \
00103 cpl_msg_debug("", "No skip in %s line %d due to '%s'", \
00104 __FILE__, __LINE__, #CONDITION); \
00105 } while (0)
00106
00107
00108 #define sinfo_end_skip \
00109 do { \
00110 cleanup: \
00111 if (cpl_error_get_code()) \
00112 cpl_msg_debug("", "Cleanup in %s line %d with error '%s' at %s", \
00113 __FILE__, __LINE__, \
00114 cpl_error_get_message(), cpl_error_get_where()); \
00115 else \
00116 cpl_msg_debug("", "Cleanup in %s line %d", \
00117 __FILE__, __LINE__); \
00118 } while (0)
00119
00120
00121 #include <cpl.h>
00122 #include <sinfo_image_ops.h>
00123 #include "sinfo_globals.h"
00124 CPL_BEGIN_DECLS
00125
00126
00127 cpl_image*
00128 sinfo_vector_to_image(const cpl_vector* vector,cpl_type type);
00129
00130 int
00131 sinfo_table_column_dump(cpl_table* t, const char* name, cpl_type type);
00132
00133 cpl_table*
00134 sinfo_table_shift_column_spline3(cpl_table* t,
00135 const char* col,
00136 const double s);
00137
00138 cpl_table*
00139 sinfo_table_shift_column_poly(cpl_table* t,
00140 const char* col,
00141 const double s,
00142 const int order);
00143
00144 cpl_table*
00145 sinfo_table_shift_column_int(const cpl_table* t,
00146 const char* col,
00147 const double s,
00148 double* r);
00149
00150 cpl_error_code
00151 sinfo_ima_line_cor(cpl_parameterlist * parlist, cpl_frameset* in);
00152
00153
00154 void sinfo_new_array_set_value( float * array, float value, int i );
00155 float sinfo_new_array_get_value( float * array, int i );
00156 void sinfo_new_destroy_array(float ** array);
00157 void sinfo_new_destroy_stringarray(char ** array, int size_x);
00158 void sinfo_new_intarray_set_value( int * array, int value, int i );
00159 void sinfo_new_array2D_set_value( float ** array, float value, int x, int y );
00160 void sinfo_new_destroy_2Dintarray(int *** array, int size_x);
00161 void sinfo_new_destroy_2Dfloatarray(float *** array, int size_x);
00162 void sinfo_new_destroy_2Ddoublearray(double *** array, int size_x);
00163 void sinfo_new_destroy_intarray(int ** array);
00164 void sinfo_new_destroy_doublearray(double * array);
00165 void sinfo_new_doublearray_set_value( double * array, double value, int i );
00166 int sinfo_new_intarray_get_value( int * array, int i );
00167 int * sinfo_new_intarray( int size);
00168 int ** sinfo_new_2Dintarray( int size_x, int size_y);
00169 double ** sinfo_new_2Ddoublearray( int size_x, int size_y);
00170 char * sinfo_new_get_rootname(const char * filename);
00171 char * sinfo_new_get_basename(const char *filename);
00172 float sinfo_new_Stats_get_cleanstdev(Stats * stats);
00173 float sinfo_new_Stats_get_cleanmean(Stats * stats);
00174 float sinfo_new_array2D_get_value( float ** array, int x, int y );
00175 float * sinfo_new_floatarray( int size);
00176 float ** sinfo_new_2Dfloatarray( int size_x, int size_y);
00177 double sinfo_new_doublearray_get_value( double * array, int i );
00178
00179 double * sinfo_new_doublearray( int size);
00180
00181
00182
00183 cpl_imagelist * sinfo_new_frameset_to_iset(cpl_frameset *) ;
00184 cpl_imagelist *
00185 sinfo_new_imagelist_load_frameset(const cpl_frameset * frameset,cpl_type type,
00186 int pnum,int extnum);
00187
00188 char ** sinfo_new_frameset_to_filenames(cpl_frameset *set, int *nfiles);
00189 char ** new_frameset_to_tags(cpl_frameset *set, int *ntags);
00190 double sinfo_spline_hermite(double xp,
00191 const double *x,
00192 const double *y,
00193 int n,
00194 int *istart );
00195
00196 cpl_error_code update_bad_pixel_map(cpl_image* im);
00197
00198 cpl_polynomial * sinfo_polynomial_fit_2d_create(cpl_bivector * xy_pos,
00199 cpl_vector * values,
00200 int degree,
00201 double * mse);
00202 cpl_polynomial * sinfo_polynomial_fit_1d_create(
00203 const cpl_vector * x_pos,
00204 const cpl_vector * values,
00205 int degree,
00206 double * mse
00207 );
00208 cpl_image * sinfo_image_filter_median(const cpl_image *, const cpl_matrix *);
00209 cpl_image * sinfo_image_filter_linear(const cpl_image *, const cpl_matrix *);
00210 CPL_END_DECLS
00211
00212 #endif