public sealed class Ktx2LayoutEverything a KTX2 file's header and level index say, and none of its pixels.
Remarks
The half of Read that a streamer can afford. A header and a level index are 80 + 24n bytes at the front of the file; the pixels are everything else. Reading the first of those says how big the texture is, how many levels it has and where each one lives, which is enough to decide what to load without having loaded any of it.
The mip tail is one contiguous run at the front of the level data, and that is the whole point. Level data is stored smallest first, so levels firstLevel through LevelCount - 1 occupy a single range starting at DataOffset — one seek and one read, whatever the resolution asked for. Were the file stored largest first the same request would be a read per level from scattered offsets, which is the difference between streaming a mip tail and streaming a mip tail badly.
Fields and properties (10)
public PixelFormat FormatWhat the bytes mean.
public int WidthThe largest level's width.
public int HeightThe largest level's height.
public int DepthThe largest level's depth. One for a 2D texture.
public int LayerCountHow many array layers. One for a plain texture.
public int FaceCountHow many faces. Six for a cube map, one otherwise.
public IReadOnlyList<Ktx2Level> LevelsEvery level, largest first, each with the file offset its bytes start at.
public int LevelCountHow many mip levels.
public long DataOffsetWhere the level data starts: the smallest level's offset.
public long DataLengthHow many bytes every level together occupies.
Methods (3)
public long TailLength(int firstLevel)How many bytes the tail from a level down to the smallest occupies.
public int TailFor(long budget)The largest tail that fits in a budget.
public TextureData Allocate(int firstLevel)Describes the texture a tail of this file decodes to.
Used by (8)
- AssetTextureSourceVixen.Engine.Renderer
- EntryVixen.Engine.Renderer
- FilesVixen.Engine.Renderer.Tests
- Ktx2Vixen.Core.Imaging
- Ktx2TestsVixen.Core.Imaging.Tests
- TexturePagePoolVixen.Engine.Renderer
- TextureStreamerVixen.Engine.Renderer
- TextureStreamingTestsVixen.Engine.Renderer.Tests