Move rendering logic into camera module

This commit is contained in:
2025-09-23 15:36:08 +01:00
parent f934cc8fa8
commit 3687723153
3 changed files with 69 additions and 56 deletions

View File

@@ -1,6 +1,8 @@
#ifndef CAMERA_H
#define CAMERA_H
#include "img.h"
#include "obj.h"
#include "vec3.h"
#include <stdint.h>
@@ -8,10 +10,15 @@
typedef struct {
vec3_t pos;
vec3_t pix_origin, x_step, y_step;
uint32_t img_width, img_height;
} camera_t;
camera_t camera_init(
vec3_t pos, double focal_len, double viewport_height, uint32_t img_width,
uint32_t img_height);
void camera_render(
const camera_t *camera, const obj_t *scene, unsigned scene_count,
img_t *img_out);
#endif