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/blenkernel/intern/colortools.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/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 2f568aa01eb..67bd6a22348 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -52,45 +52,6 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" - -void floatbuf_to_srgb_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int UNUSED(w)) -{ - int x, y; - float *rf= rectf; - float srgb[3]; - unsigned char *rc= rectc; - - for(y=y1; y<y2; y++) { - for(x=x1; x<x2; x++, rf+=4, rc+=4) { - srgb[0]= linearrgb_to_srgb(rf[0]); - srgb[1]= linearrgb_to_srgb(rf[1]); - srgb[2]= linearrgb_to_srgb(rf[2]); - - rc[0]= FTOCHAR(srgb[0]); - rc[1]= FTOCHAR(srgb[1]); - rc[2]= FTOCHAR(srgb[2]); - rc[3]= FTOCHAR(rf[3]); - } - } -} - -void floatbuf_to_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int UNUSED(w)) -{ - int x, y; - float *rf= rectf; - unsigned char *rc= rectc; - - for(y=y1; y<y2; y++) { - for(x=x1; x<x2; x++, rf+=4, rc+=4) { - rc[0]= FTOCHAR(rf[0]); - rc[1]= FTOCHAR(rf[1]); - rc[2]= FTOCHAR(rf[2]); - rc[3]= FTOCHAR(rf[3]); - } - } -} - - /* ********************************* color curve ********************* */ /* ***************** operations on full struct ************* */ |