GrayFloat Struct
An opaque grayscale pixel with a single-precision floating-point gray level, in 4 bytes per pixel.
public struct GrayFloat : IEquatable<GrayFloat>Remarks
The gray level has the meaning of the colors of RgbaFloat: linear light where 1 is the reference white, with values outside [0, 1] allowed (highlights above 1). A new image of this pixel type is labeled as linear light (ColorTransferFunction.Linear), and the components are stored in native endianness.
Converting a color to it gives the Rec. 709 luma of the color, 0.2126 R + 0.7152 G + 0.0722 B (the luma of a gray color is that gray), and converting it to a color format repeats the gray level in the three colors. Converting it to an integer pixel format follows the rules of RgbaFloat.
- Implements
Constructors
| Name | Description |
|---|---|
| GrayFloat(float) | Initializes a new instance of the GrayFloat struct. |
GrayFloat(float)
GrayFloat.csMethods
| Name | Description |
|---|---|
| Equals(GrayFloat) | 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(GrayFloat)
GrayFloat.csIndicates whether the current object is equal to another object of the same type.
Parameters
otherGrayFloat- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Remarks
Values are compared with Single.Equals: a value that is not a number equals itself.
Equals(object?)
GrayFloat.csGetHashCode()
GrayFloat.csToString()
GrayFloat.csOperators
| Name | Description |
|---|---|
| operator ==(GrayFloat, GrayFloat) | Compares two pixels for equality. |
| operator !=(GrayFloat, GrayFloat) | Compares two pixels for inequality. |
operator ==(GrayFloat, GrayFloat)
GrayFloat.csoperator !=(GrayFloat, GrayFloat)
GrayFloat.csFields
| Name | Description |
|---|---|
| Value | The gray level. |
Value
The gray level.
public float Value