13 #ifndef mitkColorProperty_h
14 #define mitkColorProperty_h
19 #include <itkRGBPixel.h>
21 #include <nlohmann/json.hpp>
27 #pragma warning(disable : 4522)
38 typedef itk::RGBPixel<float>
Color;
74 itkFactorylessNewMacro(Self);
86 void SetColor(
float red,
float green,
float blue);
91 using BaseProperty::operator=;
97 itk::LightObject::Pointer InternalClone()
const override;
99 bool IsEqual(
const BaseProperty &property)
const override;
111 template <
typename TComponent>
114 j = nlohmann::json::array();
116 for (
size_t i = 0; i < 3; ++i)
120 template <
typename TComponent>
123 for (
size_t i = 0; i < 3; ++i)
124 j.at(i).get_to(c[i]);
Abstract base class for properties.
The ColorProperty class RGB color property.
const mitk::Color & GetColor() const
mitkNewMacro3Param(ColorProperty, const float, const float, const float)
ColorProperty(const float color[3])
void SetColor(float red, float green, float blue)
std::string GetValueAsString() const override
void SetValue(const mitk::Color &color)
ColorProperty(const ColorProperty &other)
mitkClassMacro(ColorProperty, BaseProperty)
bool FromJSON(const nlohmann::json &j) override
Deserialize property value(s) from JSON.
bool ToJSON(nlohmann::json &j) const override
Serialize property value(s) to JSON.
void SetColor(const mitk::Color &color)
ColorProperty(const float red, const float green, const float blue)
ColorProperty(const mitk::Color &color)
mitkNewMacro1Param(ColorProperty, const mitk::Color &)
const mitk::Color & GetValue() const
#define mitkNewMacro1Param(classname, type)
void from_json(const nlohmann::json &j, RGBPixel< TComponent > &c)
void to_json(nlohmann::json &j, const RGBPixel< TComponent > &c)
Find image slices visible on a given plane.
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Color MakeColor(float r, float g, float b)