From b29eafffd0b92cc7b67e5cd877aad5e98b0f0231 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 10 Aug 2007 17:38:51 +0000 Subject: r16217@tres: ted | 2007-08-10 10:36:27 -0700 ImageMagick effects patch from Chris Brown. Google Summer of Code project. (bzr r3450) --- src/extension/internal/bitmap/opacity.cpp | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/extension/internal/bitmap/opacity.cpp (limited to 'src/extension/internal/bitmap/opacity.cpp') diff --git a/src/extension/internal/bitmap/opacity.cpp b/src/extension/internal/bitmap/opacity.cpp new file mode 100644 index 000000000..af2c3fe26 --- /dev/null +++ b/src/extension/internal/bitmap/opacity.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2007 Authors: + * Christopher Brown + * Ted Gould + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "extension/effect.h" +#include "extension/system.h" + +#include "opacity.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Bitmap { + +void +Opacity::applyEffect(Magick::Image* image) { + Magick::Quantum opacity = Magick::Color::scaleDoubleToQuantum(_opacity / 100.0); + image->opacity(opacity); +} + +void +Opacity::refreshParameters(Inkscape::Extension::Effect* module) { + _opacity = module->get_param_float("opacity"); +} + +#include "../clear-n_.h" + +void +Opacity::init(void) +{ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Opacity") "\n" + "org.inkscape.effect.bitmap.opacity\n" + "80.0\n" + "\n" + "all\n" + "\n" + "\n" + "\n" + "" N_("Apply Opacity Effect") "\n" + "\n" + "\n", new Opacity()); +} + +}; /* namespace Bitmap */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ -- cgit v1.2.3