Exemple #1
0
        private static byte[] DecompressDXT4(DDSStruct header, byte[] data, DDSPixelFormat pixelFormat)
        {
            // allocate bitmap
            int width  = (int)header.width;
            int height = (int)header.height;
            int depth  = (int)header.depth;

            // Can do color & alpha same as dxt5, but color is pre-multiplied
            // so the result will be wrong unless corrected.
            byte[] rawData = DecompressDXT5(header, data, pixelFormat);
            DDSHelper.CorrectPremult((uint)(width * height * depth), ref rawData);

            return(rawData);
        }