1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv=
"Content-Type" content=
"text/html;charset=UTF-8">
3 <title>QOpenCamWidget: QOpenCamWidget Class Reference
</title>
4 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css">
5 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css">
7 <!-- Generated by Doxygen 1.5.6 -->
8 <div class=
"navigation" id=
"top">
11 <li><a href=
"main.html"><span>Main
Page
</span></a></li>
12 <li class=
"current"><a href=
"annotated.html"><span>Classes
</span></a></li>
13 <li><a href=
"files.html"><span>Files
</span></a></li>
18 <li><a href=
"annotated.html"><span>Class
List
</span></a></li>
19 <li><a href=
"functions.html"><span>Class
Members
</span></a></li>
23 <div class=
"contents">
24 <h1>QOpenCamWidget Class Reference
</h1><!-- doxytag: class="QOpenCamWidget" --><code>#include
<<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>></code>
28 <a href=
"classQOpenCamWidget-members.html">List of all members.
</a><table border=
"0" cellpadding=
"0" cellspacing=
"0">
30 <tr><td colspan=
"2"><br><h2>Public Slots
</h2></td></tr>
31 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#27c30cec9a8d44c1802e4218bea7bdb4">grabFrame
</a> (void)
</td></tr>
33 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Grabs a frame and causes an update() when triggered.
<a href=
"#27c30cec9a8d44c1802e4218bea7bdb4"></a><br></td></tr>
34 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#82540c90d3efa85631f13af3a60fa94b">startSnap
</a> ()
</td></tr>
36 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Trigger this slot to save a frame from the widget.
<a href=
"#82540c90d3efa85631f13af3a60fa94b"></a><br></td></tr>
37 <tr><td colspan=
"2"><br><h2>Signals
</h2></td></tr>
38 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#d410be92ce25ff591726ba255070d09e">imageReady
</a> (QImage snapshot)
</td></tr>
40 <tr><td colspan=
"2"><br><h2>Public Member Functions
</h2></td></tr>
41 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#5835e06a54f1b09b4fd157d88dc72b6e">QOpenCamWidget
</a> (QWidget *parent=
0)
</td></tr>
43 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Consctructs a QWidget based widget for displaying video coming from an OpenCV capture source.
<a href=
"#5835e06a54f1b09b4fd157d88dc72b6e"></a><br></td></tr>
44 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#b0ad4890d7d638354289e074a6f71a3f">~QOpenCamWidget
</a> (void)
</td></tr>
46 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#c6186d1e510b5c8635b2d3bf5d94def6">paintEvent
</a> (QPaintEvent *event)
</td></tr>
48 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">A paint event is a request to repaint all or part of a widget.
<a href=
"#c6186d1e510b5c8635b2d3bf5d94def6"></a><br></td></tr>
49 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#8f885a8bb88870cd19cfc9eb4e02e2ce">setSnapshotVisible
</a> (bool visible)
</td></tr>
51 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Changes the visibility of the optional built-in
"Take snapshot" button.
<a href=
"#8f885a8bb88870cd19cfc9eb4e02e2ce"></a><br></td></tr>
52 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">bool
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#23574314cbd7a74bc6f32a640041d55a">grabCapture
</a> (int source)
</td></tr>
54 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Grabs an OpenCV video capture source.
<a href=
"#23574314cbd7a74bc6f32a640041d55a"></a><br></td></tr>
55 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">void
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880">startCapture
</a> (void)
</td></tr>
57 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Starts up grabbing of video frames.
<a href=
"#b378daa447e8d9b94e1c7c8c6853b880"></a><br></td></tr>
58 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QImage *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#aba8721f46b41d76326e048e3c876f1d">Ipl2QImage
</a> (const IplImage *img)
</td></tr>
60 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Converts from the OpenCV IplImage data structure to a QImage.
<a href=
"#aba8721f46b41d76326e048e3c876f1d"></a><br></td></tr>
61 <tr><td colspan=
"2"><br><h2>Private Attributes
</h2></td></tr>
62 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">CvCapture *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#fde0c9d47e2ea44f2aeea499fd570368">capture
</a></td></tr>
64 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QTimer *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#2e70551b39fd2bd15fc99ca4fa12107f">frametimer
</a></td></tr>
66 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QImage *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#92dab283a477c1b8a6d6d5470d5ef94d">nextFrame
</a></td></tr>
68 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QLabel *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#7ac719f26d5f4a0a80ac6e4ffd4fe46d">canvas
</a></td></tr>
70 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QVBoxLayout *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#e91d147fdd20819b56ebd7861d7ab44e">layout
</a></td></tr>
72 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">QPushButton *
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#a0aaf9bfc43d01979a7af03741620624">trigger
</a></td></tr>
74 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">bool
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classQOpenCamWidget.html#1718e4971977520cfe642daa78e1997e">trigger_active
</a></td></tr>
77 <hr><a name=
"_details"></a><h2>Detailed Description
</h2>
79 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00029">29</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
80 <hr><h2>Constructor
& Destructor Documentation
</h2>
81 <a class=
"anchor" name=
"5835e06a54f1b09b4fd157d88dc72b6e"></a><!-- doxytag: member="QOpenCamWidget::QOpenCamWidget" ref="5835e06a54f1b09b4fd157d88dc72b6e" args="(QWidget *parent=0)" -->
83 <div class=
"memproto">
84 <table class=
"memname">
86 <td class=
"memname">QOpenCamWidget::QOpenCamWidget
</td>
88 <td class=
"paramtype">QWidget *
</td>
89 <td class=
"paramname"> <em>parent
</em> =
<code>0</code> </td>
90 <td> )
</td>
98 Consctructs a QWidget based widget for displaying video coming from an OpenCV capture source.
100 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.
<p>
101 This class solves the complexity of adding a webcam view, by using the cross-platform available OpenCV library.
<p>
102 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.
<p>
103 A brief summary of how to use this class:
<div class=
"fragment"><pre class=
"fragment"> <a class=
"code" href=
"classQOpenCamWidget.html">QOpenCamWidget
</a> *cw =
<span class=
"keyword">new
</span> <a class=
"code" href=
"classQOpenCamWidget.html#5835e06a54f1b09b4fd157d88dc72b6e" title=
"Consctructs a QWidget based widget for displaying video coming from an OpenCV capture...">QOpenCamWidget
</a>(
<span class=
"keyword">this
</span>);
104 <span class=
"keywordflow">if
</span> ( cw-
><a class=
"code" href=
"classQOpenCamWidget.html#23574314cbd7a74bc6f32a640041d55a" title=
"Grabs an OpenCV video capture source.">grabCapture
</a>(-
1) ) {
105 cw-
><a class=
"code" href=
"classQOpenCamWidget.html#8f885a8bb88870cd19cfc9eb4e02e2ce" title=
"Changes the visibility of the optional built-in &quot;Take snapshot&quot; button...">setSnapshotVisible
</a>(
<span class=
"keyword">true
</span>);
106 cw-
><a class=
"code" href=
"classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880" title=
"Starts up grabbing of video frames.">startCapture
</a>();
108 connect( cw, SIGNAL(
<a class=
"code" href=
"classQOpenCamWidget.html#d410be92ce25ff591726ba255070d09e">imageReady
</a>(QImage)),
<span class=
"keyword">this
</span>, SLOT(saveImage(QImage)));
110 <dl compact
><dt><b>Parameters:
</b></dt><dd>
111 <table border=
"0" cellspacing=
"2" cellpadding=
"0">
112 <tr><td valign=
"top"></td><td valign=
"top"><em>*parent
</em> </td><td>The parent widget containing this widget, defaults to NULL.
</td></tr>
116 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">60</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
118 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00039">canvas
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00036">frametimer
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00040">layout
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00037">nextFrame
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00041">trigger
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00042">trigger_active
</a>.
</p>
122 <a class=
"anchor" name=
"b0ad4890d7d638354289e074a6f71a3f"></a><!-- doxytag: member="QOpenCamWidget::~QOpenCamWidget" ref="b0ad4890d7d638354289e074a6f71a3f" args="(void)" -->
123 <div class=
"memitem">
124 <div class=
"memproto">
125 <table class=
"memname">
127 <td class=
"memname">QOpenCamWidget::~QOpenCamWidget
</td>
129 <td class=
"paramtype">void
</td>
130 <td class=
"paramname"> </td>
131 <td> )
</td>
140 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00088">88</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
142 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00039">canvas
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00035">capture
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00041">trigger
</a>.
</p>
146 <hr><h2>Member Function Documentation
</h2>
147 <a class=
"anchor" name=
"c6186d1e510b5c8635b2d3bf5d94def6"></a><!-- doxytag: member="QOpenCamWidget::paintEvent" ref="c6186d1e510b5c8635b2d3bf5d94def6" args="(QPaintEvent *event)" -->
148 <div class=
"memitem">
149 <div class=
"memproto">
150 <table class=
"memname">
152 <td class=
"memname">void QOpenCamWidget::paintEvent
</td>
154 <td class=
"paramtype">QPaintEvent *
</td>
155 <td class=
"paramname"> <em>event
</em> </td>
156 <td> )
</td>
164 A paint event is a request to repaint all or part of a widget.
166 It can happen for one of the following reasons:
<p>
168 <li>repaint() or update() was invoked,
</li>
169 <li>the widget was obscured and has now been uncovered, or
</li>
170 <li>many other reasons.
</li>
172 <a class=
"el" href=
"classQOpenCamWidget.html">QOpenCamWidget
</a> uses the paintEvent to draw each frame onto the screen. The paintEvent itself is regularily triggered by explicit update() calls in
<a class=
"el" href=
"classQOpenCamWidget.html#27c30cec9a8d44c1802e4218bea7bdb4" title=
"Grabs a frame and causes an update() when triggered.">QOpenCamWidget::grabFrame()
</a>.
173 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00144">144</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
175 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00039">canvas
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00037">nextFrame
</a>.
</p>
179 <a class=
"anchor" name=
"8f885a8bb88870cd19cfc9eb4e02e2ce"></a><!-- doxytag: member="QOpenCamWidget::setSnapshotVisible" ref="8f885a8bb88870cd19cfc9eb4e02e2ce" args="(bool visible)" -->
180 <div class=
"memitem">
181 <div class=
"memproto">
182 <table class=
"memname">
184 <td class=
"memname">void QOpenCamWidget::setSnapshotVisible
</td>
186 <td class=
"paramtype">bool
</td>
187 <td class=
"paramname"> <em>visible
</em> </td>
188 <td> )
</td>
196 Changes the visibility of the optional built-in
"Take snapshot" button.
198 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
<a class=
"el" href=
"classQOpenCamWidget.html#82540c90d3efa85631f13af3a60fa94b" title=
"Trigger this slot to save a frame from the widget.">QOpenCamWidget::startSnap
</a> to be triggered when clicked.
<p>
199 <dl compact
><dt><b>Parameters:
</b></dt><dd>
200 <table border=
"0" cellspacing=
"2" cellpadding=
"0">
201 <tr><td valign=
"top"></td><td valign=
"top"><em>visible
</em> </td><td>True makes the button display, and trigger, false turns the feature off. False, i.e. no button, is default.
</td></tr>
205 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00110">110</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
207 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00040">layout
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00306">startSnap()
</a>,
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00041">trigger
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00042">trigger_active
</a>.
</p>
209 <p>Referenced by
<a class=
"el" href=
"view_8cpp-source.html#l00032">View::View()
</a>.
</p>
213 <a class=
"anchor" name=
"23574314cbd7a74bc6f32a640041d55a"></a><!-- doxytag: member="QOpenCamWidget::grabCapture" ref="23574314cbd7a74bc6f32a640041d55a" args="(int source)" -->
214 <div class=
"memitem">
215 <div class=
"memproto">
216 <table class=
"memname">
218 <td class=
"memname">bool QOpenCamWidget::grabCapture
</td>
220 <td class=
"paramtype">int
</td>
221 <td class=
"paramname"> <em>source
</em> </td>
222 <td> )
</td>
230 Grabs an OpenCV video capture source.
232 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.
<p>
233 <dl compact
><dt><b>Parameters:
</b></dt><dd>
234 <table border=
"0" cellspacing=
"2" cellpadding=
"0">
235 <tr><td valign=
"top"></td><td valign=
"top"><em>source
</em> </td><td>The OpenCV capture source enumeration index to open
</td></tr>
239 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00183">183</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
241 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00039">canvas
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00035">capture
</a>.
</p>
243 <p>Referenced by
<a class=
"el" href=
"view_8cpp-source.html#l00032">View::View()
</a>.
</p>
247 <a class=
"anchor" name=
"b378daa447e8d9b94e1c7c8c6853b880"></a><!-- doxytag: member="QOpenCamWidget::startCapture" ref="b378daa447e8d9b94e1c7c8c6853b880" args="(void)" -->
248 <div class=
"memitem">
249 <div class=
"memproto">
250 <table class=
"memname">
252 <td class=
"memname">void QOpenCamWidget::startCapture
</td>
254 <td class=
"paramtype">void
</td>
255 <td class=
"paramname"> </td>
256 <td> )
</td>
264 Starts up grabbing of video frames.
266 The actual grabbing and displaying of video frames is performed by a QTimer triggering the SLOT
<a class=
"el" href=
"classQOpenCamWidget.html#27c30cec9a8d44c1802e4218bea7bdb4" title=
"Grabs a frame and causes an update() when triggered.">QOpenCamWidget::grabFrame()
</a>.
<a class=
"el" href=
"classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880" title=
"Starts up grabbing of video frames.">startCapture()
</a> sets up the timer running this captureFrame loop.
<p>
267 The SLOT
<a class=
"el" href=
"classQOpenCamWidget.html#82540c90d3efa85631f13af3a60fa94b" title=
"Trigger this slot to save a frame from the widget.">QOpenCamWidget::startSnap()
</a> 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
<a class=
"el" href=
"classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880" title=
"Starts up grabbing of video frames.">startCapture()
</a>, and as such, this function is the only permitted way to start the actual capture/streaming of video from the source.
268 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00217">217</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
270 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00036">frametimer
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00266">grabFrame()
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00041">trigger
</a>.
</p>
272 <p>Referenced by
<a class=
"el" href=
"view_8cpp-source.html#l00032">View::View()
</a>.
</p>
276 <a class=
"anchor" name=
"aba8721f46b41d76326e048e3c876f1d"></a><!-- doxytag: member="QOpenCamWidget::Ipl2QImage" ref="aba8721f46b41d76326e048e3c876f1d" args="(const IplImage *img)" -->
277 <div class=
"memitem">
278 <div class=
"memproto">
279 <table class=
"memname">
281 <td class=
"memname">QImage * QOpenCamWidget::Ipl2QImage
</td>
283 <td class=
"paramtype">const IplImage *
</td>
284 <td class=
"paramname"> <em>img
</em> </td>
285 <td> )
</td>
293 Converts from the OpenCV IplImage data structure to a QImage.
295 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
<p>
296 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.
<p>
297 <dl compact
><dt><b>Parameters:
</b></dt><dd>
298 <table border=
"0" cellspacing=
"2" cellpadding=
"0">
299 <tr><td valign=
"top"></td><td valign=
"top"><em>*img
</em> </td><td>The IplImage to be converted to a QImage.
</td></tr>
303 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00241">241</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
305 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00266">grabFrame()
</a>.
</p>
309 <a class=
"anchor" name=
"27c30cec9a8d44c1802e4218bea7bdb4"></a><!-- doxytag: member="QOpenCamWidget::grabFrame" ref="27c30cec9a8d44c1802e4218bea7bdb4" args="(void)" -->
310 <div class=
"memitem">
311 <div class=
"memproto">
312 <table class=
"memname">
314 <td class=
"memname">void QOpenCamWidget::grabFrame
</td>
316 <td class=
"paramtype">void
</td>
317 <td class=
"paramname"> </td>
318 <td> )
</td>
319 <td><code> [slot]
</code></td>
326 Grabs a frame and causes an update() when triggered.
328 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
<a class=
"el" href=
"classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880" title=
"Starts up grabbing of video frames.">QOpenCamWidget::startCapture()
</a>
329 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00266">266</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
331 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00035">capture
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00241">Ipl2QImage()
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00037">nextFrame
</a>.
</p>
333 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00217">startCapture()
</a>.
</p>
337 <a class=
"anchor" name=
"82540c90d3efa85631f13af3a60fa94b"></a><!-- doxytag: member="QOpenCamWidget::startSnap" ref="82540c90d3efa85631f13af3a60fa94b" args="()" -->
338 <div class=
"memitem">
339 <div class=
"memproto">
340 <table class=
"memname">
342 <td class=
"memname">void QOpenCamWidget::startSnap
</td>
344 <td class=
"paramtype">void
</td>
345 <td class=
"paramname"> </td>
346 <td> )
</td>
347 <td><code> [slot]
</code></td>
354 Trigger this slot to save a frame from the widget.
356 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.
<p>
357 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.
<p>
358 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.
359 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00306">306</a> of file
<a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a>.
</p>
361 <p>References
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00036">frametimer
</a>,
<a class=
"el" href=
"classQOpenCamWidget.html#d410be92ce25ff591726ba255070d09e">imageReady()
</a>, and
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00037">nextFrame
</a>.
</p>
363 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00110">setSnapshotVisible()
</a>.
</p>
367 <a class=
"anchor" name=
"d410be92ce25ff591726ba255070d09e"></a><!-- doxytag: member="QOpenCamWidget::imageReady" ref="d410be92ce25ff591726ba255070d09e" args="(QImage snapshot)" -->
368 <div class=
"memitem">
369 <div class=
"memproto">
370 <table class=
"memname">
372 <td class=
"memname">void QOpenCamWidget::imageReady
</td>
374 <td class=
"paramtype">QImage
</td>
375 <td class=
"paramname"> <em>snapshot
</em> </td>
376 <td> )
</td>
377 <td><code> [signal]
</code></td>
385 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00306">startSnap()
</a>.
</p>
389 <hr><h2>Member Data Documentation
</h2>
390 <a class=
"anchor" name=
"fde0c9d47e2ea44f2aeea499fd570368"></a><!-- doxytag: member="QOpenCamWidget::capture" ref="fde0c9d47e2ea44f2aeea499fd570368" args="" -->
391 <div class=
"memitem">
392 <div class=
"memproto">
393 <table class=
"memname">
395 <td class=
"memname">CvCapture*
<a class=
"el" href=
"classQOpenCamWidget.html#fde0c9d47e2ea44f2aeea499fd570368">QOpenCamWidget::capture
</a><code> [private]
</code> </td>
403 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00035">35</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
405 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00183">grabCapture()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00266">grabFrame()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00088">~QOpenCamWidget()
</a>.
</p>
409 <a class=
"anchor" name=
"2e70551b39fd2bd15fc99ca4fa12107f"></a><!-- doxytag: member="QOpenCamWidget::frametimer" ref="2e70551b39fd2bd15fc99ca4fa12107f" args="" -->
410 <div class=
"memitem">
411 <div class=
"memproto">
412 <table class=
"memname">
414 <td class=
"memname">QTimer*
<a class=
"el" href=
"classQOpenCamWidget.html#2e70551b39fd2bd15fc99ca4fa12107f">QOpenCamWidget::frametimer
</a><code> [private]
</code> </td>
422 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00036">36</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
424 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00217">startCapture()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00306">startSnap()
</a>.
</p>
428 <a class=
"anchor" name=
"92dab283a477c1b8a6d6d5470d5ef94d"></a><!-- doxytag: member="QOpenCamWidget::nextFrame" ref="92dab283a477c1b8a6d6d5470d5ef94d" args="" -->
429 <div class=
"memitem">
430 <div class=
"memproto">
431 <table class=
"memname">
433 <td class=
"memname">QImage*
<a class=
"el" href=
"classQOpenCamWidget.html#92dab283a477c1b8a6d6d5470d5ef94d">QOpenCamWidget::nextFrame
</a><code> [private]
</code> </td>
441 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00037">37</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
443 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00266">grabFrame()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00144">paintEvent()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00306">startSnap()
</a>.
</p>
447 <a class=
"anchor" name=
"7ac719f26d5f4a0a80ac6e4ffd4fe46d"></a><!-- doxytag: member="QOpenCamWidget::canvas" ref="7ac719f26d5f4a0a80ac6e4ffd4fe46d" args="" -->
448 <div class=
"memitem">
449 <div class=
"memproto">
450 <table class=
"memname">
452 <td class=
"memname">QLabel*
<a class=
"el" href=
"classQOpenCamWidget.html#7ac719f26d5f4a0a80ac6e4ffd4fe46d">QOpenCamWidget::canvas
</a><code> [private]
</code> </td>
460 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00039">39</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
462 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00183">grabCapture()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00144">paintEvent()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00088">~QOpenCamWidget()
</a>.
</p>
466 <a class=
"anchor" name=
"e91d147fdd20819b56ebd7861d7ab44e"></a><!-- doxytag: member="QOpenCamWidget::layout" ref="e91d147fdd20819b56ebd7861d7ab44e" args="" -->
467 <div class=
"memitem">
468 <div class=
"memproto">
469 <table class=
"memname">
471 <td class=
"memname">QVBoxLayout*
<a class=
"el" href=
"classQOpenCamWidget.html#e91d147fdd20819b56ebd7861d7ab44e">QOpenCamWidget::layout
</a><code> [private]
</code> </td>
479 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00040">40</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
481 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00110">setSnapshotVisible()
</a>.
</p>
485 <a class=
"anchor" name=
"a0aaf9bfc43d01979a7af03741620624"></a><!-- doxytag: member="QOpenCamWidget::trigger" ref="a0aaf9bfc43d01979a7af03741620624" args="" -->
486 <div class=
"memitem">
487 <div class=
"memproto">
488 <table class=
"memname">
490 <td class=
"memname">QPushButton*
<a class=
"el" href=
"classQOpenCamWidget.html#a0aaf9bfc43d01979a7af03741620624">QOpenCamWidget::trigger
</a><code> [private]
</code> </td>
498 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00041">41</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
500 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00110">setSnapshotVisible()
</a>,
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00217">startCapture()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00088">~QOpenCamWidget()
</a>.
</p>
504 <a class=
"anchor" name=
"1718e4971977520cfe642daa78e1997e"></a><!-- doxytag: member="QOpenCamWidget::trigger_active" ref="1718e4971977520cfe642daa78e1997e" args="" -->
505 <div class=
"memitem">
506 <div class=
"memproto">
507 <table class=
"memname">
509 <td class=
"memname">bool
<a class=
"el" href=
"classQOpenCamWidget.html#1718e4971977520cfe642daa78e1997e">QOpenCamWidget::trigger_active
</a><code> [private]
</code> </td>
517 <p>Definition at line
<a class=
"el" href=
"qopencamwidget_8h-source.html#l00042">42</a> of file
<a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a>.
</p>
519 <p>Referenced by
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00060">QOpenCamWidget()
</a>, and
<a class=
"el" href=
"qopencamwidget_8cpp-source.html#l00110">setSnapshotVisible()
</a>.
</p>
523 <hr>The documentation for this class was generated from the following files:
<ul>
524 <li><a class=
"el" href=
"qopencamwidget_8h-source.html">qopencamwidget.h
</a><li><a class=
"el" href=
"qopencamwidget_8cpp-source.html">qopencamwidget.cpp
</a></ul>
526 <hr size=
"1"><address style=
"text-align: right;"><small>Generated on Thu Jun
11 01:
49:
57 2009 for QOpenCamWidget by
527 <a href=
"http://www.doxygen.org/index.html">
528 <img src=
"doxygen.png" alt=
"doxygen" align=
"middle" border=
"0"></a> 1.5.6 </small></address>