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

CMYK color model implementation for four-color printing. More...

#include <CCmykColorModel.h>

Inheritance diagram for icmm::CCmykColorModel:
icmm::CCmyColorModel icmm::CSubstractiveColorModelBase icmm::ISubstractiveColorModel icmm::IColorModel icmm::IColorantList istd::IChangeable istd::IChangeable istd::IPolymorphic istd::IPolymorphic

Public Types

typedef CCmyColorModel BaseClass
 
- 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 Member Functions

virtual ColorantIds GetColorantIds () const override
 Get the list of colorant-IDs.
 
virtual icmm::ColorantUsage GetColorantUsage (const ColorantId &colorantId) const override
 Get type of the colorant with the given ID.
 
virtual std::unique_ptr< ISubstractiveColorModelCreateSubspaceModel (const QStringList &colorantIds) const override
 Create ColorModel of the subspace.
 
virtual istd::IChangeableUniquePtr CloneMe (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.
 
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.
 
- 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 ()
 

Static Public Member Functions

static ColorantId GetBlack ()
 Gets the colorant ID for the black (K) component.
 
- Static Public Member Functions inherited from icmm::CCmyColorModel
static ColorantId GetCyan ()
 
static ColorantId GetMagenta ()
 
static ColorantId GetYellow ()
 
- 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.
 

Additional Inherited Members

- 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 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.
 
- 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

CMYK color model implementation for four-color printing.

Purpose

CCmykColorModel extends CCmyColorModel to represent the full CMYK (Cyan, Magenta, Yellow, Black) color model used in printing. The addition of black (K) ink provides better shadow detail, reduced ink consumption, and improved print quality compared to CMY alone.

Design

CCmykColorModel provides:

Usage Examples

// Example 1: Basic CMYK model usage
// Query model properties
IColorModel::ModelType type = cmykModel.GetModelType(); // MT_CMYK
int dims = cmykModel.GetColorSpaceDimensionality(); // 4
// Get colorant IDs
icmm::ColorantIds colorants = cmykModel.GetColorantIds();
// Returns list: ["Cyan", "Magenta", "Yellow", "Black"]
// Example 2: Querying colorant information
void InspectCmykColorants(const icmm::CCmykColorModel& model)
{
icmm::ColorantIds ids = model.GetColorantIds();
for (const icmm::ColorantId& id : ids) {
qDebug() << "Colorant:" << id;
qDebug() << "Usage:" << (int)usage;
// Usage indicates if colorant is process, spot, etc.
}
}
// Example 3: Getting black colorant specifically
icmm::ColorantId GetBlackColorant()
{
// Static method to get black colorant ID
}
// Example 4: Creating subspace models
{
// Create subspace with only CMY (no black)
QStringList cmyColorants;
cmyColorants << "Cyan" << "Magenta" << "Yellow";
std::unique_ptr<icmm::ISubstractiveColorModel> cmyModel =
cmykModel.CreateSubspaceModel(cmyColorants);
return cmyModel.release();
}
// Example 5: Converting RGB to CMYK
void ConvertRgbToCmyk(const icmm::CVarColor& rgb)
{
// Create transformation
const icmm::IColorTransformation* transform =
rgbModel.CreateColorTranformation(cmykModel);
if (transform) {
if (transform->Calculate(rgb, cmyk)) {
double c = cmyk.GetElement(0); // Cyan
double m = cmyk.GetElement(1); // Magenta
double y = cmyk.GetElement(2); // Yellow
double k = cmyk.GetElement(3); // Black
qDebug() << "CMYK:" << c << m << y << k;
}
delete transform;
}
}
// Example 6: Checking ink coverage
double CalculateInkCoverage(const icmm::CVarColor& cmyk)
{
// Total Area Coverage (TAC) - sum of all ink percentages
double tac = 0.0;
for (int i = 0; i < cmyk.GetElementsCount(); ++i) {
tac += cmyk.GetElement(i);
}
// TAC typically should not exceed 300-400% depending on press
return tac * 100.0; // Convert to percentage
}
// Example 7: Working with spot colors
void AddSpotColorant(icmm::CCmykColorModel& model)
{
// CMYK model can be extended with spot colors
// for special printing applications (metallic, varnish, etc.)
// Get current colorants
icmm::ColorantIds ids = model.GetColorantIds();
// Could add additional colorants for extended gamut printing
// (e.g., Orange, Green for 6-color CMYK+OG)
}
// Example 8: Comparing CMYK models
bool ModelsSupportSameColorants(const icmm::CCmykColorModel& model1,
const icmm::CCmykColorModel& model2)
{
icmm::ColorantIds ids1 = model1.GetColorantIds();
icmm::ColorantIds ids2 = model2.GetColorantIds();
if (ids1.size() != ids2.size()) {
return false;
}
// Check if all colorants match
for (const auto& id : ids1) {
if (!ids2.contains(id)) {
return false;
}
}
return true;
}
CMYK color model implementation for four-color printing.
virtual icmm::ColorantUsage GetColorantUsage(const ColorantId &colorantId) const override
Get type of the colorant with the given ID.
virtual ColorantIds GetColorantIds() const override
Get the list of colorant-IDs.
static ColorantId GetBlack()
Gets the colorant ID for the black (K) component.
virtual std::unique_ptr< ISubstractiveColorModel > CreateSubspaceModel(const QStringList &colorantIds) const override
Create ColorModel of the subspace.
Concrete RGB color model implementation.
virtual const icmm::IColorTransformation * CreateColorTranformation(const IColorModel &otherColorModel, const QByteArray &transformationId) const override
Creates a color transformation for conversion to another color model.
virtual int GetColorSpaceDimensionality() const override
Gets the dimensionality (number of components) of the color space.
virtual ModelType GetModelType() const override
Gets the type of the color model.
Generic color implementation with variable number of color components.
Definition CVarColor.h:176
Basic interface for color transformations between color models.
double GetElement(int index) const
Get element at specified index.
Definition CVarVector.h:409
int GetElementsCount() const
Get number of elements.
Definition CVarVector.h:387
ColorantUsage
Usage of a colorant.
Definition icmm.h:183

Black Generation

The "K" component provides several benefits:

Common strategies:

Applications

Best Practices

See also
icmm::CCmyColorModel, icmm::ISubstractiveColorModel, icmm::CCmyk, icmm::CRgbToCmykTransformation, icmm::IColorantList

Definition at line 185 of file CCmykColorModel.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 188 of file CCmykColorModel.h.

Member Function Documentation

◆ CloneMe()

virtual istd::IChangeableUniquePtr icmm::CCmykColorModel::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 icmm::CCmyColorModel.

◆ CreateSubspaceModel()

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

Create ColorModel of the subspace.

Reimplemented from icmm::CCmyColorModel.

◆ GetBlack()

static ColorantId icmm::CCmykColorModel::GetBlack ( )
static

Gets the colorant ID for the black (K) component.

Static method to retrieve the standard identifier for the black colorant in CMYK printing. Useful for querying or manipulating the black channel specifically.

Returns
ColorantId for black component
See also
GetColorantIds()

◆ GetColorantIds()

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

Get the list of colorant-IDs.

Reimplemented from icmm::CCmyColorModel.

◆ GetColorantUsage()

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

Get type of the colorant with the given ID.

Reimplemented from icmm::CCmyColorModel.


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