aboutsummaryrefslogtreecommitdiff
path: root/src/dw-hdfsee.h
blob: fc16594d3b6c26b4f1f12b938235f9e775a6dcb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
 * dw-hdfsee.h
 *
 * Quick yet non-crappy HDF viewer
 *
 * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
 *                  a research centre of the Helmholtz Association.
 * Copyright © 2012 Richard Kirian
 *
 * Authors:
 *   2009-2012 Thomas White <taw@physics.org>
 *   2014      Valerio Mariani
 *   2014      Takanori Nakane <nakane.t@gmail.com>
 *   2012      Richard Kirian
 *
 * This file is part of CrystFEL.
 *
 * CrystFEL is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CrystFEL is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with CrystFEL.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifndef DISPLAYWINDOW_H
#define DISPLAYWINDOW_H

#include "events.h"
#include "image.h"
#include <gtk/gtk.h>

typedef struct {
	GtkWidget	*window;
	GtkWidget	*entry;
} BinningDialog;


typedef struct {
	GtkWidget	*window;
	GtkWidget	*entry;
} BoostIntDialog;


typedef struct {
	GtkWidget	*window;
	GtkWidget	*entry;
} RingRadiusDialog;


struct numberswindow {
	GtkWidget *window;
	GtkWidget *labels[17*17];
	GtkWidget *feat;
	unsigned int cx;
	unsigned int cy;
};


typedef enum {
	CALIBMODE_NONE,
	CALIBMODE_PANELS,
	CALIBMODE_GROUPS,
	CALIBMODE_ALL
} CalibMode;


typedef struct {

	GtkWidget	*window;
	GtkWidget	*drawingarea;
	GtkWidget	*scrollarea;
	GtkUIManager	*ui;
	GtkActionGroup	*action_group;
	int             n_pixbufs;
	GdkPixbuf	**pixbufs;
	gulong		motion_callback;
	cairo_surface_t *surf;

	int             not_ready_yet;

    struct detector* simple_geom;

    struct hdfile	*hdfile;
	struct image	*image;

	/* Dialog boxes */
	BinningDialog  *binning_dialog;
	BoostIntDialog *boostint_dialog;
	RingRadiusDialog *ringradius_dialog;
	struct numberswindow *numbers_window;

	int		width;
	int		height;		/* Size of the drawing area */
	double          min_x;
	double          min_y;
	double          max_x;
	double          max_y;

	int		binning;
	double		boostint;
	int		noisefilter;	/* Use aggressive noise filter */
	int             median_filter;
	int             show_rings;
	int		show_peaks;
	double          ring_radius;
	double          *ring_radii;
	int             n_rings;

	CalibMode       calib_mode;
	struct rigid_group *calib_mode_curr_rg;
	struct panel    *calib_mode_curr_p;
	int             calib_mode_show_focus;
	GtkWidget       *statusbar;

	int		show_col_scale;
	int		scale;
	GdkPixbuf	*col_scale;

	int                multi_event;
	struct event_list  *ev_list;
	int                curr_event;



} DisplayWindow;

/* Open an image display window showing the given filename, or NULL */
extern DisplayWindow *displaywindow_open(char *filename,
                                         const char *peaks, double boost,
                                         int binning,
                                         int noisefilter, int calibmode,
                                         int colscale, const char *element,
                                         struct detector *det_geom,
                                         struct beam_params *beam,
                                         int show_rings,
                                         double *ring_radii, int n_rings,
                                         double ring_size, int median_filter);


#endif	/* DISPLAYWINDOW_H */