source: flair-src/branches/sanscv/lib/FlairSimulator/src/SimuCamera.cpp@ 412

Last change on this file since 412 was 324, checked in by Sanahuja Guillaume, 5 years ago

removing opencv dependency

File size: 1.3 KB
Line 
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/03/06
6// filename: SimuCamera.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class for a simulation camera
14//
15//
16/*********************************************************************/
17
18#include "SimuCamera.h"
19#include <SharedMem.h>
20#include <sstream>
21
22using std::string;
23using std::ostringstream;
24using namespace flair::core;
25
26namespace flair {
27namespace sensor {
28
29
30SimuCamera::SimuCamera(const IODevice *parent, string name, uint16_t width,
31 uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId)
32 : IODevice(parent,name) {
33
34 size_t buf_size = width * height * channels+sizeof(Time);
35
36 shmem = new SharedMem(this,ShMemName(modelId, deviceId),
37 buf_size, SharedMem::Type::producerConsumer);
38
39 SetIsReady(true);
40}
41
42SimuCamera::~SimuCamera() {
43 SetIsReady(false);
44 delete shmem;
45}
46
47string SimuCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
48 ostringstream dev_name;
49 dev_name << "simu" << modelId << "_cam_" << deviceId;
50 return dev_name.str().c_str();
51}
52
53
54
55} // end namespace sensor
56} // end namespace flair
Note: See TracBrowser for help on using the repository browser.