10 #include "ColorFilterEntry.h" 11 #include "ColorFilterMode.h" 32 QImage &imageFiltered,
33 ColorFilterMode colorFilterMode,
52 QRgb rgbBackground)
const;
59 double high0To1)
const;
67 void createStrategies ();
69 typedef QList<ColorFilterEntry> ColorList;
71 void mergePixelIntoColorCounts (QRgb pixel,
72 ColorList &colorCounts)
const;
75 QMap<ColorFilterMode, ColorFilterStrategyAbstractBase*> m_strategies;
79 #endif // COLOR_FILTER_H 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 colorCompare(QRgb rgb1, QRgb rgb2) const
See if the two color values are close enough to be considered to be the same.
bool pixelFilteredIsOn(const QImage &image, int x, int y) const
Return true if specified filtered 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...
Class for filtering image to remove unimportant information.
int zeroToOneToValue(ColorFilterMode colorFilterMode, double s) const
Inverse of pixelToZeroToOneOrMinusOne.
Base class for strategy pattern whose subclasses process the different color filter settings modes (o...
ColorFilter()
Single constructor.
bool pixelUnfilteredIsOn(ColorFilterMode colorFilterMode, const QColor &pixel, QRgb rgbBackground, double low0To1, double high0To1) const
Return true if specified unfiltered 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.