From cebce26be178a2a8304d07907896ef25679eb4d8 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 11 Mar 2014 16:52:02 -0400 Subject: [PATCH] Change our pixel component type to be signed --- Base/include/Pixel.h | 4 ++-- Base/test/TestPixel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Base/include/Pixel.h b/Base/include/Pixel.h index 34670d4..bc3c126 100644 --- a/Base/include/Pixel.h +++ b/Base/include/Pixel.h @@ -58,9 +58,9 @@ namespace FasTC { -class Pixel : public Vector4 { +class Pixel : public Vector4 { protected: - typedef uint16 ChannelType; + typedef int16 ChannelType; typedef Vector4 VectorType; uint8 m_BitDepth[4]; diff --git a/Base/test/TestPixel.cpp b/Base/test/TestPixel.cpp index abdcc94..59c50da 100644 --- a/Base/test/TestPixel.cpp +++ b/Base/test/TestPixel.cpp @@ -84,7 +84,7 @@ TEST(Pixel, FourWideConstructor) { FasTC::Pixel q(static_cast(1 << 16), 6, -2, 5, 4); EXPECT_EQ(q.R(), 6); - EXPECT_EQ(q.G(), static_cast(-2)); + EXPECT_EQ(q.G(), -2); EXPECT_EQ(q.B(), 5); EXPECT_EQ(q.A(), 0); @@ -311,7 +311,7 @@ TEST(Pixel, ByteClamp) { p.ClampByte(); EXPECT_EQ(p.A(), 255); EXPECT_EQ(p.R(), 3); - EXPECT_EQ(p.G(), 255); + EXPECT_EQ(p.G(), 0); EXPECT_EQ(p.B(), 10); }