[gnome-color-manager] Show the color XYZ values in gcm-dump-profile



commit 1ff773d01291e7ac67569d38083aebcddf74d20d
Author: Richard Hughes <richard hughsie com>
Date:   Sun Oct 17 21:08:27 2010 +0100

    Show the color XYZ values in gcm-dump-profile

 libcolor-glib/gcm-profile.c |   68 +++++++++++++++++++++++++++++++++++++++++++
 libcolor-glib/gcm-profile.h |    4 ++
 tools/gcm-dump-profile.c    |   19 +++++++++++-
 3 files changed, 90 insertions(+), 1 deletions(-)
---
diff --git a/libcolor-glib/gcm-profile.c b/libcolor-glib/gcm-profile.c
index d949355..396ea54 100644
--- a/libcolor-glib/gcm-profile.c
+++ b/libcolor-glib/gcm-profile.c
@@ -219,6 +219,74 @@ gcm_profile_get_temperature (GcmProfile *profile)
 }
 
 /**
+ * gcm_profile_get_red:
+ * @profile: a valid #GcmProfile instance
+ *
+ * Gets the monitor red chromaticity value.
+ *
+ * Return value: the #GcmColorXYZ value
+ *
+ * Since: 2.91.1
+ **/
+const GcmColorXYZ *
+gcm_profile_get_red (GcmProfile *profile)
+{
+	g_return_val_if_fail (GCM_IS_PROFILE (profile), NULL);
+	return profile->priv->red;
+}
+
+/**
+ * gcm_profile_get_green:
+ * @profile: a valid #GcmProfile instance
+ *
+ * Gets the monitor green chromaticity value.
+ *
+ * Return value: the #GcmColorXYZ value
+ *
+ * Since: 2.91.1
+ **/
+const GcmColorXYZ *
+gcm_profile_get_green (GcmProfile *profile)
+{
+	g_return_val_if_fail (GCM_IS_PROFILE (profile), NULL);
+	return profile->priv->green;
+}
+
+/**
+ * gcm_profile_get_blue:
+ * @profile: a valid #GcmProfile instance
+ *
+ * Gets the monitor red chromaticity value.
+ *
+ * Return value: the #GcmColorXYZ value
+ *
+ * Since: 2.91.1
+ **/
+const GcmColorXYZ *
+gcm_profile_get_blue (GcmProfile *profile)
+{
+	g_return_val_if_fail (GCM_IS_PROFILE (profile), NULL);
+	return profile->priv->blue;
+}
+
+/**
+ * gcm_profile_get_white:
+ * @profile: a valid #GcmProfile instance
+ *
+ * Gets the monitor white chromaticity value.
+ *
+ * Return value: the #GcmColorXYZ value
+ *
+ * Since: 2.91.1
+ **/
+const GcmColorXYZ *
+gcm_profile_get_white (GcmProfile *profile)
+{
+	g_return_val_if_fail (GCM_IS_PROFILE (profile), NULL);
+	return profile->priv->white;
+}
+
+/**
  * gcm_profile_get_file:
  * @profile: A valid #GcmProfile
  *
diff --git a/libcolor-glib/gcm-profile.h b/libcolor-glib/gcm-profile.h
index e4cb774..b60d912 100644
--- a/libcolor-glib/gcm-profile.h
+++ b/libcolor-glib/gcm-profile.h
@@ -135,6 +135,10 @@ void		 gcm_profile_set_colorspace		(GcmProfile	*profile,
 gboolean	 gcm_profile_get_has_vcgt		(GcmProfile	*profile);
 gboolean	 gcm_profile_has_colorspace_description	(GcmProfile	*profile);
 guint		 gcm_profile_get_temperature		(GcmProfile	*profile);
+const GcmColorXYZ *gcm_profile_get_red			(GcmProfile	*profile);
+const GcmColorXYZ *gcm_profile_get_green		(GcmProfile	*profile);
+const GcmColorXYZ *gcm_profile_get_blue			(GcmProfile	*profile);
+const GcmColorXYZ *gcm_profile_get_white		(GcmProfile	*profile);
 
 G_END_DECLS
 
diff --git a/tools/gcm-dump-profile.c b/tools/gcm-dump-profile.c
index 91b4df9..e365cf3 100644
--- a/tools/gcm-dump-profile.c
+++ b/tools/gcm-dump-profile.c
@@ -44,7 +44,9 @@ gcm_dump_profile_filename (const gchar *filename)
 	const gchar *manufacturer;
 	const gchar *model;
 	const gchar *datetime;
+	const GcmColorXYZ *color;
 	GFile *file = NULL;
+	guint temperature;
 
 	/* parse profile */
 	profile = gcm_profile_new ();
@@ -62,7 +64,7 @@ gcm_dump_profile_filename (const gchar *filename)
 	colorspace = gcm_profile_get_colorspace (profile);
 	g_print ("Colorspace:\t%s\n", gcm_colorspace_to_string (colorspace));
 	size = gcm_profile_get_size (profile);
-	g_print ("Size:\t%i bytes\n", size);
+	g_print ("Size:\t\t%i bytes\n", size);
 	has_vcgt = gcm_profile_get_has_vcgt (profile);
 	g_print ("Has VCGT:\t%s\n", has_vcgt ? "Yes" : "No");
 	description = gcm_profile_get_description (profile);
@@ -77,6 +79,21 @@ gcm_dump_profile_filename (const gchar *filename)
 	model = gcm_profile_get_model (profile);
 	if (model != NULL)
 		g_print ("Model:\t%s\n", model);
+	color = gcm_profile_get_white (profile);
+	if (color != NULL)
+		g_print ("White:\t\t%f,%f,%f\n", color->X, color->Y, color->Z);
+	color = gcm_profile_get_red (profile);
+	if (color != NULL)
+		g_print ("Red:\t\t%f,%f,%f\n", color->X, color->Y, color->Z);
+	color = gcm_profile_get_green (profile);
+	if (color != NULL)
+		g_print ("Green:\t\t%f,%f,%f\n", color->X, color->Y, color->Z);
+	color = gcm_profile_get_blue (profile);
+	if (color != NULL)
+		g_print ("Blue:\t\t%f,%f,%f\n", color->X, color->Y, color->Z);
+	temperature = gcm_profile_get_temperature (profile);
+	if (temperature != 0)
+		g_print ("Temperature:\t%iK\n", temperature);
 	datetime = gcm_profile_get_datetime (profile);
 	if (datetime != NULL)
 		g_print ("Created:\t%s\n", datetime);



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