[gnome-color-manager] trivial: add a 'has-vcgt' tag to GcmProfile



commit 273f66e4cd403fbcdc9890ddc4530e262d1cd8e4
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jan 6 09:17:19 2010 +0000

    trivial: add a 'has-vcgt' tag to GcmProfile

 src/gcm-dump-profile.c  |    3 +++
 src/gcm-profile-lcms1.c |    5 +++++
 src/gcm-profile.c       |   16 ++++++++++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-dump-profile.c b/src/gcm-dump-profile.c
index 39bf4b2..0bb3951 100644
--- a/src/gcm-dump-profile.c
+++ b/src/gcm-dump-profile.c
@@ -41,6 +41,7 @@ gcm_dump_profile_filename (const gchar *filename)
 	guint profile_type;
 	guint colorspace;
 	guint size;
+	gboolean has_vcgt;
 	gchar *description = NULL;
 	gchar *copyright = NULL;
 	gchar *manufacturer = NULL;
@@ -61,6 +62,7 @@ gcm_dump_profile_filename (const gchar *filename)
 		      "type", &profile_type,
 		      "colorspace", &colorspace,
 		      "size", &size,
+		      "has-vcgt", &has_vcgt,
 		      "description", &description,
 		      "copyright", &copyright,
 		      "manufacturer", &manufacturer,
@@ -72,6 +74,7 @@ gcm_dump_profile_filename (const gchar *filename)
 	g_print ("Type:\t%s\n", gcm_profile_type_to_text (profile_type));
 	g_print ("Colorspace:\t%s\n", gcm_profile_colorspace_to_text (colorspace));
 	g_print ("Size:\t%i bytes\n", size);
+	g_print ("Has VCGT:\t%s\n", has_vcgt ? "Yes" : "No");
 	if (description != NULL)
 		g_print ("Description:\t%s\n", description);
 	if (copyright != NULL)
diff --git a/src/gcm-profile-lcms1.c b/src/gcm-profile-lcms1.c
index 4f94794..8f8e718 100644
--- a/src/gcm-profile-lcms1.c
+++ b/src/gcm-profile-lcms1.c
@@ -699,6 +699,11 @@ gcm_profile_lcms1_parse_data (GcmProfile *profile, const guint8 *data, gsize len
 	/* success */
 	ret = TRUE;
 
+	/* set properties */
+	g_object_set (profile,
+		      "has-vcgt", priv->has_vcgt_formula || priv->has_vcgt_table,
+		      NULL);
+
 	egg_debug ("Has MLUT:         %s", priv->has_mlut ? "YES" : "NO");
 	egg_debug ("Has VCGT formula: %s", priv->has_vcgt_formula ? "YES" : "NO");
 	egg_debug ("Has VCGT table:   %s", priv->has_vcgt_table ? "YES" : "NO");
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 6918fad..7b1f27c 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -53,6 +53,7 @@ struct _GcmProfilePrivate
 	guint				 profile_type;
 	guint				 colorspace;
 	guint				 size;
+	gboolean			 has_vcgt;
 	gchar				*description;
 	gchar				*filename;
 	gchar				*copyright;
@@ -77,6 +78,7 @@ enum {
 	PROP_TYPE,
 	PROP_COLORSPACE,
 	PROP_SIZE,
+	PROP_HAS_VCGT,
 	PROP_WHITE_POINT,
 	PROP_BLACK_POINT,
 	PROP_LUMINANCE_RED,
@@ -283,6 +285,9 @@ gcm_profile_get_property (GObject *object, guint prop_id, GValue *value, GParamS
 	case PROP_SIZE:
 		g_value_set_uint (value, priv->size);
 		break;
+	case PROP_HAS_VCGT:
+		g_value_set_boolean (value, priv->has_vcgt);
+		break;
 	case PROP_WHITE_POINT:
 		g_value_set_object (value, priv->white_point);
 		break;
@@ -370,6 +375,9 @@ gcm_profile_set_property (GObject *object, guint prop_id, const GValue *value, G
 	case PROP_SIZE:
 		priv->size = g_value_get_uint (value);
 		break;
+	case PROP_HAS_VCGT:
+		priv->has_vcgt = g_value_get_boolean (value);
+		break;
 	case PROP_WHITE_POINT:
 		priv->white_point = g_value_dup_object (value);
 		break;
@@ -476,6 +484,14 @@ gcm_profile_class_init (GcmProfileClass *klass)
 	g_object_class_install_property (object_class, PROP_SIZE, pspec);
 
 	/**
+	 * GcmProfile:has-vcgt:
+	 */
+	pspec = g_param_spec_boolean ("has-vcgt", NULL, NULL,
+				      FALSE,
+				      G_PARAM_READWRITE);
+	g_object_class_install_property (object_class, PROP_HAS_VCGT, pspec);
+
+	/**
 	 * GcmProfile:white-point:
 	 */
 	pspec = g_param_spec_object ("white-point", NULL, NULL,



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