|
Krita Source Code Documentation
|
#include <KoColorSpaceAbstract.h>
Inheritance diagram for KoColorSpaceAbstract< _CSTrait >:Public Types | |
| typedef _CSTrait | ColorSpaceTraits |
Public Member Functions | |
| quint32 | alphaPos () const override |
| void | applyAlphaNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels) const override |
| void | applyAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels) const override |
| void | applyInverseAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels) const override |
| void | applyInverseNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels) const override |
| quint32 | channelCount () const override |
| QString | channelValueText (const quint8 *pixel, quint32 channelIndex) const override |
| quint32 | colorChannelCount () const override |
| void | convertChannelToVisualRepresentation (const quint8 *src, quint8 *dst, quint32 nPixels, const QBitArray selectedChannels) const override |
| void | convertChannelToVisualRepresentation (const quint8 *src, quint8 *dst, quint32 nPixels, const qint32 selectedChannelIndex) const override |
| void | copyOpacityU8 (quint8 *src, quint8 *dst, qint32 nPixels) const override |
| KoColorTransformation * | createDarkenAdjustment (qint32 shade, bool compensate, qreal compensation) const override |
| KoColorTransformation * | createInvertTransformation () const override |
| void | fillGrayBrushWithColor (quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const override |
| void | fillInverseAlphaNormedFloatMaskWithColor (quint8 *pixels, const float *alpha, const quint8 *brushColor, qint32 nPixels) const override |
| void | fromNormalisedChannelsValue (quint8 *pixel, const QVector< float > &values) const override |
| quint8 | intensity8 (const quint8 *src) const override |
| qreal | intensityF (const quint8 *src) const override |
| KoColorSpaceAbstract (const QString &id, const QString &name) | |
| void | multiplyAlpha (quint8 *pixels, quint8 alpha, qint32 nPixels) const override |
| void | normalisedChannelsValue (const quint8 *pixel, QVector< float > &channels) const override |
| QString | normalisedChannelValueText (const quint8 *pixel, quint32 channelIndex) const override |
| qreal | opacityF (const quint8 *U8_pixel) const override |
| quint8 | opacityU8 (const quint8 *U8_pixel) const override |
| quint32 | pixelSize () const override |
| quint8 | scaleToU8 (const quint8 *srcPixel, qint32 channelIndex) const override |
| void | setOpacity (quint8 *pixels, qreal alpha, qint32 nPixels) const override |
| void | setOpacity (quint8 *pixels, quint8 alpha, qint32 nPixels) const override |
| void | singleChannelPixel (quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex) const override |
| void | toQColor16 (const quint8 *src, QColor *c) const override |
Public Member Functions inherited from KoColorSpace | |
| virtual void | addCompositeOp (const KoCompositeOp *op) |
| virtual void | addDitherOp (KisDitherOp *op) |
| virtual void | bitBlt (const KoColorSpace *srcSpace, const KoCompositeOp::ParameterInfo ¶ms, const KoCompositeOp *op, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const |
| QBitArray | channelFlags (bool color=true, bool alpha=false) const |
| QList< KoChannelInfo * > | channels () const |
| 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 KoCompositeOp * | compositeOp (const QString &id, const KoColorSpace *srcSpace=nullptr) const |
| virtual QList< KoCompositeOp * > | compositeOps () const |
| 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 KoConvolutionOp * | convolutionOp () const |
| virtual KoColorTransformation * | createBrightnessContrastAdjustment (const quint16 *transferValues) const =0 |
| virtual KoColorConversionTransformation * | createColorConverter (const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const |
| KoColorTransformation * | createColorTransformation (const QString &id, const QHash< QString, QVariant > ¶meters) const |
| virtual KoColorTransformation * | createPerChannelAdjustment (const quint16 *const *transferValues) const =0 |
| virtual KoColorConversionTransformation * | createProofingTransform (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 KisDitherOp * | ditherOp (const QString &depth, DitherType type) const |
| QPolygonF | estimatedTRCXYY () const |
| 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 QVector< double > | fromHSY (qreal *hue, qreal *sat, qreal *luma) const =0 |
| virtual void | fromLabA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const |
| 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 |
| KoColorSpace (const QString &id, const QString &name, KoMixColorsOp *mixColorsOp, KoConvolutionOp *convolutionOp) | |
| Should be called by real color spaces. | |
| QVector< qreal > | lumaCoefficients () const |
| virtual KoMixColorsOp * | mixColorsOp () const |
| virtual void | modulateLightnessByGrayBrush (quint8 *dst, const QRgb *brush, qreal strength, qint32 nPixels) const |
| QString | name () const |
| virtual bool | operator== (const KoColorSpace &rhs) const |
| virtual const KoColorProfile * | profile () 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 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 | 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) | |
Private Attributes | |
| QScopedPointer< KoAlphaMaskApplicatorBase > | m_alphaMaskApplicator |
This in an implementation of KoColorSpace which can be used as a base for colorspaces with as many different channels of the same type.
The template parameters must be a class which inherits KoColorSpaceTrait (or a class with the same signature).
SOMETYPE is the type of the channel for instance (quint8, quint32...), SOMENBOFCHANNELS is the number of channels including the alpha channel SOMEALPHAPOS is the position of the alpha channel in the pixel (can be equal to -1 if no alpha channel).
Definition at line 38 of file KoColorSpaceAbstract.h.
| typedef _CSTrait KoColorSpaceAbstract< _CSTrait >::ColorSpaceTraits |
Definition at line 41 of file KoColorSpaceAbstract.h.
|
inline |
Definition at line 44 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Position of the alpha channel in a pixel
Implements KoColorSpace.
Definition at line 61 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Applies the specified float alpha mask to the pixels. We assume that there are just as many alpha values as pixels but we do not check this; alpha values have to be between 0.0 and 1.0
Implements KoColorSpace.
Definition at line 127 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Applies the specified 8-bit alpha mask to the pixels. We assume that there are just as many alpha values as pixels but we do not check this; the alpha values are assumed to be 8-bits.
Implements KoColorSpace.
Definition at line 119 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Applies the inverted 8-bit alpha mask to the pixels. We assume that there are just as many alpha values as pixels but we do not check this; the alpha values are assumed to be 8-bits.
Implements KoColorSpace.
Definition at line 123 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Applies the inverted specified float alpha mask to the pixels. We assume that there are just as many alpha values as pixels but we do not check this; alpha values have to be between 0.0 and 1.0
Implements KoColorSpace.
Definition at line 131 of file KoColorSpaceAbstract.h.
References KoColorSpaceAbstract< _CSTrait >::m_alphaMaskApplicator.
|
inlineoverridevirtual |
The total number of channels for a single pixel in this color model
Implements KoColorSpace.
Definition at line 57 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Return a string with the channel's value suitable for display in the gui.
Implements KoColorSpace.
Definition at line 70 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
The total number of color channels (excludes alpha) for a single pixel in this color model.
Implements KoColorSpace.
Definition at line 50 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Convert nPixels pixels in src into their human-visible visual representation. The channels are shown as if other channels were null (or, if Lab, L = 1.0, *a = *b = 0.0).
Both buffers are in the same color space.
| src | source buffer in (*this) color space |
| dst | destination buffer in the same color space as src |
| nPixels | length of the buffers in number of pixels |
| pixelSize | stride of each pixel in the destination buffer |
| selectedChannels | Bitmap of selected channels |
Implements KoColorSpace.
Reimplemented in KoLabColorSpace, LabF32ColorSpace, LabU16ColorSpace, and LabU8ColorSpace.
Definition at line 198 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Convert nPixels pixels in src into their human-visible visual representation. The channel is shown as grayscale.
Both buffers are in the same color space.
| src | source buffer in (*this) color space |
| dst | destination buffer in the same color space as src |
| nPixels | length of the buffers in number of pixels |
| pixelSize | stride of each pixel in the destination buffer |
| selectedChannelIndex | Index of the selected channel. |
Implements KoColorSpace.
Reimplemented in KoLabColorSpace, LabF32ColorSpace, LabU16ColorSpace, and LabU8ColorSpace.
Definition at line 173 of file KoColorSpaceAbstract.h.
References KoColorSpaceAbstract< _CSTrait >::alphaPos().
|
inlineoverridevirtual |
Copy the opacity of a run of pixels.
src – pixels to get opacity from. This is in the source colorspace. dst – pixels in Alpha8 colorspace to be assigned the opacity of src pixel nPixels – the number of pixels
Implements KoColorSpace.
Definition at line 111 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Darken all color channels with the given amount. If compensate is true, the compensation factor will be used to limit the darkening.
Implements KoColorSpace.
Reimplemented in KoSimpleColorSpace< _CSTraits >, KoSimpleColorSpace< KoBgrU16Traits >, KoSimpleColorSpace< KoBgrU8Traits >, and KoSimpleColorSpace< KoLabU16Traits >.
Definition at line 169 of file KoColorSpaceAbstract.h.
References KoColorSpaceRegistry::instance().
|
inlineoverridevirtual |
Invert color channels of the given pixels This function is thread-safe, but you need to create one KoColorTransformation per thread.
Implements KoColorSpace.
Definition at line 165 of file KoColorSpaceAbstract.h.
References KoInvertColorTransformation::getTransformator().
|
inlineoverridevirtual |
Fills dst with specified brushColor and then applies inverted brush mask specified in brush. Premultiplied red channel of the brush is used as an alpha channel for destination pixels.
The equation is:
dstC = colorC; dstA = qAlpha(brush) * (255 - qRed(brush)) / 255;
Implements KoColorSpace.
Definition at line 139 of file KoColorSpaceAbstract.h.
References KoColorSpaceAbstract< _CSTrait >::m_alphaMaskApplicator.
|
inlineoverridevirtual |
Fills pixels with specified brushColor and then applies inverted brush mask specified in alpha.
Implements KoColorSpace.
Definition at line 135 of file KoColorSpaceAbstract.h.
References KoColorSpaceAbstract< _CSTrait >::m_alphaMaskApplicator.
|
inlineoverridevirtual |
Write in the pixel the value from the normalized vector.
Implements KoColorSpace.
Definition at line 82 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Calculate the intensity of the given pixel, scaled down to the range 0-255. XXX: Maybe this should be more flexible
Implements KoColorSpace.
Reimplemented in RgbU8ColorSpace.
Definition at line 150 of file KoColorSpaceAbstract.h.
References KoColorSpace::toQColor().
|
inlineoverridevirtual |
Calculate the intensity of the given pixel, scaled down to the range 0-1
Implements KoColorSpace.
Reimplemented in RgbU8ColorSpace.
Definition at line 159 of file KoColorSpaceAbstract.h.
References KoColorSpaceAbstract< _CSTrait >::toQColor16().
|
inlineoverridevirtual |
Multiply the alpha channel of the given run of pixels by the given value.
pixels – a pointer to the pixels that will have their alpha set to this value alpha – a downscaled 8-bit value for opacity nPixels – the number of pixels
Implements KoColorSpace.
Definition at line 115 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Return a QVector of floats with channels' values normalized to floating point range 0 to 1.
Implements KoColorSpace.
Definition at line 78 of file KoColorSpaceAbstract.h.
References KoColorSpace::channels.
|
inlineoverridevirtual |
Return a string with the channel's value with integer channels normalised to the floating point range 0 to 1, if appropriate.
Implements KoColorSpace.
Definition at line 74 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 99 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Get the alpha value of the given pixel, downscaled to an 8-bit value.
Implements KoColorSpace.
Definition at line 95 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
The size in bytes of a single pixel in this color model
Implements KoColorSpace.
Definition at line 66 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Convert the value of the channel at the specified position into an 8-bit value. The position is not the number of bytes, but the position of the channel as defined in the channel info list.
Implements KoColorSpace.
Reimplemented in KoLabColorSpace, LabF32ColorSpace, LabU16ColorSpace, and LabU8ColorSpace.
Definition at line 86 of file KoColorSpaceAbstract.h.
References KoColorSpaceMaths< _T, _Tdst >::scaleToA().
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 107 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Set the alpha channel of the given run of pixels to the given value.
pixels – a pointer to the pixels that will have their alpha set to this value alpha – a downscaled 8-bit value for opacity nPixels – the number of pixels
Implements KoColorSpace.
Definition at line 103 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
Set dstPixel to the pixel containing only the given channel of srcPixel. The remaining channels should be set to whatever makes sense for 'empty' channels of this color space, with the intent being that the pixel should look like it only has the given channel.
Implements KoColorSpace.
Definition at line 91 of file KoColorSpaceAbstract.h.
|
inlineoverridevirtual |
By default this does the same as toQColor
Implements KoColorSpace.
Reimplemented in 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 >.
Definition at line 146 of file KoColorSpaceAbstract.h.
References KoColorSpace::toQColor().
|
private |
Definition at line 218 of file KoColorSpaceAbstract.h.