[gnome-color-manager] huey: when the sensor is in a light free environment it still displays a value



commit f86d52d180b76c8ed97c4197b5950255b2f63593
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 19 16:57:03 2010 +0100

    huey: when the sensor is in a light free environment it still displays a value
    
    It's not really clear when this adjustment should be put into the
    calculation, of if the data is part of the calibration data.

 libcolor-glib/gcm-sensor-huey.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libcolor-glib/gcm-sensor-huey.c b/libcolor-glib/gcm-sensor-huey.c
index 633e3cf..0614dc5 100644
--- a/libcolor-glib/gcm-sensor-huey.c
+++ b/libcolor-glib/gcm-sensor-huey.c
@@ -649,6 +649,11 @@ out:
 	return ret;
 }
 
+/* in a dark box, the sensors still report a reading */
+#define HUEY_ABSOLUTE_OFFSET_RED	0.000119
+#define HUEY_ABSOLUTE_OFFSET_GREEN	0.000119
+#define HUEY_ABSOLUTE_OFFSET_BLUE	0.000018
+
 /**
  * gcm_sensor_huey_sample:
  *
@@ -672,7 +677,7 @@ gcm_sensor_huey_sample (GcmSensor *sensor, GcmColorXYZ *value, GError **error)
 	ret = gcm_sensor_huey_sample_for_threshold (sensor_huey, &multiplier, &native, error);
 	if (!ret)
 		goto out;
-	egg_debug ("initial values: red=%0.4lf, green=%0.4lf, blue=%0.4lf", native.R, native.G, native.B);
+	egg_debug ("initial values: red=%0.6lf, green=%0.6lf, blue=%0.6lf", native.R, native.G, native.B);
 
 	/* compromise between the amount of time and the precision */
 	precision_value = (gdouble) HUEY_PRECISION_TIME_VALUE;
@@ -695,7 +700,7 @@ gcm_sensor_huey_sample (GcmSensor *sensor, GcmColorXYZ *value, GError **error)
 	native.R = native.R * (gdouble)multiplier.R;
 	native.G = native.G * (gdouble)multiplier.G;
 	native.B = native.B * (gdouble)multiplier.B;
-	egg_debug ("scaled values: red=%0.4lf, green=%0.4lf, blue=%0.4lf", native.R, native.G, native.B);
+	egg_debug ("scaled values: red=%0.6lf, green=%0.6lf, blue=%0.6lf", native.R, native.G, native.B);
 	egg_debug ("PRE MULTIPLY: %s\n", gcm_vec3_to_string (input));
 
 	/* it would be rediculous for the device to emit RGB, it would be completely arbitrary --



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