ColorType Class Reference

An RGB triplet. More...

#include <ColorType.h>

List of all members.

Public Member Functions

 ColorType (unsigned int r, unsigned int g, unsigned int b, unsigned int a=255)
 ColorType ()
 ~ColorType ()
BROKEN_INLINE_HINT ColorTypeoperator= (const ColorType &color)
bool operator!= (const ColorType &color) const
bool operator== (const ColorType &color) const
bool isValid () const

Static Public Member Functions

static ColorType getUniqueColor (const std::vector< ColorType > &excludedColors)
static unsigned int getUniqueColors (unsigned int count, std::vector< ColorType > &colors, const std::vector< ColorType > &excludeColors)

Public Attributes

int mRed
int mGreen
int mBlue
int mAlpha

Related Functions

(Note that these are not member functions.)

 COLORTYPE_TO_QCOLOR(colorType)
 QCOLOR_TO_COLORTYPE(qcolor)


Detailed Description

An RGB triplet.

Definition at line 50 of file ColorType.h.


Constructor & Destructor Documentation

ColorType::ColorType ( unsigned int  r,
unsigned int  g,
unsigned int  b,
unsigned int  a = 255 
)

Creates a ColorType object with given RGB values.

Valid RGB values range from 0 to 255.

Parameters:
r The red value.
g The green value.
b The blue value.
a The alpha (opacity) value.

Definition at line 67 of file ColorType.h.

ColorType::ColorType (  ) 

Creates an invalid ColorType object.

Definition at line 72 of file ColorType.h.

ColorType::~ColorType (  ) 

Destructor.

Definition at line 77 of file ColorType.h.


Member Function Documentation

static ColorType ColorType::getUniqueColor ( const std::vector< ColorType > &  excludedColors  )  [static]

Returns a unique color that is farthest away in color space from given colors.

Parameters:
excludedColors The colors from which the unique color is calculated.
Returns:
A color that is as different as possible from the given exclusion color.

Definition at line 89 of file ColorType.h.

static unsigned int ColorType::getUniqueColors ( unsigned int  count,
std::vector< ColorType > &  colors,
const std::vector< ColorType > &  excludeColors 
) [static]

Generates one or more colors that are unique to each other.

Parameters:
count The requested number of colors to generate.
colors A vector that is populated with the generated colors.
excludeColors Colors that should not be included in the generated colors.
Returns:
The number of unique colors that were generated.

Definition at line 199 of file ColorType.h.

BROKEN_INLINE_HINT ColorType& ColorType::operator= ( const ColorType color  ) 

Definition at line 288 of file ColorType.h.

bool ColorType::operator!= ( const ColorType color  )  const

Definition at line 301 of file ColorType.h.

bool ColorType::operator== ( const ColorType color  )  const

Definition at line 311 of file ColorType.h.

bool ColorType::isValid (  )  const

Queries the color for its validity.

A valid color has RGB values ranging from 0 to 255.

Returns:
TRUE if the color is valid, otherwise FALSE.

Definition at line 328 of file ColorType.h.


Friends And Related Function Documentation

COLORTYPE_TO_QCOLOR ( colorType   )  [related]

Converts a ColorType to a QColor.

Parameters:
colorType The ColorType to convert to a QColor. If an invalid ColorType is passed in, an invalid QColor will be created.
See also:
ColorType::isValid()

Definition at line 30 of file ColorType.h.

QCOLOR_TO_COLORTYPE ( qcolor   )  [related]

Converts a QColor to a ColorType.

Parameters:
qcolor The QColor to convert to a ColorType. If an invalid QColor is passed in, an invalid ColorType will be created.
See also:
ColorType::isValid()

Definition at line 44 of file ColorType.h.


Member Data Documentation

Definition at line 341 of file ColorType.h.

Definition at line 342 of file ColorType.h.

Definition at line 343 of file ColorType.h.

Definition at line 344 of file ColorType.h.


Software Development Kit - Opticks 4.9.0 Build 16218