modulate.cpp revision 5cf507fca7719ae9280d0a5199e024e920f1284d
970N/A/*
970N/A * Copyright (C) 2007 Authors:
1391N/A * Christopher Brown <audiere@gmail.com>
970N/A * Ted Gould <ted@gould.cx>
970N/A *
970N/A * Released under GNU GPL, read the file 'COPYING' for more information
970N/A */
970N/A
970N/A#include "extension/effect.h"
970N/A#include "extension/system.h"
970N/A
970N/A#include "modulate.h"
970N/A#include <Magick++.h>
970N/A
970N/Anamespace Inkscape {
970N/Anamespace Extension {
970N/Anamespace Internal {
970N/Anamespace Bitmap {
970N/A
970N/Avoid
970N/AModulate::applyEffect(Magick::Image* image) {
970N/A float hue = (_hue * 200 / 360.0) + 100;
970N/A image->modulate(_brightness + 100, _saturation + 100, hue);
970N/A}
970N/A
1152N/Avoid
970N/AModulate::refreshParameters(Inkscape::Extension::Effect* module) {
970N/A _brightness = module->get_param_float("brightness");
970N/A _saturation = module->get_param_float("saturation");
970N/A _hue = module->get_param_float("hue");
970N/A}
970N/A
970N/A#include "../clear-n_.h"
970N/A
970N/Avoid
970N/AModulate::init(void)
970N/A{
970N/A Inkscape::Extension::build_from_mem(
970N/A "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
970N/A "<name>" N_("HSB Adjust") "</name>\n"
970N/A "<id>org.inkscape.effect.bitmap.modulate</id>\n"
970N/A "<param name=\"hue\" gui-text=\"" N_("Hue:") "\" type=\"float\" min=\"-360\" max=\"360\">0</param>\n"
970N/A "<param name=\"saturation\" gui-text=\"" N_("Saturation:") "\" type=\"float\" min=\"-200\" max=\"200\">0</param>\n"
970N/A "<param name=\"brightness\" gui-text=\"" N_("Brightness:") "\" type=\"float\" min=\"-200\" max=\"200\">0</param>\n"
970N/A "<effect>\n"
970N/A "<object-type>all</object-type>\n"
970N/A "<effects-menu>\n"
970N/A "<submenu name=\"" N_("Raster") "\" />\n"
970N/A "</effects-menu>\n"
970N/A "<menu-tip>" N_("Adjust the amount of hue, saturation, and brightness in selected bitmap(s)") "</menu-tip>\n"
970N/A "</effect>\n"
970N/A "</inkscape-extension>\n", new Modulate());
970N/A}
970N/A
970N/A}; /* namespace Bitmap */
970N/A}; /* namespace Internal */
970N/A}; /* namespace Extension */
970N/A}; /* namespace Inkscape */
970N/A