aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_main.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-08-16 16:13:41 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-08-16 16:13:41 +0000
commitb792eff62d48475136f73bb4c7366208244f4772 (patch)
treeef729801cf36f041d5fdbed9030221839e30320c /legacy/evas/src/lib/canvas/evas_main.c
parent * eina: remove configure option for rwlock as it is not used anymore. (diff)
downloadefl-b792eff62d48475136f73bb4c7366208244f4772.tar.gz
* evas: oops, that wasn't to be gone.
SVN revision: 51221
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_main.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_main.c119
1 files changed, 119 insertions, 0 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_main.c b/legacy/evas/src/lib/canvas/evas_main.c
index 5c7e60617d..7b9f880488 100644
--- a/legacy/evas/src/lib/canvas/evas_main.c
+++ b/legacy/evas/src/lib/canvas/evas_main.c
@@ -1152,3 +1152,122 @@ evas_load_error_str(int error)
return "Unknown error";
}
}
+
+/**
+ * Convert a given color from HSV to RGB format.
+ *
+ * @param h The Hue component of the color.
+ * @param s The Saturation component of the color.
+ * @param v The Value component of the color.
+ * @param r The Red component of the color.
+ * @param g The Green component of the color.
+ * @param b The Blue component of the color.
+ *
+ * This function converts a given color in HSV color format to RGB
+ * color format.
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
+{
+ evas_common_convert_color_hsv_to_rgb(h, s, v, r, g, b);
+}
+
+/**
+ * Convert a given color from RGB to HSV format.
+ *
+ * @param r The Red component of the color.
+ * @param g The Green component of the color.
+ * @param b The Blue component of the color.
+ * @param h The Hue component of the color.
+ * @param s The Saturation component of the color.
+ * @param v The Value component of the color.
+ *
+ * This function converts a given color in RGB color format to HSV
+ * color format.
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v)
+{
+ evas_common_convert_color_rgb_to_hsv(r, g, b, h, s, v);
+}
+
+/**
+ * Pre-multiplies a rgb triplet by an alpha factor.
+ *
+ * @param a The alpha factor.
+ * @param r The Red component of the color.
+ * @param g The Green component of the color.
+ * @param b The Blue component of the color.
+ *
+ * This function pre-multiplies a given rbg triplet by an alpha
+ * factor. Alpha factor is used to define transparency.
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_color_argb_premul(int a, int *r, int *g, int *b)
+{
+ evas_common_convert_color_argb_premul(a, r, g, b);
+}
+
+/**
+ * Undo pre-multiplication of a rgb triplet by an alpha factor.
+ *
+ * @param a The alpha factor.
+ * @param r The Red component of the color.
+ * @param g The Green component of the color.
+ * @param b The Blue component of the color.
+ *
+ * This function undoes pre-multiplication a given rbg triplet by an
+ * alpha factor. Alpha factor is used to define transparency.
+ *
+ * @see evas_color_argb_premul().
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_color_argb_unpremul(int a, int *r, int *g, int *b)
+{
+ evas_common_convert_color_argb_unpremul(a, r, g, b);
+}
+
+/**
+ * Pre-multiplies data by an alpha factor.
+ *
+ * @param data The data value.
+ * @param len The lenght value.
+ *
+ * This function pre-multiplies a given data by an alpha
+ * factor. Alpha factor is used to define transparency.
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_data_argb_premul(unsigned int *data, unsigned int len)
+{
+ if (!data || (len < 1)) return;
+ evas_common_convert_argb_premul(data, len);
+}
+
+/**
+ * Undo pre-multiplication data by an alpha factor.
+ *
+ * @param data The data value.
+ * @param len The lenght value.
+ *
+ * This function undoes pre-multiplication of a given data by an alpha
+ * factor. Alpha factor is used to define transparency.
+ *
+ * @ingroup Evas_Utils
+ **/
+EAPI void
+evas_data_argb_unpremul(unsigned int *data, unsigned int len)
+{
+ if (!data || (len < 1)) return;
+ evas_common_convert_argb_unpremul(data, len);
+}
+