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