ACF $AcfVersion:0$
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | List of all members
icmm::CSubstractiveColorModel Class Reference

Common implementation of the general device-based, substractive color model based on the list of colorants. More...

#include <CSubstractiveColorModel.h>

Inheritance diagram for icmm::CSubstractiveColorModel:
icmm::CSubstractiveColorModelBase ibase::CObservableListBase iser::ISerializable icmm::ISubstractiveColorModel istd::IChangeable icmm::IColorModel icmm::IColorantList istd::IPolymorphic istd::IChangeable istd::IChangeable istd::IPolymorphic istd::IPolymorphic

Classes

struct  ColorantInfo
 

Public Types

typedef CSubstractiveColorModelBase BaseClass
 
typedef CObservableListBase BaseClass2
 
- Public Types inherited from icmm::IColorModel
enum  ModelType {
  MT_HSI , MT_HSV , MT_HSL , MI_YIQ ,
  MI_YUV , MI_YCBCR , MT_RGB , MT_COLORANTS ,
  MT_LUV , MT_LAB , MT_LCH , MT_XYZ ,
  MT_YXY , MI_SPECTRAL , MI_USER = 1024
}
 
enum  ModelClass { MC_DEVICE_DEPENDENT , MC_DEVICE_INDEPENDENT }
 
enum  ColorSpaceClass { CSC_ADDITIVE , CSC_SUBSTRACTIVE , CSC_PERCEPTUAL }
 
- 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 Types inherited from icmm::IColorantList
typedef QString ColorantId
 
typedef QStringList ColorantIds
 
- Public Types inherited from ibase::CObservableListBase
enum  ChangeFlags { CF_ELEMENT_ADDED = 0x382b230 , CF_ELEMENT_REMOVED , CF_ELEMENT_UPDATED , CF_RESET }
 

Public Member Functions

 CSubstractiveColorModel ()
 
 CSubstractiveColorModel (const ColorantIds &colorantIds)
 
 CSubstractiveColorModel (const CSubstractiveColorModel &other)
 
 CSubstractiveColorModel (const ISubstractiveColorModel &other)
 
CSubstractiveColorModeloperator= (const CSubstractiveColorModel &other)
 
bool operator== (const CSubstractiveColorModel &ref) const
 
bool operator!= (const CSubstractiveColorModel &ref) const
 
bool ContainsColorant (const ColorantId &colorantId) const
 Returns true if the colorant with the given ID exists in the color model.
 
bool InsertColorant (const ColorantId &colorantId, ColorantUsage usage, int index=-1)
 Insert a new colorant at the given position.
 
bool RemoveColorant (const ColorantId &colorantId)
 Remove a colorant with the given ID.
 
bool SetColorantUsage (const ColorantId &colorantId, ColorantUsage usage)
 Set a colorant usage for an existing colorant.
 
bool SetColorantId (const ColorantId &colorantId, const ColorantId &newColorantId)
 Set a new ID for an existing colorant.
 
bool AppendColorModel (const ISubstractiveColorModel &other)
 Append colorants from from another model to this one.
 
bool HasProcessColorants () const
 Check if the color model contains process colorants.
 
bool HasEcg () const
 Check if the color model contains ECG colorants.
 
bool HasSpot () const
 Check if the color model contains any spot colors.
 
ColorantIds GetProcessColorants () const
 Get the list of process colors in this color model.
 
ColorantIds GetEcgColorants () const
 Get the list of ECG colorants in this color model.
 
ColorantIds GetSpotColorants () const
 Get the list of spot colors in this color model.
 
virtual std::unique_ptr< ISubstractiveColorModelCreateSubspaceModel (const QStringList &colorantIds) const override
 Create ColorModel of the subspace.
 
virtual ColorantIds GetColorantIds () const override
 Get the list of colorant-IDs.
 
virtual ColorantUsage GetColorantUsage (const ColorantId &colorantId) const override
 Get type of the colorant with the given ID.
 
virtual bool Serialize (iser::IArchive &archive) override
 Load or store state of this object as a archive stream.
 
virtual int GetSupportedOperations () const override
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
 Copy this object from another one.
 
virtual istd::TUniqueInterfacePtr< istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const override
 Make a copy of this object.
 
- Public Member Functions inherited from icmm::CSubstractiveColorModelBase
 CSubstractiveColorModelBase ()
 
const icmm::CTristimulusSpecificationGetPreviewSpec () const
 
void SetPreviewSpec (const ITristimulusSpecification &previewSpec)
 
void SetColorantPreview (const ColorantId &colorantId, const icmm::CLab &preview)
 
virtual ModelType GetModelType () const override
 Gets the type of the color model.
 
virtual ModelClass GetModelClass () const override
 Gets the classification of the color model.
 
virtual ColorSpaceClass GetColorSpaceClass () const override
 Gets the classification of the color space defined by this model.
 
virtual int GetColorSpaceDimensionality () const override
 Gets the dimensionality (number of components) of the color space.
 
virtual const imath::IUnitInfoGetColorSpaceComponentInfo (int componentIndex) const override
 Gets mathematical unit information for a color model component.
 
