Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / drawinglayer / primitive2d / fillgraphicprimitive2d.hxx
blob9008ccc9189b19e25042ae045d034c3386556be5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
20 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
26 #include <drawinglayer/attribute/fillgraphicattribute.hxx>
29 // FillbitmapPrimitive2D class
31 namespace drawinglayer
33 namespace primitive2d
35 /** FillGraphicPrimitive2D class
37 This class defines a bitmap filling for a rectangular area. The
38 Range is defined by the Transformation, the fill by the FillGraphicAttribute.
39 There, the fill consists of a Bitmap (not transparent) defining the fill data
40 and a Point/Vector pair defining the relative position/size [0.0 .. 1.0]
41 inside the area where the bitmap is positioned. A flag defines then if this
42 is tiled or not.
44 Renderers should handle this primitive; it has a geometrically correct
45 decomposition, but on pixel oututs the areas where the tiled pieces are
46 aligned tend to show up (one overlapping or empty pixel)
48 class DRAWINGLAYER_DLLPUBLIC FillGraphicPrimitive2D : public BufferedDecompositionPrimitive2D
50 private:
51 /// the geometric definition
52 basegfx::B2DHomMatrix maTransformation;
54 /// the fill attributes
55 attribute::FillGraphicAttribute maFillGraphic;
57 protected:
58 /// local decomposition.
59 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
61 public:
62 /// constructor
63 FillGraphicPrimitive2D(
64 const basegfx::B2DHomMatrix& rTransformation,
65 const attribute::FillGraphicAttribute& rFillGraphic);
67 /// data read access
68 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
69 const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; }
71 /// compare operator
72 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override;
74 /// get range
75 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
77 /// provide unique ID
78 DeclPrimitive2DIDBlock()
80 } // end of namespace primitive2d
81 } // end of namespace drawinglayer
84 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */