discreteshadowprimitive2d.cxx (464702f4) discreteshadowprimitive2d.cxx (6de8cae6)
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

--- 50 unchanged lines hidden (view full) ---

59
60 const BitmapEx& DiscreteShadow::getTopLeft() const
61 {
62 if(maTopLeft.IsEmpty())
63 {
64 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
65 const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx();
66 const_cast< DiscreteShadow* >(this)->maTopLeft.Crop(
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

--- 50 unchanged lines hidden (view full) ---

59
60 const BitmapEx& DiscreteShadow::getTopLeft() const
61 {
62 if(maTopLeft.IsEmpty())
63 {
64 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
65 const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx();
66 const_cast< DiscreteShadow* >(this)->maTopLeft.Crop(
67 Rectangle(Point(0,0),Size(nQuarter*2+1,nQuarter*2+1)));
67 Rectangle(Point(0, 0), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1)));
68 }
69
70 return maTopLeft;
71 }
72
73 const BitmapEx& DiscreteShadow::getTop() const
74 {
75 if(maTop.IsEmpty())
76 {
77 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
78 const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx();
79 const_cast< DiscreteShadow* >(this)->maTop.Crop(
68 }
69
70 return maTopLeft;
71 }
72
73 const BitmapEx& DiscreteShadow::getTop() const
74 {
75 if(maTop.IsEmpty())
76 {
77 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
78 const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx();
79 const_cast< DiscreteShadow* >(this)->maTop.Crop(
80 Rectangle(Point(nQuarter*2+1,0),Size(1,nQuarter+1)));
80 Rectangle(Point((nQuarter * 2) + 1, 0), Size(1, nQuarter)));
81 }
82
83 return maTop;
84 }
85
86 const BitmapEx& DiscreteShadow::getTopRight() const
87 {
88 if(maTopRight.IsEmpty())
89 {
90 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
91 const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx();
92 const_cast< DiscreteShadow* >(this)->maTopRight.Crop(
81 }
82
83 return maTop;
84 }
85
86 const BitmapEx& DiscreteShadow::getTopRight() const
87 {
88 if(maTopRight.IsEmpty())
89 {
90 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
91 const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx();
92 const_cast< DiscreteShadow* >(this)->maTopRight.Crop(
93 Rectangle(Point(nQuarter*2+2,0),Size(nQuarter*2+1,nQuarter*2+1)));
93 Rectangle(Point((nQuarter * 2) + 2, 0), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1)));
94 }
95
96 return maTopRight;
97 }
98
99 const BitmapEx& DiscreteShadow::getRight() const
100 {
101 if(maRight.IsEmpty())
102 {
103 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
104 const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx();
105 const_cast< DiscreteShadow* >(this)->maRight.Crop(
94 }
95
96 return maTopRight;
97 }
98
99 const BitmapEx& DiscreteShadow::getRight() const
100 {
101 if(maRight.IsEmpty())
102 {
103 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
104 const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx();
105 const_cast< DiscreteShadow* >(this)->maRight.Crop(
106 Rectangle(Point(nQuarter*3+2,nQuarter*2+1),Size(nQuarter+1,1)));
106 Rectangle(Point((nQuarter * 3) + 3, (nQuarter * 2) + 1), Size(nQuarter, 1)));
107 }
108
109 return maRight;
110 }
111
112 const BitmapEx& DiscreteShadow::getBottomRight() const
113 {
114 if(maBottomRight.IsEmpty())
115 {
116 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
117 const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx();
118 const_cast< DiscreteShadow* >(this)->maBottomRight.Crop(
107 }
108
109 return maRight;
110 }
111
112 const BitmapEx& DiscreteShadow::getBottomRight() const
113 {
114 if(maBottomRight.IsEmpty())
115 {
116 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
117 const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx();
118 const_cast< DiscreteShadow* >(this)->maBottomRight.Crop(
119 Rectangle(Point(nQuarter*2+2,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1)));
119 Rectangle(Point((nQuarter * 2) + 2, (nQuarter * 2) + 2), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1)));
120 }
121
122 return maBottomRight;
123 }
124
125 const BitmapEx& DiscreteShadow::getBottom() const
126 {
127 if(maBottom.IsEmpty())
128 {
129 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
130 const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx();
131 const_cast< DiscreteShadow* >(this)->maBottom.Crop(
120 }
121
122 return maBottomRight;
123 }
124
125 const BitmapEx& DiscreteShadow::getBottom() const
126 {
127 if(maBottom.IsEmpty())
128 {
129 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
130 const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx();
131 const_cast< DiscreteShadow* >(this)->maBottom.Crop(
132 Rectangle(Point(nQuarter*2+1,nQuarter*3+2),Size(1,nQuarter+1)));
132 Rectangle(Point((nQuarter * 2) + 1, (nQuarter * 3) + 3), Size(1, nQuarter)));
133 }
134
135 return maBottom;
136 }
137
138 const BitmapEx& DiscreteShadow::getBottomLeft() const
139 {
140 if(maBottomLeft.IsEmpty())
141 {
142 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
143 const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx();
144 const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop(
133 }
134
135 return maBottom;
136 }
137
138 const BitmapEx& DiscreteShadow::getBottomLeft() const
139 {
140 if(maBottomLeft.IsEmpty())
141 {
142 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
143 const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx();
144 const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop(
145 Rectangle(Point(0,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1)));
145 Rectangle(Point(0, (nQuarter * 2) + 2), Size((nQuarter * 2) + 1, (nQuarter * 2) + 1)));
146 }
147
148 return maBottomLeft;
149 }
150
151 const BitmapEx& DiscreteShadow::getLeft() const
152 {
153 if(maLeft.IsEmpty())
154 {
155 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
156 const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx();
157 const_cast< DiscreteShadow* >(this)->maLeft.Crop(
146 }
147
148 return maBottomLeft;
149 }
150
151 const BitmapEx& DiscreteShadow::getLeft() const
152 {
153 if(maLeft.IsEmpty())
154 {
155 const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
156 const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx();
157 const_cast< DiscreteShadow* >(this)->maLeft.Crop(
158 Rectangle(Point(0,nQuarter*2+1),Size(nQuarter+1,1)));
158 Rectangle(Point(0, (nQuarter * 2) + 1), Size(nQuarter, 1)));
159 }
160
161 return maLeft;
162 }
163
164 } // end of namespace primitive2d
165} // end of namespace drawinglayer
166

