Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00053 #ifndef __QUILL_RED_EYE_DETECTION_H__
00054 #define __QUILL_RED_EYE_DETECTION_H__
00055
00056 #include <QColor>
00057 #include <QPoint>
00058 #include <QList>
00059 #include <QSet>
00060 #include "quillimagefiltergeneratorimplementation.h"
00061 class RedEyeDetectionPrivate;
00062 class QVariant;
00063 class QPoint;
00064 class QRect;
00065 class QPolygon;
00066
00067 class RedEyeDetection : public QuillImageFilterGeneratorImplementation
00068 {
00069 friend class TestRedEyeReduction;
00070
00075 public:
00076 RedEyeDetection();
00077 ~RedEyeDetection();
00078
00079 QuillImageFilter *generate(const QuillImage &image) const;
00080 bool setOption(const QString &option, const QVariant &value);
00081 bool isUsedOnPreview() const;
00082 const QString name() const {return QuillImageFilter::Name_RedEyeDetection; }
00083 const QStringList supportedOptions() const;
00084 QVariant option(const QString &option) const;
00085
00086 private:
00087 RedEyeDetectionPrivate *priv;
00088
00089 QRect getStartingRectangle(const QSize &imageSize,
00090 const QSize &fullImageSize) const;
00091 QPoint locateStartingPoint(const QImage &image,
00092 const QRect &rect) const;
00093 QList<QPoint> generateNeighbors(const QPoint &point) const;
00094 QSet<QPoint> expandRedEye(const QImage &image,
00095 const QPoint ¢er,
00096 const QRect &area) const;
00097 QPolygon generatePolygon(const QRect &area,
00098 const QSet<QPoint> &points) const;
00099 QPoint scalePoint(const QPoint &point,
00100 const QSize &scaleBefore,
00101 const QSize &scaleAfter) const;
00102 QPolygon scalePolygon(const QPolygon &polygon,
00103 const QSize &scaleBefore,
00104 const QSize &scaleAfter) const;
00105
00106 void setThreshold(int pass) const;
00107 bool isRedEyePixel(QRgb color) const;
00108 };
00109
00110
00111
00112 inline uint qHash(const QPoint &point)
00113 {
00114 return qHash(point.x() * 4096 + point.y());
00115 }
00116
00117 #endif //__QUILL_AUTO_CONTRAST_H__