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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-23 04:01:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-23 04:22:22 +0300
commit64b4b719ebd5201d27aa25d7fa2d765eabded9b0 (patch)
treec6e1147f3b81b90193d3acaa0df3f8c5c93db328 /source/blender/imbuf/intern/cineon/logImageCore.h
parentac53291e1ff79144ca41d63b0787bfe04da21677 (diff)
Cleanup: style, use braces for imbuf
Diffstat (limited to 'source/blender/imbuf/intern/cineon/logImageCore.h')
-rw-r--r--source/blender/imbuf/intern/cineon/logImageCore.h42
1 files changed, 28 insertions, 14 deletions
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