Kstars

streamwg.h
1/*
2 SPDX-FileCopyrightText: 2003-2017 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "indicamera.h"
10#include "ui_streamform.h"
11#include "ui_recordingoptions.h"
12#include "fitsviewer/bayer.h"
13#include <indidevapi.h>
14
15#include <QCloseEvent>
16#include <QColor>
17#include <QIcon>
18#include <QImage>
19#include <QPaintEvent>
20#include <QPixmap>
21#include <QResizeEvent>
22#include <QVBoxLayout>
23#include <QVector>
24
25class RecordOptions : public QDialog, public Ui::recordingOptions
26{
28
29 public:
30 explicit RecordOptions(QWidget *parent);
31
32 public slots:
33 void selectRecordDirectory();
34
35 private:
36 QUrl dirPath;
37
38 friend class StreamWG;
39};
40
41class StreamWG : public QDialog, public Ui::streamForm
42{
44
45 public:
46 explicit StreamWG(ISD::Camera *ccd);
47 virtual ~StreamWG() override;
48
49 void setColorFrame(bool color);
50 void setSize(int wd, int ht);
51
52 void enableStream(bool enable);
53 bool isStreamEnabled()
54 {
55 return processStream;
56 }
57
58 void newFrame(INDI::Property prop);
59
60 int getStreamWidth()
61 {
62 return streamWidth;
63 }
64 int getStreamHeight()
65 {
66 return streamHeight;
67 }
68
69 protected:
70 void closeEvent(QCloseEvent *ev) override;
71 void showEvent(QShowEvent *ev) override;
72 QSize sizeHint() const override;
73
74 public slots:
75 void toggleRecord();
76 void updateRecordStatus(bool enabled);
77 void resetFrame();
78 void syncDebayerParameters();
79
80 protected slots:
81 void setStreamingFrame(QRect newFrame);
82 void updateFPS(double instantFPS, double averageFPS);
83
84 signals:
85 void hidden();
86 void imageChanged(const QSharedPointer<QImage> &frame);
87
88 private:
89 bool queryDebayerParameters();
90
91 bool processStream;
92 int streamWidth, streamHeight;
93 bool colorFrame, isRecording;
94 bool showOverlay = false;
95 QIcon recordIcon, stopIcon;
96 ISD::Camera *m_Camera {nullptr};
97
98 // Debayer
99 BayerParams m_DebayerParams;
100 uint8_t m_BBP {8};
101 uint16_t offsetX, offsetY;
102 double pixelX, pixelY;
103 bool m_DebayerActive { false }, m_DebayerSupported { false };
104
105 // For Canon DSLRs
106 INDI::Property *eoszoom {nullptr}, *eoszoomposition {nullptr};
107
108 // Options panels
109 RecordOptions *options;
110};
Camera class controls an INDI Camera device.
Definition indicamera.h:44
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 27 2024 12:02:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.