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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00060 #ifndef __LIBGPIV_IMG_H__
00061 #define __LIBGPIV_IMG_H__
00062
00063
00064
00065 #define GPIV_IMGPAR_DEFAULT__DEPTH 8
00066 #define GPIV_IMGPAR_DEFAULT__NCOLUMNS 256
00067 #define GPIV_IMGPAR_DEFAULT__NROWS 256
00068 #define GPIV_IMGPAR_DEFAULT__X_CORR 1
00069 #define GPIV_IMGPAR_DEFAULT__S_SCALE 1.0
00070 #define GPIV_IMGPAR_DEFAULT__T_SCALE 1.0
00071 #define GPIV_IMGPAR_DEFAULT__Z_OFF_X 0.0
00072 #define GPIV_IMGPAR_DEFAULT__Z_OFF_Y 0.0
00074 #define GPIV_IMGPAR_DEFAULT__TITLE ""
00075 #define GPIV_IMGPAR_DEFAULT__CREATION_DATE ""
00076 #define GPIV_IMGPAR_DEFAULT__LOCATION ""
00077 #define GPIV_IMGPAR_DEFAULT__AUTHOR ""
00078 #define GPIV_IMGPAR_DEFAULT__SOFTWARE "gpiv / gpiv_rr"
00079 #define GPIV_IMGPAR_DEFAULT__SOURCE ""
00080 #define GPIV_IMGPAR_DEFAULT__USERTEXT ""
00081 #define GPIV_IMGPAR_DEFAULT__WARNING ""
00082 #define GPIV_IMGPAR_DEFAULT__DISCLAIMER "See The GNU General Public License (GPL)"
00083 #define GPIV_IMGPAR_DEFAULT__COMMENT ""
00084 #define GPIV_IMGPAR_DEFAULT__COPYRIGHT ""
00085 #define GPIV_IMGPAR_DEFAULT__EMAIL ""
00086 #define GPIV_IMGPAR_DEFAULT__URL ""
00089 #define GPIV_IMGPAR_KEY "IMG"
00090 #define GPIV_IMGPAR_KEY__DEPTH "depth"
00091 #define GPIV_IMGPAR_KEY__NCOLUMNS "ncolumns"
00092 #define GPIV_IMGPAR_KEY__NROWS "nrows"
00093 #define GPIV_IMGPAR_KEY__X_CORR "x_corr"
00094 #define GPIV_IMGPAR_KEY__S_SCALE "s_scale"
00095 #define GPIV_IMGPAR_KEY__T_SCALE "t_scale"
00096 #define GPIV_IMGPAR_KEY__Z_OFF_X "zoff_x"
00097 #define GPIV_IMGPAR_KEY__Z_OFF_Y "zoff_y"
00099 #define GPIV_IMGPAR_KEY__TITLE "title"
00100 #define GPIV_IMGPAR_KEY__CREATION_DATE "creation_date"
00101 #define GPIV_IMGPAR_KEY__LOCATION "location"
00102 #define GPIV_IMGPAR_KEY__AUTHOR "author"
00103 #define GPIV_IMGPAR_KEY__SOFTWARE "software"
00104 #define GPIV_IMGPAR_KEY__SOURCE "source"
00105 #define GPIV_IMGPAR_KEY__USERTEXT "usertext"
00106 #define GPIV_IMGPAR_KEY__WARNING "warning"
00107 #define GPIV_IMGPAR_KEY__DISCLAIMER "disclaimer"
00108 #define GPIV_IMGPAR_KEY__COMMENT "comment"
00109 #define GPIV_IMGPAR_KEY__COPYRIGHT "copyright"
00110 #define GPIV_IMGPAR_KEY__EMAIL "email"
00111 #define GPIV_IMGPAR_KEY__URL "url"
00113 typedef struct __GpivImagePar GpivImagePar;
00114
00122 struct __GpivImagePar {
00123 guint depth;
00124 gboolean depth__set;
00126 guint ncolumns;
00127 gboolean ncolumns__set;
00129 guint nrows;
00130 gboolean nrows__set;
00132 gboolean x_corr;
00133 gboolean x_corr__set;
00135 gfloat s_scale;
00136 gboolean s_scale__set;
00138 gfloat t_scale;
00139 gboolean t_scale__set;
00141 gfloat z_off_x;
00142 gboolean z_off_x__set;
00144 gfloat z_off_y;
00145 gboolean z_off_y__set;
00147 gchar title[GPIV_MAX_CHARS];
00148 gboolean title__set;
00150 gchar creation_date[GPIV_MAX_CHARS];
00151 gboolean creation_date__set;
00153 gchar location[GPIV_MAX_CHARS];
00154 gboolean location__set;
00156 gchar author[GPIV_MAX_CHARS];
00157 gboolean author__set;
00159 gchar software[GPIV_MAX_CHARS];
00160 gboolean software__set;
00162 gchar source[GPIV_MAX_CHARS];
00163 gboolean source__set;
00165 gchar usertext[GPIV_MAX_CHARS];
00166 gboolean usertext__set;
00168 gchar warning[GPIV_MAX_CHARS];
00169 gboolean warning__set;
00171 gchar disclaimer[GPIV_MAX_CHARS];
00172 gboolean disclaimer__set;
00174 gchar comment[GPIV_MAX_CHARS];
00175 gboolean comment__set;
00177 gchar copyright[GPIV_MAX_CHARS];
00178 gboolean copyright__set;
00180 gchar email[GPIV_MAX_CHARS];
00181 gboolean email__set;
00183 gchar url[GPIV_MAX_CHARS];
00184 gboolean url__set;
00185 };
00186
00187
00188 typedef struct __GpivImage GpivImage;
00194 struct __GpivImage {
00195 GpivImagePar *header;
00196 guint16 **frame1;
00197 guint16 **frame2;
00198 };
00199
00200
00201
00202
00203
00204
00212 void
00213 gpiv_img_parameters_set (GpivImagePar *image_par,
00214 const gboolean flag
00215 );
00216
00217
00218
00228 GpivImagePar *
00229 gpiv_img_get_parameters_from_resources (const gchar *localrc,
00230 const gboolean verbose
00231 );
00232
00233
00241 void
00242 gpiv_img_default_parameters (GpivImagePar *image_par,
00243 const gboolean force
00244 );
00245
00246
00247
00260 void
00261 gpiv_img_read_header (FILE *fp,
00262 GpivImagePar *image_par,
00263 const gboolean include_key,
00264 const gboolean verbose,
00265 FILE *fp_par_out
00266 );
00267
00268
00269
00276 char *
00277 gpiv_img_check_header_read (const GpivImagePar *image_par
00278 );
00279
00280
00281
00290 char *
00291 gpiv_img_check_header_required_read (const GpivImagePar *image_par
00292 );
00293
00294
00295
00302 char *
00303 gpiv_img_check_header_scale_read (const GpivImagePar *image_par
00304 );
00305
00306
00313 char *
00314 gpiv_img_test_header (const GpivImagePar *image_par
00315 );
00316
00317
00326 void
00327 gpiv_img_print_header (FILE *fp,
00328 const GpivImagePar *image_par
00329 );
00330
00331
00340 void
00341 gpiv_img_fprint_header (const gchar *fname,
00342 const GpivImagePar *image_par
00343 );
00344
00345
00353 GpivImagePar *
00354 gpiv_img_cp_parameters (const GpivImagePar *image_par
00355 );
00356
00357
00365 void
00366 gpiv_img_ovwrt_parameters (const GpivImagePar *image_par_src,
00367 GpivImagePar *image_par_dest
00368 );
00369
00370
00379 void
00380 gpiv_img_print_parameters (FILE *fp,
00381 const GpivImagePar *image_par
00382 );
00383
00384
00393 void
00394 gpiv_img_fprint_parameters (const gchar *fname,
00395 const GpivImagePar *image_par
00396 );
00397
00398
00405 GpivImagePar *
00406 gpiv_img_fread_hdf5_parameters (const gchar *fname
00407 );
00408
00409
00417 gchar *
00418 gpiv_img_fwrite_hdf5_parameters (const gchar *fname,
00419 const GpivImagePar *image_par
00420 );
00421
00422
00423
00432 char *
00433 gpiv_img_fread_davis_parameters (const gchar *fname,
00434 GpivImagePar *image_par
00435 );
00436
00437
00438 #endif
00439