Skip to content
Snippets Groups Projects
Image.h 728 B
Newer Older
Postea's avatar
Postea committed
#pragma once
Yoel's avatar
Yoel committed
#include <vector>

#include "../camera/CamObs.h"
#include "../tools/Vec3.h"
Postea's avatar
Postea committed
#include "Sampler.h"

namespace util {
class Image {
Yoel's avatar
Yoel committed
   public:
	Image(int width, int height);
	void setPixel(int x, int y, Vec3 color);
	void setPixels(size_t threadcount, std::shared_ptr<Sampler> sampler);
Postea's avatar
Postea committed

Yoel's avatar
Yoel committed
	Vec3 operator[](const std::array<int, 2>& i) const;  // int x, int y
	Vec3& operator[](const std::array<int, 2>& i);
Postea's avatar
Postea committed

Yoel's avatar
Yoel committed
	const int width;
	const int height;
Postea's avatar
Postea committed

   protected:
	void setPixelsTask(int x, int y, std::shared_ptr<Sampler> sampler);

Yoel's avatar
Yoel committed
   private:
Postea's avatar
Postea committed

Image raytrace(size_t threadcount, const cam::CamObs& cam,
               const std::shared_ptr<Sampler>& sampler, size_t n);
Postea's avatar
Postea committed

Yoel's avatar
Yoel committed
}  // namespace util