Engauge Digitizer 2
|
Class for filtering image to remove unimportant information. More...
#include <ColorFilter.h>
Public Member Functions | |
ColorFilter () | |
Single constructor. | |
~ColorFilter () | |
Destructor deallocates memory. | |
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 20 of file ColorFilter.h.
ColorFilter::ColorFilter | ( | ) |
ColorFilter::~ColorFilter | ( | ) |
Destructor deallocates memory.
Definition at line 25 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 46 of file ColorFilter.cpp.
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 78 of file ColorFilter.cpp.
Return true if specified filtered pixel is on.
Definition at line 126 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 176 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 148 of file ColorFilter.cpp.
int ColorFilter::zeroToOneToValue | ( | ColorFilterMode | colorFilterMode, |
double | s ) const |
Inverse of pixelToZeroToOneOrMinusOne.
Definition at line 195 of file ColorFilter.cpp.