#ifndef __VIDEOWIDGET_H
#define __VIDEOWIDGET_H

#include <boost/smart_ptr.hpp>
#include "image_v4linput.h"
#include "rgba.h"
#include <QtOpenGL/QGLWidget>

class QScrollArea;

class VideoWidget: public QGLWidget
{
  Q_OBJECT
public:
  VideoWidget( QWidget *parent = 0, Qt::WFlags = 0 );
  virtual void setImage( const mimas::image< mimas::rgba< unsigned char > > &_img );
  virtual void setImage( int _offsetX, int _offsetY, int _width, int _height,
                         const mimas::image< mimas::rgba< unsigned char > > &_img );
  const mimas::image< mimas::rgba< unsigned char > > &getImage(void)
    { return img; }
protected:
  virtual void wheelEvent( QWheelEvent *e );
  void initializeGL(void);
  void resizeGL( int w, int h );
  void paintGL(void);
  void adaptSize( int w, int h );
  int offsetX;
  int offsetY;
  double zoom;
  mimas::image< mimas::rgba< unsigned char > > img;
};

#endif