summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d81a973)
raw | patch | inline | side by side (parent: d81a973)
author | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Mon, 6 Aug 2007 00:24:31 +0000 (00:24 +0000) | ||
committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Mon, 6 Aug 2007 00:24:31 +0000 (00:24 +0000) |
* Added edge mode setting to the filter dialog
* Changed type of edgeMode in SPFeConvolveMatrix to use the enum type
* Changed type of edgeMode in SPFeConvolveMatrix to use the enum type
src/filter-enums.cpp | patch | blob | history | |
src/filter-enums.h | patch | blob | history | |
src/sp-feconvolvematrix.h | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history |
diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp
index 2d26095a47f5c6ff660aae135e9fa79397916fdd..a688ecc1920a07d5bbae7095382cadd0b1c1eb5b 100644 (file)
--- a/src/filter-enums.cpp
+++ b/src/filter-enums.cpp
};
const EnumDataConverter<FeCompositeOperator> CompositeOperatorConverter(CompositeOperatorData, COMPOSITE_ENDOPERATOR);
+// feConvolveMatrix
+const EnumData<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE] = {
+ {NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE, _("Duplicate"), "duplicate"},
+ {NR::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"},
+ {NR::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"}
+};
+const EnumDataConverter<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter(ConvolveMatrixEdgeModeData, NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE);
+
// Light source
const EnumData<LightSource> LightSourceData[LIGHT_ENDSOURCE] = {
{LIGHT_DISTANT, _("Distance Light"), "svg:feDistanceLight"},
diff --git a/src/filter-enums.h b/src/filter-enums.h
index cbea5545b59bc4b7fb83e4398d02927a46f862a3..8a6a568414e09a3c69ed2e4dc8dd1e8dc920adf7 100644 (file)
--- a/src/filter-enums.h
+++ b/src/filter-enums.h
#include "display/nr-filter-blend.h"
#include "display/nr-filter-colormatrix.h"
#include "display/nr-filter-composite.h"
+#include "display/nr-filter-convolve-matrix.h"
#include "display/nr-filter-types.h"
#include "util/enums.h"
// Composite operator
extern const Inkscape::Util::EnumData<FeCompositeOperator> CompositeOperatorData[COMPOSITE_ENDOPERATOR];
extern const Inkscape::Util::EnumDataConverter<FeCompositeOperator> CompositeOperatorConverter;
+// ConvolveMatrix edgeMode
+extern const Inkscape::Util::EnumData<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE];
+extern const Inkscape::Util::EnumDataConverter<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter;
// Lighting
enum LightSource {
LIGHT_DISTANT,
index 0cb4abc67e5bf0782bb162ada9e82d67842fd753..d757d7b3d83e2f30e7f0168e34ec650107e864c6 100644 (file)
#include "sp-filter.h"
#include "sp-feconvolvematrix-fns.h"
#include "number-opt-number.h"
+#include "display/nr-filter-convolve-matrix.h"
#include <vector>
-//#include <glib.h>
-
/* FeConvolveMatrix base class */
class SPFeConvolveMatrixClass;
std::vector<gdouble> kernelMatrix;
double divisor, bias;
int targetX, targetY;
- int edgeMode;
+ NR::FilterConvolveMatrixEdgeMode edgeMode;
NumberOptNumber kernelUnitLength;
bool preserveAlpha;
};
index edbae518dc752bbefdd8730b45fed752d623445a..3c306d382176cce6ca820689c5d909fcc676c2e2 100644 (file)
_convolve_order->signal_attr_changed().connect(sigc::mem_fun(*this, &FilterEffectsDialog::convolve_order_changed));
_settings->add_spinslider(SP_ATTR_DIVISOR, _("Divisor"), 0.01, 10, 1, 0.01, 1);
_settings->add_spinslider(SP_ATTR_BIAS, _("Bias"), -10, 10, 1, 0.01, 1);
+ _settings->add_combo(SP_ATTR_EDGEMODE, _("Edge Mode"), ConvolveMatrixEdgeModeConverter);
_settings->type(NR_FILTER_DIFFUSELIGHTING);
_settings->add_color(SP_PROP_LIGHTING_COLOR, _("Diffuse Color"));