#include "imagecontrol.h"
#include <pthread.h>
#include <iostream>
using namespace std;

#include <qframe.h>
/*
class QMyEvent: public QEvent
{
public:
    QFrame* frame;
    QMyEvent(QFrame* fr): frame(fr), QEvent(User){}
    ~QMyEvent(){}
};
*/
class QImageControl: public IImageControl, public QWidget
{
    QFrame* _left;
    QFrame* _right;
    CImage* _il, *_ir;
    pthread_mutex_t mutex;
    int _w, _h;
public:
    QImageControl(QWidget* parent, const char* name="Image control");
    virtual ~QImageControl();
    void setSize(int width, int height);
//    int getBitDepth();
    void setSourcePicture(const CImage*);
    void setDestPicture(const CImage*); 
    bool close(bool){return false;}
    void paintEvent(QPaintEvent*);
protected:
    void setPicture(const CImage*, QFrame*);
    bool event(QEvent* ev);
};
