~turminal/raytracing

1a6aa742b907066a3c97c1cb25b59c498c539f3d — Bor Grošelj Simić 2 years ago aa20797
flip the image upside down
1 files changed, 1 insertions(+), 1 deletions(-)

M image.ha
M image.ha => image.ha +1 -1
@@ 26,7 26,7 @@ export fn write(h: io::handle, img: image, samples: u32) (size | io::error) = {
	ln += fmt::fprintf(h, "{}\n{}\n{}\n{}\n",
		MAGIC, len(img[0]), len(img), MAXVAL)?;
	let scale = 1.0 / samples: i64: f64;
	for (let i = 0z; i < len(img); i += 1) {
	for (let i = len(img) - 1; i < len(img); i -= 1) {
		for (let j = 0z; j < len(img[0]); j += 1) {
			let c = torgb(img[i][j], scale);
			ln += io::write(h, [c.r, c.g, c.b])?;