29 using Ptr = std::shared_ptr<Colormap>;
30 using ConstPtr = std::shared_ptr<const Colormap>;
55 const double max = n - 1;
56 for(
int i = 0; i < n; i++)
58 result->colors.emplace_back(i / max);
68 result->name =
"0 is white";
71 const double max = n - 1;
72 for(
int i = 0; i < n; i++)
74 result->colors.emplace_back((max - i) / max);
80 [[nodiscard]]
Ptr clone()
const {
return std::make_shared<Colormap>(*
this); }
114 using Ptr = std::shared_ptr<Colormappable>;
147 using Ptr = std::shared_ptr<ColormapProvider>;
158 using Ptr = std::shared_ptr<ColormapHelperBase>;
Definition colormappable.hh:156
Colormap::Ptr getOriginalColormap() override
Definition colormap-helpers.cc:28
int getNumberOfColors() override
Definition colormap-helpers.cc:30
Colormap::Ptr getColormap() override
Definition colormap-helpers.cc:42
Colormap::Ptr originalColormap
Definition colormappable.hh:162
void setMonochromeColor(const Color &c) override
Definition colormap-helpers.cc:34
Color getMonochromeColor() override
Definition colormap-helpers.cc:32
virtual std::map< std::string, std::string > getProperties()=0
void setColormap(Colormap::Ptr colormap) override
Definition colormap-helpers.cc:24
virtual void setOriginalColormap(Colormap::Ptr colormap)
Definition colormap-helpers.cc:26
std::shared_ptr< ColormapHelperBase > Ptr
Definition colormappable.hh:158
bool getTransparentBackground() override
Definition colormap-helpers.cc:40
static void OperationNotSupported()
Definition colormap-helpers.cc:44
void disableTransparentBackground() override
Definition colormap-helpers.cc:38
Colormap::Ptr colormap
Definition colormappable.hh:161
void setTransparentBackground() override
Definition colormap-helpers.cc:36
Definition colormappable.hh:195
static Ptr create(int numberOfColors)
Definition colormap-helpers.cc:51
static Ptr createInverted(int numberOfColors)
Definition colormap-helpers.cc:53
std::map< std::string, std::string > getProperties() override
Definition colormap-helpers.cc:63
Definition colormappable.hh:145
std::shared_ptr< ColormapProvider > Ptr
Definition colormappable.hh:147
virtual Colormap::Ptr getColormap()=0
Definition colormappable.hh:27
void setAlpha(double alpha)
Definition colormappable.hh:82
std::vector< Color > colors
Definition colormappable.hh:35
Ptr clone() const
Definition colormappable.hh:80
Ptr setAlpha(double alpha) const
Definition colormappable.hh:90
std::string name
Definition colormappable.hh:34
static Colormap::Ptr createDefaultInverted(int n)
Definition colormappable.hh:65
static Colormap::Ptr create()
Definition colormappable.hh:46
std::weak_ptr< Colormap > WeakPtr
Definition colormappable.hh:31
std::shared_ptr< const Colormap > ConstPtr
Definition colormappable.hh:30
std::shared_ptr< Colormap > Ptr
Definition colormappable.hh:29
Colormap()
Definition colormappable.hh:39
static Colormap::Ptr createDefault(int n)
Definition colormappable.hh:49
Definition colormappable.hh:112
virtual Colormap::Ptr getOriginalColormap()=0
virtual int getNumberOfColors()=0
virtual void setTransparentBackground()=0
std::shared_ptr< Colormappable > Ptr
Definition colormappable.hh:114
virtual Color getMonochromeColor()=0
virtual void disableTransparentBackground()=0
std::weak_ptr< Colormappable > WeakPtr
Definition colormappable.hh:115
virtual void setColormap(Colormap::Ptr colormap)=0
virtual void setMonochromeColor(const Color &c)=0
virtual bool getTransparentBackground()=0
Definition interface.hh:11
Definition colormappable.hh:208
std::map< std::string, std::string > getProperties() override
Definition colormap-helpers.cc:145
int numberOfColors
Definition colormappable.hh:231
static Ptr create(int numberOfColors)
Definition colormap-helpers.cc:68
Color getMonochromeColor() override
Definition colormap-helpers.cc:102
void setTransparentBackground() override
Definition colormap-helpers.cc:131
void setMonochromeColor(const Color &c) override
Definition colormap-helpers.cc:88
void disableTransparentBackground() override
Definition colormap-helpers.cc:137
Color blackish
Definition colormappable.hh:233
void regenerateColormap()
Definition colormap-helpers.cc:104
bool transparentBackground
Definition colormappable.hh:235
static Colormap::Ptr generateInitialColormap(int numberOfColors, bool inverted)
Definition colormap-helpers.cc:126
static Ptr createInverted(int numberOfColors)
Definition colormap-helpers.cc:73
bool getTransparentBackground() override
Definition colormap-helpers.cc:143
Color whitish
Definition colormappable.hh:234
bool inverted
Definition colormappable.hh:232
Colormap::Ptr const colormap
Definition colormaphelpers_test.cc:55
const std::string TRANSPARENT_BACKGROUND_PROPERTY_NAME
Definition colormappable.hh:21
const std::string COLORMAPPABLE_PROPERTY_NAME
Definition colormappable.hh:19
const std::string MONOCHROME_COLORMAPPABLE_PROPERTY_NAME
Definition colormappable.hh:20
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94