-
Notifications
You must be signed in to change notification settings - Fork 0
/
Color.h
40 lines (31 loc) · 865 Bytes
/
Color.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*----------------------------------------------------------
* COSC363 Ray Tracer
*
* The color class
* A simple colour class with a set of operations including
* phong lighting.
-------------------------------------------------------------*/
#ifndef H_COLOR
#define H_COLOR
class Color
{
public:
float r, g, b;
static const Color WHITE;
static const Color BLACK;
static const Color RED;
static const Color GREEN;
static const Color BLUE;
static const Color GRAY;
Color()
: r(1), g(1), b(1)
{} ;
Color(float rCol, float gCol, float bCol)
: r(rCol), g(gCol), b(bCol)
{} ;
void scaleColor(float scaleFactor);
void combineColor(Color col);
void combineColor(Color col, float scaleFactor);
Color phongLight(Color ambientCol, float diffuseTerm, float specularTerm);
};
#endif