57 BColor(
double fRed,
double fGreen,
double fBlue)
67 :
B3DTuple(fLuminosity, fLuminosity, fLuminosity)
73 BColor(const ::basegfx::B3DTuple& rTuple)
121 const double fRedWeight(77.0 / 256.0);
122 const double fGreenWeight(151.0 / 256.0);
123 const double fBlueWeight(28.0 / 256.0);
125 return (
mfX * fRedWeight +
mfY * fGreenWeight + mfZ * fBlueWeight);
135 const double fDistR(getDistanceRed(rColor));
136 const double fDistG(getDistanceGreen(rColor));
137 const double fDistB(getDistanceBlue(rColor));
139 return std::hypot(fDistR, fDistG, fDistB);
144 const double fDistR(getDistanceRed(rColor));
145 const double fDistG(getDistanceGreen(rColor));
146 const double fDistB(getDistanceBlue(rColor));
148 double fRetval(std::max(fDistR, fDistG));
149 return std::max(fRetval, fDistB);
155 mfX = std::clamp(
mfX, 0.0, 1.0);
156 mfY = std::clamp(
mfY, 0.0, 1.0);
157 mfZ = std::clamp(mfZ, 0.0, 1.0);
175 template<
typename charT,
typename traits>
177 std::basic_ostream<charT, traits> & stream, BColor
const &
color)
180 <<
'[' <<
color.getRed() <<
", " <<
color.getGreen() <<
", "
181 <<
color.getBlue() <<
']';
#define BASEGFX_DLLPUBLIC
Base class for all Points/Vectors with three double values.
static const B3DTuple & getEmptyTuple()
Base Color class with three double values.
double getDistance(const BColor &rColor) const
BColor()
Create a Color with red, green and blue components from [0.0 to 1.0].
double getDistanceRed(const BColor &rColor) const
void setBlue(double fNew)
double getMaximumDistance(const BColor &rColor) const
BColor & operator=(const ::basegfx::B3DTuple &rVec)
assignment operator to allow assigning the results of B3DTuple calculations
double getDistanceGreen(const BColor &rColor) const
BColor(const ::basegfx::B3DTuple &rTuple)
constructor with tuple to allow copy-constructing from B3DTuple-based classes
double getDistanceBlue(const BColor &rColor) const
BColor(double fRed, double fGreen, double fBlue)
Create a 3D Color.
static const BColor & getEmptyBColor()
BColor & operator*=(const BColor &rPnt)
*=operator to allow usage from BColor, too
BColor & operator*=(double t)
*=operator to allow usage from BColor, too
void setGreen(double fNew)
BColor(double fLuminosity)
Create a 3D Color.
Reference< XOutputStream > stream
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, BColor const &color)
sal_uInt8 getRed(IntSRGBA nCol)
sal_uInt8 getBlue(IntSRGBA nCol)
sal_uInt8 getGreen(IntSRGBA nCol)