Rgba64 Struct

A pixel with 16-bit red, green, blue and straight (non-premultiplied) alpha components.

public struct Rgba64 : IEquatable<Rgba64>

Remarks

Components are stored as UInt16 values in native endianness. Codecs convert from/to the endianness of the encoded format; raw byte access (ImageFrame.CopyPixelBytesTo) exposes native-endian values.

Implements

Constructors

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

Rgba64(ushort, ushort, ushort, ushort)

Rgba64.cs

Initializes a new instance of the Rgba64 struct.

public Rgba64(ushort r, ushort g, ushort b, ushort a = 65535)

Parameters

r ushort
The red component.
g ushort
The green component.
b ushort
The blue component.
a ushort
The straight alpha component. Defaults to fully opaque.

Methods

NameDescription
Equals(Rgba64)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.
FromRgba32(Rgba32)Creates an Rgba64 from an Rgba32 using exact full-range expansion (v * 257).
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(Rgba64)

Rgba64.cs

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

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

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

Equals(object?)

Rgba64.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.

FromRgba32(Rgba32)

Rgba64.cs

Creates an Rgba64 from an Rgba32 using exact full-range expansion (v * 257).

public static Rgba64 FromRgba32(Rgba32 value)

Parameters

value Rgba32
The 8-bit pixel.

Returns

Rgba64 The widened pixel.

GetHashCode()

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

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

operator ==(Rgba64, Rgba64)

Rgba64.cs

Compares two pixels for equality.

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

Parameters

left Rgba64
The first pixel.
right Rgba64
The second pixel.

Returns

bool true if all components are equal; otherwise false.

operator !=(Rgba64, Rgba64)

Rgba64.cs

Compares two pixels for inequality.

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

Parameters

left Rgba64
The first pixel.
right Rgba64
The second pixel.

Returns

bool true if any component differs; otherwise false.

Fields

NameDescription
AThe straight alpha component (0 is fully transparent, 65535 is fully opaque).
BThe blue component.
GThe green component.
RThe red component.

A

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

public ushort A

B

The blue component.

public ushort B

G

The green component.

public ushort G

R

The red component.

public ushort R