45 , mnIntensityStart(100)
52 : meStyle (rImplGradient.meStyle)
53 , maStartColor(rImplGradient.maStartColor)
54 , maEndColor(rImplGradient.maEndColor)
55 , mnAngle(rImplGradient.mnAngle)
56 , mnBorder(rImplGradient.mnBorder)
57 , mnOfsX(rImplGradient.mnOfsX)
58 , mnOfsY(rImplGradient.mnOfsY)
59 , mnIntensityStart(rImplGradient.mnIntensityStart)
60 , mnIntensityEnd(rImplGradient.mnIntensityEnd)
61 , mnStepCount(rImplGradient.mnStepCount)
67 return (meStyle == rImpl_Gradient.
meStyle)
68 && (mnAngle == rImpl_Gradient.
mnAngle)
69 && (mnBorder == rImpl_Gradient.
mnBorder)
70 && (mnOfsX == rImpl_Gradient.
mnOfsX)
71 && (mnOfsY == rImpl_Gradient.
mnOfsY)
87 const Color& rStartColor,
const Color& rEndColor ) :
203 if(
GetStyle() == GradientStyle::Linear ||
GetStyle() == GradientStyle::Axial )
206 const double fWidth = aRect.
GetWidth();
207 const double fHeight = aRect.
GetHeight();
208 double fDX = fWidth * fabs( cos( fAngle ) ) +
209 fHeight * fabs( sin( fAngle ) );
210 double fDY = fHeight * fabs( cos( fAngle ) ) +
211 fWidth * fabs( sin( fAngle ) );
212 fDX = (fDX - fWidth) * 0.5 + 0.5;
213 fDY = (fDY - fHeight) * 0.5 + 0.5;
214 aRect.
AdjustLeft( -static_cast<tools::Long>(fDX) );
216 aRect.
AdjustTop( -static_cast<tools::Long>(fDY) );
224 if(
GetStyle() == GradientStyle::Square ||
GetStyle() == GradientStyle::Rect )
227 const double fWidth = aRect.
GetWidth();
228 const double fHeight = aRect.
GetHeight();
229 double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
230 double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
232 fDX = ( fDX - fWidth ) * 0.5 + 0.5;
233 fDY = ( fDY - fHeight ) * 0.5 + 0.5;
235 aRect.
AdjustLeft( -static_cast<tools::Long>(fDX) );
237 aRect.
AdjustTop( -static_cast<tools::Long>(fDY) );
243 if(
GetStyle() == GradientStyle::Radial )
246 aSize.
setWidth( static_cast<tools::Long>(0.5 + sqrt(static_cast<double>(aSize.Width())*static_cast<double>(aSize.Width()) + static_cast<double>(aSize.Height())*static_cast<double>(aSize.Height()))) );
247 aSize.setHeight( aSize.Width() );
249 else if(
GetStyle() == GradientStyle::Elliptical )
252 aSize.setWidth( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Width()) * 1.4142 ) );
253 aSize.setHeight( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Height()) * 1.4142 ) );
261 rCenter =
Point( aRect.
Left() + nZWidth, aRect.
Top() + nZHeight );
264 aSize.AdjustWidth( -nBorderX );
265 aSize.AdjustHeight( -nBorderY );
268 aRect.
SetLeft( rCenter.X() - ( aSize.Width() >> 1 ) );
269 aRect.
SetTop( rCenter.Y() - ( aSize.Height() >> 1 ) );
283 aStartCol =
Color(cStartLum, cStartLum, cStartLum);
284 aEndCol =
Color(cEndLum, cEndLum, cEndLum);
void SetEndColor(const Color &rColor)
GradientStyle GetStyle() const
void setWidth(tools::Long nWidth)
sal_uInt16 GetOfsY() const
sal_uInt8 GetLuminance() const
sal_uInt16 GetBorder() const
void SetBorder(sal_uInt16 nBorder)
sal_uInt16 mnIntensityEnd
void SetEndIntensity(sal_uInt16 nIntens)
Gradient & operator=(const Gradient &rGradient)
void SetSteps(sal_uInt16 nSteps)
void SetOfsY(sal_uInt16 nOfsY)
void SetStartColor(const Color &rColor)
UNDERLYING_TYPE get() const
void GetBoundRect(const tools::Rectangle &rRect, tools::Rectangle &rBoundRect, Point &rCenter) const
sal_uInt16 GetOfsX() const
Impl(const Impl &rImplGradient)
sal_uInt16 GetEndIntensity() const
bool operator==(const Gradient &rGradient) const
void SetOfsX(sal_uInt16 nOfsX)
sal_uInt16 GetSteps() const
const Color & GetStartColor() const
void SetAngle(Degree10 nAngle)
Degree10 GetAngle() const
::o3tl::cow_wrapper< Impl > mpImplGradient
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
const Color & GetEndColor() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
sal_uInt16 mnIntensityStart
void SetStyle(GradientStyle eStyle)
sal_uInt16 GetStartIntensity() const
bool operator==(const Impl &rImpl_Gradient) const
void SetStartIntensity(sal_uInt16 nIntens)