From: nicholasbishop Date: Mon, 6 Aug 2007 00:58:34 +0000 (+0000) Subject: Filter effects dialog: X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9cd2476096fe25e62c8390886312882856039ad8;p=inkscape.git Filter effects dialog: * Added controls for scale and channel selection to the filter dialog for feDisplacementMap --- diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp index a688ecc19..bd855d102 100644 --- a/src/filter-enums.cpp +++ b/src/filter-enums.cpp @@ -80,11 +80,20 @@ const EnumDataConverter CompositeOperatorConverter(Composit // feConvolveMatrix const EnumData ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE] = { {NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE, _("Duplicate"), "duplicate"}, - {NR::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"}, - {NR::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"} + {NR::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"}, + {NR::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"} }; const EnumDataConverter ConvolveMatrixEdgeModeConverter(ConvolveMatrixEdgeModeData, NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE); +// feDisplacementMap +const EnumData DisplacementMapChannelData[4] = { + {0, _("Red"), "R"}, + {1, _("Green"), "G"}, + {2, _("Blue"), "B"}, + {3, _("Alpha"), "A"} +}; +const EnumDataConverter DisplacementMapChannelConverter(DisplacementMapChannelData, 4); + // Light source const EnumData LightSourceData[LIGHT_ENDSOURCE] = { {LIGHT_DISTANT, _("Distance Light"), "svg:feDistanceLight"}, diff --git a/src/filter-enums.h b/src/filter-enums.h index 8a6a56841..7e5a641c8 100644 --- a/src/filter-enums.h +++ b/src/filter-enums.h @@ -48,6 +48,9 @@ extern const Inkscape::Util::EnumDataConverter CompositeOpe // ConvolveMatrix edgeMode extern const Inkscape::Util::EnumData ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE]; extern const Inkscape::Util::EnumDataConverter ConvolveMatrixEdgeModeConverter; +// DisplacementMap channel +extern const Inkscape::Util::EnumData DisplacementMapChannelData[4]; +extern const Inkscape::Util::EnumDataConverter DisplacementMapChannelConverter; // Lighting enum LightSource { LIGHT_DISTANT, diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 3c306d382..edcb1e9ca 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1678,6 +1678,11 @@ void FilterEffectsDialog::init_settings_widgets() _settings->add_spinslider(SP_ATTR_DIFFUSECONSTANT, _("Constant"), 0, 100, 1, 0.01, 1); _settings->add_dualspinslider(SP_ATTR_KERNELUNITLENGTH, _("Kernel Unit Length"), 0.01, 10, 1, 0.01, 1); _settings->add_lightsource(_("Light Source")); + + _settings->type(NR_FILTER_DISPLACEMENTMAP); + _settings->add_spinslider(SP_ATTR_SCALE, _("Scale"), 0, 100, 1, 0.01, 1); + _settings->add_combo(SP_ATTR_XCHANNELSELECTOR, _("X Channel"), DisplacementMapChannelConverter); + _settings->add_combo(SP_ATTR_YCHANNELSELECTOR, _("Y Channel"), DisplacementMapChannelConverter); _settings->type(NR_FILTER_GAUSSIANBLUR); _settings->add_dualspinslider(SP_ATTR_STDDEVIATION, _("Standard Deviation"), 0.01, 100, 1, 0.01, 1);