Changeset View
Changeset View
Standalone View
Standalone View
libcolorcorrect/suncalc.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Roman Gilg <subdiff@gmail.com> | ||||
3 | | ||||
4 | This program is free software; you can redistribute it and/or modify | ||||
5 | it under the terms of the GNU General Public License as published by | ||||
6 | the Free Software Foundation; either version 2 of the License, or | ||||
7 | (at your option) any later version. | ||||
8 | | ||||
9 | This program is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | GNU General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU General Public License | ||||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
16 | *********************************************************************/ | ||||
17 | #ifndef COLORCORRECT_SUNCALC_H | ||||
18 | #define COLORCORRECT_SUNCALC_H | ||||
19 | | ||||
20 | #include <QObject> | ||||
21 | #include <QDate> | ||||
22 | #include <QTime> | ||||
23 | #include <QPair> | ||||
24 | #include <QVariant> | ||||
25 | | ||||
26 | #include "colorcorrect_export.h" | ||||
27 | | ||||
28 | namespace ColorCorrect | ||||
29 | { | ||||
30 | | ||||
31 | /* | ||||
32 | * The purpose of this class is solely to enable workspace to present the | ||||
33 | * resulting timings of the current or requested configuration to the user. | ||||
34 | * The final calculations happen in similar functions in the compositor. | ||||
35 | * | ||||
36 | * The functions provided by this class here therefore needs to be hold in | ||||
37 | * sync with the functions in the compositor. | ||||
38 | */ | ||||
39 | | ||||
40 | class COLORCORRECT_EXPORT SunCalc : public QObject | ||||
41 | { | ||||
42 | Q_OBJECT | ||||
43 | | ||||
44 | public: | ||||
45 | /** | ||||
46 | * Calculates for a given location and date two of the | ||||
47 | * following sun timings in their temporal order: | ||||
48 | * - Nautical dawn and sunrise for the morning | ||||
49 | * - Sunset and nautical dusk for the evening | ||||
50 | * @since 5.11 | ||||
51 | **/ | ||||
52 | Q_INVOKABLE QVariantMap getMorningTimings(double latitude, double longitude); | ||||
53 | Q_INVOKABLE QVariantMap getEveningTimings(double latitude, double longitude); | ||||
54 | | ||||
55 | }; | ||||
56 | | ||||
57 | } | ||||
58 | | ||||
59 | #endif // COLORCORRECT_SUNCALC_H |