Kstars

ksdssimage.h
1/*
2 SPDX-FileCopyrightText: 2016 Akarsh Simha <akarsh@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "dms.h"
10
11#include <QImage>
12#include <QString>
13
14/**
15 * @class KSDssImage
16 * @short Provides a class to hold a DSS Image along with its metadata
17 *
18 * @author Akarsh Simha <akarsh@kde.org>
19 */
21{
22 public:
23 /** @short Constructor */
24 explicit KSDssImage(const QString &fileName);
25
26 /**
27 * @struct KSDssImage::Metadata
28 * @short Structure to hold some DSS image metadata
29 *
30 * @note Some fields in the structure are redundant. The methods
31 * that fill this structure must be designed to fill in the
32 * redundancies correctly!
33 *
34 */
35 struct Metadata
36 {
37 /**
38 * @enum Source
39 * @short Contains possible sources for digitized sky-survey images
40 */
41 enum Source
42 {
43 DSS = 0,
44 SDSS = 1,
45 GenericInternetSource = 2
46 };
47
48 /**
49 * @enum FileFormat
50 * @short Contains possible file formats for images
51 *
52 * @note Although DSS website provides us GIF, we may convert
53 * to PNG to incorporate metadata, since by default Qt has no
54 * write support for GIF. Besides, PNG compresses better.
55 *
56 */
58 {
59 FITS = 0,
60 GIF = 1,
61 PNG = 2
62 };
63
64 /// Used for DSS -- Indicates which version of scans to pull
66 /// Name / identifier of the object. Added to metadata
68 /// File format used.
70 /// DSS / SDSS -- source of the image
71 Source src { DSS };
72 /// Center RA (J2000.0)
74 /// Center Dec (J2000.0)
76 /// Height in arcminutes
77 float height { 0 };
78 /// Width in arcminutes
79 float width { 0 };
80 /// Photometric band (UBVRI...) Use "?" for unknown.
81 char band { '?' };
82 /// Generation for DSS images, data release for SDSS; use -1 for unknown.
83 int gen { -1 };
84 /// Are these data valid?
85 bool valid { false };
86
87 inline bool isValid() const
88 {
89 return valid; // convenience method
90 }
91 };
92
93 inline QImage getImage() const { return m_Image; }
94 inline KSDssImage::Metadata getMetadata() const { return m_Metadata; }
95 inline QString getFileName() const { return m_FileName; }
96
97 // TODO: Implement methods to load and read FITS image data and metadata
98
99 private:
100 // TODO: Add support for FITS
101 QString m_FileName;
102 QImage m_Image;
103 Metadata m_Metadata;
104};
Provides a class to hold a DSS Image along with its metadata.
Definition ksdssimage.h:21
KSDssImage(const QString &fileName)
Constructor.
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
Structure to hold some DSS image metadata.
Definition ksdssimage.h:36
Source src
DSS / SDSS – source of the image.
Definition ksdssimage.h:71
FileFormat format
File format used.
Definition ksdssimage.h:69
bool valid
Are these data valid?
Definition ksdssimage.h:85
QString version
Used for DSS – Indicates which version of scans to pull.
Definition ksdssimage.h:65
int gen
Generation for DSS images, data release for SDSS; use -1 for unknown.
Definition ksdssimage.h:83
float height
Height in arcminutes.
Definition ksdssimage.h:77
Source
Contains possible sources for digitized sky-survey images.
Definition ksdssimage.h:42
QString object
Name / identifier of the object. Added to metadata.
Definition ksdssimage.h:67
float width
Width in arcminutes.
Definition ksdssimage.h:79
char band
Photometric band (UBVRI...) Use "?" for unknown.
Definition ksdssimage.h:81
dms dec0
Center Dec (J2000.0)
Definition ksdssimage.h:75
dms ra0
Center RA (J2000.0)
Definition ksdssimage.h:73
FileFormat
Contains possible file formats for images.
Definition ksdssimage.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:25 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.