summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 43a1d19)
raw | patch | inline | side by side (parent: 43a1d19)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 23 Mar 2008 04:12:33 +0000 (04:12 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 23 Mar 2008 04:12:33 +0000 (04:12 +0000) |
src/filter-chemistry.cpp | patch | blob | history | |
src/filter-chemistry.h | patch | blob | history |
index 46dbfe0f50c8ee58ff11d9811269fdbe1733ba59..58e2fae6efab6042e78925f1f498dcc1d68a7486 100644 (file)
--- a/src/filter-chemistry.cpp
+++ b/src/filter-chemistry.cpp
@@ -319,7 +319,7 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo
SPFilter *
new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble radius)
{
- NR::Maybe<NR::Rect> const r = sp_item_bbox_desktop(item);
+ NR::Maybe<NR::Rect> const r = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX);
double width;
double height;
stdDeviation /= expansion;
// Get the object size
- NR::Maybe<NR::Rect> const r = sp_item_bbox_desktop(item);
+ NR::Maybe<NR::Rect> const r = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX);
double width;
double height;
if (r) {
}
}
+bool filter_is_single_gaussian_blur(SPFilter *filter)
+{
+ return (SP_OBJECT(filter)->firstChild() &&
+ SP_OBJECT(filter)->firstChild() == SP_OBJECT(filter)->lastChild() &&
+ SP_IS_GAUSSIANBLUR(SP_OBJECT(filter)->firstChild()));
+}
+
+double get_single_gaussian_blur_radius(SPFilter *filter)
+{
+ if (SP_OBJECT(filter)->firstChild() &&
+ SP_OBJECT(filter)->firstChild() == SP_OBJECT(filter)->lastChild() &&
+ SP_IS_GAUSSIANBLUR(SP_OBJECT(filter)->firstChild())) {
+
+ SPGaussianBlur *gb = SP_GAUSSIANBLUR(SP_OBJECT(filter)->firstChild());
+ double x = gb->stdDeviation.getNumber();
+ double y = gb->stdDeviation.getOptNumber();
+ if (x > 0 && y > 0) {
+ return MAX(x, y);
+ }
+ return x;
+ }
+}
+
+
+
/*
Local Variables:
mode:c++
diff --git a/src/filter-chemistry.h b/src/filter-chemistry.h
index 25ba0c997bdcb7f84486ec9f2379c3e921f13bc8..219f79c8cc30a29977ac1b0605e91c192cdd23a4 100644 (file)
--- a/src/filter-chemistry.h
+++ b/src/filter-chemistry.h
SPFilter *modify_filter_gaussian_blur_from_item (SPDocument *document, SPItem *item, gdouble stdDeviation);
void remove_filter (SPObject *item, bool recursive);
void remove_filter_gaussian_blur (SPObject *item);
+bool filter_is_single_gaussian_blur(SPFilter *filter);
+double get_single_gaussian_blur_radius(SPFilter *filter);
#endif