kwin/plugins/nightcolor/suncalc.h
Vlad Zahorodnii bdfb946267 Convert Night Color into a plugin
Night Color adjusts the color temperature based on the current time in
your location. It's not a generic color correction module per se.

We need a central component that can be used by both night color and
colord integration to tweak gamma ramps and which will be able to
resolve conflicts between the two. The Night Color manager cannot be
such a thing because of its very specific usecase.

This change converts Night Color into a plugin to prepare some space for
such a component.

The tricky part is that the dbus api of Night Color has "ColorCorrect"
in its name. I'm afraid we cannot do that much about it without breaking
API compatibility.
2020-11-27 18:55:01 +00:00

31 lines
705 B
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2017 Roman Gilg <subdiff@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_SUNCALCULATOR_H
#define KWIN_SUNCALCULATOR_H
#include <QDate>
#include <QTime>
#include <QPair>
namespace KWin
{
/**
* Calculates for a given location and date two of the
* following sun timings in their temporal order:
* - Nautical dawn and sunrise for the morning
* - Sunset and nautical dusk for the evening
* @since 5.12
*/
QPair<QDateTime, QDateTime> calculateSunTimings(const QDateTime &dateTime, double latitude, double longitude, bool morning);
}
#endif // KWIN_SUNCALCULATOR_H