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:
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/math_color.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 396f2c52058..693fd885b50 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -372,6 +372,40 @@ void linearrgb_to_srgb_v3_v3(float *col_to, float *col_from)
col_to[2] = linearrgb_to_srgb(col_from[2]);
}
+/* todo, should these be moved elsewhere?, they dont belong in imbuf */
+void srgb_to_linearrgb_rgba_buf(float *col, int tot)
+{
+ while(tot--) {
+ srgb_to_linearrgb_v3_v3(col, col);
+ col += 4;
+ }
+}
+
+void linearrgb_to_srgb_rgba_buf(float *col, int tot)
+{
+ while(tot--) {
+ linearrgb_to_srgb_v3_v3(col, col);
+ col += 4;
+ }
+}
+
+void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot)
+{
+ while(tot--) {
+ srgb_to_linearrgb_v3_v3(col_to, col_from);
+ col_to += 4;
+ col_from += 4;
+ }
+}
+
+void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot)
+{
+ while(tot--) {
+ linearrgb_to_srgb_v3_v3(col_to, col_from);
+ col_to += 4;
+ col_from += 4;
+ }
+}
void minmax_rgb(short c[])
{