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< qreal > colorants
 
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 <qreal> (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 312 of file KoColorSpace.cpp.

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

References d.

◆ addCompositeOp()

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

add a composite op to this colorspace.

Definition at line 388 of file KoColorSpace.cpp.

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

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

◆ addDitherOp()

void KoColorSpace::addDitherOp ( KisDitherOp * op)
virtual

Definition at line 355 of file KoColorSpace.cpp.

356{
357 if (op->sourceDepthId() == colorDepthId()) {
358 if (!d->ditherOps.contains(op->destinationDepthId().id())) {
359 d->ditherOps.insert(op->destinationDepthId().id(), {{op->type(), op}});
360 } else {
361 d->ditherOps[op->destinationDepthId().id()].insert(op->type(), op);
362 }
363 }
364}
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 499 of file KoColorSpace.cpp.

502{
503 Q_ASSERT_X(*op->colorSpace() == *this || (preferCompositionInSourceColorSpace() && *op->colorSpace() == *srcSpace),
504 "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());
505
506 if(params.rows <= 0 || params.cols <= 0)
507 return;
508
509 if(!(*this == *srcSpace)) {
511 (*op->colorSpace() == *srcSpace || srcSpace->hasCompositeOp(op->id()))) {
512
513 quint32 conversionDstBufferStride = params.cols * srcSpace->pixelSize();
514 QVector<quint8> * conversionDstCache = d->conversionCache.get(params.rows * conversionDstBufferStride);
515 quint8* conversionDstData = conversionDstCache->data();
516
517 for(qint32 row=0; row<params.rows; row++) {
518 convertPixelsTo(params.dstRowStart + row * params.dstRowStride,
519 conversionDstData + row * conversionDstBufferStride, srcSpace, params.cols,
520 renderingIntent, conversionFlags);
521 }
522
523 // TODO: Composite op substitution should eventually be removed here, but it's not urgent.
524 // Code should just provide srcSpace to KoColorSpace::compositeOp() to avoid the lookups.
525 const KoCompositeOp *otherOp = (*op->colorSpace() == *srcSpace) ? op : srcSpace->compositeOp(op->id());
526
527 KoCompositeOp::ParameterInfo paramInfo(params);
528 paramInfo.dstRowStart = conversionDstData;
529 paramInfo.dstRowStride = conversionDstBufferStride;
530 otherOp->composite(paramInfo);
531
532 for(qint32 row=0; row<params.rows; row++) {
533 srcSpace->convertPixelsTo(conversionDstData + row * conversionDstBufferStride,
534 params.dstRowStart + row * params.dstRowStride, this, params.cols,
535 renderingIntent, conversionFlags);
536 }
537
538 } else {
539 quint32 conversionBufferStride = params.cols * pixelSize();
540 QVector<quint8> * conversionCache = d->conversionCache.get(params.rows * conversionBufferStride);
541 quint8* conversionData = conversionCache->data();
542
543
544 const bool noChannelFlags = params.channelFlags.isEmpty() ||
545 params.channelFlags == srcSpace->channelFlags(true, true);
546
547 if (noChannelFlags) {
548 for(qint32 row=0; row<params.rows; row++) {
549 srcSpace->convertPixelsTo(params.srcRowStart + row * params.srcRowStride,
550 conversionData + row * conversionBufferStride, this, params.cols,
551 renderingIntent, conversionFlags);
552 }
553
554 KoCompositeOp::ParameterInfo paramInfo(params);
555 paramInfo.srcRowStart = conversionData;
556 paramInfo.srcRowStride = conversionBufferStride;
557 paramInfo.channelFlags = QBitArray();
558 op->composite(paramInfo);
559 } else {
560 quint32 homogenizationBufferStride = params.cols * srcSpace->pixelSize();
561 QVector<quint8> * homogenizationCache = d->channelFlagsApplicationCache.get(homogenizationBufferStride);
562 quint8* homogenizationData = homogenizationCache->data();
563
564 for(qint32 row=0; row<params.rows; row++) {
565 srcSpace->convertChannelToVisualRepresentation(params.srcRowStart + row * params.srcRowStride,
566 homogenizationData, params.cols,
567 params.channelFlags | srcSpace->channelFlags(false, true));
568 srcSpace->convertPixelsTo(homogenizationData,
569 conversionData + row * conversionBufferStride, this, params.cols,
570 renderingIntent, conversionFlags);
571 }
572
573
574 KoCompositeOp::ParameterInfo paramInfo(params);
575 paramInfo.srcRowStart = conversionData;
576 paramInfo.srcRowStride = conversionBufferStride;
577 paramInfo.channelFlags = channelFlags(true, params.channelFlags.testBit(srcSpace->alphaPos()));
578 op->composite(paramInfo);
579 }
580
581
582 }
583 }
584 else {
585 op->composite(params);
586 }
587}
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 298 of file KoColorSpace.cpp.

299{
300 QBitArray ba(d->channels.size());
301 if (!color && !alpha) return ba;
302
303 for (int i = 0; i < d->channels.size(); ++i) {
304 KoChannelInfo * channel = d->channels.at(i);
305 if ((color && channel->channelType() == KoChannelInfo::COLOR) ||
306 (alpha && channel->channelType() == KoChannelInfo::ALPHA))
307 ba.setBit(i, true);
308 }
309 return ba;
310}
@ 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 371 of file KoColorSpace.cpp.

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

466{
467 if (*this == *dstColorSpace) {
468 if (src != dst) {
469 memcpy(dst, src, numPixels * sizeof(quint8) * pixelSize());
470 }
471 } else {
472 KoCachedColorConversionTransformation cct = KoColorSpaceRegistry::instance()->colorConversionCache()->cachedConverter(this, dstColorSpace, renderingIntent, conversionFlags);
473 cct.transformation()->transform(src, dst, numPixels);
474 }
475 return true;
476}
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 856 of file KoColorSpace.cpp.

861{
862 QImage img = QImage(width, height, QImage::Format_ARGB32);
863
864 const KoColorSpace * dstCS = KoColorSpaceRegistry::instance()->rgb8(dstProfile);
865
866 if (data)
867 this->convertPixelsTo(const_cast<quint8 *>(data), img.bits(), dstCS, width * height, renderingIntent, conversionFlags);
868
869 return img;
870}
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 451 of file KoColorSpace.cpp.

452{
453 if (*this == *dstColorSpace) {
455 } else {
456 return KoColorSpaceRegistry::instance()->createColorConverter(this, dstColorSpace, renderingIntent, conversionFlags);
457 }
458}
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 589 of file KoColorSpace.cpp.

590{
592 if (!factory) return 0;
593 QPair<KoID, KoID> model(colorModelId(), colorDepthId());
594 QList< QPair<KoID, KoID> > models = factory->supportedModels();
595 if (models.isEmpty() || models.contains(model)) {
596 return factory->createTransformation(this, parameters);
597 } else {
598 // Find the best solution
599 // TODO use the color conversion cache
600 KoColorConversionTransformation* csToFallBack = 0;
601 KoColorConversionTransformation* fallBackToCs = 0;
602 KoColorSpaceRegistry::instance()->createColorConverters(this, models, csToFallBack, fallBackToCs);
603 Q_ASSERT(csToFallBack);
604 Q_ASSERT(fallBackToCs);
605 KoColorTransformation* transfo = factory->createTransformation(fallBackToCs->srcColorSpace(), parameters);
606 return new KoFallBackColorTransformation(csToFallBack, fallBackToCs, transfo);
607 }
608}
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 478 of file KoColorSpace.cpp.

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

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

◆ decreaseHue()

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

Definition at line 744 of file KoColorSpace.cpp.

744 {
745 int channelnumber = channelCount();
746 QVector <double> channelValues(channelnumber);
747 QVector <float> channelValuesF(channelnumber);
748 normalisedChannelsValue(pixel, channelValuesF);
749 for (int i=0;i<channelnumber;i++){
750 channelValues[i]=channelValuesF[i];
751 }
752 profile()->linearizeFloatValue(channelValues);
753 qreal hue, sat, luma = 0.0;
754 toHSY(channelValues, &hue, &sat, &luma);
755 if (hue-step<0.0){
756 hue=1.0-(step-hue);
757 } else {
758 hue -= step;
759 }
760 channelValues = fromHSY(&hue, &sat, &luma);
761 profile()->delinearizeFloatValue(channelValues);
762 for (int i=0;i<channelnumber;i++){
763 channelValuesF[i]=channelValues[i];
764 }
765 fromNormalisedChannelsValue(pixel, channelValuesF);
766 setOpacity(pixel, 1.0, 1);
767}
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 640 of file KoColorSpace.cpp.

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

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 699 of file KoColorSpace.cpp.

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

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 334 of file KoColorSpace.cpp.

335{
336 const auto it = d->ditherOps.constFind(depth);
337 if (it != d->ditherOps.constEnd()) {
338 switch (type) {
339 case DITHER_FAST:
340 case DITHER_BAYER:
341 return it->constFind(DITHER_BAYER).value();
342 case DITHER_BEST:
344 return it->constFind(DITHER_BLUE_NOISE).value();
345 case DITHER_NONE:
346 default:
347 return it->constFind(DITHER_NONE).value();
348 }
349 } else {
350 warnPigment << "Asking for dither op from " << colorDepthId() << "to an unsupported depth" << depth << "!";
351 return nullptr;
352 }
353}
@ 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
205 d->colorants.resize(3*colorChannelCount());
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[3*i] = channelValuesF[0]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
223 d->colorants[3*i+1] = channelValuesF[1]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
224 d->colorants[3*i+2] = 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[3*i] = channelValuesF[0]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
242 d->colorants[3*i+1] = channelValuesF[1]/(channelValuesF[0]+channelValuesF[1]+channelValuesF[2]);
243 d->colorants[3*i+2] = 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 877 of file KoColorSpace.cpp.

878{
879 fillGrayBrushWithColorAndLightnessWithStrength(dst, brush, brushColor, 1.0, nPixels);
880}
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 882 of file KoColorSpace.cpp.

883{
886
887 const int rgbPixelSize = sizeof(KoBgrU16Traits::Pixel);
888 QScopedArrayPointer<quint8> rgbBuffer(new quint8[(nPixels + 1) * rgbPixelSize]);
889 quint8* rgbBrushColorBuffer = rgbBuffer.data() + nPixels * rgbPixelSize;
890
891 // NOTE: dst buffer is not read during the process, so there is
892 // no need to convert that, just pass an uninitialized array
893 this->toRgbA16(brushColor, rgbBrushColorBuffer, 1);
894 fillGrayBrushWithColorPreserveLightnessRGB<KoBgrU16Traits>(rgbBuffer.data(), brush, rgbBrushColorBuffer, strength, nPixels);
895 this->fromRgbA16(rgbBuffer.data(), dst, nPixels);
896}
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 436 of file KoColorSpace.cpp.

437{
438 fromLabA16Converter()->transform(src, dst, nPixels);
439}
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 446 of file KoColorSpace.cpp.

447{
448 fromRgbA16Converter()->transform(src, dst, nPixels);
449}
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 316 of file KoColorSpace.cpp.

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

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 812 of file KoColorSpace.cpp.

812 {
813 int channelnumber = channelCount();
814 QVector <double> channelValues(channelnumber);
815 QVector <float> channelValuesF(channelnumber);
816 normalisedChannelsValue(pixel, channelValuesF);
817 for (int i=0;i<channelnumber;i++){
818 channelValues[i]=channelValuesF[i];
819 }
820 profile()->linearizeFloatValue(channelValues);
821 qreal y, u, v = 0.0;
822 toYUV(channelValues, &y, &u, &v);
823 v += step;
824 v = qBound(0.0, v, 1.0);
825 channelValues = fromYUV(&y, &u, &v);
826 profile()->delinearizeFloatValue(channelValues);
827 for (int i=0;i<channelnumber;i++){
828 channelValuesF[i]=channelValues[i];
829 }
830 fromNormalisedChannelsValue(pixel, channelValuesF);
831 setOpacity(pixel, 1.0, 1);
832}
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 790 of file KoColorSpace.cpp.

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

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 720 of file KoColorSpace.cpp.

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

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 610 of file KoColorSpace.cpp.

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

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 769 of file KoColorSpace.cpp.

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

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 678 of file KoColorSpace.cpp.

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

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 834 of file KoColorSpace.cpp.

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

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 898 of file KoColorSpace.cpp.

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

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 872 of file KoColorSpace.cpp.

873{
874 return false;
875}

◆ 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 488 of file KoColorSpace.cpp.

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

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 431 of file KoColorSpace.cpp.

432{
433 toLabA16Converter()->transform(src, dst, nPixels);
434}
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 441 of file KoColorSpace.cpp.

442{
443 toRgbA16Converter()->transform(src, dst, nPixels);
444}
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 395 of file KoColorSpace.cpp.

396{
397 memset(dst, 0, pixelSize() * nPixels);
398 setOpacity(dst, OPACITY_TRANSPARENT_U8, nPixels);
399}
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 51 of file KoColorSpace_p.h.

◆ channels

QList< KoChannelInfo * > KoColorSpace::channels

Definition at line 45 of file KoColorSpace_p.h.

◆ colorants

QVector<qreal> KoColorSpace::colorants

Definition at line 60 of file KoColorSpace_p.h.

◆ compositeOps

QList< KoCompositeOp * > KoColorSpace::compositeOps

Definition at line 44 of file KoColorSpace_p.h.

◆ conversionCache

ThreadLocalCache KoColorSpace::conversionCache
mutable

Definition at line 50 of file KoColorSpace_p.h.

◆ convolutionOp

KoConvolutionOp * KoColorSpace::convolutionOp

Definition at line 47 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 65 of file KoColorSpace_p.h.

◆ ditherOps

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

Definition at line 48 of file KoColorSpace_p.h.

◆ gamutXYY

QPolygonF KoColorSpace::gamutXYY

Definition at line 58 of file KoColorSpace_p.h.

◆ iccEngine

KoColorSpaceEngine* KoColorSpace::iccEngine

Definition at line 63 of file KoColorSpace_p.h.

◆ id

QString KoColorSpace::id

Definition at line 41 of file KoColorSpace_p.h.

◆ idNumber

quint32 KoColorSpace::idNumber

Definition at line 42 of file KoColorSpace_p.h.

◆ lumaCoefficients

QVector< qreal > KoColorSpace::lumaCoefficients

Definition at line 61 of file KoColorSpace_p.h.

◆ mixColorsOp

KoMixColorsOp * KoColorSpace::mixColorsOp

Definition at line 46 of file KoColorSpace_p.h.

◆ name

QString KoColorSpace::name

Definition at line 43 of file KoColorSpace_p.h.

◆ transfoFromLABA16

KoColorConversionTransformation* KoColorSpace::transfoFromLABA16
mutable

Definition at line 56 of file KoColorSpace_p.h.

◆ transfoFromRGBA16

KoColorConversionTransformation* KoColorSpace::transfoFromRGBA16
mutable

Definition at line 54 of file KoColorSpace_p.h.

◆ transfoToLABA16

KoColorConversionTransformation* KoColorSpace::transfoToLABA16
mutable

Definition at line 55 of file KoColorSpace_p.h.

◆ transfoToRGBA16

KoColorConversionTransformation* KoColorSpace::transfoToRGBA16
mutable

Definition at line 53 of file KoColorSpace_p.h.

◆ TRCXYY

QPolygonF KoColorSpace::TRCXYY

Definition at line 59 of file KoColorSpace_p.h.


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