diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-28 17:29:33 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-28 17:29:33 +0400 |
commit | b9ff5840a617ec836f2d09bb0f04d60e5c3b8f67 (patch) | |
tree | 8a196777f4ee32e3ee089c12b667caa2c82dec75 /source/blender/blenlib/intern/math_color.c | |
parent | 1f02209957fc8afde957b48f1be41fc399a725b0 (diff) |
Code refactoring: add unified image buffer functions for doing float => byte,
byte => float, float => float, byte => byte conversions with profile, dither
and predivide. Previously code for this was spread out too much.
There should be no functional changes, this is so the predivide/table/dither
patches can work correctly.
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 2ef29c1ce94..8f5366b6317 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -393,57 +393,6 @@ float linearrgb_to_srgb(float c) return 1.055f * powf(c, 1.0f/2.4f) - 0.055f; } -void srgb_to_linearrgb_v3_v3(float *col_to, float *col_from) -{ - col_to[0] = srgb_to_linearrgb(col_from[0]); - col_to[1] = srgb_to_linearrgb(col_from[1]); - col_to[2] = srgb_to_linearrgb(col_from[2]); -} - -void linearrgb_to_srgb_v3_v3(float *col_to, float *col_from) -{ - col_to[0] = linearrgb_to_srgb(col_from[0]); - col_to[1] = linearrgb_to_srgb(col_from[1]); - 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[3]= col_from[3]; - 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[3]= col_from[3]; - col_to += 4; - col_from += 4; - } -} - void minmax_rgb(short c[]) { if(c[0]>255) c[0]=255; |