Commit 1b219085 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove unused bitBlt methods

And add color conversion params to the remaining bitBlt method
so the conversion can be done in a controlled fashion.
parent 8377d8b7
......@@ -250,76 +250,9 @@ bool KoColorSpace::convertPixelsTo(const quint8 * src,
}
void KoColorSpace::bitBlt(quint8* dst,
qint32 dststride,
const KoColorSpace* srcSpace,
const quint8* src,
qint32 srcRowStride,
const quint8* srcAlphaMask,
qint32 maskRowStride,
quint8 opacity,
qint32 rows,
qint32 cols,
const QString& op,
const QBitArray& channelFlags) const
{
if (d->compositeOps.contains(op)) {
bitBlt(dst, dststride, srcSpace, src, srcRowStride, srcAlphaMask, maskRowStride, opacity, rows, cols, d->compositeOps.value(op), channelFlags);
} else {
bitBlt(dst, dststride, srcSpace, src, srcRowStride, srcAlphaMask, maskRowStride, opacity, rows, cols, d->compositeOps.value(COMPOSITE_OVER), channelFlags);
}
}
void KoColorSpace::bitBlt(quint8* dst,
qint32 dstRowStride,
const KoColorSpace* srcSpace,
const quint8* src,
qint32 srcRowStride,
const quint8 *srcAlphaMask,
qint32 maskRowStride,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp* op,
const QBitArray& channelFlags) const
{
Q_ASSERT_X(*op->colorSpace() == *this, "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());
if (rows <= 0 || cols <= 0)
return;
if (!(*this == *srcSpace)) {
quint32 conversionBufferStride = cols * pixelSize();
QVector<quint8> * conversionCache =
threadLocalConversionCache(rows * conversionBufferStride);
quint8* conversionData = conversionCache->data();
for (qint32 row = 0; row < rows; row++) {
srcSpace->convertPixelsTo(src + row * srcRowStride,
conversionData + row * conversionBufferStride,
this, cols,
KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
}
op->composite(dst, dstRowStride,
conversionData, conversionBufferStride,
srcAlphaMask, maskRowStride,
rows, cols,
opacity, channelFlags);
} else {
op->composite(dst, dstRowStride,
src, srcRowStride,
srcAlphaMask, maskRowStride,
rows, cols,
opacity, channelFlags);
}
}
void KoColorSpace::bitBlt(const KoColorSpace* srcSpace, const KoCompositeOp::ParameterInfo& params, const KoCompositeOp* op) const
void KoColorSpace::bitBlt(const KoColorSpace* srcSpace, const KoCompositeOp::ParameterInfo& params, const KoCompositeOp* op,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags) const
{
Q_ASSERT_X(*op->colorSpace() == *this, "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());
......@@ -334,7 +267,7 @@ void KoColorSpace::bitBlt(const KoColorSpace* srcSpace, const KoCompositeOp::Par
for(qint32 row=0; row<params.rows; row++) {
srcSpace->convertPixelsTo(params.srcRowStart + row*params.srcRowStride,
conversionData + row*conversionBufferStride, this, params.cols,
KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
renderingIntent, conversionFlags);
}
KoCompositeOp::ParameterInfo paramInfo(params);
......
......@@ -483,39 +483,6 @@ public:
*/
virtual KoID mathToolboxId() const = 0;
/**
* 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.
*
* @param dst pointer to the pixels onto which src will be composited. dst is "below" src.
* @param dststride the total number of bytes in one line in the dst paint device
* @param srcSpace the colorspace of the source pixels that will be composited onto "us"
* @param src pointer to the pixels that will be composited onto "us"
* @param srcRowStride the total number of bytes in one line in the src paint device
* @param srcAlphaMask pointer to an alpha mask that determines whether and how much
* of src will be composited onto dst
* @param maskRowStride the total number of bytes in one line in the mask paint device
* @param rows the number of rows of pixels we'll be compositing
* @param cols the length in pixels of a single row we'll be compositing.
* @param op the composition operator to use, e.g. COPY_OVER
* @param channelFlags a bit array reflecting which channels will be composited and which
* channels won't. The order is pixel order, not colorspace order.
*/
virtual void bitBlt(quint8 *dst,
qint32 dststride,
const KoColorSpace* srcSpace,
const quint8 *src,
qint32 srcRowStride,
const quint8 *srcAlphaMask,
qint32 maskRowStride,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp* op,
const QBitArray& channelFlags=QBitArray()) const;
/**
* Compose two arrays of pixels together. If source and target
* are not the same color model, the source pixels will be
......@@ -528,23 +495,9 @@ public:
* @param op the composition operator to use, e.g. COPY_OVER
*
*/
virtual void bitBlt(const KoColorSpace* srcSpace, const KoCompositeOp::ParameterInfo& params, const KoCompositeOp* op) const;
/**
* Convenience function for the above if you don't have the composite op object yet.
*/
virtual void bitBlt(quint8* dst,
qint32 dststride,
const KoColorSpace* srcSpace,
const quint8* src,
qint32 srcRowStride,
const quint8* srcAlphaMask,
qint32 maskRowStride,
quint8 opacity,
qint32 rows,
qint32 cols,
const QString& op,
const QBitArray& channelFlags=QBitArray()) const;
virtual void bitBlt(const KoColorSpace* srcSpace, const KoCompositeOp::ParameterInfo& params, const KoCompositeOp* op,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags) const;
/**
* Serialize this color following Create's swatch color specification available
......@@ -594,6 +547,7 @@ protected:
struct Private;
Private * const d;
};
inline QDebug operator<<(QDebug dbg, const KoColorSpace *cs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment