summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/ccdpreviewwg.h
blob: 79d82a37c6cb7fb4b78c0a7cd9817ff5e3b21ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*  CCD Preview
    Copyright (C) 2005 Dirk Huenniger <hunniger@cip.physik.uni-bonn.de>

    Adapted from streamwg by Jasem Mutlaq

    This application is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
    
 */
 
 #ifndef CCDPREVIEWWG_H
 #define CCDPREVIEWWG_H
 
 #include <tqpixmap.h>
 #include <kpixmapio.h>
  
 #include "ccdpreviewui.h"
 #include "tqframe.h"
 
enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2};

 class TQImage;
 class TQSocketNotifier;
 class CCDVideoWG;
 class INDIStdDevice;
 class TQPainter;
 class TQVBoxLayout;
 
 class CCDPreviewWG : public CCDPreviewForm
 {
   Q_OBJECT
  TQ_OBJECT
   
    public:
      CCDPreviewWG(INDIStdDevice *inStdDev, TQWidget * parent =0, const char * name =0);
      ~CCDPreviewWG();
 
   friend class CCDVideoWG;
   friend class INDIStdDevice;
   
   void setColorFrame(bool color);
   void setCtrl(int wd, int ht,int po, int bpp, unsigned long mgd);
   void setCCDInfo(double in_fwhm, int in_mu);
   void enableStream(bool enable);
   
   bool	processStream;
   int         		 streamWidth, streamHeight;
   CCDVideoWG		*streamFrame;
   bool			 colorFrame;
   
   private:
   INDIStdDevice        *stdDev;
   TQPixmap               playPix, pausePix, capturePix;
   TQVBoxLayout           *videoFrameLayout;
   double fwhm;
   int mu;
   
   protected:
   void closeEvent ( TQCloseEvent * e );
   void resizeEvent(TQResizeEvent *ev);
   
   
   public slots: 
   void playPressed();
   void captureImage();
   void brightnessChanged(int value);
   void contrastChanged(int value);
   void gammaChanged(int value);
   void updateFWHM();
 };
 
 class CCDVideoWG : public TQFrame
 {
      Q_OBJECT
  TQ_OBJECT
   
    public:
      CCDVideoWG(TQWidget * parent =0, const char * name =0);
      ~CCDVideoWG();
      
      friend class CCDPreviewWG;
      
      void newFrame(unsigned char *buffer, int buffSiz, int w, int h);

    private:
      void redrawVideoWG(void);
      long		totalBaseCount;
      TQRgb              *grayTable;
      TQImage		*streamImage;
      TQPixmap		 qPix;
      KPixmapIO		 kPixIO;
      unsigned char *streamBuffer;
      unsigned char *displayBuffer;
      long  streamBufferPos;
      double scale,offset,gamma;  
      int bytesPerPixel, PixelOrder;
      int Width, Height;
      unsigned long maxGoodData;
    protected:
     void paintEvent(TQPaintEvent *ev);

   public slots: 
};

#endif  //CCDPREVIEWWG