haraldhv
/
aigo
Archived
1
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
aigo/qt/aigoqt.cpp

39 lines
664 B
C++
Raw Normal View History

#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"