9 #include "fwData/config.hpp" 10 #include "fwData/factory/new.hpp" 11 #include "fwData/Object.hpp" 15 fwCampAutoDeclareDataMacro((
fwData)(Color), FWDATA_API);
28 typedef float ColorType;
29 typedef std::array<ColorType, 4> ColorArray;
32 ((::fwData::factory::New< Color >, () ))
34 ((ColorType))((ColorType)(1.0)) ((ColorType) (1.0)) ((ColorType)(
47 FWDATA_API
virtual ~
Color();
50 FWDATA_API
void shallowCopy(
const Object::csptr& _source )
override;
53 FWDATA_API
void cachedDeepCopy(
const Object::csptr& _source, DeepCopyCacheType& cache)
override;
58 ColorArray& getRGBA();
59 const ColorArray& getRGBA()
const;
60 void setRGBA(
const ColorArray& _vRGBA);
63 FWDATA_API
void setRGBA(
const ColorType red,
const ColorType green,
const ColorType blue,
66 const ColorType alpha = 1.0 );
70 FWDATA_API
void setRGBA( std::string hexaColor );
77 FWDATA_API ColorType& red();
78 FWDATA_API ColorType& green();
79 FWDATA_API ColorType& blue();
80 FWDATA_API ColorType& alpha();
86 FWDATA_API
const ColorType& red()
const;
87 FWDATA_API
const ColorType& green()
const;
88 FWDATA_API
const ColorType& blue()
const;
89 FWDATA_API
const ColorType& alpha()
const;
94 FWDATA_API
static sptr ColorFactory(ColorType red, ColorType green, ColorType blue, ColorType alpha);
105 return this->m_vRGBA;
112 return this->m_vRGBA;
119 this->m_vRGBA = _vRGBA;
#define fwCoreClassDefinitionsWithNFactoriesMacro(_classinfo_, _factories_args_)
Generate common construction methods for classes with several factories.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
ColorArray m_vRGBA
RGBA of the image (in terms of points)
This class defines color object.
void setRGBA(const ColorArray &_vRGBA)
Base class for each data object.
Contains the representation of the data objects used in the framework.