source: trunk/packages/vizservers/nanovis/Color.h @ 1970

Last change on this file since 1970 was 434, checked in by mmc, 18 years ago

Added separate controls for outline enable/disable/color, and volume
data enable/disable.

File size: 1.3 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 * Color.h: RGBA color class
4 *
5 * ======================================================================
6 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
7 *           Purdue Rendering and Perceptualization Lab (PURPL)
8 *
9 *  Copyright (c) 2004-2006  Purdue Research Foundation
10 *
11 *  See the file "license.terms" for information on usage and
12 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 * ======================================================================
14 */
15
16#ifndef _COLOR_H_
17#define _COLOR_H_
18
19class Color 
20{
21public:
22        double R;               // Red component
23        double G;               // Green component
24        double B;               // Blue component
25
26        void GetRGB(unsigned char *result);
27        void GetRGB(float *result);
28
29        void SetRGBA(unsigned char *color);
30        void GetRGBA(double opacity, unsigned char *result);
31        Color operator *(Color &other);
32        Color* next;    //pointer to the next color
33
34        Color();
35        Color(double r, double g, double b);
36        Color(const Color& c);
37        Color& operator=(const Color& c);
38        ~Color();
39
40        void LimitColors(); //Limits the color to be in range of 0.0 and 1.0
41        Color operator*(double k);
42        friend Color operator*(double k, Color &other);
43        Color operator+(Color &other);
44};
45
46#endif
Note: See TracBrowser for help on using the repository browser.