diff options
Diffstat (limited to 'kjsembed/plugins/imagefx_plugin.cpp')
-rw-r--r-- | kjsembed/plugins/imagefx_plugin.cpp | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/kjsembed/plugins/imagefx_plugin.cpp b/kjsembed/plugins/imagefx_plugin.cpp index ba2181cc..7aa81b3c 100644 --- a/kjsembed/plugins/imagefx_plugin.cpp +++ b/kjsembed/plugins/imagefx_plugin.cpp @@ -36,7 +36,7 @@ namespace KJSEmbed { namespace Bindings { -ImageFXLoader::ImageFXLoader( TQObject *parent, const char *name, const TQStringList &args ) : +ImageFXLoader::ImageFXLoader( TTQObject *parent, const char *name, const TTQStringList &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: { - TQSize size = extractQSize(exec, args, 0); - TQColor ca = extractQColor(exec, args, 1); - TQColor cb = extractQColor(exec, args, 2); + TTQSize size = extractTQSize(exec, args, 0); + TTQColor ca = extractTQColor(exec, args, 1); + TTQColor cb = extractTQColor(exec, args, 2); int type = extractInt( exec, args, 3); int ncols = extractInt( exec, args, 4); - TQImage img = KImageEffect::gradient(size, ca, cb, (KImageEffect::GradientType)type, ncols); + TTQImage img = KImageEffect::gradient(size, ca, cb, (KImageEffect::GradientType)type, ncols); retValue = convertToValue(exec, img); break; } case MethodunbalancedGradient: { - TQSize size = extractQSize(exec, args, 0); - TQColor ca = extractQColor(exec, args, 1); - TQColor cb = extractQColor(exec, args, 2); + TTQSize size = extractTQSize(exec, args, 0); + TTQColor ca = extractTQColor(exec, args, 1); + TTQColor cb = extractTQColor(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); - TQImage img = KImageEffect::unbalancedGradient(size, ca, cb, (KImageEffect::GradientType)type, xfactor, yfactor, ncols); + TTQImage img = KImageEffect::unbalancedGradient(size, ca, cb, (KImageEffect::GradientType)type, xfactor, yfactor, ncols); retValue = convertToValue(exec, img); break; } case MethodblendColor: { - TQColor clr = extractQColor(exec, args, 0); - TQImage dst = extractQImage(exec, args, 1); + TTQColor clr = extractTQColor(exec, args, 0); + TTQImage dst = extractTQImage(exec, args, 1); float opacity = (float)extractDouble(exec, args, 2); - TQImage img = KImageEffect::blend(clr, dst, opacity); + TTQImage img = KImageEffect::blend(clr, dst, opacity); retValue = convertToValue(exec, img); break; } case MethodblendImage: { - TQImage src = extractQImage(exec, args, 0); - TQImage dst = extractQImage(exec, args, 1); + TTQImage src = extractTQImage(exec, args, 0); + TTQImage dst = extractTQImage(exec, args, 1); float opacity = (float)extractDouble(exec, args, 2); - TQImage img = KImageEffect::blend(src, dst, opacity); + TTQImage img = KImageEffect::blend(src, dst, opacity); retValue = convertToValue(exec, img); break; } case MethodcomputeDestinationRect: { - TQSize lowerSize = extractQSize(exec, args, 0); + TTQSize lowerSize = extractTQSize(exec, args, 0); int disposition = extractInt(exec, args, 1); - TQImage upper = extractQImage(exec, args, 2); - TQRect rect = KImageEffect::computeDestinationRect(lowerSize, (KImageEffect::Disposition) disposition, upper); + TTQImage upper = extractTQImage(exec, args, 2); + TTQRect rect = KImageEffect::computeDestinationRect(lowerSize, (KImageEffect::Disposition) disposition, upper); retValue = convertToValue(exec, rect); break; } case MethodchannelIntensity: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); float percent = (float)extractDouble(exec, args, 1); int channel = extractInt(exec, args, 2); - TQImage img = KImageEffect::channelIntensity(image, percent, (KImageEffect::RGBComponent)channel); + TTQImage img = KImageEffect::channelIntensity(image, percent, (KImageEffect::RGBComponent)channel); retValue = convertToValue(exec, img); break; } case Methodfade: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); float val = (float)extractDouble(exec, args, 1); - TQColor color = extractQColor(exec, args, 2); - TQImage img = KImageEffect::fade(image, val, color); + TTQColor color = extractTQColor(exec, args, 2); + TTQImage img = KImageEffect::fade(image, val, color); retValue = convertToValue(exec, img); break; } case Methodflatten: { - TQImage image = extractQImage(exec, args, 0); - TQColor ca = extractQColor(exec, args, 1); - TQColor cb = extractQColor(exec, args, 2); + TTQImage image = extractTQImage(exec, args, 0); + TTQColor ca = extractTQColor(exec, args, 1); + TTQColor cb = extractTQColor(exec, args, 2); int ncols = extractInt(exec, args, 3); - TQImage img = KImageEffect::flatten(image, ca, cb, ncols); + TTQImage img = KImageEffect::flatten(image, ca, cb, ncols); retValue = convertToValue(exec, img); break; } case Methodhash: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int lite = extractInt(exec, args, 1); int spacing = extractInt(exec, args, 2); - TQImage img = KImageEffect::hash(image, (KImageEffect::Lighting)lite, spacing); + TTQImage img = KImageEffect::hash(image, (KImageEffect::Lighting)lite, spacing); retValue = convertToValue(exec, img); break; } case Methodintensity: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); float percent = (float)extractDouble(exec, args, 1); - TQImage img = KImageEffect::intensity(image, percent); + TTQImage img = KImageEffect::intensity(image, percent); retValue = convertToValue(exec, img); break; } case Methodmodulate: { - TQImage image = extractQImage(exec, args, 0); - TQImage modImage = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); + TTQImage modImage = extractTQImage(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); - TQImage img = KImageEffect::modulate(image, modImage, reverse, (KImageEffect::ModulationType)type, factor, (KImageEffect::RGBComponent)channel); + TTQImage img = KImageEffect::modulate(image, modImage, reverse, (KImageEffect::ModulationType)type, factor, (KImageEffect::RGBComponent)channel); retValue = convertToValue(exec, img); break; } case MethodtoGray: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); bool fast = extractBool(exec, args, 1); - TQImage img = KImageEffect::toGray(image, fast); + TTQImage img = KImageEffect::toGray(image, fast); retValue = convertToValue(exec, img); break; } case Methoddesaturate: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); float desat = (float)extractDouble(exec, args, 1); - TQImage img = KImageEffect::desaturate(image, desat); + TTQImage 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: { - TQImage image = extractQImage(exec, args, 0); - TQColor col = extractQColor(exec, args, 1); - TQImage img = KImageEffect::selectedImage(image, col); + TTQImage image = extractTQImage(exec, args, 0); + TTQColor col = extractTQColor(exec, args, 1); + TTQImage img = KImageEffect::selectedImage(image, col); retValue = convertToValue(exec, img); break; } case MethodcontrastHSV: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); bool sharpen = extractBool(exec, args, 1); KImageEffect::contrastHSV(image, sharpen); retValue = convertToValue(exec, image); break; } case Methodnormalize: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); KImageEffect::normalize(image); retValue = convertToValue(exec, image); break; } case Methodequalize: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); KImageEffect::equalize(image); retValue = convertToValue(exec, image); break; } case Methodthreshold: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); uint value = extractUInt(exec, args, 1); KImageEffect::threshold(image, value); retValue = convertToValue(exec, image); break; } case Methodsolarize: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); KImageEffect::solarize(image, factor); retValue = convertToValue(exec, image); break; } case Methodemboss: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - TQImage img = KImageEffect::emboss(image, radius, sigma); + TTQImage img = KImageEffect::emboss(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methoddespeckle: { - TQImage image = extractQImage(exec, args, 0); - TQImage img = KImageEffect::despeckle(image); + TTQImage image = extractTQImage(exec, args, 0); + TTQImage img = KImageEffect::despeckle(image); retValue = convertToValue(exec, img); break; } case Methodcharcoal: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); - TQImage img = KImageEffect::charcoal( image, factor); + TTQImage img = KImageEffect::charcoal( image, factor); retValue = convertToValue(exec, img); break; } case Methodcharcoal2: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - TQImage img = KImageEffect::charcoal(image, radius, sigma); + TTQImage img = KImageEffect::charcoal(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodrotate: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int r = extractInt(exec, args, 1); - TQImage img = KImageEffect::rotate(image, (KImageEffect::RotateDirection) r); + TTQImage img = KImageEffect::rotate(image, (KImageEffect::RotateDirection) r); retValue = convertToValue(exec, img); break; } case Methodsample: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int width = extractInt(exec, args, 1); int height = extractInt(exec, args, 2); - TQImage img = KImageEffect::sample(image, width, height); + TTQImage img = KImageEffect::sample(image, width, height); retValue = convertToValue(exec, img); break; } case MethodaddNoise: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int type = extractInt(exec, args, 1); - TQImage img = KImageEffect::addNoise(image, (KImageEffect::NoiseType) type); + TTQImage img = KImageEffect::addNoise(image, (KImageEffect::NoiseType) type); retValue = convertToValue(exec, img); break; } case Methodblur: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - TQImage img = KImageEffect::blur(image, radius, sigma); + TTQImage img = KImageEffect::blur(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodedge: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); - TQImage img = KImageEffect::edge(image, radius); + TTQImage img = KImageEffect::edge(image, radius); retValue = convertToValue(exec, img); break; } case Methodimplode: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); uint background = extractUInt(exec, args, 2); - TQImage img = KImageEffect::implode(image, factor, background); + TTQImage img = KImageEffect::implode(image, factor, background); retValue = convertToValue(exec, img); break; } case MethodoilPaintConvolve: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); - TQImage img = KImageEffect::oilPaintConvolve(image, radius); + TTQImage img = KImageEffect::oilPaintConvolve(image, radius); retValue = convertToValue(exec, img); break; } case MethodoilPaint: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int radius = extractInt(exec, args, 1); - TQImage img = KImageEffect::oilPaint(image, radius); + TTQImage img = KImageEffect::oilPaint(image, radius); retValue = convertToValue(exec, img); break; } case Methodsharpen: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double factor = extractDouble(exec, args, 1); - TQImage img = KImageEffect::sharpen(image, factor); + TTQImage img = KImageEffect::sharpen(image, factor); retValue = convertToValue(exec, img); break; } case Methodsharpen2: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double radius = extractDouble(exec, args, 1); double sigma = extractDouble(exec, args, 2); - TQImage img = KImageEffect::sharpen(image, radius, sigma); + TTQImage img = KImageEffect::sharpen(image, radius, sigma); retValue = convertToValue(exec, img); break; } case Methodspread: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); uint amount = extractUInt(exec, args, 1); - TQImage img = KImageEffect::spread(image, amount); + TTQImage img = KImageEffect::spread(image, amount); retValue = convertToValue(exec, img); break; } case Methodshade: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); bool color_shading = extractBool(exec, args, 1); double azimuth = extractDouble(exec, args, 2); double elevation = extractDouble(exec, args, 3); - TQImage img = KImageEffect::shade(image, color_shading, azimuth, elevation); + TTQImage img = KImageEffect::shade(image, color_shading, azimuth, elevation); retValue = convertToValue(exec, img); break; } case Methodswirl: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double degrees = extractDouble(exec, args, 1); uint background = extractUInt(exec, args, 2); - TQImage img = KImageEffect::swirl(image, degrees, background); + TTQImage img = KImageEffect::swirl(image, degrees, background); retValue = convertToValue(exec, img); break; } case Methodwave: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); double amplitude = extractDouble(exec, args, 1); double frequency = extractDouble(exec, args, 2); uint background = extractUInt(exec, args, 3); - TQImage img = KImageEffect::wave(image, amplitude, frequency, background); + TTQImage img = KImageEffect::wave(image, amplitude, frequency, background); retValue = convertToValue(exec, img); break; } case Methodcontrast: { - TQImage image = extractQImage(exec, args, 0); + TTQImage image = extractTQImage(exec, args, 0); int c = extractInt(exec, args, 1); - TQImage img = KImageEffect::contrast(image, c); + TTQImage img = KImageEffect::contrast(image, c); retValue = convertToValue(exec, img); break; } case MethodbumpMap: { - TQImage mask = extractQImage(exec, args, 0); - TQImage img = bumpmap(img, + TTQImage mask = extractTQImage(exec, args, 0); + TTQImage 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 <zack@kde.org> */ -TQImage ImageFX::bumpmap(TQImage &img, TQImage &map, double azimuth, double elevation, +TTQImage ImageFX::bumpmap(TTQImage &img, TTQImage &map, double azimuth, double elevation, int depth, int xofs, int yofs, int waterlevel, int ambient, bool compensate, bool invert, BumpmapType type, bool tiled) { - TQImage dst; + TTQImage dst; if ( img.depth() != 32 || img.depth() != 32 ) { qWarning( "Bump-mapping effect works only with 32 bit images"); |