Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

Color Struct Reference

Definition of a color. More...

#include <ColorScale.h>

List of all members.

Public Methods

 Color ()
 Color (real c)
 Color (real rr, double gg, double bb)
 Color (const Color &c)
void operator= (const Color &c)
void setColor (const Color &c)
void setColor (real rr, real gg, real bb)
void setColor (real c)
void print (Os out)
void scan (Is in)
bool isBlack ()
bool isGray ()

Public Attributes

real r
real g
real b


Detailed Description

Definition of a color.

NAME: Color - Definition of a color

DESCRIPTION:

The "Color" struct contains a (r,g,b) color, and basic functions.


Constructor & Destructor Documentation

Color::Color ( ) [inline]
 

The default constructor "Color()" creates a color object with default color black (r=g=b=0). In addition, the constructor "Color(float intensity)" creates a color object with specified intensity (r=g=b=intensity), and "Color(float r, float g, float b)" creates a color object with a specified RGB color. Moreover, there is a copy constructor "Color(Color&)".

Color::Color ( real c ) [inline]
 

See documentation of one of the overloaded constructor.

Color::Color ( real rr,
double gg,
double bb ) [inline]
 

See documentation of one of the overloaded constructor.

Color::Color ( const Color & c ) [inline]
 

See documentation of one of the overloaded constructor.


Member Function Documentation

bool Color::isBlack ( ) [inline]
 

returns true if the color is black (r=g=b=0), otherwise it returns false.

bool Color::isGray ( ) [inline]
 

returns true if the current color is a gray level (r=g=b), otherwise it returns false.

void Color::operator= ( const Color & c ) [inline]
 

sets color equal to the right-hand side color.

void Color::print ( Os out ) [inline]
 

void Color::scan ( Is in ) [inline]
 

void Color::setColor ( real c ) [inline]
 

See documentation of one of the overloaded functions.

void Color::setColor ( real rr,
real gg,
real bb ) [inline]
 

See documentation of one of the overloaded functions.

void Color::setColor ( const Color & c ) [inline]
 

sets a specified color based on the RGB value, or on another "Color" object. A special version accepts a single intensity value as input, resulting in a gray level.


Member Data Documentation

real Color::b
 

real Color::g
 

real Color::r
 


The documentation for this struct was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.