summaryrefslogtreecommitdiffstats
path: root/include/basegfx/color
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
commita6f5770b4aaaa6506a22eae0d641ad48f9b6d239 (patch)
treea6c682cae9034bc67f23c410dd3d0227d36d680b /include/basegfx/color
parentStart Center: Better icon for Recent Files (diff)
downloadcore-a6f5770b4aaaa6506a22eae0d641ad48f9b6d239.tar.gz
core-a6f5770b4aaaa6506a22eae0d641ad48f9b6d239.zip
Revert "loplugin:unusedmethods sax,shell,stoc,basegfx"
The basegfx changes appear to break Windows builds. This reverts commit 3b32c5898ff4e744d3f18b00421b433500426d74.
Diffstat (limited to 'include/basegfx/color')
-rw-r--r--include/basegfx/color/bcolor.hxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index 4358e056d26f..2bdd42063b6f 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -131,6 +131,15 @@ namespace basegfx
return *this;
}
+ // blend to another color using luminance
+ void blend(const BColor& rColor)
+ {
+ const double fLuminance(luminance());
+ mfX = rColor.getRed() * fLuminance;
+ mfY = rColor.getGreen() * fLuminance;
+ mfZ = rColor.getBlue() * fLuminance;
+ }
+
// luminance
double luminance() const
{
@@ -155,6 +164,16 @@ namespace basegfx
return sqrt(fDistR * fDistR + fDistG * fDistG + fDistB * fDistB);
}
+ double getMinimumDistance(const BColor& rColor) const
+ {
+ const double fDistR(getDistanceRed(rColor));
+ const double fDistG(getDistanceGreen(rColor));
+ const double fDistB(getDistanceBlue(rColor));
+
+ double fRetval(fDistR < fDistG ? fDistR : fDistG);
+ return (fRetval < fDistB ? fRetval : fDistB);
+ }
+
double getMaximumDistance(const BColor& rColor) const
{
const double fDistR(getDistanceRed(rColor));
@@ -187,6 +206,18 @@ namespace basegfx
return static_cast<const BColor&>( ::basegfx::B3DTuple::getEmptyTuple() );
}
+ com::sun::star::uno::Sequence< double > colorToDoubleSequence(const com::sun::star::uno::Reference< com::sun::star::rendering::XGraphicDevice >& /*xGraphicDevice*/) const
+ {
+ com::sun::star::uno::Sequence< double > aRet(4);
+ double* pRet = aRet.getArray();
+
+ pRet[0] = mfX;
+ pRet[1] = mfY;
+ pRet[2] = mfZ;
+ pRet[3] = 1.0;
+
+ return aRet;
+ }
};
} // end of namespace basegfx