-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.hpp
38 lines (30 loc) · 889 Bytes
/
camera.hpp
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
#pragma once
#include "color.hpp"
#include "objects/object.hpp"
class camera {
int image_height;
point3 camera_center;
point3 pixel00_loc;
vec3 pixel_delta_u;
vec3 pixel_delta_v;
vec3 u, v, w;
vec3 defocus_disk_u, defocus_disk_v;
void initialize();
color ray_color(const ray& r, int depth, const object& world) const;
ray get_ray(int i, int j) const;
vec3 pixel_sample_square() const;
point3 defocus_disk_sample() const;
public:
double aspect_ratio = 1;
int image_width = 100;
int samples_per_pixel = 10;
std::string filename = "image.ppm";
int max_depth = 10;
double vfov = 90;
point3 lookfrom = point3(0, 0, -1);
point3 lookat = point3(0, 0, 0);
vec3 vup = vec3(0, 1, 0);
double defocus_angle = 0;
double focus_dist = 10;
void render(const object& scene, bool verbose = false);
};