Raytracer
Loading...
Searching...
No Matches
Textures.hpp
1#include <memory>
2#include "Common.hpp"
3#include "arguments/Kinds.hpp"
4#include "interfaces/IArguments.hpp"
5#include "interfaces/ITexture.hpp"
6#include "utils/VecN.hpp"
7
8#ifndef __ARG_TEXTURES_HPP__
9 #define __ARG_TEXTURES_HPP__
10
11namespace Raytracer::Arguments
12{
14 private:
15 ArgumentKind _kind;
16 Utils::Vec3 _color;
17
18 public:
19 Solid(Utils::Vec3 color) : _color(color)
20 {
21 _kind = ArgumentKind::ARG_SOLID_COLOR;
22 }
23 Solid(double r, double g, double b) : _color(r, g, b)
24 {
25 _kind = ArgumentKind::ARG_SOLID_RGB;
26 }
27 GET_SET(Utils::Vec3, color);
28 ARG_KIND(_kind);
29 };
30
32 private:
33 double _scale;
34
35 public:
36 Noise(double scale) : _scale(scale)
37 {
38 }
39 GET_SET(double, scale);
40 ARG_KIND(ArgumentKind::ARG_NOISE);
41 };
42
44 private:
45 std::string _filename;
46
47 public:
48 Image(std::string filename) : _filename(filename)
49 {
50 }
51 GET_SET(std::string, filename);
52 ARG_KIND(ArgumentKind::ARG_IMAGE);
53 };
54
56 private:
57 ArgumentKind _kind;
58 double _scale;
59 Utils::Vec3 _color1;
60 Utils::Vec3 _color2;
61 std::shared_ptr<Interfaces::ITexture> _texture1 = nullptr;
62 std::shared_ptr<Interfaces::ITexture> _texture2 = nullptr;
63
64 public:
65 Checker(double scale, Utils::Vec3 color1, Utils::Vec3 color2)
66 : _scale(scale), _color1(color1), _color2(color2)
67 {
68 _kind = ArgumentKind::ARG_CHECKER_COLOR;
69 }
70 Checker(double scale, std::shared_ptr<Interfaces::ITexture> texture1,
71 std::shared_ptr<Interfaces::ITexture> texture2)
72 : _scale(scale), _texture1(texture1), _texture2(texture2)
73 {
74 _kind = ArgumentKind::ARG_CHECKER_TEXTURE;
75 }
76 GET_SET(double, scale);
77 GET_SET(Utils::Vec3, color1);
78 GET_SET(Utils::Vec3, color2);
79 GET_SET(std::shared_ptr<Interfaces::ITexture>, texture1);
80 GET_SET(std::shared_ptr<Interfaces::ITexture>, texture2);
81 ARG_KIND(_kind);
82 };
83} // namespace Raytracer::Arguments
84
85#endif /* __ARG_TEXTURES_HPP__ */
Definition Textures.hpp:55
Definition Textures.hpp:43
Definition Textures.hpp:31
Definition Textures.hpp:13
Definition IArguments.hpp:8
Definition VecN.hpp:40