public static double getBytesPerPixel(DDSFormat ddsFormat) { switch (ddsFormat) { case DDSFormat.DXT1: return 0.5; case DDSFormat.DXT5: case DDSFormat.ATI2: return 1; case DDSFormat.V8U8: return 2; } throw new Exception("invalid texture format"); }