ACF $AcfVersion:0$
Public Member Functions | List of all members
icmm::IRgbColor Class Referenceabstract

Interface for RGB color objects with specification support. More...

#include <IRgbColor.h>

Inheritance diagram for icmm::IRgbColor:
icmm::IColorObject iser::IObject iser::ISerializable istd::IChangeable istd::IPolymorphic icmm::CRgbColor icmm::CSRgbColor

Public Member Functions

virtual const icmm::CRgbGetRgb () const =0
 
virtual IColorSpecification::ConstColorSpecPtr GetSpecification () const =0
 
- Public Member Functions inherited from icmm::IColorObject
virtual icmm::CVarColor GetColor () const =0
 Gets the generic color value representation.
 
virtual ConstColorModelPtr GetColorModel () const =0
 Gets the associated color model.
 
virtual std::unique_ptr< IColorObjectCloneIntoUniquePtr () const =0
 Creates an independent copy of the color object.
 
- Public Member Functions inherited from iser::IObject
virtual QByteArray GetFactoryId () const
 
- Public Member Functions inherited from iser::ISerializable
virtual bool Serialize (IArchive &archive)=0
 Load or store state of this object as a archive stream.
 
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data.
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual istd::TUniqueInterfacePtr< istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Additional Inherited Members

- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING ,
  CF_DELEGATED , CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 ,
  SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 
typedef QMultiMap< QByteArray, QVariant > ChangeInfoMap
 
- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event.
 

Detailed Description

Interface for RGB color objects with specification support.

Purpose

IRgbColor extends IColorObject to provide specific support for RGB colors. It guarantees access to RGB component values and optionally provides color specification information (white point, primaries, gamma) for device-independent color management.

Usage Examples

// Example 1: Accessing RGB values from color object
void ProcessRgbColorObject(const icmm::IRgbColor* rgbColor)
{
// Get RGB values
const icmm::CRgb& rgb = rgbColor->GetRgb();
double red = rgb.GetRed();
double green = rgb.GetGreen();
double blue = rgb.GetBlue();
qDebug() << "RGB:" << red << green << blue;
}
// Example 2: Checking color specification
void CheckColorSpecification(const icmm::IRgbColor* rgbColor)
{
// Get specification if available
rgbColor->GetSpecification();
if (spec) {
// Has specification (e.g., sRGB, Adobe RGB)
// Can use for accurate color management
} else {
// No specification - generic RGB
}
}
// Example 3: Polymorphic RGB handling
void ConvertToGrayscale(icmm::IRgbColor* rgbColor)
{
const icmm::CRgb& rgb = rgbColor->GetRgb();
// Perceptual grayscale conversion
double gray = 0.2126 * rgb.GetRed() +
0.7152 * rgb.GetGreen() +
0.0722 * rgb.GetBlue();
// Could update color if interface allowed
qDebug() << "Grayscale value:" << gray;
}
// Example 4: Type-safe color operations
bool IsRgbColorBright(const icmm::IColorObject* colorObj)
{
// Try to cast to RGB color
const icmm::IRgbColor* rgbColor =
dynamic_cast<const icmm::IRgbColor*>(colorObj);
if (rgbColor) {
const icmm::CRgb& rgb = rgbColor->GetRgb();
double brightness = (rgb.GetRed() + rgb.GetGreen() + rgb.GetBlue()) / 3.0;
return brightness > 0.5;
}
return false; // Not an RGB color
}
Primitive for representation of RGB color values.
Definition CRgb.h:168
double GetBlue() const
Definition CRgb.h:256
double GetGreen() const
Definition CRgb.h:244
double GetRed() const
Definition CRgb.h:232
Common interface for color objects in the ACF color management system.
std::shared_ptr< const IColorSpecification > ConstColorSpecPtr
Interface for RGB color objects with specification support.
Definition IRgbColor.h:98
virtual IColorSpecification::ConstColorSpecPtr GetSpecification() const =0
virtual const icmm::CRgb & GetRgb() const =0

Color Specifications

IRgbColor can provide optional color specification information:

See also
icmm::IColorObject, icmm::CRgb, icmm::CRgbColor, icmm::CSRgbColor, icmm::IColorSpecification

Definition at line 97 of file IRgbColor.h.

Member Function Documentation

◆ GetRgb()

virtual const icmm::CRgb & icmm::IRgbColor::GetRgb ( ) const
pure virtual

Implemented in icmm::CRgbColor.

◆ GetSpecification()

virtual IColorSpecification::ConstColorSpecPtr icmm::IRgbColor::GetSpecification ( ) const
pure virtual

Implemented in icmm::CRgbColor.


The documentation for this class was generated from the following file: