#include <KoMixColorsOp.h>
|
| virtual Mixer * | createMixer () const =0 |
| |
| virtual void | mixArrayWithColor (const quint8 *colorArray, const quint8 *color, int nColors, qreal weight, quint8 *dst) const =0 |
| |
| virtual void | mixColors (const quint8 *colors, const qint16 *weights, int nColors, quint8 *dst, int weightSum=255) const =0 |
| |
| virtual void | mixColors (const quint8 *colors, int nColors, quint8 *dst) const =0 |
| |
| virtual void | mixColors (const quint8 *const *colors, const qint16 *weights, int nColors, quint8 *dst, int weightSum=255) const =0 |
| |
| virtual void | mixColors (const quint8 *const *colors, int nColors, quint8 *dst) const =0 |
| |
| virtual void | mixTwoColorArrays (const quint8 *colorsA, const quint8 *colorsB, int nColors, qreal weight, quint8 *dst) const =0 |
| |
| virtual | ~KoMixColorsOp () |
| |
Base class of the mix color operation. It's defined by sum(colors[i] * weights[i]) / weightSum. You access the KoMixColorsOp of a colorspace by calling KoColorSpace::mixColorsOp.
Definition at line 17 of file KoMixColorsOp.h.
◆ ~KoMixColorsOp()
| virtual KoMixColorsOp::~KoMixColorsOp |
( |
| ) |
|
|
inlinevirtual |
◆ createMixer()
| virtual Mixer * KoMixColorsOp::createMixer |
( |
| ) |
const |
|
pure virtual |
◆ mixArrayWithColor()
| virtual void KoMixColorsOp::mixArrayWithColor |
( |
const quint8 * | colorArray, |
|
|
const quint8 * | color, |
|
|
int | nColors, |
|
|
qreal | weight, |
|
|
quint8 * | dst ) const |
|
pure virtual |
Convenience function to mix one color array with one color with a specific weight. Mixes colorArray[x] with color with weight as the percentage of B vs A (0.0 -> 100% A, 1.0 -> 100% B), for all x = [0 .. nColors-1].
Implemented in KoMixColorsOpImpl< _CSTrait >.
◆ mixColors() [1/4]
| virtual void KoMixColorsOp::mixColors |
( |
const quint8 * | colors, |
|
|
const qint16 * | weights, |
|
|
int | nColors, |
|
|
quint8 * | dst, |
|
|
int | weightSum = 255 ) const |
|
pure virtual |
◆ mixColors() [2/4]
| virtual void KoMixColorsOp::mixColors |
( |
const quint8 * | colors, |
|
|
int | nColors, |
|
|
quint8 * | dst ) const |
|
pure virtual |
◆ mixColors() [3/4]
| virtual void KoMixColorsOp::mixColors |
( |
const quint8 *const * | colors, |
|
|
const qint16 * | weights, |
|
|
int | nColors, |
|
|
quint8 * | dst, |
|
|
int | weightSum = 255 ) const |
|
pure virtual |
Mix the colors.
- Parameters
-
| colors | a pointer toward the source pixels |
| weights | the coefficient of the source pixels |
| nColors | the number of pixels in the colors array |
| dst | the destination pixel |
| weightSum | an integer representing the sum of the coefficients. by default 255. If for some reason you do not want a perfect average, make this anything but the sum. Try to keep this below 255 for division-related performance. |
quint8* colors[nColors];
colors[0] = ptrToFirstPixel;
colors[1] = ptrToSecondPixel;
...
colors[nColors-1] = ptrToLastPixel;
qint16 weights[nColors];
weights[0] = firstWeight;
weights[1] = secondWeight;
...
weights[nColors-1] = lastWeight;
mixColors(colors, weights, nColors, ptrToDestinationPixel);
virtual void mixColors(const quint8 *const *colors, const qint16 *weights, int nColors, quint8 *dst, int weightSum=255) const =0
Implemented in KoMixColorsOpImpl< _CSTrait >.
◆ mixColors() [4/4]
| virtual void KoMixColorsOp::mixColors |
( |
const quint8 *const * | colors, |
|
|
int | nColors, |
|
|
quint8 * | dst ) const |
|
pure virtual |
Mix the colors uniformly, without weighting
- Parameters
-
| colors | a pointer toward the source pixels |
| nColors | the number of pixels in the colors array |
| dst | the destination pixel |
quint8* colors[nColors];
colors[0] = ptrToFirstPixel;
colors[1] = ptrToSecondPixel;
...
colors[nColors-1] = ptrToLastPixel;
mixColors(colors, nColors, ptrToDestinationPixel);
Implemented in KoMixColorsOpImpl< _CSTrait >.
◆ mixTwoColorArrays()
| virtual void KoMixColorsOp::mixTwoColorArrays |
( |
const quint8 * | colorsA, |
|
|
const quint8 * | colorsB, |
|
|
int | nColors, |
|
|
qreal | weight, |
|
|
quint8 * | dst ) const |
|
pure virtual |
Convenience function to mix two color arrays with one weight. Mixes colorsA[x] with colorsB[x] with weight as the percentage of B vs A (0.0 -> 100% A, 1.0 -> 100% B), for all x = [0 .. nColors-1].
Implemented in KoMixColorsOpImpl< _CSTrait >.
The documentation for this class was generated from the following file: