Commit 00d7dded authored by Laurent Montel's avatar Laurent Montel 😁

qt3to4

svn path=/trunk/koffice/; revision=524300
parent f680c683
......@@ -69,10 +69,10 @@ void KisCmykU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
quint32 alpha = pixel->alpha;
quint32 alphaTimesWeight = UINT16_MULT(alpha, UINT8_TO_UINT16(*weights));
totalCyan += UINT16_MULT(pixel->cyan, alphaTimesWeight);
totalMagenta += UINT16_MULT(pixel->magenta, alphaTimesWeight);
totalYellow += UINT16_MULT(pixel->yellow, alphaTimesWeight);
totalBlack += UINT16_MULT(pixel->black, alphaTimesWeight);
totalCyan += UINT16_MULT(pixel->Qt::cyan, alphaTimesWeight);
totalMagenta += UINT16_MULT(pixel->Qt::magenta, alphaTimesWeight);
totalYellow += UINT16_MULT(pixel->Qt::yellow, alphaTimesWeight);
totalBlack += UINT16_MULT(pixel->Qt::black, alphaTimesWeight);
newAlpha += alphaTimesWeight;
weights++;
......@@ -92,10 +92,10 @@ void KisCmykU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
totalBlack = UINT16_DIVIDE(totalBlack, newAlpha);
}
dstPixel->cyan = totalCyan;
dstPixel->magenta = totalMagenta;
dstPixel->yellow = totalYellow;
dstPixel->black = totalBlack;
dstPixel->Qt::cyan = totalCyan;
dstPixel->Qt::magenta = totalMagenta;
dstPixel->Qt::yellow = totalYellow;
dstPixel->Qt::black = totalBlack;
}
void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
......@@ -109,10 +109,10 @@ void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
qint32 weight = *kernelValues;
if (weight != 0) {
totalCyan += pixel->cyan * weight;
totalMagenta += pixel->magenta * weight;
totalYellow += pixel->yellow * weight;
totalK += pixel->black * weight;
totalCyan += pixel->Qt::cyan * weight;
totalMagenta += pixel->Qt::magenta * weight;
totalYellow += pixel->Qt::yellow * weight;
totalK += pixel->Qt::black * weight;
totalAlpha += pixel->alpha * weight;
}
colors++;
......@@ -122,10 +122,10 @@ void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
Pixel * p = reinterpret_cast< Pixel *>( dst );
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
p->cyan = CLAMP( ( totalCyan / factor) + offset, 0, quint16_MAX);
p->magenta = CLAMP( ( totalMagenta / factor) + offset, 0, quint16_MAX);
p->yellow = CLAMP( ( totalYellow / factor) + offset, 0, quint16_MAX);
p->black = CLAMP( ( totalK / factor) + offset, 0, quint16_MAX);
p->Qt::cyan = CLAMP( ( totalCyan / factor) + offset, 0, quint16_MAX);
p->Qt::magenta = CLAMP( ( totalMagenta / factor) + offset, 0, quint16_MAX);
p->Qt::yellow = CLAMP( ( totalYellow / factor) + offset, 0, quint16_MAX);
p->Qt::black = CLAMP( ( totalK / factor) + offset, 0, quint16_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, quint16_MAX);
......@@ -140,10 +140,10 @@ void KisCmykU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while (nPixels--)
{
Pixel * p = reinterpret_cast< Pixel *>( src );
p->cyan = quint16_MAX - p->cyan;
p->magenta = quint16_MAX - p->magenta;
p->yellow = quint16_MAX - p->yellow;
p->black = quint16_MAX - p->black;
p->Qt::cyan = quint16_MAX - p->Qt::cyan;
p->Qt::magenta = quint16_MAX - p->Qt::magenta;
p->Qt::yellow = quint16_MAX - p->Qt::yellow;
p->Qt::black = quint16_MAX - p->Qt::black;
src += psize;
}
}
......@@ -176,7 +176,7 @@ void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisCo
delete [] tmp;
}
QValueVector<KisChannelInfo *> KisCmykU16ColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisCmykU16ColorSpace::channels() const
{
return m_channels;
}
......
......@@ -174,7 +174,7 @@ void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColor
delete [] tmp;
}
QValueVector<KisChannelInfo *> KisCmykColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisCmykColorSpace::channels() const
{
return m_channels;
}
......
......@@ -70,7 +70,7 @@ void KisGrayU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
quint32 alpha = pixel->alpha;
quint32 alphaTimesWeight = UINT16_MULT(alpha, UINT8_TO_UINT16(*weights));
totalGray += UINT16_MULT(pixel->gray, alphaTimesWeight);
totalGray += UINT16_MULT(pixel->Qt::gray, alphaTimesWeight);
newAlpha += alphaTimesWeight;
weights++;
......@@ -87,7 +87,7 @@ void KisGrayU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
totalGray = UINT16_DIVIDE(totalGray, newAlpha);
}
dstPixel->gray = totalGray;
dstPixel->Qt::gray = totalGray;
}
void KisGrayU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst,
......@@ -102,7 +102,7 @@ void KisGrayU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
qint32 weight = *kernelValues;
if (weight != 0) {
totalGray += pixel->gray * weight;
totalGray += pixel->Qt::gray * weight;
totalAlpha += pixel->alpha * weight;
}
colors++;
......@@ -112,7 +112,7 @@ void KisGrayU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
Pixel * p = reinterpret_cast< Pixel *>( dst );
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
p->gray = CLAMP( ( totalGray / factor) + offset, 0, quint16_MAX);
p->Qt::gray = CLAMP( ( totalGray / factor) + offset, 0, quint16_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, quint16_MAX);
......@@ -127,7 +127,7 @@ void KisGrayU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while (nPixels--)
{
Pixel * p = reinterpret_cast< Pixel *>( src );
p->gray = quint16_MAX - p->gray;
p->Qt::gray = quint16_MAX - p->Qt::gray;
src += psize;
}
}
......@@ -137,11 +137,11 @@ void KisGrayU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
quint8 KisGrayU16ColorSpace::intensity8(const quint8 * src) const
{
const Pixel * p = reinterpret_cast<const Pixel *>( src );
return UINT16_TO_UINT8(p->gray);
return UINT16_TO_UINT8(p->Qt::gray);
}
QValueVector<KisChannelInfo *> KisGrayU16ColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisGrayU16ColorSpace::channels() const
{
return m_channels;
}
......
......@@ -61,13 +61,13 @@ KisGrayColorSpace::~KisGrayColorSpace()
void KisGrayColorSpace::setPixel(quint8 *pixel, quint8 gray, quint8 alpha) const
{
pixel[PIXEL_GRAY] = gray;
pixel[PIXEL_GRAY] = Qt::gray;
pixel[PIXEL_GRAY_ALPHA] = alpha;
}
void KisGrayColorSpace::getPixel(const quint8 *pixel, quint8 *gray, quint8 *alpha) const
{
*gray = pixel[PIXEL_GRAY];
*Qt::gray = pixel[PIXEL_GRAY];
*alpha = pixel[PIXEL_GRAY_ALPHA];
}
......@@ -175,7 +175,7 @@ quint8 KisGrayColorSpace::intensity8(const quint8 * src) const
return src[PIXEL_GRAY];
}
QValueVector<KisChannelInfo *> KisGrayColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisGrayColorSpace::channels() const
{
return m_channels;
}
......
......@@ -87,18 +87,18 @@ void KisLmsF32ColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProfile
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->longWave = computeLong(c.red(),c.green(),c.blue());
dst->middleWave = computeMiddle(c.red(),c.green(),c.blue());
dst->shortWave = computeShort(c.red(),c.green(),c.blue());
dst->longWave = computeLong(c.Qt::red(),c.Qt::green(),c.Qt::blue());
dst->middleWave = computeMiddle(c.Qt::red(),c.Qt::green(),c.Qt::blue());
dst->shortWave = computeShort(c.Qt::red(),c.Qt::green(),c.Qt::blue());
}
void KisLmsF32ColorSpace::fromQColor(const QColor& c, quint8 opacity, quint8 *dstU8, KisProfile * /*profile*/)
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->longWave = computeLong(c.red(),c.green(),c.blue());
dst->middleWave = computeMiddle(c.red(),c.green(),c.blue());
dst->shortWave = computeShort(c.red(),c.green(),c.blue());
dst->longWave = computeLong(c.Qt::red(),c.Qt::green(),c.Qt::blue());
dst->middleWave = computeMiddle(c.Qt::red(),c.Qt::green(),c.Qt::blue());
dst->shortWave = computeShort(c.Qt::red(),c.Qt::green(),c.Qt::blue());
dst->alpha = UINT8_TO_FLOAT(opacity);
}
......@@ -164,7 +164,7 @@ void KisLmsF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
dstPixel->shortWave = totalShort;
}
QValueVector<KisChannelInfo *> KisLmsF32ColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisLmsF32ColorSpace::channels() const
{
return m_channels;
}
......
......@@ -67,9 +67,9 @@ void KisRgbF16HalfColorSpace::setPixel(quint8 *dst, half red, half green, half b
{
Pixel *dstPixel = reinterpret_cast<Pixel *>(dst);
dstPixel->red = red;
dstPixel->green = green;
dstPixel->blue = blue;
dstPixel->Qt::red = Qt::red;
dstPixel->Qt::green = Qt::green;
dstPixel->Qt::blue = Qt::blue;
dstPixel->alpha = alpha;
}
......@@ -77,9 +77,9 @@ void KisRgbF16HalfColorSpace::getPixel(const quint8 *src, half *red, half *green
{
const Pixel *srcPixel = reinterpret_cast<const Pixel *>(src);
*red = srcPixel->red;
*green = srcPixel->green;
*blue = srcPixel->blue;
*Qt::red = srcPixel->Qt::red;
*Qt::green = srcPixel->Qt::green;
*Qt::blue = srcPixel->Qt::blue;
*alpha = srcPixel->alpha;
}
......@@ -87,18 +87,18 @@ void KisRgbF16HalfColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProf
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->red = UINT8_TO_HALF(c.red());
dst->green = UINT8_TO_HALF(c.green());
dst->blue = UINT8_TO_HALF(c.blue());
dst->Qt::red = UINT8_TO_HALF(c.Qt::red());
dst->Qt::green = UINT8_TO_HALF(c.Qt::green());
dst->Qt::blue = UINT8_TO_HALF(c.Qt::blue());
}
void KisRgbF16HalfColorSpace::fromQColor(const QColor& c, quint8 opacity, quint8 *dstU8, KisProfile *)
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->red = UINT8_TO_HALF(c.red());
dst->green = UINT8_TO_HALF(c.green());
dst->blue = UINT8_TO_HALF(c.blue());
dst->Qt::red = UINT8_TO_HALF(c.Qt::red());
dst->Qt::green = UINT8_TO_HALF(c.Qt::green());
dst->Qt::blue = UINT8_TO_HALF(c.Qt::blue());
dst->alpha = UINT8_TO_HALF(opacity);
}
......@@ -106,14 +106,14 @@ void KisRgbF16HalfColorSpace::toQColor(const quint8 *srcU8, QColor *c, KisProfil
{
const Pixel *src = reinterpret_cast<const Pixel *>(srcU8);
c->setRgb(HALF_TO_UINT8(src->red), HALF_TO_UINT8(src->green), HALF_TO_UINT8(src->blue));
c->setRgb(HALF_TO_UINT8(src->Qt::red), HALF_TO_UINT8(src->Qt::green), HALF_TO_UINT8(src->Qt::blue));
}
void KisRgbF16HalfColorSpace::toQColor(const quint8 *srcU8, QColor *c, quint8 *opacity, KisProfile *)
{
const Pixel *src = reinterpret_cast<const Pixel *>(srcU8);
c->setRgb(HALF_TO_UINT8(src->red), HALF_TO_UINT8(src->green), HALF_TO_UINT8(src->blue));
c->setRgb(HALF_TO_UINT8(src->Qt::red), HALF_TO_UINT8(src->Qt::green), HALF_TO_UINT8(src->Qt::blue));
*opacity = HALF_TO_UINT8(src->alpha);
}
......@@ -122,9 +122,9 @@ quint8 KisRgbF16HalfColorSpace::difference(const quint8 *src1U8, const quint8 *s
const Pixel *src1 = reinterpret_cast<const Pixel *>(src1U8);
const Pixel *src2 = reinterpret_cast<const Pixel *>(src2U8);
return HALF_TO_UINT8(qMax(QABS(src2->red - src1->red),
qMax(QABS(src2->green - src1->green),
QABS(src2->blue - src1->blue))));
return HALF_TO_UINT8(qMax(QABS(src2->Qt::red - src1->Qt::red),
qMax(QABS(src2->Qt::green - src1->Qt::green),
QABS(src2->Qt::blue - src1->Qt::blue))));
}
void KisRgbF16HalfColorSpace::mixColors(const quint8 **colors, const quint8 *weights, quint32 nColors, quint8 *dst) const
......@@ -138,9 +138,9 @@ void KisRgbF16HalfColorSpace::mixColors(const quint8 **colors, const quint8 *wei
half alpha = pixel->alpha;
half alphaTimesWeight = alpha * UINT8_TO_HALF(*weights);
totalRed += pixel->red * alphaTimesWeight;
totalGreen += pixel->green * alphaTimesWeight;
totalBlue += pixel->blue * alphaTimesWeight;
totalRed += pixel->Qt::red * alphaTimesWeight;
totalGreen += pixel->Qt::green * alphaTimesWeight;
totalBlue += pixel->Qt::blue * alphaTimesWeight;
newAlpha += alphaTimesWeight;
weights++;
......@@ -159,9 +159,9 @@ void KisRgbF16HalfColorSpace::mixColors(const quint8 **colors, const quint8 *wei
totalBlue = totalBlue / newAlpha;
}
dstPixel->red = totalRed;
dstPixel->green = totalGreen;
dstPixel->blue = totalBlue;
dstPixel->Qt::red = totalRed;
dstPixel->Qt::green = totalGreen;
dstPixel->Qt::blue = totalBlue;
}
void KisRgbF16HalfColorSpace::convolveColors(quint8** colors, qint32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
......@@ -175,9 +175,9 @@ void KisRgbF16HalfColorSpace::convolveColors(quint8** colors, qint32 * kernelVal
half weight = *kernelValues;
if (weight != 0) {
totalRed += pixel->red * UINT8_TO_HALF(weight);
totalGreen += pixel->green * UINT8_TO_HALF(weight);
totalBlue += pixel->blue * UINT8_TO_HALF(weight);
totalRed += pixel->Qt::red * UINT8_TO_HALF(weight);
totalGreen += pixel->Qt::green * UINT8_TO_HALF(weight);
totalBlue += pixel->Qt::blue * UINT8_TO_HALF(weight);
totalAlpha += pixel->alpha * UINT8_TO_HALF(weight);
}
colors++;
......@@ -187,9 +187,9 @@ void KisRgbF16HalfColorSpace::convolveColors(quint8** colors, qint32 * kernelVal
Pixel * p = reinterpret_cast< Pixel *>( dst );
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
p->red = CLAMP( ( totalRed / factor) + offset, 0, HALF_MAX);
p->green = CLAMP( ( totalGreen / factor) + offset, 0, HALF_MAX);
p->blue = CLAMP( ( totalBlue / factor) + offset, 0, HALF_MAX);
p->Qt::red = CLAMP( ( totalRed / factor) + offset, 0, HALF_MAX);
p->Qt::green = CLAMP( ( totalGreen / factor) + offset, 0, HALF_MAX);
p->Qt::blue = CLAMP( ( totalBlue / factor) + offset, 0, HALF_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, HALF_MAX);
......@@ -204,9 +204,9 @@ void KisRgbF16HalfColorSpace::invertColor(quint8 * src, qint32 nPixels)
while (nPixels--)
{
Pixel * p = reinterpret_cast< Pixel *>( src );
p->red = 1.0 - p->red;
p->green = 1.0 - p->green;
p->blue = 1.0 - p->blue;
p->Qt::red = 1.0 - p->Qt::red;
p->Qt::green = 1.0 - p->Qt::green;
p->Qt::blue = 1.0 - p->Qt::blue;
src += psize;
}
......@@ -217,11 +217,11 @@ quint8 KisRgbF16HalfColorSpace::intensity8(const quint8 * src) const
{
const Pixel * p = reinterpret_cast<const Pixel *>( src );
return HALF_TO_UINT8((p->red * 0.30 + p->green * 0.59 + p->blue * 0.11) + 0.5);
return HALF_TO_UINT8((p->Qt::red * 0.30 + p->Qt::green * 0.59 + p->Qt::blue * 0.11) + 0.5);
}
QValueVector<KisChannelInfo *> KisRgbF16HalfColorSpace::channels() const
Q3ValueVector<KisChannelInfo *> KisRgbF16HalfColorSpace::channels() const
{
return m_channels;
}
......
......@@ -79,7 +79,7 @@ void KisRgbF16HalfColorSpaceTester::testBasics()
CHECK(cs->nColorChannels(), NUM_COLOUR_CHANNELS);
CHECK(cs->pixelSize(), NUM_CHANNELS * CHANNEL_SIZE);
QValueVector<KisChannelInfo *> channels = cs->channels();
Q3ValueVector<KisChannelInfo *> channels = cs->channels();
// Red
CHECK(channels[0]->pos(), PIXEL_RED * CHANNEL_SIZE);
......
......@@ -66,9 +66,9 @@ void KisRgbF32ColorSpace::setPixel(quint8 *dst, float red, float green, float bl
{
Pixel *dstPixel = reinterpret_cast<Pixel *>(dst);
dstPixel->red = red;
dstPixel->green = green;
dstPixel->blue = blue;
dstPixel->Qt::red = Qt::red;
dstPixel->Qt::green = Qt::green;
dstPixel->Qt::blue = Qt::blue;
dstPixel->alpha = alpha;
}
......@@ -76,9 +76,9 @@ void KisRgbF32ColorSpace::getPixel(const quint8 *src, float *red, float *green,
{
const Pixel *srcPixel = reinterpret_cast<const Pixel *>(src);
*red = srcPixel->red;
*green = srcPixel->green;
*blue = srcPixel->blue;
*Qt::red = srcPixel->Qt::red;
*Qt::green = srcPixel->Qt::green;
*Qt::blue = srcPixel->Qt::blue;
*alpha = srcPixel->alpha;
}
......@@ -86,18 +86,18 @@ void KisRgbF32ColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProfile
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->red = UINT8_TO_FLOAT(c.red());
dst->green = UINT8_TO_FLOAT(c.green());
dst->blue = UINT8_TO_FLOAT(c.blue());
dst->Qt::red = UINT8_TO_FLOAT(c.Qt::red());
dst->Qt::green = UINT8_TO_FLOAT(c.Qt::green());
dst->Qt::blue = UINT8_TO_FLOAT(c.Qt::blue());
}
void KisRgbF32ColorSpace::fromQColor(const QColor& c, quint8 opacity, quint8 *dstU8, KisProfile * /*profile*/)
{
Pixel *dst = reinterpret_cast<Pixel *>(dstU8);
dst->red = UINT8_TO_FLOAT(c.red());
dst->green = UINT8_TO_FLOAT(c.green());
dst->blue = UINT8_TO_FLOAT(c.blue());
dst->Qt::red = UINT8_TO_FLOAT(c.Qt::red());
dst->Qt::green = UINT8_TO_FLOAT(c.Qt::green());
dst->Qt::blue = UINT8_TO_FLOAT(c.Qt::blue());
dst->alpha = UINT8_TO_FLOAT(opacity);
}
......@@ -105,14 +105,14 @@ void KisRgbF32ColorSpace::toQColor(const quint8 *srcU8, QColor *c, KisProfile *
{
const Pixel *src = reinterpret_cast<const Pixel *>(srcU8);
c->setRgb(FLOAT_TO_UINT8(src->red), FLOAT_TO_UINT8(src->green), FLOAT_TO_UINT8(src->blue));
c->setRgb(FLOAT_TO_UINT8(src->Qt::red), FLOAT_TO_UINT8(src->Qt::green), FLOAT_TO_UINT8(src->Qt::blue));
}
void KisRgbF32ColorSpace::toQColor(const quint8 *srcU8, QColor *c, quint8 *opacity, KisProfile * /*profile*/)
{
const Pixel *src = reinterpret_cast<const Pixel *>(srcU8);
c->setRgb(FLOAT_TO_UINT8(src->red), FLOAT_TO_UINT8(src->green), FLOAT_TO_UINT8(src->blue));
c->setRgb(FLOAT_TO_UINT8(src->Qt::red), FLOAT_TO_UINT8(src->Qt::green), FLOAT_TO_UINT8(src->Qt::blue));
*opacity = FLOAT_TO_UINT8(src->alpha);
}
......@@ -121,9 +121,9 @@ quint8 KisRgbF32ColorSpace::difference(const quint8 *src1U8, const quint8 *src2U
const Pixel *src1 = reinterpret_cast<const Pixel *>(src1U8);
const Pixel *src2 = reinterpret_cast<const Pixel *>(src2U8);
return FLOAT_TO_UINT8(qMax(QABS(src2->red - src1->red),
qMax(QABS(src2->green - src1->green),
QABS(src2->blue - src1->blue))));
return FLOAT_TO_UINT8(qMax(QABS(src2->Qt::red - src1->Qt::red),
qMax(QABS(src2->Qt::green - src1->Qt::green),
QABS(src2->Qt::blue - src1->Qt::blue))));
}
void KisRgbF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights, quint32 nColors, quint8 *dst) const
......@@ -137,9 +137,9 @@ void KisRgbF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
float alpha = pixel->alpha;
float alphaTimesWeight = alpha * UINT8_TO_FLOAT(*weights);
totalRed += pixel->red * alphaTimesWeight;
totalGreen += pixel->green * alphaTimesWeight;
totalBlue += pixel->blue * alphaTimesWeight;
totalRed += pixel->Qt::red * alphaTimesWeight;
totalGreen += pixel->Qt::green * alphaTimesWeight;
totalBlue += pixel->Qt::blue * alphaTimesWeight;
newAlpha += alphaTimesWeight;
weights++;
......@@ -158,9 +158,9 @@ void KisRgbF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
totalBlue = totalBlue / newAlpha;
}
dstPixel->red = totalRed;
dstPixel->green = totalGreen;
dstPixel->blue = totalBlue;
dstPixel->Qt::red = totalRed;
dstPixel->Qt::green = totalGreen;
dstPixel->Qt::blue = totalBlue;
}
void KisRgbF32ColorSpace::convolveColors(quint8** colors, qint32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
......@@ -174,9 +174,9 @@ void KisRgbF32ColorSpace::convolveColors(quint8** colors, qint32 * kernelValues,
float weight = *kernelValues;
if (weight != 0) {
totalRed += pixel->red * weight;
totalGreen += pixel->green * weight;
totalBlue += pixel->blue * weight;
totalRed += pixel->Qt::red * weight;
totalGreen += pixel->Qt::green * weight;
totalBlue += pixel->Qt::blue * weight;
totalAlpha += pixel->alpha * weight;
}
colors++;
......@@ -186,9 +186,9 @@ void KisRgbF32ColorSpace::convolveColors(quint8** colors, qint32 * kernelValues,
Pixel * p = reinterpret_cast< Pixel *>( dst );
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
p->red = CLAMP( ( totalRed / factor) + offset, 0, FLOAT_MAX);
p->green = CLAMP( ( totalGreen / factor) + offset, 0, FLOAT_MAX);
p->blue = CLAMP( ( totalBlue / factor) + offset, 0, FLOAT_MAX);
p->Qt::red = CLAMP( ( totalRed / factor) + offset, 0, FLOAT_MAX);
p->Qt::green = CLAMP( ( totalGreen / factor) + offset, 0, FLOAT_MAX);
p->Qt::blue = CLAMP( ( totalBlue / factor) + offset, 0, FLOAT_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, FLOAT_MAX);
......@@ -203,9 +203,9 @@ void KisRgbF32ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while (nPixels--)
{
Pixel * p = reinterpret_cast< Pixel *>( src );
p->red = FLOAT_MAX - p->red;
p->green = FLOAT_MAX - p->green;
p->blue = FLOAT_MAX - p->blue;
p->Qt::red = FLOAT_MAX - p->Qt::red;
p->Qt::green = FLOAT_MAX - p->Qt::green;
p->Qt::blue = FLOAT_MAX - p->Qt::blue;
src += psize;
}
......@@ -215,12 +215,12 @@ quint8 KisRgbF32ColorSpace::intensity8(const quint8 * src) const
{
const Pixel * p = reinterpret_cast<const Pixel *>( src );