[gnome-color-manager] trivial: add gcm_color_init_XYZ() and gcm_color_init_RGB() for future code



commit c36721ccfa3277b2bdeabe1e7f14b16587aeb8cb
Author: Richard Hughes <richard hughsie com>
Date:   Fri Sep 24 23:31:34 2010 +0100

    trivial: add gcm_color_init_XYZ() and gcm_color_init_RGB() for future code

 libcolor-glib/gcm-color.c |   38 ++++++++++++++++++++++++++++++++++++++
 libcolor-glib/gcm-color.h |    8 ++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/libcolor-glib/gcm-color.c b/libcolor-glib/gcm-color.c
index 675fcdd..4be3075 100644
--- a/libcolor-glib/gcm-color.c
+++ b/libcolor-glib/gcm-color.c
@@ -34,6 +34,44 @@
 #include <gcm-color.h>
 
 /**
+ * gcm_color_init_XYZ:
+ * @dest: the destination color
+ * @X: component value
+ * @Y: component value
+ * @Z: component value
+ *
+ * Initialises a color value.
+ **/
+void
+gcm_color_init_XYZ (GcmColorXYZ *dest, gdouble X, gdouble Y, gdouble Z)
+{
+	g_return_if_fail (dest != NULL);
+
+	dest->X = X;
+	dest->Y = Y;
+	dest->Z = Z;
+}
+
+/**
+ * gcm_color_init_RGB:
+ * @dest: the destination color
+ * @R: component value
+ * @G: component value
+ * @B: component value
+ *
+ * Initialises a color value.
+ **/
+void
+gcm_color_init_RGB (GcmColorRGB *dest, gdouble R, gdouble G, gdouble B)
+{
+	g_return_if_fail (dest != NULL);
+
+	dest->R = R;
+	dest->G = G;
+	dest->B = B;
+}
+
+/**
  * gcm_color_copy_XYZ:
  * @src: the source color
  * @dest: the destination color
diff --git a/libcolor-glib/gcm-color.h b/libcolor-glib/gcm-color.h
index 743908f..3341cbc 100644
--- a/libcolor-glib/gcm-color.h
+++ b/libcolor-glib/gcm-color.h
@@ -58,6 +58,14 @@ typedef struct {
 	gdouble	 B;
 } GcmColorRGB;
 
+void		 gcm_color_init_XYZ			(GcmColorXYZ		*dest,
+							 gdouble		 X,
+							 gdouble		 Y,
+							 gdouble		 Z);
+void		 gcm_color_init_RGB			(GcmColorRGB		*dest,
+							 gdouble		 R,
+							 gdouble		 G,
+							 gdouble		 B);
 void		 gcm_color_copy_XYZ			(const GcmColorXYZ	*src,
 							 GcmColorXYZ		*dest);
 void		 gcm_color_copy_RGB			(const GcmColorRGB	*src,



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