Rgb48 Struct

An opaque pixel with 16-bit red, green and blue components, stored in native endianness.

public struct Rgb48 : IEquatable<Rgb48>

Remarks

It holds a 16-bit color image without transparency in three quarters of the memory of Rgba64.

Implements

Constructors

NameDescription
Rgb48(ushort, ushort, ushort)Initializes a new instance of the Rgb48 struct.

Rgb48(ushort, ushort, ushort)

Rgb48.cs

Initializes a new instance of the Rgb48 struct.

public Rgb48(ushort r, ushort g, ushort b)

Parameters

r ushort
The red component.
g ushort
The green component.
b ushort
The blue component.

Methods

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

Rgb48.cs

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

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

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

Equals(object?)

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

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

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

operator ==(Rgb48, Rgb48)

Rgb48.cs

Compares two pixels for equality.

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

Parameters

left Rgb48
The first pixel.
right Rgb48
The second pixel.

Returns

bool true if all components are equal; otherwise false.

operator !=(Rgb48, Rgb48)

Rgb48.cs

Compares two pixels for inequality.

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

Parameters

left Rgb48
The first pixel.
right Rgb48
The second pixel.

Returns

bool true if any component differs; otherwise false.

Fields

NameDescription
BThe blue component.
GThe green component.
RThe red component.

B

The blue component.

public ushort B

G

The green component.

public ushort G

R

The red component.

public ushort R