Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-26 15:01:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-26 15:01:01 +0400
commit63788b47d6e805a97aac1501d3e64e1ada7e40b3 (patch)
tree4a0f33da8af8081ec87cc9846dc83cc39f8b2289 /source/blender/blenlib/intern/math_color.c
parente727056c2e34857dd5556e66c9858506eb63e987 (diff)
add vector versions of hsv_to_rgb, rgb_to_hsv & rgb_to_hsv_compat
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r--source/blender/blenlib/intern/math_color.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index abd9c1ea5b8..152fc98945f 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -90,6 +90,12 @@ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
}
}
+/* convenience function for now */
+void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
+{
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], &r_rgb[0], &r_rgb[1], &r_rgb[2]);
+}
+
void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv)
{
float y, u, v;
@@ -252,6 +258,12 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
*lv = v;
}
+/* convenience function for now */
+void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
+{
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], &r_hsv[0], &r_hsv[1], &r_hsv[2]);
+}
+
void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv)
{
float orig_h = *lh;
@@ -272,6 +284,12 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l
}
}
+/* convenience function for now */
+void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3])
+{
+ rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &r_hsv[0], &r_hsv[1], &r_hsv[2]);
+}
+
/*http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */
void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int colorspace)