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/graphicprimitive2d.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/BufferedDecompositionPrimitive2D.hxx>
25
#include <basegfx/matrix/b2dhommatrix.hxx>
26
#include <vcl/GraphicObject.hxx>
27
28
namespace drawinglayer::primitive2d
29
{
30
/** GraphicPrimitive2D class
31
32
    Primitive to hold graphics defined by GraphicObject and GraphicAttr
33
    combination. This includes MetaFiles and diverse pixel-oriented graphic
34
    formats. It even includes animated GIFs, Croppings and other changes
35
    defined in GraphicAttr.
36
37
    This makes the decomposition contain a wide variety of possibilities,
38
    too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
39
    MetafilePrimitive2D (with and without embedding in a masking when e.g.
40
    the Metafile is bigger than the geometry) and embeddings in
41
    TransformPrimitive2D and MaskPrimitive2D for croppings.
42
43
    The primitive geometry area is defined by Transform.
44
 */
45
class DRAWINGLAYER_DLLPUBLIC GraphicPrimitive2D final : public BufferedDecompositionPrimitive2D
46
{
47
private:
48
    /// the geometric definition
49
    basegfx::B2DHomMatrix maTransform;
50
51
    /// the GraphicObject with all its content possibilities
52
    GraphicObject maGraphicObject;
53
54
    /// The GraphicAttr with all its modification possibilities
55
    GraphicAttr maGraphicAttr;
56
57
    /// local decomposition
58
    virtual Primitive2DReference
59
    create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override;
60
61
public:
62
    /// constructor(s)
63
    GraphicPrimitive2D(basegfx::B2DHomMatrix aTransform, const GraphicObject& rGraphicObject,
64
                       const GraphicAttr& rGraphicAttr);
65
    GraphicPrimitive2D(basegfx::B2DHomMatrix aTransform, const GraphicObject& rGraphicObject);
66
67
    /// data read access
68
774
    const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
69
710
    const GraphicObject& getGraphicObject() const { return maGraphicObject; }
70
2.79k
    const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
71
72
    /// compare operator
73
    virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
74
75
    /// get range
76
    virtual basegfx::B2DRange
77
    getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
78
79
    /// provide unique ID
80
    virtual sal_uInt32 getPrimitive2DID() const override;
81
};
82
83
} // end of namespace drawinglayer::primitive2d
84
85
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */