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. More... | |
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. More... | |
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 20 of file ColorFilter.h.
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 73 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 171 of file ColorFilter.cpp.