summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMaria <matveeva.maria@gmail.com>2013-10-21 13:44:12 +0200
committerMaria <matveeva.maria@gmail.com>2013-10-21 13:44:12 +0200
commite9db4d1a2ffed601e47621d0944c65f0ae087edf (patch)
tree0ed834c1da077abfac9905239f1ed8e3ee8182e3 /bin
parent2e9fae14dafe36b5bd4864f7da28732d0118b74c (diff)
downloadlibuca-e9db4d1a2ffed601e47621d0944c65f0ae087edf.tar.gz
libuca-e9db4d1a2ffed601e47621d0944c65f0ae087edf.tar.bz2
libuca-e9db4d1a2ffed601e47621d0944c65f0ae087edf.tar.xz
libuca-e9db4d1a2ffed601e47621d0944c65f0ae087edf.zip
Remove floating point exception.
Diffstat (limited to 'bin')
-rw-r--r--bin/gui/control.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/gui/control.c b/bin/gui/control.c
index 35e2267..505224c 100644
--- a/bin/gui/control.c
+++ b/bin/gui/control.c
@@ -101,7 +101,7 @@ up_and_down_scale (ThreadData *data, gpointer buffer)
factor = 255.0 / (max - min);
output = data->pixels;
zoom = (gint) data->zoom_factor;
- stride = (gint) 1 / zoom;
+ stride = (gint) 1 / data->zoom_factor;
do_log = gtk_toggle_button_get_active (data->log_button);
if (data->state == RUNNING) {
@@ -129,7 +129,7 @@ up_and_down_scale (ThreadData *data, gpointer buffer)
for (gint x = 0; x < data->display_width; x++) {
if (zoom <= 1)
- offset += stride;
+ offset += stride;
else
offset = ((gint) (y / zoom) * data->width) + ((gint) (x / zoom));
@@ -193,7 +193,7 @@ up_and_down_scale (ThreadData *data, gpointer buffer)
guint16 *input = (guint16 *) buffer;
for (gint y = 0; y < data->display_height; y++) {
- if (zoom <= 1){
+ if (zoom <= 1) {
offset = y * stride * data->width;
}
@@ -304,7 +304,7 @@ get_statistics (ThreadData *data, gdouble *mean, gdouble *sigma, guint *_max, gu
}
if (gtk_toggle_button_get_active (data->log_button)) {
- *mean = log(sum/n);
+ *mean = log (sum/n);
*sigma = log (sqrt((squared_sum - sum*sum/n) / (n - 1)));
}
else {
@@ -800,6 +800,7 @@ create_main_window (GtkBuilder *builder, const gchar* camera_name)
g_signal_connect (camera, "notify::roi-width", (GCallback) on_roi_width_changed, &td);
g_signal_connect (camera, "notify::roi-height", (GCallback) on_roi_height_changed, &td);
+
histogram_view = egg_histogram_view_new (width * height, bits_per_sample, 256);
property_tree_view = egg_property_tree_view_new (G_OBJECT (camera));
image = GTK_WIDGET (gtk_builder_get_object (builder, "image"));