public sealed class TextureDataA texture in memory: the pixels, and enough to say what they mean.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One flat buffer with a level table over it, rather than an array of arrays. A texture is written to a file and uploaded to a GPU as a contiguous run of bytes in both cases, and a shape that matches those is one that neither has to copy to reach.
Levels are ordered largest first, which is the order everything except the KTX2 file format uses. Ktx2 reverses on the way out and back on the way in, and that is the only place the other order exists.
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<TextureLevel> LevelsEvery level of every face of every layer, largest level first.
public int LevelCountHow many mip levels.
public ReadOnlySpan<byte> PixelsAll of the pixels, in level order.
public int ByteLengthHow many bytes the whole texture is.
Methods (4)
public TextureData(PixelFormat format, int width, int height, int levelCount = 0, int depth = 1, int layerCount = 1, int faceCount = 1)Describes a texture and allocates its buffer.
public ReadOnlySpan<byte> Level(int level)One level's bytes, for reading.
public Span<byte> LevelSpan(int level)One level's bytes, for writing.
public Span<byte> PixelSpan()All of the pixels, for writing.
Used by (30)
- AssetTextureSourceVixen.Engine.Renderer
- AssetTextureSourceTestsVixen.Engine.Renderer.Tests
- BlockCompressorVixen.Core.Imaging
- BlockCompressorTestsVixen.Core.Imaging.Tests
- BlockEncoderTestsVixen.Core.Imaging.Tests
- BrdfLutVixen.Core.Imaging
- CubeMapVixen.Core.Imaging
- EntryVixen.Engine.Renderer
- EnvironmentPrefilterVixen.Core.Imaging
- IblTestsVixen.Core.Imaging.Tests
- Ktx2Vixen.Core.Imaging
- Ktx2TestsVixen.Core.Imaging.Tests
- MipChainVixen.Core.Imaging
- MipChainTestsVixen.Core.Imaging.Tests
- SphericalHarmonicsL2Vixen.Core.Imaging
- WorldRendererTestsVixen.Engine.Renderer.Tests
- CubeLutVixen.Editor.Assets
- CubeLutImporterVixen.Editor.Assets
- CubeLutTestsVixen.Editor.Assets.Tests
- IImageDecoderVixen.Editor.Assets
- Ktx2DecoderVixen.Editor.Assets
- SpriteSheetViewVixen.Editor.AssetEditors
- SpriteSlicerVixen.Editor.Assets
- SpriteSlicerTestsVixen.Editor.Assets.Tests
- StbImageDecoderVixen.Editor.Assets
- TextureImportViewVixen.Editor.AssetEditors
- TextureImporterVixen.Editor.Assets
- TextureImporterTestsVixen.Editor.Assets.Tests
- TextureLadderVixen.Editor.AssetEditors
- ThumbnailCacheVixen.Editor.App