diff options
author | Maria <matveeva.maria@gmail.com> | 2013-12-12 17:27:22 +0100 |
---|---|---|
committer | Maria <matveeva.maria@gmail.com> | 2013-12-12 17:27:22 +0100 |
commit | 45896ddf3b1354b683ddab417ef121d7a47f70b9 (patch) | |
tree | 26b991ff3d1c42bcbefab654f2ac75cdef9a0c3f /bin | |
parent | d02a368e3f2991e9c7c867a569fa24e73300928e (diff) | |
download | libuca-45896ddf3b1354b683ddab417ef121d7a47f70b9.tar.gz libuca-45896ddf3b1354b683ddab417ef121d7a47f70b9.tar.bz2 libuca-45896ddf3b1354b683ddab417ef121d7a47f70b9.tar.xz libuca-45896ddf3b1354b683ddab417ef121d7a47f70b9.zip |
Fix statistics of ROI
Diffstat (limited to 'bin')
-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); |