| 178 | 
        kaklik | 
        1 | 
        #ifndef __VIDEOWIDGET_H | 
      
      
         | 
         | 
        2 | 
        #define __VIDEOWIDGET_H | 
      
      
         | 
         | 
        3 | 
          | 
      
      
         | 
         | 
        4 | 
        #include <boost/smart_ptr.hpp> | 
      
      
         | 
         | 
        5 | 
        #include "image_v4linput.h" | 
      
      
         | 
         | 
        6 | 
        #include "rgba.h" | 
      
      
         | 
         | 
        7 | 
        #include <QtOpenGL/QGLWidget> | 
      
      
         | 
         | 
        8 | 
          | 
      
      
         | 
         | 
        9 | 
        class QScrollArea; | 
      
      
         | 
         | 
        10 | 
          | 
      
      
         | 
         | 
        11 | 
        class VideoWidget: public QGLWidget | 
      
      
         | 
         | 
        12 | 
        { | 
      
      
         | 
         | 
        13 | 
          Q_OBJECT | 
      
      
         | 
         | 
        14 | 
        public: | 
      
      
         | 
         | 
        15 | 
          VideoWidget( QWidget *parent = 0, Qt::WFlags = 0 ); | 
      
      
         | 
         | 
        16 | 
          virtual void setImage( const mimas::image< mimas::rgba< unsigned char > > &_img ); | 
      
      
         | 
         | 
        17 | 
          virtual void setImage( int _offsetX, int _offsetY, int _width, int _height, | 
      
      
         | 
         | 
        18 | 
                                 const mimas::image< mimas::rgba< unsigned char > > &_img ); | 
      
      
         | 
         | 
        19 | 
          const mimas::image< mimas::rgba< unsigned char > > &getImage(void) | 
      
      
         | 
         | 
        20 | 
            { return img; } | 
      
      
         | 
         | 
        21 | 
        protected: | 
      
      
         | 
         | 
        22 | 
          virtual void wheelEvent( QWheelEvent *e ); | 
      
      
         | 
         | 
        23 | 
          void initializeGL(void); | 
      
      
         | 
         | 
        24 | 
          void resizeGL( int w, int h ); | 
      
      
         | 
         | 
        25 | 
          void paintGL(void); | 
      
      
         | 
         | 
        26 | 
          void adaptSize( int w, int h ); | 
      
      
         | 
         | 
        27 | 
          int offsetX; | 
      
      
         | 
         | 
        28 | 
          int offsetY; | 
      
      
         | 
         | 
        29 | 
          double zoom; | 
      
      
         | 
         | 
        30 | 
          mimas::image< mimas::rgba< unsigned char > > img; | 
      
      
         | 
         | 
        31 | 
        }; | 
      
      
         | 
         | 
        32 | 
          | 
      
      
         | 
         | 
        33 | 
        #endif |