-
Notifications
You must be signed in to change notification settings - Fork 1
/
Matte.h
61 lines (40 loc) · 1.03 KB
/
Matte.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef __MATTE__
#define __MATTE__
#include "Material.h"
#include "Lambertian.h"
class Matte: public Material {
public:
Matte(void);
Matte(const Matte& m);
virtual Material* clone(void) const;
Matte& operator= (const Matte& rhs);
~Matte();
void set_ka(const float k);
void set_kd(const float k);
void set_cd(const RGBColor c);
void set_cd(const float r, const float g, const float b);
void set_cd(const float c);
virtual RGBColor shade(ShadeRec& sr);
private:
Lambertian* ambient_brdf;
Lambertian* diffuse_brdf;
};
inline void Matte::set_ka(const float ka) {
ambient_brdf->set_kd(ka);
}
inline void Matte::set_kd(const float kd) {
diffuse_brdf->set_kd(kd);
}
inline void Matte::set_cd(const RGBColor c) {
ambient_brdf->set_cd(c);
diffuse_brdf->set_cd(c);
}
inline void Matte::set_cd(const float r, const float g, const float b) {
ambient_brdf->set_cd(r, g, b);
diffuse_brdf->set_cd(r, g, b);
}
inline void Matte::set_cd(const float c) {
ambient_brdf->set_cd(c);
diffuse_brdf->set_cd(c);
}
#endif