Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
FreeImageAPI.FIRGB16 Struct Reference

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...

Inheritance diagram for FreeImageAPI.FIRGB16:
IComparable IComparable< FIRGB16 > IEquatable< FIRGB16 > IComparable IComparable< FIRGB16 > IEquatable< FIRGB16 >

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...
 

Detailed Description

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.

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;

Definition at line 101 of file FIRGB16.cs.

Constructor & Destructor Documentation

FreeImageAPI.FIRGB16.FIRGB16 ( Color  color)

Initializes a new instance based on the specified System.Drawing.Color.

Parameters
colorSystem.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.

Parameters
colorSystem.Drawing.Color to initialize with.

Definition at line 122 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.blue, FreeImageAPI.FIRGB16.green, and FreeImageAPI.FIRGB16.red.

Member Function Documentation

int FreeImageAPI.FIRGB16.CompareTo ( object  obj)

Compares this instance with a specified Object.

Parameters
objAn object to compare with this instance.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.
Exceptions
ArgumentExceptionobj 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.

Parameters
objAn object to compare with this instance.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.
Exceptions
ArgumentExceptionobj 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.

Parameters
otherA FIRGB16 to compare.
Returns
A signed number indicating the relative values of this instance and other .

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.

Parameters
otherA FIRGB16 to compare.
Returns
A signed number indicating the relative values of this instance and other .

Definition at line 220 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.Color, and FreeImageAPI.FIRGB16.CompareTo().

override bool FreeImageAPI.FIRGB16.Equals ( object  obj)

Tests whether the specified object is a FIRGB16 structure and is equivalent to this FIRGB16 structure.

Parameters
objThe object to test.
Returns
true if obj is a FIRGB16 structure equivalent to this FIRGB16 structure; otherwise, false.

Definition at line 232 of file FIRGB16.cs.

override bool FreeImageAPI.FIRGB16.Equals ( object  obj)

Tests whether the specified object is a FIRGB16 structure and is equivalent to this FIRGB16 structure.

Parameters
objThe object to test.
Returns
true if obj is a FIRGB16 structure equivalent to this FIRGB16 structure; otherwise, false.

Definition at line 232 of file FIRGB16.cs.

bool FreeImageAPI.FIRGB16.Equals ( FIRGB16  other)

Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure.

Parameters
otherA FIRGB16 structure to compare to this instance.

Definition at line 241 of file FIRGB16.cs.

bool FreeImageAPI.FIRGB16.Equals ( FIRGB16  other)

Tests whether the specified FIRGB16 structure is equivalent to this FIRGB16 structure.

Parameters
otherA FIRGB16 structure to compare to this instance.
Returns
true if obj is a FIRGB16 structure equivalent to this FIRGB16 structure; otherwise, false.

Definition at line 243 of file FIRGB16.cs.

override int FreeImageAPI.FIRGB16.GetHashCode ( )

Returns a hash code for this FIRGB16 structure.

Returns
An integer value that specifies the hash code for this FIRGB16.

Definition at line 250 of file FIRGB16.cs.

override int FreeImageAPI.FIRGB16.GetHashCode ( )

Returns a hash code for this FIRGB16 structure.

Returns
An integer value that specifies the hash code for this FIRGB16.

Definition at line 252 of file FIRGB16.cs.

static implicit FreeImageAPI.FIRGB16.operator Color ( FIRGB16  value)
static

Converts the value of a FIRGB16 structure to a System.Drawing.Color structure.

Parameters
valueA FIRGB16 structure.
Returns
A new instance of System.Drawing.Color initialized to value .

Definition at line 173 of file FIRGB16.cs.

static implicit FreeImageAPI.FIRGB16.operator Color ( FIRGB16  value)
static

Converts the value of a FIRGB16 structure to a System.Drawing.Color structure.

Parameters
valueA FIRGB16 structure.
Returns
A new instance of System.Drawing.Color initialized to value .

Definition at line 173 of file FIRGB16.cs.

static implicit FreeImageAPI.FIRGB16.operator FIRGB16 ( Color  value)
static

Converts the value of a System.Drawing.Color structure to a FIRGB16 structure.

Parameters
valueA System.Drawing.Color structure.
Returns
A new instance of FIRGB16 initialized to value .

Definition at line 163 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.FIRGB16().

static implicit FreeImageAPI.FIRGB16.operator FIRGB16 ( Color  value)
static

Converts the value of a System.Drawing.Color structure to a FIRGB16 structure.

Parameters
valueA System.Drawing.Color structure.
Returns
A new instance of FIRGB16 initialized to value .

Definition at line 163 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.FIRGB16().

static bool FreeImageAPI.FIRGB16.operator!= ( FIRGB16  left,
FIRGB16  right 
)
static

Tests whether two specified FIRGB16 structures are different.

Parameters
leftThe FIRGB16 that is to the left of the inequality operator.
rightThe FIRGB16 that is to the right of the inequality operator.
Returns
true if the two FIRGB16 structures are different; otherwise, false.

Definition at line 153 of file FIRGB16.cs.

static bool FreeImageAPI.FIRGB16.operator!= ( FIRGB16  left,
FIRGB16  right 
)
static

Tests whether two specified FIRGB16 structures are different.

Parameters
leftThe FIRGB16 that is to the left of the inequality operator.
rightThe FIRGB16 that is to the right of the inequality operator.
Returns
true if the two FIRGB16 structures are different; otherwise, false.

Definition at line 153 of file FIRGB16.cs.

static bool FreeImageAPI.FIRGB16.operator== ( FIRGB16  left,
FIRGB16  right 
)
static

Tests whether two specified FIRGB16 structures are equivalent.

Parameters
leftThe FIRGB16 that is to the left of the equality operator.
rightThe FIRGB16 that is to the right of the equality operator.
Returns
true if the two FIRGB16 structures are equal; otherwise, false.

Definition at line 137 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.blue, FreeImageAPI.FIRGB16.green, and FreeImageAPI.FIRGB16.red.

static bool FreeImageAPI.FIRGB16.operator== ( FIRGB16  left,
FIRGB16  right 
)
static

Tests whether two specified FIRGB16 structures are equivalent.

Parameters
leftThe FIRGB16 that is to the left of the equality operator.
rightThe FIRGB16 that is to the right of the equality operator.
Returns
true if the two FIRGB16 structures are equal; otherwise, false.

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.

Returns
The string representation of the value of this instance.

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.

Returns
The string representation of the value of this instance.

Definition at line 262 of file FIRGB16.cs.

References FreeImageAPI.FIRGB16.Color.

Member Data Documentation

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==().

Property Documentation

Color FreeImageAPI.FIRGB16.Color
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().


The documentation for this struct was generated from the following file: