Gray8 Struct

An opaque 8-bit grayscale pixel.

public struct Gray8 : IEquatable<Gray8>
Implements

Constructors

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

Gray8(byte)

Gray8.cs

Initializes a new instance of the Gray8 struct.

public Gray8(byte value)

Parameters

value byte
The gray level.

Methods

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

Gray8.cs

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

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

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

Equals(object?)

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

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

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

operator ==(Gray8, Gray8)

Gray8.cs

Compares two pixels for equality.

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

Parameters

left Gray8
The first pixel.
right Gray8
The second pixel.

Returns

bool true if the values are equal; otherwise false.

operator !=(Gray8, Gray8)

Gray8.cs

Compares two pixels for inequality.

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

Parameters

left Gray8
The first pixel.
right Gray8
The second pixel.

Returns

bool true if the values differ; otherwise false.

Fields

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

Value

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

public byte Value