Kstars

videowg.h
1 /*
2  SPDX-FileCopyrightText: 2017 Jasem Mutlaq <[email protected]>
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 
18 #include <memory>
19 #include <mutex>
20 
21 class QImage;
22 class QRubberBand;
23 
24 class VideoWG : public QLabel
25 {
26  Q_OBJECT
27 
28  public:
29  explicit VideoWG(QWidget *parent = nullptr);
30  virtual ~VideoWG() override = default;
31 
32  bool newFrame(IBLOB *bp);
33  bool newBayerFrame(IBLOB *bp, const BayerParams &params);
34 
35  bool save(const QString &filename, const char *format);
36 
37  void setSize(uint16_t w, uint16_t h);
38 
39  protected:
40  //virtual void resizeEvent(QResizeEvent *ev) override;
41  void mousePressEvent(QMouseEvent *event) override;
42  void mouseMoveEvent(QMouseEvent *event) override;
43  void mouseReleaseEvent(QMouseEvent *event) override;
44 
45  signals:
46  void newSelection(QRect);
47  void imageChanged(const QSharedPointer<QImage> &frame);
48 
49  private:
50  bool debayer(const IBLOB *bp, const BayerParams &params);
51 
52  uint16_t streamW { 0 };
53  uint16_t streamH { 0 };
54  uint32_t totalBaseCount { 0 };
55  QVector<QRgb> grayTable;
56  QSharedPointer<QImage> streamImage;
57  QPixmap kPix;
58  QRubberBand *rubberBand { nullptr };
59  QPoint origin;
60  QString m_RawFormat;
61  bool m_RawFormatSupported { false };
62 };
Q_OBJECTQ_OBJECT
virtual void mouseMoveEvent(QMouseEvent *ev) override
virtual void mousePressEvent(QMouseEvent *ev) override
virtual void mouseReleaseEvent(QMouseEvent *ev) override
QAction * save(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.