aboutsummaryrefslogtreecommitdiff
path: root/source/jv/setup_native
AgeCommit message (Expand)Author
2017-07-12update translationsChristian Lohmaier
='feature/orcus-odf-rebased2'>feature/orcus-odf-rebased2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/include/drawinglayer/primitive2d/glowprimitive2d.hxx
AgeCommit message (Collapse)Author
2022-09-14Rework of ShadowPrimitive2DArmin Le Grand (allotropia)
This is pretty much the same for ShadowPrimitive2D as the change for GlowPrimitive2D and SoftEdgePrimitive2D, so for more comments please refer to those commits: c2d1458723c66c2fd717a112f89f773226adc841 707b0c328a282d993fa33b618083d20b6c521de6 There are some needed differences due to ShadowPrimitive2D having existed longer and is used for non-blurred shadow for a long time and is used as unchanged as possible. Only for active glow of shadow is a buffering and local decompose used. Change-Id: I55e6516f59390079356ac16f24743b474e53fb05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139858 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-01Added BufferedDecompositionGroupPrimitive2DArmin Le Grand (allotropia)
...and adapted GlowPrimitive2D to it as a preparation to use similar to BufferedDecompositionPrimitive2D, but for primitives based on GroupPrimitive2D. Change-Id: Ia1f9a09d4db09238ebbf6ad1303a4cdbdb8baedf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139099 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-08-31Rework of GlowPrimitive2DArmin Le Grand (allotropia)
The new version does all needed stuff inside the GlowPrimitive2D implementation. Advantages are: - there is no need anymore to handle directly in the renderer implementations. That includes HitTest & future renderers, but also the currently existing fallback from MetafileRenderer to PixelRenderer - the buffered B2Primitive can re-use the last, potentially expensively cerated pixelation result - it checks for the possibility to do so using various aspects (see implementation, more would be possible) - it no longer uses impBufferDevice in the not wanted double-vdev/alpha-channel mode from presentation engine - it offers an example how to do all this with just a primitive (that can be replaced with another impl if needed without having to adapt any renderers). To support that, I added plenty of comments The group of GlowPrimitive2D, SoftEdgePrimitive2D and ShadowPrimitive2D use impBufferDevice in that much slower and expensive mode (two VDevs, processor-based alpha mixing). To get back to faster transparence rendering in general this is a 1st step, we also will need to re-work the other two mentioned primitives. The reworked one is now more efficient. Change-Id: I25c6fb970682b5311ce6f9ca4abf2702fb7c8862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138973 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-09-09tdf#144052 reduce Primitive2D copyingNoel Grandin
when creating charts, by using a Primitive2DContainer&& parameter in the GroupPrimitive2D constructor, which forces the call sites to pass a temporary, and at most call sites, we can std::move in an existing local variable. Change-Id: I531970918800c6832ab606b5a4ff5fd2d47ccf5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-13tdf#42949 Fix IWYU warnings in include/[a-r]*/*hxxGabor Kelemen
Recheck after 7-0 branchoff Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7f5c35474b671facbda85a9538462dd4291add91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97655 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-29tdf#101181: use buffer device with alpha in glow effectMike Kaganski
Change-Id: Iddc94a5cfdee03befdf245ee086a872f0bfaf7a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95051 Tested-by: Jenkins Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-10drawinglayer: simplify namespaces in ALL primitive2d headersTomaž Vajngerl
Change-Id: Id6a78663b4b2224497741c5acb8724741df1d70b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93913 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-10pragma once for the rest of primitive2d headersTomaž Vajngerl
Change-Id: I7c13aedfd41d12a3294aaf694a0c969630296e55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93911 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-07tdf#101181: improve glow effectMike Kaganski
The shadow of objects must not be scaled: this displaces any internal areas that need blur, e.g. holes. Instead, it needs to dilate the shadow using kernel with radius equal to blur radius: this allows the borders of dilated objects to be in the middle of the blur area. The following blur makes those new margin points to have 50% intensity, and full glow intensity at the point of old object margins. This also removed artifacts when moving objects with glow effect caused by mismatch between scaling and D2D range calculation. The D2D range therefore is not calculated by scaling, but using grow. Blur filter's "extend bitmap by blur radius" option got obsoleted and removed. There's no need to blur the glow color (24-bit RGB). Instead, glow bitmap must be filled by glow color, and have an alpha mask that is blurred accordingly. This makes the glow properly transparent, and also reduces the blur complexity which now only needs to process 8 bits of alpha channel. The object shadow is created using basegfx::BColorModifier_replace inserted into the 2d decomposition of the effect, as before. To make sure that any non-fully-transparent pixel will become black pixel in the shadow, black color is used, and the result is further processed in VclPixelProcessor2D::processGlowPrimitive2D with monochrome filter using threshold 255. Glow transparency attribute is taken into account: the initial value at the margins of the objects. Color replacement filter is used to replace the object shadow with the attribute value before blur pass. Correct blur radius is used, calculated from glow effect radius, instead of hardcoded value of 5 pixels. This makes the glow to fade gradually along the full width of the effect, instead of only fading in narrow outer border previously. Since blur filter is only implemented for radius up to 254 pixels, and since downsampling the shadow before blur increases performance without noticeable quality loss, the image is downsampled before filtering. It should be noted that the glow effect is almost identical to soft shadow effect, likely with the only difference of using dilation in the former, but not in the latter. The code might be reused later to implement soft shadow as well. Change-Id: I728c532f9df7ccf85f353c23c6c7d8352d7b2086 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93235 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-03tdf#101181 Implement glow effect on shapesTamas Bunth
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>