From 64b4b719ebd5201d27aa25d7fa2d765eabded9b0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Apr 2019 11:01:30 +1000 Subject: Cleanup: style, use braces for imbuf --- source/blender/imbuf/intern/cineon/logImageCore.h | 42 +++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'source/blender/imbuf/intern/cineon/logImageCore.h') diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h index 3f09effa839..80e32ffe77e 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.h +++ b/source/blender/imbuf/intern/cineon/logImageCore.h @@ -213,18 +213,22 @@ int logImageGetDataRGBA(LogImageFile *logImage, float *data, int dataIsLinearRGB BLI_INLINE unsigned short swap_ushort(unsigned short x, int swap) { - if (swap != 0) + if (swap != 0) { return (x >> 8) | (x << 8); - else + } + else { return x; + } } BLI_INLINE unsigned int swap_uint(unsigned int x, int swap) { - if (swap != 0) + if (swap != 0) { return (x >> 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x << 24); - else + } + else { return x; + } } BLI_INLINE float swap_float(float x, int swap) @@ -242,40 +246,50 @@ BLI_INLINE float swap_float(float x, int swap) dat2.b[3] = dat1.b[0]; return dat2.f; } - else + else { return x; + } } /* Other */ BLI_INLINE unsigned int clamp_uint(unsigned int x, unsigned int low, unsigned int high) { - if (x > high) + if (x > high) { return high; - else if (x < low) + } + else if (x < low) { return low; - else + } + else { return x; + } } BLI_INLINE float clamp_float(float x, float low, float high) { - if (x > high) + if (x > high) { return high; - else if (x < low) + } + else if (x < low) { return low; - else + } + else { return x; + } } BLI_INLINE unsigned int float_uint(float value, unsigned int max) { - if (value < 0.0f) + if (value < 0.0f) { return 0; - else if (value > (1.0f - 0.5f / (float)max)) + } + else if (value > (1.0f - 0.5f / (float)max)) { return max; - else + } + else { return (unsigned int)(((float)max * value) + 0.5f); + } } #ifdef __cplusplus -- cgit v1.2.3