--- 20 unchanged lines hidden (view full) ---

187
188 xRetval.realloc(8);
189
190 // TopLeft
191 xRetval[0] = Primitive2DReference(
192 new BitmapPrimitive2D(
193 getDiscreteShadow().getTopLeft(),
194 basegfx::tools::createScaleTranslateB2DHomMatrix(
159 }
160
161 return maLeft;
162 }
163
164 } // end of namespace primitive2d
165} // end of namespace drawinglayer
166

--- 20 unchanged lines hidden (view full) ---

187
188 xRetval.realloc(8);
189
190 // TopLeft
191 xRetval[0] = Primitive2DReference(
192 new BitmapPrimitive2D(
193 getDiscreteShadow().getTopLeft(),
194 basegfx::tools::createScaleTranslateB2DHomMatrix(
195 fBigLenX,
195 fBigLenX,
196 fBigLenY,
196 fBigLenY,
197 -fBorderX,
197 -fBorderX,
198 -fBorderY)));
199
200 // Top
201 xRetval[1] = Primitive2DReference(
202 new BitmapPrimitive2D(
203 getDiscreteShadow().getTop(),
204 basegfx::tools::createScaleTranslateB2DHomMatrix(
198 -fBorderY)));
199
200 // Top
201 xRetval[1] = Primitive2DReference(
202 new BitmapPrimitive2D(
203 getDiscreteShadow().getTop(),
204 basegfx::tools::createScaleTranslateB2DHomMatrix(
205 1.0 - (2.0 * fBorderX) - fSingleX,
206 fBorderY + fSingleY,
207 fBorderX + fSingleX,
205 1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX,
206 fBorderY,
207 fBorderX + fSingleX,
208 -fBorderY)));
209
210 // TopRight
211 xRetval[2] = Primitive2DReference(
212 new BitmapPrimitive2D(
213 getDiscreteShadow().getTopRight(),
214 basegfx::tools::createScaleTranslateB2DHomMatrix(
208 -fBorderY)));
209
210 // TopRight
211 xRetval[2] = Primitive2DReference(
212 new BitmapPrimitive2D(
213 getDiscreteShadow().getTopRight(),
214 basegfx::tools::createScaleTranslateB2DHomMatrix(
215 fBigLenX,
215 fBigLenX,
216 fBigLenY,
216 fBigLenY,
217 1.0 - fBorderX,
217 1.0 - fBorderX,
218 -fBorderY)));
219
220 // Right
221 xRetval[3] = Primitive2DReference(
222 new BitmapPrimitive2D(
223 getDiscreteShadow().getRight(),
224 basegfx::tools::createScaleTranslateB2DHomMatrix(
218 -fBorderY)));
219
220 // Right
221 xRetval[3] = Primitive2DReference(
222 new BitmapPrimitive2D(
223 getDiscreteShadow().getRight(),
224 basegfx::tools::createScaleTranslateB2DHomMatrix(
225 fBorderX + fSingleX,
226 1.0 - (2.0 * fBorderY) - fSingleY,
227 1.0,
225 fBorderX,
226 1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY,
227 1.0 + fSingleX,
228 fBorderY + fSingleY)));
229
230 // BottomRight
231 xRetval[4] = Primitive2DReference(
232 new BitmapPrimitive2D(
233 getDiscreteShadow().getBottomRight(),
234 basegfx::tools::createScaleTranslateB2DHomMatrix(
228 fBorderY + fSingleY)));
229
230 // BottomRight
231 xRetval[4] = Primitive2DReference(
232 new BitmapPrimitive2D(
233 getDiscreteShadow().getBottomRight(),
234 basegfx::tools::createScaleTranslateB2DHomMatrix(
235 fBigLenX,
235 fBigLenX,
236 fBigLenY,
236 fBigLenY,
237 1.0 - fBorderX,
238 1.0 - fBorderY)));
237 1.0 - (fBorderX + fSingleX) + fSingleX,
238 1.0 - (fBorderY + fSingleY) + fSingleY)));
239
240 // Bottom
241 xRetval[5] = Primitive2DReference(
242 new BitmapPrimitive2D(
243 getDiscreteShadow().getBottom(),
244 basegfx::tools::createScaleTranslateB2DHomMatrix(
239
240 // Bottom
241 xRetval[5] = Primitive2DReference(
242 new BitmapPrimitive2D(
243 getDiscreteShadow().getBottom(),
244 basegfx::tools::createScaleTranslateB2DHomMatrix(
245 1.0 - (2.0 * fBorderX) - fSingleX,
246 fBorderY + fSingleY,
247 fBorderX + fSingleX,
248 1.0)));
245 1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX,
246 fBorderY,
247 fBorderX + fSingleX,
248 1.0 + fSingleY)));
249
250 // BottomLeft
251 xRetval[6] = Primitive2DReference(
252 new BitmapPrimitive2D(
253 getDiscreteShadow().getBottomLeft(),
254 basegfx::tools::createScaleTranslateB2DHomMatrix(
249
250 // BottomLeft
251 xRetval[6] = Primitive2DReference(
252 new BitmapPrimitive2D(
253 getDiscreteShadow().getBottomLeft(),
254 basegfx::tools::createScaleTranslateB2DHomMatrix(
255 fBigLenX,
255 fBigLenX,
256 fBigLenY,
256 fBigLenY,
257 -fBorderX,
257 -fBorderX,
258 1.0 - fBorderY)));
259
260 // Left
261 xRetval[7] = Primitive2DReference(
262 new BitmapPrimitive2D(
263 getDiscreteShadow().getLeft(),
264 basegfx::tools::createScaleTranslateB2DHomMatrix(
258 1.0 - fBorderY)));
259
260 // Left
261 xRetval[7] = Primitive2DReference(
262 new BitmapPrimitive2D(
263 getDiscreteShadow().getLeft(),
264 basegfx::tools::createScaleTranslateB2DHomMatrix(
265 fBorderX + fSingleX,
266 1.0 - (2.0 * fBorderY) - fSingleY,
267 -fBorderX,
265 fBorderX,
266 1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY,
267 -fBorderX,
268 fBorderY + fSingleY)));
269
270 // put all in object transformation to get to target positions
271 const Primitive2DReference xTransformed(
272 new TransformPrimitive2D(
273 getTransform(),
274 xRetval));
275

--- 60 unchanged lines hidden ---
268 fBorderY + fSingleY)));
269
270 // put all in object transformation to get to target positions
271 const Primitive2DReference xTransformed(
272 new TransformPrimitive2D(
273 getTransform(),
274 xRetval));
275

--- 60 unchanged lines hidden ---