Utility/PixelFormat: Fix mask bit orders

This commit is contained in:
Lynix
2016-11-18 01:15:36 +01:00
parent 964d16f907
commit 93a2e54667
2 changed files with 11 additions and 16 deletions

View File

@@ -39,18 +39,8 @@ namespace Nz
}
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, Bitset<> rMask, Bitset<> gMask, Bitset<> bMask, Bitset<> aMask, PixelFormatSubType subType) :
redMask(rMask),
greenMask(gMask),
blueMask(bMask),
alphaMask(aMask),
content(formatContent),
redType(subType),
greenType(subType),
blueType(subType),
alphaType(subType),
name(formatName)
PixelFormatInfo(formatName, formatContent, subType, rMask, subType, gMask, subType, bMask, subType, aMask)
{
RecomputeBitsPerPixel();
}
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, PixelFormatSubType rType, Bitset<> rMask, PixelFormatSubType gType, Bitset<> gMask, PixelFormatSubType bType, Bitset<> bMask, PixelFormatSubType aType, Bitset<> aMask, UInt8 bpp) :
@@ -65,6 +55,11 @@ namespace Nz
alphaType(aType),
name(formatName)
{
redMask.Reverse();
greenMask.Reverse();
blueMask.Reverse();
alphaMask.Reverse();
if (bpp == 0)
RecomputeBitsPerPixel();
}