diff options
Diffstat (limited to 'source/blender/imbuf/intern/dds/ColorBlock.h')
-rw-r--r-- | source/blender/imbuf/intern/dds/ColorBlock.h | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.h b/source/blender/imbuf/intern/dds/ColorBlock.h index 66d1ed4e2c5..2e8a6bbda7f 100644 --- a/source/blender/imbuf/intern/dds/ColorBlock.h +++ b/source/blender/imbuf/intern/dds/ColorBlock.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/) @@ -36,65 +35,61 @@ /// Uncompressed 4x4 color block. struct ColorBlock { - ColorBlock(); - ColorBlock(const uint * linearImage); - ColorBlock(const ColorBlock & block); - ColorBlock(const Image *img, uint x, uint y); - - void init(const Image *img, uint x, uint y); - void init(uint w, uint h, const uint * data, uint x, uint y); - void init(uint w, uint h, const float * data, uint x, uint y); - - void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0 + ColorBlock(); + ColorBlock(const uint *linearImage); + ColorBlock(const ColorBlock &block); + ColorBlock(const Image *img, uint x, uint y); - bool isSingleColor(Color32 mask = Color32(0xFF, 0xFF, 0xFF, 0x00)) const; - bool hasAlpha() const; + void init(const Image *img, uint x, uint y); + void init(uint w, uint h, const uint *data, uint x, uint y); + void init(uint w, uint h, const float *data, uint x, uint y); + void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0 - // Accessors - const Color32 * colors() const; + bool isSingleColor(Color32 mask = Color32(0xFF, 0xFF, 0xFF, 0x00)) const; + bool hasAlpha() const; - Color32 color(uint i) const; - Color32 & color(uint i); + // Accessors + const Color32 *colors() const; - Color32 color(uint x, uint y) const; - Color32 & color(uint x, uint y); + Color32 color(uint i) const; + Color32 &color(uint i); -private: - - Color32 m_color[4 * 4]; + Color32 color(uint x, uint y) const; + Color32 &color(uint x, uint y); + private: + Color32 m_color[4 * 4]; }; - /// Get pointer to block colors. -inline const Color32 * ColorBlock::colors() const +inline const Color32 *ColorBlock::colors() const { - return m_color; + return m_color; } /// Get block color. inline Color32 ColorBlock::color(uint i) const { - return m_color[i]; + return m_color[i]; } /// Get block color. -inline Color32 & ColorBlock::color(uint i) +inline Color32 &ColorBlock::color(uint i) { - return m_color[i]; + return m_color[i]; } /// Get block color. inline Color32 ColorBlock::color(uint x, uint y) const { - return m_color[y * 4 + x]; + return m_color[y * 4 + x]; } /// Get block color. -inline Color32 & ColorBlock::color(uint x, uint y) +inline Color32 &ColorBlock::color(uint x, uint y) { - return m_color[y * 4 + x]; + return m_color[y * 4 + x]; } -#endif /* __COLORBLOCK_H__ */ +#endif /* __COLORBLOCK_H__ */ |