source: trunk/gui/vizservers/nanovis/Color.h @ 425

Last change on this file since 425 was 379, checked in by qiaow, 18 years ago

Hooked a simple transfer function editor GUI to the render engine.

File size: 1.2 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
37        void LimitColors(); //Limits the color to be in range of 0.0 and 1.0
38        Color operator*(double k);
39        friend Color operator*(double k, Color &other);
40        Color operator+(Color &other);
41        ~Color();
42        float r, g, b, a;
43};
44
45#endif
Note: See TracBrowser for help on using the repository browser.