7 #include "ColorFilter.h" 8 #include "DocumentModelColorFilter.h" 9 #include "DocumentModelGridRemoval.h" 10 #include "FilterImage.h" 11 #include "GridRemoval.h" 15 #include "Transformation.h" 23 const QString &curveSelected,
29 QImage imageFiltered (imageUnfiltered.width (),
30 imageUnfiltered.height (),
31 QImage::Format_RGB32);
32 QRgb rgbBackground = filter.
marginColor (&imageUnfiltered);
36 modelColorFilter.
low(curveSelected),
37 modelColorFilter.
high(curveSelected),
41 QPixmap pixmapFiltered = gridRemoval.
remove (transformation,
45 return pixmapFiltered;
Class for filtering image to remove unimportant information.
double low(const QString &curveName) const
Low value of foreground, hue, intensity, saturation or value according to current filter mode normali...
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
double high(const QString &curveName) const
High value of foreground, hue, intensity, saturation or value according to current filter mode...
QPixmap remove(const Transformation &transformation, const DocumentModelGridRemoval &modelGridRemoval, const QImage &imageBefore)
Process QImage into QPixmap, removing the grid lines.
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...
ColorFilterMode colorFilterMode(const QString &curveName) const
Get method for filter mode.
QPixmap filter(const QImage &imageUnfiltered, const Transformation &transformation, const QString &curveSelected, const DocumentModelColorFilter &modelColorFilter, const DocumentModelGridRemoval &modelGridRemoval) const
Filter original unfiltered image into filtered pixmap.
FilterImage()
Single constructor.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
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.
Strategy class for grid removal.