Exemple #1
0
 public void GetFormatInfo(TranscoderTextureFormats format, out uint bytesPerBlockOrPixel, out bool isBlockTextureFormat)
 {
     lock (File) {
         bytesPerBlockOrPixel = Transcoder.GetBytesPerBlockOrPixel(format);
         isBlockTextureFormat = Transcoder.IsBlockTextureFormat(format);
     }
 }
Exemple #2
0
        public uint GetTranscodedSizeInBytes(TranscoderTextureFormats format)
        {
            uint origWidth, origHeight, totalBlocks;

            lock (File) {
                var blockSize = Transcoder.GetBytesPerBlockOrPixel(format);
                if (Transcoder.GetImageLevelDesc(
                        File.pTranscoder, File.pData, File.DataSize, Image.Index, Index, out origWidth, out origHeight, out totalBlocks
                        ) == 0)
                {
                    return(0);
                }
                if (Transcoder.IsBlockTextureFormat(format))
                {
                    return(totalBlocks * blockSize);
                }
                else
                {
                    return(origWidth * origHeight * blockSize);
                }
            }
        }