|
Krita Source Code Documentation
|
#include <KoAlphaColorSpace.h>
Inheritance diagram for KoAlphaColorSpaceImpl< _CSTrait >:Public Member Functions | |
| QString | channelValueText (const quint8 *pixel, quint32 channelIndex) const override |
| virtual KoColorSpace * | clone () const |
| quint32 | colorChannelCount () const override |
| KoID | colorDepthId () const override |
| void | colorFromXML (quint8 *, const QDomElement &) const override |
| KoID | colorModelId () const override |
| virtual quint32 | colorSpaceType () const |
| void | colorToXML (const quint8 *, QDomDocument &, QDomElement &) const override |
| QImage | convertToQImage (const quint8 *data, qint32 width, qint32 height, const KoColorProfile *dstProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const override |
| virtual void | convolveColors (quint8 **colors, qreal *kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray &channelFlags) const |
| KoColorTransformation * | createBrightnessContrastAdjustment (const quint16 *transferValues) const override |
| KoColorTransformation * | createDarkenAdjustment (qint32, bool, qreal) const override |
| KoColorTransformation * | createPerChannelAdjustment (const quint16 *const *) const override |
| quint8 | difference (const quint8 *src1, const quint8 *src2) const override |
| quint8 | differenceA (const quint8 *src1, const quint8 *src2) const override |
| QVector< double > | fromHSY (qreal *, qreal *, qreal *) const override |
| void | fromLabA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const override |
| void | fromQColor (const QColor &color, quint8 *dst) const override |
| void | fromRgbA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const override |
| QVector< double > | fromYUV (qreal *, qreal *, qreal *) const override |
| bool | hasHighDynamicRange () const override |
| virtual void | invertColor (quint8 *, qint32) const |
| KoAlphaColorSpaceImpl () | |
| QString | normalisedChannelValueText (const quint8 *pixel, quint32 channelIndex) const override |
| const KoColorProfile * | profile () const override |
| bool | profileIsCompatible (const KoColorProfile *) const override |
| void | toHSY (const QVector< double > &, qreal *, qreal *, qreal *) const override |
| void | toLabA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const override |
| void | toQColor (const quint8 *src, QColor *c) const override |
| void | toRgbA16 (const quint8 *src, quint8 *dst, quint32 nPixels) const override |
| void | toYUV (const QVector< double > &, qreal *, qreal *, qreal *) const override |
| bool | willDegrade (ColorSpaceIndependence independence) const override |
| ~KoAlphaColorSpaceImpl () override | |
Public Member Functions inherited from KoColorSpaceAbstract< _CSTrait > | |
| 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 |
| 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 KoConvolutionOp * | convolutionOp () const |
| 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 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 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 |
| QPolygonF | gamutXYY () const |
| virtual bool | hasCompositeOp (const QString &id, const KoColorSpace *srcSpace=nullptr) const |
| 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 bool | proofPixelsTo (const quint8 *src, quint8 *dst, quint32 numPixels, KoColorConversionTransformation *proofingTransform) const |
| proofPixelsTo | |
| virtual void | transparentColor (quint8 *dst, quint32 nPixels) const |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Static Public Member Functions | |
| static QString | colorSpaceId () |
Protected Member Functions | |
| bool | preferCompositionInSourceColorSpace () const override |
Protected Member Functions inherited from KoColorSpace | |
| virtual void | addChannel (KoChannelInfo *ci) |
| const KoColorConversionTransformation * | fromLabA16Converter () const |
| const KoColorConversionTransformation * | fromRgbA16Converter () const |
| KoColorSpace () | |
| Only for use by classes that serve as baseclass for real color spaces. | |
| const KoColorConversionTransformation * | toLabA16Converter () const |
| const KoColorConversionTransformation * | toRgbA16Converter () const |
| virtual | ~KoColorSpace () |
Private Types | |
| typedef KoColorSpaceMaths< channels_type > | _Maths |
| typedef KoColorSpaceMaths< quint8, channels_type > | _MathsFromU8 |
| typedef KoColorSpaceMaths< channels_type, quint8 > | _MathsToU8 |
| typedef _CSTrait::channels_type | channels_type |
Private Attributes | |
| KoColorProfile * | m_profile |
The alpha mask is a special color strategy that treats all pixels as alpha value with a color common to the mask. The default color is white.
Definition at line 51 of file KoAlphaColorSpace.h.
|
private |
Definition at line 54 of file KoAlphaColorSpace.h.
|
private |
Definition at line 56 of file KoAlphaColorSpace.h.
|
private |
Definition at line 55 of file KoAlphaColorSpace.h.
|
private |
Definition at line 53 of file KoAlphaColorSpace.h.
| KoAlphaColorSpaceImpl< _CSTrait >::KoAlphaColorSpaceImpl | ( | ) |
Definition at line 74 of file KoAlphaColorSpace.cpp.
References KoColorSpace::addChannel(), KoColorSpace::addCompositeOp(), and KoChannelInfo::ALPHA.
|
override |
Definition at line 89 of file KoAlphaColorSpace.cpp.
|
overridevirtual |
Return a string with the channel's value suitable for display in the gui.
Implements KoColorSpace.
Definition at line 120 of file KoAlphaColorSpace.cpp.
|
virtual |
Definition at line 242 of file KoAlphaColorSpace.cpp.
|
inlineoverridevirtual |
The total number of color channels (excludes alpha) for a single pixel in this color model.
Implements KoColorSpace.
Definition at line 95 of file KoAlphaColorSpace.h.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 73 of file KoAlphaColorSpace.h.
|
inlineoverridevirtual |
Unserialize a 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
| pixel | buffer where the color will be unserialized |
| elt | the element to unserialize (<CMYK />, <sRGB />, <RGB />) |
Implements KoColorSpace.
Definition at line 152 of file KoAlphaColorSpace.h.
References warnPigment.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 69 of file KoAlphaColorSpace.h.
References AlphaColorModelID.
|
inlinestatic |
Definition at line 65 of file KoAlphaColorSpace.h.
|
inlinevirtual |
Definition at line 105 of file KoAlphaColorSpace.h.
|
inlineoverridevirtual |
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.
| pixel | buffer to serialized |
| colorElt | root element for the serialization, it is assumed that this element is <color /> |
| doc | is the document containing colorElt |
Implements KoColorSpace.
Definition at line 148 of file KoAlphaColorSpace.h.
References warnPigment.
|
overridevirtual |
Convert the pixels in data to (8-bit BGRA) QImage using the specified profiles.
| data | A pointer to a contiguous memory region containing width * height pixels |
| width | in pixels |
| height | in pixels |
| dstProfile | destination profile |
| renderingIntent | the rendering intent |
| conversionFlags | conversion flags |
Reimplemented from KoColorSpace.
Definition at line 156 of file KoAlphaColorSpace.cpp.
|
virtual |
Definition at line 136 of file KoAlphaColorSpace.cpp.
|
inlineoverridevirtual |
Create an adjustment object for adjusting the brightness and contrast transferValues is a 256 bins array with values from 0 to 0xFFFF This function is thread-safe, but you need to create one KoColorTransformation per thread.
Implements KoColorSpace.
Definition at line 128 of file KoAlphaColorSpace.h.
References warnPigment.
|
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.
Definition at line 139 of file KoAlphaColorSpace.h.
References warnPigment.
|
inlineoverridevirtual |
Create an adjustment object for adjusting individual channels transferValues is an array of colorChannelCount number of 256 bins array with values from 0 to 0xFFFF This function is thread-safe, but you need to create one KoColorTransformation per thread.
The layout of the channels must be the following:
0..N-2 - color channels of the pixel; N-1 - alpha channel of the pixel (if exists)
Implements KoColorSpace.
Definition at line 134 of file KoAlphaColorSpace.h.
References warnPigment.
|
overridevirtual |
Get the difference between 2 colors, normalized in the range (0,255). Only completely opaque and completely transparent are taken into account when computing the difference; other transparency levels are not regarded when finding the difference.
Completely transparent pixels are treated as if they are completely different from any non-transparent pixels.
Implements KoColorSpace.
Definition at line 108 of file KoAlphaColorSpace.cpp.
|
overridevirtual |
Get the difference between 2 colors, normalized in the range (0,255). This function takes the Alpha channel of the pixel into account. Alpha channel has the same weight as Lightness channel.
Completely transparent pixels are treated as if their color channels are the same as ones of the other pixel. In other words, only alpha channel difference is compared.
Implements KoColorSpace.
Definition at line 114 of file KoAlphaColorSpace.cpp.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 160 of file KoAlphaColorSpace.h.
References warnPigment.
|
overridevirtual |
Convert the specified data from Lab (D50). to this colorspace. All colorspaces are guaranteed to support this.
| src | the pixels in 16 bit lab format |
| dst | the destination data |
| nPixels | the number of pixels in the array |
Reimplemented from KoColorSpace.
Definition at line 197 of file KoAlphaColorSpace.cpp.
References KoColorSpaceMaths< _T, _Tdst >::scaleToA(), and UINT16_MULT().
|
overridevirtual |
The fromQColor methods take a given color defined as an RGB QColor and fills a byte array with the corresponding color in the the colorspace managed by this strategy.
| color | the QColor that will be used to fill dst |
| dst | a pointer to a pixel |
Implements KoColorSpace.
Definition at line 96 of file KoAlphaColorSpace.cpp.
|
overridevirtual |
Convert the specified data from sRGB 16 bits. to this colorspace. All colorspaces are guaranteed to support this.
| src | the pixels in 16 bit rgb format |
| dst | the destination data |
| nPixels | the number of pixels in the array |
Reimplemented from KoColorSpace.
Definition at line 228 of file KoAlphaColorSpace.cpp.
References KoColorSpaceMaths< _T, _Tdst >::scaleToA(), and UINT16_MULT().
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 171 of file KoAlphaColorSpace.h.
References warnPigment.
|
inlineoverridevirtual |
Returns true if the colorspace supports channel values outside the (normalised) range 0 to 1.
Implements KoColorSpace.
Definition at line 109 of file KoAlphaColorSpace.h.
|
inlinevirtual |
Definition at line 144 of file KoAlphaColorSpace.h.
References warnPigment.
|
overridevirtual |
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 128 of file KoAlphaColorSpace.cpp.
|
overrideprotectedvirtual |
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 from KoColorSpace.
Definition at line 248 of file KoAlphaColorSpace.cpp.
|
inlineoverridevirtual |
Return the profile of this color space.
Implements KoColorSpace.
Definition at line 113 of file KoAlphaColorSpace.h.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 84 of file KoAlphaColorSpace.h.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 156 of file KoAlphaColorSpace.h.
References warnPigment.
|
overridevirtual |
Convert the specified data to Lab (D50). All colorspaces are guaranteed to support this
| src | the source data |
| dst | the destination data |
| nPixels | the number of source pixels |
Reimplemented from KoColorSpace.
Definition at line 181 of file KoAlphaColorSpace.cpp.
References KoColorSpaceMaths< _T, _Tdst >::scaleToA(), and UINT16_MAX.
|
overridevirtual |
The toQColor methods take a byte array that is at least pixelSize() long and converts the contents to a QColor, using the given profile as a source profile and the optional profile as a destination profile.
| src | a pointer to the source pixel |
| c | the QColor that will be filled with the color at src |
Implements KoColorSpace.
Definition at line 102 of file KoAlphaColorSpace.cpp.
|
overridevirtual |
Convert the specified data to sRGB 16 bits. All colorspaces are guaranteed to support this
| src | the source data |
| dst | the destination data |
| nPixels | the number of source pixels |
Reimplemented from KoColorSpace.
Definition at line 210 of file KoAlphaColorSpace.cpp.
References KoColorSpaceMaths< _T, _Tdst >::scaleToA(), and UINT16_MAX.
|
inlineoverridevirtual |
Implements KoColorSpace.
Definition at line 167 of file KoAlphaColorSpace.h.
References warnPigment.
|
inlineoverridevirtual |
If false, images in this colorspace will degrade considerably by functions, tools and filters that have the given measure of colorspace independence.
| independence | the measure to which this colorspace will suffer from the manipulations of the tool or filter asking |
Implements KoColorSpace.
Definition at line 79 of file KoAlphaColorSpace.h.
|
private |
Definition at line 182 of file KoAlphaColorSpace.h.