FI16RGB555 Structure

FreeImage.NET

FI16RGB555 Structure
The FI16RGB555 structure describes a color consisting of relative intensities of red, green, blue and alpha value. Each single color component consumes 5 bits and so, takes values in the range from 0 to 31.

Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
Syntax
C#
[SerializableAttribute]
public struct FI16RGB555 : IComparable, 
	IComparable<FI16RGB555>, IEquatable<FI16RGB555>

The FI16RGB555 type exposes the following members.

Constructors
  NameDescription
Public methodFI16RGB555
Initializes a new instance based on the specified Color.
Top
Properties
  NameDescription
Public propertyBlue
Gets or sets the blue color component.
Public propertyColor
Gets or sets the Color of the structure.
Public propertyGreen
Gets or sets the green color component.
Public propertyRed
Gets or sets the red color component.
Top
Methods
  NameDescription
Public methodCompareTo(Object)
Compares this instance with a specified Object.
Public methodCompareTo(FI16RGB555)
Compares this instance with a specified FI16RGB555 object.
Public methodEquals(Object)
Tests whether the specified object is a FI16RGB555 structure and is equivalent to this FI16RGB555 structure.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(FI16RGB555)
Tests whether the specified FI16RGB555 structure is equivalent to this FI16RGB555 structure.
Public methodGetHashCode
Returns a hash code for this FI16RGB555 structure.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Converts the numeric value of the FI16RGB555 object to its equivalent string representation.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Tests whether two specified FI16RGB555 structures are equivalent.
Public operatorStatic member(Color to FI16RGB555)
Converts the value of a Color structure to a FI16RGB555 structure.
Public operatorStatic member(FI16RGB555 to Color)
Converts the value of a FI16RGB555 structure to a Color structure.
Public operatorStatic memberInequality
Tests whether two specified FI16RGB555 structures are different.
Top
Remarks

For easy integration of the underlying structure into the .NET framework, the FI16RGB555 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 FI16RGB555 structure and my be used in all situations which require an FI16RGB555 type.

Examples
The following code example demonstrates the various conversions between the FI16RGB555 structure and the Color structure.
FI16RGB555 fi16rgb;
// Initialize the structure using a native .NET Color structure.
fi16rgb = new FI16RGB555(Color.Indigo);
// Initialize the structure using the implicit operator.
fi16rgb = Color.DarkSeaGreen;
// Convert the FI16RGB555 instance into a native .NET Color
// using its implicit operator.
Color color = fi16rgb;
// Using the structure's Color property for converting it
// into a native .NET Color.
Color another = fi16rgb.Color;
See Also