]> git.defcon.no Git - qopencamwidget/blob - doc/html/classQOpenCamWidget.html
a9aecff681b7879c5c596479e0a291a715d21750
[qopencamwidget] / doc / html / classQOpenCamWidget.html
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">
6 </head><body>
7 <!-- Generated by Doxygen 1.5.6 -->
8 <div class="navigation" id="top">
9 <div class="tabs">
10 <ul>
11 <li><a href="main.html"><span>Main&nbsp;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>
14 </ul>
15 </div>
16 <div class="tabs">
17 <ul>
18 <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
19 <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
20 </ul>
21 </div>
22 </div>
23 <div class="contents">
24 <h1>QOpenCamWidget Class Reference</h1><!-- doxytag: class="QOpenCamWidget" --><code>#include &lt;<a class="el" href="qopencamwidget_8h-source.html">qopencamwidget.h</a>&gt;</code>
25 <p>
26
27 <p>
28 <a href="classQOpenCamWidget-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
29 <tr><td></td></tr>
30 <tr><td colspan="2"><br><h2>Public Slots</h2></td></tr>
31 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#27c30cec9a8d44c1802e4218bea7bdb4">grabFrame</a> (void)</td></tr>
32
33 <tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#82540c90d3efa85631f13af3a60fa94b">startSnap</a> ()</td></tr>
35
36 <tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#d410be92ce25ff591726ba255070d09e">imageReady</a> (QImage snapshot)</td></tr>
39
40 <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
41 <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#5835e06a54f1b09b4fd157d88dc72b6e">QOpenCamWidget</a> (QWidget *parent=0)</td></tr>
42
43 <tr><td class="mdescLeft">&nbsp;</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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#b0ad4890d7d638354289e074a6f71a3f">~QOpenCamWidget</a> (void)</td></tr>
45
46 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#c6186d1e510b5c8635b2d3bf5d94def6">paintEvent</a> (QPaintEvent *event)</td></tr>
47
48 <tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#8f885a8bb88870cd19cfc9eb4e02e2ce">setSnapshotVisible</a> (bool visible)</td></tr>
50
51 <tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#23574314cbd7a74bc6f32a640041d55a">grabCapture</a> (int source)</td></tr>
53
54 <tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880">startCapture</a> (void)</td></tr>
56
57 <tr><td class="mdescLeft">&nbsp;</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 *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#aba8721f46b41d76326e048e3c876f1d">Ipl2QImage</a> (const IplImage *img)</td></tr>
59
60 <tr><td class="mdescLeft">&nbsp;</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 *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#fde0c9d47e2ea44f2aeea499fd570368">capture</a></td></tr>
63
64 <tr><td class="memItemLeft" nowrap align="right" valign="top">QTimer *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#2e70551b39fd2bd15fc99ca4fa12107f">frametimer</a></td></tr>
65
66 <tr><td class="memItemLeft" nowrap align="right" valign="top">QImage *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#92dab283a477c1b8a6d6d5470d5ef94d">nextFrame</a></td></tr>
67
68 <tr><td class="memItemLeft" nowrap align="right" valign="top">QLabel *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#7ac719f26d5f4a0a80ac6e4ffd4fe46d">canvas</a></td></tr>
69
70 <tr><td class="memItemLeft" nowrap align="right" valign="top">QVBoxLayout *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#e91d147fdd20819b56ebd7861d7ab44e">layout</a></td></tr>
71
72 <tr><td class="memItemLeft" nowrap align="right" valign="top">QPushButton *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#a0aaf9bfc43d01979a7af03741620624">trigger</a></td></tr>
73
74 <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQOpenCamWidget.html#1718e4971977520cfe642daa78e1997e">trigger_active</a></td></tr>
75
76 </table>
77 <hr><a name="_details"></a><h2>Detailed Description</h2>
78
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 &amp; Destructor Documentation</h2>
81 <a class="anchor" name="5835e06a54f1b09b4fd157d88dc72b6e"></a><!-- doxytag: member="QOpenCamWidget::QOpenCamWidget" ref="5835e06a54f1b09b4fd157d88dc72b6e" args="(QWidget *parent=0)" -->
82 <div class="memitem">
83 <div class="memproto">
84 <table class="memname">
85 <tr>
86 <td class="memname">QOpenCamWidget::QOpenCamWidget </td>
87 <td>(</td>
88 <td class="paramtype">QWidget *&nbsp;</td>
89 <td class="paramname"> <em>parent</em> = <code>0</code> </td>
90 <td>&nbsp;)&nbsp;</td>
91 <td></td>
92 </tr>
93 </table>
94 </div>
95 <div class="memdoc">
96
97 <p>
98 Consctructs a QWidget based widget for displaying video coming from an OpenCV capture source.
99 <p>
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-&gt;<a class="code" href="classQOpenCamWidget.html#23574314cbd7a74bc6f32a640041d55a" title="Grabs an OpenCV video capture source.">grabCapture</a>(-1) ) {
105 cw-&gt;<a class="code" href="classQOpenCamWidget.html#8f885a8bb88870cd19cfc9eb4e02e2ce" title="Changes the visibility of the optional built-in &amp;quot;Take snapshot&amp;quot; button...">setSnapshotVisible</a>(<span class="keyword">true</span>);
106 cw-&gt;<a class="code" href="classQOpenCamWidget.html#b378daa447e8d9b94e1c7c8c6853b880" title="Starts up grabbing of video frames.">startCapture</a>();
107 }
108 connect( cw, SIGNAL(<a class="code" href="classQOpenCamWidget.html#d410be92ce25ff591726ba255070d09e">imageReady</a>(QImage)), <span class="keyword">this</span>, SLOT(saveImage(QImage)));
109 </pre></div><p>
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>&nbsp;</td><td>The parent widget containing this widget, defaults to NULL. </td></tr>
113 </table>
114 </dl>
115
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>
117
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>
119
120 </div>
121 </div><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">
126 <tr>
127 <td class="memname">QOpenCamWidget::~QOpenCamWidget </td>
128 <td>(</td>
129 <td class="paramtype">void&nbsp;</td>
130 <td class="paramname"> </td>
131 <td>&nbsp;)&nbsp;</td>
132 <td></td>
133 </tr>
134 </table>
135 </div>
136 <div class="memdoc">
137
138 <p>
139
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>
141
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>
143
144 </div>
145 </div><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">
151 <tr>
152 <td class="memname">void QOpenCamWidget::paintEvent </td>
153 <td>(</td>
154 <td class="paramtype">QPaintEvent *&nbsp;</td>
155 <td class="paramname"> <em>event</em> </td>
156 <td>&nbsp;)&nbsp;</td>
157 <td></td>
158 </tr>
159 </table>
160 </div>
161 <div class="memdoc">
162
163 <p>
164 A paint event is a request to repaint all or part of a widget.
165 <p>
166 It can happen for one of the following reasons:<p>
167 <ul>
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>
171 </ul>
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>
174
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>
176
177 </div>
178 </div><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">
183 <tr>
184 <td class="memname">void QOpenCamWidget::setSnapshotVisible </td>
185 <td>(</td>
186 <td class="paramtype">bool&nbsp;</td>
187 <td class="paramname"> <em>visible</em> </td>
188 <td>&nbsp;)&nbsp;</td>
189 <td></td>
190 </tr>
191 </table>
192 </div>
193 <div class="memdoc">
194
195 <p>
196 Changes the visibility of the optional built-in "Take snapshot" button.
197 <p>
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>&nbsp;</td><td>True makes the button display, and trigger, false turns the feature off. False, i.e. no button, is default. </td></tr>
202 </table>
203 </dl>
204
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>
206
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>
208
209 <p>Referenced by <a class="el" href="view_8cpp-source.html#l00032">View::View()</a>.</p>
210
211 </div>
212 </div><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">
217 <tr>
218 <td class="memname">bool QOpenCamWidget::grabCapture </td>
219 <td>(</td>
220 <td class="paramtype">int&nbsp;</td>
221 <td class="paramname"> <em>source</em> </td>
222 <td>&nbsp;)&nbsp;</td>
223 <td></td>
224 </tr>
225 </table>
226 </div>
227 <div class="memdoc">
228
229 <p>
230 Grabs an OpenCV video capture source.
231 <p>
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>&nbsp;</td><td>The OpenCV capture source enumeration index to open </td></tr>
236 </table>
237 </dl>
238
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>
240
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>
242
243 <p>Referenced by <a class="el" href="view_8cpp-source.html#l00032">View::View()</a>.</p>
244
245 </div>
246 </div><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">
251 <tr>
252 <td class="memname">void QOpenCamWidget::startCapture </td>
253 <td>(</td>
254 <td class="paramtype">void&nbsp;</td>
255 <td class="paramname"> </td>
256 <td>&nbsp;)&nbsp;</td>
257 <td></td>
258 </tr>
259 </table>
260 </div>
261 <div class="memdoc">
262
263 <p>
264 Starts up grabbing of video frames.
265 <p>
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>
269
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>
271
272 <p>Referenced by <a class="el" href="view_8cpp-source.html#l00032">View::View()</a>.</p>
273
274 </div>
275 </div><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">
280 <tr>
281 <td class="memname">QImage * QOpenCamWidget::Ipl2QImage </td>
282 <td>(</td>
283 <td class="paramtype">const IplImage *&nbsp;</td>
284 <td class="paramname"> <em>img</em> </td>
285 <td>&nbsp;)&nbsp;</td>
286 <td></td>
287 </tr>
288 </table>
289 </div>
290 <div class="memdoc">
291
292 <p>
293 Converts from the OpenCV IplImage data structure to a QImage.
294 <p>
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-&gt;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>&nbsp;</td><td>The IplImage to be converted to a QImage. </td></tr>
300 </table>
301 </dl>
302
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>
304
305 <p>Referenced by <a class="el" href="qopencamwidget_8cpp-source.html#l00266">grabFrame()</a>.</p>
306
307 </div>
308 </div><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">
313 <tr>
314 <td class="memname">void QOpenCamWidget::grabFrame </td>
315 <td>(</td>
316 <td class="paramtype">void&nbsp;</td>
317 <td class="paramname"> </td>
318 <td>&nbsp;)&nbsp;</td>
319 <td><code> [slot]</code></td>
320 </tr>
321 </table>
322 </div>
323 <div class="memdoc">
324
325 <p>
326 Grabs a frame and causes an update() when triggered.
327 <p>
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>
330
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>
332
333 <p>Referenced by <a class="el" href="qopencamwidget_8cpp-source.html#l00217">startCapture()</a>.</p>
334
335 </div>
336 </div><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">
341 <tr>
342 <td class="memname">void QOpenCamWidget::startSnap </td>
343 <td>(</td>
344 <td class="paramtype">void&nbsp;</td>
345 <td class="paramname"> </td>
346 <td>&nbsp;)&nbsp;</td>
347 <td><code> [slot]</code></td>
348 </tr>
349 </table>
350 </div>
351 <div class="memdoc">
352
353 <p>
354 Trigger this slot to save a frame from the widget.
355 <p>
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>
360
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>
362
363 <p>Referenced by <a class="el" href="qopencamwidget_8cpp-source.html#l00110">setSnapshotVisible()</a>.</p>
364
365 </div>
366 </div><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">
371 <tr>
372 <td class="memname">void QOpenCamWidget::imageReady </td>
373 <td>(</td>
374 <td class="paramtype">QImage&nbsp;</td>
375 <td class="paramname"> <em>snapshot</em> </td>
376 <td>&nbsp;)&nbsp;</td>
377 <td><code> [signal]</code></td>
378 </tr>
379 </table>
380 </div>
381 <div class="memdoc">
382
383 <p>
384
385 <p>Referenced by <a class="el" href="qopencamwidget_8cpp-source.html#l00306">startSnap()</a>.</p>
386
387 </div>
388 </div><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">
394 <tr>
395 <td class="memname">CvCapture* <a class="el" href="classQOpenCamWidget.html#fde0c9d47e2ea44f2aeea499fd570368">QOpenCamWidget::capture</a><code> [private]</code> </td>
396 </tr>
397 </table>
398 </div>
399 <div class="memdoc">
400
401 <p>
402
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>
404
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>
406
407 </div>
408 </div><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">
413 <tr>
414 <td class="memname">QTimer* <a class="el" href="classQOpenCamWidget.html#2e70551b39fd2bd15fc99ca4fa12107f">QOpenCamWidget::frametimer</a><code> [private]</code> </td>
415 </tr>
416 </table>
417 </div>
418 <div class="memdoc">
419
420 <p>
421
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>
423
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>
425
426 </div>
427 </div><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">
432 <tr>
433 <td class="memname">QImage* <a class="el" href="classQOpenCamWidget.html#92dab283a477c1b8a6d6d5470d5ef94d">QOpenCamWidget::nextFrame</a><code> [private]</code> </td>
434 </tr>
435 </table>
436 </div>
437 <div class="memdoc">
438
439 <p>
440
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>
442
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>
444
445 </div>
446 </div><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">
451 <tr>
452 <td class="memname">QLabel* <a class="el" href="classQOpenCamWidget.html#7ac719f26d5f4a0a80ac6e4ffd4fe46d">QOpenCamWidget::canvas</a><code> [private]</code> </td>
453 </tr>
454 </table>
455 </div>
456 <div class="memdoc">
457
458 <p>
459
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>
461
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>
463
464 </div>
465 </div><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">
470 <tr>
471 <td class="memname">QVBoxLayout* <a class="el" href="classQOpenCamWidget.html#e91d147fdd20819b56ebd7861d7ab44e">QOpenCamWidget::layout</a><code> [private]</code> </td>
472 </tr>
473 </table>
474 </div>
475 <div class="memdoc">
476
477 <p>
478
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>
480
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>
482
483 </div>
484 </div><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">
489 <tr>
490 <td class="memname">QPushButton* <a class="el" href="classQOpenCamWidget.html#a0aaf9bfc43d01979a7af03741620624">QOpenCamWidget::trigger</a><code> [private]</code> </td>
491 </tr>
492 </table>
493 </div>
494 <div class="memdoc">
495
496 <p>
497
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>
499
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>
501
502 </div>
503 </div><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">
508 <tr>
509 <td class="memname">bool <a class="el" href="classQOpenCamWidget.html#1718e4971977520cfe642daa78e1997e">QOpenCamWidget::trigger_active</a><code> [private]</code> </td>
510 </tr>
511 </table>
512 </div>
513 <div class="memdoc">
514
515 <p>
516
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>
518
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>
520
521 </div>
522 </div><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>
525 </div>
526 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jun 11 01:49:57 2009 for QOpenCamWidget by&nbsp;
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>
529 </body>
530 </html>