Lines Matching refs:filter

24 #include "filter-chemistry.h"
25 #include "filter-enums.h"
29 #include "sp-filter.h"
30 #include "sp-filter-reference.h"
36 * Count how many times the filter is used by the styles of o and its
39 static guint count_filter_hrefs(SPObject *o, SPFilter *filter)
48 && style->filter.set
49 && style->getFilter() == filter)
55 i += count_filter_hrefs(child, filter);
62 * Sets a suitable filter effects area according to given blur radius,
70 // being added can affect the required filter area
99 // create a new filter
101 repr = xml_doc->createElement("svg:filter");
106 // filter cairo surfaces and other types of cairo surfaces).
112 // Append the new filter node to defs
127 filter_add_primitive(SPFilter *filter, const Inkscape::Filters::FilterPrimitiveType type)
129 Inkscape::XML::Document *xml_doc = filter->document->getReprDoc();
131 //create filter primitive node
179 //set primitive as child of filter node
181 filter->appendChild(repr);
185 SPFilterPrimitive *prim = SP_FILTER_PRIMITIVE( filter->document->getObjectByRepr(repr) );
194 * Creates a filter with blur primitive of specified radius for an item with the given matrix expansion, width and height
205 // create a new filter
207 repr = xml_doc->createElement("svg:filter");
216 * filter cairo surfaces and other types of cairo surfaces. lp:1127103 */
234 //set feGaussianBlur as child of filter node
238 // Append the new filter node to defs
256 * Creates a simple filter with a blend primitive and a blur primitive of specified radius for
269 // create a new filter
271 repr = xml_doc->createElement("svg:filter");
277 * filter cairo surfaces and other types of cairo surfaces. lp:1127103 */
283 // Append the new filter node to defs
306 //set feGaussianBlur as child of filter node
322 // set feBlend as child of filter node
344 * Creates a simple filter for the given item with blend and blur primitives, using the
368 * If no filters are applied to given item, creates a new blur filter.
369 * If a filter is applied and it contains a blur, modify that blur.
370 * If the filter doesn't contain blur, a blur is added to the filter.
371 * Should there be more references to modified filter, that filter is
372 * duplicated, so that other elements referring that filter are not modified.
378 if (!item->style || !item->style->filter.set) {
382 SPFilter *filter = SP_FILTER(item->style->getFilter());
383 if (!filter) {
384 // We reach here when filter.set is true, but the href is not found in the document
390 // If there are more users for this filter, duplicate it
391 if (filter->hrefcount > count_filter_hrefs(item, filter)) {
396 filter = SP_FILTER( document->getObjectByRepr(repr) );
418 // Set the filter effects area
430 return filter;
445 //set feGaussianBlur as child of filter node
446 filter->getRepr()->appendChild(b_repr);
449 return filter;
455 sp_repr_css_unset_property(css, "filter");
465 * Removes the first feGaussianBlur from the filter attached to given item.
466 * Should this leave us with an empty filter, remove that filter.
468 /* TODO: the removed filter primitive may had had a named result image, so
469 * after removing, the filter may be in erroneous state, this situation should
473 if (item->style && item->style->filter.set && item->style->getFilter()) {
485 // If there are no more primitives left in this filter, discard it.
492 bool filter_is_single_gaussian_blur(SPFilter *filter)
494 return (filter->firstChild() &&
495 (filter->firstChild() == filter->lastChild()) &&
496 SP_IS_GAUSSIANBLUR(filter->firstChild()));
499 double get_single_gaussian_blur_radius(SPFilter *filter)
501 if (filter->firstChild() &&
502 (filter->firstChild() == filter->lastChild()) &&
503 SP_IS_GAUSSIANBLUR(filter->firstChild())) {
505 SPGaussianBlur *gb = SP_GAUSSIANBLUR(filter->firstChild());