digiKam
autocrop.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 : 2012-10-18
7  * Description : Auto Crop analyzer
8  *
9  * Copyright (C) 2013 by Sayantan Datta <sayantan dot knz at gmail dot com>
10  * Copyright (C) 2013-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_AUTO_CROP_H
26 #define DIGIKAM_AUTO_CROP_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QRect>
32 #include <QImage>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "nrfilter.h"
38 #include "dimg.h"
39 #include "dimgthreadedanalyser.h"
40 
41 namespace Digikam
42 {
43 
44 class DIGIKAM_EXPORT AutoCrop : public DImgThreadedAnalyser
45 {
46  Q_OBJECT
47 
48 public:
49 
53  explicit AutoCrop(DImg* const orgImage, QObject* const parent = nullptr);
54  ~AutoCrop() override;
55 
60  void startAnalyse() override;
61 
65  QRect autoInnerCrop() const;
66 
67 private:
68 
75  QRect spiralClockwiseTraversal(const QImage& source, int topCrop = -1, int bottomCrop = -1);
76 
77 private:
78 
79  class Private;
80  Private* d;
81 };
82 
83 } // namespace Digikam
84 
85 #endif // DIGIKAM_AUTO_CROP_H
Definition: autocrop.h:45
Definition: dimgthreadedanalyser.h:38
Definition: dimg.h:62
Definition: datefolderview.cpp:43