Kstars

eyepiecefield.h
1/*
2 SPDX-FileCopyrightText: 2014 Akarsh Simha <akarsh.simha@kdemail.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "dms.h"
10
11#include <QPixmap>
12
13#include <memory>
14
15class FOV;
16class SkyPoint;
17
18/**
19 * @class EyepieceField
20 * @short Renders the view through the eyepiece of various telescope types
21 *
22 * @author Akarsh Simha <akarsh.simha@kdemail.net>
23 */
24namespace EyepieceField
25{
26 /**
27 * @short Generate the eyepiece field view and corresponding image view
28 * @param sp Sky point to draw the render the eyepiece field around
29 * @param skyChart A non-null pointer to replace with the eyepiece field image
30 * @param skyImage An optionally non-null pointer to replace with the re-oriented sky image
31 * @param fovWidth width of the field-of-view in arcminutes
32 * @param fovHeight height of field-of-view in arcminutes (if not supplied, is set to fovWidth)
33 * @param imagePath Optional path to DSS or other image. North
34 * should be on the top of the image, and the size should be in
35 * the metadata; otherwise 1.01 arcsec/pixel is assumed.
36 * @note fovWidth can be zero/negative if imagePath is non-empty. If it is, the image
37 * size is used for the FOV.
38 * @note fovHeight can be zero/negative. If it is, fovWidth will be used. If fovWidth is also
39 * zero, image size is used.
40 */
41 void generateEyepieceView(SkyPoint *sp, QImage *skyChart, QImage *skyImage = nullptr, double fovWidth = -1.0,
42 double fovHeight = -1.0, const QString &imagePath = QString());
43
44 /**
45 * @short Overloaded method provided for convenience. Obtains fovWidth/fovHeight from
46 * FOV if non-null, else uses image
47 */
48 void generateEyepieceView(SkyPoint *sp, QImage *skyChart, QImage *skyImage = nullptr,
49 const FOV *fov = nullptr, const QString &imagePath = QString());
50
51 /**
52 * @short Orients the eyepiece view as needed, performs overlaying etc.
53 * @param skyChart image which contains the sky chart, possibly generated using generateEyepieceView
54 * @param skyImage optional image which contains the sky image, possibly generated using generateEyepieceView
55 * @param renderChart pixmap onto which the sky chart is to be rendered
56 * @param renderImage optional pixmap onto which the sky image is to be rendered
57 * @param rotation optional, number of degrees by which to rotate the image(s)
58 * @param scale optional, factor by which to scale the image(s)
59 * @param flip optional, if true, the image is mirrored horizontally
60 * @param invert optional, if true, the image is inverted, i.e. rotated by 180 degrees
61 * @param overlay optional, if true, the sky image is overlaid on the sky map
62 * @param invertColors optional, if true, the sky image is color-inverted
63 */
64 void renderEyepieceView(const QImage *skyChart, QPixmap *renderChart, const double rotation = 0,
65 const double scale = 1.0, const bool flip = false, const bool invert = false,
66 const QImage *skyImage = nullptr, QPixmap *renderImage = nullptr,
67 const bool overlay = false, const bool invertColors = false);
68
69 /**
70 * @short Convenience method that generates and the renders the eyepiece view
71 * @note calls generateEyepieceView() followed by the raw form of renderEyepieceView() to render an eyepiece view
72 */
73 void renderEyepieceView(SkyPoint *sp, QPixmap *renderChart, double fovWidth = -1.0, double fovHeight = -1.0,
74 const double rotation = 0, const double scale = 1.0, const bool flip = false,
75 const bool invert = false, const QString &imagePath = QString(),
76 QPixmap *renderImage = nullptr, const bool overlay = false,
77 const bool invertColors = false);
78
79 /**
80 * @short Finds the angle between "up" (i.e. direction of increasing altitude) and "north" (i.e. direction of increasing declination) at a given point in the sky
81 * @attention Procedure does not account for precession and nutation at the moment
82 * @note SkyPoint must already have Equatorial and Horizontal coordinate synced
83 */
84 dms findNorthAngle(const SkyPoint *sp, const dms *lat);
85};
Renders the view through the eyepiece of various telescope types.
A simple class encapsulating a Field-of-View symbol.
Definition fov.h:28
The sky coordinates of a point in the sky.
Definition skypoint.h:45
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.