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-------------------------------------------------------------------------------
29LIBRARY: libgpiv:
30EXTERNAL 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"
114
186
187
188typedef struct __GpivImage GpivImage;
196 guint16 **frame1;
197 guint16 **frame2;
198};
199
200
201/*
202 * Function prototypes
203 */
204
212void
214 const gboolean flag
215 );
216
217
218
230 const gboolean verbose
231 );
232
233
241void
243 const gboolean force
244 );
245
246
247
260void
262 GpivImagePar *image_par,
263 const gboolean include_key,
264 const gboolean verbose,
265 FILE *fp_par_out
266 );
267
268
269
276gchar *
278 );
279
280
281
290gchar *
292 );
293
294
295
302gchar *
304 );
305
306
313gchar *
315 );
316
317
326void
328 const GpivImagePar *image_par
329 );
330
331
340void
341gpiv_img_fprint_header (const gchar *fname,
342 const GpivImagePar *image_par
343 );
344
345
355 );
356
357
365void
367 GpivImagePar *image_par_dest
368 );
369
370
379void
381 const GpivImagePar *image_par
382 );
383
384
393void
394gpiv_img_fprint_parameters (const gchar *fname,
395 const GpivImagePar *image_par
396 );
397
398
407 );
408
409
417gchar *
419 const GpivImagePar *image_par
420 );
421
422
423
432gchar *
434 GpivImagePar *image_par
435 );
436
437#ifdef ENABLE_MPI
443void
444gpiv_img_mpi_bcast_imgpar (GpivImagePar *image_par
445 );
446
447#endif /* ENABLE_MPI */
448#endif /* __LIBGPIV_IMG_H__ */
449
GpivImagePar * gpiv_img_fread_hdf5_parameters(const gchar *fname)
Reads image parameters from hdf5 data file without IMAGE_PAR_KEY.
void gpiv_img_fprint_parameters(const gchar *fname, const GpivImagePar *image_par)
Prints image header or parameters to file.
void gpiv_img_print_header(FILE *fp, const GpivImagePar *image_par)
Prints header information to file fp.
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 * gpiv_img_check_header_read(const GpivImagePar *image_par)
Checks out if all image header info has been read.
void gpiv_img_fprint_header(const gchar *fname, const GpivImagePar *image_par)
Prints image header parameters to file.
gchar * gpiv_img_test_header(const GpivImagePar *image_par)
Checks out if all header parameters have been read.
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.
void gpiv_img_parameters_set(GpivImagePar *image_par, const gboolean flag)
Sets flag for image_par__set.
gchar * gpiv_img_check_header_scale_read(const GpivImagePar *image_par)
Checks out if image header info for time/spatial scaling has been read.
gchar * gpiv_img_fread_davis_parameters(const gchar *fname, GpivImagePar *image_par)
Reads image specifications from Davis formatted image, with ext .IMG, from file.
void gpiv_img_default_parameters(GpivImagePar *image_par, const gboolean force)
Sets default parameter values.
void gpiv_img_print_parameters(FILE *fp, const GpivImagePar *image_par)
Prints image header or parameters to fp.
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_fwrite_hdf5_parameters(const gchar *fname, const GpivImagePar *image_par)
Writes image parameters to an existing hdf5 data file.
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.
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.
#define GPIV_MAX_CHARS
Maximum number of characters on a line.
Definition gpiv.h:234
Piv image header and data.
Definition gpiv-img.h:194
GpivImagePar * header
Image header.
Definition gpiv-img.h:195
guint16 ** frame2
Second image of a double-frame image pair.
Definition gpiv-img.h:197
guint16 ** frame1
First image of a double-frame image pair.
Definition gpiv-img.h:196
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
gboolean nrows__set
flag if nrows has been defined
Definition gpiv-img.h:130
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
gfloat z_off_x
zero offset in x (column) direction, used by gpiv_post_scale()
Definition gpiv-img.h:141
gboolean z_off_x__set
flag if z_off_x has been defined
Definition gpiv-img.h:142
gboolean x_corr
cross-correlation image pair
Definition gpiv-img.h:132
gboolean ncolumns__set
flag if ncolumns has been defined
Definition gpiv-img.h:127
gchar software[GPIV_MAX_CHARS]
Program that generated the image.
Definition gpiv-img.h:159
gboolean url__set
flag if url has been defined
Definition gpiv-img.h:184
gboolean copyright__set
flag if copyright has been defined
Definition gpiv-img.h:178
gboolean email__set
flag if email has been defined
Definition gpiv-img.h:181
gboolean s_scale__set
flag if s_scale has been defined
Definition gpiv-img.h:136
gchar warning[GPIV_MAX_CHARS]
Warning message.
Definition gpiv-img.h:168
gfloat z_off_y
zero offset in y (row) direction, used by gpiv_post_scale()
Definition gpiv-img.h:144
gboolean creation_date__set
flag if creation_date has been defined
Definition gpiv-img.h:151
gboolean disclaimer__set
flag if disclaimer has been defined
Definition gpiv-img.h:172
gboolean software__set
flag if software has been defined
Definition gpiv-img.h:160
gboolean comment__set
flag if comment has been defined
Definition gpiv-img.h:175
gchar disclaimer[GPIV_MAX_CHARS]
Disclaimer or licence text.
Definition gpiv-img.h:171
gchar author[GPIV_MAX_CHARS]
Author name.
Definition gpiv-img.h:156
guint nrows
Number of image rows.
Definition gpiv-img.h:129
gboolean usertext__set
flag if usertext has been defined
Definition gpiv-img.h:166
gchar usertext[GPIV_MAX_CHARS]
User comment.
Definition gpiv-img.h:165
gchar creation_date[GPIV_MAX_CHARS]
Date of origin.
Definition gpiv-img.h:150
gboolean warning__set
flag if warning has been defined
Definition gpiv-img.h:169
gboolean source__set
flag if source has been defined
Definition gpiv-img.h:163
gboolean author__set
flag if author has been defined
Definition gpiv-img.h:157
gchar title[GPIV_MAX_CHARS]
Project name.
Definition gpiv-img.h:147
gboolean title__set
flag if title has been defined
Definition gpiv-img.h:148
gboolean t_scale__set
flag if t_scale has been defined
Definition gpiv-img.h:139
gchar location[GPIV_MAX_CHARS]
Location of origin.
Definition gpiv-img.h:153
gfloat t_scale
time-scale, used by gpiv_post_scale()
Definition gpiv-img.h:138
gboolean depth__set
flag if depth has been defined
Definition gpiv-img.h:124
guint depth
Image color depth.
Definition gpiv-img.h:123
gchar url[GPIV_MAX_CHARS]
URL of program, author, image and/or data.
Definition gpiv-img.h:183
gboolean x_corr__set
flag if x_corr has been defined
Definition gpiv-img.h:133
guint ncolumns
Number of image columns.
Definition gpiv-img.h:126
gchar email[GPIV_MAX_CHARS]
E-mail author.
Definition gpiv-img.h:180
gboolean location__set
flag if location has been defined
Definition gpiv-img.h:154
gchar source[GPIV_MAX_CHARS]
Camera name and type.
Definition gpiv-img.h:162
gchar copyright[GPIV_MAX_CHARS]
Copyright text.
Definition gpiv-img.h:177

Generated for libgpiv-0.6.1 by doxygen 1.9.8