![]() |
Paradox Game Engine
v1.0.0 beta06
|
The FIRGB16 structure describes a color consisting of relative intensities of red, green, blue and alpha value. Each single color component consumes 16 bits and so, takes values in the range from 0 to 65535. More...
Public Member Functions | |
FIRGB16 (Color color) | |
Initializes a new instance based on the specified System.Drawing.Color. More... | |
int | CompareTo (object obj) |
Compares this instance with a specified Object. More... | |
int | CompareTo (FIRGB16 other) |
Compares this instance with a specified FIRGB16 object. More... | |
override bool | Equals (object obj) |
Tests whether the specified object is a FIRGB16 structure and is equivalent to this FIRGB16 structure. More... | |
bool | Equals (FIRGB16 other) |
Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure. More... | |
override int | GetHashCode () |
Returns a hash code for this FIRGB16 structure. More... | |
override string | ToString () |
Converts the numeric value of the FIRGB16 object to its equivalent string representation. More... | |
FIRGB16 (Color color) | |
Initializes a new instance based on the specified System.Drawing.Color. More... | |
int | CompareTo (object obj) |
Compares this instance with a specified Object. More... | |
int | CompareTo (FIRGB16 other) |
Compares this instance with a specified FIRGB16 object. More... | |
override bool | Equals (object obj) |
Tests whether the specified object is a FIRGB16 structure and is equivalent to this FIRGB16 structure. More... | |
bool | Equals (FIRGB16 other) |
Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure. More... | |
override int | GetHashCode () |
Returns a hash code for this FIRGB16 structure. More... | |
override string | ToString () |
Converts the numeric value of the FIRGB16 object to its equivalent string representation. More... | |
Static Public Member Functions | |
static bool | operator== (FIRGB16 left, FIRGB16 right) |
Tests whether two specified FIRGB16 structures are equivalent. More... | |
static bool | operator!= (FIRGB16 left, FIRGB16 right) |
Tests whether two specified FIRGB16 structures are different. More... | |
static implicit | operator FIRGB16 (Color value) |
Converts the value of a System.Drawing.Color structure to a FIRGB16 structure. More... | |
static implicit | operator Color (FIRGB16 value) |
Converts the value of a FIRGB16 structure to a System.Drawing.Color structure. More... | |
static bool | operator== (FIRGB16 left, FIRGB16 right) |
Tests whether two specified FIRGB16 structures are equivalent. More... | |
static bool | operator!= (FIRGB16 left, FIRGB16 right) |
Tests whether two specified FIRGB16 structures are different. More... | |
static implicit | operator FIRGB16 (Color value) |
Converts the value of a System.Drawing.Color structure to a FIRGB16 structure. More... | |
static implicit | operator Color (FIRGB16 value) |
Converts the value of a FIRGB16 structure to a System.Drawing.Color structure. More... | |
Public Attributes | |
ushort | red |
The red color component. More... | |
ushort | green |
The green color component. More... | |
ushort | blue |
The blue color component. More... | |
Properties | |
Color | Color [get, set] |
Gets or sets the System.Drawing.Color of the structure. More... | |
The FIRGB16 structure describes a color consisting of relative intensities of red, green, blue and alpha value. Each single color component consumes 16 bits and so, takes values in the range from 0 to 65535.
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 System.Drawing.Color type. This makes the System.Drawing.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 System.Drawing.Color by right shifting 8 bits and shifting left 8 bits for the reverse conversion. When converting from System.Drawing.Color into FIRGB16, the color's alpha value is ignored and assumed to be 255 when converting from FIRGB16 into System.Drawing.Color, creating a fully opaque color.
Conversion from System.Drawing.Color to FIRGB16
FIRGB16.component = Color.component << 8
Conversion from FIRGB16 to System.Drawing.Color
Color.component = FIRGB16.component >> 8
The same conversion is also applied when the FreeImageAPI.FIRGB16.Color property or the FreeImageAPI.FIRGB16(System.Drawing.Color) constructor is invoked.
The following code example demonstrates the various conversions between the FIRGB16 structure and the System.Drawing.Color structure.
Definition at line 101 of file FIRGB16.cs.
FreeImageAPI.FIRGB16.FIRGB16 | ( | Color | color | ) |
Initializes a new instance based on the specified System.Drawing.Color.
color | System.Drawing.Color to initialize with. |
Definition at line 122 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.blue, FreeImageAPI.FIRGB16.green, and FreeImageAPI.FIRGB16.red.
Referenced by FreeImageAPI.FIRGB16.operator FIRGB16().
FreeImageAPI.FIRGB16.FIRGB16 | ( | Color | color | ) |
Initializes a new instance based on the specified System.Drawing.Color.
color | System.Drawing.Color to initialize with. |
Definition at line 122 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.blue, FreeImageAPI.FIRGB16.green, and FreeImageAPI.FIRGB16.red.
int FreeImageAPI.FIRGB16.CompareTo | ( | object | obj | ) |
Compares this instance with a specified Object.
obj | An object to compare with this instance. |
ArgumentException | obj is not a FIRGB16. |
Definition at line 201 of file FIRGB16.cs.
Referenced by FreeImageAPI.FIRGB16.CompareTo().
int FreeImageAPI.FIRGB16.CompareTo | ( | object | obj | ) |
Compares this instance with a specified Object.
obj | An object to compare with this instance. |
ArgumentException | obj is not a FIRGB16. |
Definition at line 201 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.CompareTo().
int FreeImageAPI.FIRGB16.CompareTo | ( | FIRGB16 | other | ) |
Compares this instance with a specified FIRGB16 object.
other | A FIRGB16 to compare. |
Definition at line 220 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.CompareTo().
int FreeImageAPI.FIRGB16.CompareTo | ( | FIRGB16 | other | ) |
Compares this instance with a specified FIRGB16 object.
other | A FIRGB16 to compare. |
Definition at line 220 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.Color, and FreeImageAPI.FIRGB16.CompareTo().
override bool FreeImageAPI.FIRGB16.Equals | ( | object | obj | ) |
override bool FreeImageAPI.FIRGB16.Equals | ( | object | obj | ) |
bool FreeImageAPI.FIRGB16.Equals | ( | FIRGB16 | other | ) |
Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure.
other | A FIRGB16 structure to compare to this instance. |
Definition at line 241 of file FIRGB16.cs.
bool FreeImageAPI.FIRGB16.Equals | ( | FIRGB16 | other | ) |
override int FreeImageAPI.FIRGB16.GetHashCode | ( | ) |
Returns a hash code for this FIRGB16 structure.
Definition at line 250 of file FIRGB16.cs.
override int FreeImageAPI.FIRGB16.GetHashCode | ( | ) |
Returns a hash code for this FIRGB16 structure.
Definition at line 252 of file FIRGB16.cs.
Converts the value of a FIRGB16 structure to a System.Drawing.Color structure.
value | A FIRGB16 structure. |
Definition at line 173 of file FIRGB16.cs.
Converts the value of a FIRGB16 structure to a System.Drawing.Color structure.
value | A FIRGB16 structure. |
Definition at line 173 of file FIRGB16.cs.
Converts the value of a System.Drawing.Color structure to a FIRGB16 structure.
value | A System.Drawing.Color structure. |
Definition at line 163 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.FIRGB16().
Converts the value of a System.Drawing.Color structure to a FIRGB16 structure.
value | A System.Drawing.Color structure. |
Definition at line 163 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.FIRGB16().
Tests whether two specified FIRGB16 structures are different.
left | The FIRGB16 that is to the left of the inequality operator. |
right | The FIRGB16 that is to the right of the inequality operator. |
Definition at line 153 of file FIRGB16.cs.
Tests whether two specified FIRGB16 structures are different.
left | The FIRGB16 that is to the left of the inequality operator. |
right | The FIRGB16 that is to the right of the inequality operator. |
Definition at line 153 of file FIRGB16.cs.
Tests whether two specified FIRGB16 structures are equivalent.
left | The FIRGB16 that is to the left of the equality operator. |
right | The FIRGB16 that is to the right of the equality operator. |
Definition at line 137 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.blue, FreeImageAPI.FIRGB16.green, and FreeImageAPI.FIRGB16.red.
Tests whether two specified FIRGB16 structures are equivalent.
left | The FIRGB16 that is to the left of the equality operator. |
right | The FIRGB16 that is to the right of the equality operator. |
Definition at line 137 of file FIRGB16.cs.
override string FreeImageAPI.FIRGB16.ToString | ( | ) |
Converts the numeric value of the FIRGB16 object to its equivalent string representation.
Definition at line 260 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.Color.
override string FreeImageAPI.FIRGB16.ToString | ( | ) |
Converts the numeric value of the FIRGB16 object to its equivalent string representation.
Definition at line 262 of file FIRGB16.cs.
References FreeImageAPI.FIRGB16.Color.
ushort FreeImageAPI.FIRGB16.blue |
The blue color component.
Definition at line 116 of file FIRGB16.cs.
Referenced by FreeImageAPI.FIRGB16.FIRGB16(), and FreeImageAPI.FIRGB16.operator==().
ushort FreeImageAPI.FIRGB16.green |
The green color component.
Definition at line 111 of file FIRGB16.cs.
Referenced by FreeImageAPI.FIRGB16.FIRGB16(), and FreeImageAPI.FIRGB16.operator==().
ushort FreeImageAPI.FIRGB16.red |
The red color component.
Definition at line 106 of file FIRGB16.cs.
Referenced by FreeImageAPI.FIRGB16.FIRGB16(), and FreeImageAPI.FIRGB16.operator==().
|
getset |
Gets or sets the System.Drawing.Color of the structure.
Definition at line 182 of file FIRGB16.cs.
Referenced by FreeImageAPI.FIRGB16.CompareTo(), and FreeImageAPI.FIRGB16.ToString().