aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/displaywindow.c9
-rw-r--r--src/displaywindow.h3
-rw-r--r--src/hdfsee.c28
3 files changed, 32 insertions, 8 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c
index f78977e9..3f4a7f31 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -29,9 +29,6 @@
#include "utils.h"
-#define INITIAL_BINNING 2
-
-
static void displaywindow_error(DisplayWindow *dw, const char *message)
{
GtkWidget *window;
@@ -929,7 +926,8 @@ static gint displaywindow_press(GtkWidget *widget, GdkEventButton *event,
}
-DisplayWindow *displaywindow_open(const char *filename, const char *peaks)
+DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
+ int boost, int binning)
{
DisplayWindow *dw;
char *title;
@@ -991,7 +989,8 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks)
gtk_window_set_resizable(GTK_WINDOW(dw->window), FALSE);
gtk_widget_show_all(dw->window);
- dw->binning = INITIAL_BINNING;
+ dw->binning = binning;
+ dw->boostint = boost;
displaywindow_update(dw);
/* Peak list provided at startup? */
diff --git a/src/displaywindow.h b/src/displaywindow.h
index 04199cd3..dfd79fb9 100644
--- a/src/displaywindow.h
+++ b/src/displaywindow.h
@@ -67,7 +67,8 @@ typedef struct {
/* Open an image display window showing the given filename, or NULL */
extern DisplayWindow *displaywindow_open(const char *filename,
- const char *peaks);
+ const char *peaks, int boost,
+ int binning);
#endif /* DISPLAYWINDOW_H */
diff --git a/src/hdfsee.c b/src/hdfsee.c
index 269f90a0..081769d3 100644
--- a/src/hdfsee.c
+++ b/src/hdfsee.c
@@ -36,6 +36,8 @@ static void show_help(const char *s)
" -h, --help Display this help message.\n"
"\n"
" -p, --peak-overlay=<filename> Draw circles in positions listed in file.\n"
+" -i, --int-boost=<n> Multiple intensity by <n>.\n"
+" -b, --binning=<n> Set display binning to <n>.\n"
"\n");
}
@@ -72,11 +74,15 @@ int main(int argc, char *argv[])
size_t i;
int nfiles;
char *peaks = NULL;
+ int boost = 1;
+ int binning = 2;
/* Long options */
const struct option longopts[] = {
{"help", 0, NULL, 'h'},
{"peak-overlay", 1, NULL, 'p'},
+ {"int-boost", 1, NULL, 'i'},
+ {"binning", 1, NULL, 'b'},
{0, 0, NULL, 0}
};
@@ -84,7 +90,7 @@ int main(int argc, char *argv[])
gtk_init(&argc, &argv);
/* Short options */
- while ((c = getopt_long(argc, argv, "hp:", longopts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "hp:b:i:", longopts, NULL)) != -1) {
switch (c) {
case 'h' : {
@@ -97,6 +103,23 @@ int main(int argc, char *argv[])
break;
}
+ case 'i' : {
+ boost = atoi(optarg);
+ if ( boost < 1 ) {
+ ERROR("Intensity boost must be a positive"
+ " integer.\n");
+ }
+ break;
+ }
+
+ case 'b' : {
+ binning = atoi(optarg);
+ if ( boost < 1 ) {
+ ERROR("Binning must be a positive integer.\n");
+ }
+ break;
+ }
+
case 0 : {
break;
}
@@ -116,7 +139,8 @@ int main(int argc, char *argv[])
}
for ( i=0; i<nfiles; i++ ) {
- main_window_list[i] = displaywindow_open(argv[optind+i], peaks);
+ main_window_list[i] = displaywindow_open(argv[optind+i], peaks,
+ boost, binning);
if ( main_window_list[i] == NULL ) {
ERROR("Couldn't open display window\n");
} else {