virtual QString GetColorSpaceComponentName (int componentIndex) const override
 Gets the human-readable name of a color model component.
 
virtual const icmm::IColorTransformationCreateColorTranformation (const IColorModel &otherColorModel, const QByteArray &transformationId=QByteArray()) const override
 Creates a color transformation for conversion to another color model.
 
virtual bool GetColorantVisualInfo (const ColorantId &colorantId, icmm::ICieLabColor &preview) const override
 Get visual information/preview for the given colorant.
 
- Public Member Functions inherited from icmm::IColorModel
virtual IColorSpecification::ConstColorSpecPtr GetSpecification () const
 Gets the color specification for this model, if available.
 
- Public Member Functions inherited from istd::IChangeable
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another 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 ()
 
- Public Member Functions inherited from iser::ISerializable
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data.
 

Static Public Member Functions

static std::unique_ptr< ISubstractiveColorModelCreateSubspaceModelFrom (const CSubstractiveColorModelBase &model, const QStringList &colorantIds)
 
- 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 Types

typedef ibase::TContainer< ColorantInfoColorantInfoList
 
- Protected Types inherited from icmm::CSubstractiveColorModelBase
typedef QMap< ColorantId, icmm::CLabColorantPreviewMap
 Mapping between a colorant and corresponding Lab value for its solid value.
 

Protected Member Functions

int FindColorantIndex (const ColorantId &colorantId) const
 
bool SerializeColorantInfo (iser::IArchive &archive, ColorantInfo &colorantInfo, const iser::CArchiveTag *parentTagPtr) const
 
- 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.
 

Static Protected Member Functions

static icmm::ColorantUsage GetDefaultUsageFromColorantName (const ColorantId &colorantId)
 
static ColorantId GetEcgGreen ()
 
static ColorantId GetEcgOrange ()
 
static ColorantId GetEcgViolet ()
 
static ColorantId GetEcgRed ()
 
static ColorantId GetEcgBlue ()
 
- Static Protected Member Functions inherited from ibase::CObservableListBase
static istd::IChangeable::ChangeSet ElementAddChanges (qsizetype index)
 
static istd::IChangeable::ChangeSet ElementRemoveChanges (qsizetype index)
 
static istd::IChangeable::ChangeSet ElementUpdatedChanges (qsizetype index)
 

Additional Inherited Members

- Static Public Attributes inherited from ibase::CObservableListBase
static const QByteArray CN_INDEX_ID = QByteArrayLiteral("INDEX")
 
- Protected Attributes inherited from icmm::CSubstractiveColorModelBase
icmm::CTristimulusSpecification m_previewSpec
 Tristimulus specification used for all colorants in the color model.
 
ColorantPreviewMap m_colorantPreviewMap
 

Detailed Description

Common implementation of the general device-based, substractive color model based on the list of colorants.

All kinds of colorants (Process, ECG and Spot) can be combined in this color model.

Definition at line 22 of file CSubstractiveColorModel.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 28 of file CSubstractiveColorModel.h.

◆ BaseClass2

typedef CObservableListBase icmm::CSubstractiveColorModel::BaseClass2

Definition at line 29 of file CSubstractiveColorModel.h.

◆ ColorantInfoList

Definition at line 140 of file CSubstractiveColorModel.h.

Constructor & Destructor Documentation

◆ CSubstractiveColorModel() [1/4]

icmm::CSubstractiveColorModel::CSubstractiveColorModel ( )

◆ CSubstractiveColorModel() [2/4]

icmm::CSubstractiveColorModel::CSubstractiveColorModel ( const ColorantIds colorantIds)

◆ CSubstractiveColorModel() [3/4]

icmm::CSubstractiveColorModel::CSubstractiveColorModel ( const CSubstractiveColorModel other)

◆ CSubstractiveColorModel() [4/4]

icmm::CSubstractiveColorModel::CSubstractiveColorModel ( const ISubstractiveColorModel other)

Member Function Documentation

◆ AppendColorModel()

bool icmm::CSubstractiveColorModel::AppendColorModel ( const ISubstractiveColorModel other)

Append colorants from from another model to this one.

Returns
Returns true, if the operation was succesful or false otherwise.

◆ CloneMe()

virtual istd::TUniqueInterfacePtr< istd::IChangeable > icmm::CSubstractiveColorModel::CloneMe ( CompatibilityMode  mode = CM_WITHOUT_REFS) const
overridevirtual

Make a copy of this object.

Returns
new instance or NULL, if this operation is not supported.

Reimplemented from istd::IChangeable.

◆ ContainsColorant()

bool icmm::CSubstractiveColorModel::ContainsColorant ( const ColorantId colorantId) const

Returns true if the colorant with the given ID exists in the color model.

◆ CopyFrom()

virtual bool icmm::CSubstractiveColorModel::CopyFrom ( const istd::IChangeable object,
CompatibilityMode  mode = CM_WITHOUT_REFS 
)
overridevirtual

Copy this object from another one.

Default implementation in istd::IChangeable does nothing.

Reimplemented from icmm::CSubstractiveColorModelBase.

◆ CreateSubspaceModel()

