public MipMap(byte[] data, DDSFormat format, int w, int h)
{
long requiredSize = (long)(w * h * getBytesPerPixel(format));
if (data.Length != requiredSize)
throw new InvalidDataException("Data size is not valid for selected format.\nActual: " + data.Length + " bytes\nRequired: " + requiredSize + " bytes");
this.data = data;
ddsFormat = format;
width = w;
height = h;
}
}