diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/imbuf/intern/dds/Color.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/imbuf/intern/dds/Color.h')
-rw-r--r-- | source/blender/imbuf/intern/dds/Color.h | 116 |
1 files changed, 66 insertions, 50 deletions
diff --git a/source/blender/imbuf/intern/dds/Color.h b/source/blender/imbuf/intern/dds/Color.h index da7b77c2854..16432ffa715 100644 --- a/source/blender/imbuf/intern/dds/Color.h +++ b/source/blender/imbuf/intern/dds/Color.h @@ -18,7 +18,6 @@ * \ingroup imbdds */ - /* * This file is based on a similar file from the NVIDIA texture tools * (http://nvidia-texture-tools.googlecode.com/) @@ -32,62 +31,79 @@ #define __COLOR_H__ /// 32 bit color stored as BGRA. -class Color32 -{ -public: - Color32() { } - Color32(const Color32 & c) : u(c.u) { } - Color32(unsigned char R, unsigned char G, unsigned char B) { setRGBA(R, G, B, 0xFF); } - Color32(unsigned char R, unsigned char G, unsigned char B, unsigned char A) { setRGBA( R, G, B, A); } - //Color32(unsigned char c[4]) { setRGBA(c[0], c[1], c[2], c[3]); } - //Color32(float R, float G, float B) { setRGBA(uint(R*255), uint(G*255), uint(B*255), 0xFF); } - //Color32(float R, float G, float B, float A) { setRGBA(uint(R*255), uint(G*255), uint(B*255), uint(A*255)); } - Color32(unsigned int U) : u(U) { } +class Color32 { + public: + Color32() + { + } + Color32(const Color32 &c) : u(c.u) + { + } + Color32(unsigned char R, unsigned char G, unsigned char B) + { + setRGBA(R, G, B, 0xFF); + } + Color32(unsigned char R, unsigned char G, unsigned char B, unsigned char A) + { + setRGBA(R, G, B, A); + } + //Color32(unsigned char c[4]) { setRGBA(c[0], c[1], c[2], c[3]); } + //Color32(float R, float G, float B) { setRGBA(uint(R*255), uint(G*255), uint(B*255), 0xFF); } + //Color32(float R, float G, float B, float A) { setRGBA(uint(R*255), uint(G*255), uint(B*255), uint(A*255)); } + Color32(unsigned int U) : u(U) + { + } - void setRGBA(unsigned char R, unsigned char G, unsigned char B, unsigned char A) - { - r = R; - g = G; - b = B; - a = A; - } + void setRGBA(unsigned char R, unsigned char G, unsigned char B, unsigned char A) + { + r = R; + g = G; + b = B; + a = A; + } - void setBGRA(unsigned char B, unsigned char G, unsigned char R, unsigned char A = 0xFF) - { - r = R; - g = G; - b = B; - a = A; - } + void setBGRA(unsigned char B, unsigned char G, unsigned char R, unsigned char A = 0xFF) + { + r = R; + g = G; + b = B; + a = A; + } - operator unsigned int () const { - return u; - } + operator unsigned int() const + { + return u; + } - union { - struct { - unsigned char b, g, r, a; - }; - unsigned int u; - }; + union { + struct { + unsigned char b, g, r, a; + }; + unsigned int u; + }; }; /// 16 bit 565 BGR color. -class Color16 -{ -public: - Color16() { } - Color16(const Color16 & c) : u(c.u) { } - explicit Color16(unsigned short U) : u(U) { } +class Color16 { + public: + Color16() + { + } + Color16(const Color16 &c) : u(c.u) + { + } + explicit Color16(unsigned short U) : u(U) + { + } - union { - struct { - unsigned short b : 5; - unsigned short g : 6; - unsigned short r : 5; - }; - unsigned short u; - }; + union { + struct { + unsigned short b : 5; + unsigned short g : 6; + unsigned short r : 5; + }; + unsigned short u; + }; }; -#endif /* __COLOR_H__ */ +#endif /* __COLOR_H__ */ |