-
Notifications
You must be signed in to change notification settings - Fork 464
DDSMetaData
| DirectXTex |
|---|
The DDSMetaData structure describes a (potentially complex) image surface.
struct DDSMetaData
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
bool IsDX10() const;
}-
size is
DDPIXELFORMAT.dwSizewhich is ideally 32, but in some malformed files can be 0. -
flags is
DDPIXELFORMAT.dwFlags. See theDDPF_flags in the Microsoft Docs. -
fourCC is
DDPIXELFORMAT.dwFourCCwhich is a "FourCC" code for many formats. In the case of the "DX10" extension header, this value is0x30315844. -
RGBBitCount is part of the
DDPIXELFORMATunion and can bedwRGBBitCount,dwYUVBitCount,dwAlphaBitDepth,dwLuminanceBitCount, ordwBumpBitCountdepending on flags. -
RBitMask is part of the
DDPIXELFORMATunion and can bedwRBitMask,dwYBitMask,dwLuminanceBitMask, ordwBumpDuBitMask. -
GBitMask is part of the
DDPIXELFORMATunion and can bedwGBitMask,dwUBitMask, ordwBumpDvBitMask. -
BBitMask is part of the
DDPIXELFORMATunion and can bedwBBitMask,dwVBitMask, ordwBumpLuminanceBitMask. -
ABitMask is part of the
DDPIXELFORMATunion and can bedwRGBAlphaBitMask,dwYUVAlphaBitMask, ordwLuminanceAlphaBitMask.
Use caution when examining the values of the
DDSMetaDatastructure as they come directly from the file.
- IsDX10 is a helper which does a test to see if it's the "DX10" extension header.
These methods are marked noexcept, and do not throw C++ exceptions.
This will always be the "DX10" extended version for non-legacy DDS files which can be evaluated using the IsDX10 helper method.
Keep in mind that the original pixel format is subject to numerous conversions and options so the DXGI_FORMAT value returned should always be used to interpret the returned image instead of the original DDPIXELFORMAT structure information.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v20
- GCC 10.5, 11.4, 12.3, 13.3, 14.2
- MinGW 12.2, 13.2
- CMake 3.21
DirectX Tool Kit for DirectX 11