camera.h
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   camera.h                                           :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <gychoi@student.42seoul.kr>         +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2023/05/18 19:43:38 by gychoi            #+#    #+#             */
 9  /*   Updated: 2023/05/18 19:58:43 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #ifndef CAMERA_H
14  # define CAMERA_H
15  
16  typedef struct s_camera
17  {
18  	t_point3	orig;
19  	double		viewport_h;
20  	double		viewport_w;
21  	t_vec3		horizontal;
22  	t_vec3		vertical;
23  	double		focal_len;
24  	t_point3	left_bottom;
25  }	t_camera;
26  
27  typedef struct s_canvas
28  {
29  	int		width;
30  	int		height;
31  	double	aspect_ratio;
32  }	t_canvas;
33  
34  t_canvas	canvas(int width, int height);
35  t_camera	camera(t_canvas canvas, t_point3 orig);
36  
37  #endif