aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dw-hdfsee.c4
-rw-r--r--src/dw-hdfsee.h3
-rw-r--r--src/hdfsee.c21
3 files changed, 22 insertions, 6 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 130d9f06..27b5c891 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -1686,7 +1686,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
int boost, int binning, int cmfilter,
int noisefilter, int colscale,
const char *element, const char *geometry,
- int show_rings)
+ int show_rings, double ring_size)
{
DisplayWindow *dw;
char *title;
@@ -1714,7 +1714,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
dw->noisefilter = noisefilter;
dw->not_ready_yet = 1;
dw->surf = NULL;
- dw->ring_radius = 5.0;
+ dw->ring_radius = ring_size;
/* Open the file, if any */
if ( filename != NULL ) {
diff --git a/src/dw-hdfsee.h b/src/dw-hdfsee.h
index c13b3635..87030dc0 100644
--- a/src/dw-hdfsee.h
+++ b/src/dw-hdfsee.h
@@ -100,7 +100,8 @@ extern DisplayWindow *displaywindow_open(const char *filename,
int binning, int cmfilter,
int noisefilter, int colscale,
const char *element,
- const char *geometry, int show_rings);
+ const char *geometry, int show_rings,
+ double ring_size);
#endif /* DISPLAYWINDOW_H */
diff --git a/src/hdfsee.c b/src/hdfsee.c
index 5a58ff9d..ba8d8eea 100644
--- a/src/hdfsee.c
+++ b/src/hdfsee.c
@@ -36,6 +36,7 @@ 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"
+" --ring-size=<n> Set the size for those circles.\n"
" -i, --int-boost=<n> Multiply intensity by <n>.\n"
" -b, --binning=<n> Set display binning to <n>.\n"
" --filter-cm Perform common-mode noise subtraction.\n"
@@ -97,6 +98,7 @@ int main(int argc, char *argv[])
char *cscale = NULL;
char *element = NULL;
char *geometry = NULL;
+ double ring_size = 5.0;
/* Long options */
const struct option longopts[] = {
@@ -110,15 +112,18 @@ int main(int argc, char *argv[])
{"image", 1, NULL, 'e'},
{"geometry", 1, NULL, 'g'},
{"show-rings", 0, &config_showrings, 1},
+ {"ring-size", 1, NULL, 2},
{0, 0, NULL, 0}
};
gtk_init(&argc, &argv);
/* Short options */
- while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:",
+ while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:2:",
longopts, NULL)) != -1) {
+ char *test;
+
switch (c) {
case 'h' :
show_help(argv[0]);
@@ -133,13 +138,15 @@ int main(int argc, char *argv[])
if ( boost < 1 ) {
ERROR("Intensity boost must be a positive"
" integer.\n");
+ return 1;
}
break;
case 'b' :
binning = atoi(optarg);
- if ( boost < 1 ) {
+ if ( binning < 1 ) {
ERROR("Binning must be a positive integer.\n");
+ return 1;
}
break;
@@ -155,6 +162,13 @@ int main(int argc, char *argv[])
geometry = strdup(optarg);
break;
+ case 2 :
+ ring_size = strtod(optarg, &test);
+ if ( test == optarg ) {
+ ERROR("Ring size must be numerical.\n");
+ return 1;
+ }
+
case 0 :
break;
@@ -193,7 +207,8 @@ int main(int argc, char *argv[])
config_noisefilter,
colscale, element,
geometry,
- config_showrings);
+ config_showrings,
+ ring_size);
if ( main_window_list[i] == NULL ) {
ERROR("Couldn't open display window\n");
} else {