The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Graphics.ColorFormat Struct Reference

Defines the ColorFormat component of a GraphicsMode. More...

Inherits IComparable< ColorFormat >.

Public Member Functions

 ColorFormat (int bpp)
 Constructs a new ColorFormat with the specified aggregate bits per pixel. More...
 
 ColorFormat (int red, int green, int blue, int alpha)
 Constructs a new ColorFormat with the specified bits per pixel for the Red, Green, Blue and Alpha color channels. More...
 
int CompareTo (ColorFormat other)
 Compares two instances. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 
override string ToString ()
 Returns a System.String that describes this instance. More...
 

Static Public Member Functions

static implicit operator ColorFormat (int bpp)
 Converts the specified bpp into a new ColorFormat. More...
 
static bool operator== (ColorFormat left, ColorFormat right)
 Compares two instances for equality. More...
 
static bool operator!= (ColorFormat left, ColorFormat right)
 Compares two instances for inequality. More...
 
static bool operator> (ColorFormat left, ColorFormat right)
 Compares two instances for inequality. More...
 
static bool operator>= (ColorFormat left, ColorFormat right)
 Compares two instances for inequality. More...
 
static bool operator< (ColorFormat left, ColorFormat right)
 Compares two instances for inequality. More...
 
static bool operator<= (ColorFormat left, ColorFormat right)
 Compares two instances for inequality. More...
 

Public Attributes

byte red
 
byte green
 
byte blue
 
byte alpha
 
bool isIndexed
 
int bitsPerPixel
 

Static Public Attributes

static readonly ColorFormat Empty = new ColorFormat(0)
 

Properties

int Red [get, set]
 Gets the bits per pixel for the Red channel. More...
 
int Green [get, set]
 Gets the bits per pixel for the Green channel. More...
 
int Blue [get, set]
 Gets the bits per pixel for the Blue channel. More...
 
int Alpha [get, set]
 Gets the bits per pixel for the Alpha channel. More...
 
bool IsIndexed [get, set]
 Gets a System.Boolean indicating whether this ColorFormat is indexed. More...
 
int BitsPerPixel [get, set]
 Gets the sum of Red, Green, Blue and Alpha bits per pixel. More...
 

Detailed Description

Defines the ColorFormat component of a GraphicsMode.

A ColorFormat contains Red, Green, Blue and Alpha components that descibe the allocated bits per pixel for the corresponding color.

Constructor & Destructor Documentation

OpenTK.Graphics.ColorFormat.ColorFormat ( int  bpp)

Constructs a new ColorFormat with the specified aggregate bits per pixel.

Parameters
bppThe bits per pixel sum for the Red, Green, Blue and Alpha color channels.
OpenTK.Graphics.ColorFormat.ColorFormat ( int  red,
int  green,
int  blue,
int  alpha 
)

Constructs a new ColorFormat with the specified bits per pixel for the Red, Green, Blue and Alpha color channels.

Parameters
redBits per pixel for the Red color channel.
greenBits per pixel for the Green color channel.
blueBits per pixel for the Blue color channel.
alphaBits per pixel for the Alpha color channel.

Member Function Documentation

int OpenTK.Graphics.ColorFormat.CompareTo ( ColorFormat  other)

Compares two instances.

Parameters
otherThe other instance.
Returns
Zero if this instance is equal to other; a positive value if this instance is greater than other; a negative value otherwise.
override bool OpenTK.Graphics.ColorFormat.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Parameters
objAnother object to compare to.
Returns
True if this instance is equal to obj; false otherwise.
override int OpenTK.Graphics.ColorFormat.GetHashCode ( )

Returns the hash code for this instance.

Returns
A System.Int32 with the hash code of this instance.
static implicit OpenTK.Graphics.ColorFormat.operator ColorFormat ( int  bpp)
static

Converts the specified bpp into a new ColorFormat.

Parameters
bppThe bits per pixel to convert.
Returns
A ColorFormat with the specified bits per pixel.
static bool OpenTK.Graphics.ColorFormat.operator!= ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for inequality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if both instances are not equal; false otherwise.
static bool OpenTK.Graphics.ColorFormat.operator< ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for inequality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if left is less than right; false otherwise.
static bool OpenTK.Graphics.ColorFormat.operator<= ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for inequality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if left is less than or equal to right; false otherwise.
static bool OpenTK.Graphics.ColorFormat.operator== ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for equality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if both instances are equal; false otherwise.
static bool OpenTK.Graphics.ColorFormat.operator> ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for inequality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if left is greater than right; false otherwise.
static bool OpenTK.Graphics.ColorFormat.operator>= ( ColorFormat  left,
ColorFormat  right 
)
static

Compares two instances for inequality.

Parameters
leftThe left operand.
rightThe right operand.
Returns
True if left is greater than or equal to right; false otherwise.
override string OpenTK.Graphics.ColorFormat.ToString ( )

Returns a System.String that describes this instance.

Returns
A System.String that describes this instance.

Property Documentation

int OpenTK.Graphics.ColorFormat.Alpha
getset

Gets the bits per pixel for the Alpha channel.

int OpenTK.Graphics.ColorFormat.BitsPerPixel
getset

Gets the sum of Red, Green, Blue and Alpha bits per pixel.

int OpenTK.Graphics.ColorFormat.Blue
getset

Gets the bits per pixel for the Blue channel.

int OpenTK.Graphics.ColorFormat.Green
getset

Gets the bits per pixel for the Green channel.

bool OpenTK.Graphics.ColorFormat.IsIndexed
getset

Gets a System.Boolean indicating whether this ColorFormat is indexed.

int OpenTK.Graphics.ColorFormat.Red
getset

Gets the bits per pixel for the Red channel.