ACF $AcfVersion:0$
CRgbColor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <icmm/CRgb.h>
7#include <icmm/IColorModel.h>
8#include <icmm/IRgbColor.h>
10
11
12namespace icmm
13{
14
15
16class CRgbColor: virtual public IRgbColor
17{
18public:
22 CRgbColor(const icmm::CRgb& rgb, ColorModelPtr modelPtr);
23
27 CRgbColor(const icmm::CRgb& rgb);
28
30
31 // reimplemented (icmm::IRgbColor)
32 virtual const icmm::CRgb& GetRgb() const override;
34
35 // reimplemented (icmm::IColorObject)
36 virtual icmm::CVarColor GetColor() const override;
37 virtual ConstColorModelPtr GetColorModel() const override;
38 virtual std::unique_ptr<IColorObject> CloneIntoUniquePtr() const override;
39
40 // reimplemented (iser::ISerializable)
41 virtual bool Serialize(iser::IArchive& archive) override;
42
43private:
44 icmm::CRgb m_rgb;
45 std::shared_ptr<IColorModel> m_modelPtr;
46};
47
48
49} // namespace icmm
50
51
virtual ConstColorModelPtr GetColorModel() const override
Gets the associated color model.
virtual std::unique_ptr< IColorObject > CloneIntoUniquePtr() const override
Creates an independent copy of the color object.
virtual IColorSpecification::ConstColorSpecPtr GetSpecification() const override
CRgbColor(const icmm::CRgb &rgb, ColorModelPtr modelPtr)
Takes a ColorModel (if you want to get particular about the color specification)
CRgbColor(const icmm::CRgb &rgb)
Just pass RGB-values; defaults the ColorModel to D50/2D.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
void SetSpecification(const ITristimulusSpecification &spec)
virtual const icmm::CRgb & GetRgb() const override
virtual icmm::CVarColor GetColor() const override
Gets the generic color value representation.
Primitive for representation of RGB color values.
Definition CRgb.h:168
Generic color implementation with variable number of color components.
Definition CVarColor.h:176
std::shared_ptr< const IColorSpecification > ConstColorSpecPtr
Interface for RGB color objects with specification support.
Definition IRgbColor.h:98
Interface for tristimulus-based color specifications.
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Contains color management classes.
std::shared_ptr< const IColorModel > ConstColorModelPtr
std::shared_ptr< IColorModel > ColorModelPtr