diff options
Diffstat (limited to 'krita/kritacolor')
35 files changed, 1104 insertions, 1103 deletions
diff --git a/krita/kritacolor/colorspaces/kis_alpha_colorspace.cc b/krita/kritacolor/colorspaces/kis_alpha_colorspace.cc index 01f8ec00..4b54556f 100644 --- a/krita/kritacolor/colorspaces/kis_alpha_colorspace.cc +++ b/krita/kritacolor/colorspaces/kis_alpha_colorspace.cc @@ -19,7 +19,7 @@ #include <limits.h> #include <stdlib.h> -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> #include <klocale.h> @@ -35,12 +35,12 @@ #include "kis_integer_maths.h" namespace { - const Q_UINT8 PIXEL_MASK = 0; + const TQ_UINT8 PIXEL_MASK = 0; } -KisAlphaColorSpace::KisAlphaColorSpace(KisColorSpaceFactoryRegistry * parent, +KisAlphaColorSpace::KisAlphaColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) : - KisU8BaseColorSpace(KisID("ALPHA", i18n("Alpha mask")), TYPE_GRAY_8, icSigGrayData, parent, p) + KisU8BaseColorSpace(KisID("ALPHA", i18n("Alpha tqmask")), TYPE_GRAY_8, icSigGrayData, tqparent, p) { m_channels.push_back(new KisChannelInfo(i18n("Alpha"), i18n("A"), 0, KisChannelInfo::ALPHA, KisChannelInfo::UINT8)); m_alphaPos = 0; @@ -50,42 +50,42 @@ KisAlphaColorSpace::~KisAlphaColorSpace() { } -void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfile * /*profile*/) +void KisAlphaColorSpace::fromTQColor(const TQColor& /*c*/, TQ_UINT8 *dst, KisProfile * /*profile*/) { dst[PIXEL_MASK] = OPACITY_OPAQUE; } -void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * /*profile*/) +void KisAlphaColorSpace::fromTQColor(const TQColor& /*c*/, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile * /*profile*/) { dst[PIXEL_MASK] = opacity; } -void KisAlphaColorSpace::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha) const +void KisAlphaColorSpace::getAlpha(const TQ_UINT8 *pixel, TQ_UINT8 *alpha) const { *alpha = *pixel; } -void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfile * /*profile*/) +void KisAlphaColorSpace::toTQColor(const TQ_UINT8 */*src*/, TQColor *c, KisProfile * /*profile*/) { c->setRgb(255, 255, 255); } -void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * /*profile*/) +void KisAlphaColorSpace::toTQColor(const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile * /*profile*/) { c->setRgb(255, 255, 255); *opacity = src[PIXEL_MASK]; } -Q_UINT8 KisAlphaColorSpace::difference(const Q_UINT8 *src1, const Q_UINT8 *src2) +TQ_UINT8 KisAlphaColorSpace::difference(const TQ_UINT8 *src1, const TQ_UINT8 *src2) { // Arithmetic operands smaller than int are converted to int automatically - return QABS(src2[PIXEL_MASK] - src1[PIXEL_MASK]); + return TQABS(src2[PIXEL_MASK] - src1[PIXEL_MASK]); } -void KisAlphaColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const +void KisAlphaColorSpace::mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const { if (nColors > 0) { - Q_UINT32 total = 0; + TQ_UINT32 total = 0; while(nColors) { @@ -96,25 +96,25 @@ void KisAlphaColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weight } } -QValueVector<KisChannelInfo *> KisAlphaColorSpace::channels() const +TQValueVector<KisChannelInfo *> KisAlphaColorSpace::channels() const { return m_channels; } -bool KisAlphaColorSpace::convertPixelsTo(const Q_UINT8 *src, - Q_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, - Q_UINT32 numPixels, - Q_INT32 /*renderingIntent*/) +bool KisAlphaColorSpace::convertPixelsTo(const TQ_UINT8 *src, + TQ_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, + TQ_UINT32 numPixels, + TQ_INT32 /*renderingIntent*/) { // No lcms trickery here, we are only a opacity channel - Q_INT32 size = dstColorSpace->pixelSize(); + TQ_INT32 size = dstColorSpace->pixelSize(); - Q_UINT32 j = 0; - Q_UINT32 i = 0; + TQ_UINT32 j = 0; + TQ_UINT32 i = 0; while ( i < numPixels ) { - dstColorSpace->fromQColor(Qt::red, OPACITY_OPAQUE - *(src + i), (dst + j)); + dstColorSpace->fromTQColor(TQt::red, OPACITY_OPAQUE - *(src + i), (dst + j)); i += 1; j += size; @@ -125,33 +125,33 @@ bool KisAlphaColorSpace::convertPixelsTo(const Q_UINT8 *src, } -//XXX bitblt of ColorSpaceAlpha does not take mask into consideration as this is probably not +//XXX bitblt of ColorSpaceAlpha does not take tqmask into consideration as this is probably not // used ever -void KisAlphaColorSpace::bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, +void KisAlphaColorSpace::bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) { - Q_UINT8 *d; - const Q_UINT8 *s; - Q_INT32 i; - Q_INT32 linesize; + TQ_UINT8 *d; + const TQ_UINT8 *s; + TQ_INT32 i; + TQ_INT32 linesize; if (rows <= 0 || cols <= 0) return; switch (op.op()) { case COMPOSITE_COPY: - compositeCopy(dst, dststride, src, srcRowStride, srcAlphaMask, maskRowStride, rows, cols, opacity); + compositeCopy(dst, dststride, src, srcRowStride, srcAlphaMask, tqmaskRowStride, rows, cols, opacity); return; case COMPOSITE_CLEAR: - linesize = sizeof(Q_UINT8) * cols; + linesize = sizeof(TQ_UINT8) * cols; d = dst; while (rows-- > 0) { memset(d, OPACITY_TRANSPARENT, linesize); @@ -258,30 +258,30 @@ KisCompositeOpList KisAlphaColorSpace::userVisiblecompositeOps() const return list; } -QString KisAlphaColorSpace::channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const +TQString KisAlphaColorSpace::channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const { Q_ASSERT(channelIndex < nChannels()); - Q_UINT32 channelPosition = m_channels[channelIndex]->pos(); + TQ_UINT32 channelPosition = m_channels[channelIndex]->pos(); - return QString().setNum(pixel[channelPosition]); + return TQString().setNum(pixel[channelPosition]); } -QString KisAlphaColorSpace::normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const +TQString KisAlphaColorSpace::normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const { Q_ASSERT(channelIndex < nChannels()); - Q_UINT32 channelPosition = m_channels[channelIndex]->pos(); + TQ_UINT32 channelPosition = m_channels[channelIndex]->pos(); - return QString().setNum(static_cast<float>(pixel[channelPosition]) / UINT8_MAX); + return TQString().setNum(static_cast<float>(pixel[channelPosition]) / UINT8_MAX); } -void KisAlphaColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const +void KisAlphaColorSpace::convolveColors(TQ_UINT8** colors, TQ_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nColors) const { - Q_INT32 totalAlpha = 0; + TQ_INT32 totalAlpha = 0; while (nColors--) { - Q_INT32 weight = *kernelValues; + TQ_INT32 weight = *kernelValues; if (weight != 0) { totalAlpha += (*colors)[PIXEL_MASK] * weight; @@ -291,6 +291,6 @@ void KisAlphaColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues } if (channelFlags & KisChannelInfo::FLAG_ALPHA) { - dst[PIXEL_MASK] = CLAMP((totalAlpha/ factor) + offset, 0, Q_UINT8_MAX); + dst[PIXEL_MASK] = CLAMP((totalAlpha/ factor) + offset, 0, TQ_UINT8_MAX); } } diff --git a/krita/kritacolor/colorspaces/kis_alpha_colorspace.h b/krita/kritacolor/colorspaces/kis_alpha_colorspace.h index a2113cce..dd4f3916 100644 --- a/krita/kritacolor/colorspaces/kis_alpha_colorspace.h +++ b/krita/kritacolor/colorspaces/kis_alpha_colorspace.h @@ -18,18 +18,18 @@ #ifndef KIS_COLORSPACE_ALPHA_H_ #define KIS_COLORSPACE_ALPHA_H_ -#include <qcolor.h> +#include <tqcolor.h> #include "kis_global.h" #include "kis_u8_base_colorspace.h" /** - * The alpha mask is a special color strategy that treats all pixels as - * alpha value with a colour common to the mask. The default color is white. + * The alpha tqmask is a special color strategy that treats all pixels as + * alpha value with a colour common to the tqmask. The default color is white. */ class KisAlphaColorSpace : public KisU8BaseColorSpace { public: - KisAlphaColorSpace(KisColorSpaceFactoryRegistry * parent, + KisAlphaColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p); virtual ~KisAlphaColorSpace(); @@ -39,26 +39,26 @@ public: return false; }; - virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0); - virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0); + virtual void fromTQColor(const TQColor& c, TQ_UINT8 *dst, KisProfile * profile = 0); + virtual void fromTQColor(const TQColor& c, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile * profile = 0); - virtual void getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha) const; + virtual void getAlpha(const TQ_UINT8 *pixel, TQ_UINT8 *alpha) const; - virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile = 0); - virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0); + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, KisProfile * profile = 0); + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile * profile = 0); - virtual Q_UINT8 difference(const Q_UINT8 *src1, const Q_UINT8 *src2); - virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const; + virtual TQ_UINT8 difference(const TQ_UINT8 *src1, const TQ_UINT8 *src2); + virtual void mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const; - virtual QValueVector<KisChannelInfo *> channels() const; - virtual Q_UINT32 nChannels() const { return 1; }; - virtual Q_UINT32 nColorChannels() const { return 0; }; - virtual Q_UINT32 pixelSize() const { return 1; }; + virtual TQValueVector<KisChannelInfo *> channels() const; + virtual TQ_UINT32 nChannels() const { return 1; }; + virtual TQ_UINT32 nColorChannels() const { return 0; }; + virtual TQ_UINT32 pixelSize() const { return 1; }; - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; - virtual void convolveColors(Q_UINT8** colors, Q_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const; + virtual void convolveColors(TQ_UINT8** colors, TQ_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nColors) const; protected: @@ -68,22 +68,22 @@ protected: * * Returns false if the conversion failed, true if it succeeded */ - virtual bool convertPixelsTo(const Q_UINT8 *src, - Q_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, - Q_UINT32 numPixels, - Q_INT32 renderingIntent = INTENT_PERCEPTUAL); - - - - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + virtual bool convertPixelsTo(const TQ_UINT8 *src, + TQ_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, + TQ_UINT32 numPixels, + TQ_INT32 renderingIntent = INTENT_PERCEPTUAL); + + + + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op); KisCompositeOpList userVisiblecompositeOps() const; diff --git a/krita/kritacolor/colorspaces/kis_lab_colorspace.cc b/krita/kritacolor/colorspaces/kis_lab_colorspace.cc index ec370bb3..829b4f27 100644 --- a/krita/kritacolor/colorspaces/kis_lab_colorspace.cc +++ b/krita/kritacolor/colorspaces/kis_lab_colorspace.cc @@ -24,7 +24,7 @@ #include <stdlib.h> #include LCMS_HEADER -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> #include <klocale.h> @@ -33,18 +33,18 @@ #include "kis_color_conversions.h" #include "kis_integer_maths.h" -KisLabColorSpace::KisLabColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) +KisLabColorSpace::KisLabColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) : KisU16BaseColorSpace(KisID("LABA", i18n("L*a*b* (16-bit integer/channel)")), COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1), - icSigLabData, parent, p) + icSigLabData, tqparent, p) { - m_channels.push_back(new KisChannelInfo(i18n("Lightness"), i18n("L"), CHANNEL_L * sizeof(Q_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(Q_UINT16), QColor(100,100,100))); - m_channels.push_back(new KisChannelInfo(i18n("a*"), i18n("a"), CHANNEL_A * sizeof(Q_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(Q_UINT16), QColor(150,150,150))); - m_channels.push_back(new KisChannelInfo(i18n("b*"), i18n("b"), CHANNEL_B * sizeof(Q_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(Q_UINT16), QColor(200,200,200))); - m_channels.push_back(new KisChannelInfo(i18n("Alpha"), i18n("A"), CHANNEL_ALPHA * sizeof(Q_UINT16), KisChannelInfo::ALPHA, KisChannelInfo::UINT16, sizeof(Q_UINT16))); + m_channels.push_back(new KisChannelInfo(i18n("Lightness"), i18n("L"), CHANNEL_L * sizeof(TQ_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(TQ_UINT16), TQColor(100,100,100))); + m_channels.push_back(new KisChannelInfo(i18n("a*"), i18n("a"), CHANNEL_A * sizeof(TQ_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(TQ_UINT16), TQColor(150,150,150))); + m_channels.push_back(new KisChannelInfo(i18n("b*"), i18n("b"), CHANNEL_B * sizeof(TQ_UINT16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(TQ_UINT16), TQColor(200,200,200))); + m_channels.push_back(new KisChannelInfo(i18n("Alpha"), i18n("A"), CHANNEL_ALPHA * sizeof(TQ_UINT16), KisChannelInfo::ALPHA, KisChannelInfo::UINT16, sizeof(TQ_UINT16))); - m_alphaPos = CHANNEL_ALPHA * sizeof(Q_UINT16); + m_alphaPos = CHANNEL_ALPHA * sizeof(TQ_UINT16); init(); } @@ -53,21 +53,21 @@ KisLabColorSpace::~KisLabColorSpace() { } -Q_UINT8 * KisLabColorSpace::toLabA16(const Q_UINT8 * data, const Q_UINT32 nPixels) const +TQ_UINT8 * KisLabColorSpace::toLabA16(const TQ_UINT8 * data, const TQ_UINT32 nPixels) const { - Q_UINT8 * pixels = new Q_UINT8[nPixels * pixelSize()]; + TQ_UINT8 * pixels = new TQ_UINT8[nPixels * pixelSize()]; memcpy( pixels, data, nPixels * pixelSize() ); return pixels; } -Q_UINT8 * KisLabColorSpace::fromLabA16(const Q_UINT8 * labData, const Q_UINT32 nPixels) const +TQ_UINT8 * KisLabColorSpace::fromLabA16(const TQ_UINT8 * labData, const TQ_UINT32 nPixels) const { - Q_UINT8 * pixels = new Q_UINT8[nPixels * pixelSize()]; + TQ_UINT8 * pixels = new TQ_UINT8[nPixels * pixelSize()]; memcpy( pixels, labData, nPixels * pixelSize() ); return pixels; } -Q_UINT8 KisLabColorSpace::difference(const Q_UINT8 *src1, const Q_UINT8 *src2) +TQ_UINT8 KisLabColorSpace::difference(const TQ_UINT8 *src1, const TQ_UINT8 *src2) { cmsCIELab labF1, labF2; @@ -80,18 +80,18 @@ Q_UINT8 KisLabColorSpace::difference(const Q_UINT8 *src1, const Q_UINT8 *src2) if(diff>255) return 255; else - return Q_INT8(diff); + return TQ_INT8(diff); } -void KisLabColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const +void KisLabColorSpace::mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const { - Q_UINT32 totalLightness = 0, totalAlpha = 0; - Q_UINT32 totala = 0, totalb = 0; + TQ_UINT32 totalLightness = 0, totalAlpha = 0; + TQ_UINT32 totala = 0, totalb = 0; while (nColors--) { const Pixel *color = reinterpret_cast<const Pixel *>( *colors ); - Q_UINT32 alphaTimesWeight = UINT8_MULT(color->alpha, *weights); + TQ_UINT32 alphaTimesWeight = UINT8_MULT(color->alpha, *weights); totalLightness += color->lightness * alphaTimesWeight; totala += color->a * alphaTimesWeight; @@ -133,9 +133,9 @@ void KisLabColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, ((Pixel *)dst)->b = totalb; } -void KisLabColorSpace::invertColor(Q_UINT8 * src, Q_INT32 nPixels) +void KisLabColorSpace::invertColor(TQ_UINT8 * src, TQ_INT32 nPixels) { - Q_UINT32 psize = pixelSize(); + TQ_UINT32 psize = pixelSize(); while (nPixels--) { @@ -149,15 +149,15 @@ void KisLabColorSpace::invertColor(Q_UINT8 * src, Q_INT32 nPixels) } } -void KisLabColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, - Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const +void KisLabColorSpace::convolveColors(TQ_UINT8** colors, TQ_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, + TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nColors) const { - Q_INT32 totalL = 0, totalA = 0, totalB = 0, totalAlpha = 0; + TQ_INT32 totalL = 0, totalA = 0, totalB = 0, totalAlpha = 0; while ( nColors -- ) { const Pixel * pixel = reinterpret_cast<const Pixel *>( *colors ); - Q_INT32 weight = *kernelValues; + TQ_INT32 weight = *kernelValues; if ( weight != 0 ) { totalL += pixel->lightness * weight; totalA += pixel->a * weight; @@ -172,29 +172,29 @@ void KisLabColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, Pixel * p = reinterpret_cast< Pixel *>( dst ); if (channelFlags & KisChannelInfo::FLAG_COLOR) { - p->lightness = CLAMP( ( totalL / factor) + offset, 0, Q_UINT16_MAX); - p->a = CLAMP( ( totalA / factor) + offset, 0, Q_UINT16_MAX); - p->b = CLAMP( ( totalB / factor) + offset, 0, Q_UINT16_MAX); + p->lightness = CLAMP( ( totalL / factor) + offset, 0, TQ_UINT16_MAX); + p->a = CLAMP( ( totalA / factor) + offset, 0, TQ_UINT16_MAX); + p->b = CLAMP( ( totalB / factor) + offset, 0, TQ_UINT16_MAX); } if (channelFlags & KisChannelInfo::FLAG_ALPHA) { - p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, Q_UINT16_MAX); + p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, TQ_UINT16_MAX); } } -void KisLabColorSpace::darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const +void KisLabColorSpace::darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const { // XXX: Is the 255 right for u16 colorspaces? - Q_UINT32 pSize = pixelSize(); + TQ_UINT32 pSize = pixelSize(); while ( nPixels-- ) { const Pixel * s = reinterpret_cast<const Pixel*>( src ); Pixel * d = reinterpret_cast<Pixel*>( dst ); if ( compensate ) { - d->lightness = static_cast<Q_UINT16>( ( s->lightness * shade ) / ( compensation * 255 ) ); + d->lightness = static_cast<TQ_UINT16>( ( s->lightness * shade ) / ( compensation * 255 ) ); } else { - d->lightness = static_cast<Q_UINT16>( s->lightness * shade / 255 ); + d->lightness = static_cast<TQ_UINT16>( s->lightness * shade / 255 ); } d->a = s->a; d->b = s->b; @@ -206,27 +206,27 @@ void KisLabColorSpace::darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, } -QValueVector<KisChannelInfo *> KisLabColorSpace::channels() const +TQValueVector<KisChannelInfo *> KisLabColorSpace::channels() const { return m_channels; } -Q_UINT32 KisLabColorSpace::nChannels() const +TQ_UINT32 KisLabColorSpace::nChannels() const { return NUM_CHANNELS; } -Q_UINT32 KisLabColorSpace::nColorChannels() const +TQ_UINT32 KisLabColorSpace::nColorChannels() const { return NUM_COLOR_CHANNELS; } -Q_UINT32 KisLabColorSpace::pixelSize() const +TQ_UINT32 KisLabColorSpace::pixelSize() const { return sizeof(Pixel); } -void KisLabColorSpace::getSingleChannelPixel(Q_UINT8 *dst, const Q_UINT8 *src, Q_UINT32 channelIndex) +void KisLabColorSpace::getSingleChannelPixel(TQ_UINT8 *dst, const TQ_UINT8 *src, TQ_UINT32 channelIndex) { if (channelIndex < NUM_CHANNELS) { @@ -262,24 +262,24 @@ void KisLabColorSpace::getSingleChannelPixel(Q_UINT8 *dst, const Q_UINT8 *src, Q } } -void KisLabColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisLabColorSpace::compositeOver(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { while (rows > 0) { const Pixel *src = reinterpret_cast<const Pixel *>(srcRowStart); Pixel *dst = reinterpret_cast<Pixel *>(dstRowStart); - const Q_UINT8 *mask = maskRowStart; - Q_INT32 columns = numColumns; + const TQ_UINT8 *tqmask = tqmaskRowStart; + TQ_INT32 columns = numColumns; while (columns > 0) { - Q_UINT16 srcAlpha = src->alpha; + TQ_UINT16 srcAlpha = src->alpha; - // apply the alphamask - if (mask != 0) { - if (*mask != OPACITY_OPAQUE) { - srcAlpha = UINT16_MULT(srcAlpha, *mask); + // apply the alphatqmask + if (tqmask != 0) { + if (*tqmask != OPACITY_OPAQUE) { + srcAlpha = UINT16_MULT(srcAlpha, *tqmask); } - mask++; + tqmask++; } if (srcAlpha != U16_OPACITY_TRANSPARENT) { @@ -291,14 +291,14 @@ void KisLabColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, if (srcAlpha == U16_OPACITY_OPAQUE) { memcpy(dst, src, sizeof(Pixel)); } else { - Q_UINT16 dstAlpha = dst->alpha; + TQ_UINT16 dstAlpha = dst->alpha; - Q_UINT16 srcBlend; + TQ_UINT16 srcBlend; if (dstAlpha == U16_OPACITY_OPAQUE) { srcBlend = srcAlpha; } else { - Q_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); + TQ_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); dst->alpha = newAlpha; if (newAlpha != 0) { @@ -331,40 +331,40 @@ printf("%d %d %d\n", dst->lightness, dst->a, dst->b); rows--; srcRowStart += srcRowStride; dstRowStart += dstRowStride; - if(maskRowStart) { - maskRowStart += maskRowStride; + if(tqmaskRowStart) { + tqmaskRowStart += tqmaskRowStride; } } } -void KisLabColorSpace::compositeErase(Q_UINT8 *dst, - Q_INT32 dstRowSize, - const Q_UINT8 *src, - Q_INT32 srcRowSize, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_INT32 rows, - Q_INT32 cols, - Q_UINT16 /*opacity*/) +void KisLabColorSpace::compositeErase(TQ_UINT8 *dst, + TQ_INT32 dstRowSize, + const TQ_UINT8 *src, + TQ_INT32 srcRowSize, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_INT32 rows, + TQ_INT32 cols, + TQ_UINT16 /*opacity*/) { while (rows-- > 0) { const Pixel *s = reinterpret_cast<const Pixel *>(src); Pixel *d = reinterpret_cast<Pixel *>(dst); - const Q_UINT8 *mask = srcAlphaMask; + const TQ_UINT8 *tqmask = srcAlphaMask; - for (Q_INT32 i = cols; i > 0; i--, s++, d++) + for (TQ_INT32 i = cols; i > 0; i--, s++, d++) { - Q_UINT16 srcAlpha = s->alpha; + TQ_UINT16 srcAlpha = s->alpha; - // apply the alphamask - if (mask != 0) { - Q_UINT8 U8_mask = *mask; + // apply the alphatqmask + if (tqmask != 0) { + TQ_UINT8 U8_tqmask = *tqmask; - if (U8_mask != OPACITY_OPAQUE) { - srcAlpha = UINT16_BLEND(srcAlpha, U16_OPACITY_OPAQUE, UINT8_TO_UINT16(U8_mask)); + if (U8_tqmask != OPACITY_OPAQUE) { + srcAlpha = UINT16_BLEND(srcAlpha, U16_OPACITY_OPAQUE, UINT8_TO_UINT16(U8_tqmask)); } - mask++; + tqmask++; } d->alpha = UINT16_MULT(srcAlpha, d->alpha); } @@ -372,30 +372,30 @@ void KisLabColorSpace::compositeErase(Q_UINT8 *dst, dst += dstRowSize; src += srcRowSize; if(srcAlphaMask) { - srcAlphaMask += maskRowStride; + srcAlphaMask += tqmaskRowStride; } } } -void KisLabColorSpace::bitBlt(Q_UINT8 *dst, - Q_INT32 dstRowStride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *mask, - Q_INT32 maskRowStride, - Q_UINT8 U8_opacity, - Q_INT32 rows, - Q_INT32 cols, +void KisLabColorSpace::bitBlt(TQ_UINT8 *dst, + TQ_INT32 dstRowStride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *tqmask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 U8_opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) { - Q_UINT16 opacity = UINT8_TO_UINT16(U8_opacity); + TQ_UINT16 opacity = UINT8_TO_UINT16(U8_opacity); switch (op.op()) { case COMPOSITE_UNDEF: // Undefined == no composition break; case COMPOSITE_OVER: - compositeOver(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeOver(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_IN: //compositeIn(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -425,16 +425,16 @@ void KisLabColorSpace::bitBlt(Q_UINT8 *dst, //compositeDiff(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_MULT: - //compositeMultiply(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeMultiply(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_DIVIDE: - //compositeDivide(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeDivide(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_BUMPMAP: //compositeBumpmap(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_COPY: - compositeCopy(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, U8_opacity); + compositeCopy(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, U8_opacity); break; case COMPOSITE_COPY_RED: //compositeCopyRed(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -469,22 +469,22 @@ void KisLabColorSpace::bitBlt(Q_UINT8 *dst, // No composition. break; case COMPOSITE_DARKEN: - //compositeDarken(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeDarken(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_LIGHTEN: - //compositeLighten(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeLighten(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_HUE: - //compositeHue(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeHue(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_SATURATION: - //compositeSaturation(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeSaturation(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_VALUE: - //compositeValue(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeValue(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_COLOR: - //compositeColor(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeColor(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_COLORIZE: //compositeColorize(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -493,24 +493,24 @@ void KisLabColorSpace::bitBlt(Q_UINT8 *dst, //compositeLuminize(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_SCREEN: - //compositeScreen(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeScreen(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_OVERLAY: - //compositeOverlay(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeOverlay(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_ERASE: - compositeErase(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeErase(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_DODGE: - //compositeDodge(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeDodge(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_BURN: - //compositeBurn(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeBurn(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_ALPHA_DARKEN: - abstractCompositeAlphaDarken<Q_UINT16, U16Mult, Uint8ToU16, U16OpacityTest, + abstractCompositeAlphaDarken<TQ_UINT16, U16Mult, Uint8ToU16, U16OpacityTest, CHANNEL_ALPHA, NUM_COLOR_CHANNELS, NUM_CHANNELS>( - dst, dstRowStride, src, srcRowStride, mask, maskRowStride, + dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity, U16Mult(), Uint8ToU16(), U16OpacityTest()); break; default: @@ -528,26 +528,26 @@ KisCompositeOpList KisLabColorSpace::userVisiblecompositeOps() const return list; } -QString KisLabColorSpace::channelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisLabColorSpace::channelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { const Pixel *pix = reinterpret_cast<const Pixel *>(U8_pixel); Q_ASSERT(channelIndex < nChannels()); switch(channelIndex) { case CHANNEL_L: - return QString().setNum(pix->lightness); + return TQString().setNum(pix->lightness); case CHANNEL_A: - return QString().setNum(pix->a); + return TQString().setNum(pix->a); case CHANNEL_B: - return QString().setNum(pix->b); + return TQString().setNum(pix->b); case CHANNEL_ALPHA: - return QString().setNum(pix->alpha); + return TQString().setNum(pix->alpha); default: - return QString("Error"); + return TQString("Error"); } } -QString KisLabColorSpace::normalisedChannelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisLabColorSpace::normalisedChannelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { const Pixel *pix = reinterpret_cast<const Pixel *>(U8_pixel); Q_ASSERT(channelIndex < nChannels()); @@ -557,15 +557,15 @@ QString KisLabColorSpace::normalisedChannelValueText(const Q_UINT8 *U8_pixel, Q_ switch(channelIndex) { case CHANNEL_L: - return QString().setNum(100.0 * static_cast<float>(pix->lightness) / MAX_CHANNEL_L); + return TQString().setNum(100.0 * static_cast<float>(pix->lightness) / MAX_CHANNEL_L); case CHANNEL_A: - return QString().setNum(100.0 * ((static_cast<float>(pix->a) - CHANNEL_AB_ZERO_OFFSET) / MAX_CHANNEL_AB)); + return TQString().setNum(100.0 * ((static_cast<float>(pix->a) - CHANNEL_AB_ZERO_OFFSET) / MAX_CHANNEL_AB)); case CHANNEL_B: - return QString().setNum(100.0 * ((static_cast<float>(pix->b) - CHANNEL_AB_ZERO_OFFSET) / MAX_CHANNEL_AB)); + return TQString().setNum(100.0 * ((static_cast<float>(pix->b) - CHANNEL_AB_ZERO_OFFSET) / MAX_CHANNEL_AB)); case CHANNEL_ALPHA: - return QString().setNum(100.0 * static_cast<float>(pix->alpha) / UINT16_MAX); + return TQString().setNum(100.0 * static_cast<float>(pix->alpha) / UINT16_MAX); default: - return QString("Error"); + return TQString("Error"); } } diff --git a/krita/kritacolor/colorspaces/kis_lab_colorspace.h b/krita/kritacolor/colorspaces/kis_lab_colorspace.h index 4108e699..7bfa1f83 100644 --- a/krita/kritacolor/colorspaces/kis_lab_colorspace.h +++ b/krita/kritacolor/colorspaces/kis_lab_colorspace.h @@ -19,7 +19,7 @@ #ifndef KIS_STRATEGY_COLORSPACE_LAB_H_ #define KIS_STRATEGY_COLORSPACE_LAB_H_ -#include <qcolor.h> +#include <tqcolor.h> #include <klocale.h> @@ -29,7 +29,7 @@ class KisLabColorSpace : public KisU16BaseColorSpace { public: - KisLabColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p); + KisLabColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p); virtual ~KisLabColorSpace(); public: @@ -38,13 +38,13 @@ public: * Return a COPY of the provided data. This method is provided to provide consistency, * but you really don't want to be calling it. */ - virtual Q_UINT8 * toLabA16(const Q_UINT8 * data, const Q_UINT32 nPixels) const; + virtual TQ_UINT8 * toLabA16(const TQ_UINT8 * data, const TQ_UINT32 nPixels) const; /** * Return a COPY of the provided data. This method is provided for consistency, * but you really don't want to call it. */ - virtual Q_UINT8 * fromLabA16(const Q_UINT8 * labData, const Q_UINT32 nPixels) const; + virtual TQ_UINT8 * fromLabA16(const TQ_UINT8 * labData, const TQ_UINT32 nPixels) const; @@ -56,75 +56,75 @@ public: return false; }; - virtual QValueVector<KisChannelInfo *> channels() const; - virtual Q_UINT32 nChannels() const; - virtual Q_UINT32 nColorChannels() const; - virtual Q_UINT32 pixelSize() const; + virtual TQValueVector<KisChannelInfo *> channels() const; + virtual TQ_UINT32 nChannels() const; + virtual TQ_UINT32 nColorChannels() const; + virtual TQ_UINT32 pixelSize() const; - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual void getSingleChannelPixel(Q_UINT8 *dstPixel, const Q_UINT8 *srcPixel, Q_UINT32 channelIndex); + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual void getSingleChannelPixel(TQ_UINT8 *dstPixel, const TQ_UINT8 *srcPixel, TQ_UINT32 channelIndex); - virtual Q_UINT8 difference(const Q_UINT8 *src1, const Q_UINT8 *src2); - virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const; - virtual void invertColor(Q_UINT8 * src, Q_INT32 nPixels); - virtual void convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const; + virtual TQ_UINT8 difference(const TQ_UINT8 *src1, const TQ_UINT8 *src2); + virtual void mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const; + virtual void invertColor(TQ_UINT8 * src, TQ_INT32 nPixels); + virtual void convolveColors(TQ_UINT8** colors, TQ_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nColors) const; - virtual void darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const; + virtual void darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const; virtual KisCompositeOpList userVisiblecompositeOps() const; protected: - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dstRowStride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dstRowStride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op); - void compositeOver(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); + void compositeOver(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); /* - void compositeMultiply(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDivide(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeScreen(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeOverlay(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDodge(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeBurn(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDarken(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeLighten(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeHue(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeSaturation(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeValue(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeColor(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); + void compositeMultiply(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDivide(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeScreen(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeOverlay(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDodge(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeBurn(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDarken(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeLighten(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeHue(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeSaturation(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeValue(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeColor(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); */ - void compositeErase(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); + void compositeErase(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); private: struct Pixel { - Q_UINT16 lightness; - Q_UINT16 a; - Q_UINT16 b; - Q_UINT16 alpha; + TQ_UINT16 lightness; + TQ_UINT16 a; + TQ_UINT16 b; + TQ_UINT16 alpha; }; - static const Q_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX; - static const Q_UINT16 U16_OPACITY_TRANSPARENT = UINT16_MIN; + static const TQ_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX; + static const TQ_UINT16 U16_OPACITY_TRANSPARENT = UINT16_MIN; - static const Q_UINT32 NUM_CHANNELS = 4; - static const Q_UINT32 NUM_COLOR_CHANNELS = 3; + static const TQ_UINT32 NUM_CHANNELS = 4; + static const TQ_UINT32 NUM_COLOR_CHANNELS = 3; - static const Q_UINT32 CHANNEL_L = 0; - static const Q_UINT32 CHANNEL_A = 1; - static const Q_UINT32 CHANNEL_B = 2; - static const Q_UINT32 CHANNEL_ALPHA = 3; + static const TQ_UINT32 CHANNEL_L = 0; + static const TQ_UINT32 CHANNEL_A = 1; + static const TQ_UINT32 CHANNEL_B = 2; + static const TQ_UINT32 CHANNEL_ALPHA = 3; - static const Q_UINT32 MAX_CHANNEL_L = 0xff00; - static const Q_UINT32 MAX_CHANNEL_AB = 0xffff; - static const Q_UINT32 CHANNEL_AB_ZERO_OFFSET = 0x8000; + static const TQ_UINT32 MAX_CHANNEL_L = 0xff00; + static const TQ_UINT32 MAX_CHANNEL_AB = 0xffff; + static const TQ_UINT32 CHANNEL_AB_ZERO_OFFSET = 0x8000; friend class KisLabColorSpaceTester; }; @@ -141,13 +141,13 @@ public: /** * lcms colorspace type definition. */ - virtual Q_UINT32 colorSpaceType() { return (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)); }; + virtual TQ_UINT32 colorSpaceType() { return (COLORSPACE_SH(PT_Lab)|CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)); }; virtual icColorSpaceSignature colorSpaceSignature() { return icSigLabData; }; - virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) { return new KisLabColorSpace(parent, p); }; + virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) { return new KisLabColorSpace(tqparent, p); }; - virtual QString defaultProfile() { return "Lab built-in - (lcms internal)"; }; + virtual TQString defaultProfile() { return "Lab built-in - (lcms internal)"; }; }; #endif // KIS_STRATEGY_COLORSPACE_LAB_H_ diff --git a/krita/kritacolor/colorspaces/kis_xyz_colorspace.cc b/krita/kritacolor/colorspaces/kis_xyz_colorspace.cc index 3d14ea18..98ccead0 100644 --- a/krita/kritacolor/colorspaces/kis_xyz_colorspace.cc +++ b/krita/kritacolor/colorspaces/kis_xyz_colorspace.cc @@ -23,7 +23,7 @@ #include <config.h> #include LCMS_HEADER -#include <qimage.h> +#include <tqimage.h> #include <klocale.h> #include <kdebug.h> @@ -34,21 +34,21 @@ #include "kis_integer_maths.h" #define downscale(quantum) (quantum) //((unsigned char) ((quantum)/257UL)) -#define upscale(value) (value) // ((Q_UINT8) (257UL*(value))) +#define upscale(value) (value) // ((TQ_UINT8) (257UL*(value))) // XXX: Maybe use TYPE_XYZ_DBL for an extra stimulating performance hit? People shouldn't depend // on this fallback... -KisXyzColorSpace::KisXyzColorSpace(KisColorSpaceFactoryRegistry * parent, +KisXyzColorSpace::KisXyzColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) : - KisU16BaseColorSpace(KisID("XYZA", i18n("XYZ/Alpha")), (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)), icSigCmykData, parent, p) + KisU16BaseColorSpace(KisID("XYZA", i18n("XYZ/Alpha")), (COLORSPACE_SH(PT_XYZ)|CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)), icSigCmykData, tqparent, p) { m_channels.push_back(new KisChannelInfo(i18n("X"), i18n("X"), 0, KisChannelInfo::COLOR, KisChannelInfo::UINT8)); m_channels.push_back(new KisChannelInfo(i18n("Y"), i18n("Y"), 1, KisChannelInfo::COLOR, KisChannelInfo::UINT8)); m_channels.push_back(new KisChannelInfo(i18n("Z"), i18n("Z"), 2, KisChannelInfo::COLOR, KisChannelInfo::UINT8)); m_channels.push_back(new KisChannelInfo(i18n("Alpha"), i18n("A"), 4, KisChannelInfo::ALPHA, KisChannelInfo::UINT8)); - m_alphaPos = PIXEL_ALPHA * sizeof(Q_UINT16); + m_alphaPos = PIXEL_ALPHA * sizeof(TQ_UINT16); init(); } @@ -59,42 +59,42 @@ KisXyzColorSpace::~KisXyzColorSpace() } -QValueVector<KisChannelInfo *> KisXyzColorSpace::channels() const +TQValueVector<KisChannelInfo *> KisXyzColorSpace::channels() const { return m_channels; } -Q_UINT32 KisXyzColorSpace::nChannels() const +TQ_UINT32 KisXyzColorSpace::nChannels() const { return xyz::MAX_CHANNEL_XYZA; } -Q_UINT32 KisXyzColorSpace::nColorChannels() const +TQ_UINT32 KisXyzColorSpace::nColorChannels() const { return xyz::MAX_CHANNEL_XYZ; } -Q_UINT32 KisXyzColorSpace::pixelSize() const +TQ_UINT32 KisXyzColorSpace::pixelSize() const { - return xyz::MAX_CHANNEL_XYZA * sizeof(Q_UINT16); + return xyz::MAX_CHANNEL_XYZA * sizeof(TQ_UINT16); } -KisColorAdjustment * KisXyzColorSpace::createBrightnessContrastAdjustment(Q_UINT16 *transferValues) +KisColorAdjustment * KisXyzColorSpace::createBrightnessContrastAdjustment(TQ_UINT16 *transferValues) { return 0; } -void KisXyzColorSpace::applyAdjustment(const Q_UINT8 *src, Q_UINT8 *dst, KisColorAdjustment *, Q_INT32 nPixels) +void KisXyzColorSpace::applyAdjustment(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *, TQ_INT32 nPixels) { } -void KisXyzColorSpace::invertColor(Q_UINT8 * src, Q_INT32 nPixels) +void KisXyzColorSpace::invertColor(TQ_UINT8 * src, TQ_INT32 nPixels) { - Q_INT32 pSize = pixelSize(); + TQ_INT32 pSize = pixelSize(); while (nPixels--) { - Q_UINT16 * p = reinterpret_cast<Q_UINT16 *>(src); + TQ_UINT16 * p = reinterpret_cast<TQ_UINT16 *>(src); p[PIXEL_X] = UINT16_MAX - p[PIXEL_X]; p[PIXEL_Y] = UINT16_MAX - p[PIXEL_Y]; p[PIXEL_Z] = UINT16_MAX - p[PIXEL_Z]; @@ -102,44 +102,44 @@ void KisXyzColorSpace::invertColor(Q_UINT8 * src, Q_INT32 nPixels) } } -void KisXyzColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const +void KisXyzColorSpace::mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const { } -void KisXyzColorSpace::convolveColors(Q_UINT8** colors, Q_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nPixels) const +void KisXyzColorSpace::convolveColors(TQ_UINT8** colors, TQ_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nPixels) const { } -void KisXyzColorSpace::darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const +void KisXyzColorSpace::darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const { } -Q_UINT8 KisXyzColorSpace::intensity8(const Q_UINT8 * src) const +TQ_UINT8 KisXyzColorSpace::intensity8(const TQ_UINT8 * src) const { return 0; } -void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeOver(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { while (rows > 0) { - const Q_UINT16 *src = reinterpret_cast<const Q_UINT16 *>(srcRowStart); - Q_UINT16 *dst = reinterpret_cast<Q_UINT16 *>(dstRowStart); - const Q_UINT8 *mask = maskRowStart; - Q_INT32 columns = numColumns; + const TQ_UINT16 *src = reinterpret_cast<const TQ_UINT16 *>(srcRowStart); + TQ_UINT16 *dst = reinterpret_cast<TQ_UINT16 *>(dstRowStart); + const TQ_UINT8 *tqmask = tqmaskRowStart; + TQ_INT32 columns = numColumns; while (columns > 0) { - Q_UINT16 srcAlpha = src[PIXEL_ALPHA]; + TQ_UINT16 srcAlpha = src[PIXEL_ALPHA]; - // apply the alphamask - if (mask != 0) { - Q_UINT8 U8_mask = *mask; + // apply the alphatqmask + if (tqmask != 0) { + TQ_UINT8 U8_tqmask = *tqmask; - if (U8_mask != OPACITY_OPAQUE) { - srcAlpha = UINT16_MULT(srcAlpha, UINT8_TO_UINT16(U8_mask)); + if (U8_tqmask != OPACITY_OPAQUE) { + srcAlpha = UINT16_MULT(srcAlpha, UINT8_TO_UINT16(U8_tqmask)); } - mask++; + tqmask++; } if (srcAlpha != U16_OPACITY_TRANSPARENT) { @@ -149,16 +149,16 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, } if (srcAlpha == U16_OPACITY_OPAQUE) { - memcpy(dst, src, xyz::MAX_CHANNEL_XYZA * sizeof(Q_UINT16)); + memcpy(dst, src, xyz::MAX_CHANNEL_XYZA * sizeof(TQ_UINT16)); } else { - Q_UINT16 dstAlpha = dst[PIXEL_ALPHA]; + TQ_UINT16 dstAlpha = dst[PIXEL_ALPHA]; - Q_UINT16 srcBlend; + TQ_UINT16 srcBlend; if (dstAlpha == U16_OPACITY_OPAQUE) { srcBlend = srcAlpha; } else { - Q_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); + TQ_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); dst[PIXEL_ALPHA] = newAlpha; if (newAlpha != 0) { @@ -169,7 +169,7 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, } if (srcBlend == U16_OPACITY_OPAQUE) { - memcpy(dst, src, xyz::MAX_CHANNEL_XYZ * sizeof(Q_UINT16)); + memcpy(dst, src, xyz::MAX_CHANNEL_XYZ * sizeof(TQ_UINT16)); } else { dst[PIXEL_X] = UINT16_BLEND(src[PIXEL_X], dst[PIXEL_X], srcBlend); dst[PIXEL_Y] = UINT16_BLEND(src[PIXEL_Y], dst[PIXEL_Y], srcBlend); @@ -186,8 +186,8 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, rows--; srcRowStart += srcRowStride; dstRowStart += dstRowStride; - if(maskRowStart) { - maskRowStart += maskRowStride; + if(tqmaskRowStart) { + tqmaskRowStart += tqmaskRowStride; } } } @@ -195,25 +195,25 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, #define COMMON_COMPOSITE_OP_PROLOG() \ while (rows > 0) { \ \ - const Q_UINT16 *src = reinterpret_cast<const Q_UINT16 *>(srcRowStart); \ - Q_UINT16 *dst = reinterpret_cast<Q_UINT16 *>(dstRowStart); \ - Q_INT32 columns = numColumns; \ - const Q_UINT8 *mask = maskRowStart; \ + const TQ_UINT16 *src = reinterpret_cast<const TQ_UINT16 *>(srcRowStart); \ + TQ_UINT16 *dst = reinterpret_cast<TQ_UINT16 *>(dstRowStart); \ + TQ_INT32 columns = numColumns; \ + const TQ_UINT8 *tqmask = tqmaskRowStart; \ \ while (columns > 0) { \ \ - Q_UINT16 srcAlpha = src[PIXEL_ALPHA]; \ - Q_UINT16 dstAlpha = dst[PIXEL_ALPHA]; \ + TQ_UINT16 srcAlpha = src[PIXEL_ALPHA]; \ + TQ_UINT16 dstAlpha = dst[PIXEL_ALPHA]; \ \ - srcAlpha = QMIN(srcAlpha, dstAlpha); \ + srcAlpha = TQMIN(srcAlpha, dstAlpha); \ \ - if (mask != 0) { \ - Q_UINT8 U8_mask = *mask; \ + if (tqmask != 0) { \ + TQ_UINT8 U8_tqmask = *tqmask; \ \ - if (U8_mask != OPACITY_OPAQUE) { \ - srcAlpha = UINT16_MULT(srcAlpha, UINT8_TO_UINT16(U8_mask)); \ + if (U8_tqmask != OPACITY_OPAQUE) { \ + srcAlpha = UINT16_MULT(srcAlpha, UINT8_TO_UINT16(U8_tqmask)); \ } \ - mask++; \ + tqmask++; \ } \ \ if (srcAlpha != U16_OPACITY_TRANSPARENT) { \ @@ -222,12 +222,12 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, srcAlpha = UINT16_MULT(srcAlpha, opacity); \ } \ \ - Q_UINT16 srcBlend; \ + TQ_UINT16 srcBlend; \ \ if (dstAlpha == U16_OPACITY_OPAQUE) { \ srcBlend = srcAlpha; \ } else { \ - Q_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); \ + TQ_UINT16 newAlpha = dstAlpha + UINT16_MULT(U16_OPACITY_OPAQUE - dstAlpha, srcAlpha); \ dst[PIXEL_ALPHA] = newAlpha; \ \ if (newAlpha != 0) { \ @@ -248,20 +248,20 @@ void KisXyzColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, rows--; \ srcRowStart += srcRowStride; \ dstRowStart += dstRowStride; \ - if(maskRowStart) { \ - maskRowStart += maskRowStride; \ + if(tqmaskRowStart) { \ + tqmaskRowStart += tqmaskRowStride; \ } \ } -void KisXyzColorSpace::compositeMultiply(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeMultiply(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; srcColor = UINT16_MULT(srcColor, dstColor); @@ -273,19 +273,19 @@ void KisXyzColorSpace::compositeMultiply(Q_UINT8 *dstRowStart, Q_INT32 dstRowStr COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeDivide(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeDivide(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; - srcColor = QMIN((dstColor * (UINT16_MAX + 1u) + (srcColor / 2u)) / (1u + srcColor), UINT16_MAX); + srcColor = TQMIN((dstColor * (UINT16_MAX + 1u) + (srcColor / 2u)) / (1u + srcColor), UINT16_MAX); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -294,19 +294,19 @@ void KisXyzColorSpace::compositeDivide(Q_UINT8 *dstRowStart, Q_INT32 dstRowStrid COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeScreen(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeScreen(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; srcColor = UINT16_MAX - UINT16_MULT(UINT16_MAX - dstColor, UINT16_MAX - srcColor); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -315,19 +315,19 @@ void KisXyzColorSpace::compositeScreen(Q_UINT8 *dstRowStart, Q_INT32 dstRowStrid COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeOverlay(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeOverlay(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; srcColor = UINT16_MULT(dstColor, dstColor + 2u * UINT16_MULT(srcColor, UINT16_MAX - dstColor)); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -336,19 +336,19 @@ void KisXyzColorSpace::compositeOverlay(Q_UINT8 *dstRowStart, Q_INT32 dstRowStri COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeDodge(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeDodge(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; - srcColor = QMIN((dstColor * (UINT16_MAX + 1u)) / (UINT16_MAX + 1u - srcColor), UINT16_MAX); + srcColor = TQMIN((dstColor * (UINT16_MAX + 1u)) / (UINT16_MAX + 1u - srcColor), UINT16_MAX); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -357,20 +357,20 @@ void KisXyzColorSpace::compositeDodge(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeBurn(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeBurn(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; - srcColor = QMIN(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), UINT16_MAX); + srcColor = TQMIN(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), UINT16_MAX); srcColor = CLAMP(UINT16_MAX - srcColor, 0u, UINT16_MAX); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -379,19 +379,19 @@ void KisXyzColorSpace::compositeBurn(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeDarken(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeDarken(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; - srcColor = QMIN(srcColor, dstColor); + srcColor = TQMIN(srcColor, dstColor); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -400,19 +400,19 @@ void KisXyzColorSpace::compositeDarken(Q_UINT8 *dstRowStart, Q_INT32 dstRowStrid COMMON_COMPOSITE_OP_EPILOG(); } -void KisXyzColorSpace::compositeLighten(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT16 opacity) +void KisXyzColorSpace::compositeLighten(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT16 opacity) { COMMON_COMPOSITE_OP_PROLOG(); { for (int channel = 0; channel < xyz::MAX_CHANNEL_XYZ; channel++) { - Q_UINT16 srcColor = src[channel]; - Q_UINT16 dstColor = dst[channel]; + TQ_UINT16 srcColor = src[channel]; + TQ_UINT16 dstColor = dst[channel]; - srcColor = QMAX(srcColor, dstColor); + srcColor = TQMAX(srcColor, dstColor); - Q_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); + TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); dst[channel] = newColor; } @@ -423,34 +423,34 @@ void KisXyzColorSpace::compositeLighten(Q_UINT8 *dstRowStart, Q_INT32 dstRowStri -void KisXyzColorSpace::compositeErase(Q_UINT8 *dst, - Q_INT32 dstRowSize, - const Q_UINT8 *src, - Q_INT32 srcRowSize, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_INT32 rows, - Q_INT32 cols, - Q_UINT16 /*opacity*/) +void KisXyzColorSpace::compositeErase(TQ_UINT8 *dst, + TQ_INT32 dstRowSize, + const TQ_UINT8 *src, + TQ_INT32 srcRowSize, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_INT32 rows, + TQ_INT32 cols, + TQ_UINT16 /*opacity*/) { while (rows-- > 0) { const Pixel *s = reinterpret_cast<const Pixel *>(src); Pixel *d = reinterpret_cast<Pixel *>(dst); - const Q_UINT8 *mask = srcAlphaMask; + const TQ_UINT8 *tqmask = srcAlphaMask; - for (Q_INT32 i = cols; i > 0; i--, s++, d++) + for (TQ_INT32 i = cols; i > 0; i--, s++, d++) { - Q_UINT16 srcAlpha = s -> alpha; + TQ_UINT16 srcAlpha = s -> alpha; - // apply the alphamask - if (mask != 0) { - Q_UINT8 U8_mask = *mask; + // apply the alphatqmask + if (tqmask != 0) { + TQ_UINT8 U8_tqmask = *tqmask; - if (U8_mask != OPACITY_OPAQUE) { - srcAlpha = UINT16_BLEND(srcAlpha, U16_OPACITY_OPAQUE, UINT8_TO_UINT16(U8_mask)); + if (U8_tqmask != OPACITY_OPAQUE) { + srcAlpha = UINT16_BLEND(srcAlpha, U16_OPACITY_OPAQUE, UINT8_TO_UINT16(U8_tqmask)); } - mask++; + tqmask++; } d -> alpha = UINT16_MULT(srcAlpha, d -> alpha); } @@ -458,30 +458,30 @@ void KisXyzColorSpace::compositeErase(Q_UINT8 *dst, dst += dstRowSize; src += srcRowSize; if(srcAlphaMask) { - srcAlphaMask += maskRowStride; + srcAlphaMask += tqmaskRowStride; } } } -void KisXyzColorSpace::bitBlt(Q_UINT8 *dst, - Q_INT32 dstRowStride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *mask, - Q_INT32 maskRowStride, - Q_UINT8 U8_opacity, - Q_INT32 rows, - Q_INT32 cols, +void KisXyzColorSpace::bitBlt(TQ_UINT8 *dst, + TQ_INT32 dstRowStride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *tqmask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 U8_opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) { - Q_UINT16 opacity = UINT8_TO_UINT16(U8_opacity); + TQ_UINT16 opacity = UINT8_TO_UINT16(U8_opacity); switch (op.op()) { case COMPOSITE_UNDEF: // Undefined == no composition break; case COMPOSITE_OVER: - compositeOver(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeOver(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_IN: //compositeIn(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -510,16 +510,16 @@ void KisXyzColorSpace::bitBlt(Q_UINT8 *dst, //compositeDiff(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_MULT: - compositeMultiply(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeMultiply(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_DIVIDE: - compositeDivide(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeDivide(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_BUMPMAP: //compositeBumpmap(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_COPY: - compositeCopy(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, U8_opacity); + compositeCopy(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, U8_opacity); break; case COMPOSITE_COPY_RED: //compositeCopyRed(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -554,22 +554,22 @@ void KisXyzColorSpace::bitBlt(Q_UINT8 *dst, // No composition. break; case COMPOSITE_DARKEN: - compositeDarken(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeDarken(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_LIGHTEN: - compositeLighten(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeLighten(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_HUE: - //compositeHue(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeHue(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_SATURATION: - //compositeSaturation(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeSaturation(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_VALUE: - //compositeValue(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeValue(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_COLOR: - //compositeColor(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + //compositeColor(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_COLORIZE: //compositeColorize(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); @@ -578,24 +578,24 @@ void KisXyzColorSpace::bitBlt(Q_UINT8 *dst, //compositeLuminize(pixelSize(), dst, dstRowStride, src, srcRowStride, rows, cols, opacity); break; case COMPOSITE_SCREEN: - compositeScreen(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeScreen(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_OVERLAY: - compositeOverlay(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeOverlay(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_ERASE: - compositeErase(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeErase(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_DODGE: - compositeDodge(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeDodge(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_BURN: - compositeBurn(dst, dstRowStride, src, srcRowStride, mask, maskRowStride, rows, cols, opacity); + compositeBurn(dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_ALPHA_DARKEN: - abstractCompositeAlphaDarken<Q_UINT16, U16Mult, Uint8ToU16, U16OpacityTest, + abstractCompositeAlphaDarken<TQ_UINT16, U16Mult, Uint8ToU16, U16OpacityTest, PIXEL_ALPHA, xyz::MAX_CHANNEL_XYZ, xyz::MAX_CHANNEL_XYZA>( - dst, dstRowStride, src, srcRowStride, mask, maskRowStride, + dst, dstRowStride, src, srcRowStride, tqmask, tqmaskRowStride, rows, cols, opacity, U16Mult(), Uint8ToU16(), U16OpacityTest()); break; default: diff --git a/krita/kritacolor/colorspaces/kis_xyz_colorspace.h b/krita/kritacolor/colorspaces/kis_xyz_colorspace.h index 86af9178..2f7c3efd 100644 --- a/krita/kritacolor/colorspaces/kis_xyz_colorspace.h +++ b/krita/kritacolor/colorspaces/kis_xyz_colorspace.h @@ -18,15 +18,15 @@ #ifndef KIS__COLORSPACE_XYZ_H_ #define KIS__COLORSPACE_XYZ_H_ -#include <qcolor.h> +#include <tqcolor.h> #include "kis_global.h" #include "kis_integer_maths.h" #include "kis_u16_base_colorspace.h" namespace xyz { - const Q_INT32 MAX_CHANNEL_XYZ = 3; - const Q_INT32 MAX_CHANNEL_XYZA = 4; + const TQ_INT32 MAX_CHANNEL_XYZ = 3; + const TQ_INT32 MAX_CHANNEL_XYZA = 4; } @@ -36,14 +36,14 @@ class KisXyzColorSpace : public KisU16BaseColorSpace { public: struct Pixel { - Q_UINT16 X; - Q_UINT16 Y; - Q_UINT16 Z; - Q_UINT16 alpha; + TQ_UINT16 X; + TQ_UINT16 Y; + TQ_UINT16 Z; + TQ_UINT16 alpha; }; public: - KisXyzColorSpace(KisColorSpaceFactoryRegistry * parent, + KisXyzColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p); virtual ~KisXyzColorSpace(); @@ -56,56 +56,56 @@ public: }; public: // Pixel manipulation - virtual KisColorAdjustment *createBrightnessContrastAdjustment(Q_UINT16 *transferValues); - virtual void applyAdjustment(const Q_UINT8 *src, Q_UINT8 *dst, KisColorAdjustment *, Q_INT32 nPixels); - virtual void invertColor(Q_UINT8 * src, Q_INT32 nPixels); - virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const; - virtual void convolveColors(Q_UINT8** colors, Q_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nPixels) const; - virtual void darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const; - virtual Q_UINT8 intensity8(const Q_UINT8 * src) const; + virtual KisColorAdjustment *createBrightnessContrastAdjustment(TQ_UINT16 *transferValues); + virtual void applyAdjustment(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *, TQ_INT32 nPixels); + virtual void invertColor(TQ_UINT8 * src, TQ_INT32 nPixels); + virtual void mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const; + virtual void convolveColors(TQ_UINT8** colors, TQ_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nPixels) const; + virtual void darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const; + virtual TQ_UINT8 intensity8(const TQ_UINT8 * src) const; // Information about the colorstrategy - virtual QValueVector<KisChannelInfo *> channels() const; - virtual Q_UINT32 nChannels() const; - virtual Q_UINT32 nColorChannels() const; - virtual Q_UINT32 pixelSize() const; + virtual TQValueVector<KisChannelInfo *> channels() const; + virtual TQ_UINT32 nChannels() const; + virtual TQ_UINT32 nColorChannels() const; + virtual TQ_UINT32 pixelSize() const; // Composition - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op); KisCompositeOpList userVisiblecompositeOps() const; protected: - void compositeOver(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeMultiply(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDivide(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeScreen(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeOverlay(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDodge(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeBurn(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeDarken(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeLighten(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); - void compositeErase(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT16 opacity); + void compositeOver(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeMultiply(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDivide(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeScreen(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeOverlay(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDodge(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeBurn(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeDarken(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeLighten(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); + void compositeErase(TQ_UINT8 *dst, TQ_INT32 dstRowStride, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmask, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 columns, TQ_UINT16 opacity); private: - static const Q_UINT8 PIXEL_X = 0; - static const Q_UINT8 PIXEL_Y = 1; - static const Q_UINT8 PIXEL_Z = 2; - static const Q_UINT8 PIXEL_ALPHA = 3; + static const TQ_UINT8 PIXEL_X = 0; + static const TQ_UINT8 PIXEL_Y = 1; + static const TQ_UINT8 PIXEL_Z = 2; + static const TQ_UINT8 PIXEL_ALPHA = 3; - Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor. + TQ_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor. }; diff --git a/krita/kritacolor/kis_abstract_colorspace.cc b/krita/kritacolor/kis_abstract_colorspace.cc index 0a6ad8e9..f29e965f 100644 --- a/krita/kritacolor/kis_abstract_colorspace.cc +++ b/krita/kritacolor/kis_abstract_colorspace.cc @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> #include <kconfig.h> @@ -63,9 +63,9 @@ class KisColorAdjustmentImpl : public KisColorAdjustment KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, - KisColorSpaceFactoryRegistry * parent, + KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) - : m_parent( parent ) + : m_parent( tqparent ) , m_profile( p ) , m_id( id ) , m_cmType( cmType ) @@ -87,8 +87,8 @@ KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, void KisAbstractColorSpace::init() { - // Default pixel buffer for QColor conversion - m_qcolordata = new Q_UINT8[3]; + // Default pixel buffer for TQColor conversion + m_qcolordata = new TQ_UINT8[3]; Q_CHECK_PTR(m_qcolordata); if (m_profile == 0) return; @@ -119,7 +119,7 @@ KisAbstractColorSpace::~KisAbstractColorSpace() -void KisAbstractColorSpace::fromQColor(const QColor& color, Q_UINT8 *dst, KisProfile * profile) +void KisAbstractColorSpace::fromTQColor(const TQColor& color, TQ_UINT8 *dst, KisProfile * profile) { m_qcolordata[2] = color.red(); m_qcolordata[1] = color.green(); @@ -146,18 +146,18 @@ void KisAbstractColorSpace::fromQColor(const QColor& color, Q_UINT8 *dst, KisPro setAlpha(dst, OPACITY_OPAQUE, 1); } -void KisAbstractColorSpace::fromQColor(const QColor& color, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile) +void KisAbstractColorSpace::fromTQColor(const TQColor& color, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile * profile) { - fromQColor(color, dst, profile); + fromTQColor(color, dst, profile); setAlpha(dst, opacity, 1); } -void KisAbstractColorSpace::toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile) +void KisAbstractColorSpace::toTQColor(const TQ_UINT8 *src, TQColor *c, KisProfile * profile) { if (profile == 0) { // Default sRGB transform if (!m_defaultToRGB) return; - cmsDoTransform(m_defaultToRGB, const_cast <Q_UINT8 *>(src), m_qcolordata, 1); + cmsDoTransform(m_defaultToRGB, const_cast <TQ_UINT8 *>(src), m_qcolordata, 1); } else { if (m_lastToRGB == 0 || (m_lastToRGB != 0 && m_lastRGBProfile != profile->profile())) { @@ -166,48 +166,48 @@ void KisAbstractColorSpace::toQColor(const Q_UINT8 *src, QColor *c, KisProfile * INTENT_PERCEPTUAL, 0); m_lastRGBProfile = profile->profile(); } - cmsDoTransform(m_lastToRGB, const_cast <Q_UINT8 *>(src), m_qcolordata, 1); + cmsDoTransform(m_lastToRGB, const_cast <TQ_UINT8 *>(src), m_qcolordata, 1); } c->setRgb(m_qcolordata[2], m_qcolordata[1], m_qcolordata[0]); } -void KisAbstractColorSpace::toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile) +void KisAbstractColorSpace::toTQColor(const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile * profile) { - toQColor(src, c, profile); + toTQColor(src, c, profile); *opacity = getAlpha(src); } -void KisAbstractColorSpace::toLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const +void KisAbstractColorSpace::toLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const { if ( m_defaultToLab == 0 ) return; - cmsDoTransform( m_defaultToLab, const_cast<Q_UINT8 *>( src ), dst, nPixels ); + cmsDoTransform( m_defaultToLab, const_cast<TQ_UINT8 *>( src ), dst, nPixels ); } -void KisAbstractColorSpace::fromLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const +void KisAbstractColorSpace::fromLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const { if ( m_defaultFromLab == 0 ) return; - cmsDoTransform( m_defaultFromLab, const_cast<Q_UINT8 *>( src ), dst, nPixels ); + cmsDoTransform( m_defaultFromLab, const_cast<TQ_UINT8 *>( src ), dst, nPixels ); } -void KisAbstractColorSpace::getSingleChannelPixel(Q_UINT8 *dstPixel, const Q_UINT8 *srcPixel, Q_UINT32 channelIndex) +void KisAbstractColorSpace::getSingleChannelPixel(TQ_UINT8 *dstPixel, const TQ_UINT8 *srcPixel, TQ_UINT32 channelIndex) { if (channelIndex < m_channels.count()) { - fromQColor(Qt::black, OPACITY_TRANSPARENT, dstPixel); + fromTQColor(TQt::black, OPACITY_TRANSPARENT, dstPixel); const KisChannelInfo *channelInfo = m_channels[channelIndex]; memcpy(dstPixel + channelInfo->pos(), srcPixel + channelInfo->pos(), channelInfo->size()); } } -bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, - Q_UINT8 * dst, +bool KisAbstractColorSpace::convertPixelsTo(const TQ_UINT8 * src, + TQ_UINT8 * dst, KisColorSpace * dstColorSpace, - Q_UINT32 numPixels, - Q_INT32 renderingIntent) + TQ_UINT32 numPixels, + TQ_INT32 renderingIntent) { if (dstColorSpace->colorSpaceType() == colorSpaceType() && dstColorSpace->getProfile() == getProfile()) @@ -220,8 +220,8 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, cmsHTRANSFORM tf = 0; - Q_INT32 srcPixelSize = pixelSize(); - Q_INT32 dstPixelSize = dstColorSpace->pixelSize(); + TQ_INT32 srcPixelSize = pixelSize(); + TQ_INT32 dstPixelSize = dstColorSpace->pixelSize(); if (m_lastUsedTransform != 0 && m_lastUsedDstColorSpace != 0) { if (dstColorSpace->colorSpaceType() == m_lastUsedDstColorSpace->colorSpaceType() && @@ -232,7 +232,7 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, if (!tf && m_profile && dstColorSpace->getProfile()) { - if (!m_transforms.contains(dstColorSpace)) { + if (!m_transforms.tqcontains(dstColorSpace)) { tf = createTransform(dstColorSpace, m_profile, dstColorSpace->getProfile(), @@ -254,11 +254,11 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, if (tf) { - cmsDoTransform(tf, const_cast<Q_UINT8 *>(src), dst, numPixels); + cmsDoTransform(tf, const_cast<TQ_UINT8 *>(src), dst, numPixels); // Lcms does nothing to the destination alpha channel so we must convert that manually. while (numPixels > 0) { - Q_UINT8 alpha = getAlpha(src); + TQ_UINT8 alpha = getAlpha(src); dstColorSpace->setAlpha(dst, alpha, 1); src += srcPixelSize; @@ -271,11 +271,11 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, // Last resort fallback. This will be removed when this class is renamed KisLCMSColorSpace after 1.5. while (numPixels > 0) { - QColor color; - Q_UINT8 opacity; + TQColor color; + TQ_UINT8 opacity; - toQColor(src, &color, &opacity); - dstColorSpace->fromQColor(color, opacity, dst); + toTQColor(src, &color, &opacity); + dstColorSpace->fromTQColor(color, opacity, dst); src += srcPixelSize; dst += dstPixelSize; @@ -286,7 +286,7 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, } -KisColorAdjustment *KisAbstractColorSpace::createBrightnessContrastAdjustment(Q_UINT16 *transferValues) +KisColorAdjustment *KisAbstractColorSpace::createBrightnessContrastAdjustment(TQ_UINT16 *transferValues) { if (!m_profile) return 0; @@ -393,7 +393,7 @@ KisColorAdjustment *KisAbstractColorSpace::createDesaturateAdjustment() return adj; } -KisColorAdjustment *KisAbstractColorSpace::createPerChannelAdjustment(Q_UINT16 **transferValues) +KisColorAdjustment *KisAbstractColorSpace::createPerChannelAdjustment(TQ_UINT16 **transferValues) { if (!m_profile) return 0; @@ -419,79 +419,79 @@ KisColorAdjustment *KisAbstractColorSpace::createPerChannelAdjustment(Q_UINT16 * } -void KisAbstractColorSpace::applyAdjustment(const Q_UINT8 *src, Q_UINT8 *dst, KisColorAdjustment *adjustment, Q_INT32 nPixels) +void KisAbstractColorSpace::applyAdjustment(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *adjustment, TQ_INT32 nPixels) { KisColorAdjustmentImpl * adj = dynamic_cast<KisColorAdjustmentImpl*>(adjustment); if (adj) - cmsDoTransform(adj->transform, const_cast<Q_UINT8 *>(src), dst, nPixels); + cmsDoTransform(adj->transform, const_cast<TQ_UINT8 *>(src), dst, nPixels); } -void KisAbstractColorSpace::invertColor(Q_UINT8 * src, Q_INT32 nPixels) +void KisAbstractColorSpace::invertColor(TQ_UINT8 * src, TQ_INT32 nPixels) { - QColor c; - Q_UINT8 opacity; - Q_UINT32 psize = pixelSize(); + TQColor c; + TQ_UINT8 opacity; + TQ_UINT32 psize = pixelSize(); while (nPixels--) { - toQColor(src, &c, &opacity); - c.setRgb(Q_UINT8_MAX - c.red(), Q_UINT8_MAX - c.green(), Q_UINT8_MAX - c.blue()); - fromQColor( c, opacity, src); + toTQColor(src, &c, &opacity); + c.setRgb(TQ_UINT8_MAX - c.red(), TQ_UINT8_MAX - c.green(), TQ_UINT8_MAX - c.blue()); + fromTQColor( c, opacity, src); src += psize; } } -Q_UINT8 KisAbstractColorSpace::difference(const Q_UINT8* src1, const Q_UINT8* src2) +TQ_UINT8 KisAbstractColorSpace::difference(const TQ_UINT8* src1, const TQ_UINT8* src2) { if (m_defaultToLab) { - Q_UINT8 lab1[8], lab2[8]; + TQ_UINT8 lab1[8], lab2[8]; cmsCIELab labF1, labF2; if (getAlpha(src1) == OPACITY_TRANSPARENT || getAlpha(src2) == OPACITY_TRANSPARENT) return (getAlpha(src1) == getAlpha(src2) ? 0 : 255); - cmsDoTransform( m_defaultToLab, const_cast<Q_UINT8*>( src1 ), lab1, 1); - cmsDoTransform( m_defaultToLab, const_cast<Q_UINT8*>( src2 ), lab2, 1); + cmsDoTransform( m_defaultToLab, const_cast<TQ_UINT8*>( src1 ), lab1, 1); + cmsDoTransform( m_defaultToLab, const_cast<TQ_UINT8*>( src2 ), lab2, 1); cmsLabEncoded2Float(&labF1, (WORD *)lab1); cmsLabEncoded2Float(&labF2, (WORD *)lab2); double diff = cmsDeltaE(&labF1, &labF2); if(diff>255) return 255; else - return Q_INT8(diff); + return TQ_INT8(diff); } else { - QColor c1; - Q_UINT8 opacity1; - toQColor(src1, &c1, &opacity1); - - QColor c2; - Q_UINT8 opacity2; - toQColor(src2, &c2, &opacity2); - - Q_UINT8 red = abs(c1.red() - c2.red()); - Q_UINT8 green = abs(c1.green() - c2.green()); - Q_UINT8 blue = abs(c1.blue() - c2.blue()); - return QMAX(red, QMAX(green, blue)); + TQColor c1; + TQ_UINT8 opacity1; + toTQColor(src1, &c1, &opacity1); + + TQColor c2; + TQ_UINT8 opacity2; + toTQColor(src2, &c2, &opacity2); + + TQ_UINT8 red = abs(c1.red() - c2.red()); + TQ_UINT8 green = abs(c1.green() - c2.green()); + TQ_UINT8 blue = abs(c1.blue() - c2.blue()); + return TQMAX(red, TQMAX(green, blue)); } } -void KisAbstractColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const +void KisAbstractColorSpace::mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const { - Q_UINT32 totalRed = 0, totalGreen = 0, totalBlue = 0, newAlpha = 0; + TQ_UINT32 totalRed = 0, totalGreen = 0, totalBlue = 0, newAlpha = 0; - QColor c; - Q_UINT8 opacity; + TQColor c; + TQ_UINT8 opacity; while (nColors--) { // Ugly hack to get around the current constness mess of the colour strategy... - const_cast<KisAbstractColorSpace *>(this)->toQColor(*colors, &c, &opacity); + const_cast<KisAbstractColorSpace *>(this)->toTQColor(*colors, &c, &opacity); - Q_UINT32 alphaTimesWeight = UINT8_MULT(opacity, *weights); + TQ_UINT32 alphaTimesWeight = UINT8_MULT(opacity, *weights); totalRed += c.red() * alphaTimesWeight; totalGreen += c.green() * alphaTimesWeight; @@ -513,38 +513,38 @@ void KisAbstractColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *wei // Divide by 255. totalRed += 0x80; - Q_UINT32 dstRed = ((totalRed >> 8) + totalRed) >> 8; + TQ_UINT32 dstRed = ((totalRed >> 8) + totalRed) >> 8; Q_ASSERT(dstRed <= 255); totalGreen += 0x80; - Q_UINT32 dstGreen = ((totalGreen >> 8) + totalGreen) >> 8; + TQ_UINT32 dstGreen = ((totalGreen >> 8) + totalGreen) >> 8; Q_ASSERT(dstGreen <= 255); totalBlue += 0x80; - Q_UINT32 dstBlue = ((totalBlue >> 8) + totalBlue) >> 8; + TQ_UINT32 dstBlue = ((totalBlue >> 8) + totalBlue) >> 8; Q_ASSERT(dstBlue <= 255); - const_cast<KisAbstractColorSpace *>(this)->fromQColor(QColor(dstRed, dstGreen, dstBlue), newAlpha, dst); + const_cast<KisAbstractColorSpace *>(this)->fromTQColor(TQColor(dstRed, dstGreen, dstBlue), newAlpha, dst); } -void KisAbstractColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, - Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const +void KisAbstractColorSpace::convolveColors(TQ_UINT8** colors, TQ_INT32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, + TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nColors) const { - Q_INT32 totalRed = 0, totalGreen = 0, totalBlue = 0, totalAlpha = 0; + TQ_INT32 totalRed = 0, totalGreen = 0, totalBlue = 0, totalAlpha = 0; - QColor dstColor; - Q_UINT8 dstOpacity; + TQColor dstColor; + TQ_UINT8 dstOpacity; - const_cast<KisAbstractColorSpace *>(this)->toQColor(dst, &dstColor, &dstOpacity); + const_cast<KisAbstractColorSpace *>(this)->toTQColor(dst, &dstColor, &dstOpacity); while (nColors--) { - Q_INT32 weight = *kernelValues; + TQ_INT32 weight = *kernelValues; if (weight != 0) { - QColor c; - Q_UINT8 opacity; - const_cast<KisAbstractColorSpace *>(this)->toQColor( *colors, &c, &opacity ); + TQColor c; + TQ_UINT8 opacity; + const_cast<KisAbstractColorSpace *>(this)->toTQColor( *colors, &c, &opacity ); totalRed += c.red() * weight; totalGreen += c.green() * weight; totalBlue += c.blue() * weight; @@ -556,73 +556,73 @@ void KisAbstractColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelVal if (channelFlags & KisChannelInfo::FLAG_COLOR) { - const_cast<KisAbstractColorSpace *>(this)->fromQColor(QColor(CLAMP((totalRed / factor) + offset, 0, Q_UINT8_MAX), - CLAMP((totalGreen / factor) + offset, 0, Q_UINT8_MAX), - CLAMP((totalBlue / factor) + offset, 0, Q_UINT8_MAX)), + const_cast<KisAbstractColorSpace *>(this)->fromTQColor(TQColor(CLAMP((totalRed / factor) + offset, 0, TQ_UINT8_MAX), + CLAMP((totalGreen / factor) + offset, 0, TQ_UINT8_MAX), + CLAMP((totalBlue / factor) + offset, 0, TQ_UINT8_MAX)), dstOpacity, dst); } if (channelFlags & KisChannelInfo::FLAG_ALPHA) { - const_cast<KisAbstractColorSpace *>(this)->fromQColor(dstColor, CLAMP((totalAlpha/ factor) + offset, 0, Q_UINT8_MAX), dst); + const_cast<KisAbstractColorSpace *>(this)->fromTQColor(dstColor, CLAMP((totalAlpha/ factor) + offset, 0, TQ_UINT8_MAX), dst); } } -void KisAbstractColorSpace::darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const +void KisAbstractColorSpace::darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const { if (m_defaultToLab) { - Q_UINT16 * labcache = new Q_UINT16[nPixels * 4]; - cmsDoTransform( m_defaultToLab, const_cast<Q_UINT8*>( src ), reinterpret_cast<Q_UINT8*>( labcache ), nPixels ); + TQ_UINT16 * labcache = new TQ_UINT16[nPixels * 4]; + cmsDoTransform( m_defaultToLab, const_cast<TQ_UINT8*>( src ), reinterpret_cast<TQ_UINT8*>( labcache ), nPixels ); for ( int i = 0; i < nPixels * 4; ++i ) { if ( compensate ) { - labcache[i] = static_cast<Q_UINT16>( ( labcache[i] * shade ) / ( compensation * 255 ) ); + labcache[i] = static_cast<TQ_UINT16>( ( labcache[i] * shade ) / ( compensation * 255 ) ); } else { - labcache[i] = static_cast<Q_UINT16>( labcache[i] * shade / 255 ); + labcache[i] = static_cast<TQ_UINT16>( labcache[i] * shade / 255 ); } } - cmsDoTransform( m_defaultFromLab, reinterpret_cast<Q_UINT8*>( labcache ), dst, nPixels ); + cmsDoTransform( m_defaultFromLab, reinterpret_cast<TQ_UINT8*>( labcache ), dst, nPixels ); // Copy alpha for ( int i = 0; i < nPixels; ++i ) { - Q_UINT8 alpha = getAlpha( src ); + TQ_UINT8 alpha = getAlpha( src ); setAlpha( dst, alpha, 1 ); } delete [] labcache; } else { - QColor c; - Q_INT32 psize = pixelSize(); + TQColor c; + TQ_INT32 psize = pixelSize(); for (int i = 0; i < nPixels; ++i) { - const_cast<KisAbstractColorSpace *>(this)->toQColor(src + (i * psize), &c); - Q_INT32 r, g, b; + const_cast<KisAbstractColorSpace *>(this)->toTQColor(src + (i * psize), &c); + TQ_INT32 r, g, b; if (compensate) { - r = static_cast<Q_INT32>( QMIN(255, (c.red() * shade) / (compensation * 255))); - g = static_cast<Q_INT32>( QMIN(255, (c.green() * shade) / (compensation * 255))); - b = static_cast<Q_INT32>( QMIN(255, (c.blue() * shade) / (compensation * 255))); + r = static_cast<TQ_INT32>( TQMIN(255, (c.red() * shade) / (compensation * 255))); + g = static_cast<TQ_INT32>( TQMIN(255, (c.green() * shade) / (compensation * 255))); + b = static_cast<TQ_INT32>( TQMIN(255, (c.blue() * shade) / (compensation * 255))); } else { - r = static_cast<Q_INT32>( QMIN(255, (c.red() * shade / 255))); - g = static_cast<Q_INT32>( QMIN(255, (c.green() * shade / 255))); - b = static_cast<Q_INT32>( QMIN(255, (c.blue() * shade / 255))); + r = static_cast<TQ_INT32>( TQMIN(255, (c.red() * shade / 255))); + g = static_cast<TQ_INT32>( TQMIN(255, (c.green() * shade / 255))); + b = static_cast<TQ_INT32>( TQMIN(255, (c.blue() * shade / 255))); } c.setRgb(r, g, b); - const_cast<KisAbstractColorSpace *>(this)->fromQColor( c, dst + (i * psize)); + const_cast<KisAbstractColorSpace *>(this)->fromTQColor( c, dst + (i * psize)); } } } -Q_UINT8 KisAbstractColorSpace::intensity8(const Q_UINT8 * src) const +TQ_UINT8 KisAbstractColorSpace::intensity8(const TQ_UINT8 * src) const { - QColor c; - Q_UINT8 opacity; - const_cast<KisAbstractColorSpace *>(this)->toQColor(src, &c, &opacity); - return static_cast<Q_UINT8>((c.red() * 0.30 + c.green() * 0.59 + c.blue() * 0.11) + 0.5); + TQColor c; + TQ_UINT8 opacity; + const_cast<KisAbstractColorSpace *>(this)->toTQColor(src, &c, &opacity); + return static_cast<TQ_UINT8>((c.red() * 0.30 + c.green() * 0.59 + c.blue() * 0.11) + 0.5); } @@ -632,32 +632,32 @@ KisID KisAbstractColorSpace::mathToolboxID() const return KisID("Basic"); } -void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, +void KisAbstractColorSpace::bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, KisColorSpace * srcSpace, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) { if (rows <= 0 || cols <= 0) return; if (this != srcSpace) { - Q_UINT32 len = pixelSize() * rows * cols; + TQ_UINT32 len = pixelSize() * rows * cols; // If our conversion cache is too small, extend it. - if (!m_conversionCache.resize( len, QGArray::SpeedOptim )) { + if (!m_conversionCache.resize( len, TQGArray::SpeedOptim )) { kdWarning() << "Could not allocate enough memory for the conversion!\n"; // XXX: We should do a slow, pixel by pixel bitblt here... abort(); } - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { srcSpace->convertPixelsTo(src + row * srcRowStride, m_conversionCache.data() + row * cols * pixelSize(), this, cols); @@ -671,7 +671,7 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, m_conversionCache.data(), srcRowStride, srcAlphaMask, - maskRowStride, + tqmaskRowStride, opacity, rows, cols, @@ -684,7 +684,7 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, src, srcRowStride, srcAlphaMask, - maskRowStride, + tqmaskRowStride, opacity, rows, cols, @@ -692,12 +692,12 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, } } -QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, +TQImage KisAbstractColorSpace::convertToTQImage(const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, KisProfile *dstProfile, - Q_INT32 renderingIntent, float /*exposure*/) + TQ_INT32 renderingIntent, float /*exposure*/) { - QImage img = QImage(width, height, 32, 0, QImage::LittleEndian); + TQImage img = TQImage(width, height, 32, 0, TQImage::LittleEndian); img.setAlphaBuffer( true ); KisColorSpace * dstCS; @@ -708,7 +708,7 @@ QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width dstCS = m_parent->getRGB8(); if (data) - convertPixelsTo(const_cast<Q_UINT8 *>(data), img.bits(), dstCS, width * height, renderingIntent); + convertPixelsTo(const_cast<TQ_UINT8 *>(data), img.bits(), dstCS, width * height, renderingIntent); return img; } @@ -717,7 +717,7 @@ QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width cmsHTRANSFORM KisAbstractColorSpace::createTransform(KisColorSpace * dstColorSpace, KisProfile * srcProfile, KisProfile * dstProfile, - Q_INT32 renderingIntent) + TQ_INT32 renderingIntent) { KConfig * cfg = KGlobal::config(); bool bpCompensation = cfg->readBoolEntry("useBlackPointCompensation", false); @@ -741,11 +741,11 @@ cmsHTRANSFORM KisAbstractColorSpace::createTransform(KisColorSpace * dstColorSpa return 0; } -void KisAbstractColorSpace::compositeCopy(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 * /*maskRowStart*/, Q_INT32 /*maskRowStride*/, Q_INT32 rows, Q_INT32 numColumns, Q_UINT8 opacity) +void KisAbstractColorSpace::compositeCopy(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 * /*tqmaskRowStart*/, TQ_INT32 /*tqmaskRowStride*/, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 opacity) { - Q_UINT8 *dst = dstRowStart; - const Q_UINT8 *src = srcRowStart; - Q_INT32 bytesPerPixel = pixelSize(); + TQ_UINT8 *dst = dstRowStart; + const TQ_UINT8 *src = srcRowStart; + TQ_INT32 bytesPerPixel = pixelSize(); while (rows > 0) { memcpy(dst, src, numColumns * bytesPerPixel); diff --git a/krita/kritacolor/kis_abstract_colorspace.h b/krita/kritacolor/kis_abstract_colorspace.h index b201986a..72d581a1 100644 --- a/krita/kritacolor/kis_abstract_colorspace.h +++ b/krita/kritacolor/kis_abstract_colorspace.h @@ -21,10 +21,10 @@ #include <strings.h> -#include <qmap.h> -#include <qcolor.h> -#include <qstringlist.h> -#include <qpair.h> +#include <tqmap.h> +#include <tqcolor.h> +#include <tqstringlist.h> +#include <tqpair.h> #include "kis_global.h" #include "kis_channelinfo.h" @@ -35,7 +35,7 @@ #include "koffice_export.h" -class QPainter; +class TQPainter; class KisPixelRO; class KisColorSpaceFactoryRegistry; @@ -53,13 +53,13 @@ public: * @param id The unique human and machine readable identifiation of this colorspace * @param cmType the lcms type indentification for this colorspace, may be 0 * @param colorSpaceSignature the icc identification for this colorspace, may be 0 - * @param parent the registry that owns this instance + * @param tqparent the registry that owns this instance * @param profile the profile this colorspace uses for transforms */ KisAbstractColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, - KisColorSpaceFactoryRegistry * parent, + KisColorSpaceFactoryRegistry * tqparent, KisProfile *profile); void init(); @@ -79,32 +79,32 @@ public: //========== Channels =====================================================// // Return a vector describing all the channels this color model has. - virtual QValueVector<KisChannelInfo *> channels() const = 0; + virtual TQValueVector<KisChannelInfo *> channels() const = 0; - virtual Q_UINT32 nChannels() const = 0; + virtual TQ_UINT32 nChannels() const = 0; - virtual Q_UINT32 nColorChannels() const = 0; + virtual TQ_UINT32 nColorChannels() const = 0; - virtual Q_UINT32 nSubstanceChannels() const { return 0; }; + virtual TQ_UINT32 nSubstanceChannels() const { return 0; }; - virtual Q_UINT32 pixelSize() const = 0; + virtual TQ_UINT32 pixelSize() const = 0; - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const = 0; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const = 0; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const = 0; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const = 0; - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos) = 0; + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos) = 0; - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos) = 0; + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos) = 0; - virtual void getSingleChannelPixel(Q_UINT8 *dstPixel, const Q_UINT8 *srcPixel, Q_UINT32 channelIndex); + virtual void getSingleChannelPixel(TQ_UINT8 *dstPixel, const TQ_UINT8 *srcPixel, TQ_UINT32 channelIndex); //========== Identification ===============================================// virtual KisID id() const { return m_id; } - void setColorSpaceType(Q_UINT32 type) { m_cmType = type; } - Q_UINT32 colorSpaceType() { return m_cmType; } + void setColorSpaceType(TQ_UINT32 type) { m_cmType = type; } + TQ_UINT32 colorSpaceType() { return m_cmType; } virtual icColorSpaceSignature colorSpaceSignature() { return m_colorSpaceSignature; } @@ -126,65 +126,65 @@ public: //================= Conversion functions ==================================// - virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0); - virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0); + virtual void fromTQColor(const TQColor& c, TQ_UINT8 *dst, KisProfile * profile = 0); + virtual void fromTQColor(const TQColor& c, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile * profile = 0); - virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile = 0); - virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0); + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, KisProfile * profile = 0); + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile * profile = 0); - virtual void toLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const; - virtual void fromLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const; + virtual void toLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const; + virtual void fromLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const; - virtual QImage convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, + virtual TQImage convertToTQImage(const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, KisProfile * dstProfile, - Q_INT32 renderingIntent = INTENT_PERCEPTUAL, + TQ_INT32 renderingIntent = INTENT_PERCEPTUAL, float exposure = 0.0f); - virtual bool convertPixelsTo(const Q_UINT8 * src, - Q_UINT8 * dst, KisColorSpace * dstColorSpace, - Q_UINT32 numPixels, - Q_INT32 renderingIntent = INTENT_PERCEPTUAL); + virtual bool convertPixelsTo(const TQ_UINT8 * src, + TQ_UINT8 * dst, KisColorSpace * dstColorSpace, + TQ_UINT32 numPixels, + TQ_INT32 renderingIntent = INTENT_PERCEPTUAL); //============================== Manipulation fucntions ==========================// // // The manipulation functions have default implementations that _convert_ the pixel -// to a QColor and back. Reimplement these methods in your color strategy! +// to a TQColor and back. Reimplement these methods in your color strategy! // - virtual KisColorAdjustment *createBrightnessContrastAdjustment(Q_UINT16 *transferValues); + virtual KisColorAdjustment *createBrightnessContrastAdjustment(TQ_UINT16 *transferValues); virtual KisColorAdjustment *createDesaturateAdjustment(); - virtual KisColorAdjustment *createPerChannelAdjustment(Q_UINT16 **transferValues); + virtual KisColorAdjustment *createPerChannelAdjustment(TQ_UINT16 **transferValues); - virtual void applyAdjustment(const Q_UINT8 *src, Q_UINT8 *dst, KisColorAdjustment *, Q_INT32 nPixels); + virtual void applyAdjustment(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *, TQ_INT32 nPixels); - virtual void invertColor(Q_UINT8 * src, Q_INT32 nPixels); + virtual void invertColor(TQ_UINT8 * src, TQ_INT32 nPixels); - virtual Q_UINT8 difference(const Q_UINT8* src1, const Q_UINT8* src2); + virtual TQ_UINT8 difference(const TQ_UINT8* src1, const TQ_UINT8* src2); - virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const; + virtual void mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const; - virtual void convolveColors(Q_UINT8** colors, Q_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nPixels) const; + virtual void convolveColors(TQ_UINT8** colors, TQ_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nPixels) const; - virtual void darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const; + virtual void darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const; - virtual Q_UINT8 intensity8(const Q_UINT8 * src) const; + virtual TQ_UINT8 intensity8(const TQ_UINT8 * src) const; virtual KisID mathToolboxID() const; - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, KisColorSpace * srcSpace, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op); //========================== END of Public API ========================================// @@ -196,53 +196,53 @@ protected: * Compose two byte arrays containing pixels in the same color * model together. */ - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dstRowSize, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dstRowSize, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) = 0; virtual cmsHTRANSFORM createTransform(KisColorSpace * dstColorSpace, KisProfile * srcProfile, KisProfile * dstProfile, - Q_INT32 renderingIntent); + TQ_INT32 renderingIntent); - virtual void compositeCopy(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 numColumns, Q_UINT8 opacity); + virtual void compositeCopy(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 opacity); // So I don't need to re-implement it everywhere. template <typename ColorType, typename NativeMult, typename Uint8ToNative, typename NativeOpacityTest, int AlphaPos, int NonAlphaSize, int TotalSize> - void abstractCompositeAlphaDarken(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, - const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, - const Q_UINT8 *maskRowStart, Q_INT32 maskRowStride, - Q_INT32 rows, Q_INT32 numColumns, Q_UINT8 opacity, + void abstractCompositeAlphaDarken(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, + const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, + const TQ_UINT8 *tqmaskRowStart, TQ_INT32 tqmaskRowStride, + TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 opacity, NativeMult nativeMult, Uint8ToNative uint8ToNative, NativeOpacityTest nativeOpacityTest) { while (rows > 0) { const ColorType *src = reinterpret_cast<const ColorType*>(srcRowStart); ColorType *dst = reinterpret_cast<ColorType*>(dstRowStart); - const Q_UINT8 *mask = maskRowStart; - Q_INT32 columns = numColumns; + const TQ_UINT8 *tqmask = tqmaskRowStart; + TQ_INT32 columns = numColumns; while (columns > 0) { ColorType srcAlpha = src[AlphaPos]; ColorType dstAlpha = dst[AlphaPos]; - // apply the alphamask - if(mask != 0) + // apply the alphatqmask + if(tqmask != 0) { - if(*mask != OPACITY_OPAQUE) - srcAlpha = nativeMult(srcAlpha, uint8ToNative(*mask)); - mask++; + if(*tqmask != OPACITY_OPAQUE) + srcAlpha = nativeMult(srcAlpha, uint8ToNative(*tqmask)); + tqmask++; } if (opacity != OPACITY_OPAQUE) { @@ -263,19 +263,19 @@ protected: rows--; srcRowStart += srcRowStride; dstRowStart += dstRowStride; - if(maskRowStart) - maskRowStart += maskRowStride; + if(tqmaskRowStart) + tqmaskRowStart += tqmaskRowStride; } } protected: - QStringList m_profileFilenames; - Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor. - Q_INT32 m_alphaPos; // The position in _bytes_ of the alpha channel - Q_INT32 m_alphaSize; // The width in _bytes_ of the alpha channel + TQStringList m_profileFilenames; + TQ_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor. + TQ_INT32 m_alphaPos; // The position in _bytes_ of the alpha channel + TQ_INT32 m_alphaSize; // The width in _bytes_ of the alpha channel - QValueVector<KisChannelInfo *> m_channels; + TQValueVector<KisChannelInfo *> m_channels; KisColorSpaceFactoryRegistry * m_parent; @@ -300,13 +300,13 @@ private: icColorSpaceSignature m_colorSpaceSignature; // The colorspace signature as defined in icm/icc files // cmsHTRANSFORM is a void *, so this should work. - typedef QMap<KisColorSpace *, cmsHTRANSFORM> TransformMap; + typedef TQMap<KisColorSpace *, cmsHTRANSFORM> TransformMap; TransformMap m_transforms; // Cache for existing transforms KisAbstractColorSpace(const KisAbstractColorSpace&); KisAbstractColorSpace& operator=(const KisAbstractColorSpace&); - QMemArray<Q_UINT8> m_conversionCache; // XXX: This will be a bad problem when we have threading. + TQMemArray<TQ_UINT8> m_conversionCache; // XXX: This will be a bad problem when we have threading. }; #endif // KIS_STRATEGY_COLORSPACE_H_ diff --git a/krita/kritacolor/kis_basic_histogram_producers.cc b/krita/kritacolor/kis_basic_histogram_producers.cc index 2b9994d3..b769a3d3 100644 --- a/krita/kritacolor/kis_basic_histogram_producers.cc +++ b/krita/kritacolor/kis_basic_histogram_producers.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include <klocale.h> #include "config.h" @@ -66,7 +66,7 @@ void KisBasicHistogramProducer::makeExternalToInternal() { // This function assumes that the pixel is has no 'gaps'. That is to say: if we start // at byte 0, we can get to the end of the pixel by adding consecutive size()s of // the channels - QValueVector<KisChannelInfo *> c = channels(); + TQValueVector<KisChannelInfo *> c = channels(); uint count = c.count(); int currentPos = 0; @@ -88,17 +88,17 @@ KisBasicU8HistogramProducer::KisBasicU8HistogramProducer(const KisID& id, KisCol { } -QString KisBasicU8HistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<Q_UINT8>(pos * UINT8_MAX)); +TQString KisBasicU8HistogramProducer::positionToString(double pos) const { + return TQString("%1").tqarg(static_cast<TQ_UINT8>(pos * UINT8_MAX)); } -void KisBasicU8HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) +void KisBasicU8HistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { if (!pixels) return; if (!cs) return; if (nPixels == 0) return; - Q_INT32 pSize = cs->pixelSize(); + TQ_INT32 pSize = cs->pixelSize(); if ( selectionMask ) { while (nPixels > 0) { @@ -140,9 +140,9 @@ KisBasicU16HistogramProducer::KisBasicU16HistogramProducer(const KisID& id, KisC { } -QString KisBasicU16HistogramProducer::positionToString(double pos) const +TQString KisBasicU16HistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<Q_UINT8>(pos * UINT8_MAX)); + return TQString("%1").tqarg(static_cast<TQ_UINT8>(pos * UINT8_MAX)); } double KisBasicU16HistogramProducer::maximalZoom() const @@ -150,28 +150,28 @@ double KisBasicU16HistogramProducer::maximalZoom() const return 1.0 / 255.0; } -void KisBasicU16HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) +void KisBasicU16HistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { // The view - Q_UINT16 from = static_cast<Q_UINT16>(m_from * UINT16_MAX); - Q_UINT16 width = static_cast<Q_UINT16>(m_width * UINT16_MAX + 0.5); // We include the end - Q_UINT16 to = from + width; + TQ_UINT16 from = static_cast<TQ_UINT16>(m_from * UINT16_MAX); + TQ_UINT16 width = static_cast<TQ_UINT16>(m_width * UINT16_MAX + 0.5); // We include the end + TQ_UINT16 to = from + width; double factor = 255.0 / width; - Q_INT32 pSize = cs->pixelSize(); + TQ_INT32 pSize = cs->pixelSize(); if ( selectionMask ) { - Q_UINT16* pixel = reinterpret_cast<Q_UINT16*>(pixels); + TQ_UINT16* pixel = reinterpret_cast<TQ_UINT16*>(pixels); while (nPixels > 0) { if ( ! ((m_skipUnselected && *selectionMask == 0) || (m_skipTransparent && cs->getAlpha(pixels) == OPACITY_TRANSPARENT)) ) { for (int i = 0; i < m_channels; i++) { - Q_UINT16 value = pixel[i]; + TQ_UINT16 value = pixel[i]; if (value > to) m_outRight.at(i)++; else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -182,17 +182,17 @@ void KisBasicU16HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * se } else { while (nPixels > 0) { - Q_UINT16* pixel = reinterpret_cast<Q_UINT16*>(pixels); + TQ_UINT16* pixel = reinterpret_cast<TQ_UINT16*>(pixels); if ( ! (m_skipTransparent && cs->getAlpha(pixels) == OPACITY_TRANSPARENT)) { for (int i = 0; i < m_channels; i++) { - Q_UINT16 value = pixel[i]; + TQ_UINT16 value = pixel[i]; if (value > to) m_outRight.at(i)++; else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -209,8 +209,8 @@ KisBasicF32HistogramProducer::KisBasicF32HistogramProducer(const KisID& id, KisC { } -QString KisBasicF32HistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<float>(pos)); // XXX I doubt this is correct! +TQString KisBasicF32HistogramProducer::positionToString(double pos) const { + return TQString("%1").tqarg(static_cast<float>(pos)); // XXX I doubt this is correct! } double KisBasicF32HistogramProducer::maximalZoom() const { @@ -218,14 +218,14 @@ double KisBasicF32HistogramProducer::maximalZoom() const { return 1.0 / 255.0; } -void KisBasicF32HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) { +void KisBasicF32HistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { // The view float from = static_cast<float>(m_from); float width = static_cast<float>(m_width); float to = from + width; float factor = 255.0 / width; - Q_INT32 pSize = cs->pixelSize(); + TQ_INT32 pSize = cs->pixelSize(); if ( selectionMask ) { while (nPixels > 0) { @@ -239,7 +239,7 @@ void KisBasicF32HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * se else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -262,7 +262,7 @@ void KisBasicF32HistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * se else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -281,8 +281,8 @@ KisBasicF16HalfHistogramProducer::KisBasicF16HalfHistogramProducer(const KisID& : KisBasicHistogramProducer(id, cs->nChannels(), 256, cs) { } -QString KisBasicF16HalfHistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<float>(pos)); // XXX I doubt this is correct! +TQString KisBasicF16HalfHistogramProducer::positionToString(double pos) const { + return TQString("%1").tqarg(static_cast<float>(pos)); // XXX I doubt this is correct! } double KisBasicF16HalfHistogramProducer::maximalZoom() const { @@ -290,14 +290,14 @@ double KisBasicF16HalfHistogramProducer::maximalZoom() const { return 1.0 / 255.0; } -void KisBasicF16HalfHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) { +void KisBasicF16HalfHistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { // The view float from = static_cast<float>(m_from); float width = static_cast<float>(m_width); float to = from + width; float factor = 255.0 / width; - Q_INT32 pSize = cs->pixelSize(); + TQ_INT32 pSize = cs->pixelSize(); if ( selectionMask ) { while (nPixels > 0) { half* pixel = reinterpret_cast<half*>(pixels); @@ -309,7 +309,7 @@ void KisBasicF16HalfHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -329,7 +329,7 @@ void KisBasicF16HalfHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 else if (value < from) m_outLeft.at(i)++; else - m_bins.at(i).at(static_cast<Q_UINT8>((value - from) * factor))++; + m_bins.at(i).at(static_cast<TQ_UINT8>((value - from) * factor))++; } m_count++; } @@ -346,17 +346,17 @@ KisGenericRGBHistogramProducer::KisGenericRGBHistogramProducer() 3, 256, 0) { /* we set 0 as colorspece, because we are not based on a specific colorspace. This is no problem for the superclass since we override channels() */ - m_channelsList.append(new KisChannelInfo(i18n("R"), i18n("R"), 0, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, QColor(255,0,0))); - m_channelsList.append(new KisChannelInfo(i18n("G"), i18n("G"), 1, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, QColor(0,255,0))); - m_channelsList.append(new KisChannelInfo(i18n("B"), i18n("B"), 2, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, QColor(0,0,255))); + m_channelsList.append(new KisChannelInfo(i18n("R"), i18n("R"), 0, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, TQColor(255,0,0))); + m_channelsList.append(new KisChannelInfo(i18n("G"), i18n("G"), 1, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, TQColor(0,255,0))); + m_channelsList.append(new KisChannelInfo(i18n("B"), i18n("B"), 2, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, TQColor(0,0,255))); } -QValueVector<KisChannelInfo *> KisGenericRGBHistogramProducer::channels() { +TQValueVector<KisChannelInfo *> KisGenericRGBHistogramProducer::channels() { return m_channelsList; } -QString KisGenericRGBHistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<Q_UINT8>(pos * UINT8_MAX)); +TQString KisGenericRGBHistogramProducer::positionToString(double pos) const { + return TQString("%1").tqarg(static_cast<TQ_UINT8>(pos * UINT8_MAX)); } double KisGenericRGBHistogramProducer::maximalZoom() const { @@ -364,19 +364,19 @@ double KisGenericRGBHistogramProducer::maximalZoom() const { } -void KisGenericRGBHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) +void KisGenericRGBHistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { for (int i = 0; i < m_channels; i++) { m_outRight.at(i) = 0; m_outLeft.at(i) = 0; } - QColor c; - Q_INT32 pSize = cs->pixelSize(); + TQColor c; + TQ_INT32 pSize = cs->pixelSize(); if (selectionMask) { while (nPixels > 0) { if ( !((m_skipUnselected && *selectionMask == 0) || (m_skipTransparent && cs->getAlpha(pixels) == OPACITY_TRANSPARENT)) ) { - cs->toQColor(pixels, &c); + cs->toTQColor(pixels, &c); m_bins.at(0).at(c.red())++; m_bins.at(1).at(c.green())++; m_bins.at(2).at(c.blue())++; @@ -393,7 +393,7 @@ void KisGenericRGBHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * while (nPixels > 0) { if ( !(m_skipTransparent && cs->getAlpha(pixels) == OPACITY_TRANSPARENT)) { - cs->toQColor(pixels, &c); + cs->toTQColor(pixels, &c); m_bins.at(0).at(c.red())++; m_bins.at(1).at(c.green())++; m_bins.at(2).at(c.blue())++; @@ -428,12 +428,12 @@ KisGenericLabHistogramProducer::~KisGenericLabHistogramProducer() delete m_channelsList[2]; } -QValueVector<KisChannelInfo *> KisGenericLabHistogramProducer::channels() { +TQValueVector<KisChannelInfo *> KisGenericLabHistogramProducer::channels() { return m_channelsList; } -QString KisGenericLabHistogramProducer::positionToString(double pos) const { - return QString("%1").arg(static_cast<Q_UINT16>(pos * UINT16_MAX)); +TQString KisGenericLabHistogramProducer::positionToString(double pos) const { + return TQString("%1").tqarg(static_cast<TQ_UINT16>(pos * UINT16_MAX)); } double KisGenericLabHistogramProducer::maximalZoom() const { @@ -441,21 +441,21 @@ double KisGenericLabHistogramProducer::maximalZoom() const { } -void KisGenericLabHistogramProducer::addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *cs) +void KisGenericLabHistogramProducer::addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *cs) { for (int i = 0; i < m_channels; i++) { m_outRight.at(i) = 0; m_outLeft.at(i) = 0; } - Q_UINT8 dst[8]; - Q_INT32 pSize = cs->pixelSize(); + TQ_UINT8 dst[8]; + TQ_INT32 pSize = cs->pixelSize(); if (selectionMask) { while (nPixels > 0) { if ( !((m_skipUnselected && *selectionMask == 0) || (m_skipTransparent && cs->getAlpha(pixels) == OPACITY_TRANSPARENT)) ) { /* - cs->toQColor(pixels, &c); + cs->toTQColor(pixels, &c); m_bins.at(0).at(c.red())++; */ m_count++; diff --git a/krita/kritacolor/kis_basic_histogram_producers.h b/krita/kritacolor/kis_basic_histogram_producers.h index 498c7be4..8b913ece 100644 --- a/krita/kritacolor/kis_basic_histogram_producers.h +++ b/krita/kritacolor/kis_basic_histogram_producers.h @@ -19,7 +19,7 @@ #ifndef _KIS_BASIC_HISTOGRAM_PRODUCERS_ #define _KIS_BASIC_HISTOGRAM_PRODUCERS_ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <klocale.h> #include "config.h" @@ -40,27 +40,27 @@ public: virtual void setView(double from, double size) { m_from = from; m_width = size; } virtual const KisID& id() const { return m_id; } - virtual QValueVector<KisChannelInfo *> channels() { return m_colorSpace->channels(); } - virtual Q_INT32 numberOfBins() { return m_nrOfBins; } + virtual TQValueVector<KisChannelInfo *> channels() { return m_colorSpace->channels(); } + virtual TQ_INT32 numberOfBins() { return m_nrOfBins; } virtual double viewFrom() const { return m_from; } virtual double viewWidth() const { return m_width; } - virtual Q_INT32 count() { return m_count; } + virtual TQ_INT32 count() { return m_count; } - virtual Q_INT32 getBinAt(int channel, int position) + virtual TQ_INT32 getBinAt(int channel, int position) { return m_bins.at(externalToInternal(channel)).at(position); } - virtual Q_INT32 outOfViewLeft(int channel) + virtual TQ_INT32 outOfViewLeft(int channel) { return m_outLeft.at(externalToInternal(channel)); } - virtual Q_INT32 outOfViewRight(int channel) + virtual TQ_INT32 outOfViewRight(int channel) { return m_outRight.at(externalToInternal(channel)); } protected: /** * The order in which channels() returns is not the same as the internal representation, * that of the pixel internally. This method converts external usage to internal usage. - * This method uses some basic assumtpions about the layout of the pixel, so _extremely_ + * This method uses some basic assumtpions about the tqlayout of the pixel, so _extremely_ * exotic spaces might want to override this (see makeExternalToInternal source for * those assumptions) **/ @@ -71,38 +71,38 @@ protected: } // not virtual since that is useless: we call it from constructor void makeExternalToInternal(); - typedef QValueVector<Q_UINT32> vBins; - QValueVector<vBins> m_bins; + typedef TQValueVector<TQ_UINT32> vBins; + TQValueVector<vBins> m_bins; vBins m_outLeft, m_outRight; double m_from, m_width; - Q_INT32 m_count; + TQ_INT32 m_count; int m_channels, m_nrOfBins; KisColorSpace *m_colorSpace; KisID m_id; - QValueVector<Q_INT32> m_external; + TQValueVector<TQ_INT32> m_external; }; class KisBasicU8HistogramProducer : public KisBasicHistogramProducer { public: KisBasicU8HistogramProducer(const KisID& id, KisColorSpace *colorSpace); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const { return 1.0; } }; class KisBasicU16HistogramProducer : public KisBasicHistogramProducer { public: KisBasicU16HistogramProducer(const KisID& id, KisColorSpace *colorSpace); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const; }; class KisBasicF32HistogramProducer : public KisBasicHistogramProducer { public: KisBasicF32HistogramProducer(const KisID& id, KisColorSpace *colorSpace); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const; }; @@ -110,8 +110,8 @@ public: class KisBasicF16HalfHistogramProducer : public KisBasicHistogramProducer { public: KisBasicF16HalfHistogramProducer(const KisID& id, KisColorSpace *colorSpace); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const; }; #endif @@ -136,19 +136,19 @@ protected: /** * This is a Producer (with associated factory) that converts the pixels of the colorspace - * to RGB8 with toQColor, and then does its counting on RGB. This is NOT registered with the + * to RGB8 with toTQColor, and then does its counting on RGB. This is NOT registered with the * Registry, because it isCompatibleWith all colorspaces, and should only be used in extreme * cases (like no other producer being available **/ class KisGenericRGBHistogramProducer : public KisBasicHistogramProducer { public: KisGenericRGBHistogramProducer(); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const; - virtual QValueVector<KisChannelInfo *> channels(); + virtual TQValueVector<KisChannelInfo *> channels(); protected: - QValueVector<KisChannelInfo *> m_channelsList; + TQValueVector<KisChannelInfo *> m_channelsList; }; /** KisGenericRGBHistogramProducer his special Factory that isCompatibleWith everything. */ @@ -172,12 +172,12 @@ class KisGenericLabHistogramProducer : public KisBasicHistogramProducer { public: KisGenericLabHistogramProducer(); virtual ~KisGenericLabHistogramProducer(); - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace *colorSpace); - virtual QString positionToString(double pos) const; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace *colorSpace); + virtual TQString positionToString(double pos) const; virtual double maximalZoom() const; - virtual QValueVector<KisChannelInfo *> channels(); + virtual TQValueVector<KisChannelInfo *> channels(); protected: - QValueVector<KisChannelInfo *> m_channelsList; + TQValueVector<KisChannelInfo *> m_channelsList; private: static KisLabColorSpace* m_labCs; }; diff --git a/krita/kritacolor/kis_channelinfo.h b/krita/kritacolor/kis_channelinfo.h index f37d8900..f8ec8301 100644 --- a/krita/kritacolor/kis_channelinfo.h +++ b/krita/kritacolor/kis_channelinfo.h @@ -18,8 +18,8 @@ #ifndef KIS_CHANNELINFO_H_ #define KIS_CHANNELINFO_H_ -#include <qcolor.h> -#include "qstring.h" +#include <tqcolor.h> +#include "tqstring.h" #include "ksharedptr.h" /** @@ -64,27 +64,27 @@ public: * @param size the size in bytes of this channel * @param color a color to visually represent this channel by in the gui */ - KisChannelInfo( const QString & name, const QString & abbrev, Q_INT32 npos, enumChannelType channelType, enumChannelValueType channelValueType, Q_INT32 size = 1, QColor color = QColor(0,0,0)) + KisChannelInfo( const TQString & name, const TQString & abbrev, TQ_INT32 npos, enumChannelType channelType, enumChannelValueType channelValueType, TQ_INT32 size = 1, TQColor color = TQColor(0,0,0)) : m_name (name), m_abbrev(abbrev), m_pos (npos), m_channelType(channelType), m_channelValueType(channelValueType), m_size(size), m_color(color) { }; public: /** * User-friendly name for this channel for presentation purposes in the gui */ - inline QString name() const { return m_name; }; + inline TQString name() const { return m_name; }; /** * Return the single-letter abbreviation for this channel */ - inline QString abbrev() const { return m_abbrev; }; + inline TQString abbrev() const { return m_abbrev; }; /** * returns the position of the first byte of the channel in the pixel */ - inline Q_INT32 pos() const { return m_pos; }; + inline TQ_INT32 pos() const { return m_pos; }; /** * returns the number of bytes this channel takes */ - inline Q_INT32 size() const { return m_size; }; + inline TQ_INT32 size() const { return m_size; }; /** * returns the type of the channel @@ -98,17 +98,17 @@ public: * This is a color that can be used to represent this channel in histograms and so. * By default this is black, so keep in mind that many channels might look the same */ - inline QColor color() const { return m_color; } + inline TQColor color() const { return m_color; } private: - QString m_name; - QString m_abbrev; - Q_INT32 m_pos; + TQString m_name; + TQString m_abbrev; + TQ_INT32 m_pos; enumChannelType m_channelType; enumChannelValueType m_channelValueType; - Q_INT32 m_size; - QColor m_color; + TQ_INT32 m_size; + TQColor m_color; }; diff --git a/krita/kritacolor/kis_color.cc b/krita/kritacolor/kis_color.cc index eb845c27..7d6acb89 100644 --- a/krita/kritacolor/kis_color.cc +++ b/krita/kritacolor/kis_color.cc @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qcolor.h> +#include <tqcolor.h> #include "kdebug.h" #include "kis_debug_areas.h" @@ -35,35 +35,35 @@ KisColor::~KisColor() delete [] m_data; } -KisColor::KisColor(const QColor & color, KisColorSpace * colorSpace) +KisColor::KisColor(const TQColor & color, KisColorSpace * colorSpace) : m_colorSpace(colorSpace) { Q_ASSERT(color.isValid()); Q_ASSERT(colorSpace); - m_data = new Q_UINT8[colorSpace->pixelSize()]; + m_data = new TQ_UINT8[colorSpace->pixelSize()]; memset(m_data, 0, m_colorSpace->pixelSize()); - m_colorSpace->fromQColor(color, OPACITY_OPAQUE, m_data); + m_colorSpace->fromTQColor(color, OPACITY_OPAQUE, m_data); } -KisColor::KisColor(const QColor & color, Q_UINT8 alpha, KisColorSpace * colorSpace) +KisColor::KisColor(const TQColor & color, TQ_UINT8 alpha, KisColorSpace * colorSpace) : m_colorSpace(colorSpace) { Q_ASSERT(color.isValid()); Q_ASSERT(colorSpace); - m_data = new Q_UINT8[colorSpace->pixelSize()]; + m_data = new TQ_UINT8[colorSpace->pixelSize()]; memset(m_data, 0, m_colorSpace->pixelSize()); - m_colorSpace->fromQColor(color, alpha, m_data); + m_colorSpace->fromTQColor(color, alpha, m_data); } -KisColor::KisColor(const Q_UINT8 * data, KisColorSpace * colorSpace) +KisColor::KisColor(const TQ_UINT8 * data, KisColorSpace * colorSpace) : m_colorSpace(colorSpace) { - m_data = new Q_UINT8[colorSpace->pixelSize()]; + m_data = new TQ_UINT8[colorSpace->pixelSize()]; memset(m_data, 0, m_colorSpace->pixelSize()); memmove(m_data, data, colorSpace->pixelSize()); } @@ -72,7 +72,7 @@ KisColor::KisColor(const Q_UINT8 * data, KisColorSpace * colorSpace) KisColor::KisColor(const KisColor &src, KisColorSpace * colorSpace) : m_colorSpace(colorSpace) { - m_data = new Q_UINT8[colorSpace->pixelSize()]; + m_data = new TQ_UINT8[colorSpace->pixelSize()]; memset(m_data, 0, m_colorSpace->pixelSize()); src.colorSpace()->convertPixelsTo(src.data(), m_data, colorSpace, 1); @@ -83,7 +83,7 @@ KisColor::KisColor(const KisColor & rhs) if (this == &rhs) return; m_colorSpace = rhs.colorSpace(); - m_data = new Q_UINT8[m_colorSpace->pixelSize()]; + m_data = new TQ_UINT8[m_colorSpace->pixelSize()]; memset(m_data, 0, m_colorSpace->pixelSize()); memcpy(m_data, rhs.data(), m_colorSpace->pixelSize()); } @@ -95,7 +95,7 @@ KisColor & KisColor::operator=(const KisColor & rhs) m_colorSpace = rhs.colorSpace(); if (rhs.m_colorSpace && rhs.m_data) { - m_data = new Q_UINT8[m_colorSpace->pixelSize()]; + m_data = new TQ_UINT8[m_colorSpace->pixelSize()]; memcpy(m_data, rhs.m_data, m_colorSpace->pixelSize()); } return * this; @@ -109,7 +109,7 @@ void KisColor::convertTo(KisColorSpace * cs) if (m_colorSpace == cs) return; - Q_UINT8 * m_data2 = new Q_UINT8[cs->pixelSize()]; + TQ_UINT8 * m_data2 = new TQ_UINT8[cs->pixelSize()]; memset(m_data2, 0, cs->pixelSize()); m_colorSpace->convertPixelsTo(m_data, m_data2, cs, 1); @@ -120,38 +120,38 @@ void KisColor::convertTo(KisColorSpace * cs) } -void KisColor::setColor(Q_UINT8 * data, KisColorSpace * colorSpace) +void KisColor::setColor(TQ_UINT8 * data, KisColorSpace * colorSpace) { delete [] m_data; - m_data = new Q_UINT8[colorSpace->pixelSize()]; + m_data = new TQ_UINT8[colorSpace->pixelSize()]; memcpy(m_data, data, colorSpace->pixelSize()); m_colorSpace = colorSpace; } -// To save the user the trouble of doing color->colorSpace()->toQColor(color->data(), &c, &a, profile -void KisColor::toQColor(QColor *c) const +// To save the user the trouble of doing color->colorSpace()->toTQColor(color->data(), &c, &a, profile +void KisColor::toTQColor(TQColor *c) const { if (m_colorSpace && m_data) { // XXX (bsar): There must be a better way, but I'm getting hopelessly confused about constness by now KisColorSpace * cs(const_cast<KisColorSpace*>(m_colorSpace)); - cs->toQColor(m_data, c); + cs->toTQColor(m_data, c); } } -void KisColor::toQColor(QColor *c, Q_UINT8 *opacity) const +void KisColor::toTQColor(TQColor *c, TQ_UINT8 *opacity) const { if (m_colorSpace && m_data) { // XXX (bsar): There must be a better way, but I'm getting hopelessly confused about constness by now KisColorSpace * cs(const_cast<KisColorSpace*>(m_colorSpace)); - cs->toQColor(m_data, c, opacity); + cs->toTQColor(m_data, c, opacity); } } -QColor KisColor::toQColor() const +TQColor KisColor::toTQColor() const { - QColor c; - toQColor(&c); + TQColor c; + toTQColor(&c); return c; } @@ -159,26 +159,26 @@ void KisColor::dump() const { //kdDebug(DBG_AREA_CMS) << "KisColor (" << this << "), " << m_colorSpace->id().name() << "\n"; - QValueVector<KisChannelInfo *> channels = m_colorSpace->channels(); + TQValueVector<KisChannelInfo *> channels = m_colorSpace->channels(); - QValueVector<KisChannelInfo *>::const_iterator begin = channels.begin(); - QValueVector<KisChannelInfo *>::const_iterator end = channels.end(); + TQValueVector<KisChannelInfo *>::const_iterator begin = channels.begin(); + TQValueVector<KisChannelInfo *>::const_iterator end = channels.end(); - for (QValueVector<KisChannelInfo *>::const_iterator it = begin; it != end; ++it) + for (TQValueVector<KisChannelInfo *>::const_iterator it = begin; it != end; ++it) { KisChannelInfo * ch = (*it); // XXX: setNum always takes a byte. - if (ch->size() == sizeof(Q_UINT8)) { + if (ch->size() == sizeof(TQ_UINT8)) { // Byte - //kdDebug(DBG_AREA_CMS) << "Channel (byte): " << ch->name() << ": " << QString().setNum(m_data[ch->pos()]) << "\n"; + //kdDebug(DBG_AREA_CMS) << "Channel (byte): " << ch->name() << ": " << TQString().setNum(m_data[ch->pos()]) << "\n"; } - else if (ch->size() == sizeof(Q_UINT16)) { + else if (ch->size() == sizeof(TQ_UINT16)) { // Short (may also by an nvidia half) - //kdDebug(DBG_AREA_CMS) << "Channel (short): " << ch->name() << ": " << QString().setNum(*((const Q_UINT16 *)(m_data+ch->pos()))) << "\n"; + //kdDebug(DBG_AREA_CMS) << "Channel (short): " << ch->name() << ": " << TQString().setNum(*((const TQ_UINT16 *)(m_data+ch->pos()))) << "\n"; } - else if (ch->size() == sizeof(Q_UINT32)) { + else if (ch->size() == sizeof(TQ_UINT32)) { // Integer (may also be float... Find out how to distinguish these!) - //kdDebug(DBG_AREA_CMS) << "Channel (int): " << ch->name() << ": " << QString().setNum(*((const Q_UINT32 *)(m_data+ch->pos()))) << "\n"; + //kdDebug(DBG_AREA_CMS) << "Channel (int): " << ch->name() << ": " << TQString().setNum(*((const TQ_UINT32 *)(m_data+ch->pos()))) << "\n"; } } diff --git a/krita/kritacolor/kis_color.h b/krita/kritacolor/kis_color.h index 647bddb3..b7646586 100644 --- a/krita/kritacolor/kis_color.h +++ b/krita/kritacolor/kis_color.h @@ -18,7 +18,7 @@ #ifndef _KIS_COLOR_H_ #define _KIS_COLOR_H_ -#include <qcolor.h> +#include <tqcolor.h> #include "ksharedptr.h" #include "kis_global.h" @@ -38,16 +38,16 @@ public: virtual ~KisColor(); - /// Create a KisColor from a QColor. The QColor is immediately converted to native. The QColor + /// Create a KisColor from a TQColor. The TQColor is immediately converted to native. The TQColor /// is assumed to have the current monitor profile. - KisColor(const QColor & color, KisColorSpace * colorSpace); + KisColor(const TQColor & color, KisColorSpace * colorSpace); - /// Create a KisColor from a QColor. The QColor is immediately converted to native. The QColor + /// Create a KisColor from a TQColor. The TQColor is immediately converted to native. The TQColor /// is assumed to have the current monitor profile. - KisColor(const QColor & color, Q_UINT8 alpha, KisColorSpace * colorSpace); + KisColor(const TQColor & color, TQ_UINT8 alpha, KisColorSpace * colorSpace); /// Create a KisColor using a native color strategy. The data is copied. - KisColor(const Q_UINT8 * data, KisColorSpace * colorSpace); + KisColor(const TQ_UINT8 * data, KisColorSpace * colorSpace); /// Create a KisColor by converting src into another colorspace KisColor(const KisColor &src, KisColorSpace * colorSpace); @@ -59,7 +59,7 @@ public: KisColor &operator=(const KisColor &); /// For easy memcpy'ing etc. - Q_UINT8 * data() const { return m_data; } + TQ_UINT8 * data() const { return m_data; } KisColorSpace * colorSpace() const { return m_colorSpace; } @@ -70,19 +70,19 @@ public: void convertTo(KisColorSpace * cs); /// Replace the existing color data, and colorspace with the specified data. - void setColor(Q_UINT8 * data, KisColorSpace * colorSpace = 0); + void setColor(TQ_UINT8 * data, KisColorSpace * colorSpace = 0); - /// To save the user the trouble of doing color->colorSpace()->toQColor(color->data(), &c, &a - void toQColor(QColor *c) const; - void toQColor(QColor *c, Q_UINT8 *opacity) const; + /// To save the user the trouble of doing color->colorSpace()->toTQColor(color->data(), &c, &a + void toTQColor(TQColor *c) const; + void toTQColor(TQColor *c, TQ_UINT8 *opacity) const; - QColor toQColor() const; + TQColor toTQColor() const; void dump() const; private: - Q_UINT8 * m_data; + TQ_UINT8 * m_data; KisColorSpace * m_colorSpace; }; diff --git a/krita/kritacolor/kis_color_conversions.cc b/krita/kritacolor/kis_color_conversions.cc index 2ba54ad5..e517c9f7 100644 --- a/krita/kritacolor/kis_color_conversions.cc +++ b/krita/kritacolor/kis_color_conversions.cc @@ -18,7 +18,7 @@ #include <cmath> -#include <qglobal.h> +#include <tqglobal.h> #include "kis_color_conversions.h" @@ -150,8 +150,8 @@ void hsv_to_rgb(int H, int S, int V, int *R, int *G, int *B) void RGBToHSV(float r, float g, float b, float *h, float *s, float *v) { - float max = QMAX(r, QMAX(g, b)); - float min = QMIN(r, QMIN(g, b)); + float max = TQMAX(r, TQMAX(g, b)); + float min = TQMIN(r, TQMIN(g, b)); *v = max; @@ -239,7 +239,7 @@ void HSVToRGB(float h, float s, float v, float *r, float *g, float *b) } } -void rgb_to_hls(Q_UINT8 red, Q_UINT8 green, Q_UINT8 blue, float * hue, float * lightness, float * saturation) +void rgb_to_hls(TQ_UINT8 red, TQ_UINT8 green, TQ_UINT8 blue, float * hue, float * lightness, float * saturation) { float r = red / 255.0; float g = green / 255.0; @@ -250,11 +250,11 @@ void rgb_to_hls(Q_UINT8 red, Q_UINT8 green, Q_UINT8 blue, float * hue, float * l float max, min, delta; - max = QMAX(r, g); - max = QMAX(max, b); + max = TQMAX(r, g); + max = TQMAX(max, b); - min = QMIN(r, g); - min = QMIN(min, b); + min = TQMIN(r, g); + min = TQMIN(min, b); delta = max - min; @@ -310,7 +310,7 @@ float hue_value(float n1, float n2, float hue) } -void hls_to_rgb(float h, float l, float s, Q_UINT8 * r, Q_UINT8 * g, Q_UINT8 * b) +void hls_to_rgb(float h, float l, float s, TQ_UINT8 * r, TQ_UINT8 * g, TQ_UINT8 * b) { float m1, m2; @@ -321,13 +321,13 @@ void hls_to_rgb(float h, float l, float s, Q_UINT8 * r, Q_UINT8 * g, Q_UINT8 * b m1 = 2 * l - m2; - *r = (Q_UINT8)(hue_value(m1, m2, h + 120) * 255 + 0.5); - *g = (Q_UINT8)(hue_value(m1, m2, h) * 255 + 0.5); - *b = (Q_UINT8)(hue_value(m1, m2, h - 120) * 255 + 0.5); + *r = (TQ_UINT8)(hue_value(m1, m2, h + 120) * 255 + 0.5); + *g = (TQ_UINT8)(hue_value(m1, m2, h) * 255 + 0.5); + *b = (TQ_UINT8)(hue_value(m1, m2, h - 120) * 255 + 0.5); } -void rgb_to_hls(Q_UINT8 r, Q_UINT8 g, Q_UINT8 b, int * h, int * l, int * s) +void rgb_to_hls(TQ_UINT8 r, TQ_UINT8 g, TQ_UINT8 b, int * h, int * l, int * s) { float hue, saturation, lightness; @@ -337,7 +337,7 @@ void rgb_to_hls(Q_UINT8 r, Q_UINT8 g, Q_UINT8 b, int * h, int * l, int * s) *s = (int)(saturation * 255 + 0.5); } -void hls_to_rgb(int h, int l, int s, Q_UINT8 * r, Q_UINT8 * g, Q_UINT8 * b) +void hls_to_rgb(int h, int l, int s, TQ_UINT8 * r, TQ_UINT8 * g, TQ_UINT8 * b) { float hue = h; float lightness = l / 255.0; @@ -359,10 +359,10 @@ void RGBToHSL(float r, float g, float b, float *h, float *s, float *l) float vm; float r2, g2, b2; - v = QMAX(r,g); - v = QMAX(v,b); - m = QMIN(r,g); - m = QMIN(m,b); + v = TQMAX(r,g); + v = TQMAX(v,b); + m = TQMIN(r,g); + m = TQMIN(m,b); if ((*l = (m + v) / 2.0) <= 0.0) { *h = UNDEFINED_HUE; diff --git a/krita/kritacolor/kis_color_conversions.h b/krita/kritacolor/kis_color_conversions.h index 011a50ea..53a476e0 100644 --- a/krita/kritacolor/kis_color_conversions.h +++ b/krita/kritacolor/kis_color_conversions.h @@ -19,7 +19,7 @@ #ifndef _KIS_CONVERSIONS_H_ #define _KIS_CONVERSIONS_H_ -#include <qglobal.h> +#include <tqglobal.h> /** * A number of often-used conversions between color models @@ -36,14 +36,14 @@ void RGBToHSL(float r, float g, float b, float *h, float *s, float *l); void HSLToRGB(float h, float sl, float l, float *r, float *g, float *b); - void rgb_to_hls(Q_UINT8 r, Q_UINT8 g, Q_UINT8 b, float * h, float * l, float * s); + void rgb_to_hls(TQ_UINT8 r, TQ_UINT8 g, TQ_UINT8 b, float * h, float * l, float * s); float hue_value(float n1, float n2, float hue); - void hls_to_rgb(float h, float l, float s, Q_UINT8 * r, Q_UINT8 * g, Q_UINT8 * b); + void hls_to_rgb(float h, float l, float s, TQ_UINT8 * r, TQ_UINT8 * g, TQ_UINT8 * b); - void rgb_to_hls(Q_UINT8 r, Q_UINT8 g, Q_UINT8 b, int * h, int * l, int * s); - void hls_to_rgb(int h, int l, int s, Q_UINT8 * r, Q_UINT8 * g, Q_UINT8 * b); + void rgb_to_hls(TQ_UINT8 r, TQ_UINT8 g, TQ_UINT8 b, int * h, int * l, int * s); + void hls_to_rgb(int h, int l, int s, TQ_UINT8 * r, TQ_UINT8 * g, TQ_UINT8 * b); #endif // _KIS_CONVERSIONS_H_ diff --git a/krita/kritacolor/kis_colorspace.h b/krita/kritacolor/kis_colorspace.h index 0a94a74b..3506ef6e 100644 --- a/krita/kritacolor/kis_colorspace.h +++ b/krita/kritacolor/kis_colorspace.h @@ -21,8 +21,8 @@ #include <config.h> #include LCMS_HEADER -#include <qvaluevector.h> -#include <qvaluelist.h> +#include <tqvaluevector.h> +#include <tqvaluelist.h> #include "kis_composite_op.h" #include "kis_channelinfo.h" @@ -75,61 +75,61 @@ public: //========== Channels =====================================================// /// Return a vector describing all the channels this color model has. - virtual QValueVector<KisChannelInfo *> channels() const = 0; + virtual TQValueVector<KisChannelInfo *> channels() const = 0; /** * The total number of channels for a single pixel in this color model */ - virtual Q_UINT32 nChannels() const = 0; + virtual TQ_UINT32 nChannels() const = 0; /** * The total number of color channels (excludes alpha and substance) for a single * pixel in this color model. */ - virtual Q_UINT32 nColorChannels() const = 0; + virtual TQ_UINT32 nColorChannels() const = 0; /** * The total number of substance channels for a single pixel * in this color model */ - virtual Q_UINT32 nSubstanceChannels() const { return 0; }; + virtual TQ_UINT32 nSubstanceChannels() const { return 0; }; /** * The size in bytes of a single pixel in this color model */ - virtual Q_UINT32 pixelSize() const = 0; + virtual TQ_UINT32 pixelSize() const = 0; /** * Return a string with the channel's value suitable for display in the gui. */ - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const = 0; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const = 0; /** * Return a string with the channel's value with integer * channels normalised to the floating point range 0 to 1, if appropriate. */ - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const = 0; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const = 0; /** * Convert the value of the channel at the specified position into * an 8-bit value. The position is not the number of bytes, but * the position of the channel as defined in the channel info list. */ - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos) = 0; + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos) = 0; /** * Convert the value of the channel at the specified position into * a 16-bit value. This may be upscaling or downscaling, depending * on the defined value of the channel */ - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos) = 0; + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos) = 0; /** * Set dstPixel to the pixel containing only the given channel of srcPixel. The remaining channels * should be set to whatever makes sense for 'empty' channels of this colour space, * with the intent being that the pixel should look like it only has the given channel. */ - virtual void getSingleChannelPixel(Q_UINT8 *dstPixel, const Q_UINT8 *srcPixel, Q_UINT32 channelIndex) = 0; + virtual void getSingleChannelPixel(TQ_UINT8 *dstPixel, const TQ_UINT8 *srcPixel, TQ_UINT32 channelIndex) = 0; //========== Identification ===============================================// @@ -142,7 +142,7 @@ public: /** * lcms colorspace type definition. */ - virtual Q_UINT32 colorSpaceType() = 0; + virtual TQ_UINT32 colorSpaceType() = 0; virtual icColorSpaceSignature colorSpaceSignature() = 0; @@ -185,54 +185,54 @@ public: /** - * The fromQColor methods take a given color defined as an RGB QColor + * The fromTQColor methods take a given color defined as an RGB TQColor * and fills a byte array with the corresponding color in the * the colorspace managed by this strategy. * - * @param c the QColor that will be used to fill dst + * @param c the TQColor that will be used to fill dst * @param dst a pointer to a pixel - * @param profile the optional profile that describes the color values of QColor + * @param profile the optional profile that describes the color values of TQColor */ - virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0) = 0; + virtual void fromTQColor(const TQColor& c, TQ_UINT8 *dst, KisProfile * profile = 0) = 0; /** - * The fromQColor methods take a given color defined as an RGB QColor + * The fromTQColor methods take a given color defined as an RGB TQColor * and fills a byte array with the corresponding color in the * the colorspace managed by this strategy. * - * @param c the QColor that will be used to fill dst + * @param c the TQColor that will be used to fill dst * @param opacity the opacity of the color * @param dst a pointer to a pixel - * @param profile the optional profile that describes the color values of QColor + * @param profile the optional profile that describes the color values of TQColor */ - virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0) = 0; + virtual void fromTQColor(const TQColor& c, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile * profile = 0) = 0; /** - * 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 + * The toTQColor methods take a byte array that is at least pixelSize() long + * and converts the contents to a TQColor, using the given profile as a source * profile and the optional profile as a destination profile. * * @param src a pointer to the source pixel - * @param c the QColor that will be filled with the color at src + * @param c the TQColor that will be filled with the color at src * @param profile the optional profile that describes the color in c, for instance the monitor profile */ - virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile = 0) = 0; + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, KisProfile * profile = 0) = 0; /** - * 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 + * The toTQColor methods take a byte array that is at least pixelSize() long + * and converts the contents to a TQColor, using the given profile as a source * profile and the option profile as a destination profile. * * @param src a pointer to the source pixel - * @param c the QColor that will be filled with the color at src + * @param c the TQColor that will be filled with the color at src * @param opacity a pointer to a byte that will be filled with the opacity a src * @param profile the optional profile that describes the color in c, for instance the monitor profile */ - virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0) = 0; + virtual void toTQColor(const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile * profile = 0) = 0; /** - * Convert the pixels in data to (8-bit BGRA) QImage using the specified profiles. + * Convert the pixels in data to (8-bit BGRA) TQImage using the specified profiles. * The pixels are supposed to be encoded in this color model. The default implementation * will convert the pixels using either the profiles or the default profiles for the * current colorstrategy and the RGBA colorstrategy. If that is not what you want, @@ -245,8 +245,8 @@ public: * @param renderingIntent the rendering intent * @param exposure The exposure setting for rendering a preview of a high dynamic range image. */ - virtual QImage convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, - KisProfile * dstProfile, Q_INT32 renderingIntent = INTENT_PERCEPTUAL, + virtual TQImage convertToTQImage(const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, + KisProfile * dstProfile, TQ_INT32 renderingIntent = INTENT_PERCEPTUAL, float exposure = 0.0f) = 0; @@ -257,7 +257,7 @@ public: * @param dst the destination data * @param nPixels the number of source pixels */ - virtual void toLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const = 0; + virtual void toLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const = 0; /** * Convert the specified data from Lab. to this colorspace. All colorspaces are @@ -267,7 +267,7 @@ public: * @param dst the destination data * @param nPixels the number of pixels in the array */ - virtual void fromLabA16(const Q_UINT8 * src, Q_UINT8 * dst, const Q_UINT32 nPixels) const = 0; + virtual void fromLabA16(const TQ_UINT8 * src, TQ_UINT8 * dst, const TQ_UINT32 nPixels) const = 0; /** * Convert a byte array of srcLen pixels *src to the specified color space @@ -275,23 +275,23 @@ public: * * Returns false if the conversion failed, true if it succeeded */ - virtual bool convertPixelsTo(const Q_UINT8 * src, - Q_UINT8 * dst, KisColorSpace * dstColorSpace, - Q_UINT32 numPixels, - Q_INT32 renderingIntent = INTENT_PERCEPTUAL) = 0; + virtual bool convertPixelsTo(const TQ_UINT8 * src, + TQ_UINT8 * dst, KisColorSpace * dstColorSpace, + TQ_UINT32 numPixels, + TQ_INT32 renderingIntent = INTENT_PERCEPTUAL) = 0; //============================== Manipulation functions ==========================// // // The manipulation functions have default implementations that _convert_ the pixel -// to a QColor and back. Reimplement these methods in your color strategy! +// to a TQColor and back. Reimplement these methods in your color strategy! // /** * Get the alpha value of the given pixel, downscaled to an 8-bit value. */ - virtual Q_UINT8 getAlpha(const Q_UINT8 * pixel) const = 0; + virtual TQ_UINT8 getAlpha(const TQ_UINT8 * pixel) const = 0; /** * Set the alpha channel of the given run of pixels to the given value. @@ -301,7 +301,7 @@ public: * nPixels -- the number of pixels * */ - virtual void setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const = 0; + virtual void setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const = 0; /** * Multiply the alpha channel of the given run of pixels by the given value. @@ -311,27 +311,27 @@ public: * nPixels -- the number of pixels * */ - virtual void multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) = 0; + virtual void multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) = 0; /** - * Applies the specified 8-bit alpha mask to the pixels. We assume that there are just + * Applies the specified 8-bit alpha tqmask to the pixels. We assume that there are just * as many alpha values as pixels but we do not check this; the alpha values * are assumed to be 8-bits. */ - virtual void applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels) = 0; + virtual void applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels) = 0; /** - * Applies the inverted 8-bit alpha mask to the pixels. We assume that there are just + * Applies the inverted 8-bit alpha tqmask to the pixels. We assume that there are just * as many alpha values as pixels but we do not check this; the alpha values * are assumed to be 8-bits. */ - virtual void applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels) = 0; + virtual void applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels) = 0; /** * Create an adjustment object for adjusting the brightness and contrast * transferValues is a 256 bins array with values from 0 to 0xFFFF */ - virtual KisColorAdjustment *createBrightnessContrastAdjustment(Q_UINT16 *transferValues) = 0; + virtual KisColorAdjustment *createBrightnessContrastAdjustment(TQ_UINT16 *transferValues) = 0; /** * Create an adjustment object for desaturating @@ -342,35 +342,35 @@ public: * Create an adjustment object for adjusting individual channels * transferValues is an array of nColorChannels number of 256 bins array with values from 0 to 0xFFFF */ - virtual KisColorAdjustment *createPerChannelAdjustment(Q_UINT16 **transferValues) = 0; + virtual KisColorAdjustment *createPerChannelAdjustment(TQ_UINT16 **transferValues) = 0; /** * Apply the adjustment created with onr of the other functions */ - virtual void applyAdjustment(const Q_UINT8 *src, Q_UINT8 *dst, KisColorAdjustment *, Q_INT32 nPixels) = 0; + virtual void applyAdjustment(const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *, TQ_INT32 nPixels) = 0; /** * Invert color channels of the given pixels */ - virtual void invertColor(Q_UINT8 * src, Q_INT32 nPixels) = 0; + virtual void invertColor(TQ_UINT8 * src, TQ_INT32 nPixels) = 0; // XXX: What with alpha channels? YYY: Add an overloaded function that takes alpha into account? /** * Get the difference between 2 colors, normalized in the range (0,255) */ - virtual Q_UINT8 difference(const Q_UINT8* src1, const Q_UINT8* src2) = 0; + virtual TQ_UINT8 difference(const TQ_UINT8* src1, const TQ_UINT8* src2) = 0; /** * Mix the colors given their weights and return in dst * The sum of weights is assumed 255 */ - virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const = 0; + virtual void mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const = 0; /** * Convolve the given array of pointers to pixels and return the result * in dst. The kernel values are clamped between -128 and 128 */ - virtual void convolveColors(Q_UINT8** colors, Q_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nPixels) const = 0; + virtual void convolveColors(TQ_UINT8** colors, TQ_INT32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nPixels) const = 0; /** * Darken all color channels with the given amount. If compensate is true, @@ -378,12 +378,12 @@ public: * * (See the bumpmap filter) */ - virtual void darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 shade, bool compensate, double compensation, Q_INT32 nPixels) const = 0; + virtual void darken(const TQ_UINT8 * src, TQ_UINT8 * dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const = 0; /** * Calculate the intensity of the given pixel, scaled down to the range 0-255. XXX: Maybe this should be more flexible */ - virtual Q_UINT8 intensity8(const Q_UINT8 * src) const = 0; + virtual TQ_UINT8 intensity8(const TQ_UINT8 * src) const = 0; /** * Create a mathematical toolbox compatible with this colorspace @@ -395,16 +395,16 @@ public: * are not the same colour model, the source pixels will be * converted to the target model. */ - virtual void bitBlt(Q_UINT8 *dst, - Q_INT32 dststride, + virtual void bitBlt(TQ_UINT8 *dst, + TQ_INT32 dststride, KisColorSpace * srcSpace, - const Q_UINT8 *src, - Q_INT32 srcRowStride, - const Q_UINT8 *srcAlphaMask, - Q_INT32 maskRowStride, - Q_UINT8 opacity, - Q_INT32 rows, - Q_INT32 cols, + const TQ_UINT8 *src, + TQ_INT32 srcRowStride, + const TQ_UINT8 *srcAlphaMask, + TQ_INT32 tqmaskRowStride, + TQ_UINT8 opacity, + TQ_INT32 rows, + TQ_INT32 cols, const KisCompositeOp& op) = 0; /** @@ -412,8 +412,8 @@ public: * created paint device. XXX: Currently this uses times and not * threads. */ - virtual QValueList<KisFilter*> createBackgroundFilters() - { return QValueList<KisFilter*>(); }; + virtual TQValueList<KisFilter*> createBackgroundFilters() + { return TQValueList<KisFilter*>(); }; private: @@ -432,18 +432,18 @@ public: /** * lcms colorspace type definition. */ - virtual Q_UINT32 colorSpaceType() = 0; + virtual TQ_UINT32 colorSpaceType() = 0; virtual icColorSpaceSignature colorSpaceSignature() = 0; - virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *) = 0; + virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *) = 0; /** * Returns the default icc profile for use with this colorspace. This may be "" * & @return the default icc profile name */ - virtual QString defaultProfile() = 0; + virtual TQString defaultProfile() = 0; }; diff --git a/krita/kritacolor/kis_colorspace_factory_registry.cc b/krita/kritacolor/kis_colorspace_factory_registry.cc index 8aab0d9a..bbe500bc 100644 --- a/krita/kritacolor/kis_colorspace_factory_registry.cc +++ b/krita/kritacolor/kis_colorspace_factory_registry.cc @@ -32,7 +32,7 @@ #include "kis_lab_colorspace.h" -KisColorSpaceFactoryRegistry::KisColorSpaceFactoryRegistry(QStringList profileFilenames) +KisColorSpaceFactoryRegistry::KisColorSpaceFactoryRegistry(TQStringList profileFilenames) { // Create the built-in colorspaces @@ -41,7 +41,7 @@ KisColorSpaceFactoryRegistry::KisColorSpaceFactoryRegistry(QStringList profileFi // Load the profiles if (!profileFilenames.empty()) { KisProfile * profile = 0; - for ( QStringList::Iterator it = profileFilenames.begin(); it != profileFilenames.end(); ++it ) { + for ( TQStringList::Iterator it = profileFilenames.begin(); it != profileFilenames.end(); ++it ) { profile = new KisProfile(*it); Q_CHECK_PTR(profile); @@ -62,8 +62,8 @@ KisColorSpaceFactoryRegistry::KisColorSpaceFactoryRegistry(QStringList profileFi */ // Load all colorspace modules - KTrader::OfferList offers = KTrader::self()->query(QString::fromLatin1("Krita/ColorSpace"), - QString::fromLatin1("(Type == 'Service') and " + KTrader::OfferList offers = KTrader::self()->query(TQString::tqfromLatin1("Krita/ColorSpace"), + TQString::tqfromLatin1("(Type == 'Service') and " "([X-Krita-Version] == 2)")); if (offers.empty()) { @@ -77,7 +77,7 @@ KisColorSpaceFactoryRegistry::KisColorSpaceFactoryRegistry(QStringList profileFi KService::Ptr service = *iter; int errCode = 0; KParts::Plugin* plugin = - KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, QStringList(), &errCode); + KParts::ComponentFactory::createInstanceFromService<KParts::Plugin> ( service, this, 0, TQStringList(), &errCode); if ( plugin ) kdDebug(DBG_AREA_PLUGINS) << "found colorspace " << service->property("Name").toString() << "\n"; else { @@ -98,26 +98,26 @@ KisColorSpaceFactoryRegistry::~KisColorSpaceFactoryRegistry() { } -KisProfile * KisColorSpaceFactoryRegistry::getProfileByName(const QString & name) +KisProfile * KisColorSpaceFactoryRegistry::getProfileByName(const TQString & name) { - if (m_profileMap.find(name) == m_profileMap.end()) { + if (m_profileMap.tqfind(name) == m_profileMap.end()) { return 0; } return m_profileMap[name]; } -QValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisID id) +TQValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisID id) { return profilesFor(get(id)); } -QValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisColorSpaceFactory * csf) +TQValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisColorSpaceFactory * csf) { - QValueVector<KisProfile *> profiles; + TQValueVector<KisProfile *> profiles; - QMap<QString, KisProfile * >::Iterator it; + TQMap<TQString, KisProfile * >::Iterator it; for (it = m_profileMap.begin(); it != m_profileMap.end(); ++it) { KisProfile * profile = it.data(); if (profile->colorSpaceSignature() == csf->colorSpaceSignature()) { @@ -139,14 +139,14 @@ void KisColorSpaceFactoryRegistry::addPaintDeviceAction(KisColorSpace* cs, m_paintDevActionMap[cs->id()].append(action); } -QValueVector<KisPaintDeviceAction *> +TQValueVector<KisPaintDeviceAction *> KisColorSpaceFactoryRegistry::paintDeviceActionsFor(KisColorSpace* cs) { return m_paintDevActionMap[cs->id()]; } -KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID, const QString & pName) +KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID, const TQString & pName) { - QString profileName = pName; + TQString profileName = pName; if(profileName.isEmpty()) { @@ -158,9 +158,9 @@ KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID, profileName = csf->defaultProfile(); } - QString name = csID.id() + "<comb>" + profileName; + TQString name = csID.id() + "<comb>" + profileName; - if (m_csMap.find(name) == m_csMap.end()) { + if (m_csMap.tqfind(name) == m_csMap.end()) { KisColorSpaceFactory *csf = get(csID); if(!csf) return 0; @@ -175,7 +175,7 @@ KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID, m_csMap[name] = cs; } - if(m_csMap.contains(name)) + if(m_csMap.tqcontains(name)) return m_csMap[name]; else return 0; @@ -199,7 +199,7 @@ KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID, if(!cs ) return 0; - QString name = csID.id() + "<comb>" + profile->productName(); + TQString name = csID.id() + "<comb>" + profile->productName(); m_csMap[name] = cs; } diff --git a/krita/kritacolor/kis_colorspace_factory_registry.h b/krita/kritacolor/kis_colorspace_factory_registry.h index 2922a0e8..104c99aa 100644 --- a/krita/kritacolor/kis_colorspace_factory_registry.h +++ b/krita/kritacolor/kis_colorspace_factory_registry.h @@ -19,23 +19,24 @@ #ifndef KIS_COLORSPACE_FACTORY_REGISTRY_H_ #define KIS_COLORSPACE_FACTORY_REGISTRY_H_ -#include "qobject.h" +#include "tqobject.h" #include "kis_generic_registry.h" #include "kis_colorspace.h" -class QStringList; +class TQStringList; class KisPaintDeviceAction; /** - * This class contains: + * This class tqcontains: * - a registry of colorspace instantiated with specific profiles. * - a registry of singleton colorspace factories. * - a registry of icc profiles */ -class KisColorSpaceFactoryRegistry : public QObject, public KisGenericRegistry<KisColorSpaceFactory *> { +class KisColorSpaceFactoryRegistry : public TQObject, public KisGenericRegistry<KisColorSpaceFactory *> { Q_OBJECT + TQ_OBJECT public: @@ -47,7 +48,7 @@ public: * * @param profileFileNames a list of all filenames of all profiles that need to be loaded initially */ - KisColorSpaceFactoryRegistry(QStringList profileFileNames); + KisColorSpaceFactoryRegistry(TQStringList profileFileNames); virtual ~KisColorSpaceFactoryRegistry(); @@ -60,19 +61,19 @@ public: * Return the profile associated with the given product name, * or 0. */ - KisProfile * getProfileByName(const QString & name); + KisProfile * getProfileByName(const TQString & name); /** * Return the vector of profiles for this colorspacefactory */ - QValueVector<KisProfile *> profilesFor(KisColorSpaceFactory * cs); + TQValueVector<KisProfile *> profilesFor(KisColorSpaceFactory * cs); - QValueVector<KisProfile *> profilesFor(KisID id); + TQValueVector<KisProfile *> profilesFor(KisID id); /** * Return the colorspace + profile as named, or NULL if impossible combination. */ - KisColorSpace * getColorSpace(const KisID & csID, const QString & profileName); + KisColorSpace * getColorSpace(const KisID & csID, const TQString & profileName); /** * Return the colorspace + profile -- where the profile is matched on the name of the specified profile @@ -100,7 +101,7 @@ public: /** * Get a list of KisConstructPaintDeviceAction for a colorspace */ - QValueVector<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs); + TQValueVector<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs); private: KisColorSpaceFactoryRegistry(); @@ -109,10 +110,10 @@ private: private: - QMap<QString, KisProfile * > m_profileMap; - QMap<QString, KisColorSpace * > m_csMap; - typedef QValueVector<KisPaintDeviceAction *> PaintActionVector; - QMap<KisID, PaintActionVector> m_paintDevActionMap; + TQMap<TQString, KisProfile * > m_profileMap; + TQMap<TQString, KisColorSpace * > m_csMap; + typedef TQValueVector<KisPaintDeviceAction *> PaintActionVector; + TQMap<KisID, PaintActionVector> m_paintDevActionMap; KisColorSpace *m_alphaCs; }; diff --git a/krita/kritacolor/kis_colorspace_iface.cc b/krita/kritacolor/kis_colorspace_iface.cc index 5c7816c9..6e6b3cb8 100644 --- a/krita/kritacolor/kis_colorspace_iface.cc +++ b/krita/kritacolor/kis_colorspace_iface.cc @@ -24,15 +24,15 @@ #include <dcopclient.h> -KisColorSpaceIface::KisColorSpaceIface( KisColorSpace * parent ) - : DCOPObject(parent->id().id().latin1()) +KisColorSpaceIface::KisColorSpaceIface( KisColorSpace * tqparent ) + : DCOPObject(tqparent->id().id().latin1()) { - m_parent = parent; + m_parent = tqparent; } -QByteArray KisColorSpaceIface::invertColor(QByteArray src, Q_INT32 nPixels) +TQByteArray KisColorSpaceIface::invertColor(TQByteArray src, TQ_INT32 nPixels) { - m_parent->invertColor((Q_UINT8*)src.data(), nPixels); + m_parent->invertColor((TQ_UINT8*)src.data(), nPixels); return src; } diff --git a/krita/kritacolor/kis_colorspace_iface.h b/krita/kritacolor/kis_colorspace_iface.h index 2243dc0f..ce52e846 100644 --- a/krita/kritacolor/kis_colorspace_iface.h +++ b/krita/kritacolor/kis_colorspace_iface.h @@ -22,7 +22,7 @@ #include <dcopref.h> #include <dcopobject.h> -#include <qstring.h> +#include <tqstring.h> class KisColorSpace; @@ -30,10 +30,10 @@ class KisColorSpaceIface : public DCOPObject { K_DCOP public: - KisColorSpaceIface( KisColorSpace * parent ); + KisColorSpaceIface( KisColorSpace * tqparent ); k_dcop: - QByteArray invertColor(QByteArray src, Q_INT32 nPixels); + TQByteArray invertColor(TQByteArray src, TQ_INT32 nPixels); private: diff --git a/krita/kritacolor/kis_composite_op.cc b/krita/kritacolor/kis_composite_op.cc index 3bdd0e4f..ddce271b 100644 --- a/krita/kritacolor/kis_composite_op.cc +++ b/krita/kritacolor/kis_composite_op.cc @@ -28,7 +28,7 @@ KisCompositeOp::KisCompositeOp() m_valid = false; } -KisCompositeOp::KisCompositeOp(const QString& id) +KisCompositeOp::KisCompositeOp(const TQString& id) { if (s_idOpMap.empty()) { fillMap(); diff --git a/krita/kritacolor/kis_composite_op.h b/krita/kritacolor/kis_composite_op.h index f6972f93..bd4f10a2 100644 --- a/krita/kritacolor/kis_composite_op.h +++ b/krita/kritacolor/kis_composite_op.h @@ -19,7 +19,7 @@ #define KIS_COMPOSITE_OP_H_ #include <map> -#include <qvaluelist.h> +#include <tqvaluelist.h> //#include "kis_global.h" #include "kis_id.h" @@ -75,7 +75,7 @@ enum CompositeOp { class KisCompositeOp { public: KisCompositeOp(); - KisCompositeOp(const QString& id); + KisCompositeOp(const TQString& id); KisCompositeOp(CompositeOp compositeOp); KisID id() const { return m_id; } @@ -98,6 +98,6 @@ private: static KisIDCompositeOpMap s_idOpMap; }; -typedef QValueList<KisCompositeOp> KisCompositeOpList; +typedef TQValueList<KisCompositeOp> KisCompositeOpList; #endif // KIS_COMPOSITE_OP_H diff --git a/krita/kritacolor/kis_f16half_base_colorspace.cc b/krita/kritacolor/kis_f16half_base_colorspace.cc index be316408..d4886c5f 100644 --- a/krita/kritacolor/kis_f16half_base_colorspace.cc +++ b/krita/kritacolor/kis_f16half_base_colorspace.cc @@ -20,7 +20,7 @@ #include "kis_global.h" #include "kis_f16half_base_colorspace.h" -Q_UINT8 KisF16HalfBaseColorSpace::getAlpha(const Q_UINT8 * U8_pixel) const +TQ_UINT8 KisF16HalfBaseColorSpace::getAlpha(const TQ_UINT8 * U8_pixel) const { if (m_alphaPos < 0) return OPACITY_OPAQUE; @@ -30,10 +30,10 @@ Q_UINT8 KisF16HalfBaseColorSpace::getAlpha(const Q_UINT8 * U8_pixel) const return HALF_TO_UINT8(*pixel); } -void KisF16HalfBaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT32 nPixels) const +void KisF16HalfBaseColorSpace::setAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 alpha, TQ_INT32 nPixels) const { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels > 0) { @@ -45,10 +45,10 @@ void KisF16HalfBaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT3 } } -void KisF16HalfBaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha, Q_INT32 nPixels) +void KisF16HalfBaseColorSpace::multiplyAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 U8_alpha, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); half alpha = UINT8_TO_HALF(U8_alpha); while (nPixels > 0) { @@ -61,11 +61,11 @@ void KisF16HalfBaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha } } -void KisF16HalfBaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisF16HalfBaseColorSpace::applyAlphaU8Mask(TQ_UINT8 * U8_pixel, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { @@ -77,11 +77,11 @@ void KisF16HalfBaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * al } } -void KisF16HalfBaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisF16HalfBaseColorSpace::applyInverseAlphaU8Mask(TQ_UINT8 * U8_pixels, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { @@ -93,31 +93,31 @@ void KisF16HalfBaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UI } } -QString KisF16HalfBaseColorSpace::channelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisF16HalfBaseColorSpace::channelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); const half *pixel = reinterpret_cast<const half *>(U8_pixel); - Q_UINT32 channelPosition = channels()[channelIndex] -> pos() / sizeof(half); + TQ_UINT32 channelPosition = channels()[channelIndex] -> pos() / sizeof(half); - return QString().setNum(pixel[channelPosition]); + return TQString().setNum(pixel[channelPosition]); } -QString KisF16HalfBaseColorSpace::normalisedChannelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisF16HalfBaseColorSpace::normalisedChannelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); const half *pixel = reinterpret_cast<const half *>(U8_pixel); - Q_UINT32 channelPosition = channels()[channelIndex] -> pos() / sizeof(half); + TQ_UINT32 channelPosition = channels()[channelIndex] -> pos() / sizeof(half); - return QString().setNum(100.0 * pixel[channelPosition]); + return TQString().setNum(100.0 * pixel[channelPosition]); } -Q_UINT8 KisF16HalfBaseColorSpace::scaleToU8(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT8 KisF16HalfBaseColorSpace::scaleToU8(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { const half *pixelChannel = reinterpret_cast<const half *>(U8_pixel + channelPos); return HALF_TO_UINT8(*pixelChannel); } -Q_UINT16 KisF16HalfBaseColorSpace::scaleToU16(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT16 KisF16HalfBaseColorSpace::scaleToU16(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { const half *pixelChannel = reinterpret_cast<const half *>(U8_pixel + channelPos); return HALF_TO_UINT16(*pixelChannel); diff --git a/krita/kritacolor/kis_f16half_base_colorspace.h b/krita/kritacolor/kis_f16half_base_colorspace.h index 1beb37c1..ff1dbf8c 100644 --- a/krita/kritacolor/kis_f16half_base_colorspace.h +++ b/krita/kritacolor/kis_f16half_base_colorspace.h @@ -18,7 +18,7 @@ #ifndef KIS_F16HALF_BASE_COLORSPACE_H_ #define KIS_F16HALF_BASE_COLORSPACE_H_ -#include <qcolor.h> +#include <tqcolor.h> #include <half.h> @@ -63,25 +63,25 @@ class KisF16HalfBaseColorSpace : public KisAbstractColorSpace { public: KisF16HalfBaseColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, - KisColorSpaceFactoryRegistry * parent, + KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) - : KisAbstractColorSpace(id, cmType, colorSpaceSignature, parent, p) + : KisAbstractColorSpace(id, cmType, colorSpaceSignature, tqparent, p) { m_alphaSize = sizeof(half); }; - virtual Q_UINT8 getAlpha(const Q_UINT8 * pixel) const; - virtual void setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const; - virtual void multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels); + virtual TQ_UINT8 getAlpha(const TQ_UINT8 * pixel) const; + virtual void setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const; + virtual void multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels); - virtual void applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); - virtual void applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); + virtual void applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); + virtual void applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos); - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos); + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); virtual bool hasHighDynamicRange() const { return true; } @@ -93,7 +93,7 @@ protected: } }; struct Uint8ToF16Half { - inline half operator()(const Q_UINT8 src) const { + inline half operator()(const TQ_UINT8 src) const { return UINT8_TO_HALF(src); } }; diff --git a/krita/kritacolor/kis_f32_base_colorspace.cc b/krita/kritacolor/kis_f32_base_colorspace.cc index 2b6cc56d..27a6a312 100644 --- a/krita/kritacolor/kis_f32_base_colorspace.cc +++ b/krita/kritacolor/kis_f32_base_colorspace.cc @@ -20,7 +20,7 @@ #include "kis_global.h" #include "kis_f32_base_colorspace.h" -Q_UINT8 KisF32BaseColorSpace::getAlpha(const Q_UINT8 * U8_pixel) const +TQ_UINT8 KisF32BaseColorSpace::getAlpha(const TQ_UINT8 * U8_pixel) const { if (m_alphaPos < 0) return OPACITY_OPAQUE; @@ -30,10 +30,10 @@ Q_UINT8 KisF32BaseColorSpace::getAlpha(const Q_UINT8 * U8_pixel) const return FLOAT_TO_UINT8(*pixel); } -void KisF32BaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT32 nPixels) const +void KisF32BaseColorSpace::setAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 alpha, TQ_INT32 nPixels) const { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels > 0) { @@ -45,10 +45,10 @@ void KisF32BaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT32 nP } } -void KisF32BaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha, Q_INT32 nPixels) +void KisF32BaseColorSpace::multiplyAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 U8_alpha, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); float alpha = UINT8_TO_FLOAT(U8_alpha); while (nPixels > 0) { @@ -61,11 +61,11 @@ void KisF32BaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha, Q_ } } -void KisF32BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisF32BaseColorSpace::applyAlphaU8Mask(TQ_UINT8 * U8_pixel, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { @@ -77,11 +77,11 @@ void KisF32BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * alpha8 } } -void KisF32BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisF32BaseColorSpace::applyInverseAlphaU8Mask(TQ_UINT8 * U8_pixels, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { @@ -93,31 +93,31 @@ void KisF32BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UINT8 } } -QString KisF32BaseColorSpace::channelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisF32BaseColorSpace::channelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); const float *pixel = reinterpret_cast<const float *>(U8_pixel); - Q_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(float); + TQ_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(float); - return QString().setNum(pixel[channelPosition]); + return TQString().setNum(pixel[channelPosition]); } -QString KisF32BaseColorSpace::normalisedChannelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisF32BaseColorSpace::normalisedChannelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); const float *pixel = reinterpret_cast<const float *>(U8_pixel); - Q_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(float); + TQ_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(float); - return QString().setNum(100.0 * pixel[channelPosition]); + return TQString().setNum(100.0 * pixel[channelPosition]); } -Q_UINT8 KisF32BaseColorSpace::scaleToU8(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT8 KisF32BaseColorSpace::scaleToU8(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { const float *pixelChannel = reinterpret_cast<const float *>(U8_pixel + channelPos); return FLOAT_TO_UINT8(*pixelChannel); } -Q_UINT16 KisF32BaseColorSpace::scaleToU16(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT16 KisF32BaseColorSpace::scaleToU16(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { const float *pixelChannel = reinterpret_cast<const float *>(U8_pixel + channelPos); return FLOAT_TO_UINT16(*pixelChannel); diff --git a/krita/kritacolor/kis_f32_base_colorspace.h b/krita/kritacolor/kis_f32_base_colorspace.h index f3a9ac28..60ecb9aa 100644 --- a/krita/kritacolor/kis_f32_base_colorspace.h +++ b/krita/kritacolor/kis_f32_base_colorspace.h @@ -18,7 +18,7 @@ #ifndef KIS_F32_BASE_COLORSPACE_H_ #define KIS_F32_BASE_COLORSPACE_H_ -#include <qcolor.h> +#include <tqcolor.h> #include "kis_global.h" #include "kis_abstract_colorspace.h" @@ -58,24 +58,24 @@ class KisF32BaseColorSpace : public KisAbstractColorSpace { public: - KisF32BaseColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisColorSpaceFactoryRegistry * parent, KisProfile *p) - : KisAbstractColorSpace(id, cmType, colorSpaceSignature, parent, p) + KisF32BaseColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) + : KisAbstractColorSpace(id, cmType, colorSpaceSignature, tqparent, p) { m_alphaSize = sizeof(float); }; - virtual Q_UINT8 getAlpha(const Q_UINT8 * pixel) const; - virtual void setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const; - virtual void multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels); + virtual TQ_UINT8 getAlpha(const TQ_UINT8 * pixel) const; + virtual void setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const; + virtual void multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels); - virtual void applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); - virtual void applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); + virtual void applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); + virtual void applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos); - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos); + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); virtual bool hasHighDynamicRange() const { return true; } }; diff --git a/krita/kritacolor/kis_histogram_producer.cc b/krita/kritacolor/kis_histogram_producer.cc index ae61e7cf..bbea95ba 100644 --- a/krita/kritacolor/kis_histogram_producer.cc +++ b/krita/kritacolor/kis_histogram_producer.cc @@ -41,7 +41,7 @@ KisIDList KisHistogramProducerFactoryRegistry::listKeysCompatibleWith( KisColorSpace* colorSpace) const { KisIDList list; - QValueList<float> preferredList; + TQValueList<float> preferredList; storageMap::const_iterator it = m_storage.begin(); storageMap::const_iterator endit = m_storage.end(); // O(n^2), can't this be done better? (But preferrably not by looking up the preferredness @@ -49,8 +49,8 @@ KisIDList KisHistogramProducerFactoryRegistry::listKeysCompatibleWith( while( it != endit ) { if (it->second->isCompatibleWith(colorSpace)) { float preferred = it->second->preferrednessLevelWith(colorSpace); - QValueList<float>::iterator pit = preferredList.begin(); - QValueList<float>::iterator pend = preferredList.end(); + TQValueList<float>::iterator pit = preferredList.begin(); + TQValueList<float>::iterator pend = preferredList.end(); KisIDList::iterator lit = list.begin(); while (pit != pend && preferred <= *pit) { diff --git a/krita/kritacolor/kis_histogram_producer.h b/krita/kritacolor/kis_histogram_producer.h index 171ab1b0..2d25b354 100644 --- a/krita/kritacolor/kis_histogram_producer.h +++ b/krita/kritacolor/kis_histogram_producer.h @@ -19,7 +19,7 @@ #ifndef _KIS_HISTOGRAM_PRODUCER_ #define _KIS_HISTOGRAM_PRODUCER_ -#include <qglobal.h> +#include <tqglobal.h> #include <ksharedptr.h> #include <kis_colorspace.h> @@ -27,7 +27,7 @@ #include "kis_generic_registry.h" class KisRectIteratorPixel; -class QString; +class TQString; class KisChannelInfo; /** @@ -67,7 +67,7 @@ public: * @param nPixels The number of pixels * @param colorSpace the colorspace that can decode the pixel data. */ - virtual void addRegionToBin(Q_UINT8 * pixels, Q_UINT8 * selectionMask, Q_UINT32 nPixels, KisColorSpace* colorSpace) = 0; + virtual void addRegionToBin(TQ_UINT8 * pixels, TQ_UINT8 * selectionMask, TQ_UINT32 nPixels, KisColorSpace* colorSpace) = 0; // Methods to set what exactly is being added to the bins virtual void setView(double from, double width) = 0; @@ -76,18 +76,18 @@ public: // Methods with general information about this specific producer virtual const KisID& id() const = 0; - virtual QValueVector<KisChannelInfo *> channels() = 0; - virtual Q_INT32 numberOfBins() = 0; - virtual QString positionToString(double pos) const = 0; + virtual TQValueVector<KisChannelInfo *> channels() = 0; + virtual TQ_INT32 numberOfBins() = 0; + virtual TQString positionToString(double pos) const = 0; virtual double viewFrom() const = 0; virtual double viewWidth() const = 0; virtual double maximalZoom() const = 0; // Methods to get information on the data we have seen - virtual Q_INT32 count() = 0; - virtual Q_INT32 getBinAt(Q_INT32 channel, Q_INT32 position) = 0; - virtual Q_INT32 outOfViewLeft(Q_INT32 channel) = 0; - virtual Q_INT32 outOfViewRight(Q_INT32 channel) = 0; + virtual TQ_INT32 count() = 0; + virtual TQ_INT32 getBinAt(TQ_INT32 channel, TQ_INT32 position) = 0; + virtual TQ_INT32 outOfViewLeft(TQ_INT32 channel) = 0; + virtual TQ_INT32 outOfViewRight(TQ_INT32 channel) = 0; protected: bool m_skipTransparent; bool m_skipUnselected; diff --git a/krita/kritacolor/kis_profile.cc b/krita/kritacolor/kis_profile.cc index 83880398..b59eeadb 100644 --- a/krita/kritacolor/kis_profile.cc +++ b/krita/kritacolor/kis_profile.cc @@ -24,9 +24,9 @@ #include <config.h> #include LCMS_HEADER -#include <qimage.h> -#include <qtextstream.h> -#include <qfile.h> +#include <tqimage.h> +#include <tqtextstream.h> +#include <tqfile.h> #include <kdebug.h> @@ -39,9 +39,9 @@ #include <X11/Xatom.h> #include <fixx11h.h> -KisProfile::KisProfile(QByteArray rawData) +KisProfile::KisProfile(TQByteArray rawData) : m_rawData(rawData), - m_filename( QString() ), + m_filename( TQString() ), m_valid( false ), m_suitableForOutput(false) { @@ -49,7 +49,7 @@ KisProfile::KisProfile(QByteArray rawData) init(); } -KisProfile::KisProfile(const QString& file) +KisProfile::KisProfile(const TQString& file) : m_filename(file), m_valid( false ), m_suitableForOutput( false ) @@ -58,7 +58,7 @@ KisProfile::KisProfile(const QString& file) KisProfile::KisProfile(const cmsHPROFILE profile) : m_profile(profile), - m_filename( QString() ), + m_filename( TQString() ), m_valid( true ) { size_t bytesNeeded=0; @@ -86,7 +86,7 @@ KisProfile::~KisProfile() bool KisProfile::load() { - QFile file(m_filename); + TQFile file(m_filename); file.open(IO_ReadOnly); m_rawData = file.readAll(); m_profile = cmsOpenProfileFromMem(m_rawData.data(), (DWORD)m_rawData.size()); @@ -140,7 +140,7 @@ cmsHPROFILE KisProfile::profile() { #if 0 if (m_profile = 0) { - QFile file(m_filename); + TQFile file(m_filename); file.open(IO_ReadOnly); m_rawData = file.readAll(); m_profile = cmsOpenProfileFromMem(m_rawData.data(), (DWORD)m_rawData.size()); @@ -168,13 +168,13 @@ KisAnnotationSP KisProfile::annotation() const KisProfile * KisProfile::getScreenProfile (int screen) { -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 Atom type; int format; unsigned long nitems; unsigned long bytes_after; - Q_UINT8 * str; + TQ_UINT8 * str; static Atom icc_atom = XInternAtom( qt_xdisplay(), "_ICC_PROFILE", False ); @@ -192,8 +192,8 @@ KisProfile * KisProfile::getScreenProfile (int screen) (unsigned char **) &str) ) { - QByteArray bytes (nitems); - bytes.assign((char*)str, (Q_UINT32)nitems); + TQByteArray bytes (nitems); + bytes.assign((char*)str, (TQ_UINT32)nitems); return new KisProfile(bytes); } else { diff --git a/krita/kritacolor/kis_profile.h b/krita/kritacolor/kis_profile.h index 075b8060..5f732188 100644 --- a/krita/kritacolor/kis_profile.h +++ b/krita/kritacolor/kis_profile.h @@ -26,8 +26,8 @@ #include LCMS_HEADER -#include <qvaluevector.h> -#include <qcstring.h> +#include <tqvaluevector.h> +#include <tqcstring.h> #include <kio/job.h> @@ -39,8 +39,8 @@ class KisProfile { public: - KisProfile(QByteArray rawData); - KisProfile(const QString& file); + KisProfile(TQByteArray rawData); + KisProfile(const TQString& file); KisProfile(const cmsHPROFILE profile); virtual ~KisProfile(); @@ -50,10 +50,10 @@ public: inline icColorSpaceSignature colorSpaceSignature() const { return m_colorSpaceSignature; } inline icProfileClassSignature deviceClass() const { return m_deviceClass; } - inline QString productName() const { return m_productName; } - inline QString productDescription() const { return m_productDescription; } - inline QString productInfo() const { return m_productInfo; } - inline QString manufacturer() const { return m_manufacturer; } + inline TQString productName() const { return m_productName; } + inline TQString productDescription() const { return m_productDescription; } + inline TQString productInfo() const { return m_productInfo; } + inline TQString manufacturer() const { return m_manufacturer; } cmsHPROFILE profile(); KisAnnotationSP annotation() const; @@ -64,7 +64,7 @@ public: inline bool isSuitableForOutput() { return m_suitableForOutput; }; - inline QString filename() const { return m_filename; } + inline TQString filename() const { return m_filename; } public: @@ -76,14 +76,14 @@ private: cmsHPROFILE m_profile; icColorSpaceSignature m_colorSpaceSignature; icProfileClassSignature m_deviceClass; - QString m_productName; - QString m_productDescription; - QString m_productInfo; - QString m_manufacturer; + TQString m_productName; + TQString m_productDescription; + TQString m_productInfo; + TQString m_manufacturer; - QByteArray m_rawData; + TQByteArray m_rawData; - QString m_filename; + TQString m_filename; bool m_valid; bool m_suitableForOutput; diff --git a/krita/kritacolor/kis_u16_base_colorspace.cc b/krita/kritacolor/kis_u16_base_colorspace.cc index 45d72d0c..a735e35c 100644 --- a/krita/kritacolor/kis_u16_base_colorspace.cc +++ b/krita/kritacolor/kis_u16_base_colorspace.cc @@ -23,26 +23,26 @@ #include "kis_u16_base_colorspace.h" -Q_UINT8 KisU16BaseColorSpace::getAlpha(const Q_UINT8 * U8_pixel) const +TQ_UINT8 KisU16BaseColorSpace::getAlpha(const TQ_UINT8 * U8_pixel) const { if (m_alphaPos < 0) return OPACITY_OPAQUE; U8_pixel+= m_alphaPos; - const Q_UINT16 *pixel = reinterpret_cast<const Q_UINT16 *>(U8_pixel); + const TQ_UINT16 *pixel = reinterpret_cast<const TQ_UINT16 *>(U8_pixel); return UINT16_TO_UINT8(*pixel); } -void KisU16BaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT32 nPixels) const +void KisU16BaseColorSpace::setAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 alpha, TQ_INT32 nPixels) const { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels > 0) { - Q_UINT16 *pixel = reinterpret_cast<Q_UINT16 *>(U8_pixel + m_alphaPos); + TQ_UINT16 *pixel = reinterpret_cast<TQ_UINT16 *>(U8_pixel + m_alphaPos); pixel[0] = UINT8_TO_UINT16(alpha); --nPixels; @@ -50,16 +50,16 @@ void KisU16BaseColorSpace::setAlpha(Q_UINT8 *U8_pixel, Q_UINT8 alpha, Q_INT32 nP } } -void KisU16BaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha, Q_INT32 nPixels) +void KisU16BaseColorSpace::multiplyAlpha(TQ_UINT8 *U8_pixel, TQ_UINT8 U8_alpha, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); - Q_UINT16 alpha = UINT8_TO_UINT16(U8_alpha); + TQ_INT32 psize = pixelSize(); + TQ_UINT16 alpha = UINT8_TO_UINT16(U8_alpha); while (nPixels > 0) { - Q_UINT16 *pixelAlpha = reinterpret_cast<Q_UINT16 *>(U8_pixel + m_alphaPos); + TQ_UINT16 *pixelAlpha = reinterpret_cast<TQ_UINT16 *>(U8_pixel + m_alphaPos); *pixelAlpha = UINT16_MULT(*pixelAlpha, alpha); --nPixels; @@ -67,18 +67,18 @@ void KisU16BaseColorSpace::multiplyAlpha(Q_UINT8 *U8_pixel, Q_UINT8 U8_alpha, Q_ } } -void KisU16BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisU16BaseColorSpace::applyAlphaU8Mask(TQ_UINT8 * U8_pixel, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { // Go to the alpha position (which is given in bytes from the start of the pixel, // and cast to short. - Q_UINT16 *pixelAlpha = reinterpret_cast<Q_UINT16 *>(U8_pixel + m_alphaPos); + TQ_UINT16 *pixelAlpha = reinterpret_cast<TQ_UINT16 *>(U8_pixel + m_alphaPos); *pixelAlpha = UINT8_MULT(*pixelAlpha, *alpha8); ++alpha8; @@ -87,20 +87,20 @@ void KisU16BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * U8_pixel, Q_UINT8 * alpha8 } } -void KisU16BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UINT8 * alpha8, Q_INT32 nPixels) +void KisU16BaseColorSpace::applyInverseAlphaU8Mask(TQ_UINT8 * U8_pixels, TQ_UINT8 * alpha8, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while(nPixels--) { - Q_UINT16 s_alpha8; - Q_UINT32 p_alpha, s_alpha16; + TQ_UINT16 s_alpha8; + TQ_UINT32 p_alpha, s_alpha16; - Q_UINT16 *alpha = reinterpret_cast<Q_UINT16 *>(U8_pixels + m_alphaPos); + TQ_UINT16 *alpha = reinterpret_cast<TQ_UINT16 *>(U8_pixels + m_alphaPos); p_alpha = *(alpha); s_alpha8 = MAX_SELECTED - *alpha8; @@ -116,33 +116,33 @@ void KisU16BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * U8_pixels, Q_UINT8 } } -QString KisU16BaseColorSpace::channelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisU16BaseColorSpace::channelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); - const Q_UINT16 *pixel = reinterpret_cast<const Q_UINT16 *>(U8_pixel); - Q_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(Q_UINT16); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); + const TQ_UINT16 *pixel = reinterpret_cast<const TQ_UINT16 *>(U8_pixel); + TQ_UINT32 channelPosition = channels()[channelIndex]->pos() / sizeof(TQ_UINT16); - return QString().setNum(pixel[channelPosition]); + return TQString().setNum(pixel[channelPosition]); } -QString KisU16BaseColorSpace::normalisedChannelValueText(const Q_UINT8 *U8_pixel, Q_UINT32 channelIndex) const +TQString KisU16BaseColorSpace::normalisedChannelValueText(const TQ_UINT8 *U8_pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); - const Q_UINT16 *pixel = reinterpret_cast<const Q_UINT16 *>(U8_pixel); - Q_UINT32 channelPosition = m_channels[channelIndex]->pos() / sizeof(Q_UINT16); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); + const TQ_UINT16 *pixel = reinterpret_cast<const TQ_UINT16 *>(U8_pixel); + TQ_UINT32 channelPosition = m_channels[channelIndex]->pos() / sizeof(TQ_UINT16); - return QString().setNum(100.0 * static_cast<float>(pixel[channelPosition]) / UINT16_MAX); + return TQString().setNum(100.0 * static_cast<float>(pixel[channelPosition]) / UINT16_MAX); } -Q_UINT8 KisU16BaseColorSpace::scaleToU8(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT8 KisU16BaseColorSpace::scaleToU8(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { - const Q_UINT16 *pixel = reinterpret_cast<const Q_UINT16 *>(U8_pixel); + const TQ_UINT16 *pixel = reinterpret_cast<const TQ_UINT16 *>(U8_pixel); return UINT16_TO_UINT8(pixel[channelPos]); } -Q_UINT16 KisU16BaseColorSpace::scaleToU16(const Q_UINT8 * U8_pixel, Q_INT32 channelPos) +TQ_UINT16 KisU16BaseColorSpace::scaleToU16(const TQ_UINT8 * U8_pixel, TQ_INT32 channelPos) { - const Q_UINT16 *pixel = reinterpret_cast<const Q_UINT16 *>(U8_pixel); + const TQ_UINT16 *pixel = reinterpret_cast<const TQ_UINT16 *>(U8_pixel); return pixel[channelPos]; } diff --git a/krita/kritacolor/kis_u16_base_colorspace.h b/krita/kritacolor/kis_u16_base_colorspace.h index aedd5a2e..756ab9b5 100644 --- a/krita/kritacolor/kis_u16_base_colorspace.h +++ b/krita/kritacolor/kis_u16_base_colorspace.h @@ -31,48 +31,48 @@ class KisU16BaseColorSpace : public KisAbstractColorSpace { public: - static const Q_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX; - static const Q_UINT16 U16_OPACITY_TRANSPARENT = UINT16_MIN; + static const TQ_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX; + static const TQ_UINT16 U16_OPACITY_TRANSPARENT = UINT16_MIN; public: KisU16BaseColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, - KisColorSpaceFactoryRegistry * parent, + KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) : KisAbstractColorSpace(id, cmType, colorSpaceSignature, - parent, + tqparent, p) { - m_alphaSize = sizeof(Q_UINT16); + m_alphaSize = sizeof(TQ_UINT16); }; - virtual Q_UINT8 getAlpha(const Q_UINT8 * pixel) const; - virtual void setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const; - virtual void multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels); + virtual TQ_UINT8 getAlpha(const TQ_UINT8 * pixel) const; + virtual void setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const; + virtual void multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels); - virtual void applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); - virtual void applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); + virtual void applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); + virtual void applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos); - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos); + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); protected: // For Alpha Composite struct U16Mult { - inline Q_UINT16 operator()(const Q_UINT16& a, const Q_UINT16& b) const { + inline TQ_UINT16 operator()(const TQ_UINT16& a, const TQ_UINT16& b) const { return UINT16_MULT(a, b); } }; struct Uint8ToU16 { - inline Q_UINT16 operator()(const Q_UINT8 src) const { + inline TQ_UINT16 operator()(const TQ_UINT8 src) const { return UINT8_TO_UINT16(src); } }; struct U16OpacityTest { - inline bool operator()(const Q_UINT16& opacity) const { + inline bool operator()(const TQ_UINT16& opacity) const { return opacity != U16_OPACITY_TRANSPARENT; } }; diff --git a/krita/kritacolor/kis_u8_base_colorspace.cc b/krita/kritacolor/kis_u8_base_colorspace.cc index ec0003fc..338d95d6 100644 --- a/krita/kritacolor/kis_u8_base_colorspace.cc +++ b/krita/kritacolor/kis_u8_base_colorspace.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qcolor.h> +#include <tqcolor.h> #include <kdebug.h> @@ -24,17 +24,17 @@ #include "kis_u8_base_colorspace.h" #include "kis_integer_maths.h" -Q_UINT8 KisU8BaseColorSpace::getAlpha(const Q_UINT8 * pixel) const +TQ_UINT8 KisU8BaseColorSpace::getAlpha(const TQ_UINT8 * pixel) const { return pixel[m_alphaPos]; } -void KisU8BaseColorSpace::setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const +void KisU8BaseColorSpace::setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); pixels += m_alphaPos; while (nPixels > 0) { @@ -45,10 +45,10 @@ void KisU8BaseColorSpace::setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPix } -void KisU8BaseColorSpace::multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) +void KisU8BaseColorSpace::multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) { if (m_alphaPos < 0) return; - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels > 0) { pixels[m_alphaPos] = UINT8_MULT(pixels[m_alphaPos], alpha); @@ -57,9 +57,9 @@ void KisU8BaseColorSpace::multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 } } -void KisU8BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels) +void KisU8BaseColorSpace::applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels) { - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while (nPixels--) { @@ -71,13 +71,13 @@ void KisU8BaseColorSpace::applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_ } } -void KisU8BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels) +void KisU8BaseColorSpace::applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels) { - Q_INT32 psize = pixelSize(); + TQ_INT32 psize = pixelSize(); while(nPixels--) { - Q_UINT16 p_alpha, s_alpha; + TQ_UINT16 p_alpha, s_alpha; p_alpha = getAlpha(pixels); s_alpha = MAX_SELECTED - *alpha; @@ -89,29 +89,29 @@ void KisU8BaseColorSpace::applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * al } } -QString KisU8BaseColorSpace::channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const +TQString KisU8BaseColorSpace::channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); - Q_UINT32 channelPosition = m_channels[channelIndex]->pos(); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); + TQ_UINT32 channelPosition = m_channels[channelIndex]->pos(); - return QString().setNum(pixel[channelPosition]); + return TQString().setNum(pixel[channelPosition]); } -QString KisU8BaseColorSpace::normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const +TQString KisU8BaseColorSpace::normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const { - Q_ASSERT(channelIndex < (Q_UINT32)nChannels()); - Q_UINT32 channelPosition = m_channels[channelIndex]->pos(); + Q_ASSERT(channelIndex < (TQ_UINT32)nChannels()); + TQ_UINT32 channelPosition = m_channels[channelIndex]->pos(); - return QString().setNum(100.0 * static_cast<float>(pixel[channelPosition]) / UINT8_MAX); + return TQString().setNum(100.0 * static_cast<float>(pixel[channelPosition]) / UINT8_MAX); } -Q_UINT8 KisU8BaseColorSpace::scaleToU8(const Q_UINT8 * pixel, Q_INT32 channelPos) +TQ_UINT8 KisU8BaseColorSpace::scaleToU8(const TQ_UINT8 * pixel, TQ_INT32 channelPos) { return pixel[channelPos]; } -Q_UINT16 KisU8BaseColorSpace::scaleToU16(const Q_UINT8 * pixel, Q_INT32 channelPos) +TQ_UINT16 KisU8BaseColorSpace::scaleToU16(const TQ_UINT8 * pixel, TQ_INT32 channelPos) { return UINT8_TO_UINT16(pixel[channelPos]); } diff --git a/krita/kritacolor/kis_u8_base_colorspace.h b/krita/kritacolor/kis_u8_base_colorspace.h index fc830e99..098a1f59 100644 --- a/krita/kritacolor/kis_u8_base_colorspace.h +++ b/krita/kritacolor/kis_u8_base_colorspace.h @@ -18,9 +18,9 @@ #ifndef KIS_U8_BASE_COLORSPACE_H_ #define KIS_U8_BASE_COLORSPACE_H_ -#include <qcolor.h> +#include <tqcolor.h> -#include <qcolor.h> +#include <tqcolor.h> #include "kis_global.h" #include "kis_abstract_colorspace.h" @@ -34,40 +34,40 @@ class KisU8BaseColorSpace : public KisAbstractColorSpace { public: KisU8BaseColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, - KisColorSpaceFactoryRegistry * parent, + KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) - : KisAbstractColorSpace(id, cmType, colorSpaceSignature, parent, p) + : KisAbstractColorSpace(id, cmType, colorSpaceSignature, tqparent, p) { - m_alphaSize = sizeof(Q_UINT8); + m_alphaSize = sizeof(TQ_UINT8); }; - virtual Q_UINT8 getAlpha(const Q_UINT8 * pixel) const; - virtual void setAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels) const; - virtual void multiplyAlpha(Q_UINT8 * pixels, Q_UINT8 alpha, Q_INT32 nPixels); + virtual TQ_UINT8 getAlpha(const TQ_UINT8 * pixel) const; + virtual void setAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const; + virtual void multiplyAlpha(TQ_UINT8 * pixels, TQ_UINT8 alpha, TQ_INT32 nPixels); - virtual void applyAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); - virtual void applyInverseAlphaU8Mask(Q_UINT8 * pixels, Q_UINT8 * alpha, Q_INT32 nPixels); + virtual void applyAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); + virtual void applyInverseAlphaU8Mask(TQ_UINT8 * pixels, TQ_UINT8 * alpha, TQ_INT32 nPixels); - virtual QString channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; - virtual QString normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const; + virtual TQString channelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; + virtual TQString normalisedChannelValueText(const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const; - virtual Q_UINT8 scaleToU8(const Q_UINT8 * srcPixel, Q_INT32 channelPos); - virtual Q_UINT16 scaleToU16(const Q_UINT8 * srcPixel, Q_INT32 channelPos); + virtual TQ_UINT8 scaleToU8(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); + virtual TQ_UINT16 scaleToU16(const TQ_UINT8 * srcPixel, TQ_INT32 channelPos); protected: // For Alpha Composite struct U8Mult { - inline Q_UINT8 operator()(const Q_UINT8& a, const Q_UINT8& b) const { + inline TQ_UINT8 operator()(const TQ_UINT8& a, const TQ_UINT8& b) const { return UINT8_MULT(a, b); } }; struct Uint8ToU8 { - inline Q_UINT8 operator()(const Q_UINT8 src) const { + inline TQ_UINT8 operator()(const TQ_UINT8 src) const { return src; } }; struct U8OpacityTest { - inline bool operator()(const Q_UINT8& opacity) const { + inline bool operator()(const TQ_UINT8& opacity) const { return opacity != OPACITY_TRANSPARENT; } }; diff --git a/krita/kritacolor/tests/kis_color_conversions_tester.h b/krita/kritacolor/tests/kis_color_conversions_tester.h index f21eca59..1223abbb 100644 --- a/krita/kritacolor/tests/kis_color_conversions_tester.h +++ b/krita/kritacolor/tests/kis_color_conversions_tester.h @@ -24,11 +24,11 @@ #define CHECK_TOLERANCE( x, y, tolerance ) \ if ((x) <= (y) + (tolerance) && (x) >= (y) - (tolerance)) \ { \ - success(QString(__FILE__) + "[" + QString::number(__LINE__) + "]: passed " + #x); \ + success(TQString(__FILE__) + "[" + TQString::number(__LINE__) + "]: passed " + #x); \ } \ else \ { \ - failure(QString(__FILE__) + "[" + QString::number(__LINE__) + QString("]: failed ") + #x + "\n Expected " + #y + ", Actual result " + QString::number(x)); \ + failure(TQString(__FILE__) + "[" + TQString::number(__LINE__) + TQString("]: failed ") + #x + "\n Expected " + #y + ", Actual result " + TQString::number(x)); \ } \ |