|
Engauge Digitizer 2
|
Class for filtering image to remove unimportant information. More...
#include <ColorFilter.h>
Public Member Functions | |
| 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. | |
| 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. | |
| 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. | |
| double | pixelToZeroToOneOrMinusOne (ColorFilterMode colorFilterMode, const QColor &pixel, QRgb rgbBackground) const |
| Return pixel converted according to the current filter parameter, normalized to zero to one. | |
| bool | pixelUnfilteredIsOn (ColorFilterMode colorFilterMode, const QColor &pixel, QRgb rgbBackground, double low0To1, double high0To1) const |
| Return true if specified unfiltered pixel is on. | |
| int | zeroToOneToValue (ColorFilterMode colorFilterMode, double s) const |
| Inverse of pixelToZeroToOneOrMinusOne. | |
Class for filtering image to remove unimportant information.
Definition at line 18 of file ColorFilter.h.
| ColorFilter::ColorFilter | ( | ) |
Single constructor.
Definition at line 15 of file ColorFilter.cpp.
| bool ColorFilter::colorCompare | ( | QRgb | rgb1, |
| QRgb | rgb2 | ||
| ) | const |
See if the two color values are close enough to be considered to be the same.
Definition at line 19 of file ColorFilter.cpp.
| void ColorFilter::filterImage | ( | const QImage & | imageOriginal, |
| QImage & | imageFiltered, | ||
| ColorFilterMode | colorFilterMode, | ||
| double | low, | ||
| double | high, | ||
| QRgb | rgbBackground | ||
| ) |
Filter the original image according to the specified filtering parameters.
Definition at line 26 of file ColorFilter.cpp.
| QRgb ColorFilter::marginColor | ( | const QImage * | image | ) | const |
Identify the margin color of the image, which is defined as the most common color in the four margins.
For speed, only pixels in the four borders are examined, with the results from those borders safely representing the most common color of the entire margin areas.
Definition at line 58 of file ColorFilter.cpp.
| bool ColorFilter::pixelFilteredIsOn | ( | const QImage & | image, |
| int | x, | ||
| int | y | ||
| ) | const |
Return true if specified filtered pixel is on.
Definition at line 106 of file ColorFilter.cpp.
| double ColorFilter::pixelToZeroToOneOrMinusOne | ( | ColorFilterMode | colorFilterMode, |
| const QColor & | pixel, | ||
| QRgb | rgbBackground | ||
| ) | const |
Return pixel converted according to the current filter parameter, normalized to zero to one.
Special case is -1 for a pixel that cannot be converted, like finding hue value for gray scale pixel
Definition at line 156 of file ColorFilter.cpp.
| bool ColorFilter::pixelUnfilteredIsOn | ( | ColorFilterMode | colorFilterMode, |
| const QColor & | pixel, | ||
| QRgb | rgbBackground, | ||
| double | low0To1, | ||
| double | high0To1 | ||
| ) | const |
Return true if specified unfiltered pixel is on.
Definition at line 128 of file ColorFilter.cpp.
| int ColorFilter::zeroToOneToValue | ( | ColorFilterMode | colorFilterMode, |
| double | s | ||
| ) | const |
Inverse of pixelToZeroToOneOrMinusOne.
Definition at line 205 of file ColorFilter.cpp.