1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETESHADOWPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETESHADOWPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/primitivetools2d.hxx>
26 #include <vcl/bitmapex.hxx>
27 #include <basegfx/matrix/b2dhommatrix.hxx>
30 // DiscreteShadowPrimitive2D class
32 namespace drawinglayer
36 /** DiscreteShadow data class
39 class DRAWINGLAYER_DLLPUBLIC DiscreteShadow
42 /// the original shadow BitmapEx in a special form
45 /// buffered extracted parts of CombinedShadow for easier usage
50 BitmapEx maBottomRight
;
52 BitmapEx maBottomLeft
;
57 explicit DiscreteShadow(const BitmapEx
& rBitmapEx
);
60 const BitmapEx
& getBitmapEx() const { return maBitmapEx
; }
63 bool operator==(const DiscreteShadow
& rCompare
) const
65 return getBitmapEx() == rCompare
.getBitmapEx();
68 /// helper accesses which create on-demand needed segments
69 const BitmapEx
& getTopLeft() const;
70 const BitmapEx
& getTop() const;
71 const BitmapEx
& getTopRight() const;
72 const BitmapEx
& getRight() const;
73 const BitmapEx
& getBottomRight() const;
74 const BitmapEx
& getBottom() const;
75 const BitmapEx
& getBottomLeft() const;
76 const BitmapEx
& getLeft() const;
79 /** DiscreteShadowPrimitive2D class
82 class DRAWINGLAYER_DLLPUBLIC DiscreteShadowPrimitive2D
: public DiscreteMetricDependentPrimitive2D
85 // the object transformation of the rectangular object
86 basegfx::B2DHomMatrix maTransform
;
88 // the bitmap shadow data
89 DiscreteShadow maDiscreteShadow
;
92 /// create local decomposition
93 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
97 DiscreteShadowPrimitive2D(
98 const basegfx::B2DHomMatrix
& rTransform
,
99 const DiscreteShadow
& rDiscreteShadow
);
102 const basegfx::B2DHomMatrix
& getTransform() const { return maTransform
; }
103 const DiscreteShadow
& getDiscreteShadow() const { return maDiscreteShadow
; }
106 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
109 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
111 /// provide unique ID
112 DeclPrimitive2DIDBlock()
114 } // end of namespace primitive2d
115 } // end of namespace drawinglayer
119 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETESHADOWPRIMITIVE2D_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */