Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / drawinglayer / primitive2d / fillbitmapprimitive2d.hxx
blob377354a34500a3ec2fcc495f2fbffd7e8571e025
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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
27 #include <drawinglayer/attribute/fillbitmapattribute.hxx>
30 // FillbitmapPrimitive2D class
32 namespace drawinglayer
34 namespace primitive2d
36 /** FillBitmapPrimitive2D class
38 This class defines a bitmap filling for a rectangular area. The
39 Range is defined by the Transformation, the fill by the FillBitmapAttribute.
40 There, the fill consists of a Bitmap (not transparent) defining the fill data
41 and a Point/Vector pair defining the relative position/size [0.0 .. 1.0]
42 inside the area where the bitmap is positioned. A flag defines then if this
43 is tiled or not.
45 Renderers should handle this primitive; it has a geometrically correct
46 decomposition, but on pixel oututs the areas where the tiled pieces are
47 aligned tend to show up (one overlapping or empty pixel)
49 class DRAWINGLAYER_DLLPUBLIC FillBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
51 private:
52 /// the geometric definition
53 basegfx::B2DHomMatrix maTransformation;
55 /// the fill attributes
56 attribute::FillBitmapAttribute maFillBitmap;
58 protected:
59 /// local decomposition.
60 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
62 public:
63 /// constructor
64 FillBitmapPrimitive2D(
65 const basegfx::B2DHomMatrix& rTransformation,
66 const attribute::FillBitmapAttribute& rFillBitmap);
68 /// data read access
69 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
70 const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
72 /// compare operator
73 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
75 /// get range
76 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
78 /// provide unique ID
79 DeclPrimitive2DIDBlock()
81 } // end of namespace primitive2d
82 } // end of namespace drawinglayer
85 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLBITMAPPRIMITIVE2D_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */