summaryrefslogtreecommitdiffstats
path: root/krita/core/kis_gradient.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/core/kis_gradient.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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/core/kis_gradient.cc')
-rw-r--r--krita/core/kis_gradient.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/krita/core/kis_gradient.cc b/krita/core/kis_gradient.cc
index 33714461..efc370bb 100644
--- a/krita/core/kis_gradient.cc
+++ b/krita/core/kis_gradient.cc
@@ -25,9 +25,9 @@
#include <cfloat>
#include <cmath>
-#include <qimage.h>
-#include <qtextstream.h>
-#include <qfile.h>
+#include <tqimage.h>
+#include <tqtextstream.h>
+#include <tqfile.h>
#include <koColor.h>
#include <kogradientmanager.h>
@@ -50,7 +50,7 @@ KisGradientSegment::SineInterpolationStrategy *KisGradientSegment::SineInterpola
KisGradientSegment::SphereIncreasingInterpolationStrategy *KisGradientSegment::SphereIncreasingInterpolationStrategy::m_instance = 0;
KisGradientSegment::SphereDecreasingInterpolationStrategy *KisGradientSegment::SphereDecreasingInterpolationStrategy::m_instance = 0;
-KisGradient::KisGradient(const QString& file) : super(file)
+KisGradient::KisGradient(const TQString& file) : super(file)
{
}
@@ -72,7 +72,7 @@ bool KisGradient::save()
return false;
}
-QImage KisGradient::img()
+TQImage KisGradient::img()
{
return m_img;
}
@@ -132,7 +132,7 @@ bool KisGradient::init()
}
}
-void KisGradient::setImage(const QImage& img)
+void KisGradient::setImage(const TQImage& img)
{
m_img = img;
m_img.detach();
@@ -145,7 +145,7 @@ KisGradientSegment *KisGradient::segmentAt(double t) const
Q_ASSERT(t >= 0 || t <= 1);
Q_ASSERT(!m_segments.empty());
- for(QValueVector<KisGradientSegment *>::const_iterator it = m_segments.begin(); it!= m_segments.end(); ++it)
+ for(TQValueVector<KisGradientSegment *>::const_iterator it = m_segments.begin(); it!= m_segments.end(); ++it)
{
if (t > (*it)->startOffset() - DBL_EPSILON && t < (*it)->endOffset() + DBL_EPSILON) {
return *it;
@@ -155,7 +155,7 @@ KisGradientSegment *KisGradient::segmentAt(double t) const
return 0;
}
-void KisGradient::colorAt(double t, QColor *color, Q_UINT8 *opacity) const
+void KisGradient::colorAt(double t, TQColor *color, TQ_UINT8 *opacity) const
{
const KisGradientSegment *segment = segmentAt(t);
Q_ASSERT(segment != 0);
@@ -163,13 +163,13 @@ void KisGradient::colorAt(double t, QColor *color, Q_UINT8 *opacity) const
if (segment) {
Color col = segment->colorAt(t);
*color = col.color();
- *opacity = static_cast<Q_UINT8>(col.alpha() * OPACITY_OPAQUE + 0.5);
+ *opacity = static_cast<TQ_UINT8>(col.alpha() * OPACITY_OPAQUE + 0.5);
}
}
-QImage KisGradient::generatePreview(int width, int height) const
+TQImage KisGradient::generatePreview(int width, int height) const
{
- QImage img(width, height, 32);
+ TQImage img(width, height, 32);
for (int y = 0; y < img.height(); y++) {
for (int x = 0; x < img.width(); x++) {
@@ -178,8 +178,8 @@ QImage KisGradient::generatePreview(int width, int height) const
int backgroundGreen = backgroundRed;
int backgroundBlue = backgroundRed;
- QColor color;
- Q_UINT8 opacity;
+ TQColor color;
+ TQ_UINT8 opacity;
double t = static_cast<double>(x) / (img.width() - 1);
colorAt(t, &color, &opacity);
@@ -190,7 +190,7 @@ QImage KisGradient::generatePreview(int width, int height) const
int green = static_cast<int>((1 - alpha) * backgroundGreen + alpha * color.green() + 0.5);
int blue = static_cast<int>((1 - alpha) * backgroundBlue + alpha * color.blue() + 0.5);
- img.setPixel(x, y, qRgb(red, green, blue));
+ img.setPixel(x, y, tqRgb(red, green, blue));
}
}
@@ -435,7 +435,7 @@ Color KisGradientSegment::RGBColorInterpolationStrategy::colorAt(double t, Color
int blue = static_cast<int>(startBlue + t * (end.color().blue() - startBlue) + 0.5);
double alpha = startAlpha + t * (end.alpha() - startAlpha);
- return Color(QColor(red, green, blue), alpha);
+ return Color(TQColor(red, green, blue), alpha);
}
KisGradientSegment::HSVCWColorInterpolationStrategy *KisGradientSegment::HSVCWColorInterpolationStrategy::instance()