source: flair-src/trunk/lib/FlairSensorActuator/src/V4LCamera.cpp@ 448

Last change on this file since 448 was 403, checked in by Sanahuja Guillaume, 3 years ago

select user memory pointer (v4l) if using custom alloc function in images (ie if initdsp was called)

File size: 1.8 KB
RevLine 
[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]23using std::string;
24using namespace flair::core;
25
[15]26namespace flair {
27namespace sensor {
[340]28
[346]29V4LCamera::V4LCamera(string name,uint8_t camera_index, uint16_t width, uint16_t height,
[403]30 Image::Type::Format format, bool useMemoryUsrPtr,uint8_t priority)
[351]31 : Thread(getFrameworkManager(), name, priority),
[340]32 Camera(name, width, height, format) {
33
[403]34 pimpl_=new V4LCamera_impl(this,name,camera_index,width,height,format,useMemoryUsrPtr);
[340]35}
36
37V4LCamera::~V4LCamera() {
[346]38 SafeStop();
39 Join();
[352]40 delete pimpl_;
[340]41}
42
43void V4LCamera::Run(void) {
[352]44 pimpl_->Run();
[348]45}
[340]46
[165]47bool V4LCamera::HasProblems(void) {
[352]48 return pimpl_->hasProblems;
[165]49}
50
[15]51void V4LCamera::SetAutoGain(bool value) {
[352]52 pimpl_->SetAutoGain(value);
[3]53}
54
[15]55void V4LCamera::SetAutoExposure(bool value) {
[338]56 Thread::Warn("not implemented\n");
[3]57}
58
[15]59void V4LCamera::SetGain(float value) {
[352]60 pimpl_->SetGain(value);
[3]61}
62
[15]63void V4LCamera::SetExposure(float value) {
[352]64 pimpl_->SetExposure(value);
[3]65}
66
[15]67void V4LCamera::SetBrightness(float value) {
[352]68 pimpl_->SetBrightness(value);
[3]69}
70
[15]71void V4LCamera::SetSaturation(float value) {
[352]72 pimpl_->SetSaturation(value);
[3]73}
74
[15]75void V4LCamera::SetHue(float value) {
[352]76 pimpl_->SetHue(value);
[3]77}
78
[15]79void V4LCamera::SetContrast(float value) {
[352]80 pimpl_->SetContrast(value);
[3]81}
82
83} // end namespace sensor
84} // end namespace flair
Note: See TracBrowser for help on using the repository browser.