LaHalf Struct

A pixel with a half-precision floating-point gray level and a straight (non-premultiplied) alpha component, in 4 bytes per pixel.

public struct LaHalf : IEquatable<LaHalf>

Remarks

The values have the meaning of those of LaFloat, with the range and the precision of Half (11 significant bits, finite values up to 65,504). Components are stored in native endianness.

Implements

Constructors

NameDescription
LaHalf(Half)Initializes a new instance of the LaHalf struct with a fully opaque alpha.
LaHalf(Half, Half)Initializes a new instance of the LaHalf struct.

LaHalf overloads

LaHalf(Half)

LaHalf.cs

Initializes a new instance of the LaHalf struct with a fully opaque alpha.

public LaHalf(Half l)
Parameters
l Half
The gray level.

LaHalf(Half, Half)

LaHalf.cs

Initializes a new instance of the LaHalf struct.

public LaHalf(Half l, Half a)
Parameters
l Half
The gray level.
a Half
The straight alpha component.

Methods

NameDescription
Equals(LaHalf)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(LaHalf)

LaHalf.cs

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

public readonly bool Equals(LaHalf other)
Parameters
other LaHalf
An object to compare with this object.
Returns

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

Remarks

Components are compared with Half.Equals: a component that is not a number equals itself.

Equals(object?)

LaHalf.cs

Indicates whether this instance and a specified object are equal.

public override readonly 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()

LaHalf.cs

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

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

ToString()

LaHalf.cs

Returns the fully qualified type name of this instance.

public override readonly string ToString()

Returns

string The fully qualified type name.

Operators

NameDescription
operator ==(LaHalf, LaHalf)Compares two pixels for equality.
operator !=(LaHalf, LaHalf)Compares two pixels for inequality.

operator ==(LaHalf, LaHalf)

LaHalf.cs

Compares two pixels for equality.

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

Parameters

left LaHalf
The first pixel.
right LaHalf
The second pixel.

Returns

bool true if all components are equal; otherwise false.

operator !=(LaHalf, LaHalf)

LaHalf.cs

Compares two pixels for inequality.

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

Parameters

left LaHalf
The first pixel.
right LaHalf
The second pixel.

Returns

bool true if any component differs; otherwise false.

Fields

NameDescription
AThe straight alpha component (0 is fully transparent, 1 is fully opaque).
LThe gray level.

A

The straight alpha component (0 is fully transparent, 1 is fully opaque).

public Half A

L

The gray level.

public Half L