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