GSoC’20 Blurry Shadows
The shadow of objects in LibreOffice is just a copy of the original object without any effects. It has attributes for transparency, angle, distance, and color. Currently, users have the ability to enable the shadow for the object, change its color, its angle, distance behind the object, and its transparency. The main target of the project is the addition of a new feature that blurs the shadow of any given shape. In order to add this feature, a blur attribute is added to the shadow’s attributes. This attribute is used to change the amount of blurring that is to be applied to the shadow. In addition, the shadow’s files are updated to support/include information about the new blur feature. Finally, the UI is extended to control the value of the blur through a spin button which is added in the shadow sidebar.
Figure : The current state of the shadow in LibreOffice
Figure : The result of implementing the blur effect to shadow,
Implementation for a blur shadow feature
Modified SdrShadowAttribute Class to have an attribute for the blur, updated the class methods to get and set the blur attribute.
Added SDRATTR_SHADOWBLUR to shadow attributes as a metric item.
Define UNO name for ShadowBlur
Added shadow blur into shadow properties definition
Modified shadowprimitive2d class to have an attribute for the blur, updated the class methods
Implemented processShadowPrimitive2D function which uses the blur radius from the shadowprimitive2d to generate a mask for the blurred shadow bitmap.
Feature support on OOXML
Added shadow blur attribute to EffectShadowProperties struct
Updated pushToPropMap function to set a property for shadow blur as PROP_ShadowBlur
Updated outershdw case to support shadow blur attribute
Define a shadow blur SVX id
Modify ShadowProperities.idl to have shadow blur as a new property.
Added import/export OOXML support for our new feature.
Implemented testShapeBlurPPTXImport function to test blur import
Feature support on ODF.
Added import/export ODF support for our new feature.
Add two test functions for OOXML and ODF export.
Extend UI for controlling the feature.
Updated shadow property panel with a spin button to control the blur radius of the shadow.
Modified the sidebar UI file to include the spin button.
Update the shadow tab in area dialog with another spin button to control the blur from the shadow tab
Modified the shadow tab UI file to include the spin button.
The shadow appears solid instead of blurry in presentation mode
Shadow blur inside area dialog preview
Area dialog preview doesn’t support the blur of the shadow. I have tried to add support for the blur it was a hard task until my mentor recommended a way to try which actually solved it. It seems to be working but not in an efficient way yet.
HOW TO SEE IT WORK:
My work is available in the origin master, so you can follow the build steps
from here: https://wiki.documentfoundation.org/Development/BuildingOnLinux, It will help you build and run all LibreOffice modules. You can try opening impress after building successfully by this terminal command:
$ instdir/program/soffice --impress
Then, use any shape and apply blur to it from the sidebar or shadow tab.