• Main Page
  • Classes
  • Files
  • File List
  • File Members

redeyedetection.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
00004 ** Contact: Alexander Bokovoy <alexander.bokovoy@nokia.com>
00005 **
00006 ** This file is part of the Quill Image Filters package.
00007 **
00008 ** Commercial Usage
00009 ** Licensees holding valid Qt Commercial licenses may use this file in
00010 ** accordance with the Qt Commercial License Agreement provided with the
00011 ** Software or, alternatively, in accordance with the terms contained in
00012 ** a written agreement between you and Nokia.
00013 **
00014 ** GNU Lesser General Public License Usage
00015 ** Alternatively, this file may be used under the terms of the GNU Lesser
00016 ** General Public License version 2.1 as published by the Free Software
00017 ** Foundation and appearing in the file LICENSE.LGPL included in the
00018 ** packaging of this file.  Please review the following information to
00019 ** ensure the GNU Lesser General Public License version 2.1 requirements
00020 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00021 **
00022 ** In addition, as a special exception, Nokia gives you certain
00023 ** additional rights. These rights are described in the Nokia Qt LGPL
00024 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
00025 ** package.
00026 **
00027 ** GNU General Public License Usage
00028 ** Alternatively, this file may be used under the terms of the GNU
00029 ** General Public License version 3.0 as published by the Free Software
00030 ** Foundation and appearing in the file LICENSE.GPL included in the
00031 ** packaging of this file.  Please review the following information to
00032 ** ensure the GNU General Public License version 3.0 requirements will be
00033 ** met: http://www.gnu.org/copyleft/gpl.html.
00034 **
00035 ** If you are unsure which license is appropriate for your use, please
00036 ** contact the sales department at qt-sales@nokia.com.
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 &center,
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 /* To be able to store QPoints in a QHash */
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__

Generated on Wed Jun 1 2011 13:17:23 for quillimagefilter by  doxygen 1.7.1