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