Bgr565 Struct
An opaque pixel with a 5-bit red, a 6-bit green and a 5-bit blue component, packed in a 16-bit value.
public struct Bgr565 : IEquatable<Bgr565>Remarks
Bgr565.PackedValue is stored in native endianness and holds blue in its 5 low bits, green in the next 6 bits and red in its 5 high bits: the layout of DXGI_FORMAT_B5G6R5_UNORM and of the RGB_565 bitmaps of Android. The components go from 0 to 31 (red and blue) or 63 (green), the largest value of their bits.
A component is the fraction of its largest value: conversions to and from the other formats round to the nearest sample, so the conversion to a format with 8 bits or more per component and back is exact, and a conversion to this format reduces the precision.
- Implements
Constructors
| Name | Description |
|---|---|
| Bgr565(byte, byte, byte) | Initializes a new instance of the Bgr565 struct. |
Bgr565(byte, byte, byte)
Bgr565.csInitializes a new instance of the Bgr565 struct.
Parameters
rbyte- The red component, from 0 to 31.
gbyte- The green component, from 0 to 63.
bbyte- The blue component, from 0 to 31.
Exceptions
ArgumentOutOfRangeException- A component is larger than the largest value of its bits.
Properties
| Name | Description |
|---|---|
| B | Gets or sets the blue component, from 0 to 31. |
| G | Gets or sets the green component, from 0 to 63. |
| R | Gets or sets the red component, from 0 to 31. |
Gets or sets the blue component, from 0 to 31.
public byte B { readonly get; set; }Gets or sets the green component, from 0 to 63.
public byte G { readonly get; set; }Gets or sets the red component, from 0 to 31.
public byte R { readonly get; set; }Methods
| Name | Description |
|---|---|
| Equals(Bgr565) | 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. |
GetHashCode()
Bgr565.csToString()
Bgr565.csOperators
| Name | Description |
|---|---|
| operator ==(Bgr565, Bgr565) | Compares two pixels for equality. |
| operator !=(Bgr565, Bgr565) | Compares two pixels for inequality. |
operator ==(Bgr565, Bgr565)
Bgr565.csoperator !=(Bgr565, Bgr565)
Bgr565.csFields
| Name | Description |
|---|---|
| PackedValue | The packed components: blue in bits 0 to 4, green in bits 5 to 10 and red in bits 11 to 15. |
PackedValue
The packed components: blue in bits 0 to 4, green in bits 5 to 10 and red in bits 11 to 15.
public ushort PackedValue