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