1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | // created: 2014/07/17
|
---|
6 | // filename: V4LCamera.cpp
|
---|
7 | //
|
---|
8 | // author: Guillaume Sanahuja
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: base class for V4l camera
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "V4LCamera.h"
|
---|
19 | #include "V4LCamera_impl.h"
|
---|
20 | #include <Image.h>
|
---|
21 | #include <FrameworkManager.h>
|
---|
22 |
|
---|
23 | using std::string;
|
---|
24 | using namespace flair::core;
|
---|
25 |
|
---|
26 | namespace flair {
|
---|
27 | namespace sensor {
|
---|
28 |
|
---|
29 | V4LCamera::V4LCamera(string name,uint8_t camera_index, uint16_t width, uint16_t height,
|
---|
30 | Image::Type::Format format, uint8_t priority)
|
---|
31 | : Thread(getFrameworkManager(), name, priority),
|
---|
32 | Camera(name, width, height, format) {
|
---|
33 |
|
---|
34 | pimpl_=new V4LCamera_impl(this,name,camera_index,width,height,format);
|
---|
35 | }
|
---|
36 |
|
---|
37 | V4LCamera::~V4LCamera() {
|
---|
38 | SafeStop();
|
---|
39 | Join();
|
---|
40 | delete pimpl_;
|
---|
41 | }
|
---|
42 |
|
---|
43 | void V4LCamera::Run(void) {
|
---|
44 | pimpl_->Run();
|
---|
45 | }
|
---|
46 |
|
---|
47 | bool V4LCamera::HasProblems(void) {
|
---|
48 | return pimpl_->hasProblems;
|
---|
49 | }
|
---|
50 |
|
---|
51 | void V4LCamera::SetAutoGain(bool value) {
|
---|
52 | pimpl_->SetAutoGain(value);
|
---|
53 | }
|
---|
54 |
|
---|
55 | void V4LCamera::SetAutoExposure(bool value) {
|
---|
56 | Thread::Warn("not implemented\n");
|
---|
57 | }
|
---|
58 |
|
---|
59 | void V4LCamera::SetGain(float value) {
|
---|
60 | pimpl_->SetGain(value);
|
---|
61 | }
|
---|
62 |
|
---|
63 | void V4LCamera::SetExposure(float value) {
|
---|
64 | pimpl_->SetExposure(value);
|
---|
65 | }
|
---|
66 |
|
---|
67 | void V4LCamera::SetBrightness(float value) {
|
---|
68 | pimpl_->SetBrightness(value);
|
---|
69 | }
|
---|
70 |
|
---|
71 | void V4LCamera::SetSaturation(float value) {
|
---|
72 | pimpl_->SetSaturation(value);
|
---|
73 | }
|
---|
74 |
|
---|
75 | void V4LCamera::SetHue(float value) {
|
---|
76 | pimpl_->SetHue(value);
|
---|
77 | }
|
---|
78 |
|
---|
79 | void V4LCamera::SetContrast(float value) {
|
---|
80 | pimpl_->SetContrast(value);
|
---|
81 | }
|
---|
82 |
|
---|
83 | } // end namespace sensor
|
---|
84 | } // end namespace flair
|
---|