namespace Brutal.TextureApi; /// /// Interface representing a texture. /// public interface ITexture { /// /// The texel data for this texture /// public Span Data { get; } /// /// The data for one image of the texture. /// /// You cannot have 3d cubemaps, therefore the third parameter /// is used for face or slice depending on the type of texture. /// The mip level of data to get /// The array layer of data to get /// The face (If a cube map) or slice (if a depth texture) of data to get. /// Thrown if data cannot be retrieved public Span ImageData(int level, int layer, int faceOrSlice); /// /// The extent of this texture (in texels). This is equal to the extent of the largest /// mip level of the texture /// public TexelCount3 Extent { get; } /// /// The of this texture. You can convert this to a Vulkan /// texture format with a call to ToVkFormat(). e.g. /// myITexture.Format.ToVkFormat(); /// public TextureFormat Format { get; } /// /// The number of array layers in this texture /// public int LayerCount { get; } /// /// The number of levels (mipmaps) in this texture /// public int LevelCount { get; } /// /// The number of faces in this texture. This is typically 1 unless IsCubemap == true /// in which it could be up to 6 /// public int FaceCount { get; } /// /// Whether this texture is defined as a cubemap /// public bool IsCubemap { get; } /// /// Returns whether this ITexture is an array texture. /// public bool IsArray { get; } /// /// Returns the number of dimensions of this ITexture. /// public int DimensionCount { get; } // 1, 2 or 3d /// /// Byte count from start of one row of the texture to the next /// /// Mip level to get the pitch for /// The number of bytes from start of one row to start of the next row /// Thrown if level is less than 0 or greater than mip levels - 1 public ByteSize RowPitch(int level); }