~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/imageplugins/hotpixels/blackframeparser.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2005-03-27
 
7
 * Description : black frames parser
 
8
 * 
 
9
 * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
 
10
 * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 * 
 
12
 * Part of the algorithm for finding the hot pixels was based on
 
13
 * the code of jpegpixi, which was released under the GPL license,
 
14
 * and is Copyright (C) 2003, 2004 Martin Dickopp
 
15
 *
 
16
 * This program is free software; you can redistribute it
 
17
 * and/or modify it under the terms of the GNU General
 
18
 * Public License as published by the Free Software Foundation;
 
19
 * either version 2, or (at your option)
 
20
 * any later version.
 
21
 * 
 
22
 * This program is distributed in the hope that it will be useful,
 
23
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
24
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
25
 * GNU General Public License for more details.
 
26
 * 
 
27
 * ============================================================ */
 
28
 
 
29
#ifndef BLACKFRAMEPARSER_H
 
30
#define BLACKFRAMEPARSER_H
 
31
 
 
32
#define MIN(a,b) ((a) < (b) ? (a) : (b))
 
33
#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
34
 
 
35
// Qt includes.
 
36
 
 
37
#include <qimage.h>
 
38
#include <qobject.h>
 
39
#include <qvaluelist.h>
 
40
#include <qstring.h>
 
41
#include <qrect.h>
 
42
 
 
43
// KDE includes.
 
44
 
 
45
#include <kurl.h>
 
46
 
 
47
// Local includes.
 
48
 
 
49
#include "dimg.h"
 
50
#include "loadsavethread.h"
 
51
#include "hotpixel.h"
 
52
 
 
53
using namespace Digikam;
 
54
 
 
55
namespace DigikamHotPixelsImagesPlugin
 
56
{
 
57
 
 
58
class BlackFrameParser: public QObject
 
59
{
 
60
    Q_OBJECT
 
61
 
 
62
public:
 
63
 
 
64
    BlackFrameParser(QObject *parent);
 
65
    ~BlackFrameParser();
 
66
 
 
67
    void parseHotPixels(const QString &file);
 
68
    void parseBlackFrame(const KURL &url);
 
69
    void parseBlackFrame(QImage& img);
 
70
    QImage image(){return m_Image;}
 
71
 
 
72
signals:
 
73
 
 
74
    void parsed(QValueList<HotPixel>);
 
75
    void signalLoadingProgress(float);
 
76
    void signalLoadingComplete();
 
77
 
 
78
private slots:
 
79
 
 
80
    void slotLoadingProgress(const LoadingDescription&, float);
 
81
    void slotLoadImageFromUrlComplete(const LoadingDescription&, const DImg&);
 
82
    
 
83
private:
 
84
 
 
85
    void blackFrameParsing();
 
86
    void consolidatePixels(QValueList<HotPixel>& list);
 
87
    void validateAndConsolidate(HotPixel *a, HotPixel *b);
 
88
 
 
89
private:
 
90
 
 
91
    QString         m_OutputString;
 
92
    QString         m_localFile;
 
93
 
 
94
    QImage          m_Image;
 
95
 
 
96
    LoadSaveThread *m_imageLoaderThread;
 
97
};
 
98
 
 
99
}  // NameSpace DigikamHotPixelsImagesPlugin
 
100
 
 
101
#endif // BLACKFRAMEPARSER_H