// Collect info from the DDS file.
DdsHeader ddsHeader = new DdsHeader(ddsFile);
Dds10Header dds10Header = getDds10Header(ddsFile, ddsHeader);
Dimensions ddsDimensions = getDimensions(ddsHeader);
UncheckedImageFormat ddsFormat = getFormat(ddsHeader, dds10Header);
// Get image counts.
int numArrays = (dds10Header.arraySize > 1) ? dds10Header.arraySize : 1;
int numFaces = (dds10Header.miscFlag & Dds10MiscFlags.RESOURCE_MISC_TEXTURECUBE) != 0 ? 6 : 1;
int numMipmaps = (ddsHeader.flags & DdsFlags.MIPMAPCOUNT) != 0 ? ddsHeader.mipmapCount : 1;