[gnome-color-manager: 35/80] huey: get the relationship between the multiplier and the value, and plot a graph



commit 490ddc549efcddae93aba8132e993cbc24b681ca
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jul 17 22:58:53 2010 +0100

    huey: get the relationship between the multiplier and the value, and plot a graph

 docs/huey/multiplier-1-to-100.csv.gz |  Bin 0 -> 905 bytes
 src/gcm-huey-example.c               |   15 ++++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/docs/huey/multiplier-1-to-100.csv.gz b/docs/huey/multiplier-1-to-100.csv.gz
new file mode 100644
index 0000000..d0c6958
Binary files /dev/null and b/docs/huey/multiplier-1-to-100.csv.gz differ
diff --git a/src/gcm-huey-example.c b/src/gcm-huey-example.c
index f630f0b..33056a7 100644
--- a/src/gcm-huey-example.c
+++ b/src/gcm-huey-example.c
@@ -567,6 +567,7 @@ get_color (GcmPriv *priv, GcmColorUint16 *values, GError **error)
 {
 	gboolean ret;
 	GcmColorUint8 rgb;
+	guint i;
 
 	/* set this to one value for a quick approximate value */
 	rgb.red = 1;
@@ -577,14 +578,22 @@ get_color (GcmPriv *priv, GcmColorUint16 *values, GError **error)
 		goto out;
 	g_debug ("initial values: red=%i, green=%i, blue=%i", values->red, values->green, values->blue);
 
+g_print ("xxx%i,%i,%i,%i\n", 0, values->red, values->green, values->blue);
+
+/* generate the relationship to see if it's linear */
+for (i=0;i<100;i++) {
 	/* pump up the scale a little */
-	rgb.red = 4;
-	rgb.green = 4;
-	rgb.blue = 4;
+	rgb.red = i;
+	rgb.green = i;
+	rgb.blue = i;
 	ret = get_color_for_threshold (priv, &rgb, values, error);
 	if (!ret)
 		goto out;
 	g_debug ("scaled values: red=%i, green=%i, blue=%i", values->red, values->green, values->blue);
+
+g_print ("%i,%i,%i,%i\n", i, values->red, values->green, values->blue);
+}
+
 out:
 	return ret;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]