xref: /AOO41X/main/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx (revision 4f506f19cd544df9572ed8c88b6bdbc6c8f33210)
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_DISCRETEBITMAPPRIMITIVE2D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive2d/primitivetools2d.hxx>
29 #include <vcl/bitmapex.hxx>
30 
31 //////////////////////////////////////////////////////////////////////////////
32 // DiscreteBitmapPrimitive2D class
33 
34 namespace drawinglayer
35 {
36     namespace primitive2d
37     {
38         /** DiscreteBitmapPrimitive2D class
39 
40             This class defines a view-dependent BitmapPrimitive which has a
41             logic position for the top-left position and is always to be
42             painted in 1:1 pixel resolution. It will never be sheared, rotated
43             or scaled with the view.
44          */
45         class DRAWINGLAYER_DLLPUBLIC DiscreteBitmapPrimitive2D : public ObjectAndViewTransformationDependentPrimitive2D
46         {
47         private:
48             /// the RGBA Bitmap-data
49             BitmapEx                                    maBitmapEx;
50 
51             /** the top-left object position */
52             basegfx::B2DPoint                           maTopLeft;
53 
54         protected:
55             /// local decomposition.
56             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
57 
58         public:
59             /// constructor
60             DiscreteBitmapPrimitive2D(
61                 const BitmapEx& rBitmapEx,
62                 const basegfx::B2DPoint& rTopLeft);
63 
64             /// data read access
getBitmapEx() const65             const BitmapEx& getBitmapEx() const { return maBitmapEx; }
getTopLeft() const66             const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
67 
68             /// compare operator
69             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
70 
71             /// provide unique ID
72             DeclPrimitrive2DIDBlock()
73         };
74     } // end of namespace primitive2d
75 } // end of namespace drawinglayer
76 
77 //////////////////////////////////////////////////////////////////////////////
78 
79 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
80 
81 //////////////////////////////////////////////////////////////////////////////
82 // eof
83