[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 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"
|
---|
[352] | 19 | #include "V4LCamera_impl.h"
|
---|
[338] | 20 | #include <Image.h>
|
---|
[3] | 21 | #include <FrameworkManager.h>
|
---|
[330] | 22 |
|
---|
[3] | 23 | using std::string;
|
---|
| 24 | using namespace flair::core;
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace sensor {
|
---|
[340] | 28 |
|
---|
[346] | 29 | V4LCamera::V4LCamera(string name,uint8_t camera_index, uint16_t width, uint16_t height,
|
---|
[340] | 30 | Image::Type::Format format, uint8_t priority)
|
---|
[351] | 31 | : Thread(getFrameworkManager(), name, priority),
|
---|
[340] | 32 | Camera(name, width, height, format) {
|
---|
| 33 |
|
---|
[352] | 34 | pimpl_=new V4LCamera_impl(this,name,camera_index,width,height,format);
|
---|
[340] | 35 | }
|
---|
| 36 |
|
---|
| 37 | V4LCamera::~V4LCamera() {
|
---|
[346] | 38 | SafeStop();
|
---|
| 39 | Join();
|
---|
[352] | 40 | delete pimpl_;
|
---|
[340] | 41 | }
|
---|
| 42 |
|
---|
| 43 | void V4LCamera::Run(void) {
|
---|
[352] | 44 | pimpl_->Run();
|
---|
[348] | 45 | }
|
---|
[340] | 46 |
|
---|
[165] | 47 | bool V4LCamera::HasProblems(void) {
|
---|
[352] | 48 | return pimpl_->hasProblems;
|
---|
[165] | 49 | }
|
---|
| 50 |
|
---|
[15] | 51 | void V4LCamera::SetAutoGain(bool value) {
|
---|
[352] | 52 | pimpl_->SetAutoGain(value);
|
---|
[3] | 53 | }
|
---|
| 54 |
|
---|
[15] | 55 | void V4LCamera::SetAutoExposure(bool value) {
|
---|
[338] | 56 | Thread::Warn("not implemented\n");
|
---|
[3] | 57 | }
|
---|
| 58 |
|
---|
[15] | 59 | void V4LCamera::SetGain(float value) {
|
---|
[352] | 60 | pimpl_->SetGain(value);
|
---|
[3] | 61 | }
|
---|
| 62 |
|
---|
[15] | 63 | void V4LCamera::SetExposure(float value) {
|
---|
[352] | 64 | pimpl_->SetExposure(value);
|
---|
[3] | 65 | }
|
---|
| 66 |
|
---|
[15] | 67 | void V4LCamera::SetBrightness(float value) {
|
---|
[352] | 68 | pimpl_->SetBrightness(value);
|
---|
[3] | 69 | }
|
---|
| 70 |
|
---|
[15] | 71 | void V4LCamera::SetSaturation(float value) {
|
---|
[352] | 72 | pimpl_->SetSaturation(value);
|
---|
[3] | 73 | }
|
---|
| 74 |
|
---|
[15] | 75 | void V4LCamera::SetHue(float value) {
|
---|
[352] | 76 | pimpl_->SetHue(value);
|
---|
[3] | 77 | }
|
---|
| 78 |
|
---|
[15] | 79 | void V4LCamera::SetContrast(float value) {
|
---|
[352] | 80 | pimpl_->SetContrast(value);
|
---|
[3] | 81 | }
|
---|
| 82 |
|
---|
| 83 | } // end namespace sensor
|
---|
| 84 | } // end namespace flair
|
---|