Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorSpaceBlendingPolicy.cpp File Reference
#include "KoColorSpaceBlendingPolicy.h"
#include <KoCompositeOpRegistry.h>
#include <ksharedconfig.h>
#include <kconfiggroup.h>

Go to the source code of this file.

Functions

QStringList subtractiveBlendingModesInCmyk ()
 the list of blendmodes that perform channel-inversion in CMYK color space
 
bool useSubtractiveBlendingForCmykColorSpaces ()
 

Function Documentation

◆ subtractiveBlendingModesInCmyk()

QStringList subtractiveBlendingModesInCmyk ( )

the list of blendmodes that perform channel-inversion in CMYK color space

Here is the list of blendmodes which are not invariant to color channel inversion, therefore they cannot work in CMYK properly. These modes automatically invert the channels before blending when used for CMYK color space.

This is a behavior-change in Krita 5.2

Definition at line 30 of file KoColorSpaceBlendingPolicy.cpp.

31{
41 QStringList ids;
42
43 ids << COMPOSITE_BEHIND;
44 ids << COMPOSITE_GREATER;
45
46 ids << COMPOSITE_OVERLAY;
49 ids << COMPOSITE_HARD_MIX;
53 ids << COMPOSITE_PARALLEL;
54 ids << COMPOSITE_ALLANON;
62 ids << COMPOSITE_SCREEN;
63 ids << COMPOSITE_DODGE;
65 ids << COMPOSITE_LIGHTEN;
77 ids << COMPOSITE_PNORM_A;
78 ids << COMPOSITE_PNORM_B;
83 ids << COMPOSITE_BURN;
85 ids << COMPOSITE_DARKEN;
90 ids << COMPOSITE_ADD;
91 ids << COMPOSITE_SUBTRACT;
93 ids << COMPOSITE_MULT;
94 ids << COMPOSITE_DIVIDE;
95 ids << COMPOSITE_MOD;
96 ids << COMPOSITE_MOD_CON;
102 ids << COMPOSITE_DIFF;
103 ids << COMPOSITE_EXCLUSION;
106 ids << COMPOSITE_NEGATION;
107
108 ids << COMPOSITE_XOR;
109 ids << COMPOSITE_OR;
110 ids << COMPOSITE_AND;
111 ids << COMPOSITE_NAND;
112 ids << COMPOSITE_NOR;
113 ids << COMPOSITE_XNOR;
116 ids << COMPOSITE_CONVERSE;
118
119 ids << COMPOSITE_REFLECT;
120 ids << COMPOSITE_GLOW;
121 ids << COMPOSITE_FREEZE;
122 ids << COMPOSITE_HEAT;
123 ids << COMPOSITE_GLEAT;
124 ids << COMPOSITE_HELOW;
125 ids << COMPOSITE_REEZE;
126 ids << COMPOSITE_FRECT;
127 ids << COMPOSITE_FHYRD;
128
130
131 return ids;
132}
const QString COMPOSITE_SOFT_LIGHT_IFS_ILLUSIONS
const QString COMPOSITE_GLOW
const QString COMPOSITE_DARKEN
const QString COMPOSITE_DIVISIVE_MOD_CON
const QString COMPOSITE_ALLANON
const QString COMPOSITE_EQUIVALENCE
const QString COMPOSITE_NEGATION
const QString COMPOSITE_OVERLAY
const QString COMPOSITE_DIVIDE
const QString COMPOSITE_DODGE
const QString COMPOSITE_SOFT_LIGHT_SVG
const QString COMPOSITE_HELOW
const QString COMPOSITE_GAMMA_LIGHT
const QString COMPOSITE_ADD
const QString COMPOSITE_FOG_DARKEN_IFS_ILLUSIONS
const QString COMPOSITE_LIGHTEN
const QString COMPOSITE_LINEAR_BURN
const QString COMPOSITE_FREEZE
const QString COMPOSITE_FOG_LIGHTEN_IFS_ILLUSIONS
const QString COMPOSITE_CONVERSE
const QString COMPOSITE_GRAIN_MERGE
const QString COMPOSITE_SOFT_LIGHT_PHOTOSHOP
const QString COMPOSITE_PARALLEL
const QString COMPOSITE_PENUMBRAA
const QString COMPOSITE_INVERSE_SUBTRACT
const QString COMPOSITE_TINT_IFS_ILLUSIONS
const QString COMPOSITE_DIVISIVE_MOD
const QString COMPOSITE_MULT
const QString COMPOSITE_REFLECT
const QString COMPOSITE_PNORM_B
const QString COMPOSITE_OR
const QString COMPOSITE_LINEAR_LIGHT
const QString COMPOSITE_XNOR
const QString COMPOSITE_FHYRD
const QString COMPOSITE_HARD_LIGHT
const QString COMPOSITE_INTERPOLATION
const QString COMPOSITE_LUMINOSITY_SAI
const QString COMPOSITE_PENUMBRAB
const QString COMPOSITE_IMPLICATION
const QString COMPOSITE_SHADE_IFS_ILLUSIONS
const QString COMPOSITE_NOT_IMPLICATION
const QString COMPOSITE_SOFT_LIGHT_PEGTOP_DELPHI
const QString COMPOSITE_EASY_BURN
const QString COMPOSITE_HARD_OVERLAY
const QString COMPOSITE_FLAT_LIGHT
const QString COMPOSITE_SCREEN
const QString COMPOSITE_PIN_LIGHT
const QString COMPOSITE_DIFF
const QString COMPOSITE_GREATER
const QString COMPOSITE_MOD_CON
const QString COMPOSITE_GAMMA_DARK
const QString COMPOSITE_PENUMBRAD
const QString COMPOSITE_PNORM_A
const QString COMPOSITE_HARD_MIX
const QString COMPOSITE_BEHIND
const QString COMPOSITE_NOR
const QString COMPOSITE_PENUMBRAC
const QString COMPOSITE_SUBTRACT
const QString COMPOSITE_BURN
const QString COMPOSITE_LINEAR_DODGE
const QString COMPOSITE_GLEAT
const QString COMPOSITE_ADDITIVE_SUBTRACTIVE
const QString COMPOSITE_MOD
const QString COMPOSITE_EASY_DODGE
const QString COMPOSITE_NAND
const QString COMPOSITE_HARD_MIX_SOFTER_PHOTOSHOP
const QString COMPOSITE_HEAT
const QString COMPOSITE_SUPER_LIGHT
const QString COMPOSITE_EXCLUSION
const QString COMPOSITE_FRECT
const QString COMPOSITE_NOT_CONVERSE
const QString COMPOSITE_REEZE
const QString COMPOSITE_GAMMA_ILLUMINATION
const QString COMPOSITE_MODULO_SHIFT_CON
const QString COMPOSITE_GEOMETRIC_MEAN
const QString COMPOSITE_AND
const QString COMPOSITE_GRAIN_EXTRACT
const QString COMPOSITE_ARC_TANGENT
const QString COMPOSITE_INTERPOLATIONB
const QString COMPOSITE_XOR
const QString COMPOSITE_VIVID_LIGHT
const QString COMPOSITE_HARD_MIX_PHOTOSHOP
const QString COMPOSITE_MODULO_SHIFT

