Kstars

videowg.h
1/*
2 SPDX-FileCopyrightText: 2017 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "fitsviewer/bayer.h"
10
11#include <indidevapi.h>
12
13#include <QPixmap>
14#include <QVector>
15#include <QColor>
16#include <QLabel>
17#include <QSqlDatabase>
18#include <QPen>
19#include <QPainter>
20
21#include <memory>
22#include <mutex>
23
24class QImage;
25class QRubberBand;
26class QSqlTableModel;
27
28class VideoWG : public QLabel
29{
31
32 public:
33 explicit VideoWG(QWidget *parent = nullptr);
34 virtual ~VideoWG() override;
35
36 bool newFrame(IBLOB *bp);
37 bool newBayerFrame(IBLOB *bp, const BayerParams &params);
38
39 bool save(const QString &filename, const char *format);
40
41 void setSize(uint16_t w, uint16_t h);
42
43 protected:
44 //virtual void resizeEvent(QResizeEvent *ev) override;
45 void mousePressEvent(QMouseEvent *event) override;
46 void mouseMoveEvent(QMouseEvent *event) override;
47 void mouseReleaseEvent(QMouseEvent *event) override;
48 void initOverlayModel();
49
50 public slots:
51 void modelChanged();
52 void toggleOverlay();
53
54 signals:
55 void newSelection(QRect);
56 void imageChanged(const QSharedPointer<QImage> &frame);
57
58 private:
59 bool debayer(const IBLOB *bp, const BayerParams &params);
60
61 uint16_t streamW { 0 };
62 uint16_t streamH { 0 };
63 uint32_t totalBaseCount { 0 };
64 QVector<QRgb> grayTable;
65 QSharedPointer<QImage> streamImage;
66 QPixmap kPix;
67 QRubberBand *rubberBand { nullptr };
68 QPoint origin;
69 QString m_RawFormat;
70 bool m_RawFormatSupported { false };
71
72 // Collimation Overlay
73 void setupOverlay();
74 void paintOverlay(QPixmap &imagePix);
75 bool overlayEnabled = false;
76 QSqlTableModel *m_CollimationOverlayElementsModel = { nullptr };
77 QList<QVariantMap> m_CollimationOverlayElements;
78 QList<QVariantMap> m_EnabledOverlayElements;
79 QVariantMap *m_CurrentElement = nullptr;
80 QStringList *typeValues = nullptr;
81 QPainter *painter = nullptr;
82 float scale;
83 void PaintOneItem (QString type, QPointF position, int sizeX, int sizeY, int thickness);
84};
virtual bool event(QEvent *e) override
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.