Table of Contents

Struct MipMapCount

Namespace
Stride.Graphics
Assembly
Stride.dll

Describes the number of mipmap levels of a Texture.

public readonly struct MipMapCount : IEquatable<MipMapCount>
Implements
Inherited Members
Extension Methods

Remarks

MipMapCount allows implicit conversion from several types of values:

  • Set to true to specify all mipmaps (i.e. the whole mipchain). This is equivalent to Auto.
  • Set to false to specify a single mipmap. This is equivalent to One.
  • Set to any positive non-zero integer to indicate a specific number of mipmaps.

Constructors

MipMapCount(bool)

Initializes a new instance of the MipMapCount struct.

public MipMapCount(bool allMipMaps)

Parameters

allMipMaps bool

true to indicate that all mipmap levels should be generated; false to indicate only a single level.

MipMapCount(int)

Initializes a new instance of the MipMapCount struct.

public MipMapCount(int count)

Parameters

count int

The mipmap count.

Fields

Auto

Automatic mipmap count based on the size of the Texture (i.e. the whole mipchain).

public static readonly MipMapCount Auto

Field Value

MipMapCount

Count

The number of mipmaps.

public readonly int Count

Field Value

int

Remarks

A value of zero (0) means that all mipmaps (the whole mipchain) will be generated. A value of one (1) means only a single mipmap is generated. Any other number indicates the number of mipmaps to generate.

One

Just a single mipmap.

public static readonly MipMapCount One

Field Value

MipMapCount

Methods

Equals(MipMapCount)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MipMapCount other)

Parameters

other MipMapCount

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(MipMapCount, MipMapCount)

public static bool operator ==(MipMapCount left, MipMapCount right)

Parameters

left MipMapCount
right MipMapCount

Returns

bool

implicit operator bool(MipMapCount)

Performs an implicit conversion from MipMapCount to bool.

public static implicit operator bool(MipMapCount mipMap)

Parameters

mipMap MipMapCount

The value to convert.

Returns

bool

true if all mipmap levels should be generated; false a single level or more should be generated.

implicit operator int(MipMapCount)

Performs an implicit conversion from MipMapCount to int.

public static implicit operator int(MipMapCount mipMap)

Parameters

mipMap MipMapCount

The value to convert.

Returns

int

The number of mipmaps. A value of zero (0) means all mipmaps.

implicit operator MipMapCount(bool)

Performs an implicit conversion from bool to MipMapCount.

public static implicit operator MipMapCount(bool allMipMaps)

Parameters

allMipMaps bool

true to indicate that all mipmap levels should be generated; false to indicate only a single level.

Returns

MipMapCount

The result of the conversion.

implicit operator MipMapCount(int)

Performs an implicit conversion from int to MipMapCount.

public static implicit operator MipMapCount(int mipMapCount)

Parameters

mipMapCount int

The number of mipmaps. A value of zero (0) means all mipmaps.

Returns

MipMapCount

The result of the conversion.

operator !=(MipMapCount, MipMapCount)

public static bool operator !=(MipMapCount left, MipMapCount right)

Parameters

left MipMapCount
right MipMapCount

Returns

bool