Inkscape
Vector Graphics Editor
|
Go to the source code of this file.
Functions | |
static guint | count_filter_hrefs (SPObject *o, SPFilter *filter) |
Count how many times the filter is used by the styles of o and its descendants. | |
SPFilter * | new_filter (SPDocument *document) |
SPFilterPrimitive * | filter_add_primitive (SPFilter *filter, const Inkscape::Filters::FilterPrimitiveType type) |
SPFilter * | new_filter_gaussian_blur (SPDocument *document, gdouble radius, double expansion) |
Creates a filter with blur primitive of specified radius for an item with the given matrix expansion, width and height. | |
static SPFilter * | new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdouble radius, double expansion) |
Creates a simple filter with a blend primitive and a blur primitive of specified radius for an item with the given matrix expansion, width and height. | |
SPFilter * | new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble radius) |
Creates a simple filter for the given item with blend and blur primitives, using the specified mode and radius, respectively. | |
SPFilter * | modify_filter_gaussian_blur_from_item (SPDocument *document, SPItem *item, gdouble radius) |
Modifies the gaussian blur applied to the item. | |
void | remove_filter (SPObject *item, bool recursive) |
void | remove_hidder_filter (SPObject *item) |
bool | has_hidder_filter (SPObject const *item) |
void | remove_filter_gaussian_blur (SPObject *item) |
Removes the first feGaussianBlur from the filter attached to given item. | |
void | remove_filter_legacy_blend (SPObject *item) |
Removes blend primitive from the filter attached to given item. | |
SPBlendMode | filter_get_legacy_blend (SPObject *item) |
Get if the filter have a < 1.0 blending filter @params: the item to get filtered blend. | |
bool | filter_is_single_gaussian_blur (SPFilter *filter) |
double | get_single_gaussian_blur_radius (SPFilter *filter) |
bool | set_blend_mode (SPItem *item, SPBlendMode blend_mode) |
Count how many times the filter is used by the styles of o and its descendants.
Definition at line 37 of file filter-chemistry.cpp.
References child, SPObject::children, count_filter_hrefs(), SPStyle::filter, SPStyle::getFilter(), and SPObject::style.
Referenced by count_filter_hrefs(), and modify_filter_gaussian_blur_from_item().
SPFilterPrimitive * filter_add_primitive | ( | SPFilter * | filter, |
const Inkscape::Filters::FilterPrimitiveType | type | ||
) |
Definition at line 94 of file filter-chemistry.cpp.
References SPObject::appendChild(), Inkscape::XML::Document::createElement(), SPObject::document, FPConverter, Inkscape::Util::EnumDataConverter< E >::get_key(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), Inkscape::Filters::NR_FILTER_BLEND, Inkscape::Filters::NR_FILTER_COLORMATRIX, Inkscape::Filters::NR_FILTER_COMPONENTTRANSFER, Inkscape::Filters::NR_FILTER_COMPOSITE, Inkscape::Filters::NR_FILTER_CONVOLVEMATRIX, Inkscape::Filters::NR_FILTER_DIFFUSELIGHTING, Inkscape::Filters::NR_FILTER_DISPLACEMENTMAP, Inkscape::Filters::NR_FILTER_FLOOD, Inkscape::Filters::NR_FILTER_GAUSSIANBLUR, Inkscape::Filters::NR_FILTER_IMAGE, Inkscape::Filters::NR_FILTER_MERGE, Inkscape::Filters::NR_FILTER_MORPHOLOGY, Inkscape::Filters::NR_FILTER_OFFSET, Inkscape::Filters::NR_FILTER_SPECULARLIGHTING, Inkscape::Filters::NR_FILTER_TILE, Inkscape::Filters::NR_FILTER_TURBULENCE, Inkscape::GC::release(), and Inkscape::XML::Node::setAttribute().
Referenced by Inkscape::UI::Dialog::FilterEffectsDialog::add_filter_primitive().
SPBlendMode filter_get_legacy_blend | ( | SPObject * | item | ) |
Get if the filter have a < 1.0 blending filter @params: the item to get filtered blend.
Definition at line 490 of file filter-chemistry.cpp.
References SPObject::children, SPStyle::filter, SPStyle::getFilter(), item, SP_CSS_BLEND_NORMAL, and SPObject::style.
Referenced by objects_query_blend().
bool filter_is_single_gaussian_blur | ( | SPFilter * | filter | ) |
Definition at line 523 of file filter-chemistry.cpp.
References SPObject::children.
Referenced by Inkscape::UI::Widget::ObjectCompositeSettings::_blendBlurValueChanged().
double get_single_gaussian_blur_radius | ( | SPFilter * | filter | ) |
Definition at line 529 of file filter-chemistry.cpp.
References SPObject::children, SPObject::firstChild(), and MAX.
bool has_hidder_filter | ( | SPObject const * | item | ) |
Definition at line 405 of file filter-chemistry.cpp.
References SPStyle::getFilter(), SPObject::getId(), item, and SPObject::style.
Referenced by Inkscape::Extension::Internal::CairoRenderer::_doRender(), and object_align().
SPFilter * modify_filter_gaussian_blur_from_item | ( | SPDocument * | document, |
SPItem * | item, | ||
gdouble | radius | ||
) |
Modifies the gaussian blur applied to the item.
If no filters are applied to given item, creates a new blur filter. If a filter is applied and it contains a blur, modify that blur. If the filter doesn't contain blur, a blur is added to the filter. Should there be more references to modified filter, that filter is duplicated, so that other elements referring that filter are not modified.
Definition at line 318 of file filter-chemistry.cpp.
References SPObject::appendChild(), Inkscape::XML::Node::appendChild(), count_filter_hrefs(), Inkscape::XML::Document::createElement(), Geom::Affine::descrim(), Inkscape::XML::Node::duplicate(), SPStyle::filter, Inkscape::XML::Node::firstChild(), SPDocument::getDefs(), SPStyle::getFilter(), SPDocument::getObjectByRepr(), SPObject::getRepr(), SPDocument::getReprDoc(), SPObject::hrefcount, SPItem::i2dt_affine(), item, Inkscape::XML::Node::name(), new_filter_simple_from_item(), Inkscape::XML::Node::next(), Inkscape::GC::release(), Inkscape::XML::Node::setAttributeSvgDouble(), and SPObject::style.
Referenced by Inkscape::UI::Widget::ObjectCompositeSettings::_blendBlurValueChanged(), and Inkscape::UI::Tools::sp_tweak_color_recursive().
SPFilter * new_filter | ( | SPDocument * | document | ) |
Definition at line 59 of file filter-chemistry.cpp.
References SPObject::appendChild(), Inkscape::XML::Document::createElement(), css, SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), Inkscape::GC::release(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), and sp_repr_css_set_property().
Referenced by Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::add_filter(), and SPItem::filter_ref_changed().
|
static |
Creates a simple filter with a blend primitive and a blur primitive of specified radius for an item with the given matrix expansion, width and height.
Definition at line 223 of file filter-chemistry.cpp.
References SPObject::appendChild(), Inkscape::XML::Node::appendChild(), Inkscape::XML::Document::createElement(), css, SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), Inkscape::GC::release(), root, Inkscape::XML::Node::root(), Inkscape::XML::Node::setAttribute(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), and sp_repr_css_set_property().
Referenced by new_filter_simple_from_item().
SPFilter * new_filter_gaussian_blur | ( | SPDocument * | document, |
gdouble | radius, | ||
double | expansion | ||
) |
Creates a filter with blur primitive of specified radius for an item with the given matrix expansion, width and height.
Definition at line 164 of file filter-chemistry.cpp.
References SPObject::appendChild(), Inkscape::XML::Node::appendChild(), Inkscape::XML::Document::createElement(), css, SPDocument::getDefs(), SPDocument::getObjectByRepr(), SPDocument::getReprDoc(), Inkscape::GC::release(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), and sp_repr_css_set_property().
Referenced by Inkscape::UI::Dialog::CloneTiler::apply().
SPFilter * new_filter_simple_from_item | ( | SPDocument * | document, |
SPItem * | item, | ||
const char * | mode, | ||
gdouble | radius | ||
) |
Creates a simple filter for the given item with blend and blur primitives, using the specified mode and radius, respectively.
Definition at line 304 of file filter-chemistry.cpp.
References Geom::Affine::descrim(), SPItem::i2dt_affine(), item, mode, and new_filter_blend_gaussian_blur().
Referenced by modify_filter_gaussian_blur_from_item().
void remove_filter | ( | SPObject * | item, |
bool | recursive | ||
) |
Definition at line 382 of file filter-chemistry.cpp.
References css, SPObject::getRepr(), item, sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), sp_repr_css_change_recursive(), and sp_repr_css_unset_property().
Referenced by Inkscape::UI::Widget::ObjectCompositeSettings::_blendBlurValueChanged(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::remove_filter(), remove_filter_gaussian_blur(), remove_filter_legacy_blend(), remove_hidder_filter(), Inkscape::UI::Dialog::FilterEffectsDialog::FilterModifier::selection_toggled(), and Inkscape::UI::Tools::sp_tweak_color_recursive().
void remove_filter_gaussian_blur | ( | SPObject * | item | ) |
Removes the first feGaussianBlur from the filter attached to given item.
Should this leave us with an empty filter, remove that filter.
Definition at line 424 of file filter-chemistry.cpp.
References Inkscape::XML::Node::childCount(), SPStyle::filter, Inkscape::XML::Node::firstChild(), SPStyle::getFilter(), SPObject::getRepr(), item, Inkscape::XML::Node::name(), Inkscape::XML::Node::next(), remove_filter(), sp_repr_unparent(), and SPObject::style.
void remove_filter_legacy_blend | ( | SPObject * | item | ) |
Removes blend primitive from the filter attached to given item.
Get if the filter have a < 1.0 blending filter and if it remove it @params: the item to remove filtered blend
Definition at line 453 of file filter-chemistry.cpp.
References SPObject::children, SPObject::deleteObject(), SPStyle::filter, SPStyle::getFilter(), item, remove_filter(), and SPObject::style.
Referenced by set_blend_mode().
void remove_hidder_filter | ( | SPObject * | item | ) |
Definition at line 394 of file filter-chemistry.cpp.
References SPStyle::getFilter(), SPObject::getId(), item, remove_filter(), and SPObject::style.
bool set_blend_mode | ( | SPItem * | item, |
SPBlendMode | blend_mode | ||
) |
Definition at line 545 of file filter-chemistry.cpp.
References SPStyle::filter, SPStyle::getFilter(), SPStyle::isolation, item, SPStyle::mix_blend_mode, remove_filter_legacy_blend(), SP_CSS_BLEND_NORMAL, SP_CSS_ISOLATION_ISOLATE, SPObject::style, and SPObject::updateRepr().
Referenced by Inkscape::UI::Widget::ObjectCompositeSettings::_blendBlurValueChanged(), and Inkscape::UI::Dialog::ObjectsPanel::ObjectsPanel().