diff src/histogram.c @ 1312:fcf0e7a6143e

Introduce helpers histogram_toggle_channel() and histogram_toggle_mode().
author zas_
date Mon, 23 Feb 2009 17:20:40 +0000
parents ef05743535e3
children 1fc356f629fe
line wrap: on
line diff
--- a/src/histogram.c	Sun Feb 22 17:46:42 2009 +0000
+++ b/src/histogram.c	Mon Feb 23 17:20:40 2009 +0000
@@ -97,6 +97,18 @@
 	return histogram->log_mode;
 }
 
+gint histogram_toggle_channel(Histogram *histogram)
+{
+	if (!histogram) return 0;
+	return histogram_set_channel(histogram, (histogram_get_channel(histogram)+1)%HCHAN_COUNT);
+}
+
+gint histogram_toggle_mode(Histogram *histogram)
+{
+	if (!histogram) return 0;
+	return histogram_set_mode(histogram, !histogram_get_mode(histogram));
+}
+
 const gchar *histogram_label(Histogram *histogram)
 {
 	const gchar *t1 = "";