22#include <osl/diagnose.h>
27 : maTopLeft(rShadowBitmap,-1,-1),
28 maTop(rShadowBitmap,0,-1),
29 maTopRight(rShadowBitmap,+1,-1),
30 maLeft(rShadowBitmap,-1,0),
32 maBottomLeft(rShadowBitmap,-1,+1),
34 maBottomRight(rShadowBitmap,+1,+1),
35 maCenter(rShadowBitmap,0,0),
58 const ::tools::Rectangle& rBox)
const
76 const Color aNewColor)
102 const sal_Int32 nHorizontalPosition,
103 const sal_Int32 nVerticalPosition)
105 OSL_ASSERT(nHorizontalPosition>=-1 && nHorizontalPosition<=+1);
106 OSL_ASSERT(nVerticalPosition>=-1 && nVerticalPosition<=+1);
108 const sal_Int32 nS (1);
109 const sal_Int32 nC (::std::max<sal_Int32>(0,(rBitmap.
GetSizePixel().
Width()-nS)/2));
110 const sal_Int32 nO (nC/2);
113 nHorizontalPosition<0 ? 0 : (nHorizontalPosition == 0 ? nC : nC+nS),
114 nVerticalPosition<0 ? 0 : (nVerticalPosition == 0 ? nC : nC+nS));
116 nHorizontalPosition==0 ? nS : nC,
117 nVerticalPosition==0 ? nS : nC);
122 nHorizontalPosition<0 ? -nO : nHorizontalPosition>0 ? -nO : 0,
123 nVerticalPosition<0 ? -nO : nVerticalPosition>0 ? -nO : 0);
127 const sal_Int32 nSideBitmapSize (64);
128 if (nHorizontalPosition == 0 && nVerticalPosition == 0)
132 else if (nHorizontalPosition == 0)
136 else if (nVerticalPosition == 0)
144 const Point& rAnchor)
const
146 if ( ! maBitmap.IsEmpty())
152 const Point& rAnchor1,
153 const Point& rAnchor2,
157 if (maBitmap.IsEmpty())
160 const Size aBitmapSize (maBitmap.GetSizePixel());
161 if (rAnchor1.
Y() == rAnchor2.
Y())
164 const sal_Int32 nY (rAnchor1.
Y() + maOffset.Y());
165 const sal_Int32 nLeft (
169 const sal_Int32 nRight (
173 for (sal_Int32 nX=nLeft; nX<=nRight; nX+=aBitmapSize.
Width())
181 else if (rAnchor1.
X() == rAnchor2.
X())
184 const sal_Int32 nX (rAnchor1.
X() + maOffset.X());
185 const sal_Int32 nTop (
189 const sal_Int32 nBottom (
193 for (sal_Int32 nY=nTop; nY<=nBottom; nY+=aBitmapSize.
Height())
210 const ::tools::Rectangle& rBox)
const
212 const Size aBitmapSize (maBitmap.GetSizePixel());
218 ::std::min(aBitmapSize.
Width(), rBox.Right()-nX+1),
219 std::min(aBitmapSize.
Height(), rBox.Bottom()-nY+1)),
LineDescriptorList maRight
LineDescriptorList maLeft
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
::Color GetPixelColor(sal_Int32 nX, sal_Int32 nY) const
void Replace(const Color &rSearchColor, const Color &rReplaceColor)
const Size & GetSizePixel() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
Bitmap with offset that is used when the bitmap is painted.
OffsetBitmap(const BitmapEx &rBitmap, const sal_Int32 nHorizontalPosition, const sal_Int32 nVerticalPosition)
Create one of the eight shadow bitmaps from one that combines them all.
void PaintSide(OutputDevice &rDevice, const Point &rAnchor1, const Point &rAnchor2, const OffsetBitmap &rCornerBitmap1, const OffsetBitmap &rCornerBitmap2) const
Use the given device to paint the bitmap stretched between the two given locations.
void PaintCenter(OutputDevice &rDevice, const ::tools::Rectangle &rBox) const
Fill the given rectangle with the bitmap.
void PaintCorner(OutputDevice &rDevice, const Point &rAnchor) const
Use the given device to paint the bitmap at the location that is the sum of the given anchor and the ...
void AdaptColor(const Color aNewColor)
Special functionality that takes the color from the center bitmap and replaces that color in all bitm...
void PaintFrame(OutputDevice &rDevice, const ::tools::Rectangle &rBox) const
Paint a border around the given box by using a set of bitmaps for the corners and sides.
OffsetBitmap maBottomRight
OffsetBitmap maBottomLeft
FramePainter(const BitmapEx &rBitmap)