virtual std::unique_ptr< ISubstractiveColorModel > icmm::CSubstractiveColorModel::CreateSubspaceModel ( const QStringList &  colorantIds) const
overridevirtual

Create ColorModel of the subspace.

Implements icmm::ISubstractiveColorModel.

◆ CreateSubspaceModelFrom()

static std::unique_ptr< ISubstractiveColorModel > icmm::CSubstractiveColorModel::CreateSubspaceModelFrom ( const CSubstractiveColorModelBase model,
const QStringList &  colorantIds 
)
static

◆ FindColorantIndex()

int icmm::CSubstractiveColorModel::FindColorantIndex ( const ColorantId colorantId) const
protected

◆ GetColorantIds()

virtual ColorantIds icmm::CSubstractiveColorModel::GetColorantIds ( ) const
overridevirtual

Get the list of colorant-IDs.

Implements icmm::IColorantList.

◆ GetColorantUsage()

virtual ColorantUsage icmm::CSubstractiveColorModel::GetColorantUsage ( const ColorantId colorantId) const
overridevirtual

Get type of the colorant with the given ID.

Implements icmm::IColorantList.

◆ GetDefaultUsageFromColorantName()

static icmm::ColorantUsage icmm::CSubstractiveColorModel::GetDefaultUsageFromColorantName ( const ColorantId colorantId)
staticprotected

◆ GetEcgBlue()

static ColorantId icmm::CSubstractiveColorModel::GetEcgBlue ( )
staticprotected

◆ GetEcgColorants()

ColorantIds icmm::CSubstractiveColorModel::GetEcgColorants ( ) const

Get the list of ECG colorants in this color model.

◆ GetEcgGreen()

static ColorantId icmm::CSubstractiveColorModel::GetEcgGreen ( )
staticprotected

◆ GetEcgOrange()

static ColorantId icmm::CSubstractiveColorModel::GetEcgOrange ( )
staticprotected

◆ GetEcgRed()

static ColorantId icmm::CSubstractiveColorModel::GetEcgRed ( )
staticprotected

◆ GetEcgViolet()

static ColorantId icmm::CSubstractiveColorModel::GetEcgViolet ( )
staticprotected

◆ GetProcessColorants()

ColorantIds icmm::CSubstractiveColorModel::GetProcessColorants ( ) const

Get the list of process colors in this color model.

◆ GetSpotColorants()

ColorantIds icmm::CSubstractiveColorModel::GetSpotColorants ( ) const

Get the list of spot colors in this color model.

◆ GetSupportedOperations()

virtual int icmm::CSubstractiveColorModel::GetSupportedOperations ( ) const
overridevirtual

Get set of flags for supported operations.

See also
SupportedOperations

Reimplemented from icmm::CSubstractiveColorModelBase.

◆ HasEcg()

bool icmm::CSubstractiveColorModel::HasEcg ( ) const

Check if the color model contains ECG colorants.

◆ HasProcessColorants()

bool icmm::CSubstractiveColorModel::HasProcessColorants ( ) const

Check if the color model contains process colorants.

◆ HasSpot()

bool icmm::CSubstractiveColorModel::HasSpot ( ) const

Check if the color model contains any spot colors.

◆ InsertColorant()

bool icmm::CSubstractiveColorModel::InsertColorant ( const ColorantId colorantId,
ColorantUsage  usage,
int  index = -1 
)

Insert a new colorant at the given position.

If a colorant with the same colorant-ID already exists, the method will fail.

Parameters
indexPosition, where the new colorant will be inserted. A negative value means the new colorant will be inserted at the end of the colorant list.

◆ operator!=()

bool icmm::CSubstractiveColorModel::operator!= ( const CSubstractiveColorModel ref) const

◆ operator=()

CSubstractiveColorModel & icmm::CSubstractiveColorModel::operator= ( const CSubstractiveColorModel other)

◆ operator==()

bool icmm::CSubstractiveColorModel::operator== ( const CSubstractiveColorModel ref) const

◆ RemoveColorant()

bool icmm::CSubstractiveColorModel::RemoveColorant ( const ColorantId colorantId)

Remove a colorant with the given ID.

Returns
Returns true, if the operation was succesful or false otherwise.

◆ Serialize()

virtual bool icmm::CSubstractiveColorModel::Serialize ( iser::IArchive archive)
overridevirtual

Load or store state of this object as a archive stream.

Type of operation is depending on archive type.

See also
iser::IArchive

Implements iser::ISerializable.

◆ SerializeColorantInfo()

bool icmm::CSubstractiveColorModel::SerializeColorantInfo ( iser::IArchive archive,
ColorantInfo colorantInfo,
const iser::CArchiveTag parentTagPtr 
) const
protected

◆ SetColorantId()

bool icmm::CSubstractiveColorModel::SetColorantId ( const ColorantId colorantId,
const ColorantId newColorantId 
)

Set a new ID for an existing colorant.

◆ SetColorantUsage()

bool icmm::CSubstractiveColorModel::SetColorantUsage ( const ColorantId colorantId,
ColorantUsage  usage 
)

Set a colorant usage for an existing colorant.


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