From ad5f012a4cc4cf58987eeca64228f5ba9d702a80 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 10 Oct 2013 11:35:01 -0400 Subject: [PATCH] Add the ability to treat intensity pixels as floats. --- Base/include/IPixel.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Base/include/IPixel.h b/Base/include/IPixel.h index 830b1bb..4b83437 100644 --- a/Base/include/IPixel.h +++ b/Base/include/IPixel.h @@ -63,9 +63,14 @@ class IPixel { public: IPixel() : m_Intensity(0.0f) { } + IPixel(float f) : m_Intensity(f) { } - explicit IPixel(uint32 rgba) { - Unpack(rgba); + operator float() const { + return m_Intensity; + } + + IPixel operator=(const float &f) { + return m_Intensity = f; } // Take all of the components, transform them to their 8-bit variants,