Fawkes API  Fawkes Development Version
dummy.cpp
1 
2 /***************************************************************************
3  * dummy.cpp - controller that controls nothing, sounds like a stupid
4  * idea but this avoids NULL checks in software using
5  * a camera controller
6  *
7  * Created: Tue May 12 19:07:59 2009
8  * Copyright 2005-2009 Tim Niemueller [www.niemueller.de]
9  *
10  ****************************************************************************/
11 
12 /* This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version. A runtime exception applies to
16  * this software (see LICENSE.GPL_WRE file mentioned below for details).
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Library General Public License for more details.
22  *
23  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
24  */
25 
26 #include <fvcams/control/dummy.h>
27 
28 namespace firevision {
29 
30 /** @class DummyCameraControl <fvcams/control/dummy.h>
31  * Dummy camera control.
32  * This control supports every control type, but the operations are NOOPs.
33  * This is useful to instantiate the dummy control to avoid NULL checks.
34  * @author Tim Niemueller
35  */
36 
37 bool
39 {
40  return true;
41 }
42 
43 void
45 {
46 }
47 
48 bool
50 {
51  return true;
52 }
53 
54 void
56 {
57 }
58 
59 unsigned int
61 {
62  return 0;
63 }
64 
65 void
66 DummyCameraControl::set_exposure_auto(unsigned int exposure_auto)
67 {
68 }
69 
70 int
72 {
73  return 0;
74 }
75 
76 void
78 {
79 }
80 
81 int
83 {
84  return 0;
85 }
86 
87 void
89 {
90 }
91 
92 int
94 {
95  return 0;
96 }
97 
98 void
100 {
101 }
102 
103 int
105 {
106  return 0;
107 }
108 
109 void
111 {
112 }
113 
114 unsigned int
116 {
117  return 0;
118 }
119 
120 void
121 DummyCameraControl::set_brightness(unsigned int brightness)
122 {
123 }
124 
125 unsigned int
127 {
128  return 0;
129 }
130 
131 void
132 DummyCameraControl::set_contrast(unsigned int contrast)
133 {
134 }
135 
136 unsigned int
138 {
139  return 0;
140 }
141 
142 void
143 DummyCameraControl::set_saturation(unsigned int saturation)
144 {
145 }
146 
147 int
149 {
150  return 0;
151 }
152 
153 void
155 {
156 }
157 
158 unsigned int
160 {
161  return 0;
162 }
163 
164 void
165 DummyCameraControl::set_exposure(unsigned int exposure)
166 {
167 }
168 
169 unsigned int
171 {
172  return 0;
173 }
174 
175 void
177 {
178 }
179 
180 // From CameraControlImage
181 const char *
183 {
184  return "";
185 }
186 
187 void
189 {
190 }
191 
192 unsigned int
194 {
195  return 0;
196 }
197 
198 unsigned int
200 {
201  return 0;
202 }
203 
204 void
205 DummyCameraControl::size(unsigned int &width, unsigned int &height)
206 {
207  width = height = 0;
208 }
209 
210 void
211 DummyCameraControl::set_size(unsigned int width, unsigned int height)
212 {
213 }
214 
215 bool
217 {
218  return false;
219 }
220 
221 bool
223 {
224  return false;
225 }
226 
227 void
228 DummyCameraControl::mirror(bool &horiz, bool &vert)
229 {
230  horiz = vert = false;
231 }
232 
233 void
235 {
236 }
237 
238 void
240 {
241 }
242 
243 void
244 DummyCameraControl::set_mirror(bool horiz, bool vert)
245 {
246 }
247 
248 unsigned int
250 {
251  return 0;
252 }
253 
254 void
256 {
257 }
258 
259 unsigned int
261 {
262  return 0;
263 }
264 
265 unsigned int
267 {
268  return 0;
269 }
270 
271 void
272 DummyCameraControl::lens_corr(unsigned int &x_corr, unsigned int &y_corr)
273 {
274  x_corr = y_corr = 0;
275 }
276 
277 void
279 {
280 }
281 
282 void
284 {
285 }
286 
287 void
288 DummyCameraControl::set_lens_corr(unsigned int x_corr, unsigned int y_corr)
289 {
290 }
291 
292 void
294 {
295 }
296 
297 bool
299 {
300  return false;
301 }
302 
303 bool
305 {
306  return false;
307 }
308 
309 void
311 {
312 }
313 
314 void
316 {
317 }
318 
319 void
321 {
322 }
323 
324 void
326 {
327 }
328 
329 int
331 {
332  return 0;
333 }
334 
335 int
337 {
338  return 0;
339 }
340 
341 void
343 {
344 }
345 
346 void
347 DummyCameraControl::pan_tilt(int &pan, int &tilt)
348 {
349  pan = tilt = 0;
350 }
351 
352 void
353 DummyCameraControl::pan_tilt_rad(float &pan, float &tilt)
354 {
355  pan = tilt = 0.f;
356 }
357 
358 int
360 {
361  return 0;
362 }
363 
364 int
366 {
367  return 0;
368 }
369 
370 int
372 {
373  return 0;
374 }
375 
376 int
378 {
379  return 0;
380 }
381 
382 void
384 {
385 }
386 
387 void
388 DummyCameraControl::set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down)
389 {
390 }
391 
392 void
394 {
395 }
396 
397 void
399 {
400 }
401 
402 void
404 {
405 }
406 
407 unsigned int
409 {
410  return 0;
411 }
412 
413 unsigned int
415 {
416  return 0;
417 }
418 
419 unsigned int
421 {
422  return 0;
423 }
424 
425 void
427 {
428 }
429 
430 void
432 {
433 }
434 
435 void
437 {
438 }
439 
440 bool
442 {
443  return false;
444 }
445 
446 void
447 DummyCameraControl::set_effect(unsigned int effect)
448 {
449 }
450 
451 unsigned int
453 {
454  return EFFECT_NONE;
455 }
456 
457 void
459 {
460 }
461 
462 bool
464 {
465  return true;
466 }
467 
468 void
470 {
471 }
472 
473 unsigned int
475 {
476  return 0;
477 }
478 
479 void
480 DummyCameraControl::set_focus(unsigned int focus)
481 {
482 }
483 
484 unsigned int
486 {
487  return 0;
488 }
489 
490 unsigned int
492 {
493  return 0;
494 }
495 
496 } // end namespace firevision
virtual void reset_effect()
Reset effect.
Definition: dummy.cpp:458
virtual bool supports_tilt()
Check whether this controller supports tilting.
Definition: dummy.cpp:304
virtual void set_format(const char *format)
Set the image format the camera should use.
Definition: dummy.cpp:188
virtual unsigned int contrast()
Get current contrast.
Definition: dummy.cpp:126
virtual unsigned int width()
Get the current width of the image.
Definition: dummy.cpp:193
virtual unsigned int exposure_auto()
Return whether auto exposure is enabled.
Definition: dummy.cpp:60
virtual unsigned int effect()
Current effect.
Definition: dummy.cpp:452
virtual void set_zoom_speed_wide(unsigned int speed)
Set speed in wide range.
Definition: dummy.cpp:431
virtual void set_lens_y_corr(unsigned int y_corr)
Set lens y correction.
Definition: dummy.cpp:283
virtual void set_tilt(int tilt)
Set tilt value.
Definition: dummy.cpp:315
virtual void set_red_balance(int red_balance)
Set red balance.
Definition: dummy.cpp:77
virtual void lens_corr(unsigned int &x_corr, unsigned int &y_corr)
Get current lens correction.
Definition: dummy.cpp:272
virtual void set_auto_gain(bool enabled)
Enable/disable auto gain.
Definition: dummy.cpp:44
virtual int v_balance()
Get current v balance.
Definition: dummy.cpp:104
virtual void set_exposure_auto(unsigned int enabled)
Enable/disable auto exposure.
Definition: dummy.cpp:66
virtual void set_saturation(unsigned int saturation)
Set new saturation.
Definition: dummy.cpp:143
virtual void set_mirror(bool horiz, bool vert)
Set whether the camera should mirror images.
Definition: dummy.cpp:244
virtual void set_size(unsigned int width, unsigned int height)
Set the image size the camera should use.
Definition: dummy.cpp:211
virtual void set_blue_balance(int blue_balance)
Set blue balance.
Definition: dummy.cpp:88
virtual int red_balance()
Get current red balance.
Definition: dummy.cpp:71
virtual int min_tilt()
Get minimum tilt value.
Definition: dummy.cpp:371
virtual bool auto_gain()
Return whether auto gain is enabled.
Definition: dummy.cpp:38
virtual bool supports_effect(unsigned int effect)
Check if camera control supports desired effect.
Definition: dummy.cpp:441
virtual void reset_pan_tilt()
Bring camera into home position.
Definition: dummy.cpp:383
virtual unsigned int zoom_max()
Maximum zoom value.
Definition: dummy.cpp:414
virtual void set_fps(unsigned int fps)
Set the number of frames per second the camera tries to deliver.
Definition: dummy.cpp:255
virtual int tilt()
Get tilt value.
Definition: dummy.cpp:336
virtual int blue_balance()
Get current blue balance.
Definition: dummy.cpp:82
virtual void set_hue(int hue)
Set new hue.
Definition: dummy.cpp:154
virtual void set_zoom(unsigned int zoom)
Set new camera-specific zoom value.
Definition: dummy.cpp:403
virtual int min_pan()
Get minimum pan value.
Definition: dummy.cpp:359
virtual void set_pan(int pan)
Set pan value.
Definition: dummy.cpp:310
virtual void start_get_pan_tilt()
Start asynchronous fetch operation for pan and tilt values.
Definition: dummy.cpp:342
virtual unsigned int focus_min()
Get minimum focus value.
Definition: dummy.cpp:485
virtual const char * format()
Get the image format the camera currently uses.
Definition: dummy.cpp:182
virtual bool vert_mirror()
Return whether the camera image is vertically mirrored.
Definition: dummy.cpp:222
virtual void set_effect(unsigned int effect)
Enable effect.
Definition: dummy.cpp:447
virtual unsigned int lens_y_corr()
Get current lens y correction.
Definition: dummy.cpp:266
virtual unsigned int focus()
Get current focus value.
Definition: dummy.cpp:474
virtual int pan()
Get pan value.
Definition: dummy.cpp:330
virtual void reset_zoom()
Reset zoom.
Definition: dummy.cpp:398
virtual void pan_tilt(int &pan, int &tilt)
Get pan and tilt at the same time.
Definition: dummy.cpp:347
virtual unsigned int focus_max()
Get maximum focus value.
Definition: dummy.cpp:491
virtual void set_pan_tilt(int pan, int tilt)
Set pan and tilt in one go.
Definition: dummy.cpp:320
virtual bool auto_white_balance()
Return whether auto white balance is enabled.
Definition: dummy.cpp:49
virtual void set_horiz_mirror(bool enabled)
Set whether the camera should mirror images horizontally.
Definition: dummy.cpp:234
virtual void set_pan_tilt_rad(float pan, float tilt)
Set pan and tilt as float value.
Definition: dummy.cpp:325
virtual unsigned int gain()
Get current gain.
Definition: dummy.cpp:170
virtual void process_pantilt()
Process pan/tilt information.
Definition: dummy.cpp:293
virtual int hue()
Get current hue.
Definition: dummy.cpp:148
virtual unsigned int zoom_min()
Minimum zoom value.
Definition: dummy.cpp:420
virtual void set_lens_corr(unsigned int x_corr, unsigned int y_corr)
Set lens correction.
Definition: dummy.cpp:288
virtual void set_brightness(unsigned int brightness)
Set new brightness.
Definition: dummy.cpp:121
virtual unsigned int saturation()
Get current saturation.
Definition: dummy.cpp:137
virtual void set_auto_focus(bool enabled)
Enable or disable auto focus.
Definition: dummy.cpp:469
virtual bool auto_focus()
Check if auto focus is enabled.
Definition: dummy.cpp:463
virtual int u_balance()
Get current u balance.
Definition: dummy.cpp:93
virtual void set_vert_mirror(bool enabled)
Set whether the camera should mirror images vertically.
Definition: dummy.cpp:239
virtual int max_pan()
Get maximum pan value.
Definition: dummy.cpp:365
virtual unsigned int height()
Get the current height of the image.
Definition: dummy.cpp:199
virtual void set_exposure(unsigned int exposure)
Set new exposure.
Definition: dummy.cpp:165
virtual void set_gain(unsigned int gain)
Set new gain.
Definition: dummy.cpp:176
virtual bool supports_pan()
Check whether this controller supports panning.
Definition: dummy.cpp:298
static const unsigned int EFFECT_NONE
No effect constant.
Definition: effect.h:35
virtual void reset_pan_tilt_limit()
Reset pan/tilt limits.
Definition: dummy.cpp:393
virtual void set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down)
Set pan/tilt limits.
Definition: dummy.cpp:388
virtual void set_u_balance(int u_balance)
Set u balance.
Definition: dummy.cpp:99
virtual void set_auto_white_balance(bool enabled)
Enable/disable auto white balance.
Definition: dummy.cpp:55
virtual void set_zoom_digital_enabled(bool enabled)
Set if digital zoom may be used.
Definition: dummy.cpp:436
virtual int max_tilt()
Get maximum tilt value.
Definition: dummy.cpp:377
virtual void set_zoom_speed_tele(unsigned int speed)
Set speed in tele range.
Definition: dummy.cpp:426
virtual void set_v_balance(int v_balance)
Set v balance.
Definition: dummy.cpp:110
virtual unsigned int exposure()
Get current exposure.
Definition: dummy.cpp:159
virtual void pan_tilt_rad(float &pan, float &tilt)
Get pan and tilt at the same time in radiant.
Definition: dummy.cpp:353
virtual void set_focus(unsigned int focus)
Set new focus value.
Definition: dummy.cpp:480
virtual bool horiz_mirror()
Return whether the camera image is horizontally mirrored.
Definition: dummy.cpp:216
virtual void size(unsigned int &width, unsigned int &height)
Get the current image size.
Definition: dummy.cpp:205
virtual unsigned int zoom()
Get current zoom value.
Definition: dummy.cpp:408
virtual void mirror(bool &horiz, bool &vert)
Get information about current camera image mirroring.
Definition: dummy.cpp:228
virtual unsigned int fps()
Get the number of frames per second the camera tries to deliver.
Definition: dummy.cpp:249
virtual void set_lens_x_corr(unsigned int x_corr)
Set lens x correction.
Definition: dummy.cpp:278
virtual unsigned int lens_x_corr()
Get current lens x correction.
Definition: dummy.cpp:260
virtual void set_contrast(unsigned int contrast)
Set new contrast.
Definition: dummy.cpp:132
virtual unsigned int brightness()
Get current brightness.
Definition: dummy.cpp:115