From be844246cfccf29dac9cd1f91bfc477dd21a562c Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sun, 20 Dec 2015 16:25:29 -0500 Subject: [PATCH] Allow setting the various pixel types to opaque --- Base/include/FasTC/Color.h | 2 ++ Base/include/FasTC/IPixel.h | 2 ++ Base/include/FasTC/Pixel.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Base/include/FasTC/Color.h b/Base/include/FasTC/Color.h index 0ca5846..b3c9483 100644 --- a/Base/include/FasTC/Color.h +++ b/Base/include/FasTC/Color.h @@ -93,6 +93,8 @@ class Color : public Vec4f { // Tests for equality by comparing the values and the bit depths. bool operator==(const Color &) const; + + void MakeOpaque() { A() = 1.f ; } }; REGISTER_VECTOR_TYPE(Color); diff --git a/Base/include/FasTC/IPixel.h b/Base/include/FasTC/IPixel.h index a9bb547..dedf271 100644 --- a/Base/include/FasTC/IPixel.h +++ b/Base/include/FasTC/IPixel.h @@ -77,6 +77,8 @@ class IPixel : public VectorBase { // up in the most-significant byte. uint32 Pack() const; void Unpack(uint32 rgba); + + void MakeOpaque() { /* Do nothing.. */ } }; REGISTER_VECTOR_TYPE(IPixel); diff --git a/Base/include/FasTC/Pixel.h b/Base/include/FasTC/Pixel.h index bc3c126..0a51d75 100644 --- a/Base/include/FasTC/Pixel.h +++ b/Base/include/FasTC/Pixel.h @@ -170,6 +170,8 @@ class Pixel : public Vector4 { vec[i] = (vec[i] < 0)? 0 : ((vec[i] > 255)? 255 : vec[i]); } } + + void MakeOpaque() { A() = 255; } }; REGISTER_VECTOR_TYPE(Pixel);