[gnome-color-manager] trivial: add functionality to get a Vec3 from a GcmColor type
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: add functionality to get a Vec3 from a GcmColor type
- Date: Tue, 3 Aug 2010 16:07:53 +0000 (UTC)
commit da75a91c11bf08d960eb2de5bcb1d9adebccb38d
Author: Richard Hughes <richard hughsie com>
Date: Tue Aug 3 12:39:02 2010 +0100
trivial: add functionality to get a Vec3 from a GcmColor type
libcolor-glib/gcm-color.c | 30 ++++++++++++++++++++++++++++++
libcolor-glib/gcm-color.h | 6 +++---
2 files changed, 33 insertions(+), 3 deletions(-)
---
diff --git a/libcolor-glib/gcm-color.c b/libcolor-glib/gcm-color.c
index 13f0a3e..675fcdd 100644
--- a/libcolor-glib/gcm-color.c
+++ b/libcolor-glib/gcm-color.c
@@ -173,3 +173,33 @@ gcm_color_convert_XYZ_to_Yxy (const GcmColorXYZ *src, GcmColorYxy *dest)
dest->x = src->X / sum;
dest->y = src->Y / sum;
}
+
+/**
+ * gcm_color_get_XYZ_Vec3:
+ * @src: the source color
+ *
+ * Returns the color as a vector component
+ *
+ * Return value: the vector.
+ **/
+GcmVec3 *
+gcm_color_get_XYZ_Vec3 (GcmColorXYZ *src)
+{
+ g_return_val_if_fail (src != NULL, NULL);
+ return (GcmVec3 *) src;
+}
+
+/**
+ * gcm_color_get_RGB_Vec3:
+ * @src: the source color
+ *
+ * Returns the color as a vector component
+ *
+ * Return value: the vector.
+ **/
+GcmVec3 *
+gcm_color_get_RGB_Vec3 (GcmColorRGB *src)
+{
+ g_return_val_if_fail (src != NULL, NULL);
+ return (GcmVec3 *) src;
+}
diff --git a/libcolor-glib/gcm-color.h b/libcolor-glib/gcm-color.h
index c0bb309..80bdc9c 100644
--- a/libcolor-glib/gcm-color.h
+++ b/libcolor-glib/gcm-color.h
@@ -26,7 +26,7 @@
#ifndef __GCM_COLOR_H__
#define __GCM_COLOR_H__
-#define __GCM_COLOR_H_INSIDE__
+#include <gcm-common.h>
typedef struct {
guint8 R;
@@ -70,8 +70,8 @@ void gcm_color_convert_Yxy_to_XYZ (const GcmColorYxy *src,
GcmColorXYZ *dest);
void gcm_color_convert_XYZ_to_Yxy (const GcmColorXYZ *src,
GcmColorYxy *dest);
-
-#undef __GCM_COLOR_H_INSIDE__
+GcmVec3 *gcm_color_get_XYZ_Vec3 (GcmColorXYZ *src);
+GcmVec3 *gcm_color_get_RGB_Vec3 (GcmColorRGB *src);
#endif /* __GCM_COLOR_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]