summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4bc6aa)
raw | patch | inline | side by side (parent: b4bc6aa)
author | tavmjong <tavmjong@users.sourceforge.net> | |
Sun, 30 Sep 2007 20:56:15 +0000 (20:56 +0000) | ||
committer | tavmjong <tavmjong@users.sourceforge.net> | |
Sun, 30 Sep 2007 20:56:15 +0000 (20:56 +0000) |
Enable and use preserveAlpha attribute.
Increase range for divisor attribute.
Increase range for divisor attribute.
src/display/nr-filter-convolve-matrix.cpp | patch | blob | history | |
src/sp-feconvolvematrix.cpp | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history |
index 562f3ffc470e1c83bc4fca2c01640de26a9854c6..6adf9c9a52483072f97dcee5555c92cec4516985 100644 (file)
out_data[4*( x + width*y )+1] = CLAMP_D_TO_U8(result_G / divisor + bias);
out_data[4*( x + width*y )+2] = CLAMP_D_TO_U8(result_B / divisor + bias);
out_data[4*( x + width*y )+3] = CLAMP_D_TO_U8(result_A / divisor + bias);
+ if( preserveAlpha ) {
+ out_data[4*( x + width*y )+3] = in_data[4*( x + width*y )+3];
+ }
}
}
index 5a3edfc50f8512be66f4c99d23dd02f5ba3577ba..84a1a8682a7ac217f05aa3c47f66288865d667e4 100644 (file)
@@ -321,6 +321,7 @@ static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, NR:
nr_convolve->set_kernelMatrix(sp_convolve->kernelMatrix);
nr_convolve->set_divisor(sp_convolve->divisor);
nr_convolve->set_bias(sp_convolve->bias);
+ nr_convolve->set_preserveAlpha(sp_convolve->preserveAlpha);
}
/*
index dc6fc06bb7eae81c5118a3efbfe7737bfb442260..fa64054b0535f92a552df2e03d3ca14d72459155 100644 (file)
_convolve_target = _settings->add_multispinbutton(SP_ATTR_TARGETX, SP_ATTR_TARGETY, _("Target"), 0, 4, 1, 1, 0);
_convolve_matrix = _settings->add_matrix(SP_ATTR_KERNELMATRIX, _("Kernel"));
_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_DIVISOR, _("Divisor"), 0.01, 1000, 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->add_checkbutton(SP_ATTR_PRESERVEALPHA, _("Preserve Alpha"), "true", "false");
_settings->type(NR_FILTER_DIFFUSELIGHTING);
_settings->add_color(SP_PROP_LIGHTING_COLOR, _("Diffuse Color"));