39 lines
664 B
C++
39 lines
664 B
C++
|
#include "aigoqt.h"
|
||
|
#include <QtDebug>
|
||
|
|
||
|
AigoQt::AigoQt(QWidget *parent)
|
||
|
: QMainWindow(parent)
|
||
|
{
|
||
|
setupUi(this);
|
||
|
cam = new Quickcam("/dev/video0");
|
||
|
|
||
|
timer = new QTimer(this);
|
||
|
connect(timer, SIGNAL(timeout()), this, SLOT(updateImage()));
|
||
|
timer->start(200);
|
||
|
}
|
||
|
|
||
|
AigoQt::~AigoQt( void )
|
||
|
{
|
||
|
delete cam;
|
||
|
}
|
||
|
|
||
|
void AigoQt::updateImage( void )
|
||
|
{
|
||
|
cam->update();
|
||
|
SDL_Surface *s = cam->getSurface();
|
||
|
image->setPixmap(QPixmap::fromImage(QImage((uchar*)s->pixels, s->w, s->h, QImage::Format_RGB32)));
|
||
|
}
|
||
|
|
||
|
void AigoQt::on_buttonSetCorners_clicked( void )
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void AigoQt::on_slider_valueChanged( int value)
|
||
|
{
|
||
|
timer->stop();
|
||
|
timer->start(value);
|
||
|
}
|
||
|
|
||
|
#include "aigoqt.moc"
|