35 QImage &imageFiltered,
55 QRgb rgbBackground)
const;
62 double high0To1)
const;
70 void createStrategies ();
72 typedef QList<ColorFilterEntry> ColorList;
74 void mergePixelIntoColorCounts (QRgb pixel,
75 ColorList &colorCounts)
const;
78 QMap<ColorFilterMode, ColorFilterStrategyAbstractBase*> m_strategies;
Base class for strategy pattern whose subclasses process the different color filter settings modes (o...
QRgb marginColor(const QImage *image) const
Identify the margin color of the image, which is defined as the most common color in the four margins...
bool pixelFilteredIsOn(const QImage &image, int x, int y) const
Return true if specified filtered pixel is on.
void filterImage(const QImage &imageOriginal, QImage &imageFiltered, ColorFilterMode colorFilterMode, double low, double high, QRgb rgbBackground)
Filter the original image according to the specified filtering parameters.
~ColorFilter()
Destructor deallocates memory.
int zeroToOneToValue(ColorFilterMode colorFilterMode, double s) const
Inverse of pixelToZeroToOneOrMinusOne.
bool pixelUnfilteredIsOn(ColorFilterMode colorFilterMode, const QColor &pixel, QRgb rgbBackground, double low0To1, double high0To1) const
Return true if specified unfiltered pixel is on.
double pixelToZeroToOneOrMinusOne(ColorFilterMode colorFilterMode, const QColor &pixel, QRgb rgbBackground) const
Return pixel converted according to the current filter parameter, normalized to zero to one.
ColorFilter()
Single constructor.
bool colorCompare(QRgb rgb1, QRgb rgb2) const
See if the two color values are close enough to be considered to be the same.