public static GetUncompressedSize ( int topWidth, int topHeight, int numChannels, bool inclMips ) : int | ||
topWidth | int | Width of top mipmap. |
topHeight | int | Height of top mipmap. |
numChannels | int | Number of channels in image. |
inclMips | bool | Include size of mipmaps. |
return | int |
public static int GetUncompressedSize(int topWidth, int topHeight, int numChannels, bool inclMips)
{
return (int)(numChannels * (topWidth * topHeight) * (inclMips ? 4d/3d : 1d));
}
/// <summary> /// Creates a Mipmap object from a WPF image. /// </summary> public MipMap(byte[] pixels, int width, int height, ImageFormats.ImageEngineFormatDetails details) { Pixels = pixels; Width = width; Height = height; LoadedFormatDetails = details; UncompressedSize = ImageFormats.GetUncompressedSize(width, height, details.MaxNumberOfChannels, false); }