moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / streamwg.h
blob27d24fc74c30eae21d094378608a2ed9ecd9513e
1 /* Stream Widget
2 Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 This application is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 2004-03-16: A class to handle video streaming.
12 #ifndef STREAMWG_H
13 #define STREAMWG_H
15 #include <qpixmap.h>
16 #include <kpixmapio.h>
18 #include "streamformui.h"
19 #include "qframe.h"
22 class QImage;
23 class QSocketNotifier;
24 class VideoWG;
25 class INDIStdDevice;
26 class QPainter;
27 class QVBoxLayout;
29 class StreamWG : public streamForm
31 Q_OBJECT
33 public:
34 StreamWG(INDIStdDevice *inStdDev, QWidget * parent =0, const char * name =0);
35 ~StreamWG();
37 friend class VideoWG;
38 friend class INDIStdDevice;
40 void setColorFrame(bool color);
41 void setSize(int wd, int ht);
42 void enableStream(bool enable);
44 bool processStream;
45 int streamWidth, streamHeight;
46 VideoWG *streamFrame;
47 bool colorFrame;
49 private:
50 INDIStdDevice *stdDev;
51 QPixmap playPix, pausePix, capturePix;
52 QVBoxLayout *videoFrameLayout;
54 protected:
55 void closeEvent ( QCloseEvent * e );
56 void resizeEvent(QResizeEvent *ev);
59 public slots:
60 void playPressed();
61 void captureImage();
66 class VideoWG : public QFrame
68 Q_OBJECT
70 public:
71 VideoWG(QWidget * parent =0, const char * name =0);
72 ~VideoWG();
74 friend class StreamWG;
76 void newFrame(unsigned char *buffer, int buffSiz, int w, int h);
78 private:
79 int totalBaseCount;
80 QRgb *grayTable;
81 QImage *streamImage;
82 QPixmap qPix;
83 KPixmapIO kPixIO;
85 protected:
86 void paintEvent(QPaintEvent *ev);
90 #endif