Initial revision
[gpiv.git] / src / display_interface.h
blob1ceec479ba70e53304c6ade8dcd17918e54be8ca
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
6 libraries.
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)
15 any later version.
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 * widgets prototypes of display
30 * $Log: display_interface.h,v $
31 * Revision 1.1 2003-06-17 17:10:52 gerber
32 * Initial revision
36 #ifndef DISPLAY_INTERFACE_H
37 #define DISPLAY_INTERFACE_H
39 #include "console_interface.h"
42 typedef struct _Image Image;
43 struct _Image {
44 GtkWidget *img_display1;
45 GtkWidget *img_display2;
46 ImagePar image_par;
47 unsigned char **img1;
48 unsigned char **img2;
51 * when image is displayed at gdk window
53 /* guchar rgbbuf_img[IMAGE_WIDTH_MAX * IMAGE_HEIGHT_MAX * 3]; */
54 guchar *graybuf_img;
55 gint rgb_img_width;
58 * when image is displayed at gnome canvas
60 /* GnomeCanvasItem *gci_img1; */
61 /* GnomeCanvasItem *gci_img2; */
62 gboolean exist_img;
66 typedef struct _Intreg Intreg;
67 struct _Intreg {
68 gint row_start_old;
69 gint row_start;
70 gint row_end;
71 gint col_start_old;
72 gint col_start;
73 gint col_end;
74 gint int_size_1;
75 gint int_size_2;
76 gint int_shift;
77 gint pre_shift_row;
78 gint pre_shift_col;
79 PivData data;
80 gboolean exist;
81 GnomeCanvasItem *gci_intreg1[MAX_DATA][MAX_DATA];
82 GnomeCanvasItem *gci_intreg2[MAX_DATA][MAX_DATA];
86 typedef struct _GpivData GpivData;
87 struct _GpivData {
88 PivEvalPar piv_eval_par;
89 PivData piv_data;
90 PivData piv_data_scaled;
91 gboolean exist_piv;
92 gboolean saved_piv;
93 gboolean scaled_piv;
94 GnomeCanvasItem *gci_vector[MAX_DATA][MAX_DATA];
97 Covariance cov[MAX_DATA][MAX_DATA];
98 gboolean exist_cov;
100 float **intreg1[MAX_DATA][MAX_DATA];
101 float **intreg2[MAX_DATA][MAX_DATA];
103 PivValidPar piv_valid_par;
104 gboolean exist_valid;
106 PivPostPar piv_post_par;
107 ScalarData vor_data;
108 ScalarData vor_data_scaled;
109 gboolean exist_vor;
110 gboolean exist_vor_scaled;
111 gboolean saved_vor;
112 GnomeCanvasItem *gci_scalar_vor[MAX_DATA][MAX_DATA];
114 ScalarData sstrain_data;
115 ScalarData sstrain_data_scaled;
116 gboolean exist_sstrain;
117 gboolean exist_sstrain_scaled;
118 gboolean saved_sstrain;
119 GnomeCanvasItem *gci_scalar_sstrain[MAX_DATA][MAX_DATA];
121 ScalarData nstrain_data;
122 ScalarData nstrain_data_scaled;
123 gboolean exist_nstrain;
124 gboolean exist_nstrain_scaled;
125 gboolean saved_nstrain;
126 GnomeCanvasItem *gci_scalar_nstrain[MAX_DATA][MAX_DATA];
130 typedef struct _Display Display;
131 struct _Display {
132 char fname_base[MAX_CHARS];
133 gint count;
135 GtkWidget *mwin; /* main window for display */
136 GtkWidget *table;
137 GtkWidget *button_origin;
138 GtkWidget *arrow_origin;
139 GtkWidget *scrolledwindow;
140 GtkObject *scrolledwindow_hadj;
141 GtkObject *scrolledwindow_vadj;
142 GtkWidget *canvas;
143 GtkWidget *view_options;
144 GtkWidget *vruler;
145 GtkWidget *hruler;
146 GtkWidget *appbar;
147 GtkWidget *nav_ebox;
149 gint zoom_index;
150 float zoom_factor;
151 gboolean stretch_window;
152 gint vector_scale;
153 gchar msg_display_default[MAX_CHARS];
155 GtkWidget *display_menu;
156 GnomeCanvasItem *gci_bg;
159 Image img;
160 Intreg intreg;
161 GpivData gpd;
163 gboolean display_img1;
164 gboolean display_img2;
165 gboolean display_intregs;
166 gboolean display_piv;
167 gboolean display_vor;
168 gboolean display_sstrain;
169 gboolean display_nstrain;
171 gint index_x_old;
172 gint index_y_old;
173 gint xgrab_first;
174 gint ygrab_first;
179 Display *
180 create_display (gchar *fname,
181 gint buf,
182 GpivConsole * gpiv);
185 * widget for display menu
187 GtkWidget
188 *create_display_menu (Display * disp);
192 * widgets for create_img_display
194 GtkWidget *create_img_display (gchar *fname,
195 ImagePar image_par);
196 GtkWidget *img_display_window;
197 GtkWidget *darea;
200 #endif /* DISPLAY_INTERFACE_H */