-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (23 loc) · 703 Bytes
/
Copy pathmain.cpp
File metadata and controls
29 lines (23 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Created by luiz0tavio on 6/23/18.
//
#include <iostream>
#include <memory>
#include "Util/File.hpp"
#include "RayTracing/Data/Data.hpp"
#include "RayTracing/RayTracing.hpp"
int main(int argc, char* argv[])
{
if (argc < 3) {
std::cerr << "Must specify at least 2 parameters!" << std::endl;
return EXIT_FAILURE;
}
auto data = std::make_shared<RayTracing::Data>();
data->loadFromfile(argv[1]);
auto ray_tracing = std::make_unique<RayTracing::RayTracing>(data.get());
ray_tracing->fillColorMap();
auto file = std::make_unique<RayTracing::File>(argv[2]);
file->clearFile();
file->writePPM(ray_tracing->getColorMap());
return EXIT_SUCCESS;
}