GSoC’20 Blurry Shadows

 


Final Report

PROJECT ABSTRACTION

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.

                                    

              [1]                                  [2] 


Figure [1]: The current state of the shadow in LibreOffice

Figure [2]: The result of implementing the blur effect to shadow, 



DELIVERABLES

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.


CODE PATCH:https://gerrit.libreoffice.org/c/core/+/95000

https://gerrit.libreoffice.org/c/core/+/95388 

https://gerrit.libreoffice.org/c/core/+/95859

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


CODE PATCH:https://gerrit.libreoffice.org/c/core/+/95090/6


Feature support on ODF.

  • Added import/export ODF support for our new feature.

  • Add two test functions for OOXML and ODF export.


CODE PATCH:https://gerrit.libreoffice.org/c/core/+/96907


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.


CODE PATH:https://gerrit.libreoffice.org/c/core/+/98718    

                      https://gerrit.libreoffice.org/c/core/+/99557


SOLVED BUGS

  • The shadow appears solid instead of blurry in presentation mode


CODE PATCH:https://gerrit.libreoffice.org/c/core/+/100861



ADDITIONAL WORK

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.


CODE PATH:https://gerrit.libreoffice.org/c/core/+/101400

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.



Comments

Post a Comment