diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-12-12 08:29:45 -0800 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-12-12 08:29:45 -0800 |
commit | 6d3773ecda3a371877a7b40b0c07167358b8438c (patch) | |
tree | 26b991ff3d1c42bcbefab654f2ac75cdef9a0c3f | |
parent | d02a368e3f2991e9c7c867a569fa24e73300928e (diff) | |
parent | 45896ddf3b1354b683ddab417ef121d7a47f70b9 (diff) | |
download | uca-6d3773ecda3a371877a7b40b0c07167358b8438c.tar.gz uca-6d3773ecda3a371877a7b40b0c07167358b8438c.tar.bz2 uca-6d3773ecda3a371877a7b40b0c07167358b8438c.tar.xz uca-6d3773ecda3a371877a7b40b0c07167358b8438c.zip |
Merge pull request #22 from ufo-kit/roi
Fix statistics of ROI
-rw-r--r-- | bin/gui/control.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/bin/gui/control.c b/bin/gui/control.c index 2a7d74f..dd05be4 100644 --- a/bin/gui/control.c +++ b/bin/gui/control.c @@ -496,6 +496,10 @@ update_pixbuf (ThreadData *data) gdouble sigma; guint min; guint max; + guint width; + guint height; + guint x = 0; + guint y = 0; gdk_flush (); @@ -512,6 +516,17 @@ update_pixbuf (ThreadData *data) egg_histogram_view_update (EGG_HISTOGRAM_VIEW (data->histogram_view), uca_ring_buffer_get_current_pointer (data->buffer)); + if ((data->adj_width > 0) && (data->adj_height > 0)) { + x = data->from_x; + y = data->from_y; + width = data->adj_width; + height = data->adj_height; + } + else { + width = data->display_width; + height = data->display_height; + } + get_statistics (data, &mean, &sigma, &max, &min); string = g_string_new_len (NULL, 32); @@ -527,16 +542,16 @@ update_pixbuf (ThreadData *data) g_string_printf (string, "max = %i", max); gtk_label_set_text (data->max_label, string->str); - g_string_printf (string, "x = %i", data->from_x); + g_string_printf (string, "x = %i", x); gtk_label_set_text (data->roix_label, string->str); - g_string_printf (string, "y = %i", data->from_y); + g_string_printf (string, "y = %i", y); gtk_label_set_text (data->roiy_label, string->str); - g_string_printf (string, "width = %i", data->adj_width); + g_string_printf (string, "width = %i", width); gtk_label_set_text (data->roiw_label, string->str); - g_string_printf (string, "height = %i", data->adj_height); + g_string_printf (string, "height = %i", height); gtk_label_set_text (data->roih_label, string->str); g_string_free (string, TRUE); |