Commit 2ff27f00 authored by Adrian Page's avatar Adrian Page

Implement convertToQImage for alpha colourspace. Useful for debugging selection problems.


svn path=/trunk/koffice/; revision=658792
parent 95f214a3
......@@ -386,3 +386,19 @@ void KoAlphaColorSpace::convolveColors(quint8** colors, qint32 * kernelValues, q
if ( channelFlags.isEmpty() || channelFlags.testBit(PIXEL_MASK) )
dst[PIXEL_MASK] = CLAMP((totalAlpha/ factor) + offset, 0, SCHAR_MAX);
}
QImage KoAlphaColorSpace::convertToQImage(const quint8 *data, qint32 width, qint32 height,
KoColorProfile * dstProfile, qint32 renderingIntent,
float exposure) const
{
QImage img(width, height, QImage::Format_RGB32);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
quint8 c = data[x + y * width];
img.setPixel(x, y, qRgb(c, c, c));
}
}
return img;
}
......@@ -71,16 +71,7 @@ public:
virtual KoColorProfile* profile() const { return 0; }
virtual QImage convertToQImage(const quint8 *data, qint32 width, qint32 height,
KoColorProfile * dstProfile, qint32 renderingIntent = INTENT_PERCEPTUAL,
float exposure = 0.0f) const
{
Q_UNUSED(data);
Q_UNUSED(width);
Q_UNUSED(height);
Q_UNUSED(dstProfile);
Q_UNUSED(renderingIntent);
Q_UNUSED(exposure);
return QImage();
}
float exposure = 0.0f) const;
virtual void toLabA16(const quint8* src, quint8* dst, quint32 nPixels) const
{
......
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