xref: /trunk/main/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
29 #include <vcl/bitmapex.hxx>
30 #include <basegfx/matrix/b2dhommatrix.hxx>
31 
32 //////////////////////////////////////////////////////////////////////////////
33 // BitmapPrimitive2D class
34 
35 namespace drawinglayer
36 {
37     namespace primitive2d
38     {
39         /** BitmapPrimitive2D class
40 
41             This class is the central primitive for Bitmap-based primitives.
42             It provides RGBA-based bitmaps, currently using a BitmapEx from VCL.
43             This may change in the future to any other, maybe more general base
44             class providing 24bit RGBA.
45          */
46         class DRAWINGLAYER_DLLPUBLIC BitmapPrimitive2D : public BasePrimitive2D
47         {
48         private:
49             /// the RGBA Bitmap-data
50             BitmapEx                                    maBitmapEx;
51 
52             /** the object transformation from unit coordinates, defining
53                 size, shear, rotate and position
54              */
55             basegfx::B2DHomMatrix                       maTransform;
56 
57         public:
58             /// constructor
59             BitmapPrimitive2D(
60                 const BitmapEx& rBitmapEx,
61                 const basegfx::B2DHomMatrix& rTransform);
62 
63             /// data read access
getBitmapEx() const64             const BitmapEx& getBitmapEx() const { return maBitmapEx; }
getTransform() const65             const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
66 
67             /// compare operator
68             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
69 
70             /// get range
71             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
72 
73             /// provide unique ID
74             DeclPrimitrive2DIDBlock()
75         };
76     } // end of namespace primitive2d
77 } // end of namespace drawinglayer
78 
79 //////////////////////////////////////////////////////////////////////////////
80 
81 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BITMAPPRIMITIVE2D_HXX
82 
83 //////////////////////////////////////////////////////////////////////////////
84 // eof
85