1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
8 Copyright (C) 2002 Gerber van der Graaf
10 This file is part of gpiv.
12 Gpiv 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)
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.
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.
26 ----------------------------------------------------------------------*/
29 * Graphical User Interface for gpiv
30 * $Log: gpiv_gtk.h,v $
31 * Revision 1.2 2003-06-27 13:47:26 gerber
32 * display ruler, line/point evaluation
34 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
42 #include <sys/types.h>
44 #include <unistd.h> /* for the "pause" function: */
48 #include <math.h> /* for isnan */
52 #define PROGNAME "GP_GUI." /* Abbreviation of program name; used for
53 error messages and parameter keys are
55 #define RCSID "$Id: gpiv_gtk.h,v 1.2 2003-06-27 13:47:26 gerber Exp $" /* Revision Control System (RCS) version */
56 #define ERR_IVAL = 99 /* Some arbitrary integer error value */
58 #define ADJ_MIN -50.0 /* minimum value for adjustment */
59 #define ADJ_MAX 50.0 /* maximum value for adjustment */
60 #define ADJ_STEP 0.001 /* Step increment for adjustment */
61 #define ADJ_PAGE 0.1 /* Page increment for adjustment */
65 * Sony PCR-100 video camera: 1152 x 864
67 #ifndef IMAGE_WIDTH_MAX
68 #define IMAGE_WIDTH_MAX 1280
71 #ifndef IMAGE_HEIGHT_MAX
72 #define IMAGE_HEIGHT_MAX 1024
76 char IMAGE_WIDTH_LABEL
[MAX_CHARS
];
77 char IMAGE_HEIGHT_LABEL
[MAX_CHARS
];
80 * Extra marge for display
82 #define VIEW_HMARGE 38
83 #define VIEW_VMARGE 62
84 #define RULER_WIDTH 17 /* width of the rulers in the display window */
86 #define MAX_DATA (IMAGE_WIDTH_MAX / 8) /* Maximum number of data/estimators/Interr. Areas per row */
87 #define MAX_BUFS 10 /* maximum number of buffers (=displays) */
91 #define THICKNESS 1 /* line thickness to be drawn in te canvases */
92 #define ARROW_LENGTH 6 /* length of (piv) vector arrow head */
93 #define ARROW_EDGE 6 /* edge of (piv) vector arrow head */
94 #define ARROW_WIDTH 3 /* width of (piv) vector arrow head */
96 #define BITSHIFT_RED 24 /* bitshift for color red value (used in display_all_scalar_intregs) */
97 #define BITSHIFT_GREEN 16 /* bitshift for color green value */
98 #define BITSHIFT_BLUE 8 /* bitshift for color blue value */
101 #include "console_interface.h"
102 #include "display_interface.h"
106 gchar
*msg_default
, *msg_error
, msg_display
[40], *fname_last
;
108 guchar graybuf_int1
[MAX_INTERR_SIZE
* MAX_INTERR_SIZE
];
109 guchar graybuf_int2
[MAX_INTERR_SIZE
* MAX_INTERR_SIZE
];
110 guchar graybuf_cov
[MAX_INTERR_SIZE
* MAX_INTERR_SIZE
];
113 /* GnomeCanvasPoints *points; */
114 GnomeCanvasItem
*gci_img1
, *gci_aoi
, *gci_line
;
115 PivData oldpiv_data
, intregs_tmp
;
116 gboolean exist_oldpiv
;
117 gint zero_off_tmp
, weight_tmp
; /* used in on_radiobutton_piv_int */
118 gint setby_spinbutton
; /* used in on_spinbutton_piv_int and on_radiobutton_piv_int */
120 float **int_area_1
, **int_area_1
, **covariance
;
121 GnomeCanvasItem
*text_piv_disprocess
, *gci_background_piv_disprocess
,
122 *gci_vector_piv_disprocess
;
124 gfloat x_offset
, x_lower
, x_upper
, y_offset
, y_lower
, y_upper
;
125 gint enable_col_start
, enable_col_end
, enable_row_start
, enable_row_end
;
126 GtkWidget
*gpiv_exit
, *gpiv_close_buffer
, *gpiv_preferences
;
129 gint nd_lines
, nc_lines
;
130 char fname
[MAX_CHARS
];
133 gboolean exec_process
, cancel_process
;
135 Display
*display
[MAX_BUFS
], *display_act
;
139 * Parameters of gpiv:
141 typedef struct _GpivPar GpivPar
;
143 gboolean display_img1
; /* display first image in display */
144 gboolean display_img2
; /* display second image in display */
145 gboolean display_intregs
; /* display interrogation regions in display */
146 gboolean display_piv
; /* display piv vectors in display */
147 gboolean display_vor
; /* display vorticity in display */
148 gboolean display_sstrain
; /* display shear strain in display */
149 gboolean display_nstrain
; /* display normal strain in display */
150 gboolean display_process
; /* display interrogation areas and covariance function during image analyzing process */
151 gboolean show_tooltips
; /* flag to show tooltips or hints (in pop-up window) */
153 gboolean process_piv
; /* used by gpiv toolbar to run piv */
154 gboolean process_gradient
; /* used by gpiv toolbar to run gradient */
155 gboolean process_resstats
; /* used by gpiv toolbar to run resstats */
156 gboolean process_errvec
; /* used by gpiv toolbar to run errvec */
157 gboolean process_peaklock
; /* used by gpiv toolbar to run peaklock */
158 gboolean process_average
; /* used by gpiv toolbar to run average */
159 gboolean process_scale
; /* used by gpiv toolbar to run scale */
160 gboolean process_substract
; /* used by gpiv toolbar to run substract */
161 gboolean process_vorstra
; /* used by gpiv toolbar to run vorstra */
164 gint zoom_index
; /* index for displayed zooming */
165 gint vector_scale
; /* scale of vectors to be displayed */
166 gboolean stretch_window
; /* stretch display window for image area */
167 gboolean view_tabulator
; /* display tabulator of process parameters in main window */
168 gboolean view_gpivbuttons
; /* display gpiv buttons in main window */
169 gint nbins
; /* number of bins to display histograms */
170 gint img_width
; /* number of columns in image */
171 gint img_height
; /* number of rows in image */
173 gboolean hdf
; /* store data in hdf 5 format, with .gpi extension */
174 gboolean hdf_img
; /* include image data in .gpi file (hdf 5 format) */
175 } default_par
, gpiv_par
;
179 * Parameters for each process:
180 * ImagePar should be unique for each image
183 PivEvalPar piv_eval_par
;
184 PivValidPar piv_valid_par
;
185 PivPostPar piv_post_par
;
187 char c_line
[MAX_LINES_C
][MAX_CHARS
];
188 int var_scale
, nc_lines
, display_intregs
;
189 gint
/* ibuf, */ nbufs
;
210 VECTOR_SCALE_7
= 128,
240 DISABLE_POINT_MS
= 8,
253 static float zfactor
[] = {
263 int m_select_index_y
, m_select_index_x
;