digiKam
blackframeparser.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2005-03-27
7  * Description : black frames parser
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
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  * written by 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 DIGIKAM_BLACK_FRAME_PARSER_H
30 #define DIGIKAM_BLACK_FRAME_PARSER_H
31 
32 // Qt includes
33 
34 #include <QList>
35 #include <QObject>
36 #include <QString>
37 #include <QRect>
38 #include <QUrl>
39 
40 // Local includes
41 
42 #include "digikam_export.h"
43 #include "hotpixelprops.h"
44 #include "loadingdescription.h"
45 
46 using namespace Digikam;
47 
48 namespace Digikam
49 {
50 
51 class DIGIKAM_EXPORT BlackFrameParser: public QObject
52 {
53  Q_OBJECT
54 
55 public:
56 
57  explicit BlackFrameParser(QObject* const parent);
58  ~BlackFrameParser() override;
59 
60  void parseHotPixels(const QString& file);
61  void parseBlackFrame(const QUrl& url);
62  void parseBlackFrame(const DImg& img);
63 
64  DImg image() const;
65 
66 Q_SIGNALS:
67 
69  void signalLoadingProgress(float);
71 
72 private Q_SLOTS:
73 
74  void slotLoadingProgress(const LoadingDescription&, float v);
75  void slotLoadImageFromUrlComplete(const LoadingDescription&, const DImg& img);
76 
77 private:
78 
79  void blackFrameParsing();
80  void consolidatePixels(QList<HotPixelProps>& list);
81  void validateAndConsolidate(HotPixelProps* const a, HotPixelProps* const b);
82 
83 private:
84 
85  class Private;
86  Private* const d;
87 };
88 
89 } // namespace Digikam
90 
91 #endif // DIGIKAM_BLACK_FRAME_PARSER_H
Definition: blackframeparser.h:52
void signalHotPixelsParsed(const QList< HotPixelProps > &)
void signalLoadingProgress(float)
Definition: dimg.h:62
Definition: hotpixelprops.h:41
Definition: loadingdescription.h:45
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43