diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
commit | 479f5f799523bffbcc83dff581a2299c047c6fff (patch) | |
tree | 186aae707ed02aac6c7cab2fb14e97f72aca5e36 /kjsembed/plugins/imagefx_plugin.cpp | |
parent | f1dbff6145c98324ff82e34448b7483727e8ace4 (diff) | |
download | tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kjsembed/plugins/imagefx_plugin.cpp')
-rw-r--r-- | kjsembed/plugins/imagefx_plugin.cpp | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/kjsembed/plugins/imagefx_plugin.cpp b/kjsembed/plugins/imagefx_plugin.cpp index 903c7655..ba2181cc 100644 --- a/kjsembed/plugins/imagefx_plugin.cpp +++ b/kjsembed/plugins/imagefx_plugin.cpp @@ -27,8 +27,8 @@ #include <kjsembed/jsfactory_imp.h> #include <kjsembed/kjsembedpart.h> #include <kjsembed/customobject_imp.h> -#include <qvariant.h> -#include <qbrush.h> +#include <tqvariant.h> +#include <tqbrush.h> #include "imagefx_plugin.h" @@ -36,7 +36,7 @@ namespace KJSEmbed { namespace Bindings { -ImageFXLoader::ImageFXLoader( QObject *parent, const char *name, const QStringList &args ) : +ImageFXLoader::ImageFXLoader( TQObject *parent, const char *name, const TQStringList &args ) : JSBindingPlugin(parent, name, args) { } @@ -206,116 +206,116 @@ KJS::Value ImageFX::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li KJS::Value retValue = KJS::Value(); switch ( mid ) { case Methodgradient: { - QSize size = extractQSize(exec, args, 0); - QColor ca = extractQColor(exec, args, 1); - QColor cb = extractQColor(exec, args, 2); + TQSize size = extractQSize(exec, args, 0); + TQColor ca = extractQColor(exec, args, 1); + TQColor cb = extractQColor(exec, args, 2); int type = extractInt( exec, args, 3); int ncols = extractInt( exec, args, 4); - QImage img = KImageEffect::gradient(size, ca, cb, (KImageEffect::GradientType)type, ncols); + TQImage img = KImageEffect::gradient(size, ca, cb, (KImageEffect::GradientType)type, ncols); retValue = convertToValue(exec, img); break; } case MethodunbalancedGradient: { - QSize size = extractQSize(exec, args, 0); - QColor ca = extractQColor(exec, args, 1); - QColor cb = extractQColor(exec, args, 2); + TQSize size = extractQSize(exec, args, 0); + TQColor ca = extractQColor(exec, args, 1); + TQColor cb = extractQColor(exec, args, 2); int type = extractInt( exec, args, 3); int xfactor = extractInt( exec, args, 4); int yfactor = extractInt( exec, args, 5); int ncols = extractInt( exec, args, 6); - QImage img = KImageEffect::unbalancedGradient(size, ca, cb, (KImageEffect::GradientType)type, xfactor, yfactor, ncols); + TQImage img = KImageEffect::unbalancedGradient(size, ca, cb, (KImageEffect::GradientType)type, xfactor, yfactor, ncols); retValue = convertToValue(exec, img); break; } case MethodblendColor: { - QColor clr = extractQColor(exec, args, 0); - QImage dst = extractQImage(exec, args, 1); + TQColor clr = extractQColor(exec, args, 0); + TQImage dst = extractQImage(exec, args, 1); float opacity = (float)extractDouble(exec, args, 2); - QImage img = KImageEffect::blend(clr, dst, opacity); + TQImage img = KImageEffect::blend(clr, dst, opacity); retValue = convertToValue(exec, img); break; } case MethodblendImage: { - QImage src = extractQImage(exec, args, 0); - QImage dst = extractQImage(exec, args, 1); + TQImage src = extractQImage(exec, args, 0); + TQImage dst = extractQImage(exec, args, 1); float opacity = (float)extractDouble(exec, args, 2); - QImage img = KImageEffect::blend(src, dst, opacity); + TQImage img = KImageEffect::blend(src, dst, opacity); retValue = convertToValue(exec, img); break; } case MethodcomputeDestinationRect: { - QSize lowerSize = extractQSize(exec, args, 0); + TQSize lowerSize = extractQSize(exec, args, 0); int disposition = extractInt(exec, args, 1); - QImage upper = extractQImage(exec, args, 2); - QRect rect = KImageEffect::computeDestinationRect(lowerSize, (KImageEffect::Disposition) disposition, upper); + TQImage upper = extractQImage(exec, args, 2); + TQRect rect = KImageEffect::computeDestinationRect(lowerSize, (KImageEffect::Disposition) disposition, upper); retValue = convertToValue(exec, rect); break; } case MethodchannelIntensity: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); float percent = (float)extractDouble(exec, args, 1); int channel = extractInt(exec, args, 2); - QImage img = KImageEffect::channelIntensity(image, percent, (KImageEffect::RGBComponent)channel); + TQImage img = KImageEffect::channelIntensity(image, percent, (KImageEffect::RGBComponent)channel); retValue = convertToValue(exec, img); break; } case Methodfade: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); float val = (float)extractDouble(exec, args, 1); - QColor color = extractQColor(exec, args, 2); - QImage img = KImageEffect::fade(image, val, color); + TQColor color = extractQColor(exec, args, 2); + TQImage img = KImageEffect::fade(image, val, color); retValue = convertToValue(exec, img); break; } case Methodflatten: { - QImage image = extractQImage(exec, args, 0); - QColor ca = extractQColor(exec, args, 1); - QColor cb = extractQColor(exec, args, 2); + TQImage image = extractQImage(exec, args, 0); + TQColor ca = extractQColor(exec, args, 1); + TQColor cb = extractQColor(exec, args, 2); int ncols = extractInt(exec, args, 3); - QImage img = KImageEffect::flatten(image, ca, cb, ncols); + TQImage img = KImageEffect::flatten(image, ca, cb, ncols); retValue = convertToValue(exec, img); break; } case Methodhash: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int lite = extractInt(exec, args, 1); int spacing = extractInt(exec, args, 2); - QImage img = KImageEffect::hash(image, (KImageEffect::Lighting)lite, spacing); + TQImage img = KImageEffect::hash(image, (KImageEffect::Lighting)lite, spacing); retValue = convertToValue(exec, img); break; } case Methodintensity: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); float percent = (float)extractDouble(exec, args, 1); - QImage img = KImageEffect::intensity(image, percent); + TQImage img = KImageEffect::intensity(image, percent); retValue = convertToValue(exec, img); break; } case Methodmodulate: { - QImage image = extractQImage(exec, args, 0); - QImage modImage = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); + TQImage modImage = extractQImage(exec, args, 0); bool reverse = extractBool(exec, args, 1); int type = extractInt(exec, args, 2); int factor = extractInt(exec, args, 3); int channel = extractInt(exec, args, 4); - QImage img = KImageEffect::modulate(image, modImage, reverse, (KImageEffect::ModulationType)type, factor, (KImageEffect::RGBComponent)channel); + TQImage img = KImageEffect::modulate(image, modImage, reverse, (KImageEffect::ModulationType)type, factor, (KImageEffect::RGBComponent)channel); retValue = convertToValue(exec, img); break; } case MethodtoGray: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); bool fast = extractBool(exec, args, 1); - QImage img = KImageEffect::toGray(image, fast); + TQImage img = KImageEffect::toGray(image, fast); retValue = convertToValue(exec, img); break; } case Methoddesaturate: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); float desat = (float)extractDouble(exec, args, 1); - QImage img = KImageEffect::desaturate(image, desat); + TQImage img = KImageEffect::desaturate(image, desat); retValue = convertToValue(exec, img); break; } @@ -326,193 +326,193 @@ KJS::Value ImageFX::call( KJS::ExecState *exec, KJS::Object &self, const KJS::Li } case MethodselectedImage: { - QImage image = extractQImage(exec, args, 0); - QColor col = extractQColor(exec, args, 1); - QImage img = KImageEffect::selectedImage(image, col); + TQImage image = extractQImage(exec, args, 0); + TQColor col = extractQColor(exec, args, 1); + TQImage img = KImageEffect::selectedImage(image, col); retValue = convertToValue(exec, img); break; } case MethodcontrastHSV: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); bool sharpen = extractBool(exec, args, 1); KImageEffect::contrastHSV(image, sharpen); retValue = convertToValue(exec, image); break; } case Methodnormalize: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); KImageEffect::normalize(image); retValue = convertToValue(exec, image); break; } case Methodequalize: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); KImageEffect::equalize(image); retValue = convertToValue(exec, image); break; } case Methodthreshold: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); uint value = extractUInt(exec, args, 1); KImageEffect::threshold(image, value); retValue = convertToValue(exec, image); break; } case Methodsolarize: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); KImageEffect::solarize(image, factor); retValue = convertToValue(exec, image); break; } case Methodemboss: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - QImage img = KImageEffect::emboss(image, radius, sigma); + TQImage img = KImageEffect::emboss(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methoddespeckle: { - QImage image = extractQImage(exec, args, 0); - QImage img = KImageEffect::despeckle(image); + TQImage image = extractQImage(exec, args, 0); + TQImage img = KImageEffect::despeckle(image); retValue = convertToValue(exec, img); break; } case Methodcharcoal: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); - QImage img = KImageEffect::charcoal( image, factor); + TQImage img = KImageEffect::charcoal( image, factor); retValue = convertToValue(exec, img); break; } case Methodcharcoal2: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - QImage img = KImageEffect::charcoal(image, radius, sigma); + TQImage img = KImageEffect::charcoal(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodrotate: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int r = extractInt(exec, args, 1); - QImage img = KImageEffect::rotate(image, (KImageEffect::RotateDirection) r); + TQImage img = KImageEffect::rotate(image, (KImageEffect::RotateDirection) r); retValue = convertToValue(exec, img); break; } case Methodsample: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int width = extractInt(exec, args, 1); int height = extractInt(exec, args, 2); - QImage img = KImageEffect::sample(image, width, height); + TQImage img = KImageEffect::sample(image, width, height); retValue = convertToValue(exec, img); break; } case MethodaddNoise: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int type = extractInt(exec, args, 1); - QImage img = KImageEffect::addNoise(image, (KImageEffect::NoiseType) type); + TQImage img = KImageEffect::addNoise(image, (KImageEffect::NoiseType) type); retValue = convertToValue(exec, img); break; } case Methodblur: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - QImage img = KImageEffect::blur(image, radius, sigma); + TQImage img = KImageEffect::blur(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodedge: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); - QImage img = KImageEffect::edge(image, radius); + TQImage img = KImageEffect::edge(image, radius); retValue = convertToValue(exec, img); break; } case Methodimplode: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); uint background = extractUInt(exec, args, 2); - QImage img = KImageEffect::implode(image, factor, background); + TQImage img = KImageEffect::implode(image, factor, background); retValue = convertToValue(exec, img); break; } case MethodoilPaintConvolve: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); - QImage img = KImageEffect::oilPaintConvolve(image, radius); + TQImage img = KImageEffect::oilPaintConvolve(image, radius); retValue = convertToValue(exec, img); break; } case MethodoilPaint: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int radius = extractInt(exec, args, 1); - QImage img = KImageEffect::oilPaint(image, radius); + TQImage img = KImageEffect::oilPaint(image, radius); retValue = convertToValue(exec, img); break; } case Methodsharpen: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); - QImage img = KImageEffect::sharpen(image, factor); + TQImage img = KImageEffect::sharpen(image, factor); retValue = convertToValue(exec, img); break; } case Methodsharpen2: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - QImage img = KImageEffect::sharpen(image, radius, sigma); + TQImage img = KImageEffect::sharpen(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodspread: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); uint amount = extractUInt(exec, args, 1); - QImage img = KImageEffect::spread(image, amount); + TQImage img = KImageEffect::spread(image, amount); retValue = convertToValue(exec, img); break; } case Methodshade: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); bool color_shading = extractBool(exec, args, 1); double azimuth = extractDouble(exec, args, 2); double elevation = extractDouble(exec, args, 3); - QImage img = KImageEffect::shade(image, color_shading, azimuth, elevation); + TQImage img = KImageEffect::shade(image, color_shading, azimuth, elevation); retValue = convertToValue(exec, img); break; } case Methodswirl: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double degrees = extractDouble(exec, args, 1); uint background = extractUInt(exec, args, 2); - QImage img = KImageEffect::swirl(image, degrees, background); + TQImage img = KImageEffect::swirl(image, degrees, background); retValue = convertToValue(exec, img); break; } case Methodwave: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); double amplitude = extractDouble(exec, args, 1); double frequency = extractDouble(exec, args, 2); uint background = extractUInt(exec, args, 3); - QImage img = KImageEffect::wave(image, amplitude, frequency, background); + TQImage img = KImageEffect::wave(image, amplitude, frequency, background); retValue = convertToValue(exec, img); break; } case Methodcontrast: { - QImage image = extractQImage(exec, args, 0); + TQImage image = extractQImage(exec, args, 0); int c = extractInt(exec, args, 1); - QImage img = KImageEffect::contrast(image, c); + TQImage img = KImageEffect::contrast(image, c); retValue = convertToValue(exec, img); break; } case MethodbumpMap: { - QImage mask = extractQImage(exec, args, 0); - QImage img = bumpmap(img, + TQImage mask = extractQImage(exec, args, 0); + TQImage img = bumpmap(img, mask, extractDouble(exec, args, 1), extractDouble(exec, args, 2), @@ -771,12 +771,12 @@ static void bumpmap_row( uint *src, * @return The destination image (dst) containing the result. * @author Zack Rusin <[email protected]> */ -QImage ImageFX::bumpmap(QImage &img, QImage &map, double azimuth, double elevation, +TQImage ImageFX::bumpmap(TQImage &img, TQImage &map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, bool compensate, bool invert, BumpmapType type, bool tiled) { - QImage dst; + TQImage dst; if ( img.depth() != 32 || img.depth() != 32 ) { qWarning( "Bump-mapping effect works only with 32 bit images"); |