La16 Struct

A pixel with an 8-bit gray level and an 8-bit straight (non-premultiplied) alpha component, stored in that byte order.

public struct La16 : IEquatable<La16>

Remarks

It holds a grayscale image with transparency in half the memory of Rgba32.

Implements

Constructors

NameDescription
La16(byte, byte)Initializes a new instance of the La16 struct.

La16(byte, byte)

La16.cs

Initializes a new instance of the La16 struct.

public La16(byte l, byte a = 255)

Parameters

l byte
The gray level.
a byte
The straight alpha component. Defaults to fully opaque.

Methods

NameDescription
Equals(La16)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(La16)

La16.cs

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

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

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

Equals(object?)

La16.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()

La16.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()

La16.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 ==(La16, La16)Compares two pixels for equality.
operator !=(La16, La16)Compares two pixels for inequality.

operator ==(La16, La16)

La16.cs

Compares two pixels for equality.

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

Parameters

left La16
The first pixel.
right La16
The second pixel.

Returns

bool true if all components are equal; otherwise false.

operator !=(La16, La16)

La16.cs

Compares two pixels for inequality.

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

Parameters

left La16
The first pixel.
right La16
The second pixel.

Returns

bool true if any component differs; otherwise false.

Fields

NameDescription
AThe straight alpha component (0 is fully transparent, 255 is fully opaque).
LThe gray level (0 is black, 255 is white), in the encoded (not linear) scale.

A

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

public byte A

L

The gray level (0 is black, 255 is white), in the encoded (not linear) scale.

public byte L