diff options
Diffstat (limited to 'source/blender/imbuf/intern/dds/PixelFormat.h')
-rw-r--r-- | source/blender/imbuf/intern/dds/PixelFormat.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h index 3c5cb34812c..308ea810f03 100644 --- a/source/blender/imbuf/intern/dds/PixelFormat.h +++ b/source/blender/imbuf/intern/dds/PixelFormat.h @@ -66,17 +66,14 @@ // Convert component \a c having \a inbits to the returned value having \a outbits. inline uint convert(uint c, uint inbits, uint outbits) { - if (inbits == 0) - { + if (inbits == 0) { return 0; } - else if (inbits >= outbits) - { + else if (inbits >= outbits) { // truncate return c >> (inbits - outbits); } - else - { + else { // bitexpand return (c << (outbits - inbits)) | convert(c, inbits, outbits - inbits); } @@ -85,21 +82,20 @@ // Get pixel component shift and size given its mask. inline void maskShiftAndSize(uint mask, uint * shift, uint * size) { - if (!mask) - { + if (!mask) { *shift = 0; *size = 0; return; } *shift = 0; - while((mask & 1) == 0) { + while ((mask & 1) == 0) { ++(*shift); mask >>= 1; } *size = 0; - while((mask & 1) == 1) { + while ((mask & 1) == 1) { ++(*size); mask >>= 1; } |