public static byte[] GetMipLevel(byte[] ImageData, uint Width, uint Height, uint MipCount, uint MipLevel, TextureFormats format) { uint offset = 0; for (int m = 0; m < MipCount; m++) { uint width = (uint)Math.Max(1, Width >> m); uint height = (uint)Math.Max(1, Height >> m); uint size = (uint)Decode_Gamecube.GetDataSize(format, (int)width, (int)height); if (MipLevel == m) { return(ByteUtils.SubArray(ImageData, offset, size)); } offset += size; } return(ImageData); }
public override void SetImageData(List <byte[]> imageData, uint width, uint height, int arrayLevel = 0) { Width = width; Height = height; ImageData = ByteUtils.CombineArray(imageData.ToArray()); }