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

Interface for color space specification information. More...

#include <IColorSpecification.h>

Inheritance diagram for icmm::IColorSpecification:
iser::IObject iser::ISerializable istd::IChangeable istd::IPolymorphic icmm::ISpectralColorSpecification icmm::ITristimulusSpecification icmm::CSpectralColorSpecificationBase icmm::CTristimulusSpecification

Public Types

enum  SpecType { Tristimulus , Spectral }
 
typedef std::shared_ptr< const IColorSpecificationConstColorSpecPtr
 
typedef std::shared_ptr< IColorSpecificationColorSpecPtr
 
- 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
 

Public Member Functions

 I_DECLARE_ENUM (SpecType, Tristimulus, Spectral)
 
virtual SpecType GetSpecificationType () const =0
 Gets the logical type of the specification.
 
- 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

- 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 color space specification information.

Purpose

IColorSpecification provides metadata about how a color space is defined. This includes information about the reference white point, color primaries (for RGB), viewing conditions, and other parameters needed for accurate color reproduction and conversion between color spaces.

Specification Types

Color specifications fall into two categories:

Tristimulus-based (SpecType::Tristimulus):**

Usage Examples

// Example 1: Checking specification type
void InspectSpecification(const icmm::IColorSpecification* spec)
{
switch (type) {
qDebug() << "Tristimulus-based (e.g., RGB)";
// Can cast to ITristimulusSpecification
break;
qDebug() << "Spectral-based (full spectrum)";
// Can cast to ISpectralColorSpecification
break;
}
}
// Example 2: Working with RGB specifications
{
if (spec && spec->GetSpecificationType() ==
{
// Can use tristimulus-specific operations
dynamic_cast<const icmm::ITristimulusSpecification*>(spec.get());
if (tristim) {
// Access primaries, white point, gamma, etc.
icmm::CVarColor whitePoint = tristim->GetWhitePoint();
}
}
}
// Example 3: Comparing specifications
bool SpecificationsMatch(IColorSpecification::ConstColorSpecPtr spec1,
{
if (!spec1 || !spec2) {
return spec1 == spec2; // Both null or one null
}
// Different types don't match
if (spec1->GetSpecificationType() != spec2->GetSpecificationType()) {
return false;
}
// Would need type-specific comparison
// ...
return false;
}
// Example 4: Creating color with specification
icmm::IColorObject* CreateColorWithSpec(
const icmm::CVarColor& colorValue,
{
// Create appropriate color object based on specification
if (spec) {
switch (spec->GetSpecificationType()) {
// Create RGB color with specification
// return new CRgbColor(colorValue, spec);
break;
// Create spectral color with specification
// return new CSpectralColor(colorValue, spec);
break;
}
}
return nullptr;
}
// Example 5: Specification-aware conversion
bool CanConvertAccurately(IColorSpecification::ConstColorSpecPtr sourceSpec,
{
// Spectral -> Tristimulus: Always possible, may lose info
if (sourceSpec && sourceSpec->GetSpecificationType() ==
return true;
}
// Tristimulus -> Tristimulus: Depends on gamuts
if (sourceSpec && destSpec &&
sourceSpec->GetSpecificationType() == IColorSpecification::SpecType::Tristimulus &&
destSpec->GetSpecificationType() == IColorSpecification::SpecType::Tristimulus) {
// Check if gamuts overlap
return true; // Simplified
}
return false;
}
Generic color implementation with variable number of color components.
Definition CVarColor.h:176
Common interface for color objects in the ACF color management system.
Interface for color space specification information.
@ Tristimulus
Tristimulus-based specification (e.g., RGB with primaries and white point).
@ Spectral
Spectral-based specification (full wavelength representation).
virtual SpecType GetSpecificationType() const =0
Gets the logical type of the specification.
std::shared_ptr< const IColorSpecification > ConstColorSpecPtr
Interface for tristimulus-based color specifications.

Common Specifications

RGB Specifications:**

Best Practices

See also
icmm::ITristimulusSpecification, icmm::ISpectralColorSpecification, icmm::IColorModel, icmm::IWhitePointProvider

Definition at line 167 of file IColorSpecification.h.

Member Typedef Documentation

◆ ColorSpecPtr

Definition at line 171 of file IColorSpecification.h.

◆ ConstColorSpecPtr

Definition at line 170 of file IColorSpecification.h.

Member Enumeration Documentation

◆ SpecType

Enumerator
Tristimulus 

Tristimulus-based specification (e.g., RGB with primaries and white point).

Spectral 

Spectral-based specification (full wavelength representation).

Definition at line 173 of file IColorSpecification.h.

Member Function Documentation

◆ GetSpecificationType()

virtual SpecType icmm::IColorSpecification::GetSpecificationType ( ) const
pure virtual

Gets the logical type of the specification.

Returns whether this is a tristimulus-based specification (3 values like RGB) or a spectral-based specification (full wavelength distribution).

Returns
SpecType indicating Tristimulus or Spectral
See also
SpecType

Implemented in icmm::ISpectralColorSpecification, and icmm::ITristimulusSpecification.

◆ I_DECLARE_ENUM()

icmm::IColorSpecification::I_DECLARE_ENUM ( SpecType  ,
Tristimulus  ,
Spectral   
)

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