Kstars

fitsoverlay.h
1 /*
2  SPDX-FileCopyrightText: 2012 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QPixmap>
10 #include <KIO/Job>
11 #include <QFile>
12 
13 #include "dms.h"
14 
15 class FITSImage;
16 class SkyPoint;
17 
18 typedef struct
19 {
20  FITSImage *image_data;
21  dms ra, dec;
22  int pix_width, pix_height;
23  QPixmap pix;
24 } FOverlay;
25 
26 class FITSOverlay : public QObject
27 {
28  Q_OBJECT
29 
30  public:
31  FITSOverlay();
32  ~FITSOverlay();
33 
34  void addFITSOverlay(const dms &ra, const dms &dec, const QUrl &imageURL);
35  //void removeFITSOverlay(const SkyPoint *clickedPoint);
36 
37  //const QPixmap *getPixmap() { return &pix;}
38  //const SkyPoint *getCoord() { return coord; }
39 
40  bool contains(const dms &ra, const dms &dec);
41 
42  QList<FOverlay *> getOverlays() { return fList; }
43 
44  private:
45  void loadImageFromURL();
46  void openImage();
47 
48  QUrl m_ImageUrl;
49  KIO::Job *downloadJob { nullptr }; // download job of image -> 0 == no job is running
50  QString filename;
51  QFile file;
52  dms ra, dec;
53 
54  QList<FOverlay *> fList;
55 
56  private slots:
57  /**Make sure download has finished, then make sure file exists, then save the image */
58  void downloadReady(KJob *);
59 };
Q_OBJECTQ_OBJECT
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
const CachingDms & dec() const
Definition: skypoint.h:269
QTextStream & dec(QTextStream &stream)
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
const CachingDms & ra() const
Definition: skypoint.h:263
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 03:59:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.