Line data Source code
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 : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
20 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
21 :
22 : #include <drawinglayer/drawinglayerdllapi.h>
23 :
24 : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 : #include <basegfx/matrix/b2dhommatrix.hxx>
26 : #include <drawinglayer/attribute/fillgraphicattribute.hxx>
27 :
28 :
29 : // FillbitmapPrimitive2D class
30 :
31 : namespace drawinglayer
32 : {
33 : namespace primitive2d
34 : {
35 : /** FillGraphicPrimitive2D class
36 :
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.
43 :
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)
47 : */
48 814 : class DRAWINGLAYER_DLLPUBLIC FillGraphicPrimitive2D : public BufferedDecompositionPrimitive2D
49 : {
50 : private:
51 : /// the geometric definition
52 : basegfx::B2DHomMatrix maTransformation;
53 :
54 : /// the fill attributes
55 : attribute::FillGraphicAttribute maFillGraphic;
56 :
57 : protected:
58 : /// local decomposition.
59 : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
60 :
61 : public:
62 : /// constructor
63 : FillGraphicPrimitive2D(
64 : const basegfx::B2DHomMatrix& rTransformation,
65 : const attribute::FillGraphicAttribute& rFillGraphic);
66 :
67 : /// data read access
68 668 : const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
69 339 : const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; }
70 :
71 : /// compare operator
72 : virtual bool operator==( const BasePrimitive2D& rPrimitive ) const SAL_OVERRIDE;
73 :
74 : /// get range
75 : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
76 :
77 : /// provide unique ID
78 : DeclPrimitive2DIDBlock()
79 : };
80 : } // end of namespace primitive2d
81 : } // end of namespace drawinglayer
82 :
83 :
84 :
85 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX
86 :
87 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|