kstars
streamwg.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef STREAMWG_H
00013 #define STREAMWG_H
00014
00015 #include <qpixmap.h>
00016 #include <kpixmapio.h>
00017
00018 #include "streamformui.h"
00019 #include "qframe.h"
00020
00021
00022 class QImage;
00023 class QSocketNotifier;
00024 class VideoWG;
00025 class INDIStdDevice;
00026 class QPainter;
00027 class QVBoxLayout;
00028
00029 class StreamWG : public streamForm
00030 {
00031 Q_OBJECT
00032
00033 public:
00034 StreamWG(INDIStdDevice *inStdDev, QWidget * parent =0, const char * name =0);
00035 ~StreamWG();
00036
00037 friend class VideoWG;
00038 friend class INDIStdDevice;
00039
00040 void setColorFrame(bool color);
00041 void setSize(int wd, int ht);
00042 void enableStream(bool enable);
00043
00044 bool processStream;
00045 int streamWidth, streamHeight;
00046 VideoWG *streamFrame;
00047 bool colorFrame;
00048
00049 private:
00050 INDIStdDevice *stdDev;
00051 QPixmap playPix, pausePix, capturePix;
00052 QVBoxLayout *videoFrameLayout;
00053
00054 protected:
00055 void closeEvent ( QCloseEvent * e );
00056 void resizeEvent(QResizeEvent *ev);
00057
00058
00059 public slots:
00060 void playPressed();
00061 void captureImage();
00062
00063
00064 };
00065
00066 class VideoWG : public QFrame
00067 {
00068 Q_OBJECT
00069
00070 public:
00071 VideoWG(QWidget * parent =0, const char * name =0);
00072 ~VideoWG();
00073
00074 friend class StreamWG;
00075
00076 void newFrame(unsigned char *buffer, int buffSiz, int w, int h);
00077
00078 private:
00079 int totalBaseCount;
00080 QRgb *grayTable;
00081 QImage *streamImage;
00082 QPixmap qPix;
00083 KPixmapIO kPixIO;
00084
00085 protected:
00086 void paintEvent(QPaintEvent *ev);
00087
00088 };
00089
00090 #endif