From: nicholasbishop Date: Thu, 9 Aug 2007 06:06:33 +0000 (+0000) Subject: Filter effects dialog: X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e83c8c22aeee166a8062cf991004c63217761be4;p=inkscape.git Filter effects dialog: * Added controls for feMorphology --- diff --git a/src/display/nr-filter-morphology.h b/src/display/nr-filter-morphology.h index be9ad2031..be182203c 100644 --- a/src/display/nr-filter-morphology.h +++ b/src/display/nr-filter-morphology.h @@ -19,7 +19,8 @@ namespace NR { enum FilterMorphologyOperator { MORPHOLOGY_OPERATOR_ERODE, - MORPHOLOGY_OPERATOR_DILATE + MORPHOLOGY_OPERATOR_DILATE, + MORPHOLOGY_OPERATOR_END }; class FilterMorphology : public FilterPrimitive { diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp index bd855d102..d9f0a3986 100644 --- a/src/filter-enums.cpp +++ b/src/filter-enums.cpp @@ -94,6 +94,13 @@ const EnumData DisplacementMapChannelData[4] = { }; const EnumDataConverter DisplacementMapChannelConverter(DisplacementMapChannelData, 4); +// feMorphology +const EnumData MorphologyOperatorData[NR::MORPHOLOGY_OPERATOR_END] = { + {NR::MORPHOLOGY_OPERATOR_ERODE, _("Erode"), "erode"}, + {NR::MORPHOLOGY_OPERATOR_DILATE, _("Dilate"), "dilate"} +}; +const EnumDataConverter MorphologyOperatorConverter(MorphologyOperatorData, NR::MORPHOLOGY_OPERATOR_END); + // 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 7e5a641c8..37c7e6f0d 100644 --- a/src/filter-enums.h +++ b/src/filter-enums.h @@ -16,6 +16,7 @@ #include "display/nr-filter-colormatrix.h" #include "display/nr-filter-composite.h" #include "display/nr-filter-convolve-matrix.h" +#include "display/nr-filter-morphology.h" #include "display/nr-filter-types.h" #include "util/enums.h" @@ -51,6 +52,9 @@ extern const Inkscape::Util::EnumDataConverter // DisplacementMap channel extern const Inkscape::Util::EnumData DisplacementMapChannelData[4]; extern const Inkscape::Util::EnumDataConverter DisplacementMapChannelConverter; +// Morphology operator +extern const Inkscape::Util::EnumData MorphologyOperatorData[NR::MORPHOLOGY_OPERATOR_END]; +extern const Inkscape::Util::EnumDataConverter MorphologyOperatorConverter; // Lighting enum LightSource { LIGHT_DISTANT, diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index af413bc0e..3c5a351e6 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1791,6 +1791,10 @@ void FilterEffectsDialog::init_settings_widgets() _settings->type(NR_FILTER_GAUSSIANBLUR); _settings->add_dualspinslider(SP_ATTR_STDDEVIATION, _("Standard Deviation"), 0.01, 100, 1, 0.01, 1); + _settings->type(NR_FILTER_MORPHOLOGY); + _settings->add_combo(SP_ATTR_OPERATOR, _("Operator"), MorphologyOperatorConverter); + _settings->add_dualspinslider(SP_ATTR_RADIUS, _("Radius"), 0, 100, 1, 0.01, 1); + _settings->type(NR_FILTER_OFFSET); _settings->add_spinslider(SP_ATTR_DX, _("Delta X"), -100, 100, 1, 0.01, 1); _settings->add_spinslider(SP_ATTR_DY, _("Delta Y"), -100, 100, 1, 0.01, 1);