Table of Contents

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

texture Color4[]

The texture.

generateMipMaps bool

if set to true [generate mip maps].

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

texture Color4[]

The texture.

width int

The width.

generateMipMaps bool

if 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

texture Color4[]

The texture.

width int

The width.

height int

The height.

generateMipMaps bool

if 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

texture Color4[]

The texture.

width int

The width.

height int

The height.

depth int

The depth.

generateMipMaps bool

if 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

texture byte[]

The texture.

pixelFormat Format

The pixel format.

width int

The width.

generateMipMaps bool

if 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

texture byte[]

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

generateMipMaps bool

if 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

texture byte[]

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

depth int

The depth.

generateMipMaps bool

if 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

texture Stream

The texture.

pixelFormat Format

The pixel format.

width int

The width.

generateMipMaps bool

if 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

texture Stream

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

generateMipMaps bool

if 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

texture Stream

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

depth int

The depth.

generateMipMaps bool

if 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

texture Stream

The texture.

generateMipMaps bool

if set to true [generate mip maps].

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

texture nint

The texture.

pixelFormat Format

The pixel format.

width int

The width.

generateMipMaps bool

if 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

texture nint

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

generateMipMaps bool

if 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

texture nint

The texture.

pixelFormat Format

The pixel format.

width int

The width.

height int

The height.

depth int

The depth.

generateMipMaps bool

if 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

TextureDataType

Depth

public int Depth { get; }

Property Value

int

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

bool

Height

The height. Only used by non-compressed texture data.

public int Height { get; }

Property Value

int

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

bool

Null

public static TextureInfo Null { get; }

Property Value

TextureInfo

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

Stream

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; }

Property Value

int