Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorSpace Struct Referenceabstract

#include <KoColorSpace.h>

+ Inheritance diagram for KoColorSpace:

Classes

struct  ThreadLocalCache
 

Public Member Functions

virtual void addCompositeOp (const KoCompositeOp *op)
 
virtual void addDitherOp (KisDitherOp *op)
 
virtual quint32 alphaPos () const =0
 
virtual void applyAlphaNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels) const =0
 
virtual void applyAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels) const =0
 
virtual void applyInverseAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels) const =0
 
virtual void applyInverseNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels) const =0
 
virtual void bitBlt (const KoColorSpace *srcSpace, const KoCompositeOp::ParameterInfo &params, const KoCompositeOp *op, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
 
virtual quint32 channelCount () const =0
 
QBitArray channelFlags (bool color=true, bool alpha=false) const
 
QList< KoChannelInfo * > channels () const
 
virtual QString channelValueText (const quint8 *pixel, quint32 channelIndex) const =0
 
virtual quint32 colorChannelCount () const =0
 
virtual KoID colorDepthId () const =0
 
virtual void colorFromXML (quint8 *pixel, const QDomElement &elt) const =0
 
virtual KoID colorModelId () const =0
 
virtual void colorToXML (const quint8 *pixel, QDomDocument &doc, QDomElement &colorElt) const =0
 
const KoCompositeOpcompositeOp (const QString &id, const KoColorSpace *srcSpace=nullptr) const
 
virtual QList< KoCompositeOp * > compositeOps () const
 
virtual void convertChannelToVisualRepresentation (const quint8 *src, quint8 *dst, quint32 nPixels, const QBitArray selectedChannels) const =0
 
virtual void convertChannelToVisualRepresentation (const quint8 *src, quint8 *dst, quint32 nPixels, const qint32 selectedChannelIndex) const =0
 
virtual bool convertPixelsTo (const quint8 *src, quint8 *dst, const KoColorSpace *dstColorSpace, quint32 numPixels, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
 
virtual QImage convertToQImage (const quint8 *data, qint32 width, qint32 height, const KoColorProfile *dstProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
 
virtual KoConvolutionOpconvolutionOp () const
 
virtual void copyOpacityU8 (quint8 *src, quint8 *dst, qint32 nPixels) const =0
 
virtual KoColorTransformationcreateBrightnessContrastAdjustment (const quint16 *transferValues) const =0
 
virtual KoColorConversionTransformationcreateColorConverter (const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
 
KoColorTransformationcreateColorTransformation (const QString &id, const QHash< QString, QVariant > &parameters) const
 
virtual KoColorTransformationcreateDarkenAdjustment (qint32 shade, bool compensate, qreal compensation) const =0
 
virtual KoColorTransformationcreateInvertTransformation () const =0
 
virtual KoColorTransformationcreatePerChannelAdjustment (const quint16 *const *transferValues) const =0
 
virtual KoColorConversionTransformationcreateProofingTransform (const KoColorSpace *dstColorSpace, const KoColorSpace *proofingSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent proofingIntent, bool bpcFirstTransform, quint8 *gamutWarning, KoColorConversionTransformation::ConversionFlags displayConversionFlags) const
 createProofingTransform Create a proofing transform. This is a two part transform that can also do gamut checks. The first transform is from source -> proofing space. Here the gamut checks are performed. The second is the proofing to destination space.
 
virtual void decreaseHue (quint8 *pixel, qreal step) const
 
virtual void decreaseLuminosity (quint8 *pixel, qreal step) const
 
virtual void decreaseSaturation (quint8 *pixel, qreal step) const
 
virtual quint8 difference (const quint8 *src1, const quint8 *src2) const =0
 
virtual quint8 differenceA (const quint8 *src1, const quint8 *src2) const =0
 
virtual const KisDitherOpditherOp (const QString &depth, DitherType type) const
 
QPolygonF estimatedTRCXYY () const
 
virtual void fillGrayBrushWithColor (quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const =0
 
virtual void fillGrayBrushWithColorAndLightnessOverlay (quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const
 
virtual void fillGrayBrushWithColorAndLightnessWithStrength (quint8 *dst, const QRgb *brush, quint8 *brushColor, qreal strength, qint32 nPixels) const
 
virtual void fillInverseAlphaNormedFloatMaskWithColor (quint8 *pixels, const float *alpha, const quint8 *brushColor, qint32 nPixels) const =0
 
virtual QVector< double > fromHSY (qreal *hue, qreal *sat, qreal *luma) const =0
 
virtual void fromLabA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const
 
virtual void fromNormalisedChannelsValue (quint8 *pixel, const QVector< float > &values) const =0
 
virtual void fromQColor (const QColor &color, quint8 *dst) const =0
 
virtual void fromRgbA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const
 
virtual QVector< double > fromYUV (qreal *y, qreal *u, qreal *v) const =0
 
QPolygonF gamutXYY () const
 
virtual bool hasCompositeOp (const QString &id, const KoColorSpace *srcSpace=nullptr) const
 
virtual bool hasHighDynamicRange () const =0
 
QString id () const
 
virtual void increaseBlue (quint8 *pixel, qreal step) const
 
virtual void increaseGreen (quint8 *pixel, qreal step) const
 
virtual void increaseHue (quint8 *pixel, qreal step) const
 
virtual void increaseLuminosity (quint8 *pixel, qreal step) const
 
virtual void increaseRed (quint8 *pixel, qreal step) const
 
virtual void increaseSaturation (quint8 *pixel, qreal step) const
 
virtual void increaseYellow (quint8 *pixel, qreal step) const
 
virtual quint8 intensity8 (const quint8 *src) const =0
 
virtual qreal intensityF (const quint8 *src) const =0
 
 KoColorSpace (const QString &id, const QString &name, KoMixColorsOp *mixColorsOp, KoConvolutionOp *convolutionOp)
 Should be called by real color spaces.
 
QVector< qreal > lumaCoefficients () const
 
virtual KoMixColorsOpmixColorsOp () const
 
virtual void modulateLightnessByGrayBrush (quint8 *dst, const QRgb *brush, qreal strength, qint32 nPixels) const
 
virtual void multiplyAlpha (quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
 
QString name () const
 
virtual void normalisedChannelsValue (const quint8 *pixel, QVector< float > &channels) const =0
 
virtual QString normalisedChannelValueText (const quint8 *pixel, quint32 channelIndex) const =0
 
virtual qreal opacityF (const quint8 *pixel) const =0
 
virtual quint8 opacityU8 (const quint8 *pixel) const =0
 
virtual bool operator== (const KoColorSpace &rhs) const
 
virtual quint32 pixelSize () const =0
 
virtual const KoColorProfileprofile () const =0
 
virtual bool profileIsCompatible (const KoColorProfile *profile) const =0
 
virtual bool proofPixelsTo (const quint8 *src, quint8 *dst, quint32 numPixels, KoColorConversionTransformation *proofingTransform) const
 proofPixelsTo
 
virtual quint8 scaleToU8 (const quint8 *srcPixel, qint32 channelPos) const =0
 
virtual void setOpacity (quint8 *pixels, qreal alpha, qint32 nPixels) const =0
 
virtual void setOpacity (quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
 
virtual void singleChannelPixel (quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex) const =0
 
virtual void toHSY (const QVector< double > &channelValues, qreal *hue, qreal *sat, qreal *luma) const =0
 
virtual void toLabA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const
 
virtual void toQColor (const quint8 *src, QColor *c) const =0
 
virtual void toQColor16 (const quint8 *src, QColor *c) const =0
 
virtual void toRgbA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const
 
virtual void toYUV (const QVector< double > &channelValues, qreal *y, qreal *u, qreal *v) const =0
 
virtual void transparentColor (quint8 *dst, quint32 nPixels) const
 
virtual bool willDegrade (ColorSpaceIndependence independence) const =0
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Public Attributes

ThreadLocalCache channelFlagsApplicationCache
 
QList< KoChannelInfo * > channels
 
QVector< KoColorimetryUtils::xyYcolorants
 
QHash< QString, KoCompositeOp * > compositeOps
 
ThreadLocalCache conversionCache
 
KoConvolutionOpconvolutionOp
 
Deletability deletability
 
QHash< QString, QMap< DitherType, KisDitherOp * > > ditherOps
 
QPolygonF gamutXYY
 
KoColorSpaceEngineiccEngine
 
QString id
 
quint32 idNumber
 
QVector< qreal > lumaCoefficients
 
KoMixColorsOpmixColorsOp
 
QString name
 
KoColorConversionTransformationtransfoFromLABA16
 
KoColorConversionTransformationtransfoFromRGBA16
 
KoColorConversionTransformationtransfoToLABA16
 
KoColorConversionTransformationtransfoToRGBA16
 
QPolygonF TRCXYY
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Protected Member Functions

virtual void addChannel (KoChannelInfo *ci)
 
const KoColorConversionTransformationfromLabA16Converter () const
 
const KoColorConversionTransformationfromRgbA16Converter () const
 
 KoColorSpace ()
 Only for use by classes that serve as baseclass for real color spaces.
 
virtual bool preferCompositionInSourceColorSpace () const
 
const KoColorConversionTransformationtoLabA16Converter () const
 
const KoColorConversionTransformationtoRgbA16Converter () const
 
virtual ~KoColorSpace ()
 

Protected Attributes

Private *const d
 

Friends

class KoColorSpaceFactory
 
class KoColorSpaceRegistry
 

Detailed Description

A KoColorSpace is the definition of a certain color space.

A color model and a color space are two related concepts. A color model is more general in that it describes the channels involved and how they in broad terms combine to describe a color. Examples are RGB, HSV, CMYK.

A color space is more specific in that it also describes exactly how the channels are combined. So for each color model there can be a number of specific color spaces. So RGB is the model and sRGB, adobeRGB, etc are colorspaces.

In Pigment KoColorSpace acts as both a color model and a color space. You can think of the class definition as the color model, but the instance of the class as representing a colorspace.

A third concept is the profile represented by KoColorProfile. It represents the info needed to specialize a color model into a color space.

KoColorSpace is an abstract class serving as an interface.

Subclasses implement actual color spaces Some subclasses implement only some parts and are named Traits

Definition at line 77 of file KoColorSpace.h.

Constructor & Destructor Documentation

◆ KoColorSpace() [1/2]

KoColorSpace::KoColorSpace ( )
protected

Only for use by classes that serve as baseclass for real color spaces.

Definition at line 39 of file KoColorSpace.cpp.

40 : d(new Private())
41{
42}
Private *const d

◆ KoColorSpace() [2/2]

KoColorSpace::KoColorSpace ( const QString & id,
const QString & name,
KoMixColorsOp * mixColorsOp,
KoConvolutionOp * convolutionOp )

Should be called by real color spaces.

Definition at line 44 of file KoColorSpace.cpp.

45 : d(new Private())
46{
47 d->id = id;
48 d->idNumber = qHash(d->id);
49 d->name = name;
50 d->mixColorsOp = mixColorsOp;
51 d->convolutionOp = convolutionOp;
52 d->transfoToRGBA16 = 0;
53 d->transfoFromRGBA16 = 0;
54 d->transfoToLABA16 = 0;
55 d->transfoFromLABA16 = 0;
56 d->gamutXYY = QPolygonF();
57 d->TRCXYY = QPolygonF();
58 d->colorants = QVector <KoColorimetryUtils::xyY> (0);
59 d->lumaCoefficients = QVector <qreal> (0);
60 d->iccEngine = 0;
61 d->deletability = NotOwnedByRegistry;
62}
@ NotOwnedByRegistry
uint qHash(const KoInputDevice &key)
KoConvolutionOp * convolutionOp
KoMixColorsOp * mixColorsOp

References convolutionOp, d, id, mixColorsOp, name, NotOwnedByRegistry, and qHash().

◆ ~KoColorSpace()

KoColorSpace::~KoColorSpace ( )
protectedvirtual

Definition at line 64 of file KoColorSpace.cpp.

65{
66 Q_ASSERT(d->deletability != OwnedByRegistryDoNotDelete);
67
68 Q_FOREACH(const KoCompositeOp *op, d->compositeOps) {
69 delete op;
70 }
71 d->compositeOps.clear();
72 for (const auto& map: d->ditherOps) {
73 qDeleteAll(map);
74 }
75 d->ditherOps.clear();
76 Q_FOREACH (KoChannelInfo * channel, d->channels) {
77 delete channel;
78 }
79 d->channels.clear();
80 if (d->deletability == NotOwnedByRegistry) {
82 if (cache) {
83 cache->colorSpaceIsDestroyed(this);
84 }
85 }
86 delete d->mixColorsOp;
87 delete d->convolutionOp;
88 delete d->transfoToRGBA16;
89 delete d->transfoFromRGBA16;
90 delete d->transfoToLABA16;
91 delete d->transfoFromLABA16;
92 delete d;
93}
@ OwnedByRegistryDoNotDelete
void colorSpaceIsDestroyed(const KoColorSpace *src)
QHash< QString, QMap< DitherType, KisDitherOp * > > ditherOps
KoColorConversionCache * colorConversionCache
static KoColorSpaceRegistry * instance()

References KoColorSpaceRegistry::colorConversionCache, KoColorConversionCache::colorSpaceIsDestroyed(), d, KoColorSpaceRegistry::instance(), NotOwnedByRegistry, and OwnedByRegistryDoNotDelete.

Member Function Documentation

◆ addChannel()

void KoColorSpace::addChannel ( KoChannelInfo * ci)
protectedvirtual

Use this function in the constructor of your colorspace to add the information about a channel.

Parameters
cia pointer to the information about a channel

Definition at line 311 of file KoColorSpace.cpp.

312{
313 d->channels.push_back(ci);
314}

References d.

◆ addCompositeOp()

void KoColorSpace::addCompositeOp ( const KoCompositeOp * op)
virtual

add a composite op to this colorspace.

Definition at line 387 of file KoColorSpace.cpp.

388{
389 if (op->colorSpace()->id() == id()) {
390 d->compositeOps.insert(op->id(), const_cast<KoCompositeOp*>(op));
391 }
392}
const KoColorSpace * colorSpace

References KoCompositeOp::colorSpace, d, id, and KoCompositeOp::id.

◆ addDitherOp()

void KoColorSpace::addDitherOp ( KisDitherOp * op)
virtual

Definition at line 354 of file KoColorSpace.cpp.

355{
356 if (op->sourceDepthId() == colorDepthId()) {
357 if (!d->ditherOps.contains(op->destinationDepthId().id())) {
358 d->ditherOps.insert(op->destinationDepthId().id(), {{op->type(), op}});
359 } else {
360 d->ditherOps[op->destinationDepthId().id()].insert(op->type(), op);
361 }
362 }
363}
virtual KoID destinationDepthId() const =0
virtual KoID sourceDepthId() const =0
virtual DitherType type() const =0
virtual KoID colorDepthId() const =0
QString id() const
Definition KoID.cpp:63

References colorDepthId(), d, KisDitherOp::destinationDepthId(), KoID::id(), KisDitherOp::sourceDepthId(), and KisDitherOp::type().

◆ alphaPos()

◆ applyAlphaNormedFloatMask()

◆ applyAlphaU8Mask()

◆ applyInverseAlphaU8Mask()

◆ applyInverseNormedFloatMask()

◆ bitBlt()

void KoColorSpace::bitBlt ( const KoColorSpace * srcSpace,
const KoCompositeOp::ParameterInfo & params,
const KoCompositeOp * op,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const
virtual

Compose two arrays of pixels together. If source and target are not the same color model, the source pixels will be converted to the target model. We're "dst" – "dst" pixels are always in this colorspace.

Parameters
srcSpacethe colorspace of the source pixels that will be composited onto "us"
paramsthe information needed for blitting e.g. the source and destination pixel data, the opacity and flow, ...
opthe composition operator instance to use, e.g. COPY_OVER. This operator must belong to this (dst) color space, UNLESS preferCompositionInSourceColorSpace() returns true. In this case, the operator should be from the source color space. Besides avoiding recurring lookups via compositeOp(), this is necessary if this color space does not implement the desired composite op, but srcPace does. Use compositeOp() with valid srcSpace to get the appropriate op.
renderingIntentthe rendering intent
conversionFlagsthe conversion flags.

Definition at line 498 of file KoColorSpace.cpp.

501{
502 Q_ASSERT_X(*op->colorSpace() == *this || (preferCompositionInSourceColorSpace() && *op->colorSpace() == *srcSpace),
503 "KoColorSpace::bitBlt", QString("Composite op is for color space %1 (%2) while this is %3 (%4)").arg(op->colorSpace()->id()).arg(op->colorSpace()->profile()->name()).arg(id()).arg(profile()->name()).toLatin1());
504
505 if(params.rows <= 0 || params.cols <= 0)
506 return;
507
508 if(!(*this == *srcSpace)) {
510 (*op->colorSpace() == *srcSpace || srcSpace->hasCompositeOp(op->id()))) {
511
512 quint32 conversionDstBufferStride = params.cols * srcSpace->pixelSize();
513 QVector<quint8> * conversionDstCache = d->conversionCache.get(params.rows * conversionDstBufferStride);
514 quint8* conversionDstData = conversionDstCache->data();
515
516 for(qint32 row=0; row<params.rows; row++) {
517 convertPixelsTo(params.dstRowStart + row * params.dstRowStride,
518 conversionDstData + row * conversionDstBufferStride, srcSpace, params.cols,
519 renderingIntent, conversionFlags);
520 }
521
522 // TODO: Composite op substitution should eventually be removed here, but it's not urgent.
523 // Code should just provide srcSpace to KoColorSpace::compositeOp() to avoid the lookups.
524 const KoCompositeOp *otherOp = (*op->colorSpace() == *srcSpace) ? op : srcSpace->compositeOp(op->id());
525
526 KoCompositeOp::ParameterInfo paramInfo(params);
527 paramInfo.dstRowStart = conversionDstData;
528 paramInfo.dstRowStride = conversionDstBufferStride;
529 otherOp->composite(paramInfo);
530
531 for(qint32 row=0; row<params.rows; row++) {
532 srcSpace->convertPixelsTo(conversionDstData + row * conversionDstBufferStride,
533 params.dstRowStart + row * params.dstRowStride, this, params.cols,
534 renderingIntent, conversionFlags);
535 }
536
537 } else {
538 quint32 conversionBufferStride = params.cols * pixelSize();
539 QVector<quint8> * conversionCache = d->conversionCache.get(params.rows * conversionBufferStride);
540 quint8* conversionData = conversionCache->data();
541
542
543 const bool noChannelFlags = params.channelFlags.isEmpty() ||
544 params.channelFlags == srcSpace->channelFlags(true, true);
545
546 if (noChannelFlags) {
547 for(qint32 row=0; row<params.rows; row++) {
548 srcSpace->convertPixelsTo(params.srcRowStart + row * params.srcRowStride,
549 conversionData + row * conversionBufferStride, this, params.cols,
550 renderingIntent, conversionFlags);
551 }
552
553 KoCompositeOp::ParameterInfo paramInfo(params);
554 paramInfo.srcRowStart = conversionData;
555 paramInfo.srcRowStride = conversionBufferStride;
556 paramInfo.channelFlags = QBitArray();
557 op->composite(paramInfo);
558 } else {
559 quint32 homogenizationBufferStride = params.cols * srcSpace->pixelSize();
560 QVector<quint8> * homogenizationCache = d->channelFlagsApplicationCache.get(homogenizationBufferStride);
561 quint8* homogenizationData = homogenizationCache->data();
562
563 for(qint32 row=0; row<params.rows; row++) {
564 srcSpace->convertChannelToVisualRepresentation(params.srcRowStart + row * params.srcRowStride,
565 homogenizationData, params.cols,
566 params.channelFlags | srcSpace->channelFlags(false, true));
567 srcSpace->convertPixelsTo(homogenizationData,
568 conversionData + row * conversionBufferStride, this, params.cols,
569 renderingIntent, conversionFlags);
570 }
571
572
573 KoCompositeOp::ParameterInfo paramInfo(params);
574 paramInfo.srcRowStart = conversionData;
575 paramInfo.srcRowStride = conversionBufferStride;
576 paramInfo.channelFlags = channelFlags(true, params.channelFlags.testBit(srcSpace->alphaPos()));
577 op->composite(paramInfo);
578 }
579
580
581 }
582 }
583 else {
584 op->composite(params);
585 }
586}
virtual quint32 alphaPos() const =0
virtual quint32 pixelSize() const =0
virtual void convertChannelToVisualRepresentation(const quint8 *src, quint8 *dst, quint32 nPixels, const qint32 selectedChannelIndex) const =0
ThreadLocalCache conversionCache
QBitArray channelFlags(bool color=true, bool alpha=false) const
virtual bool preferCompositionInSourceColorSpace() const
virtual bool convertPixelsTo(const quint8 *src, quint8 *dst, const KoColorSpace *dstColorSpace, quint32 numPixels, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
virtual bool hasCompositeOp(const QString &id, const KoColorSpace *srcSpace=nullptr) const
const KoCompositeOp * compositeOp(const QString &id, const KoColorSpace *srcSpace=nullptr) const
virtual const KoColorProfile * profile() const =0
void composite(quint8 *dstRowStart, qint32 dstRowStride, const quint8 *srcRowStart, qint32 srcRowStride, const quint8 *maskRowStart, qint32 maskRowStride, qint32 rows, qint32 numColumns, float opacity, const QBitArray &channelFlags=QBitArray()) const

References alphaPos(), channelFlags(), KoCompositeOp::ParameterInfo::channelFlags, KoCompositeOp::colorSpace, KoCompositeOp::ParameterInfo::cols, KoCompositeOp::composite(), compositeOp(), conversionCache, convertChannelToVisualRepresentation(), convertPixelsTo(), d, KoCompositeOp::ParameterInfo::dstRowStart, KoCompositeOp::ParameterInfo::dstRowStride, hasCompositeOp(), id, KoCompositeOp::id, KoColorProfile::name, name, pixelSize(), preferCompositionInSourceColorSpace(), profile(), KoCompositeOp::ParameterInfo::rows, KoCompositeOp::ParameterInfo::srcRowStart, and KoCompositeOp::ParameterInfo::srcRowStride.

◆ channelCount()

◆ channelFlags()

QBitArray KoColorSpace::channelFlags ( bool color = true,
bool alpha = false ) const

returns a QBitArray that contains true for the specified channel types:

Parameters
colorif true, set all color channels to true
alphaif true, set all alpha channels to true

The order of channels is the colorspace descriptive order, not the pixel order.

Definition at line 297 of file KoColorSpace.cpp.

298{
299 QBitArray ba(d->channels.size());
300 if (!color && !alpha) return ba;
301
302 for (int i = 0; i < d->channels.size(); ++i) {
303 KoChannelInfo * channel = d->channels.at(i);
304 if ((color && channel->channelType() == KoChannelInfo::COLOR) ||
305 (alpha && channel->channelType() == KoChannelInfo::ALPHA))
306 ba.setBit(i, true);
307 }
308 return ba;
309}
@ ALPHA
The channel represents the opacity of a pixel.
@ COLOR
The channel represents a color.
enumChannelType channelType() const

References KoChannelInfo::ALPHA, KoChannelInfo::channelType(), KoChannelInfo::COLOR, and d.

◆ channels()

QList< KoChannelInfo * > KoColorSpace::channels ( ) const

Return a list describing all the channels this color model has. The order of the channels in the list is the order of channels in the pixel. To find out the preferred display position, use KoChannelInfo::displayPosition.

◆ channelValueText()

◆ colorChannelCount()

◆ colorDepthId()

◆ colorFromXML()

virtual void KoColorSpace::colorFromXML ( quint8 * pixel,
const QDomElement & elt ) const
pure virtual

◆ colorModelId()

◆ colorToXML()

virtual void KoColorSpace::colorToXML ( const quint8 * pixel,
QDomDocument & doc,
QDomElement & colorElt ) const
pure virtual

Serialize this color following Create's swatch color specification available at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft

This function doesn't create the <color /> element but rather the <CMYK />, <sRGB />, <RGB /> ... elements. It is assumed that colorElt is the <color /> element.

Parameters
pixelbuffer to serialized
colorEltroot element for the serialization, it is assumed that this element is <color />
docis the document containing colorElt

Implemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, KoSimpleColorSpace< KoLabU16Traits >, CmykF32ColorSpace, CmykU16ColorSpace, CmykU8ColorSpace, GrayF16ColorSpace, GrayF32ColorSpace, GrayAU16ColorSpace, GrayAU8ColorSpace, LabF32ColorSpace, LabU16ColorSpace, LabU8ColorSpace, RgbF16ColorSpace, RgbF32ColorSpace, RgbU16ColorSpace, RgbU8ColorSpace, XyzF16ColorSpace, XyzF32ColorSpace, XyzU16ColorSpace, XyzU8ColorSpace, YCbCrF32ColorSpace, YCbCrU16ColorSpace, and YCbCrU8ColorSpace.

◆ compositeOp()

const KoCompositeOp * KoColorSpace::compositeOp ( const QString & id,
const KoColorSpace * srcSpace = nullptr ) const

Retrieve a single composite op from the ones this colorspace offers. If the requested composite op does not exist, COMPOSITE_OVER is returned.

Parameters
srcSpaceoptional source color space. Some color spaces prefer blitting in source color space. If already known, additional composite ops may be available. Note: if given, the returned op is only safe to use with this exact source color space!

Definition at line 370 of file KoColorSpace.cpp.

371{
372 if (srcSpace && preferCompositionInSourceColorSpace()) {
373 if (const KoCompositeOp *op = srcSpace->compositeOp(id)) {
374 return op;
375 }
376 }
377 const QHash<QString, KoCompositeOp*>::ConstIterator it = d->compositeOps.constFind(id);
378 if (it != d->compositeOps.constEnd()) {
379 return it.value();
380 }
381 else {
382 warnPigment << "Asking for nonexistent composite operation " << id << ", returning " << COMPOSITE_OVER;
383 return d->compositeOps.value(COMPOSITE_OVER);
384 }
385}
#define warnPigment
const QString COMPOSITE_OVER

References COMPOSITE_OVER, compositeOp(), d, preferCompositionInSourceColorSpace(), and warnPigment.

◆ compositeOps()

virtual QList< KoCompositeOp * > KoColorSpace::compositeOps ( ) const
virtual

Returns the list of user-visible composite ops supported by this colorspace.

◆ convertChannelToVisualRepresentation() [1/2]

virtual void KoColorSpace::convertChannelToVisualRepresentation ( const quint8 * src,
quint8 * dst,
quint32 nPixels,
const QBitArray selectedChannels ) const
pure virtual

◆ convertChannelToVisualRepresentation() [2/2]

virtual void KoColorSpace::convertChannelToVisualRepresentation ( const quint8 * src,
quint8 * dst,
quint32 nPixels,
const qint32 selectedChannelIndex ) const
pure virtual

◆ convertPixelsTo()

bool KoColorSpace::convertPixelsTo ( const quint8 * src,
quint8 * dst,
const KoColorSpace * dstColorSpace,
quint32 numPixels,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const
virtual

Convert a byte array of srcLen pixels *src to the specified color space and put the converted bytes into the prepared byte array *dst.

Returns false if the conversion failed, true if it succeeded

This function is not thread-safe. If you want to apply multiple conversion in different threads at the same time, you need to create one color converter per-thread using createColorConverter.

Reimplemented in KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.

Definition at line 459 of file KoColorSpace.cpp.

465{
466 if (*this == *dstColorSpace) {
467 if (src != dst) {
468 memcpy(dst, src, numPixels * sizeof(quint8) * pixelSize());
469 }
470 } else {
471 KoCachedColorConversionTransformation cct = KoColorSpaceRegistry::instance()->colorConversionCache()->cachedConverter(this, dstColorSpace, renderingIntent, conversionFlags);
472 cct.transformation()->transform(src, dst, numPixels);
473 }
474 return true;
475}
const KoColorConversionTransformation * transformation() const
KoCachedColorConversionTransformation cachedConverter(const KoColorSpace *src, const KoColorSpace *dst, KoColorConversionTransformation::Intent _renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
void transform(const quint8 *src, quint8 *dst, qint32 nPixels) const override=0

References KoColorConversionCache::cachedConverter(), KoColorSpaceRegistry::colorConversionCache, KoColorSpaceRegistry::instance(), pixelSize(), KoColorConversionTransformation::transform(), and KoCachedColorConversionTransformation::transformation().

◆ convertToQImage()

QImage KoColorSpace::convertToQImage ( const quint8 * data,
qint32 width,
qint32 height,
const KoColorProfile * dstProfile,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const
virtual

Convert the pixels in data to (8-bit BGRA) QImage using the specified profiles.

Parameters
dataA pointer to a contiguous memory region containing width * height pixels
widthin pixels
heightin pixels
dstProfiledestination profile
renderingIntentthe rendering intent
conversionFlagsconversion flags

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >.

Definition at line 855 of file KoColorSpace.cpp.

860{
861 QImage img = QImage(width, height, QImage::Format_ARGB32);
862
863 const KoColorSpace * dstCS = KoColorSpaceRegistry::instance()->rgb8(dstProfile);
864
865 if (data)
866 this->convertPixelsTo(const_cast<quint8 *>(data), img.bits(), dstCS, width * height, renderingIntent, conversionFlags);
867
868 return img;
869}
const KoColorSpace * rgb8(const QString &profileName=QString())

References convertPixelsTo(), KoColorSpaceRegistry::instance(), and KoColorSpaceRegistry::rgb8().

◆ convolutionOp()

virtual KoConvolutionOp * KoColorSpace::convolutionOp ( ) const
virtual
Returns
the convolution operation of this colorspace (do not delete it locally, it's deleted by the colorspace).

◆ copyOpacityU8()

◆ createBrightnessContrastAdjustment()

◆ createColorConverter()

KoColorConversionTransformation * KoColorSpace::createColorConverter ( const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const
virtual

Create a color conversion transformation.

Definition at line 450 of file KoColorSpace.cpp.

451{
452 if (*this == *dstColorSpace) {
454 } else {
455 return KoColorSpaceRegistry::instance()->createColorConverter(this, dstColorSpace, renderingIntent, conversionFlags);
456 }
457}
KoColorConversionTransformation * createColorConverter(const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const

References KoColorSpaceRegistry::createColorConverter(), and KoColorSpaceRegistry::instance().

◆ createColorTransformation()

KoColorTransformation * KoColorSpace::createColorTransformation ( const QString & id,
const QHash< QString, QVariant > & parameters ) const

Definition at line 588 of file KoColorSpace.cpp.

589{
591 if (!factory) return 0;
592 QPair<KoID, KoID> model(colorModelId(), colorDepthId());
593 QList< QPair<KoID, KoID> > models = factory->supportedModels();
594 if (models.isEmpty() || models.contains(model)) {
595 return factory->createTransformation(this, parameters);
596 } else {
597 // Find the best solution
598 // TODO use the color conversion cache
599 KoColorConversionTransformation* csToFallBack = 0;
600 KoColorConversionTransformation* fallBackToCs = 0;
601 KoColorSpaceRegistry::instance()->createColorConverters(this, models, csToFallBack, fallBackToCs);
602 Q_ASSERT(csToFallBack);
603 Q_ASSERT(fallBackToCs);
604 KoColorTransformation* transfo = factory->createTransformation(fallBackToCs->srcColorSpace(), parameters);
605 return new KoFallBackColorTransformation(csToFallBack, fallBackToCs, transfo);
606 }
607}
virtual KoID colorModelId() const =0
T get(const QString &id) const
void createColorConverters(const KoColorSpace *colorSpace, const QList< QPair< KoID, KoID > > &possibilities, KoColorConversionTransformation *&fromCS, KoColorConversionTransformation *&toCS) const
static KoColorTransformationFactoryRegistry * instance()
virtual KoColorTransformation * createTransformation(const KoColorSpace *colorSpace, QHash< QString, QVariant > parameters) const =0
virtual QList< QPair< KoID, KoID > > supportedModels() const =0

References colorDepthId(), colorModelId(), KoColorSpaceRegistry::createColorConverters(), KoColorTransformationFactory::createTransformation(), KoGenericRegistry< T >::get(), KoColorSpaceRegistry::instance(), KoColorTransformationFactoryRegistry::instance(), KoColorConversionTransformation::srcColorSpace, and KoColorTransformationFactory::supportedModels().

◆ createDarkenAdjustment()

◆ createInvertTransformation()

◆ createPerChannelAdjustment()

◆ createProofingTransform()

KoColorConversionTransformation * KoColorSpace::createProofingTransform ( const KoColorSpace * dstColorSpace,
const KoColorSpace * proofingSpace,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::Intent proofingIntent,
bool bpcFirstTransform,
quint8 * gamutWarning,
KoColorConversionTransformation::ConversionFlags displayConversionFlags ) const
virtual

createProofingTransform Create a proofing transform. This is a two part transform that can also do gamut checks. The first transform is from source -> proofing space. Here the gamut checks are performed. The second is the proofing to destination space.

Parameters
dstColorSpace– destination space, typically the display profile.
proofingSpace– space to proof to.
renderingIntent– rendering intent for the first transform.
proofingIntent– rendering intent for the second transform.
bcpFirstTransform– whether the first transform should use blackpoint compensation. All other flags are handled by displayFlags.
gamutWarning– The color of the gamut warning in dstColorSpace. Gamut warnings require Gamut warning flag being set on display flags.
adaptationState– Whether the white point is being adapted in Absolute colorimetric. [0.0 1.0] with 0 no adaptation, 1 full adaptation.
displayConversionFlags– the rest of the conversion flags. This includes blackpoint compensation for the second transform, as well as gamut warnings.
Returns
a KoColorConversionTransform that can softproof.

Definition at line 477 of file KoColorSpace.cpp.

478{
479 if (!d->iccEngine) {
480 d->iccEngine = KoColorSpaceEngineRegistry::instance()->get("icc");
481 }
482 if (!d->iccEngine) return 0;
483
484 return d->iccEngine->createColorProofingTransformation(this, dstColorSpace, proofingSpace, renderingIntent, proofingIntent, bpcFirstTransform, gamutWarning, displayConversionFlags);
485}
static KoColorSpaceEngineRegistry * instance()

References d, KoGenericRegistry< T >::get(), and KoColorSpaceEngineRegistry::instance().

◆ decreaseHue()

void KoColorSpace::decreaseHue ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 743 of file KoColorSpace.cpp.

743 {
744 int channelnumber = channelCount();
745 QVector <double> channelValues(channelnumber);
746 QVector <float> channelValuesF(channelnumber);
747 normalisedChannelsValue(pixel, channelValuesF);
748 for (int i=0;i<channelnumber;i++){
749 channelValues[i]=channelValuesF[i];
750 }
751 profile()->linearizeFloatValue(channelValues);
752 qreal hue, sat, luma = 0.0;
753 toHSY(channelValues, &hue, &sat, &luma);
754 if (hue-step<0.0){
755 hue=1.0-(step-hue);
756 } else {
757 hue -= step;
758 }
759 channelValues = fromHSY(&hue, &sat, &luma);
760 profile()->delinearizeFloatValue(channelValues);
761 for (int i=0;i<channelnumber;i++){
762 channelValuesF[i]=channelValues[i];
763 }
764 fromNormalisedChannelsValue(pixel, channelValuesF);
765 setOpacity(pixel, 1.0, 1);
766}
virtual void toHSY(const QVector< double > &channelValues, qreal *hue, qreal *sat, qreal *luma) const =0
virtual void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
virtual quint32 channelCount() const =0
virtual void normalisedChannelsValue(const quint8 *pixel, QVector< float > &channels) const =0
virtual void fromNormalisedChannelsValue(quint8 *pixel, const QVector< float > &values) const =0
virtual QVector< double > fromHSY(qreal *hue, qreal *sat, qreal *luma) const =0
virtual void linearizeFloatValue(QVector< qreal > &Value) const =0
virtual void delinearizeFloatValue(QVector< qreal > &Value) const =0

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ decreaseLuminosity()

void KoColorSpace::decreaseLuminosity ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 639 of file KoColorSpace.cpp.

639 {
640 int channelnumber = channelCount();
641 QVector <double> channelValues(channelnumber);
642 QVector <float> channelValuesF(channelnumber);
643 normalisedChannelsValue(pixel, channelValuesF);
644 for (int i=0;i<channelnumber;i++){
645 channelValues[i]=channelValuesF[i];
646 }
647 if (profile()->hasTRC()){
648 //only linearise and crunch the luma if there's a TRC
649 profile()->linearizeFloatValue(channelValues);
650 qreal hue, sat, luma = 0.0;
651 toHSY(channelValues, &hue, &sat, &luma);
652 luma = pow(luma, 1/2.2);
653 if (luma-step<0.0) {
654 luma=0.0;
655 } else {
656 luma -= step;
657 }
658 luma = pow(luma, 2.2);
659 channelValues = fromHSY(&hue, &sat, &luma);
660 profile()->delinearizeFloatValue(channelValues);
661 } else {
662 qreal hue, sat, luma = 0.0;
663 toHSY(channelValues, &hue, &sat, &luma);
664 if (luma-step<0.0) {
665 luma=0.0;
666 } else {
667 luma -= step;
668 }
669 channelValues = fromHSY(&hue, &sat, &luma);
670 }
671 for (int i=0;i<channelnumber;i++){
672 channelValuesF[i]=channelValues[i];
673 }
674 fromNormalisedChannelsValue(pixel, channelValuesF);
675 setOpacity(pixel, 1.0, 1);
676}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ decreaseSaturation()

void KoColorSpace::decreaseSaturation ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 698 of file KoColorSpace.cpp.

698 {
699 int channelnumber = channelCount();
700 QVector <double> channelValues(channelnumber);
701 QVector <float> channelValuesF(channelnumber);
702 normalisedChannelsValue(pixel, channelValuesF);
703 for (int i=0;i<channelnumber;i++){
704 channelValues[i]=channelValuesF[i];
705 }
706 profile()->linearizeFloatValue(channelValues);
707 qreal hue, sat, luma = 0.0;
708 toHSY(channelValues, &hue, &sat, &luma);
709 sat -= step;
710 sat = qBound(0.0, sat, 1.0);
711 channelValues = fromHSY(&hue, &sat, &luma);
712 profile()->delinearizeFloatValue(channelValues);
713 for (int i=0;i<channelnumber;i++){
714 channelValuesF[i]=channelValues[i];
715 }
716 fromNormalisedChannelsValue(pixel, channelValuesF);
717 setOpacity(pixel, 1.0, 1);
718}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ difference()

◆ differenceA()

◆ ditherOp()

const KisDitherOp * KoColorSpace::ditherOp ( const QString & depth,
DitherType type ) const
virtual

Retrieve the elevate-to-normalized floating point dithering op.

Definition at line 333 of file KoColorSpace.cpp.

334{
335 const auto it = d->ditherOps.constFind(depth);
336 if (it != d->ditherOps.constEnd()) {
337 switch (type) {
338 case DITHER_FAST:
339 case DITHER_BAYER:
340 return it->constFind(DITHER_BAYER).value();
341 case DITHER_BEST:
343 return it->constFind(DITHER_BLUE_NOISE).value();
344 case DITHER_NONE:
345 default:
346 return it->constFind(DITHER_NONE).value();
347 }
348 } else {
349 warnPigment << "Asking for dither op from " << colorDepthId() << "to an unsupported depth" << depth << "!";
350 return nullptr;
351 }
352}
@ DITHER_NONE
Definition KisDitherOp.h:22
@ DITHER_BLUE_NOISE
Definition KisDitherOp.h:27
@ DITHER_BAYER
Definition KisDitherOp.h:26
@ DITHER_FAST
Definition KisDitherOp.h:23
@ DITHER_BEST
Definition KisDitherOp.h:24
int depth(typename Forest< T >::const_child_iterator beginIt, typename Forest< T >::const_child_iterator endIt)
Definition KisForest.h:1213

References colorDepthId(), d, DITHER_BAYER, DITHER_BEST, DITHER_BLUE_NOISE, DITHER_FAST, DITHER_NONE, and warnPigment.

◆ estimatedTRCXYY()

QPolygonF KoColorSpace::estimatedTRCXYY ( ) const

Definition at line 188 of file KoColorSpace.cpp.

189{
190 if (d->TRCXYY.empty()){
191 const QList<KoChannelInfo *> channelInfo = this->channels();
192
193 qreal max = 1.0;
194 if ((colorModelId().id()=="CMYKA" || colorModelId().id()=="LABA") && colorDepthId().id()=="F32") {
195 //boundaries for cmyka/laba have trouble getting the max values for Float, and are pretty awkward in general.
196 max = channelInfo[0]->getUIMax();
197 }
198 const KoColorSpace* xyzColorSpace = KoColorSpaceRegistry::instance()->colorSpace("XYZA", "F32");
199 quint8 *data = new quint8[pixelSize()];
200 quint8 *data2 = new quint8[xyzColorSpace->pixelSize()];
201
202 // This is fixed to 5 since the maximum number of channels are 5 for CMYKA
203 QVector <float> channelValuesF(5);//for getting the coordinates.
204
206
207 const int segments = 10;
208 for (quint32 i=0; i<colorChannelCount(); i++) {
209 qreal colorantY=1.0;
210 if (colorModelId().id()!="CMYKA") {
211 for (int j = 0; j <= segments; j++) {
212 channelValuesF.fill(0.0);
213 channelValuesF[channelInfo[i]->displayPosition()] = ((max/segments)*(segments-j));
214
215 if (colorModelId().id()!="XYZA") { //no need for conversion when using xyz.
216 fromNormalisedChannelsValue(data, channelValuesF);
218 xyzColorSpace->normalisedChannelsValue(data2,channelValuesF);
219 }
220 if (j==0) {
221 colorantY = channelValuesF[1];
222 d->colorants[i].x = channelValuesF[0]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
223 d->colorants[i].y = channelValuesF[1]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
224 d->colorants[i].Y = channelValuesF[1];
225 }
226 d->TRCXYY << QPointF(channelValuesF[1]/colorantY, ((1.0/segments)*(segments-j)));
227 }
228 } else {
229 for (int j = 0; j <= segments; j++) {
230 channelValuesF.fill(0.0);
231 channelValuesF[i] = ((max/segments)*(j));
232
233 fromNormalisedChannelsValue(data, channelValuesF);
234
236
237 xyzColorSpace->normalisedChannelsValue(data2,channelValuesF);
238
239 if (j==0) {
240 colorantY = channelValuesF[1];
241 d->colorants[i].x = channelValuesF[0]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
242 d->colorants[i].y = channelValuesF[1]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
243 d->colorants[i].Y = channelValuesF[1];
244 }
245 d->TRCXYY << QPointF(channelValuesF[1]/colorantY, ((1.0/segments)*(j)));
246 }
247 }
248 }
249
250 delete[] data;
251 delete[] data2;
252 return d->TRCXYY;
253 } else {
254 return d->TRCXYY;
255 }
256}
QList< KoChannelInfo * > channels
virtual quint32 colorChannelCount() const =0
constexpr std::enable_if< sizeof...(values)==0, size_t >::type max()
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)

References KoColorConversionTransformation::adjustmentConversionFlags(), channels, colorChannelCount(), colorDepthId(), colorModelId(), KoColorSpaceRegistry::colorSpace(), convertPixelsTo(), d, fromNormalisedChannelsValue(), KoID::id(), KoColorSpaceRegistry::instance(), KoColorConversionTransformation::IntentAbsoluteColorimetric, normalisedChannelsValue(), and pixelSize().

◆ fillGrayBrushWithColor()

◆ fillGrayBrushWithColorAndLightnessOverlay()

void KoColorSpace::fillGrayBrushWithColorAndLightnessOverlay ( quint8 * dst,
const QRgb * brush,
quint8 * brushColor,
qint32 nPixels ) const
virtual

Fills dst with specified brushColor and then applies inverted brush mask specified in brush. Inverted red channel of the brush is used as lightness of the destination. Alpha channel of the brush is used as alpha of the destination.

The equation is:

dstL_hsl = preserveLightness(colorL_hsl, lightFactor);
dstA = qAlpha(brush);

For details on preserveLightness() formula, see KoColorSpacePreserveLightnessUtils.h

Reimplemented in KoRgbU16ColorSpace, KoRgbU8ColorSpace, RgbF16ColorSpace, RgbF32ColorSpace, RgbU16ColorSpace, and RgbU8ColorSpace.

Definition at line 876 of file KoColorSpace.cpp.

877{
878 fillGrayBrushWithColorAndLightnessWithStrength(dst, brush, brushColor, 1.0, nPixels);
879}
virtual void fillGrayBrushWithColorAndLightnessWithStrength(quint8 *dst, const QRgb *brush, quint8 *brushColor, qreal strength, qint32 nPixels) const

References fillGrayBrushWithColorAndLightnessWithStrength().

◆ fillGrayBrushWithColorAndLightnessWithStrength()

void KoColorSpace::fillGrayBrushWithColorAndLightnessWithStrength ( quint8 * dst,
const QRgb * brush,
quint8 * brushColor,
qreal strength,
qint32 nPixels ) const
virtual

Fallback implementation. All RGB color spaces have their own implementation without any conversions.

Reimplemented in KoRgbU16ColorSpace, KoRgbU8ColorSpace, RgbF16ColorSpace, RgbF32ColorSpace, RgbU16ColorSpace, and RgbU8ColorSpace.

Definition at line 881 of file KoColorSpace.cpp.

882{
885
886 const int rgbPixelSize = sizeof(KoBgrU16Traits::Pixel);
887 QScopedArrayPointer<quint8> rgbBuffer(new quint8[(nPixels + 1) * rgbPixelSize]);
888 quint8* rgbBrushColorBuffer = rgbBuffer.data() + nPixels * rgbPixelSize;
889
890 // NOTE: dst buffer is not read during the process, so there is
891 // no need to convert that, just pass an uninitialized array
892 this->toRgbA16(brushColor, rgbBrushColorBuffer, 1);
893 fillGrayBrushWithColorPreserveLightnessRGB<KoBgrU16Traits>(rgbBuffer.data(), brush, rgbBrushColorBuffer, strength, nPixels);
894 this->fromRgbA16(rgbBuffer.data(), dst, nPixels);
895}
virtual void toRgbA16(const quint8 *src, quint8 *dst, quint32 nPixels) const
virtual void fromRgbA16(const quint8 *src, quint8 *dst, quint32 nPixels) const

References fromRgbA16(), and toRgbA16().

◆ fillInverseAlphaNormedFloatMaskWithColor()

◆ fromHSY()

◆ fromLabA16()

void KoColorSpace::fromLabA16 ( const quint8 * src,
quint8 * dst,
quint32 nPixels ) const
virtual

Convert the specified data from Lab (D50). to this colorspace. All colorspaces are guaranteed to support this.

Parameters
srcthe pixels in 16 bit lab format
dstthe destination data
nPixelsthe number of pixels in the array

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.

Definition at line 435 of file KoColorSpace.cpp.

436{
437 fromLabA16Converter()->transform(src, dst, nPixels);
438}
const KoColorConversionTransformation * fromLabA16Converter() const

References fromLabA16Converter(), and KoColorConversionTransformation::transform().

◆ fromLabA16Converter()

◆ fromNormalisedChannelsValue()

◆ fromQColor()

◆ fromRgbA16()

void KoColorSpace::fromRgbA16 ( const quint8 * src,
quint8 * dst,
quint32 nPixels ) const
virtual

Convert the specified data from sRGB 16 bits. to this colorspace. All colorspaces are guaranteed to support this.

Parameters
srcthe pixels in 16 bit rgb format
dstthe destination data
nPixelsthe number of pixels in the array

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.

Definition at line 445 of file KoColorSpace.cpp.

446{
447 fromRgbA16Converter()->transform(src, dst, nPixels);
448}
const KoColorConversionTransformation * fromRgbA16Converter() const

References fromRgbA16Converter(), and KoColorConversionTransformation::transform().

◆ fromRgbA16Converter()

◆ fromYUV()

◆ gamutXYY()

QPolygonF KoColorSpace::gamutXYY ( ) const

◆ hasCompositeOp()

bool KoColorSpace::hasCompositeOp ( const QString & id,
const KoColorSpace * srcSpace = nullptr ) const
virtual

Tests if the colorspace offers the specific composite op.

Parameters
srcSpaceoptional source color space. Some color spaces prefer blitting in source color space. If already known, additional composite ops may be available.

Definition at line 315 of file KoColorSpace.cpp.

316{
317 if (srcSpace && preferCompositionInSourceColorSpace() && srcSpace->hasCompositeOp(id)) {
318 return true;
319 }
320 return d->compositeOps.contains(id);
321}

References d, hasCompositeOp(), and preferCompositionInSourceColorSpace().

◆ hasHighDynamicRange()

◆ id()

QString KoColorSpace::id ( ) const

ID for use in files and internally: unchanging name. As the id must be unique it is usually the concatenation of the id of the color model and of the color depth, for instance "RGBA8" or "CMYKA16" or "XYZA32f".

◆ increaseBlue()

void KoColorSpace::increaseBlue ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 811 of file KoColorSpace.cpp.

811 {
812 int channelnumber = channelCount();
813 QVector <double> channelValues(channelnumber);
814 QVector <float> channelValuesF(channelnumber);
815 normalisedChannelsValue(pixel, channelValuesF);
816 for (int i=0;i<channelnumber;i++){
817 channelValues[i]=channelValuesF[i];
818 }
819 profile()->linearizeFloatValue(channelValues);
820 qreal y, u, v = 0.0;
821 toYUV(channelValues, &y, &u, &v);
822 v += step;
823 v = qBound(0.0, v, 1.0);
824 channelValues = fromYUV(&y, &u, &v);
825 profile()->delinearizeFloatValue(channelValues);
826 for (int i=0;i<channelnumber;i++){
827 channelValuesF[i]=channelValues[i];
828 }
829 fromNormalisedChannelsValue(pixel, channelValuesF);
830 setOpacity(pixel, 1.0, 1);
831}
qreal v
qreal u
virtual void toYUV(const QVector< double > &channelValues, qreal *y, qreal *u, qreal *v) const =0
virtual QVector< double > fromYUV(qreal *y, qreal *u, qreal *v) const =0

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromNormalisedChannelsValue(), fromYUV(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), toYUV(), u, and v.

◆ increaseGreen()

void KoColorSpace::increaseGreen ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 789 of file KoColorSpace.cpp.

789 {
790 int channelnumber = channelCount();
791 QVector <double> channelValues(channelnumber);
792 QVector <float> channelValuesF(channelnumber);
793 normalisedChannelsValue(pixel, channelValuesF);
794 for (int i=0;i<channelnumber;i++){
795 channelValues[i]=channelValuesF[i];
796 }
797 profile()->linearizeFloatValue(channelValues);
798 qreal y, u, v = 0.0;
799 toYUV(channelValues, &y, &u, &v);
800 u -= step;
801 u = qBound(0.0, u, 1.0);
802 channelValues = fromYUV(&y, &u, &v);
803 profile()->delinearizeFloatValue(channelValues);
804 for (int i=0;i<channelnumber;i++){
805 channelValuesF[i]=channelValues[i];
806 }
807 fromNormalisedChannelsValue(pixel, channelValuesF);
808 setOpacity(pixel, 1.0, 1);
809}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromNormalisedChannelsValue(), fromYUV(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), toYUV(), u, and v.

◆ increaseHue()

void KoColorSpace::increaseHue ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 719 of file KoColorSpace.cpp.

719 {
720 int channelnumber = channelCount(); //doesn't work for cmyka...
721 QVector <double> channelValues(channelnumber);
722 QVector <float> channelValuesF(channelnumber);
723 normalisedChannelsValue(pixel, channelValuesF);
724 for (int i=0;i<channelnumber;i++){
725 channelValues[i]=channelValuesF[i];
726 }
727 profile()->linearizeFloatValue(channelValues);
728 qreal hue, sat, luma = 0.0;
729 toHSY(channelValues, &hue, &sat, &luma);
730 if (hue+step>1.0){
731 hue=(hue+step)- 1.0;
732 } else {
733 hue += step;
734 }
735 channelValues = fromHSY(&hue, &sat, &luma);
736 profile()->delinearizeFloatValue(channelValues);
737 for (int i=0;i<channelnumber;i++){
738 channelValuesF[i]=channelValues[i];
739 }
740 fromNormalisedChannelsValue(pixel, channelValuesF);
741 setOpacity(pixel, 1.0, 1);
742}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ increaseLuminosity()

void KoColorSpace::increaseLuminosity ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 609 of file KoColorSpace.cpp.

609 {
610 int channelnumber = channelCount();
611 QVector <double> channelValues(channelnumber);
612 QVector <float> channelValuesF(channelnumber);
613 normalisedChannelsValue(pixel, channelValuesF);
614 for (int i=0;i<channelnumber;i++){
615 channelValues[i]=channelValuesF[i];
616 }
617 if (profile()->hasTRC()){
618 //only linearise and crunch the luma if there's a TRC
619 profile()->linearizeFloatValue(channelValues);
620 qreal hue, sat, luma = 0.0;
621 toHSY(channelValues, &hue, &sat, &luma);
622 luma = pow(luma, 1/2.2);
623 luma = qMin(1.0, luma + step);
624 luma = pow(luma, 2.2);
625 channelValues = fromHSY(&hue, &sat, &luma);
626 profile()->delinearizeFloatValue(channelValues);
627 } else {
628 qreal hue, sat, luma = 0.0;
629 toHSY(channelValues, &hue, &sat, &luma);
630 luma = qMin(1.0, luma + step);
631 channelValues = fromHSY(&hue, &sat, &luma);
632 }
633 for (int i=0;i<channelnumber;i++){
634 channelValuesF[i]=channelValues[i];
635 }
636 fromNormalisedChannelsValue(pixel, channelValuesF);
637 setOpacity(pixel, 1.0, 1);
638}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ increaseRed()

void KoColorSpace::increaseRed ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 768 of file KoColorSpace.cpp.

768 {
769 int channelnumber = channelCount();
770 QVector <double> channelValues(channelnumber);
771 QVector <float> channelValuesF(channelnumber);
772 normalisedChannelsValue(pixel, channelValuesF);
773 for (int i=0;i<channelnumber;i++){
774 channelValues[i]=channelValuesF[i];
775 }
776 profile()->linearizeFloatValue(channelValues);
777 qreal y, u, v = 0.0;
778 toYUV(channelValues, &y, &u, &v);
779 u += step;
780 u = qBound(0.0, u, 1.0);
781 channelValues = fromYUV(&y, &u, &v);
782 profile()->delinearizeFloatValue(channelValues);
783 for (int i=0;i<channelnumber;i++){
784 channelValuesF[i]=channelValues[i];
785 }
786 fromNormalisedChannelsValue(pixel, channelValuesF);
787 setOpacity(pixel, 1.0, 1);
788}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromNormalisedChannelsValue(), fromYUV(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), toYUV(), u, and v.

◆ increaseSaturation()

void KoColorSpace::increaseSaturation ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 677 of file KoColorSpace.cpp.

677 {
678 int channelnumber = channelCount();
679 QVector <double> channelValues(channelnumber);
680 QVector <float> channelValuesF(channelnumber);
681 normalisedChannelsValue(pixel, channelValuesF);
682 for (int i=0;i<channelnumber;i++){
683 channelValues[i]=channelValuesF[i];
684 }
685 profile()->linearizeFloatValue(channelValues);
686 qreal hue, sat, luma = 0.0;
687 toHSY(channelValues, &hue, &sat, &luma);
688 sat += step;
689 sat = qBound(0.0, sat, 1.0);
690 channelValues = fromHSY(&hue, &sat, &luma);
691 profile()->delinearizeFloatValue(channelValues);
692 for (int i=0;i<channelnumber;i++){
693 channelValuesF[i]=channelValues[i];
694 }
695 fromNormalisedChannelsValue(pixel, channelValuesF);
696 setOpacity(pixel, 1.0, 1);
697}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromHSY(), fromNormalisedChannelsValue(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), and toHSY().

◆ increaseYellow()

void KoColorSpace::increaseYellow ( quint8 * pixel,
qreal step ) const
virtual

Definition at line 833 of file KoColorSpace.cpp.

833 {
834 int channelnumber = channelCount();
835 QVector <double> channelValues(channelnumber);
836 QVector <float> channelValuesF(channelnumber);
837 normalisedChannelsValue(pixel, channelValuesF);
838 for (int i=0;i<channelnumber;i++){
839 channelValues[i]=channelValuesF[i];
840 }
841 profile()->linearizeFloatValue(channelValues);
842 qreal y, u, v = 0.0;
843 toYUV(channelValues, &y, &u, &v);
844 v -= step;
845 v = qBound(0.0, v, 1.0);
846 channelValues = fromYUV(&y, &u, &v);
847 profile()->delinearizeFloatValue(channelValues);
848 for (int i=0;i<channelnumber;i++){
849 channelValuesF[i]=channelValues[i];
850 }
851 fromNormalisedChannelsValue(pixel, channelValuesF);
852 setOpacity(pixel, 1.0, 1);
853}

References channelCount(), KoColorProfile::delinearizeFloatValue(), fromNormalisedChannelsValue(), fromYUV(), KoColorProfile::linearizeFloatValue(), normalisedChannelsValue(), profile(), setOpacity(), toYUV(), u, and v.

◆ intensity8()

◆ intensityF()

◆ lumaCoefficients()

QVector< qreal > KoColorSpace::lumaCoefficients ( ) const

◆ mixColorsOp()

virtual KoMixColorsOp * KoColorSpace::mixColorsOp ( ) const
virtual
Returns
the mix color operation of this colorspace (do not delete it locally, it's deleted by the colorspace).

◆ modulateLightnessByGrayBrush()

void KoColorSpace::modulateLightnessByGrayBrush ( quint8 * dst,
const QRgb * brush,
qreal strength,
qint32 nPixels ) const
virtual

Fallback implementation. All RGB color spaces have their own implementation without any conversions.

Reimplemented in KoRgbU16ColorSpace, KoRgbU8ColorSpace, RgbF16ColorSpace, RgbF32ColorSpace, RgbU16ColorSpace, and RgbU8ColorSpace.

Definition at line 897 of file KoColorSpace.cpp.

898{
901
902 const int rgbPixelSize = sizeof(KoBgrU16Traits::Pixel);
903 QScopedArrayPointer<quint8> dstBuffer(new quint8[nPixels * rgbPixelSize]);
904
905 this->toRgbA16(dst, dstBuffer.data(), nPixels);
906 modulateLightnessByGrayBrushRGB<KoBgrU16Traits>(dstBuffer.data(), brush, strength, nPixels);
907 this->fromRgbA16(dstBuffer.data(), dst, nPixels);
908}

References fromRgbA16(), and toRgbA16().

◆ multiplyAlpha()

◆ name()

QString KoColorSpace::name ( ) const

User visible name which contains the name of the color model and of the color depth. For instance "RGBA (8-bits)" or "CMYKA (16-bits)".

◆ normalisedChannelsValue()

◆ normalisedChannelValueText()

◆ opacityF()

◆ opacityU8()

◆ operator==()

bool KoColorSpace::operator== ( const KoColorSpace & rhs) const
virtual

Definition at line 95 of file KoColorSpace.cpp.

96{
97 const KoColorProfile* p1 = rhs.profile();
98 const KoColorProfile* p2 = profile();
99 return d->idNumber == rhs.d->idNumber && ((p1 == p2) || (*p1 == *p2));
100}
QPointF p2
QPointF p1

References d, p1, p2, and profile().

◆ pixelSize()

◆ preferCompositionInSourceColorSpace()

bool KoColorSpace::preferCompositionInSourceColorSpace ( ) const
protectedvirtual

This function defines the behavior of the bitBlt function when the composition of pixels in different colorspaces is requested, that is in case:

srcCS == any dstCS == this

1) preferCompositionInSourceColorSpace() == false,

the source pixels are first converted to *this color space and then composition is performed.

2) preferCompositionInSourceColorSpace() == true,

the destination pixels are first converted into *srcCS color space, then the composition is done, and the result is finally converted into *this colorspace.

This is used by alpha8() color space mostly, because it has weaker representation of the color, so the composition should be done in CS with richer functionality.

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >.

Definition at line 871 of file KoColorSpace.cpp.

872{
873 return false;
874}

◆ profile()

◆ profileIsCompatible()

◆ proofPixelsTo()

bool KoColorSpace::proofPixelsTo ( const quint8 * src,
quint8 * dst,
quint32 numPixels,
KoColorConversionTransformation * proofingTransform ) const
virtual

proofPixelsTo

Parameters
srcsource
dstdestination
numPixelsthe amount of pixels.
proofingTransformthe intent used for proofing.
Returns

Definition at line 487 of file KoColorSpace.cpp.

491{
492 proofingTransform->transform(src, dst, numPixels);
493
494 //the transform is deleted in the destructor.
495 return true;
496}

References KoColorConversionTransformation::transform().

◆ scaleToU8()

◆ setOpacity() [1/2]

◆ setOpacity() [2/2]

◆ singleChannelPixel()

◆ toHSY()

◆ toLabA16()

void KoColorSpace::toLabA16 ( const quint8 * src,
quint8 * dst,
quint32 nPixels ) const
virtual

Convert the specified data to Lab (D50). All colorspaces are guaranteed to support this

Parameters
srcthe source data
dstthe destination data
nPixelsthe number of source pixels

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.

Definition at line 430 of file KoColorSpace.cpp.

431{
432 toLabA16Converter()->transform(src, dst, nPixels);
433}
const KoColorConversionTransformation * toLabA16Converter() const

References toLabA16Converter(), and KoColorConversionTransformation::transform().

◆ toLabA16Converter()

◆ toQColor()

◆ toQColor16()

virtual void KoColorSpace::toQColor16 ( const quint8 * src,
QColor * c ) const
pure virtual

The toQColor16 methods take a byte array that is at least pixelSize() long and converts the contents to a 16 bit QColor, using the given profile as a source profile and the optional profile as a destination profile.

Parameters
srca pointer to the source pixel
cthe QColor that will be filled with the color at src

Implemented in KoColorSpaceAbstract< _CSTrait >, KoColorSpaceAbstract< _CSTraits >, KoColorSpaceAbstract< KoBgrU16Traits >, KoColorSpaceAbstract< KoBgrU8Traits >, KoColorSpaceAbstract< KoCmykF32Traits >, KoColorSpaceAbstract< KoCmykU16Traits >, KoColorSpaceAbstract< KoCmykU8Traits >, KoColorSpaceAbstract< KoGrayF16Traits >, KoColorSpaceAbstract< KoGrayF32Traits >, KoColorSpaceAbstract< KoGrayU16Traits >, KoColorSpaceAbstract< KoGrayU8Traits >, KoColorSpaceAbstract< KoLabF32Traits >, KoColorSpaceAbstract< KoLabU16Traits >, KoColorSpaceAbstract< KoLabU8Traits >, KoColorSpaceAbstract< KoRgbF16Traits >, KoColorSpaceAbstract< KoRgbF32Traits >, KoColorSpaceAbstract< KoXyzF16Traits >, KoColorSpaceAbstract< KoXyzF32Traits >, KoColorSpaceAbstract< KoXyzU16Traits >, KoColorSpaceAbstract< KoXyzU8Traits >, KoColorSpaceAbstract< KoYCbCrF32Traits >, KoColorSpaceAbstract< KoYCbCrU16Traits >, KoColorSpaceAbstract< KoYCbCrU8Traits >, LcmsColorSpace< _CSTraits >, LcmsColorSpace< KoBgrU16Traits >, LcmsColorSpace< KoBgrU8Traits >, LcmsColorSpace< KoCmykF32Traits >, LcmsColorSpace< KoCmykU16Traits >, LcmsColorSpace< KoCmykU8Traits >, LcmsColorSpace< KoGrayF16Traits >, LcmsColorSpace< KoGrayF32Traits >, LcmsColorSpace< KoGrayU16Traits >, LcmsColorSpace< KoGrayU8Traits >, LcmsColorSpace< KoLabF32Traits >, LcmsColorSpace< KoLabU16Traits >, LcmsColorSpace< KoLabU8Traits >, LcmsColorSpace< KoRgbF16Traits >, LcmsColorSpace< KoRgbF32Traits >, LcmsColorSpace< KoXyzF16Traits >, LcmsColorSpace< KoXyzF32Traits >, LcmsColorSpace< KoXyzU16Traits >, LcmsColorSpace< KoXyzU8Traits >, LcmsColorSpace< KoYCbCrF32Traits >, LcmsColorSpace< KoYCbCrU16Traits >, and LcmsColorSpace< KoYCbCrU8Traits >.

◆ toRgbA16()

void KoColorSpace::toRgbA16 ( const quint8 * src,
quint8 * dst,
quint32 nPixels ) const
virtual

Convert the specified data to sRGB 16 bits. All colorspaces are guaranteed to support this

Parameters
srcthe source data
dstthe destination data
nPixelsthe number of source pixels

Reimplemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.

Definition at line 440 of file KoColorSpace.cpp.

441{
442 toRgbA16Converter()->transform(src, dst, nPixels);
443}
const KoColorConversionTransformation * toRgbA16Converter() const

References toRgbA16Converter(), and KoColorConversionTransformation::transform().

◆ toRgbA16Converter()

◆ toYUV()

◆ transparentColor()

void KoColorSpace::transparentColor ( quint8 * dst,
quint32 nPixels ) const
virtual

Fills the provided buffer with fully transparent color in this color space.

Not all color spaces support conversion from QColor (e.g. InputClass spaces), so for them we need to generate this color separately.

Definition at line 394 of file KoColorSpace.cpp.

395{
396 memset(dst, 0, pixelSize() * nPixels);
397 setOpacity(dst, OPACITY_TRANSPARENT_U8, nPixels);
398}
const quint8 OPACITY_TRANSPARENT_U8

References OPACITY_TRANSPARENT_U8, pixelSize(), and setOpacity().

◆ willDegrade()

virtual bool KoColorSpace::willDegrade ( ColorSpaceIndependence independence) const
pure virtual

If false, images in this colorspace will degrade considerably by functions, tools and filters that have the given measure of colorspace independence.

Parameters
independencethe measure to which this colorspace will suffer from the manipulations of the tool or filter asking
Returns
false if no degradation will take place, true if degradation will take place

Implemented in KoAlphaColorSpaceImpl< _CSTrait >, KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, KoSimpleColorSpace< KoLabU16Traits >, CmykF32ColorSpace, CmykU16ColorSpace, CmykU8ColorSpace, LabF32ColorSpace, LabU16ColorSpace, LabU8ColorSpace, RgbF16ColorSpace, RgbF32ColorSpace, RgbU16ColorSpace, XyzF16ColorSpace, XyzF32ColorSpace, XyzU16ColorSpace, XyzU8ColorSpace, YCbCrF32ColorSpace, YCbCrU16ColorSpace, YCbCrU8ColorSpace, GrayF16ColorSpace, GrayF32ColorSpace, GrayAU16ColorSpace, GrayAU8ColorSpace, and RgbU8ColorSpace.

Friends And Related Symbol Documentation

◆ KoColorSpaceFactory

friend class KoColorSpaceFactory
friend

Definition at line 80 of file KoColorSpace.h.

◆ KoColorSpaceRegistry

friend class KoColorSpaceRegistry
friend

Definition at line 79 of file KoColorSpace.h.

Member Data Documentation

◆ channelFlagsApplicationCache

ThreadLocalCache KoColorSpace::channelFlagsApplicationCache
mutable

Definition at line 52 of file KoColorSpace_p.h.

◆ channels

QList< KoChannelInfo * > KoColorSpace::channels

Definition at line 46 of file KoColorSpace_p.h.

◆ colorants

QVector<KoColorimetryUtils::xyY> KoColorSpace::colorants

Definition at line 61 of file KoColorSpace_p.h.

◆ compositeOps

QList< KoCompositeOp * > KoColorSpace::compositeOps

Definition at line 45 of file KoColorSpace_p.h.

◆ conversionCache

ThreadLocalCache KoColorSpace::conversionCache
mutable

Definition at line 51 of file KoColorSpace_p.h.

◆ convolutionOp

KoConvolutionOp * KoColorSpace::convolutionOp

Definition at line 48 of file KoColorSpace_p.h.

◆ d

Private* const KoColorSpace::d
protected

Definition at line 751 of file KoColorSpace.h.

◆ deletability

Deletability KoColorSpace::deletability

Definition at line 66 of file KoColorSpace_p.h.

◆ ditherOps

QHash<QString, QMap<DitherType, KisDitherOp*> > KoColorSpace::ditherOps

Definition at line 49 of file KoColorSpace_p.h.

◆ gamutXYY

QPolygonF KoColorSpace::gamutXYY

Definition at line 59 of file KoColorSpace_p.h.

◆ iccEngine

KoColorSpaceEngine* KoColorSpace::iccEngine

Definition at line 64 of file KoColorSpace_p.h.

◆ id

QString KoColorSpace::id

Definition at line 42 of file KoColorSpace_p.h.

◆ idNumber

quint32 KoColorSpace::idNumber

Definition at line 43 of file KoColorSpace_p.h.

◆ lumaCoefficients

QVector< qreal > KoColorSpace::lumaCoefficients

Definition at line 62 of file KoColorSpace_p.h.

◆ mixColorsOp

KoMixColorsOp * KoColorSpace::mixColorsOp

Definition at line 47 of file KoColorSpace_p.h.

◆ name

QString KoColorSpace::name

Definition at line 44 of file KoColorSpace_p.h.

◆ transfoFromLABA16

KoColorConversionTransformation* KoColorSpace::transfoFromLABA16
mutable

Definition at line 57 of file KoColorSpace_p.h.

◆ transfoFromRGBA16

KoColorConversionTransformation* KoColorSpace::transfoFromRGBA16
mutable

Definition at line 55 of file KoColorSpace_p.h.

◆ transfoToLABA16

KoColorConversionTransformation* KoColorSpace::transfoToLABA16
mutable

Definition at line 56 of file KoColorSpace_p.h.

◆ transfoToRGBA16

KoColorConversionTransformation* KoColorSpace::transfoToRGBA16
mutable

Definition at line 54 of file KoColorSpace_p.h.

◆ TRCXYY

QPolygonF KoColorSpace::TRCXYY

Definition at line 60 of file KoColorSpace_p.h.


The documentation for this struct was generated from the following files: