diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2020-01-21 19:04:13 +0100 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2020-03-03 15:52:47 +0100 |
commit | f9fc420dceb1ece2c98767da16a21aaff771f140 (patch) | |
tree | 299b9c856a3567ee85af11b7b314d2d02a03420b /svx/inc | |
parent | 224ab38f747dcafe711c10b54ad53c52bda9e41d (diff) |
tdf#101181 Implement glow effect on shapes
Glow effect is a color-blurred outline outside of the shape. In ooxml
document it is specified with the <a:glow> element.
The commit contains the following:
- Add support for importing and exporting <a:glow> from ooxml documents.
- Assign new properties to XShape which stores glow-related attributes.
- A new 2D primitive is introduced in module 'drawinglayer' which is
responsible for representing the glow primitive which is to be rendered.
+ A glow primitive is a clone of the original shape which has been
scaled up slightly and a new color has been assigned to it. The
radius of the glow effect and the color is defined in the <a:glow>
element being imported.
- A blur algorithm is introduced in module 'vcl', which is called during
rendering the primitive.
+ The blur algorithm works on a bitmap.
+ Since the algorithm is CPU-intensive, the result is cached in the
processor and it is recalculated only if needed.
- Add support for importing and exporting glow effect to ODF format. For
that, new attributes of element <style:graphic-properties> has been
added:
+ loext:glow, which can have the values "visible" or "hidden"
+ loext:glow-radius: which holds the radius of the glow effect in cm.
+ loext:glow-color: holds the color of the glow effect
- Tests have been added to assert properties after pptx import and
export.
Change-Id: I836aeb5e0f24e2c8d5725834c8c0f98083bc82e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89125
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'svx/inc')
5 files changed, 22 insertions, 3 deletions
diff --git a/svx/inc/sdr/attribute/sdrlinefillshadowtextattribute.hxx b/svx/inc/sdr/attribute/sdrlinefillshadowtextattribute.hxx index 519800e7dd02..f9d7969e519a 100644 --- a/svx/inc/sdr/attribute/sdrlinefillshadowtextattribute.hxx +++ b/svx/inc/sdr/attribute/sdrlinefillshadowtextattribute.hxx @@ -41,7 +41,8 @@ namespace drawinglayer const SdrLineStartEndAttribute& rLineStartEnd, const SdrShadowAttribute& rShadow, const FillGradientAttribute& rFillFloatTransGradient, - const SdrTextAttribute& rTextAttribute); + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow); SdrLineFillShadowTextAttribute(); SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate); SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate); diff --git a/svx/inc/sdr/attribute/sdrlineshadowtextattribute.hxx b/svx/inc/sdr/attribute/sdrlineshadowtextattribute.hxx index af7df7982422..840b20e44cc9 100644 --- a/svx/inc/sdr/attribute/sdrlineshadowtextattribute.hxx +++ b/svx/inc/sdr/attribute/sdrlineshadowtextattribute.hxx @@ -20,6 +20,7 @@ #pragma once #include <sdr/attribute/sdrshadowtextattribute.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> #include <drawinglayer/attribute/sdrlineattribute.hxx> #include <drawinglayer/attribute/sdrlinestartendattribute.hxx> @@ -39,7 +40,8 @@ namespace drawinglayer const SdrLineAttribute& rLine, const SdrLineStartEndAttribute& rLineStartEnd, const SdrShadowAttribute& rShadow, - const SdrTextAttribute& rTextAttribute); + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow); SdrLineShadowTextAttribute(); SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate); SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate); diff --git a/svx/inc/sdr/attribute/sdrshadowtextattribute.hxx b/svx/inc/sdr/attribute/sdrshadowtextattribute.hxx index c58437b70928..bbcd7e95a501 100644 --- a/svx/inc/sdr/attribute/sdrshadowtextattribute.hxx +++ b/svx/inc/sdr/attribute/sdrshadowtextattribute.hxx @@ -21,6 +21,7 @@ #include <drawinglayer/attribute/sdrshadowattribute.hxx> #include <sdr/attribute/sdrtextattribute.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> namespace drawinglayer @@ -33,10 +34,14 @@ namespace drawinglayer SdrShadowAttribute maShadow; // shadow attributes (if used) SdrTextAttribute maTextAttribute; // text and text attributes (if used) + // glow effect + SdrGlowAttribute maGlow; + public: SdrShadowTextAttribute( const SdrShadowAttribute& rShadow, - const SdrTextAttribute& rTextAttribute); + const SdrTextAttribute& rTextAttribute, + const SdrGlowAttribute& rGlow); SdrShadowTextAttribute(); SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate); SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate); @@ -50,6 +55,7 @@ namespace drawinglayer // data access const SdrShadowAttribute& getShadow() const { return maShadow; } const SdrTextAttribute& getText() const { return maTextAttribute; } + const SdrGlowAttribute& getGlow() const { return maGlow; } }; } // end of namespace attribute } // end of namespace drawinglayer diff --git a/svx/inc/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx index 1d9e17d60d2a..da0242eed3a5 100644 --- a/svx/inc/sdr/primitive2d/sdrattributecreator.hxx +++ b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx @@ -31,6 +31,7 @@ namespace drawinglayer { namespace attribute { class SdrLineAttribute; class SdrLineStartEndAttribute; class SdrShadowAttribute; + class SdrGlowAttribute; class SdrFillAttribute; class SdrTextAttribute; class FillGradientAttribute; @@ -67,6 +68,9 @@ namespace drawinglayer attribute::SdrFillAttribute SVXCORE_DLLPUBLIC createNewSdrFillAttribute( const SfxItemSet& rSet); + attribute::SdrGlowAttribute createNewSdrGlowAttribute( + const SfxItemSet& rSet); + // #i101508# Support handing over given text-to-border distances attribute::SdrTextAttribute createNewSdrTextAttribute( const SfxItemSet& rSet, diff --git a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx index f55edda1b7c1..6a2cf1993305 100644 --- a/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/svx/inc/sdr/primitive2d/sdrdecompositiontools.hxx @@ -20,6 +20,8 @@ #pragma once #include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/attribute/sdrglowattribute.hxx> + #include <svx/svxdllapi.h> // predefines @@ -71,6 +73,10 @@ namespace drawinglayer const Primitive2DContainer& rContent, const attribute::SdrShadowAttribute& rShadow); + Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedGlowPrimitive( + const Primitive2DContainer& rContent, + const attribute::SdrGlowAttribute& rGlow); + } // end of namespace primitive2d } // end of namespace drawinglayer |