FIRGB16 Structure |
Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
[SerializableAttribute] public struct FIRGB16 : IComparable, IComparable<FIRGB16>, IEquatable<FIRGB16>
The FIRGB16 type exposes the following members.
Name | Description | |
---|---|---|
CompareTo(Object) |
Compares this instance with a specified Object.
| |
CompareTo(FIRGB16) |
Compares this instance with a specified FIRGB16 object.
| |
Equals(Object) |
Tests whether the specified object is a FIRGB16 structure
and is equivalent to this FIRGB16 structure.
(Overrides ValueTypeEquals(Object).) | |
Equals(FIRGB16) |
Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure.
| |
GetHashCode |
Returns a hash code for this FIRGB16 structure.
(Overrides ValueTypeGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString |
Converts the numeric value of the FIRGB16 object
to its equivalent string representation.
(Overrides ValueTypeToString.) |
Name | Description | |
---|---|---|
Equality |
Tests whether two specified FIRGB16 structures are equivalent.
| |
(Color to FIRGB16) |
Converts the value of a Color structure to a FIRGB16 structure.
| |
(FIRGB16 to Color) |
Converts the value of a FIRGB16 structure to a Color structure.
| |
Inequality |
Tests whether two specified FIRGB16 structures are different.
|
Name | Description | |
---|---|---|
blue |
The blue color component.
| |
green |
The green color component.
| |
red |
The red color component.
|
The FIRGB16 structure provides access to an underlying FreeImage FIRGB16 structure. To determine the red, green or blue component of a color, use the red, green or blue fields, respectively.
For easy integration of the underlying structure into the .NET framework, the FIRGB16 structure implements implicit conversion operators to convert the represented color to and from the Color type. This makes the Color type a real replacement for the FIRGB16 structure and my be used in all situations which require an FIRGB16 type.
Each color component red, green or blue of FIRGB16 is translated into it's corresponding color component R, G or B of Color by right shifting 8 bits and shifting left 8 bits for the reverse conversion. When converting from Color into FIRGB16, the color's alpha value is ignored and assumed to be 255 when converting from FIRGB16 into Color, creating a fully opaque color.
Conversion from System.Drawing.Color to FIRGB16
FIRGB16.component = Color.component << 8Conversion from FIRGB16 to System.Drawing.Color
Color.component = FIRGB16.component >> 8The same conversion is also applied when the Color property or the FIRGB16(Color) constructor is invoked.
FIRGB16 firgb16; // Initialize the structure using a native .NET Color structure. firgb16 = new FIRGBA16(Color.Indigo); // Initialize the structure using the implicit operator. firgb16 = Color.DarkSeaGreen; // Convert the FIRGB16 instance into a native .NET Color // using its implicit operator. Color color = firgb16; // Using the structure's Color property for converting it // into a native .NET Color. Color another = firgb16.Color;