Rgb24 Struct

An opaque pixel with 8-bit red, green and blue components, stored in RGB byte order.

public struct Rgb24 : IEquatable<Rgb24>
Implements

Constructors

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

Rgb24(byte, byte, byte)

Rgb24.cs

Initializes a new instance of the Rgb24 struct.

public Rgb24(byte r, byte g, byte b)

Parameters

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

Methods

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

Rgb24.cs

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

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

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

Equals(object?)

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

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

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

operator ==(Rgb24, Rgb24)

Rgb24.cs

Compares two pixels for equality.

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

Parameters

left Rgb24
The first pixel.
right Rgb24
The second pixel.

Returns

bool true if all components are equal; otherwise false.

operator !=(Rgb24, Rgb24)

Rgb24.cs

Compares two pixels for inequality.

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

Parameters

left Rgb24
The first pixel.
right Rgb24
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 byte B

G

The green component.

public byte G

R

The red component.

public byte R