File indexing completed on 2024-04-21 03:49:59

0001 // SPDX-FileCopyrightText: 2007-2009 David Roberts <dvdr18@gmail.com>
0002 // 
0003 // SPDX-License-Identifier: LGPL-2.1-or-later
0004 
0005 #ifndef MARBLE_SUNLOCATOR_H
0006 #define MARBLE_SUNLOCATOR_H
0007 
0008 
0009 #include <QObject>
0010 #include <QColor>
0011 
0012 //FIXME: This class shouldn't be exposed but is needed by the worldclock plasmoid
0013 #include "marble_export.h"
0014 
0015 namespace Marble
0016 {
0017 class MarbleClock;
0018 class SunLocatorPrivate;
0019 class Planet;
0020 
0021 class MARBLE_EXPORT SunLocator : public QObject
0022 {
0023     Q_OBJECT
0024 
0025  public:
0026     SunLocator( const MarbleClock *clock, const Planet *planet );
0027     ~SunLocator() override;
0028 
0029     qreal shading(qreal lon, qreal a, qreal c) const;
0030     static void shadePixel(QRgb &pixcol, qreal shade);
0031     static void shadePixelComposite(QRgb &pixcol, const QRgb &dpixcol, qreal shade);
0032 
0033     void  setPlanet( const Planet *planet );
0034 
0035     qreal getLon() const;
0036     qreal getLat() const;
0037 
0038  public Q_SLOTS:
0039     void update();
0040 
0041  Q_SIGNALS:
0042     void positionChanged( qreal lon, qreal lat );
0043 
0044  private:
0045     SunLocatorPrivate * const d;
0046 
0047     Q_DISABLE_COPY( SunLocator )
0048 };
0049 
0050 }
0051 
0052 #endif