PixelFormat rename
PixelFormatInfo => PixelFormatDescription PixelFormat => PixelFormatInfo PixelFormatType => PixelFormat
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Nz
|
||||
|
||||
UInt8 GetBytesPerPixel() const;
|
||||
virtual unsigned int GetDepth(UInt8 level = 0) const = 0;
|
||||
virtual PixelFormatType GetFormat() const = 0;
|
||||
virtual PixelFormat GetFormat() const = 0;
|
||||
virtual unsigned int GetHeight(UInt8 level = 0) const = 0;
|
||||
virtual UInt8 GetLevelCount() const = 0;
|
||||
virtual UInt8 GetMaxLevel() const = 0;
|
||||
|
||||
@@ -165,64 +165,64 @@ namespace Nz
|
||||
PixelFormatContent_Max = PixelFormatContent_Stencil
|
||||
};
|
||||
|
||||
enum PixelFormatType
|
||||
enum PixelFormat
|
||||
{
|
||||
PixelFormatType_Undefined = -1,
|
||||
PixelFormat_Undefined = -1,
|
||||
|
||||
PixelFormatType_A8, // 1*uint8
|
||||
PixelFormatType_BGR8, // 3*uint8
|
||||
PixelFormatType_BGRA8, // 4*uint8
|
||||
PixelFormatType_DXT1,
|
||||
PixelFormatType_DXT3,
|
||||
PixelFormatType_DXT5,
|
||||
PixelFormatType_L8, // 1*uint8
|
||||
PixelFormatType_LA8, // 2*uint8
|
||||
PixelFormatType_R8, // 1*uint8
|
||||
PixelFormatType_R8I, // 1*int8
|
||||
PixelFormatType_R8UI, // 1*uint8
|
||||
PixelFormatType_R16, // 1*uint16
|
||||
PixelFormatType_R16F, // 1*half
|
||||
PixelFormatType_R16I, // 1*int16
|
||||
PixelFormatType_R16UI, // 1*uint16
|
||||
PixelFormatType_R32F, // 1*float
|
||||
PixelFormatType_R32I, // 1*uint16
|
||||
PixelFormatType_R32UI, // 1*uint32
|
||||
PixelFormatType_RG8, // 2*int8
|
||||
PixelFormatType_RG8I, // 2*int8
|
||||
PixelFormatType_RG8UI, // 2*uint8
|
||||
PixelFormatType_RG16, // 2*uint16
|
||||
PixelFormatType_RG16F, // 2*half
|
||||
PixelFormatType_RG16I, // 2*int16
|
||||
PixelFormatType_RG16UI, // 2*uint16
|
||||
PixelFormatType_RG32F, // 2*float
|
||||
PixelFormatType_RG32I, // 2*uint16
|
||||
PixelFormatType_RG32UI, // 2*uint32
|
||||
PixelFormatType_RGB5A1, // 3*uint5 + alpha bit
|
||||
PixelFormatType_RGB8, // 3*uint8
|
||||
PixelFormatType_RGB16F, // 3*half
|
||||
PixelFormatType_RGB16I, // 4*int16
|
||||
PixelFormatType_RGB16UI, // 4*uint16
|
||||
PixelFormatType_RGB32F, // 3*float
|
||||
PixelFormatType_RGB32I, // 4*int32
|
||||
PixelFormatType_RGB32UI, // 4*uint32
|
||||
PixelFormatType_RGBA4, // 4*uint4
|
||||
PixelFormatType_RGBA8, // 4*uint8
|
||||
PixelFormatType_RGBA16F, // 4*half
|
||||
PixelFormatType_RGBA16I, // 4*int16
|
||||
PixelFormatType_RGBA16UI, // 4*uint16
|
||||
PixelFormatType_RGBA32F, // 4*float
|
||||
PixelFormatType_RGBA32I, // 4*int32
|
||||
PixelFormatType_RGBA32UI, // 4*uint32
|
||||
PixelFormatType_Depth16,
|
||||
PixelFormatType_Depth24,
|
||||
PixelFormatType_Depth24Stencil8,
|
||||
PixelFormatType_Depth32,
|
||||
PixelFormatType_Stencil1,
|
||||
PixelFormatType_Stencil4,
|
||||
PixelFormatType_Stencil8,
|
||||
PixelFormatType_Stencil16,
|
||||
PixelFormat_A8, // 1*uint8
|
||||
PixelFormat_BGR8, // 3*uint8
|
||||
PixelFormat_BGRA8, // 4*uint8
|
||||
PixelFormat_DXT1,
|
||||
PixelFormat_DXT3,
|
||||
PixelFormat_DXT5,
|
||||
PixelFormat_L8, // 1*uint8
|
||||
PixelFormat_LA8, // 2*uint8
|
||||
PixelFormat_R8, // 1*uint8
|
||||
PixelFormat_R8I, // 1*int8
|
||||
PixelFormat_R8UI, // 1*uint8
|
||||
PixelFormat_R16, // 1*uint16
|
||||
PixelFormat_R16F, // 1*half
|
||||
PixelFormat_R16I, // 1*int16
|
||||
PixelFormat_R16UI, // 1*uint16
|
||||
PixelFormat_R32F, // 1*float
|
||||
PixelFormat_R32I, // 1*uint16
|
||||
PixelFormat_R32UI, // 1*uint32
|
||||
PixelFormat_RG8, // 2*int8
|
||||
PixelFormat_RG8I, // 2*int8
|
||||
PixelFormat_RG8UI, // 2*uint8
|
||||
PixelFormat_RG16, // 2*uint16
|
||||
PixelFormat_RG16F, // 2*half
|
||||
PixelFormat_RG16I, // 2*int16
|
||||
PixelFormat_RG16UI, // 2*uint16
|
||||
PixelFormat_RG32F, // 2*float
|
||||
PixelFormat_RG32I, // 2*uint16
|
||||
PixelFormat_RG32UI, // 2*uint32
|
||||
PixelFormat_RGB5A1, // 3*uint5 + alpha bit
|
||||
PixelFormat_RGB8, // 3*uint8
|
||||
PixelFormat_RGB16F, // 3*half
|
||||
PixelFormat_RGB16I, // 4*int16
|
||||
PixelFormat_RGB16UI, // 4*uint16
|
||||
PixelFormat_RGB32F, // 3*float
|
||||
PixelFormat_RGB32I, // 4*int32
|
||||
PixelFormat_RGB32UI, // 4*uint32
|
||||
PixelFormat_RGBA4, // 4*uint4
|
||||
PixelFormat_RGBA8, // 4*uint8
|
||||
PixelFormat_RGBA16F, // 4*half
|
||||
PixelFormat_RGBA16I, // 4*int16
|
||||
PixelFormat_RGBA16UI, // 4*uint16
|
||||
PixelFormat_RGBA32F, // 4*float
|
||||
PixelFormat_RGBA32I, // 4*int32
|
||||
PixelFormat_RGBA32UI, // 4*uint32
|
||||
PixelFormat_Depth16,
|
||||
PixelFormat_Depth24,
|
||||
PixelFormat_Depth24Stencil8,
|
||||
PixelFormat_Depth32,
|
||||
PixelFormat_Stencil1,
|
||||
PixelFormat_Stencil4,
|
||||
PixelFormat_Stencil8,
|
||||
PixelFormat_Stencil16,
|
||||
|
||||
PixelFormatType_Max = PixelFormatType_Stencil16
|
||||
PixelFormat_Max = PixelFormat_Stencil16
|
||||
};
|
||||
|
||||
enum PixelFormatSubType
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Nz
|
||||
struct NAZARA_UTILITY_API ImageParams : ResourceParameters
|
||||
{
|
||||
// Le format dans lequel l'image doit être chargée (Undefined pour le format le plus proche de l'original)
|
||||
PixelFormatType loadFormat = PixelFormatType_Undefined;
|
||||
PixelFormat loadFormat = PixelFormat_Undefined;
|
||||
|
||||
// Le nombre de niveaux de mipmaps maximum devant être créé
|
||||
UInt8 levelCount = 0;
|
||||
@@ -56,16 +56,16 @@ namespace Nz
|
||||
struct SharedImage;
|
||||
|
||||
Image();
|
||||
Image(ImageType type, PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth = 1, UInt8 levelCount = 1);
|
||||
Image(ImageType type, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, UInt8 levelCount = 1);
|
||||
Image(const Image& image);
|
||||
Image(SharedImage* sharedImage);
|
||||
~Image();
|
||||
|
||||
bool Convert(PixelFormatType format);
|
||||
bool Convert(PixelFormat format);
|
||||
|
||||
void Copy(const Image* source, const Boxui& srcBox, const Vector3ui& dstPos);
|
||||
|
||||
bool Create(ImageType type, PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth = 1, UInt8 levelCount = 1);
|
||||
bool Create(ImageType type, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, UInt8 levelCount = 1);
|
||||
void Destroy();
|
||||
|
||||
bool Fill(const Color& color);
|
||||
@@ -77,7 +77,7 @@ namespace Nz
|
||||
|
||||
const UInt8* GetConstPixels(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0, UInt8 level = 0) const;
|
||||
unsigned int GetDepth(UInt8 level = 0) const override;
|
||||
PixelFormatType GetFormat() const override;
|
||||
PixelFormat GetFormat() const override;
|
||||
unsigned int GetHeight(UInt8 level = 0) const override;
|
||||
UInt8 GetLevelCount() const override;
|
||||
UInt8 GetMaxLevel() const override;
|
||||
@@ -113,7 +113,7 @@ namespace Nz
|
||||
|
||||
Image& operator=(const Image& image);
|
||||
|
||||
static void Copy(UInt8* destination, const UInt8* source, PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth = 1, unsigned int dstWidth = 0, unsigned int dstHeight = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0);
|
||||
static void Copy(UInt8* destination, const UInt8* source, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, unsigned int dstWidth = 0, unsigned int dstHeight = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0);
|
||||
static UInt8 GetMaxLevel(unsigned int width, unsigned int height, unsigned int depth = 1);
|
||||
static UInt8 GetMaxLevel(ImageType type, unsigned int width, unsigned int height, unsigned int depth = 1);
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Nz
|
||||
{
|
||||
using PixelContainer = std::vector<std::unique_ptr<UInt8[]>>;
|
||||
|
||||
SharedImage(unsigned short RefCount, ImageType Type, PixelFormatType Format, PixelContainer&& Levels, unsigned int Width, unsigned int Height, unsigned int Depth) :
|
||||
SharedImage(unsigned short RefCount, ImageType Type, PixelFormat Format, PixelContainer&& Levels, unsigned int Width, unsigned int Height, unsigned int Depth) :
|
||||
type(Type),
|
||||
format(Format),
|
||||
levels(std::move(Levels)),
|
||||
@@ -152,7 +152,7 @@ namespace Nz
|
||||
}
|
||||
|
||||
ImageType type;
|
||||
PixelFormatType format;
|
||||
PixelFormat format;
|
||||
PixelContainer levels;
|
||||
unsigned int depth;
|
||||
unsigned int height;
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
struct PixelFormatInfo
|
||||
struct PixelFormatDescription
|
||||
{
|
||||
inline PixelFormatInfo();
|
||||
inline PixelFormatInfo(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType);
|
||||
inline PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType);
|
||||
inline PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, Bitset<> rMask, Bitset<> gMask, Bitset<> bMask, Bitset<> aMask, PixelFormatSubType subType);
|
||||
inline PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, PixelFormatSubType rType, Bitset<> rMask, PixelFormatSubType gType, Bitset<> gMask, PixelFormatSubType bType, Bitset<> bMask, PixelFormatSubType aType, Bitset<> aMask, UInt8 bpp = 0);
|
||||
inline PixelFormatDescription();
|
||||
inline PixelFormatDescription(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType);
|
||||
inline PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType);
|
||||
inline PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, Bitset<> rMask, Bitset<> gMask, Bitset<> bMask, Bitset<> aMask, PixelFormatSubType subType);
|
||||
inline PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, PixelFormatSubType rType, Bitset<> rMask, PixelFormatSubType gType, Bitset<> gMask, PixelFormatSubType bType, Bitset<> bMask, PixelFormatSubType aType, Bitset<> aMask, UInt8 bpp = 0);
|
||||
|
||||
inline void Clear();
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Nz
|
||||
UInt8 bitsPerPixel;
|
||||
};
|
||||
|
||||
class NAZARA_UTILITY_API PixelFormat
|
||||
class NAZARA_UTILITY_API PixelFormatInfo
|
||||
{
|
||||
friend class Utility;
|
||||
|
||||
@@ -60,37 +60,37 @@ namespace Nz
|
||||
using ConvertFunction = std::function<UInt8*(const UInt8* start, const UInt8* end, UInt8* dst)>;
|
||||
using FlipFunction = std::function<void(unsigned int width, unsigned int height, unsigned int depth, const UInt8* src, UInt8* dst)>;
|
||||
|
||||
static inline std::size_t ComputeSize(PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth);
|
||||
static inline std::size_t ComputeSize(PixelFormat format, unsigned int width, unsigned int height, unsigned int depth);
|
||||
|
||||
static inline bool Convert(PixelFormatType srcFormat, PixelFormatType dstFormat, const void* src, void* dst);
|
||||
static inline bool Convert(PixelFormatType srcFormat, PixelFormatType dstFormat, const void* start, const void* end, void* dst);
|
||||
static inline bool Convert(PixelFormat srcFormat, PixelFormat dstFormat, const void* src, void* dst);
|
||||
static inline bool Convert(PixelFormat srcFormat, PixelFormat dstFormat, const void* start, const void* end, void* dst);
|
||||
|
||||
static bool Flip(PixelFlipping flipping, PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth, const void* src, void* dst);
|
||||
static bool Flip(PixelFlipping flipping, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth, const void* src, void* dst);
|
||||
|
||||
static inline UInt8 GetBitsPerPixel(PixelFormatType format);
|
||||
static inline PixelFormatContent GetContent(PixelFormatType format);
|
||||
static inline UInt8 GetBytesPerPixel(PixelFormatType format);
|
||||
static inline const PixelFormatInfo& GetInfo(PixelFormatType format);
|
||||
static inline const String& GetName(PixelFormatType format);
|
||||
static inline UInt8 GetBitsPerPixel(PixelFormat format);
|
||||
static inline PixelFormatContent GetContent(PixelFormat format);
|
||||
static inline UInt8 GetBytesPerPixel(PixelFormat format);
|
||||
static inline const PixelFormatDescription& GetInfo(PixelFormat format);
|
||||
static inline const String& GetName(PixelFormat format);
|
||||
|
||||
static inline bool HasAlpha(PixelFormatType format);
|
||||
static inline bool HasAlpha(PixelFormat format);
|
||||
|
||||
static PixelFormatType IdentifyFormat(const PixelFormatInfo& info);
|
||||
static PixelFormat IdentifyFormat(const PixelFormatDescription& info);
|
||||
|
||||
static inline bool IsCompressed(PixelFormatType format);
|
||||
static inline bool IsConversionSupported(PixelFormatType srcFormat, PixelFormatType dstFormat);
|
||||
static inline bool IsValid(PixelFormatType format);
|
||||
static inline bool IsCompressed(PixelFormat format);
|
||||
static inline bool IsConversionSupported(PixelFormat srcFormat, PixelFormat dstFormat);
|
||||
static inline bool IsValid(PixelFormat format);
|
||||
|
||||
static inline void SetConvertFunction(PixelFormatType srcFormat, PixelFormatType dstFormat, ConvertFunction func);
|
||||
static inline void SetFlipFunction(PixelFlipping flipping, PixelFormatType format, FlipFunction func);
|
||||
static inline void SetConvertFunction(PixelFormat srcFormat, PixelFormat dstFormat, ConvertFunction func);
|
||||
static inline void SetFlipFunction(PixelFlipping flipping, PixelFormat format, FlipFunction func);
|
||||
|
||||
private:
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
static PixelFormatInfo s_pixelFormatInfos[PixelFormatType_Max + 1];
|
||||
static ConvertFunction s_convertFunctions[PixelFormatType_Max+1][PixelFormatType_Max+1];
|
||||
static std::map<PixelFormatType, FlipFunction> s_flipFunctions[PixelFlipping_Max+1];
|
||||
static PixelFormatDescription s_pixelFormatInfos[PixelFormat_Max + 1];
|
||||
static ConvertFunction s_convertFunctions[PixelFormat_Max+1][PixelFormat_Max+1];
|
||||
static std::map<PixelFormat, FlipFunction> s_flipFunctions[PixelFlipping_Max+1];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline PixelFormatInfo::PixelFormatInfo() :
|
||||
inline PixelFormatDescription::PixelFormatDescription() :
|
||||
content(PixelFormatContent_Undefined),
|
||||
bitsPerPixel(0)
|
||||
{
|
||||
}
|
||||
|
||||
inline PixelFormatInfo::PixelFormatInfo(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||
inline PixelFormatDescription::PixelFormatDescription(PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||
content(formatContent),
|
||||
redType(subType),
|
||||
greenType(subType),
|
||||
@@ -25,7 +25,7 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||
inline PixelFormatDescription::PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, UInt8 bpp, PixelFormatSubType subType) :
|
||||
content(formatContent),
|
||||
redType(subType),
|
||||
greenType(subType),
|
||||
@@ -36,12 +36,12 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline PixelFormatInfo::PixelFormatInfo(const String& formatName, PixelFormatContent formatContent, Bitset<> rMask, Bitset<> gMask, Bitset<> bMask, Bitset<> aMask, PixelFormatSubType subType) :
|
||||
PixelFormatInfo(formatName, formatContent, subType, rMask, subType, gMask, subType, bMask, subType, aMask)
|
||||
inline PixelFormatDescription::PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, Bitset<> rMask, Bitset<> gMask, Bitset<> bMask, Bitset<> aMask, PixelFormatSubType subType) :
|
||||
PixelFormatDescription(formatName, formatContent, subType, rMask, subType, gMask, subType, bMask, subType, aMask)
|
||||
{
|
||||
}
|
||||
|
||||
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) :
|
||||
inline PixelFormatDescription::PixelFormatDescription(const String& formatName, PixelFormatContent formatContent, PixelFormatSubType rType, Bitset<> rMask, PixelFormatSubType gType, Bitset<> gMask, PixelFormatSubType bType, Bitset<> bMask, PixelFormatSubType aType, Bitset<> aMask, UInt8 bpp) :
|
||||
redMask(rMask),
|
||||
greenMask(gMask),
|
||||
blueMask(bMask),
|
||||
@@ -62,7 +62,7 @@ namespace Nz
|
||||
RecomputeBitsPerPixel();
|
||||
}
|
||||
|
||||
inline void PixelFormatInfo::Clear()
|
||||
inline void PixelFormatDescription::Clear()
|
||||
{
|
||||
bitsPerPixel = 0;
|
||||
alphaMask.Clear();
|
||||
@@ -72,7 +72,7 @@ namespace Nz
|
||||
name.Clear();
|
||||
}
|
||||
|
||||
inline bool PixelFormatInfo::IsCompressed() const
|
||||
inline bool PixelFormatDescription::IsCompressed() const
|
||||
{
|
||||
return redType == PixelFormatSubType_Compressed ||
|
||||
greenType == PixelFormatSubType_Compressed ||
|
||||
@@ -80,12 +80,12 @@ namespace Nz
|
||||
alphaType == PixelFormatSubType_Compressed;
|
||||
}
|
||||
|
||||
inline bool PixelFormatInfo::IsValid() const
|
||||
inline bool PixelFormatDescription::IsValid() const
|
||||
{
|
||||
return bitsPerPixel != 0;
|
||||
}
|
||||
|
||||
inline void PixelFormatInfo::RecomputeBitsPerPixel()
|
||||
inline void PixelFormatDescription::RecomputeBitsPerPixel()
|
||||
{
|
||||
Bitset<> counter;
|
||||
counter |= redMask;
|
||||
@@ -96,7 +96,7 @@ namespace Nz
|
||||
bitsPerPixel = static_cast<UInt8>(counter.Count());
|
||||
}
|
||||
|
||||
inline bool PixelFormatInfo::Validate() const
|
||||
inline bool PixelFormatDescription::Validate() const
|
||||
{
|
||||
if (!IsValid())
|
||||
return false;
|
||||
@@ -143,16 +143,16 @@ namespace Nz
|
||||
|
||||
|
||||
|
||||
inline std::size_t PixelFormat::ComputeSize(PixelFormatType format, unsigned int width, unsigned int height, unsigned int depth)
|
||||
inline std::size_t PixelFormatInfo::ComputeSize(PixelFormat format, unsigned int width, unsigned int height, unsigned int depth)
|
||||
{
|
||||
if (IsCompressed(format))
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case PixelFormatType_DXT1:
|
||||
case PixelFormatType_DXT3:
|
||||
case PixelFormatType_DXT5:
|
||||
return (((width + 3) / 4) * ((height + 3) / 4) * ((format == PixelFormatType_DXT1) ? 8 : 16)) * depth;
|
||||
case PixelFormat_DXT1:
|
||||
case PixelFormat_DXT3:
|
||||
case PixelFormat_DXT5:
|
||||
return (((width + 3) / 4) * ((height + 3) / 4) * ((format == PixelFormat_DXT1) ? 8 : 16)) * depth;
|
||||
|
||||
default:
|
||||
NazaraError("Unsupported format");
|
||||
@@ -163,7 +163,7 @@ namespace Nz
|
||||
return width * height * depth * GetBytesPerPixel(format);
|
||||
}
|
||||
|
||||
inline bool PixelFormat::Convert(PixelFormatType srcFormat, PixelFormatType dstFormat, const void* src, void* dst)
|
||||
inline bool PixelFormatInfo::Convert(PixelFormat srcFormat, PixelFormat dstFormat, const void* src, void* dst)
|
||||
{
|
||||
if (srcFormat == dstFormat)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ namespace Nz
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool PixelFormat::Convert(PixelFormatType srcFormat, PixelFormatType dstFormat, const void* start, const void* end, void* dst)
|
||||
inline bool PixelFormatInfo::Convert(PixelFormat srcFormat, PixelFormat dstFormat, const void* start, const void* end, void* dst)
|
||||
{
|
||||
if (srcFormat == dstFormat)
|
||||
{
|
||||
@@ -225,42 +225,42 @@ namespace Nz
|
||||
return true;
|
||||
}
|
||||
|
||||
inline UInt8 PixelFormat::GetBitsPerPixel(PixelFormatType format)
|
||||
inline UInt8 PixelFormatInfo::GetBitsPerPixel(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].bitsPerPixel;
|
||||
}
|
||||
|
||||
inline UInt8 PixelFormat::GetBytesPerPixel(PixelFormatType format)
|
||||
inline UInt8 PixelFormatInfo::GetBytesPerPixel(PixelFormat format)
|
||||
{
|
||||
return GetBitsPerPixel(format)/8;
|
||||
}
|
||||
|
||||
inline PixelFormatContent PixelFormat::GetContent(PixelFormatType format)
|
||||
inline PixelFormatContent PixelFormatInfo::GetContent(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].content;
|
||||
}
|
||||
|
||||
inline const PixelFormatInfo& PixelFormat::GetInfo(PixelFormatType format)
|
||||
inline const PixelFormatDescription& PixelFormatInfo::GetInfo(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format];
|
||||
}
|
||||
|
||||
inline const String& PixelFormat::GetName(PixelFormatType format)
|
||||
inline const String& PixelFormatInfo::GetName(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].name;
|
||||
}
|
||||
|
||||
inline bool PixelFormat::HasAlpha(PixelFormatType format)
|
||||
inline bool PixelFormatInfo::HasAlpha(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].alphaMask.TestAny();
|
||||
}
|
||||
|
||||
inline bool PixelFormat::IsCompressed(PixelFormatType format)
|
||||
inline bool PixelFormatInfo::IsCompressed(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].IsCompressed();
|
||||
}
|
||||
|
||||
inline bool PixelFormat::IsConversionSupported(PixelFormatType srcFormat, PixelFormatType dstFormat)
|
||||
inline bool PixelFormatInfo::IsConversionSupported(PixelFormat srcFormat, PixelFormat dstFormat)
|
||||
{
|
||||
if (srcFormat == dstFormat)
|
||||
return true;
|
||||
@@ -268,17 +268,17 @@ namespace Nz
|
||||
return s_convertFunctions[srcFormat][dstFormat] != nullptr;
|
||||
}
|
||||
|
||||
inline bool PixelFormat::IsValid(PixelFormatType format)
|
||||
inline bool PixelFormatInfo::IsValid(PixelFormat format)
|
||||
{
|
||||
return format != PixelFormatType_Undefined;
|
||||
return format != PixelFormat_Undefined;
|
||||
}
|
||||
|
||||
inline void PixelFormat::SetConvertFunction(PixelFormatType srcFormat, PixelFormatType dstFormat, ConvertFunction func)
|
||||
inline void PixelFormatInfo::SetConvertFunction(PixelFormat srcFormat, PixelFormat dstFormat, ConvertFunction func)
|
||||
{
|
||||
s_convertFunctions[srcFormat][dstFormat] = func;
|
||||
}
|
||||
|
||||
inline void PixelFormat::SetFlipFunction(PixelFlipping flipping, PixelFormatType format, FlipFunction func)
|
||||
inline void PixelFormatInfo::SetFlipFunction(PixelFlipping flipping, PixelFormat format, FlipFunction func)
|
||||
{
|
||||
s_flipFunctions[flipping][format] = func;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user