-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColorGenerator.hpp
48 lines (38 loc) · 1.04 KB
/
ColorGenerator.hpp
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef COLORGENERATOR_HPP
#define COLORGENERATOR_HPP
#include "ColorScheme.hpp"
#include "Pixel.hpp"
class ColorGenerator
{
public:
ColorGenerator() {}
virtual ~ColorGenerator() {}
virtual Pixel ToPixel(double real, double imag, uint64_t iteration) const = 0;
virtual ColorGenerator *clone() const = 0;
};
class ColorGradient
: public ColorGenerator
{
public:
ColorGradient(ColorScheme const *colorScheme);
ColorGradient(ColorGradient const &other);
virtual ~ColorGradient();
Pixel ToPixel(double real, double imag, uint64_t iteration) const override;
ColorGenerator *clone() const override;
private:
ColorScheme *colorScheme;
};
class DiscreteColorGradient
: public ColorGenerator
{
public:
DiscreteColorGradient(ColorScheme const *colorScheme, uint32_t paletteSize);
DiscreteColorGradient(DiscreteColorGradient const &other);
virtual ~DiscreteColorGradient();
Pixel ToPixel(double real, double imag, uint64_t iteration) const override;
ColorGenerator *clone() const override;
private:
uint32_t paletteSize;
Pixel *colors;
};
#endif