diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/colorspaces/ycbcr_u8 | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/colorspaces/ycbcr_u8')
-rw-r--r-- | krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.cc | 148 | ||||
-rw-r--r-- | krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.h | 102 | ||||
-rw-r--r-- | krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.cc | 8 | ||||
-rw-r--r-- | krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.h | 3 |
4 files changed, 131 insertions, 130 deletions
diff --git a/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.cc b/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.cc index 7c6707c5..9c7548bf 100644 --- a/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.cc +++ b/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.cc @@ -19,22 +19,22 @@ #include "kis_ycbcr_u8_colorspace.h" -#include <qimage.h> +#include <tqimage.h> #include <kis_integer_maths.h> -const Q_INT32 MAX_CHANNEL_YCbCr = 3; -const Q_INT32 MAX_CHANNEL_YCbCrA = 4; +const TQ_INT32 MAX_CHANNEL_YCbCr = 3; +const TQ_INT32 MAX_CHANNEL_YCbCrA = 4; -KisYCbCrU8ColorSpace::KisYCbCrU8ColorSpace(KisColorSpaceFactoryRegistry* parent, KisProfile* /*p*/) - : KisU8BaseColorSpace(KisID("YCbCrAU8", i18n("YCbCr (8-bit integer/channel)")), TYPE_YCbCr_8, icSigYCbCrData, parent, 0) +KisYCbCrU8ColorSpace::KisYCbCrU8ColorSpace(KisColorSpaceFactoryRegistry* tqparent, KisProfile* /*p*/) + : KisU8BaseColorSpace(KisID("YCbCrAU8", i18n("YCbCr (8-bit integer/channel)")), TYPE_YCbCr_8, icSigYCbCrData, tqparent, 0) { - m_channels.push_back(new KisChannelInfo(i18n("Y"), "Y", PIXEL_Y * sizeof(Q_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(Q_UINT8))); - m_channels.push_back(new KisChannelInfo(i18n("Cb"), "Cb", PIXEL_Cb * sizeof(Q_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(Q_UINT8))); - m_channels.push_back(new KisChannelInfo(i18n("Cr"), "Cr", PIXEL_Cr * sizeof(Q_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(Q_UINT8))); - m_channels.push_back(new KisChannelInfo(i18n("Alpha"), "A", PIXEL_ALPHA * sizeof(Q_UINT8), KisChannelInfo::ALPHA, KisChannelInfo::UINT8, sizeof(Q_UINT8))); + m_channels.push_back(new KisChannelInfo(i18n("Y"), "Y", PIXEL_Y * sizeof(TQ_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(TQ_UINT8))); + m_channels.push_back(new KisChannelInfo(i18n("Cb"), "Cb", PIXEL_Cb * sizeof(TQ_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(TQ_UINT8))); + m_channels.push_back(new KisChannelInfo(i18n("Cr"), "Cr", PIXEL_Cr * sizeof(TQ_UINT8), KisChannelInfo::COLOR, KisChannelInfo::UINT8, sizeof(TQ_UINT8))); + m_channels.push_back(new KisChannelInfo(i18n("Alpha"), "A", PIXEL_ALPHA * sizeof(TQ_UINT8), KisChannelInfo::ALPHA, KisChannelInfo::UINT8, sizeof(TQ_UINT8))); - m_alphaPos = PIXEL_ALPHA * sizeof(Q_UINT8); + m_alphaPos = PIXEL_ALPHA * sizeof(TQ_UINT8); KisAbstractColorSpace::init(); } @@ -43,7 +43,7 @@ KisYCbCrU8ColorSpace::~KisYCbCrU8ColorSpace() { } -void KisYCbCrU8ColorSpace::setPixel(Q_UINT8 *dst, Q_UINT8 Y, Q_UINT8 Cb, Q_UINT8 Cr, Q_UINT8 alpha) const +void KisYCbCrU8ColorSpace::setPixel(TQ_UINT8 *dst, TQ_UINT8 Y, TQ_UINT8 Cb, TQ_UINT8 Cr, TQ_UINT8 alpha) const { Pixel *dstPixel = reinterpret_cast<Pixel *>(dst); @@ -53,7 +53,7 @@ void KisYCbCrU8ColorSpace::setPixel(Q_UINT8 *dst, Q_UINT8 Y, Q_UINT8 Cb, Q_UINT8 dstPixel->alpha = alpha; } -void KisYCbCrU8ColorSpace::getPixel(const Q_UINT8 *src, Q_UINT8 *Y, Q_UINT8 *Cb, Q_UINT8 *Cr, Q_UINT8 *alpha) const +void KisYCbCrU8ColorSpace::getPixel(const TQ_UINT8 *src, TQ_UINT8 *Y, TQ_UINT8 *Cb, TQ_UINT8 *Cr, TQ_UINT8 *alpha) const { const Pixel *srcPixel = reinterpret_cast<const Pixel *>(src); @@ -64,11 +64,11 @@ void KisYCbCrU8ColorSpace::getPixel(const Q_UINT8 *src, Q_UINT8 *Y, Q_UINT8 *Cb, } -void KisYCbCrU8ColorSpace::fromQColor(const QColor& c, Q_UINT8 *dstU8, KisProfile * profile ) +void KisYCbCrU8ColorSpace::fromTQColor(const TQColor& c, TQ_UINT8 *dstU8, KisProfile * profile ) { if(getProfile()) { - KisU8BaseColorSpace::fromQColor(c, dstU8, profile); + KisU8BaseColorSpace::fromTQColor(c, dstU8, profile); } else { Pixel *dst = reinterpret_cast<Pixel *>(dstU8); dst->Y = computeY( c.red(), c.green(), c.blue()); @@ -77,11 +77,11 @@ void KisYCbCrU8ColorSpace::fromQColor(const QColor& c, Q_UINT8 *dstU8, KisProfil } } -void KisYCbCrU8ColorSpace::fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dstU8, KisProfile * profile ) +void KisYCbCrU8ColorSpace::fromTQColor(const TQColor& c, TQ_UINT8 opacity, TQ_UINT8 *dstU8, KisProfile * profile ) { if(getProfile()) { - KisU8BaseColorSpace::fromQColor(c, opacity, dstU8, profile); + KisU8BaseColorSpace::fromTQColor(c, opacity, dstU8, profile); } else { Pixel *dst = reinterpret_cast<Pixel *>(dstU8); dst->Y = computeY( c.red(), c.green(), c.blue()); @@ -91,11 +91,11 @@ void KisYCbCrU8ColorSpace::fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 } } -void KisYCbCrU8ColorSpace::toQColor(const Q_UINT8 *srcU8, QColor *c, KisProfile * profile) +void KisYCbCrU8ColorSpace::toTQColor(const TQ_UINT8 *srcU8, TQColor *c, KisProfile * profile) { if(getProfile()) { - KisU8BaseColorSpace::toQColor(srcU8, c, profile); + KisU8BaseColorSpace::toTQColor(srcU8, c, profile); } else { const Pixel *src = reinterpret_cast<const Pixel *>(srcU8); @@ -103,11 +103,11 @@ void KisYCbCrU8ColorSpace::toQColor(const Q_UINT8 *srcU8, QColor *c, KisProfile } } -void KisYCbCrU8ColorSpace::toQColor(const Q_UINT8 *srcU8, QColor *c, Q_UINT8 *opacity, KisProfile * profile) +void KisYCbCrU8ColorSpace::toTQColor(const TQ_UINT8 *srcU8, TQColor *c, TQ_UINT8 *opacity, KisProfile * profile) { if(getProfile()) { - KisU8BaseColorSpace::toQColor(srcU8, c, opacity, profile); + KisU8BaseColorSpace::toTQColor(srcU8, c, opacity, profile); } else { const Pixel *src = reinterpret_cast<const Pixel *>(srcU8); c->setRgb(computeRed(src->Y,src->Cb,src->Cr), computeGreen(src->Y,src->Cb,src->Cr), computeBlue(src->Y,src->Cb,src->Cr)); @@ -115,32 +115,32 @@ void KisYCbCrU8ColorSpace::toQColor(const Q_UINT8 *srcU8, QColor *c, Q_UINT8 *op } } -Q_UINT8 KisYCbCrU8ColorSpace::difference(const Q_UINT8 *src1U8, const Q_UINT8 *src2U8) +TQ_UINT8 KisYCbCrU8ColorSpace::difference(const TQ_UINT8 *src1U8, const TQ_UINT8 *src2U8) { if(getProfile()) return KisU8BaseColorSpace::difference(src1U8, src2U8); const Pixel *src1 = reinterpret_cast<const Pixel *>(src1U8); const Pixel *src2 = reinterpret_cast<const Pixel *>(src2U8); - return QMAX(QABS(src2->Y - src1->Y), QMAX(QABS(src2->Cb - src1->Cb), QABS(src2->Cr - src1->Cr))); + return TQMAX(TQABS(src2->Y - src1->Y), TQMAX(TQABS(src2->Cb - src1->Cb), TQABS(src2->Cr - src1->Cr))); } -void KisYCbCrU8ColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const +void KisYCbCrU8ColorSpace::mixColors(const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const { - Q_UINT8 totalY = 0, totalCb = 0, totalCr = 0, newAlpha = 0; + TQ_UINT8 totalY = 0, totalCb = 0, totalCr = 0, newAlpha = 0; while (nColors--) { const Pixel *pixel = reinterpret_cast<const Pixel *>(*colors); - Q_UINT8 alpha = pixel->alpha; + TQ_UINT8 alpha = pixel->alpha; float alphaTimesWeight = alpha * *weights; - totalY += (Q_UINT8)(pixel->Y * alphaTimesWeight); - totalCb += (Q_UINT8)(pixel->Cb * alphaTimesWeight); - totalCr += (Q_UINT8)(pixel->Cr * alphaTimesWeight); - newAlpha += (Q_UINT8)(alphaTimesWeight); + totalY += (TQ_UINT8)(pixel->Y * alphaTimesWeight); + totalCb += (TQ_UINT8)(pixel->Cb * alphaTimesWeight); + totalCr += (TQ_UINT8)(pixel->Cr * alphaTimesWeight); + newAlpha += (TQ_UINT8)(alphaTimesWeight); weights++; colors++; @@ -161,38 +161,38 @@ void KisYCbCrU8ColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weig dstPixel->Cr = totalCr; } -QValueVector<KisChannelInfo *> KisYCbCrU8ColorSpace::channels() const { +TQValueVector<KisChannelInfo *> KisYCbCrU8ColorSpace::channels() const { return m_channels; } -Q_UINT32 KisYCbCrU8ColorSpace::nChannels() const { +TQ_UINT32 KisYCbCrU8ColorSpace::nChannels() const { return MAX_CHANNEL_YCbCrA; } -Q_UINT32 KisYCbCrU8ColorSpace::nColorChannels() const { +TQ_UINT32 KisYCbCrU8ColorSpace::nColorChannels() const { return MAX_CHANNEL_YCbCr; } -Q_UINT32 KisYCbCrU8ColorSpace::pixelSize() const { - return MAX_CHANNEL_YCbCrA*sizeof(Q_UINT8); +TQ_UINT32 KisYCbCrU8ColorSpace::pixelSize() const { + return MAX_CHANNEL_YCbCrA*sizeof(TQ_UINT8); } -QImage KisYCbCrU8ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, KisProfile * dstProfile, Q_INT32 renderingIntent, float exposure ) +TQImage KisYCbCrU8ColorSpace::convertToTQImage(const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, KisProfile * dstProfile, TQ_INT32 renderingIntent, float exposure ) { if(getProfile()) - return KisU8BaseColorSpace::convertToQImage( data, width, height, dstProfile, renderingIntent, exposure); + return KisU8BaseColorSpace::convertToTQImage( data, width, height, dstProfile, renderingIntent, exposure); - QImage img = QImage(width, height, 32, 0, QImage::LittleEndian); + TQImage img = TQImage(width, height, 32, 0, TQImage::LittleEndian); img.setAlphaBuffer(true); - Q_INT32 i = 0; + TQ_INT32 i = 0; uchar *j = img.bits(); while ( i < width * height * MAX_CHANNEL_YCbCrA) { - Q_UINT8 Y = *( data + i + PIXEL_Y ); - Q_UINT8 Cb = *( data + i + PIXEL_Cb ); - Q_UINT8 Cr = *( data + i + PIXEL_Cr ); + TQ_UINT8 Y = *( data + i + PIXEL_Y ); + TQ_UINT8 Cb = *( data + i + PIXEL_Cb ); + TQ_UINT8 Cr = *( data + i + PIXEL_Cr ); *( j + 3) = *( data + i + PIXEL_ALPHA ); *( j + 2 ) = computeRed(Y,Cb,Cr); *( j + 1 ) = computeGreen(Y,Cb,Cr); @@ -204,45 +204,45 @@ QImage KisYCbCrU8ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, } -void KisYCbCrU8ColorSpace::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, const KisCompositeOp& op) +void KisYCbCrU8ColorSpace::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) { switch (op.op()) { case COMPOSITE_UNDEF: // Undefined == no composition break; case COMPOSITE_OVER: - compositeOver(dst, dstRowStride, src, srcRowStride, srcAlphaMask, maskRowStride, rows, cols, opacity); + compositeOver(dst, dstRowStride, src, srcRowStride, srcAlphaMask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_COPY: - compositeCopy(dst, dstRowStride, src, srcRowStride, srcAlphaMask, maskRowStride, rows, cols, opacity); + compositeCopy(dst, dstRowStride, src, srcRowStride, srcAlphaMask, tqmaskRowStride, rows, cols, opacity); break; case COMPOSITE_ERASE: - compositeErase(dst, dstRowStride, src, srcRowStride, srcAlphaMask, maskRowStride, rows, cols, opacity); + compositeErase(dst, dstRowStride, src, srcRowStride, srcAlphaMask, tqmaskRowStride, rows, cols, opacity); break; default: break; } } -void KisYCbCrU8ColorSpace::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_UINT8 opacity) +void KisYCbCrU8ColorSpace::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_UINT8 opacity) { while (rows > 0) { - const Q_UINT8 *src = srcRowStart; - Q_UINT8 *dst = dstRowStart; - const Q_UINT8 *mask = maskRowStart; - Q_INT32 columns = numColumns; + const TQ_UINT8 *src = srcRowStart; + TQ_UINT8 *dst = dstRowStart; + const TQ_UINT8 *tqmask = tqmaskRowStart; + TQ_INT32 columns = numColumns; while (columns > 0) { - Q_UINT8 srcAlpha = src[PIXEL_ALPHA]; + TQ_UINT8 srcAlpha = src[PIXEL_ALPHA]; - // apply the alphamask - if (mask != 0) { - if (*mask != OPACITY_OPAQUE) { - srcAlpha *= *mask; + // apply the alphatqmask + if (tqmask != 0) { + if (*tqmask != OPACITY_OPAQUE) { + srcAlpha *= *tqmask; } - mask++; + tqmask++; } if (srcAlpha > OPACITY_TRANSPARENT) { @@ -252,16 +252,16 @@ void KisYCbCrU8ColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStr } if (srcAlpha == OPACITY_OPAQUE) { - memcpy(dst, src, MAX_CHANNEL_YCbCrA * sizeof(Q_UINT8)); + memcpy(dst, src, MAX_CHANNEL_YCbCrA * sizeof(TQ_UINT8)); } else { - Q_UINT8 dstAlpha = dst[PIXEL_ALPHA]; + TQ_UINT8 dstAlpha = dst[PIXEL_ALPHA]; - Q_UINT8 srcBlend; + TQ_UINT8 srcBlend; if (dstAlpha == OPACITY_OPAQUE ) { srcBlend = srcAlpha; } else { - Q_UINT8 newAlpha = dstAlpha + (OPACITY_OPAQUE - dstAlpha) * srcAlpha; + TQ_UINT8 newAlpha = dstAlpha + (OPACITY_OPAQUE - dstAlpha) * srcAlpha; dst[PIXEL_ALPHA] = newAlpha; if (newAlpha > 0) { @@ -272,7 +272,7 @@ void KisYCbCrU8ColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStr } if (srcBlend == OPACITY_OPAQUE) { - memcpy(dst, src, MAX_CHANNEL_YCbCr * sizeof(Q_UINT8)); + memcpy(dst, src, MAX_CHANNEL_YCbCr * sizeof(TQ_UINT8)); } else { dst[PIXEL_Y] = UINT8_BLEND(src[PIXEL_Y], dst[PIXEL_Y], srcBlend); dst[PIXEL_Cb] = UINT8_BLEND(src[PIXEL_Cb], dst[PIXEL_Cb], srcBlend); @@ -289,30 +289,30 @@ void KisYCbCrU8ColorSpace::compositeOver(Q_UINT8 *dstRowStart, Q_INT32 dstRowStr rows--; srcRowStart += srcRowStride; dstRowStart += dstRowStride; - if(maskRowStart) { - maskRowStart += maskRowStride; + if(tqmaskRowStart) { + tqmaskRowStart += tqmaskRowStride; } } } -void KisYCbCrU8ColorSpace::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_UINT8 /*opacity*/) +void KisYCbCrU8ColorSpace::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_UINT8 /*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_UINT8 srcAlpha = s -> alpha; + TQ_UINT8 srcAlpha = s -> alpha; - // apply the alphamask - if (mask != 0) { - if (*mask != OPACITY_OPAQUE) { - srcAlpha = *mask; + // apply the alphatqmask + if (tqmask != 0) { + if (*tqmask != OPACITY_OPAQUE) { + srcAlpha = *tqmask; } - mask++; + tqmask++; } d -> alpha = srcAlpha * d -> alpha; } @@ -320,12 +320,12 @@ void KisYCbCrU8ColorSpace::compositeErase(Q_UINT8 *dst, Q_INT32 dstRowSize, cons dst += dstRowSize; src += srcRowSize; if(srcAlphaMask) { - srcAlphaMask += maskRowStride; + srcAlphaMask += tqmaskRowStride; } } } -void KisYCbCrU8ColorSpace::compositeCopy(Q_UINT8 *dstRowStart, Q_INT32 dstRowStride, const Q_UINT8 *srcRowStart, Q_INT32 srcRowStride, const Q_UINT8 */*mask*/, Q_INT32 /*maskRowStride*/, Q_INT32 rows, Q_INT32 numColumns, Q_UINT8 /*opacity*/) +void KisYCbCrU8ColorSpace::compositeCopy(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 */*tqmask*/, TQ_INT32 /*tqmaskRowStride*/, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 /*opacity*/) { while (rows > 0) { memcpy(dstRowStart, srcRowStart, numColumns * sizeof(Pixel)); diff --git a/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.h b/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.h index bc4d8329..479a7179 100644 --- a/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.h +++ b/krita/colorspaces/ycbcr_u8/kis_ycbcr_u8_colorspace.h @@ -31,92 +31,92 @@ class KisYCbCrU8ColorSpace : public KisU8BaseColorSpace { public: - KisYCbCrU8ColorSpace(KisColorSpaceFactoryRegistry* parent, KisProfile* p); + KisYCbCrU8ColorSpace(KisColorSpaceFactoryRegistry* tqparent, KisProfile* p); ~KisYCbCrU8ColorSpace(); virtual bool willDegrade(ColorSpaceIndependence ) { return false; }; public: - void setPixel(Q_UINT8 *pixel, Q_UINT8 Y, Q_UINT8 Cb, Q_UINT8 Cr, Q_UINT8 alpha) const; - void getPixel(const Q_UINT8 *pixel, Q_UINT8 *Y, Q_UINT8 *Cb, Q_UINT8 *Cr, Q_UINT8 *alpha) const; + void setPixel(TQ_UINT8 *pixel, TQ_UINT8 Y, TQ_UINT8 Cb, TQ_UINT8 Cr, TQ_UINT8 alpha) const; + void getPixel(const TQ_UINT8 *pixel, TQ_UINT8 *Y, TQ_UINT8 *Cb, TQ_UINT8 *Cr, TQ_UINT8 *alpha) const; - 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 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; - 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 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, + TQ_INT32 renderingIntent, float exposure = 0.0f); 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_UINT8 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_UINT8 opacity); - void compositeCopy(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_UINT8 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_UINT8 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_UINT8 opacity); + void compositeCopy(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_UINT8 opacity); private: -#define CLAMP_TO_8BITCHANNEL(a) CLAMP(a, 0, Q_UINT8_MAX) - inline Q_UINT8 computeRed(Q_UINT8 Y, Q_UINT8 /*Cb*/, Q_UINT8 Cr) +#define CLAMP_TO_8BITCHANNEL(a) CLAMP(a, 0, TQ_UINT8_MAX) + inline TQ_UINT8 computeRed(TQ_UINT8 Y, TQ_UINT8 /*Cb*/, TQ_UINT8 Cr) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( (Cr - 128)* (2-2*LUMA_RED) + Y ) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( (Cr - 128)* (2-2*LUMA_RED) + Y ) ); } - inline Q_UINT8 computeGreen(Q_UINT8 Y, Q_UINT8 Cb, Q_UINT8 Cr) + inline TQ_UINT8 computeGreen(TQ_UINT8 Y, TQ_UINT8 Cb, TQ_UINT8 Cr) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( (Y - LUMA_BLUE * computeBlue(Y,Cb,Cr) - LUMA_RED * computeRed(Y,Cb,Cr) ) / LUMA_GREEN ) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( (Y - LUMA_BLUE * computeBlue(Y,Cb,Cr) - LUMA_RED * computeRed(Y,Cb,Cr) ) / LUMA_GREEN ) ); } - inline Q_UINT8 computeBlue(Q_UINT8 Y, Q_UINT8 Cb, Q_UINT8 /*Cr*/) + inline TQ_UINT8 computeBlue(TQ_UINT8 Y, TQ_UINT8 Cb, TQ_UINT8 /*Cr*/) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( (Cb - 128)*(2 - 2 * LUMA_BLUE) + Y) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( (Cb - 128)*(2 - 2 * LUMA_BLUE) + Y) ); } - inline Q_UINT8 computeY( Q_UINT8 r, Q_UINT8 b, Q_UINT8 g) + inline TQ_UINT8 computeY( TQ_UINT8 r, TQ_UINT8 b, TQ_UINT8 g) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( LUMA_RED*r + LUMA_GREEN*g + LUMA_BLUE*b ) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( LUMA_RED*r + LUMA_GREEN*g + LUMA_BLUE*b ) ); } - inline Q_UINT8 computeCb( Q_UINT8 r, Q_UINT8 b, Q_UINT8 g) + inline TQ_UINT8 computeCb( TQ_UINT8 r, TQ_UINT8 b, TQ_UINT8 g) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( (b - computeY(r,g,b))/(2-2*LUMA_BLUE) + 128) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( (b - computeY(r,g,b))/(2-2*LUMA_BLUE) + 128) ); } - inline Q_UINT8 computeCr( Q_UINT8 r, Q_UINT8 b, Q_UINT8 g) + inline TQ_UINT8 computeCr( TQ_UINT8 r, TQ_UINT8 b, TQ_UINT8 g) { - return (Q_UINT8)( CLAMP_TO_8BITCHANNEL( (r - computeY(r,g,b))/(2-2*LUMA_RED) + 128) ); + return (TQ_UINT8)( CLAMP_TO_8BITCHANNEL( (r - computeY(r,g,b))/(2-2*LUMA_RED) + 128) ); } #undef CLAMP_TO_8BITCHANNEL - static const Q_UINT8 PIXEL_Y = 0; - static const Q_UINT8 PIXEL_Cb = 1; - static const Q_UINT8 PIXEL_Cr = 2; - static const Q_UINT8 PIXEL_ALPHA = 3; + static const TQ_UINT8 PIXEL_Y = 0; + static const TQ_UINT8 PIXEL_Cb = 1; + static const TQ_UINT8 PIXEL_Cr = 2; + static const TQ_UINT8 PIXEL_ALPHA = 3; struct Pixel { - Q_UINT8 Y; - Q_UINT8 Cb; - Q_UINT8 Cr; - Q_UINT8 alpha; + TQ_UINT8 Y; + TQ_UINT8 Cb; + TQ_UINT8 Cr; + TQ_UINT8 alpha; }; }; @@ -132,13 +132,13 @@ class KisYCbCrU8ColorSpaceFactory : public KisColorSpaceFactory /** * lcms colorspace type definition. */ - virtual Q_UINT32 colorSpaceType() { return TYPE_YCbCr_8; }; + virtual TQ_UINT32 colorSpaceType() { return TYPE_YCbCr_8; }; virtual icColorSpaceSignature colorSpaceSignature() { return icSigYCbCrData; }; - virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) { return new KisYCbCrU8ColorSpace(parent, p); }; + virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * tqparent, KisProfile *p) { return new KisYCbCrU8ColorSpace(tqparent, p); }; - virtual QString defaultProfile() { return ""; }; + virtual TQString defaultProfile() { return ""; }; }; #endif diff --git a/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.cc b/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.cc index 751e3f31..471b203e 100644 --- a/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.cc +++ b/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.cc @@ -35,14 +35,14 @@ typedef KGenericFactory<YCbCrU8Plugin> YCbCrU8PluginFactory; K_EXPORT_COMPONENT_FACTORY( krita_ycbcr_u8_plugin, YCbCrU8PluginFactory( "krita" ) ) -YCbCrU8Plugin::YCbCrU8Plugin(QObject *parent, const char *name, const QStringList &) - : KParts::Plugin(parent, name) +YCbCrU8Plugin::YCbCrU8Plugin(TQObject *tqparent, const char *name, const TQStringList &) + : KParts::Plugin(tqparent, name) { setInstance(YCbCrU8PluginFactory::instance()); - if ( parent->inherits("KisColorSpaceFactoryRegistry") ) + if ( tqparent->inherits("KisColorSpaceFactoryRegistry") ) { - KisColorSpaceFactoryRegistry * f = dynamic_cast<KisColorSpaceFactoryRegistry*>( parent ); + KisColorSpaceFactoryRegistry * f = dynamic_cast<KisColorSpaceFactoryRegistry*>( tqparent ); KisColorSpace * colorSpaceYCbCrU8 = new KisYCbCrU8ColorSpace(f, 0); KisColorSpaceFactory * csf = new KisYCbCrU8ColorSpaceFactory(); diff --git a/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.h b/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.h index ef418784..98274614 100644 --- a/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.h +++ b/krita/colorspaces/ycbcr_u8/ycbcr_u8_plugin.h @@ -27,8 +27,9 @@ class YCbCrU8Plugin : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: - YCbCrU8Plugin(QObject *parent, const char *name, const QStringList &); + YCbCrU8Plugin(TQObject *tqparent, const char *name, const TQStringList &); virtual ~YCbCrU8Plugin(); }; |