summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec8021b)
raw | patch | inline | side by side (parent: ec8021b)
author | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Sat, 28 Jul 2007 01:55:25 +0000 (01:55 +0000) | ||
committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Sat, 28 Jul 2007 01:55:25 +0000 (01:55 +0000) |
* Limited the upper bounds of the feConvolveMatrix attributes targetX and targetY so that they match the value of Order.
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.h | patch | blob | history |
index 19e6a9d3d49408340a859747216c8046097049f4..6a634449ff0bb456a5602acd8c02d42851d7d41a 100644 (file)
return _signal_changed;
}
- void update_direct(FilterEffectsDialog* d)
+ void update(SPFeConvolveMatrix* conv)
{
- update(SP_FECONVOLVEMATRIX(d->_primitive_list.get_selected()));
+ if(conv) {
+ int cols, rows;
+
+ cols = (int)conv->order.getNumber();
+ if(cols > 5)
+ cols = 5;
+ rows = conv->order.optNumber_set ? (int)conv->order.getOptNumber() : cols;
+
+ update(conv, cols, rows);
+ }
}
private:
class ConvolveMatrixColumns : public Gtk::TreeModel::ColumnRecord
std::vector<Gtk::TreeModelColumn<double> > cols;
};
- void update(SPFeConvolveMatrix* conv)
- {
- if(conv) {
- int cols, rows;
-
- cols = (int)conv->order.getNumber();
- if(cols > 5)
- cols = 5;
- rows = conv->order.optNumber_set ? (int)conv->order.getOptNumber() : cols;
-
- update(conv, cols, rows);
- }
- }
-
void update(SPFeConvolveMatrix* conv, const int rows, const int cols)
{
_model->clear();
_k4 = _settings->add(SP_ATTR_K4, _("K4"), -10, 10, 1, 0.01, 1);
_settings->type(NR_FILTER_CONVOLVEMATRIX);
- DualSpinSlider* order = _settings->add(SP_ATTR_ORDER, _("Size"), "", 1, 5, 1, 1, 0);
- order->remove_scale();
+ _convolve_order = _settings->add(SP_ATTR_ORDER, _("Size"), "", 1, 5, 1, 1, 0);
+ _convolve_order->remove_scale();
_settings->combine();
- SpinSlider* tx = _settings->add(SP_ATTR_TARGETX, _("Target"), 1, 5, 1, 1, 0);
- tx->remove_scale();
- SpinSlider* ty = _settings->add(SP_ATTR_TARGETY, "", 1, 5, 1, 1, 0);
- ty->remove_scale();
+ _convolve_tx = _settings->add(SP_ATTR_TARGETX, _("Target"), 0, 4, 1, 1, 0);
+ _convolve_tx->remove_scale();
+ _convolve_ty = _settings->add(SP_ATTR_TARGETY, "", 0, 4, 1, 1, 0);
+ _convolve_ty->remove_scale();
_settings->combine();
- ConvolveMatrix* convmat = _settings->add(SP_ATTR_KERNELMATRIX, _("Kernel"));
- order->signal_value_changed().connect(
- sigc::bind(sigc::mem_fun(*convmat, &ConvolveMatrix::update_direct), this));
+ _convolve_matrix = _settings->add(SP_ATTR_KERNELMATRIX, _("Kernel"));
+ _convolve_order->signal_value_changed().connect(sigc::mem_fun(*this, &FilterEffectsDialog::convolve_order_changed));
_settings->add(SP_ATTR_DIVISOR, _("Divisor"), 0.01, 10, 1, 0.01, 1);
_settings->add(SP_ATTR_BIAS, _("Bias"), -10, 10, 1, 0.01, 1);
}
}
+void FilterEffectsDialog::convolve_order_changed()
+{
+ _convolve_matrix->update(SP_FECONVOLVEMATRIX(_primitive_list.get_selected()));
+ _convolve_tx->get_adjustment().set_upper(_convolve_order->get_spinslider1().get_value());
+ _convolve_ty->get_adjustment().set_upper(_convolve_order->get_spinslider2().get_value());
+}
+
void FilterEffectsDialog::set_attr_color(const SPAttributeEnum attr, const Gtk::ColorButton* input)
{
if(input->is_sensitive()) {
index 51c1cc5fcab7456c0d3aa68f14e29a170077e629..9e9a02f47bc1e000c61872386d1eaa3ca01ce0d7 100644 (file)
void add_primitive();
void remove_primitive();
void duplicate_primitive();
+ void convolve_order_changed();
void set_attr_color(const SPAttributeEnum attr, const Gtk::ColorButton*);
void set_attr_direct(const SPAttributeEnum attr, const AttrWidget*);
class ConvolveMatrix;
Settings* _settings;
+ // Convolve Matrix
+ ConvolveMatrix* _convolve_matrix;
+ DualSpinSlider* _convolve_order;
+ SpinSlider* _convolve_tx;
+ SpinSlider* _convolve_ty;
+
// For controlling setting sensitivity
Gtk::Widget* _k1, *_k2, *_k3, *_k4;