Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ColorFilter Class Reference

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.
 

Detailed Description

Class for filtering image to remove unimportant information.

Definition at line 18 of file ColorFilter.h.

Constructor & Destructor Documentation

◆ ColorFilter()

ColorFilter::ColorFilter ( )

Single constructor.

Definition at line 15 of file ColorFilter.cpp.

Member Function Documentation

◆ colorCompare()

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.

◆ filterImage()

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.

◆ marginColor()

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.

◆ pixelFilteredIsOn()

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.

◆ pixelToZeroToOneOrMinusOne()

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.

◆ pixelUnfilteredIsOn()

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.

◆ zeroToOneToValue()

int ColorFilter::zeroToOneToValue ( ColorFilterMode  colorFilterMode,
double  s 
) const

Inverse of pixelToZeroToOneOrMinusOne.

Definition at line 205 of file ColorFilter.cpp.


The documentation for this class was generated from the following files: