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
|
#include "ViewPlane.h"
#include "Sampler.h"
ViewPlane::ViewPlane(const int h, const int v, const int ns, const int md, const float _s, const float g, const float ig) : hres(h), vres(v), num_samples(ns), max_depth(md), s(_s), gamma(g), inv_gamma(ig), sampler_ptr(NULL) {
}
ViewPlane::ViewPlane(const ViewPlane& vp) : hres(vp.hres), vres(vp.vres), num_samples(vp.num_samples), max_depth(vp.max_depth), s(vp.s), gamma(vp.gamma), inv_gamma(vp.inv_gamma), sampler_ptr(vp.sampler_ptr) {
}
ViewPlane::~ViewPlane(void) {
}
ViewPlane& ViewPlane::operator =(const ViewPlane& vp) {
if (this == &vp) {
return *this;
}
hres = vp.hres;
vres = vp.vres;
num_samples = vp.num_samples;
max_depth = vp.max_depth;
s = vp.s;
gamma = vp.gamma;
inv_gamma = vp.inv_gamma;
return *this;
}
void ViewPlane::set_sampler(Sampler* sp) {
if (sampler_ptr) {
delete sampler_ptr;
sampler_ptr = NULL;
}
num_samples = sp->get_num_samples();
sampler_ptr = sp;
}
|