Class TextureInfo
- Namespace
- HelixToolkit.SharpDX
- Assembly
- HelixToolkit.SharpDX.dll
Stream texture data.
public sealed class TextureInfo
- Inheritance
-
TextureInfo
- Inherited Members
Constructors
TextureInfo(Color4[]?, bool)
Create TextureInfo with a non-compressed 1D color4 data
public TextureInfo(Color4[]? texture, bool generateMipMaps = true)
Parameters
Exceptions
- ArgumentNullException
Texture cannot be null.
- ArgumentException
Height cannot be zero.
TextureInfo(Color4[]?, int, bool)
Create TextureInfo with a non-compressed 1D color4 data
public TextureInfo(Color4[]? texture, int width, bool generateMipMaps = true)
Parameters
textureColor4[]The texture.
widthintThe width.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentNullException
Texture cannot be null.
- ArgumentException
Height cannot be zero.
TextureInfo(Color4[]?, int, int, bool)
Create TextureInfo with a non-compressed 2D color4 data
public TextureInfo(Color4[]? texture, int width, int height, bool generateMipMaps = true)
Parameters
textureColor4[]The texture.
widthintThe width.
heightintThe height.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentException
Height cannot be zero.
TextureInfo(Color4[]?, int, int, int, bool)
Create TextureInfo with a non-compressed 3D color4 data
public TextureInfo(Color4[]? texture, int width, int height, int depth, bool generateMipMaps = true)
Parameters
textureColor4[]The texture.
widthintThe width.
heightintThe height.
depthintThe depth.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentOutOfRangeException
Depth cannot be zero.
TextureInfo(byte[]?, Format, int, bool)
Create TextureInfo with a non-compressed 1D texture data
public TextureInfo(byte[]? texture, Format pixelFormat, int width, bool generateMipMaps = true)
Parameters
texturebyte[]The texture.
pixelFormatFormatThe pixel format.
widthintThe width.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentNullException
Texture cannot be null.
- ArgumentException
Height cannot be zero.
TextureInfo(byte[]?, Format, int, int, bool)
Create TextureInfo with a non-compressed 2D texture data
public TextureInfo(byte[]? texture, Format pixelFormat, int width, int height, bool generateMipMaps = true)
Parameters
texturebyte[]The texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentException
Height cannot be zero.
TextureInfo(byte[]?, Format, int, int, int, bool)
Create TextureInfo with a non-compressed 3D texture data
public TextureInfo(byte[]? texture, Format pixelFormat, int width, int height, int depth, bool generateMipMaps = true)
Parameters
texturebyte[]The texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
depthintThe depth.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentOutOfRangeException
Depth cannot be zero.
TextureInfo(Stream?, Format, int, bool)
Create TextureInfo with a non-compressed 1D texture stream
public TextureInfo(Stream? texture, Format pixelFormat, int width, bool generateMipMaps = true)
Parameters
textureStreamThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentNullException
Texture cannot be null.
- ArgumentException
Height cannot be zero.
TextureInfo(Stream?, Format, int, int, bool)
Create TextureInfo with a non-compressed 2D texture stream
public TextureInfo(Stream? texture, Format pixelFormat, int width, int height, bool generateMipMaps = true)
Parameters
textureStreamThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentException
Height cannot be zero.
TextureInfo(Stream?, Format, int, int, int, bool)
Create TextureInfo with a non-compressed 3D texture stream
public TextureInfo(Stream? texture, Format pixelFormat, int width, int height, int depth, bool generateMipMaps = true)
Parameters
textureStreamThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
depthintThe depth.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentOutOfRangeException
Depth cannot be zero.
TextureInfo(Stream?, bool)
Create TextureInfo with a compressed texture stream
public TextureInfo(Stream? texture, bool generateMipMaps = true)
Parameters
Exceptions
- ArgumentNullException
Texture cannot be null.
TextureInfo(nint, Format, int, bool)
Create TextureInfo with a non-compressed 1D texture raw pointer
public TextureInfo(nint texture, Format pixelFormat, int width, bool generateMipMaps = true)
Parameters
texturenintThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentNullException
Texture cannot be null.
- ArgumentException
Height cannot be zero.
TextureInfo(nint, Format, int, int, bool)
Create TextureInfo with a non-compressed 2D texture raw pointer
public TextureInfo(nint texture, Format pixelFormat, int width, int height, bool generateMipMaps = true)
Parameters
texturenintThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentException
Height cannot be zero.
TextureInfo(nint, Format, int, int, int, bool)
Create TextureInfo with a non-compressed 3D texture raw pointer
public TextureInfo(nint texture, Format pixelFormat, int width, int height, int depth, bool generateMipMaps = true)
Parameters
texturenintThe texture.
pixelFormatFormatThe pixel format.
widthintThe width.
heightintThe height.
depthintThe depth.
generateMipMapsboolif set to
true[generate mip maps].
Exceptions
- ArgumentOutOfRangeException
Depth cannot be zero.
Properties
Color4Array
Gets the color4 array.
public Color4[] Color4Array { get; }
Property Value
- Color4[]
The color4 array.
DataType
public TextureDataType DataType { get; }
Property Value
Depth
public int Depth { get; }
Property Value
Dimension
Gets the texture dimension.
public int Dimension { get; }
Property Value
- int
The dimension.
GenerateMipMaps
The generate mip maps automatically after being loaded.
public bool GenerateMipMaps { get; }
Property Value
Height
The height. Only used by non-compressed texture data.
public int Height { get; }
Property Value
IsCompressed
Whether the texture is a compressed data format, such as Jepg, Png, DDS. Set IsCompressed= false for such as Color4[] array content.
public bool IsCompressed { get; }
Property Value
Null
public static TextureInfo Null { get; }
Property Value
PixelFormat
The pixel format. Only used by non-compressed texture data.
public Format PixelFormat { get; }
Property Value
- Format
RawPointer
Gets the raw pointer.
public nint RawPointer { get; }
Property Value
- nint
The raw pointer.
Tag
Gets the tag.
public object? Tag { get; }
Property Value
- object
The tag.
Texture
The texture stream
public Stream Texture { get; }
Property Value
TextureRaw
Gets the texture raw bytes.
public byte[] TextureRaw { get; }
Property Value
- byte[]
The texture raw.
Width
The texture width. Only used by non-compressed texture data.
public int Width { get; }