raytracer
Parallel Ray Tracer written from scratch (no graphics API).
Loading...
Searching...
No Matches
raytracer::raytracer::Camera Class Reference

#include <camera.h>

Public Member Functions

 Camera ()=default
 Camera (double _screen_left_coord, double _screen_right_coord, double _screen_bottom_coord, double _screen_top_coord, double _focal_length, const common::Vec3 &_origin, const common::Vec3 &_direction, const common::Vec3 &_world_up, int _screen_width_pixels, int _screen_height_pixels, ViewType _view_type, int _color_channels, int _rays_per_pixel, int _max_recursion_depth)
Ray compute_ray_for_pixel (Pixel p) const
 NLOHMANN_DEFINE_TYPE_INTRUSIVE (Camera, screen_left_coord, screen_right_coord, screen_bottom_coord, screen_top_coord, focal_length, origin, direction, world_up, screen_width_pixels, screen_height_pixels, view_type, color_channels, rays_per_pixel, max_recursion_depth) int get_screen_width_pixels() const
int get_screen_height_pixels () const
int get_color_channels () const
int get_rays_per_pixel () const
int get_max_recursion_depth () const

Constructor & Destructor Documentation

◆ Camera() [1/2]

raytracer::raytracer::Camera::Camera ( )
default
Here is the caller graph for this function:

◆ Camera() [2/2]

raytracer::raytracer::Camera::Camera ( double _screen_left_coord,
double _screen_right_coord,
double _screen_bottom_coord,
double _screen_top_coord,
double _focal_length,
const common::Vec3 & _origin,
const common::Vec3 & _direction,
const common::Vec3 & _world_up,
int _screen_width_pixels,
int _screen_height_pixels,
ViewType _view_type,
int _color_channels,
int _rays_per_pixel,
int _max_recursion_depth )

Member Function Documentation

◆ compute_ray_for_pixel()

Ray raytracer::raytracer::Camera::compute_ray_for_pixel ( Pixel p) const
nodiscard

Compute the direction that points to a pixel center (with jitter), from the camera origin.

Parameters
pThe pixel defined by its x and y coordinates in the screen plane.
Returns
The ray with the origin at the camera, pointed towards the pixel.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_color_channels()

int raytracer::raytracer::Camera::get_color_channels ( ) const
inlinenodiscard

Getter for the number of color channels of the rendered image.

Returns
The number of color channels of the rendered image.
Here is the caller graph for this function:

◆ get_max_recursion_depth()

int raytracer::raytracer::Camera::get_max_recursion_depth ( ) const
inlinenodiscard

Getter for the maximum number of times a ray can bounce before tracing stops.

Returns
The maximum number of times a ray can bounce before tracing stops.
Here is the caller graph for this function:

◆ get_rays_per_pixel()

int raytracer::raytracer::Camera::get_rays_per_pixel ( ) const
inlinenodiscard

Getter for the number of rays traced per pixel, whose colors are averaged.

Returns
The number of rays traced per pixel.
Here is the caller graph for this function:

◆ get_screen_height_pixels()

int raytracer::raytracer::Camera::get_screen_height_pixels ( ) const
inlinenodiscard

Getter for the height of the rendered image in pixels.

Returns
The height of the rendered image in pixels.
Here is the caller graph for this function:

◆ NLOHMANN_DEFINE_TYPE_INTRUSIVE()

raytracer::raytracer::Camera::NLOHMANN_DEFINE_TYPE_INTRUSIVE ( Camera ,
screen_left_coord ,
screen_right_coord ,
screen_bottom_coord ,
screen_top_coord ,
focal_length ,
origin ,
direction ,
world_up ,
screen_width_pixels ,
screen_height_pixels ,
view_type ,
color_channels ,
rays_per_pixel ,
max_recursion_depth  ) const
inlinenodiscard

Getter for the width of the rendered image in pixels.

Returns
The width of the rendered image in pixels.
Here is the call graph for this function:

The documentation for this class was generated from the following files: