digiKam
hotpixelsweights.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 : a class to calculate filter weights for hot pixels tool
8  *
9  * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
10  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_HOT_PIXELS_WEIGHTS_H
26 #define DIGIKAM_HOT_PIXELS_WEIGHTS_H
27 
28 // Qt includes
29 
30 #include <QList>
31 #include <QRect>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_EXPORT HotPixelsWeights
41 {
42 
43 public:
44 
48 
49  HotPixelsWeights& operator=(const HotPixelsWeights& w);
50  bool operator==(const HotPixelsWeights& ws) const;
51  double** operator[](int n) const;
52 
53  unsigned int height() const;
54  void setHeight(int h);
55 
56  unsigned int polynomeOrder() const;
57  void setPolynomeOrder(int order);
58 
59  bool twoDim() const;
60  void setTwoDim(bool td);
61 
62  void setWidth(int w);
63  unsigned int width() const;
64 
65  const QList<QPoint> positions() const;
66 
67  void calculateHotPixelsWeights();
68 
69 protected:
70 
71  int coefficientNumber() const;
72 
73  double** * weightMatrices() const;
74 
75 private:
76 
77  double polyTerm(const size_t i_coeff,
78  const int x,
79  const int y,
80  const int poly_order) const;
81 
82  void matrixInv(double* const a,
83  const size_t size);
84 
85 private:
86 
87  unsigned int m_height;
88  unsigned int m_width;
89  unsigned int m_coefficientNumber;
90  bool m_twoDim;
91  unsigned int m_polynomeOrder;
92  double** * m_weightMatrices;
93  QList<QPoint> m_positions;
94 };
95 
96 } // namespace Digikam
97 
98 #endif // DIGIKAM_HOT_PIXELS_WEIGHTS_H
Definition: hotpixelsweights.h:41
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49