diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-22 18:28:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-22 18:28:43 +0400 |
commit | fc5da14dad0256064a4778694af873fe48ab4fb2 (patch) | |
tree | 0894b2cce120c6f66eec99d696d769912794b116 /source/blender/imbuf/intern/cineon/logImageCore.c | |
parent | 40da6bb531ebb3b43a9e66f31390498620a9c082 (diff) |
Fix for inline functions of new cineon library
Diffstat (limited to 'source/blender/imbuf/intern/cineon/logImageCore.c')
-rw-r--r-- | source/blender/imbuf/intern/cineon/logImageCore.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c b/source/blender/imbuf/intern/cineon/logImageCore.c index 36c9787d14d..5c734db323d 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.c +++ b/source/blender/imbuf/intern/cineon/logImageCore.c @@ -1429,77 +1429,3 @@ static int convertRGBAToLogElement(float *src, float *dst, LogImageFile *logImag return rvalue; } - -/* - * Endianness swapping - */ - -inline unsigned short swap_ushort(unsigned short x, int swap) -{ - if (swap != 0) - return (x >> 8) | (x << 8); - else - return x; -} - -inline unsigned int swap_uint(unsigned int x, int swap) -{ - if (swap != 0) - return (x >> 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x << 24); - else - return x; -} - -inline float swap_float(float x, int swap) -{ - if (swap != 0) { - union { - float f; - unsigned char b[4]; - } dat1, dat2; - - dat1.f = x; - dat2.b[0] = dat1.b[3]; - dat2.b[1] = dat1.b[2]; - dat2.b[2] = dat1.b[1]; - dat2.b[3] = dat1.b[0]; - return dat2.f; - } - else - return x; -} - - -/* - * Other - */ - -inline unsigned int clamp_uint(unsigned int x, unsigned int low, unsigned int high) -{ - if (x > high) - return high; - else if (x < low) - return low; - else - return x; -} - -inline float clamp_float(float x, float low, float high) -{ - if (x > high) - return high; - else if (x < low) - return low; - else - return x; -} - -inline unsigned int float_uint(float value, unsigned int max) -{ - if (value < 0.0f) - return 0; - else if (value > (1.0f - 0.5f / (float)max)) - return max; - else - return (unsigned int)(((float)max * value) + 0.5f); -} |