13#include <klocalizedstring.h>
24#define downscale(quantum) (quantum)
25#define upscale(value) (value)
37 addStandardCompositeOps<KoBgrU8Traits>(
this);
38 addStandardDitherOps<KoBgrU8Traits>(
this);
52 const KoBgrU8Traits::Pixel *
p =
reinterpret_cast<const KoBgrU8Traits::Pixel *
>(pixel);
53 QDomElement labElt = doc.createElement(
"RGB");
58 colorElt.appendChild(labElt);
63 KoBgrU8Traits::Pixel *
p =
reinterpret_cast<KoBgrU8Traits::Pixel *
>(pixel);
72 const KoBgrU8Traits::Pixel *
p =
reinterpret_cast<const KoBgrU8Traits::Pixel *
>(src);
76 return static_cast<quint8
>((
p->red * 30 +
p->green * 59 +
p->blue * 11 + 50) / 100);
81 const KoBgrU8Traits::Pixel *
p =
reinterpret_cast<const KoBgrU8Traits::Pixel *
>(src);
84 return static_cast<qreal
>(
p->red * 30 +
p->green * 59 +
p->blue * 11) / (100.0 * 255.0);
94 QVector <double> channelValues(4);
109 QVector <double> channelValues(4);
112 channelValues[3]=1.0;
113 return channelValues;
118 fillGrayBrushWithColorPreserveLightnessRGB<KoBgrU8Traits>(dst, brush, brushColor, 1.0, nPixels);
123 fillGrayBrushWithColorPreserveLightnessRGB<KoBgrU8Traits>(dst, brush, brushColor, strength, nPixels);
128 modulateLightnessByGrayBrushRGB<KoBgrU8Traits>(dst, brush, strength, nPixels);
void HSYToRGB(const qreal h, const qreal s, const qreal y, qreal *red, qreal *green, qreal *blue, qreal R, qreal G, qreal B)
void RGBToYUV(const qreal r, const qreal g, const qreal b, qreal *y, qreal *u, qreal *v, qreal R, qreal G, qreal B)
void RGBToHSY(const qreal r, const qreal g, const qreal b, qreal *h, qreal *s, qreal *y, qreal R, qreal G, qreal B)
void YUVToRGB(const qreal y, const qreal u, const qreal v, qreal *r, qreal *g, qreal *b, qreal R, qreal G, qreal B)
@ ALPHA
The channel represents the opacity of a pixel.
@ COLOR
The channel represents a color.
@ UINT8
use this for an unsigned integer 8bits channel
static _Tdst scaleToA(_T a)
virtual void addCompositeOp(const KoCompositeOp *op)
QVector< qreal > lumaCoefficients
virtual void addChannel(KoChannelInfo *ci)
const KoColorProfile * profile() const override
void colorFromXML(quint8 *pixel, const QDomElement &elt) const override
QVector< double > fromYUV(qreal *y, qreal *u, qreal *v) const override
virtual KoColorSpace * clone() const
quint8 intensity8(const quint8 *src) const override
RgbU8ColorSpace(const QString &name, KoColorProfile *p)
void fillGrayBrushWithColorAndLightnessOverlay(quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const override
void toHSY(const QVector< double > &channelValues, qreal *hue, qreal *sat, qreal *luma) const override
void toYUV(const QVector< double > &channelValues, qreal *y, qreal *u, qreal *v) const override
qreal intensityF(const quint8 *src) const override
QVector< double > fromHSY(qreal *hue, qreal *sat, qreal *luma) const override
void colorToXML(const quint8 *pixel, QDomDocument &doc, QDomElement &colorElt) const override
void fillGrayBrushWithColorAndLightnessWithStrength(quint8 *dst, const QRgb *brush, quint8 *brushColor, qreal strength, qint32 nPixels) const override
void modulateLightnessByGrayBrush(quint8 *dst, const QRgb *brush, qreal strength, qint32 nPixels) const override
double toDouble(const QString &str, bool *ok=nullptr)
QString toString(const QString &value)