public void GetFormatInfo(TranscoderTextureFormats format, out uint bytesPerBlockOrPixel, out bool isBlockTextureFormat) { lock (File) { bytesPerBlockOrPixel = Transcoder.GetBytesPerBlockOrPixel(format); isBlockTextureFormat = Transcoder.IsBlockTextureFormat(format); } }
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); } } }