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_FILLGRAPHICPRIMITIVE2D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 29 #include <basegfx/matrix/b2dhommatrix.hxx> 30 #include <drawinglayer/attribute/fillgraphicattribute.hxx> 31 32 ////////////////////////////////////////////////////////////////////////////// 33 // FillbitmapPrimitive2D class 34 35 namespace drawinglayer 36 { 37 namespace primitive2d 38 { 39 /** FillGraphicPrimitive2D class 40 41 This class defines a bitmap filling for a rectangular area. The 42 Range is defined by the Transformation, the fill by the FillGraphicAttribute. 43 There, the fill consists of a Bitmap (not transparent) defining the fill data 44 and a Point/Vector pair defining the relative position/size [0.0 .. 1.0] 45 inside the area where the bitmap is positioned. A flag defines then if this 46 is tiled or not. 47 48 Renderers should handle this primitive; it has a geometrically correct 49 decomposition, but on pixel oututs the areas where the tiled pieces are 50 aligned tend to show up (one overlapping or empty pixel) 51 */ 52 class DRAWINGLAYER_DLLPUBLIC FillGraphicPrimitive2D : public BufferedDecompositionPrimitive2D 53 { 54 private: 55 /// the geometric definition 56 basegfx::B2DHomMatrix maTransformation; 57 58 /// the fill attributes 59 attribute::FillGraphicAttribute maFillGraphic; 60 61 protected: 62 /// local decomposition. 63 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 64 65 public: 66 /// constructor 67 FillGraphicPrimitive2D( 68 const basegfx::B2DHomMatrix& rTransformation, 69 const attribute::FillGraphicAttribute& rFillGraphic); 70 71 /// data read access getTransformation() const72 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } getFillGraphic() const73 const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; } 74 75 /// compare operator 76 virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; 77 78 /// get range 79 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; 80 81 /// provide unique ID 82 DeclPrimitrive2DIDBlock() 83 }; 84 } // end of namespace primitive2d 85 } // end of namespace drawinglayer 86 87 ////////////////////////////////////////////////////////////////////////////// 88 89 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRAPHICPRIMITIVE2D_HXX 90 91 ////////////////////////////////////////////////////////////////////////////// 92 // eof 93