mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
37 lines
703 B
C++
37 lines
703 B
C++
#ifndef OUTPUT_H_
|
|
#define OUTPUT_H_
|
|
|
|
#include <Eigen/Core>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
using Eigen::Vector3f;
|
|
using std::string;
|
|
using std::vector;
|
|
|
|
class Output {
|
|
public:
|
|
Output(const Vector3f &bgc, string path, int w, int h)
|
|
: red(vector<float>(w * h, bgc.x())),
|
|
green(vector<float>(w * h, bgc.y())),
|
|
blue(vector<float>(w * h, bgc.z())), path(path), width(w), height(h) {}
|
|
|
|
void write();
|
|
|
|
private:
|
|
int width, height;
|
|
string path;
|
|
vector<float> red;
|
|
vector<float> green;
|
|
vector<float> blue;
|
|
|
|
public:
|
|
void r(int, float);
|
|
float r(int) const;
|
|
void g(int, float);
|
|
float g(int) const;
|
|
void b(int, float);
|
|
float b(int) const;
|
|
};
|
|
|
|
#endif // !OUTPUT_H_
|