From: 020535 <020535@07accd87-1e0b-0410-939d-c05d8a058e03> Date: Thu, 11 Jun 2009 21:55:04 +0000 (+0000) Subject: Removing the docs from svn. These are generatet using doxygen anyways. X-Git-Url: https://git.defcon.no/?a=commitdiff_plain;h=a65d4d45c78706c49bd443a392b4c378efbdc3b9;p=qopencamwidget Removing the docs from svn. These are generatet using doxygen anyways. git-svn-id: https://dilbert.hig.no/svn/student/020535/qopencamwidget/trunk@176 07accd87-1e0b-0410-939d-c05d8a058e03 --- diff --git a/doc/html/annotated.html b/doc/html/annotated.html deleted file mode 100644 index 259c2b6..0000000 --- a/doc/html/annotated.html +++ /dev/null @@ -1,33 +0,0 @@ - -
-QOpenCamWidget | |
View |
canvas | QOpenCamWidget | [private] |
capture | QOpenCamWidget | [private] |
frametimer | QOpenCamWidget | [private] |
grabCapture(int source) | QOpenCamWidget | |
grabFrame(void) | QOpenCamWidget | [slot] |
imageReady(QImage snapshot) | QOpenCamWidget | [signal] |
Ipl2QImage(const IplImage *img) | QOpenCamWidget | |
layout | QOpenCamWidget | [private] |
nextFrame | QOpenCamWidget | [private] |
paintEvent(QPaintEvent *event) | QOpenCamWidget | |
QOpenCamWidget(QWidget *parent=0) | QOpenCamWidget | |
setSnapshotVisible(bool visible) | QOpenCamWidget | |
startCapture(void) | QOpenCamWidget | |
startSnap() | QOpenCamWidget | [slot] |
trigger | QOpenCamWidget | [private] |
trigger_active | QOpenCamWidget | [private] |
~QOpenCamWidget(void) | QOpenCamWidget |
#include <qopencamwidget.h>
-- -
Public Slots | |
void | grabFrame (void) |
Grabs a frame and causes an update() when triggered. | |
void | startSnap () |
Trigger this slot to save a frame from the widget. | |
Signals | |
void | imageReady (QImage snapshot) |
Public Member Functions | |
QOpenCamWidget (QWidget *parent=0) | |
Consctructs a QWidget based widget for displaying video coming from an OpenCV capture source. | |
~QOpenCamWidget (void) | |
void | paintEvent (QPaintEvent *event) |
A paint event is a request to repaint all or part of a widget. | |
void | setSnapshotVisible (bool visible) |
Changes the visibility of the optional built-in "Take snapshot" button. | |
bool | grabCapture (int source) |
Grabs an OpenCV video capture source. | |
void | startCapture (void) |
Starts up grabbing of video frames. | |
QImage * | Ipl2QImage (const IplImage *img) |
Converts from the OpenCV IplImage data structure to a QImage. | |
Private Attributes | |
CvCapture * | capture |
QTimer * | frametimer |
QImage * | nextFrame |
QLabel * | canvas |
QVBoxLayout * | layout |
QPushButton * | trigger |
bool | trigger_active |
Definition at line 29 of file qopencamwidget.h.
-QOpenCamWidget::QOpenCamWidget | -( | -QWidget * | - parent = 0 |
- ) | -- |
-Consctructs a QWidget based widget for displaying video coming from an OpenCV capture source. -
-Including webcam data in a Qt application can be problematic, at least as long as Phonon does not support webcams, and the Phonon GStreamer backend only supports simple pipelines.
-This class solves the complexity of adding a webcam view, by using the cross-platform available OpenCV library.
-Limitations, i.e. reasons to read this code and reimplement, are: saving or streaming video is not really available (unless you do repeated timer-triggered connections to the startSnap slot), the widget size is identical to the video source dimensions (it resizes the wodget using setMinimuSize to the video dimensions, and does not handle resizing to sizes above this dimension.
-A brief summary of how to use this class:
QOpenCamWidget *cw = new QOpenCamWidget(this); - if ( cw->grabCapture(-1) ) { - cw->setSnapshotVisible(true); - cw->startCapture(); - } - connect( cw, SIGNAL(imageReady(QImage)), this, SLOT(saveImage(QImage))); -
-
*parent | The parent widget containing this widget, defaults to NULL. |
Definition at line 60 of file qopencamwidget.cpp.
- -References canvas, frametimer, layout, nextFrame, trigger, and trigger_active.
- -QOpenCamWidget::~QOpenCamWidget | -( | -void | -- | ) | -- |
- -
Definition at line 88 of file qopencamwidget.cpp.
- - - --
void QOpenCamWidget::paintEvent | -( | -QPaintEvent * | -event | -) | -- |
-A paint event is a request to repaint all or part of a widget. -
-It can happen for one of the following reasons:
-
Definition at line 144 of file qopencamwidget.cpp.
- - - -void QOpenCamWidget::setSnapshotVisible | -( | -bool | -visible | -) | -- |
-Changes the visibility of the optional built-in "Take snapshot" button. -
-The widget contains a push-button that optionally can be displayed. When visible, this button is located at the bottom of the widget, and causes the SLOT QOpenCamWidget::startSnap to be triggered when clicked.
-
visible | True makes the button display, and trigger, false turns the feature off. False, i.e. no button, is default. |
Definition at line 110 of file qopencamwidget.cpp.
- -References layout, startSnap(), trigger, and trigger_active.
- -Referenced by View::View().
- -bool QOpenCamWidget::grabCapture | -( | -int | -source | -) | -- |
-Grabs an OpenCV video capture source. -
-By grabbing a source, it is meant to open the capture source, and have it ready to start streaming/capturing frames. Returns true on success, false on error. The grabCapture is separated from the constructor and/or frame-grabbing, so that you may do the error-checking you really should do before proceeding.
-
source | The OpenCV capture source enumeration index to open |
Definition at line 183 of file qopencamwidget.cpp.
- -References canvas, and capture.
- -Referenced by View::View().
- -void QOpenCamWidget::startCapture | -( | -void | -- | ) | -- |
-Starts up grabbing of video frames. -
-The actual grabbing and displaying of video frames is performed by a QTimer triggering the SLOT QOpenCamWidget::grabFrame(). startCapture() sets up the timer running this captureFrame loop.
-The SLOT QOpenCamWidget::startSnap() is used to get image frames out from the widget for other uses, like saving or processing. This function relies on the timer created and configured by startCapture(), and as such, this function is the only permitted way to start the actual capture/streaming of video from the source. -
Definition at line 217 of file qopencamwidget.cpp.
- -References frametimer, grabFrame(), and trigger.
- -Referenced by View::View().
- -QImage * QOpenCamWidget::Ipl2QImage | -( | -const IplImage * | -img | -) | -- |
-Converts from the OpenCV IplImage data structure to a QImage. -
-OpenCV uses a data strcuture calles IplImage, optimized for computer vision image processing tasks. This code was adapted from kcamwidget.cpp, part of the KDE SVN at playground/multimedia/kcam/kcamwidget.cpp
-In regard that the IplImage can be forced into a format that aligns well with a RBG888-format, the conversion becomes one of the shortes, simples IplImage->QImage I've seen.
-
*img | The IplImage to be converted to a QImage. |
Definition at line 241 of file qopencamwidget.cpp.
- -Referenced by grabFrame().
- -void QOpenCamWidget::grabFrame | -( | -void | -- | ) | - [slot] |
-
-Grabs a frame and causes an update() when triggered. -
-This is the SLOT that actually reads the video source and causes the widget to display live video. Preferably this slot will never be called my any other signal that a timeout() on the frametimer, which is controlled by QOpenCamWidget::startCapture() -
Definition at line 266 of file qopencamwidget.cpp.
- -References capture, Ipl2QImage(), and nextFrame.
- -Referenced by startCapture().
- -void QOpenCamWidget::startSnap | -( | -void | -- | ) | - [slot] |
-
-Trigger this slot to save a frame from the widget. -
-When this slot is triggered, the widgets capture loop is temporarily stopped, and the last displayed frame is "captured", and made available through the emitting of the class imageReady SIGNAL.
-With the "Take snapshot" button visible (setSnapshotVisible(true)), this SLOT is triggered when the user clicks on the trigger button. If you do not wish to use the internal trigger button, you will have to add a different mechanism to trigger this SLOT.
-It is possible, though I would not recommend, to use repeated triggering of this slot to do repeated frame-capture, and thus make a form of "Animation" or "Video" capture. -
Definition at line 306 of file qopencamwidget.cpp.
- -References frametimer, imageReady(), and nextFrame.
- -Referenced by setSnapshotVisible().
- -void QOpenCamWidget::imageReady | -( | -QImage | -snapshot | -) | - [signal] |
-
- -
Referenced by startSnap().
- --
CvCapture* QOpenCamWidget::capture [private] |
-
- -
Definition at line 35 of file qopencamwidget.h.
- -Referenced by grabCapture(), grabFrame(), and ~QOpenCamWidget().
- -QTimer* QOpenCamWidget::frametimer [private] |
-
- -
Definition at line 36 of file qopencamwidget.h.
- -Referenced by QOpenCamWidget(), startCapture(), and startSnap().
- -QImage* QOpenCamWidget::nextFrame [private] |
-
- -
Definition at line 37 of file qopencamwidget.h.
- -Referenced by grabFrame(), paintEvent(), QOpenCamWidget(), and startSnap().
- -QLabel* QOpenCamWidget::canvas [private] |
-
- -
Definition at line 39 of file qopencamwidget.h.
- -Referenced by grabCapture(), paintEvent(), QOpenCamWidget(), and ~QOpenCamWidget().
- -QVBoxLayout* QOpenCamWidget::layout [private] |
-
- -
Definition at line 40 of file qopencamwidget.h.
- -Referenced by QOpenCamWidget(), and setSnapshotVisible().
- -QPushButton* QOpenCamWidget::trigger [private] |
-
- -
Definition at line 41 of file qopencamwidget.h.
- -Referenced by QOpenCamWidget(), setSnapshotVisible(), startCapture(), and ~QOpenCamWidget().
- -bool QOpenCamWidget::trigger_active [private] |
-
- -
Definition at line 42 of file qopencamwidget.h.
- -Referenced by QOpenCamWidget(), and setSnapshotVisible().
- --
saveImage(QImage image) | View | [slot] |
View(QWidget *parent=0) | View | |
~View(void) | View |
#include <view.h>
-- -
Public Slots | |
void | saveImage (QImage image) |
Public Member Functions | |
View (QWidget *parent=0) | |
~View (void) |
Definition at line 5 of file view.h.
-View::View | -( | -QWidget * | - parent = 0 |
- ) | -- |
- -
Definition at line 32 of file view.cpp.
- -References QOpenCamWidget::grabCapture(), saveImage(), QOpenCamWidget::setSnapshotVisible(), and QOpenCamWidget::startCapture().
- --
void View::saveImage | -( | -QImage | -image | -) | - [slot] |
-
-
main.cpp [code] | |
qopencamwidget.cpp [code] | |
qopencamwidget.h [code] | |
view.cpp [code] | |
view.h [code] |
-
-
-
-
-
-
#include <QtGui/QApplication>
#include "view.h"
-Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
int main | -( | -int | -argc, | -|
- | - | char * | -argv[] | - |
- | ) | -- |
-
#include "qopencamwidget.h"
-Go to the source code of this file.
#include <QtGui>
#include <opencv/cv.h>
#include <opencv/highgui.h>
-Go to the source code of this file.
Classes | |
class | QOpenCamWidget |
#include "view.h"
#include "qopencamwidget.h"
-Go to the source code of this file.
#include <QtGui>
-Go to the source code of this file.
Classes | |
class | View |