References COMPOSITE_ADD, COMPOSITE_ADDITIVE_SUBTRACTIVE, COMPOSITE_ALLANON, COMPOSITE_AND, COMPOSITE_ARC_TANGENT, COMPOSITE_BEHIND, COMPOSITE_BURN, COMPOSITE_CONVERSE, COMPOSITE_DARKEN, COMPOSITE_DIFF, COMPOSITE_DIVIDE, COMPOSITE_DIVISIVE_MOD, COMPOSITE_DIVISIVE_MOD_CON, COMPOSITE_DODGE, COMPOSITE_EASY_BURN, COMPOSITE_EASY_DODGE, COMPOSITE_EQUIVALENCE, COMPOSITE_EXCLUSION, COMPOSITE_FHYRD, COMPOSITE_FLAT_LIGHT, COMPOSITE_FOG_DARKEN_IFS_ILLUSIONS, COMPOSITE_FOG_LIGHTEN_IFS_ILLUSIONS, COMPOSITE_FRECT, COMPOSITE_FREEZE, COMPOSITE_GAMMA_DARK, COMPOSITE_GAMMA_ILLUMINATION, COMPOSITE_GAMMA_LIGHT, COMPOSITE_GEOMETRIC_MEAN, COMPOSITE_GLEAT, COMPOSITE_GLOW, COMPOSITE_GRAIN_EXTRACT, COMPOSITE_GRAIN_MERGE, COMPOSITE_GREATER, COMPOSITE_HARD_LIGHT, COMPOSITE_HARD_MIX, COMPOSITE_HARD_MIX_PHOTOSHOP, COMPOSITE_HARD_MIX_SOFTER_PHOTOSHOP, COMPOSITE_HARD_OVERLAY, COMPOSITE_HEAT, COMPOSITE_HELOW, COMPOSITE_IMPLICATION, COMPOSITE_INTERPOLATION, COMPOSITE_INTERPOLATIONB, COMPOSITE_INVERSE_SUBTRACT, COMPOSITE_LIGHTEN, COMPOSITE_LINEAR_BURN, COMPOSITE_LINEAR_DODGE, COMPOSITE_LINEAR_LIGHT, COMPOSITE_LUMINOSITY_SAI, COMPOSITE_MOD, COMPOSITE_MOD_CON, COMPOSITE_MODULO_SHIFT, COMPOSITE_MODULO_SHIFT_CON, COMPOSITE_MULT, COMPOSITE_NAND, COMPOSITE_NEGATION, COMPOSITE_NOR, COMPOSITE_NOT_CONVERSE, COMPOSITE_NOT_IMPLICATION, COMPOSITE_OR, COMPOSITE_OVERLAY, COMPOSITE_PARALLEL, COMPOSITE_PENUMBRAA, COMPOSITE_PENUMBRAB, COMPOSITE_PENUMBRAC, COMPOSITE_PENUMBRAD, COMPOSITE_PIN_LIGHT, COMPOSITE_PNORM_A, COMPOSITE_PNORM_B, COMPOSITE_REEZE, COMPOSITE_REFLECT, COMPOSITE_SCREEN, COMPOSITE_SHADE_IFS_ILLUSIONS, COMPOSITE_SOFT_LIGHT_IFS_ILLUSIONS, COMPOSITE_SOFT_LIGHT_PEGTOP_DELPHI, COMPOSITE_SOFT_LIGHT_PHOTOSHOP, COMPOSITE_SOFT_LIGHT_SVG, COMPOSITE_SUBTRACT, COMPOSITE_SUPER_LIGHT, COMPOSITE_TINT_IFS_ILLUSIONS, COMPOSITE_VIVID_LIGHT, COMPOSITE_XNOR, and COMPOSITE_XOR.

◆ useSubtractiveBlendingForCmykColorSpaces()

bool useSubtractiveBlendingForCmykColorSpaces ( )
Returns
false if the user selected the legacy behavior of the blendmodes in CMYK color spaces

Definition at line 12 of file KoColorSpaceBlendingPolicy.cpp.

13{
14 static bool isConfigInitialized = false;
15 static bool useSubtractiveBlending = true;
16
17 if (!isConfigInitialized) {
18 KConfigGroup cfg = KSharedConfig::openConfig()->group("");
19 useSubtractiveBlending = cfg.readEntry("useSubtractiveBlendingForCmykColorSpaces", true);
20 isConfigInitialized = true;
21
22 if (!useSubtractiveBlending) {
23 qInfo() << "INFO: requested old version of CMYK blending mode. Switching...";
24 }
25 }
26
27 return useSubtractiveBlending;
28}