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/modulate.cpp | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/extension/internal/bitmap/modulate.cpp (limited to 'src/extension/internal/bitmap/modulate.cpp') diff --git a/src/extension/internal/bitmap/modulate.cpp b/src/extension/internal/bitmap/modulate.cpp new file mode 100644 index 000000000..97a4d5a47 --- /dev/null +++ b/src/extension/internal/bitmap/modulate.cpp @@ -0,0 +1,57 @@ +/* + * 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 "modulate.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Bitmap { + +void +Modulate::applyEffect(Magick::Image* image) { + float hue = (_hue + 180.0) / 180.0; + image->modulate(_brightness, _saturation, hue); +} + +void +Modulate::refreshParameters(Inkscape::Extension::Effect* module) { + _brightness = module->get_param_float("brightness"); + _saturation = module->get_param_float("saturation"); + _hue = module->get_param_float("hue"); +} + +#include "../clear-n_.h" + +void +Modulate::init(void) +{ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Modulate") "\n" + "org.inkscape.effect.bitmap.modulate\n" + "1.0\n" + "1.0\n" + "0.0\n" + "\n" + "all\n" + "\n" + "\n" + "\n" + "" N_("Apply Modulate Effect") "\n" + "\n" + "\n", new Modulate()); +} + +}; /* namespace Bitmap */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ -- cgit v1.2.3