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