Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#pragma once
21
22
#include <drawinglayer/drawinglayerdllapi.h>
23
24
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
25
26
27
namespace drawinglayer::primitive2d
28
{
29
        /** UnifiedTransparencePrimitive2D class
30
31
            This primitive encapsulates a child hierarchy and defines
32
            that it shall be visualized with the given transparency. That
33
            transparency is unique for all contained geometry, so that
34
            e.g. overlapping polygons in the child geometry will not show
35
            regions of combined transparency, but be all rendered with the
36
            defined, single transparency.
37
         */
38
        class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D final : public GroupPrimitive2D
39
        {
40
        private:
41
            /// the unified transparence
42
            double                              mfTransparence;
43
44
        public:
45
            /// constructor
46
            UnifiedTransparencePrimitive2D(
47
                Primitive2DContainer&& rChildren,
48
                double fTransparence);
49
50
            /// data read access
51
0
            double getTransparence() const { return mfTransparence; }
52
53
            /// compare operator
54
            virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
55
56
            /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
57
            virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
58
59
            /// create decomposition
60
            virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
61
62
            /// provide unique ID
63
            virtual sal_uInt32 getPrimitive2DID() const override;
64
        };
65
} // end of namespace drawinglayer::primitive2d
66
67
68
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */