Main Page | Files | Data Structures | Functions | Global Variables |
gpiv-img.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
2 
3 /*-----------------------------------------------------------------------------
4 
5 
6  libgpiv - library for Particle Image Velocimetry
7 
8  Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Gerber van der Graaf
9 
10  This file is part of libgpiv.
11 
12  Libgpiv is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2, or (at your option)
15  any later version.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software Foundation,
24  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 
26 
27 
28 -------------------------------------------------------------------------------
29 LIBRARY: libgpiv:
30 EXTERNAL FUNCTIONS:
31  gpiv_img_parameters_set
32  gpiv_img_get_parameters
33 
34  gpiv_img_read_header
35  gpiv_img_check_header_read
36  gpiv_img_check_header_required_read
37  gpiv_img_check_header_scale_read
38  gpiv_img_test_header
39  gpiv_img_print_header
40  gpiv_img_fprint_header
41  gpiv_img_print_parameters
42  gpiv_img_fprint_parameters
43  gpiv_img_cp_parameters
44  gpiv_img_ovwrt_parameters
45  gpiv_img_fread_hdf5_parameters
46  gpiv_img_fwrite_hdf5_parameters
47  gpiv_img_fread_davis_parameters
48 
49 -----------------------------------------------------------------------------*/
50 
60 #ifndef __LIBGPIV_IMG_H__
61 #define __LIBGPIV_IMG_H__
62 
63 
64 
65 #define GPIV_IMGPAR_DEFAULT__DEPTH 8
66 #define GPIV_IMGPAR_DEFAULT__NCOLUMNS 256
67 #define GPIV_IMGPAR_DEFAULT__NROWS 256
68 #define GPIV_IMGPAR_DEFAULT__X_CORR 1
69 #define GPIV_IMGPAR_DEFAULT__S_SCALE 1.0
70 #define GPIV_IMGPAR_DEFAULT__T_SCALE 1.0
71 #define GPIV_IMGPAR_DEFAULT__Z_OFF_X 0.0
72 #define GPIV_IMGPAR_DEFAULT__Z_OFF_Y 0.0
74 #define GPIV_IMGPAR_DEFAULT__TITLE ""
75 #define GPIV_IMGPAR_DEFAULT__CREATION_DATE ""
76 #define GPIV_IMGPAR_DEFAULT__LOCATION ""
77 #define GPIV_IMGPAR_DEFAULT__AUTHOR ""
78 #define GPIV_IMGPAR_DEFAULT__SOFTWARE "gpiv / gpiv_rr"
79 #define GPIV_IMGPAR_DEFAULT__SOURCE ""
80 #define GPIV_IMGPAR_DEFAULT__USERTEXT ""
81 #define GPIV_IMGPAR_DEFAULT__WARNING ""
82 #define GPIV_IMGPAR_DEFAULT__DISCLAIMER "See The GNU General Public License (GPL)"
83 #define GPIV_IMGPAR_DEFAULT__COMMENT ""
84 #define GPIV_IMGPAR_DEFAULT__COPYRIGHT ""
85 #define GPIV_IMGPAR_DEFAULT__EMAIL ""
86 #define GPIV_IMGPAR_DEFAULT__URL ""
89 #define GPIV_IMGPAR_KEY "IMG"
90 #define GPIV_IMGPAR_KEY__DEPTH "depth"
91 #define GPIV_IMGPAR_KEY__NCOLUMNS "ncolumns"
92 #define GPIV_IMGPAR_KEY__NROWS "nrows"
93 #define GPIV_IMGPAR_KEY__X_CORR "x_corr"
94 #define GPIV_IMGPAR_KEY__S_SCALE "s_scale"
95 #define GPIV_IMGPAR_KEY__T_SCALE "t_scale"
96 #define GPIV_IMGPAR_KEY__Z_OFF_X "zoff_x"
97 #define GPIV_IMGPAR_KEY__Z_OFF_Y "zoff_y"
99 #define GPIV_IMGPAR_KEY__TITLE "title"
100 #define GPIV_IMGPAR_KEY__CREATION_DATE "creation_date"
101 #define GPIV_IMGPAR_KEY__LOCATION "location"
102 #define GPIV_IMGPAR_KEY__AUTHOR "author"
103 #define GPIV_IMGPAR_KEY__SOFTWARE "software"
104 #define GPIV_IMGPAR_KEY__SOURCE "source"
105 #define GPIV_IMGPAR_KEY__USERTEXT "usertext"
106 #define GPIV_IMGPAR_KEY__WARNING "warning"
107 #define GPIV_IMGPAR_KEY__DISCLAIMER "disclaimer"
108 #define GPIV_IMGPAR_KEY__COMMENT "comment"
109 #define GPIV_IMGPAR_KEY__COPYRIGHT "copyright"
110 #define GPIV_IMGPAR_KEY__EMAIL "email"
111 #define GPIV_IMGPAR_KEY__URL "url"
113 typedef struct __GpivImagePar GpivImagePar;
114 
123  guint depth;
124  gboolean depth__set;
126  guint ncolumns;
127  gboolean ncolumns__set;
129  guint nrows;
130  gboolean nrows__set;
132  gboolean x_corr;
133  gboolean x_corr__set;
135  gfloat s_scale;
136  gboolean s_scale__set;
138  gfloat t_scale;
139  gboolean t_scale__set;
141  gfloat z_off_x;
142  gboolean z_off_x__set;
144  gfloat z_off_y;
145  gboolean z_off_y__set;
148  gboolean title__set;
154  gboolean location__set;
157  gboolean author__set;
160  gboolean software__set;
163  gboolean source__set;
166  gboolean usertext__set;
169  gboolean warning__set;
172  gboolean disclaimer__set;
175  gboolean comment__set;
178  gboolean copyright__set;
181  gboolean email__set;
184  gboolean url__set;
185 };
186 
187 
188 typedef struct __GpivImage GpivImage;
194 struct __GpivImage {
196  guint16 **frame1;
197  guint16 **frame2;
198 };
199 
200 
201 /*
202  * Function prototypes
203  */
204 
212 void
214  const gboolean flag
215  );
216 
217 
218 
228 GpivImagePar *
229 gpiv_img_get_parameters_from_resources (const gchar *localrc,
230  const gboolean verbose
231  );
232 
233 
241 void
243  const gboolean force
244  );
245 
246 
247 
260 void
261 gpiv_img_read_header (FILE *fp,
262  GpivImagePar *image_par,
263  const gboolean include_key,
264  const gboolean verbose,
265  FILE *fp_par_out
266  );
267 
268 
269 
276 gchar *
278  );
279 
280 
281 
290 gchar *
292  );
293 
294 
295 
302 gchar *
304  );
305 
306 
313 gchar *
314 gpiv_img_test_header (const GpivImagePar *image_par
315  );
316 
317 
326 void
327 gpiv_img_print_header (FILE *fp,
328  const GpivImagePar *image_par
329  );
330 
331 
340 void
341 gpiv_img_fprint_header (const gchar *fname,
342  const GpivImagePar *image_par
343  );
344 
345 
353 GpivImagePar *
354 gpiv_img_cp_parameters (const GpivImagePar *image_par
355  );
356 
357 
365 void
366 gpiv_img_ovwrt_parameters (const GpivImagePar *image_par_src,
367  GpivImagePar *image_par_dest
368  );
369 
370 
379 void
380 gpiv_img_print_parameters (FILE *fp,
381  const GpivImagePar *image_par
382  );
383 
384 
393 void
394 gpiv_img_fprint_parameters (const gchar *fname,
395  const GpivImagePar *image_par
396  );
397 
398 
405 GpivImagePar *
406 gpiv_img_fread_hdf5_parameters (const gchar *fname
407  );
408 
409 
417 gchar *
418 gpiv_img_fwrite_hdf5_parameters (const gchar *fname,
419  const GpivImagePar *image_par
420  );
421 
422 
423 
432 gchar *
433 gpiv_img_fread_davis_parameters (const gchar *fname,
434  GpivImagePar *image_par
435  );
436 
437 #ifdef ENABLE_MPI
438 
443 void
444 gpiv_img_mpi_bcast_imgpar (GpivImagePar *image_par
445  );
446 
447 #endif /* ENABLE_MPI */
448 #endif /* __LIBGPIV_IMG_H__ */
449 
void gpiv_img_print_parameters(FILE *fp, const GpivImagePar *image_par)
Prints image header or parameters to fp.
gboolean location__set
flag if location has been defined
Definition: gpiv-img.h:154
gfloat t_scale
time-scale, used by gpiv_post_scale()
Definition: gpiv-img.h:138
gboolean source__set
flag if source has been defined
Definition: gpiv-img.h:163
gchar title[GPIV_MAX_CHARS]
Project name.
Definition: gpiv-img.h:147
gboolean usertext__set
flag if usertext has been defined
Definition: gpiv-img.h:166
gboolean z_off_y__set
flag if z_off_y has been defined
Definition: gpiv-img.h:145
gchar comment[GPIV_MAX_CHARS]
Comment from other image formats.
Definition: gpiv-img.h:174
gboolean x_corr__set
flag if x_corr has been defined
Definition: gpiv-img.h:133
GpivImagePar * gpiv_img_cp_parameters(const GpivImagePar *image_par)
Generate a new copy of image parameters from image_par if image_par_dest have not been set...
gchar source[GPIV_MAX_CHARS]
Camera name and type.
Definition: gpiv-img.h:162
GpivImagePar * gpiv_img_get_parameters_from_resources(const gchar *localrc, const gboolean verbose)
Reads image parameters from localrc, $HOME/.gpivrc and system-wide gpiv.conf.
gfloat z_off_y
zero offset in y (row) direction, used by gpiv_post_scale()
Definition: gpiv-img.h:144
void gpiv_img_parameters_set(GpivImagePar *image_par, const gboolean flag)
Sets flag for image_par__set.
void gpiv_img_default_parameters(GpivImagePar *image_par, const gboolean force)
Sets default parameter values.
Piv image header and data.
Definition: gpiv-img.h:194
gchar * gpiv_img_check_header_required_read(const GpivImagePar *image_par)
Checks out if the required image header info for reading/storing has been read.
gboolean creation_date__set
flag if creation_date has been defined
Definition: gpiv-img.h:151
gchar * gpiv_img_check_header_scale_read(const GpivImagePar *image_par)
Checks out if image header info for time/spatial scaling has been read.
void gpiv_img_ovwrt_parameters(const GpivImagePar *image_par_src, GpivImagePar *image_par_dest)
Overwrites image parameters from image_par_src to image_par_dest.
gboolean nrows__set
flag if nrows has been defined
Definition: gpiv-img.h:130
guint16 ** frame2
Second image of a double-frame image pair.
Definition: gpiv-img.h:197
GpivImagePar * gpiv_img_fread_hdf5_parameters(const gchar *fname)
Reads image parameters from hdf5 data file without IMAGE_PAR_KEY.
gchar url[GPIV_MAX_CHARS]
URL of program, author, image and/or data.
Definition: gpiv-img.h:183
gboolean depth__set
flag if depth has been defined
Definition: gpiv-img.h:124
gchar * gpiv_img_test_header(const GpivImagePar *image_par)
Checks out if all header parameters have been read.
guint16 ** frame1
First image of a double-frame image pair.
Definition: gpiv-img.h:196
gchar email[GPIV_MAX_CHARS]
E-mail author.
Definition: gpiv-img.h:180
gboolean software__set
flag if software has been defined
Definition: gpiv-img.h:160
Image parameters or header info.
Definition: gpiv-img.h:122
gfloat s_scale
spatial scale, used by gpiv_post_scale()
Definition: gpiv-img.h:135
gchar * gpiv_img_fwrite_hdf5_parameters(const gchar *fname, const GpivImagePar *image_par)
Writes image parameters to an existing hdf5 data file.
gchar software[GPIV_MAX_CHARS]
Program that generated the image.
Definition: gpiv-img.h:159
guint depth
Image color depth.
Definition: gpiv-img.h:123
guint nrows
Number of image rows.
Definition: gpiv-img.h:129
#define GPIV_MAX_CHARS
Maximum number of characters on a line.
Definition: gpiv.h:234
gboolean t_scale__set
flag if t_scale has been defined
Definition: gpiv-img.h:139
gboolean ncolumns__set
flag if ncolumns has been defined
Definition: gpiv-img.h:127
gchar warning[GPIV_MAX_CHARS]
Warning message.
Definition: gpiv-img.h:168
gboolean comment__set
flag if comment has been defined
Definition: gpiv-img.h:175
gfloat z_off_x
zero offset in x (column) direction, used by gpiv_post_scale()
Definition: gpiv-img.h:141
void gpiv_img_read_header(FILE *fp, GpivImagePar *image_par, const gboolean include_key, const gboolean verbose, FILE *fp_par_out)
Reads each line of file fp and looks for image header parameters.
gchar * gpiv_img_check_header_read(const GpivImagePar *image_par)
Checks out if all image header info has been read.
void gpiv_img_print_header(FILE *fp, const GpivImagePar *image_par)
Prints header information to file fp.
void gpiv_img_fprint_header(const gchar *fname, const GpivImagePar *image_par)
Prints image header parameters to file.
gboolean url__set
flag if url has been defined
Definition: gpiv-img.h:184
gchar copyright[GPIV_MAX_CHARS]
Copyright text.
Definition: gpiv-img.h:177
gboolean email__set
flag if email has been defined
Definition: gpiv-img.h:181
gboolean copyright__set
flag if copyright has been defined
Definition: gpiv-img.h:178
gchar usertext[GPIV_MAX_CHARS]
User comment.
Definition: gpiv-img.h:165
gchar disclaimer[GPIV_MAX_CHARS]
Disclaimer or licence text.
Definition: gpiv-img.h:171
gchar location[GPIV_MAX_CHARS]
Location of origin.
Definition: gpiv-img.h:153
gboolean title__set
flag if title has been defined
Definition: gpiv-img.h:148
void gpiv_img_fprint_parameters(const gchar *fname, const GpivImagePar *image_par)
Prints image header or parameters to file.
GpivImagePar * header
Image header.
Definition: gpiv-img.h:195
gchar creation_date[GPIV_MAX_CHARS]
Date of origin.
Definition: gpiv-img.h:150
gboolean x_corr
cross-correlation image pair
Definition: gpiv-img.h:132
gboolean z_off_x__set
flag if z_off_x has been defined
Definition: gpiv-img.h:142
gchar * gpiv_img_fread_davis_parameters(const gchar *fname, GpivImagePar *image_par)
Reads image specifications from Davis formatted image, with ext .IMG, from file.
gboolean s_scale__set
flag if s_scale has been defined
Definition: gpiv-img.h:136
gboolean disclaimer__set
flag if disclaimer has been defined
Definition: gpiv-img.h:172
gboolean author__set
flag if author has been defined
Definition: gpiv-img.h:157
gboolean warning__set
flag if warning has been defined
Definition: gpiv-img.h:169
guint ncolumns
Number of image columns.
Definition: gpiv-img.h:126
gchar author[GPIV_MAX_CHARS]
Author name.
Definition: gpiv-img.h:156

Generated for libgpiv-0.6.1 by doxygen 1.8.13