Allow setting the various pixel types to opaque

This commit is contained in:
Pavel Krajcevski 2015-12-20 16:25:29 -05:00
parent 6f2ee27a0e
commit be844246cf
3 changed files with 6 additions and 0 deletions

View file

@ -93,6 +93,8 @@ class Color : public Vec4f {
// Tests for equality by comparing the values and the bit depths. // Tests for equality by comparing the values and the bit depths.
bool operator==(const Color &) const; bool operator==(const Color &) const;
void MakeOpaque() { A() = 1.f ; }
}; };
REGISTER_VECTOR_TYPE(Color); REGISTER_VECTOR_TYPE(Color);

View file

@ -77,6 +77,8 @@ class IPixel : public VectorBase<float, 1> {
// up in the most-significant byte. // up in the most-significant byte.
uint32 Pack() const; uint32 Pack() const;
void Unpack(uint32 rgba); void Unpack(uint32 rgba);
void MakeOpaque() { /* Do nothing.. */ }
}; };
REGISTER_VECTOR_TYPE(IPixel); REGISTER_VECTOR_TYPE(IPixel);

View file

@ -170,6 +170,8 @@ class Pixel : public Vector4<int16> {
vec[i] = (vec[i] < 0)? 0 : ((vec[i] > 255)? 255 : vec[i]); vec[i] = (vec[i] < 0)? 0 : ((vec[i] > 255)? 255 : vec[i]);
} }
} }
void MakeOpaque() { A() = 255; }
}; };
REGISTER_VECTOR_TYPE(Pixel); REGISTER_VECTOR_TYPE(Pixel);