diff --git a/libs/pigment/colorspaces/KoAlphaF16ColorSpace.cpp b/libs/pigment/colorspaces/KoAlphaF16ColorSpace.cpp index 93582060d0..8ce9ded688 100644 --- a/libs/pigment/colorspaces/KoAlphaF16ColorSpace.cpp +++ b/libs/pigment/colorspaces/KoAlphaF16ColorSpace.cpp @@ -1,145 +1,122 @@ /* * Copyright (c) 2004 Boudewijn Rempt * Copyright (c) 2006 Cyrille Berger * Copyright (c) 2010 Lukáš Tvrdý * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoAlphaF16ColorSpace.h" #include #include #include #include #include #include "KoChannelInfo.h" #include "KoID.h" #include "KoIntegerMaths.h" #include "KoCompositeOpOver.h" #include "KoCompositeOpErase.h" #include "KoCompositeOpCopy2.h" #include "KoCompositeOpAlphaDarken.h" #include KoAlphaF16ColorSpace::KoAlphaF16ColorSpace() : KoColorSpaceAbstract("ALPHAF16", i18n("16 bits float alpha mask")) { addChannel(new KoChannelInfo(i18n("Alpha"), 0, 0, KoChannelInfo::ALPHA, KoChannelInfo::FLOAT16)); m_compositeOps << new KoCompositeOpOver(this) << new KoCompositeOpErase(this) << new KoCompositeOpCopy2(this) << new KoCompositeOpAlphaDarken(this); Q_FOREACH (KoCompositeOp *op, m_compositeOps) { addCompositeOp(op); } m_profile = new KoDummyColorProfile; } KoAlphaF16ColorSpace::~KoAlphaF16ColorSpace() { qDeleteAll(m_compositeOps); delete m_profile; m_profile = 0; } void KoAlphaF16ColorSpace::fromQColor(const QColor& c, quint8 *dst, const KoColorProfile * /*profile*/) const { dst[0] = c.alpha(); } void KoAlphaF16ColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorProfile * /*profile*/) const { c->setRgba(qRgba(255, 255, 255, src[0])); } quint8 KoAlphaF16ColorSpace::difference(const quint8 *src1, const quint8 *src2) const { // Arithmetic operands smaller than int are converted to int automatically return qAbs(src2[0] - src1[0]); } quint8 KoAlphaF16ColorSpace::differenceA(const quint8 *src1, const quint8 *src2) const { return difference(src1, src2); } QString KoAlphaF16ColorSpace::channelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(pixel[channelPosition]); } QString KoAlphaF16ColorSpace::normalisedChannelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(static_cast(pixel[channelPosition]) / UINT8_MAX); } -void KoAlphaF16ColorSpace::convolveColors(quint8** colors, qreal * kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray & channelFlags) const +void KoAlphaF16ColorSpace::convolveColors(quint8** /*colors*/, qreal * /*kernelValues*/, quint8 */*dst*/, qreal /*factor*/, qreal /*offset*/, qint32 /*nColors*/, const QBitArray & /*channelFlags*/) const { -// qreal totalAlpha = 0; - -// while (nColors--) { -// qreal weight = *kernelValues; - -// if (weight != 0) { -// totalAlpha += (*colors)[0] * weight; -// } -// ++colors; -// ++kernelValues; -// } - -// if (channelFlags.isEmpty() || channelFlags.testBit(0)) -// dst[0] = CLAMP((totalAlpha / factor) + offset, 0, SCHAR_MAX); + warnPigment << i18n("Undefined operation in the alpha color space"); } QImage KoAlphaF16ColorSpace::convertToQImage(const quint8 *data, qint32 width, qint32 height, const KoColorProfile * /*dstProfile*/, KoColorConversionTransformation::Intent /*renderingIntent*/, KoColorConversionTransformation::ConversionFlags /*conversionFlags*/) const { + warnPigment << i18n("Undefined operation in the alpha color space"); QImage img(width, height, QImage::Format_Indexed8); -// QVector table; -// for (int i = 0; i < 256; ++i) table.append(qRgb(i, i, i)); -// img.setColorTable(table); - -// quint8* data_img; -// for (int i = 0; i < height; ++i) { -// data_img=img.scanLine(i); -// for (int j = 0; j < width; ++j) -// data_img[j]=*(data++); -// } - return img; } KoColorSpace *KoAlphaF16ColorSpace::clone() const { return new KoAlphaF16ColorSpace(); } bool KoAlphaF16ColorSpace::preferCompositionInSourceColorSpace() const { return true; } diff --git a/libs/pigment/colorspaces/KoAlphaF16ColorSpace.h b/libs/pigment/colorspaces/KoAlphaF16ColorSpace.h index 022f608264..e9920d03f0 100644 --- a/libs/pigment/colorspaces/KoAlphaF16ColorSpace.h +++ b/libs/pigment/colorspaces/KoAlphaF16ColorSpace.h @@ -1,189 +1,192 @@ /* * Copyright (c) 2004 Boudewijn Rempt * Copyright (c) 2006 Cyrille Berger * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KOF16ALPHACOLORSPACE_H #define KOF16ALPHACOLORSPACE_H #include #include "DebugPigment.h" #include "kritapigment_export.h" #include "KoColorSpaceAbstract.h" #include "KoColorSpaceTraits.h" #include "KoColorModelStandardIds.h" #include "KoSimpleColorSpaceFactory.h" #include typedef KoColorSpaceTrait AlphaF16Traits; class QBitArray; /** * 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. */ class KRITAPIGMENT_EXPORT KoAlphaF16ColorSpace : public KoColorSpaceAbstract { public: KoAlphaF16ColorSpace(); virtual ~KoAlphaF16ColorSpace(); static QString colorSpaceId() { return "ALPHAF16"; } virtual KoID colorModelId() const { return AlphaColorModelID; } virtual KoID colorDepthId() const { return Float16BitsColorDepthID; } virtual KoColorSpace* clone() const; virtual bool willDegrade(ColorSpaceIndependence independence) const { Q_UNUSED(independence); return false; } virtual bool profileIsCompatible(const KoColorProfile* /*profile*/) const { return false; } virtual void fromQColor(const QColor& color, quint8 *dst, const KoColorProfile * profile = 0) const; virtual void toQColor(const quint8 *src, QColor *c, const KoColorProfile * profile = 0) const; virtual quint8 difference(const quint8 *src1, const quint8 *src2) const; virtual quint8 differenceA(const quint8 *src1, const quint8 *src2) const; virtual quint32 colorChannelCount() const { return 0; } virtual QString channelValueText(const quint8 *pixel, quint32 channelIndex) const; virtual QString normalisedChannelValueText(const quint8 *pixel, quint32 channelIndex) const; virtual void convolveColors(quint8** colors, qreal* kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray & channelFlags) const; virtual quint32 colorSpaceType() const { return 0; } virtual bool hasHighDynamicRange() const { return false; } virtual const KoColorProfile* profile() const { return m_profile; } virtual QImage convertToQImage(const quint8 *data, qint32 width, qint32 height, const KoColorProfile * dstProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const; virtual void toLabA16(const quint8* src, quint8* dst, quint32 nPixels) const { quint16* lab = reinterpret_cast(dst); while (nPixels--) { lab[3] = src[0]; src++; lab += 4; } } + virtual void fromLabA16(const quint8* src, quint8* dst, quint32 nPixels) const { const quint16* lab = reinterpret_cast(src); while (nPixels--) { dst[0] = lab[3]; dst++; lab += 4; } } virtual void toRgbA16(const quint8* src, quint8* dst, quint32 nPixels) const { quint16* rgb = reinterpret_cast(dst); while (nPixels--) { rgb[3] = src[0]; src++; rgb += 4; } } + virtual void fromRgbA16(const quint8* src, quint8* dst, quint32 nPixels) const { const quint16* rgb = reinterpret_cast(src); while (nPixels--) { dst[0] = rgb[3]; dst++; rgb += 4; } } + virtual KoColorTransformation* createBrightnessContrastAdjustment(const quint16* transferValues) const { Q_UNUSED(transferValues); warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } virtual KoColorTransformation* createPerChannelAdjustment(const quint16* const*) const { warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } virtual KoColorTransformation *createDarkenAdjustment(qint32 , bool , qreal) const { warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } virtual void invertColor(quint8*, qint32) const { warnPigment << i18n("Undefined operation in the alpha color space"); } virtual void colorToXML(const quint8* , QDomDocument& , QDomElement&) const { warnPigment << i18n("Undefined operation in the alpha color space"); } virtual void colorFromXML(quint8* , const QDomElement&) const { warnPigment << i18n("Undefined operation in the alpha color space"); } virtual void toHSY(const QVector &, qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); } virtual QVector fromHSY(qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); QVector channelValues (1); channelValues.fill(0.0); return channelValues; } virtual void toYUV(const QVector &, qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); } virtual QVector fromYUV(qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); QVector channelValues (1); channelValues.fill(0.0); return channelValues; } protected: virtual bool preferCompositionInSourceColorSpace() const; private: KoColorProfile* m_profile; QList m_compositeOps; }; #endif diff --git a/libs/pigment/colorspaces/KoAlphaF32ColorSpace.cpp b/libs/pigment/colorspaces/KoAlphaF32ColorSpace.cpp index 6f7f775dd0..f744e173ea 100644 --- a/libs/pigment/colorspaces/KoAlphaF32ColorSpace.cpp +++ b/libs/pigment/colorspaces/KoAlphaF32ColorSpace.cpp @@ -1,145 +1,122 @@ /* * Copyright (c) 2004 Boudewijn Rempt * Copyright (c) 2006 Cyrille Berger * Copyright (c) 2010 Lukáš Tvrdý * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoAlphaF32ColorSpace.h" #include #include #include #include #include #include "KoChannelInfo.h" #include "KoID.h" #include "KoIntegerMaths.h" #include "KoCompositeOpOver.h" #include "KoCompositeOpErase.h" #include "KoCompositeOpCopy2.h" #include "KoCompositeOpAlphaDarken.h" #include KoAlphaF32ColorSpace::KoAlphaF32ColorSpace() : KoColorSpaceAbstract("ALPHAF32", i18n("32 bits float alpha mask")) { addChannel(new KoChannelInfo(i18n("Alpha"), 0, 0, KoChannelInfo::ALPHA, KoChannelInfo::FLOAT32)); m_compositeOps << new KoCompositeOpOver(this) << new KoCompositeOpErase(this) << new KoCompositeOpCopy2(this) << new KoCompositeOpAlphaDarken(this); Q_FOREACH (KoCompositeOp *op, m_compositeOps) { addCompositeOp(op); } m_profile = new KoDummyColorProfile; } KoAlphaF32ColorSpace::~KoAlphaF32ColorSpace() { qDeleteAll(m_compositeOps); delete m_profile; m_profile = 0; } void KoAlphaF32ColorSpace::fromQColor(const QColor& c, quint8 *dst, const KoColorProfile * /*profile*/) const { dst[0] = c.alpha(); } void KoAlphaF32ColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorProfile * /*profile*/) const { c->setRgba(qRgba(255, 255, 255, src[0])); } quint8 KoAlphaF32ColorSpace::difference(const quint8 *src1, const quint8 *src2) const { // Arithmetic operands smaller than int are converted to int automatically return qAbs(src2[0] - src1[0]); } quint8 KoAlphaF32ColorSpace::differenceA(const quint8 *src1, const quint8 *src2) const { return difference(src1, src2); } QString KoAlphaF32ColorSpace::channelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(pixel[channelPosition]); } QString KoAlphaF32ColorSpace::normalisedChannelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(static_cast(pixel[channelPosition]) / UINT8_MAX); } -void KoAlphaF32ColorSpace::convolveColors(quint8** colors, qreal * kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray & channelFlags) const +void KoAlphaF32ColorSpace::convolveColors(quint8** /*colors*/, qreal * /*kernelValues*/, quint8 */*dst*/, qreal /*factor*/, qreal /*offset*/, qint32 /*nColors*/, const QBitArray & /*channelFlags*/) const { -// qreal totalAlpha = 0; - -// while (nColors--) { -// qreal weight = *kernelValues; - -// if (weight != 0) { -// totalAlpha += (*colors)[0] * weight; -// } -// ++colors; -// ++kernelValues; -// } - -// if (channelFlags.isEmpty() || channelFlags.testBit(0)) -// dst[0] = CLAMP((totalAlpha / factor) + offset, 0, SCHAR_MAX); + warnPigment << i18n("Undefined operation in the alpha color space"); } QImage KoAlphaF32ColorSpace::convertToQImage(const quint8 *data, qint32 width, qint32 height, const KoColorProfile * /*dstProfile*/, KoColorConversionTransformation::Intent /*renderingIntent*/, KoColorConversionTransformation::ConversionFlags /*conversionFlags*/) const { + warnPigment << i18n("Undefined operation in the alpha color space"); QImage img(width, height, QImage::Format_Indexed8); -// QVector table; -// for (int i = 0; i < 256; ++i) table.append(qRgb(i, i, i)); -// img.setColorTable(table); - -// quint8* data_img; -// for (int i = 0; i < height; ++i) { -// data_img=img.scanLine(i); -// for (int j = 0; j < width; ++j) -// data_img[j]=*(data++); -// } - return img; } KoColorSpace* KoAlphaF32ColorSpace::clone() const { return new KoAlphaF32ColorSpace(); } bool KoAlphaF32ColorSpace::preferCompositionInSourceColorSpace() const { return true; } diff --git a/libs/pigment/colorspaces/KoAlphaU16ColorSpace.cpp b/libs/pigment/colorspaces/KoAlphaU16ColorSpace.cpp index 6446ae057a..f7ca740764 100644 --- a/libs/pigment/colorspaces/KoAlphaU16ColorSpace.cpp +++ b/libs/pigment/colorspaces/KoAlphaU16ColorSpace.cpp @@ -1,146 +1,123 @@ /* * Copyright (c) 2004 Boudewijn Rempt * Copyright (c) 2006 Cyrille Berger * Copyright (c) 2010 Lukáš Tvrdý * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoAlphaU16ColorSpace.h" #include #include #include #include #include #include "KoChannelInfo.h" #include "KoID.h" #include "KoIntegerMaths.h" #include "KoCompositeOpOver.h" #include "KoCompositeOpErase.h" #include "KoCompositeOpCopy2.h" #include "KoCompositeOpAlphaDarken.h" #include KoAlphaU16ColorSpace::KoAlphaU16ColorSpace() : KoColorSpaceAbstract("ALPHAU16", i18n("16 bits integer alpha mask")) { addChannel(new KoChannelInfo(i18n("Alpha"), 0, 0, KoChannelInfo::ALPHA, KoChannelInfo::UINT16)); m_compositeOps << new KoCompositeOpOver(this) << new KoCompositeOpErase(this) << new KoCompositeOpCopy2(this) << new KoCompositeOpAlphaDarken(this); Q_FOREACH (KoCompositeOp *op, m_compositeOps) { addCompositeOp(op); } m_profile = new KoDummyColorProfile; } KoAlphaU16ColorSpace::~KoAlphaU16ColorSpace() { qDeleteAll(m_compositeOps); delete m_profile; m_profile = 0; } void KoAlphaU16ColorSpace::fromQColor(const QColor& c, quint8 *dst, const KoColorProfile * /*profile*/) const { dst[0] = c.alpha(); } void KoAlphaU16ColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorProfile * /*profile*/) const { c->setRgba(qRgba(255, 255, 255, src[0])); } quint8 KoAlphaU16ColorSpace::difference(const quint8 *src1, const quint8 *src2) const { // Arithmetic operands smaller than int are converted to int automatically return qAbs(src2[0] - src1[0]); } quint8 KoAlphaU16ColorSpace::differenceA(const quint8 *src1, const quint8 *src2) const { return difference(src1, src2); } QString KoAlphaU16ColorSpace::channelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(pixel[channelPosition]); } QString KoAlphaU16ColorSpace::normalisedChannelValueText(const quint8 *pixel, quint32 channelIndex) const { Q_ASSERT(channelIndex < channelCount()); quint32 channelPosition = channels()[channelIndex]->pos(); return QString().setNum(static_cast(pixel[channelPosition]) / UINT16_MAX); } void KoAlphaU16ColorSpace::convolveColors(quint8** colors, qreal * kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray & channelFlags) const { -// qreal totalAlpha = 0; - -// while (nColors--) { -// qreal weight = *kernelValues; - -// if (weight != 0) { -// totalAlpha += (*colors)[0] * weight; -// } -// ++colors; -// ++kernelValues; -// } - -// if (channelFlags.isEmpty() || channelFlags.testBit(0)) -// dst[0] = CLAMP((totalAlpha / factor) + offset, 0, SCHAR_MAX); + warnPigment << i18n("Undefined operation in the alpha color space"); } QImage KoAlphaU16ColorSpace::convertToQImage(const quint8 *data, qint32 width, qint32 height, const KoColorProfile * /*dstProfile*/, KoColorConversionTransformation::Intent /*renderingIntent*/, KoColorConversionTransformation::ConversionFlags /*conversionFlags*/) const { + warnPigment << i18n("Undefined operation in the alpha color space"); QImage img(width, height, QImage::Format_Indexed8); -// QVector table; -// for (int i = 0; i < 256; ++i) table.append(qRgb(i, i, i)); -// img.setColorTable(table); - -// quint8* data_img; -// for (int i = 0; i < height; ++i) { -// data_img=img.scanLine(i); -// for (int j = 0; j < width; ++j) -// data_img[j]=*(data++); -// } - return img; } KoColorSpace* KoAlphaU16ColorSpace::clone() const { return new KoAlphaU16ColorSpace(); } bool KoAlphaU16ColorSpace::preferCompositionInSourceColorSpace() const { return true; } diff --git a/libs/pigment/colorspaces/KoAlphaU16ColorSpace.h b/libs/pigment/colorspaces/KoAlphaU16ColorSpace.h index 501fd86181..7ed996d078 100644 --- a/libs/pigment/colorspaces/KoAlphaU16ColorSpace.h +++ b/libs/pigment/colorspaces/KoAlphaU16ColorSpace.h @@ -1,187 +1,195 @@ /* * Copyright (c) 2016 Boudewijn Rempt * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KOALPHAU16COLORSPACE_H #define KOALPHAU16COLORSPACE_H #include #include "DebugPigment.h" #include "kritapigment_export.h" #include "KoColorSpaceAbstract.h" #include "KoColorSpaceTraits.h" #include "KoColorModelStandardIds.h" #include "KoSimpleColorSpaceFactory.h" typedef KoColorSpaceTrait AlphaU16Traits; class QBitArray; /** * 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. */ class KRITAPIGMENT_EXPORT KoAlphaU16ColorSpace : public KoColorSpaceAbstract { public: KoAlphaU16ColorSpace(); virtual ~KoAlphaU16ColorSpace(); static QString colorSpaceId() { return "ALPHAU16"; } virtual KoID colorModelId() const { return AlphaColorModelID; } virtual KoID colorDepthId() const { return Integer16BitsColorDepthID; } virtual KoColorSpace* clone() const; virtual bool willDegrade(ColorSpaceIndependence independence) const { Q_UNUSED(independence); return false; } virtual bool profileIsCompatible(const KoColorProfile* /*profile*/) const { return false; } virtual void fromQColor(const QColor& color, quint8 *dst, const KoColorProfile * profile = 0) const; virtual void toQColor(const quint8 *src, QColor *c, const KoColorProfile * profile = 0) const; virtual quint8 difference(const quint8 *src1, const quint8 *src2) const; virtual quint8 differenceA(const quint8 *src1, const quint8 *src2) const; virtual quint32 colorChannelCount() const { return 0; } virtual QString channelValueText(const quint8 *pixel, quint32 channelIndex) const; virtual QString normalisedChannelValueText(const quint8 *pixel, quint32 channelIndex) const; virtual void convolveColors(quint8** colors, qreal* kernelValues, quint8 *dst, qreal factor, qreal offset, qint32 nColors, const QBitArray & channelFlags) const; virtual quint32 colorSpaceType() const { return 0; } virtual bool hasHighDynamicRange() const { return false; } virtual const KoColorProfile* profile() const { return m_profile; } virtual QImage convertToQImage(const quint8 *data, qint32 width, qint32 height, const KoColorProfile * dstProfile, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const; virtual void toLabA16(const quint8* src, quint8* dst, quint32 nPixels) const { quint16* lab = reinterpret_cast(dst); while (nPixels--) { lab[3] = src[0]; src++; lab += 4; } } virtual void fromLabA16(const quint8* src, quint8* dst, quint32 nPixels) const { const quint16* lab = reinterpret_cast(src); while (nPixels--) { dst[0] = lab[3]; dst++; lab += 4; } } virtual void toRgbA16(const quint8* src, quint8* dst, quint32 nPixels) const { quint16* rgb = reinterpret_cast(dst); while (nPixels--) { rgb[3] = src[0]; src++; rgb += 4; } } virtual void fromRgbA16(const quint8* src, quint8* dst, quint32 nPixels) const { const quint16* rgb = reinterpret_cast(src); while (nPixels--) { dst[0] = rgb[3]; dst++; rgb += 4; } } virtual KoColorTransformation* createBrightnessContrastAdjustment(const quint16* transferValues) const { Q_UNUSED(transferValues); warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } virtual KoColorTransformation* createPerChannelAdjustment(const quint16* const*) const { warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } + virtual KoColorTransformation *createDarkenAdjustment(qint32 , bool , qreal) const { warnPigment << i18n("Undefined operation in the alpha color space"); return 0; } + virtual void invertColor(quint8*, qint32) const { warnPigment << i18n("Undefined operation in the alpha color space"); } + virtual void colorToXML(const quint8* , QDomDocument& , QDomElement&) const { warnPigment << i18n("Undefined operation in the alpha color space"); } + virtual void colorFromXML(quint8* , const QDomElement&) const { warnPigment << i18n("Undefined operation in the alpha color space"); } + virtual void toHSY(const QVector &, qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); } + virtual QVector fromHSY(qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); QVector channelValues (1); channelValues.fill(0.0); return channelValues; } + virtual void toYUV(const QVector &, qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); } + virtual QVector fromYUV(qreal *, qreal *, qreal *) const { warnPigment << i18n("Undefined operation in the alpha color space"); QVector channelValues (1); channelValues.fill(0.0); return channelValues; } protected: virtual bool preferCompositionInSourceColorSpace() const; private: KoColorProfile* m_profile; QList m_compositeOps; }; #endif