[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 | /*!
|
---|
[286] | 6 | * \file SimulatedCamera.h
|
---|
[3] | 7 | * \brief Class for a simulation camera
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2014/03/06
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
[286] | 13 | #ifndef SIMULATEDCAMERA_H
|
---|
| 14 | #define SIMULATEDCAMERA_H
|
---|
[3] | 15 |
|
---|
| 16 | #include <Camera.h>
|
---|
| 17 | #include <Thread.h>
|
---|
| 18 |
|
---|
[15] | 19 | namespace flair {
|
---|
[144] | 20 | namespace core {
|
---|
| 21 | class SharedMem;
|
---|
| 22 | }
|
---|
[3] | 23 | }
|
---|
| 24 |
|
---|
[15] | 25 | namespace flair {
|
---|
| 26 | namespace sensor {
|
---|
[286] | 27 | /*! \class SimulatedCamera
|
---|
[15] | 28 | *
|
---|
| 29 | * \brief Class for a simulation camera
|
---|
| 30 | */
|
---|
[286] | 31 | class SimulatedCamera : public core::Thread, public Camera {
|
---|
[15] | 32 | public:
|
---|
| 33 | /*!
|
---|
| 34 | * \brief Constructor
|
---|
| 35 | *
|
---|
[286] | 36 | * Construct a SimulatedCamera.
|
---|
[137] | 37 | * It will be child of the FrameworkManager.
|
---|
[15] | 38 | *
|
---|
| 39 | * \param name name
|
---|
| 40 | * \param width width
|
---|
| 41 | * \param height height
|
---|
| 42 | * \param channels number of channels
|
---|
[158] | 43 | * \param modelId Model id
|
---|
| 44 | * \param deviceId Camera id of the Model
|
---|
[15] | 45 | * \param priority priority of the Thread
|
---|
| 46 | */
|
---|
[286] | 47 | SimulatedCamera(std::string name,
|
---|
[158] | 48 | uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId,
|
---|
[15] | 49 | uint8_t priority);
|
---|
[3] | 50 |
|
---|
| 51 |
|
---|
[15] | 52 | /*!
|
---|
| 53 | * \brief Destructor
|
---|
| 54 | *
|
---|
| 55 | */
|
---|
[286] | 56 | ~SimulatedCamera();
|
---|
[3] | 57 |
|
---|
[15] | 58 | protected:
|
---|
| 59 | /*!
|
---|
| 60 | * \brief SharedMem to access datas
|
---|
| 61 | *
|
---|
| 62 | */
|
---|
| 63 | core::SharedMem *shmem;
|
---|
[3] | 64 |
|
---|
[15] | 65 | private:
|
---|
| 66 | /*!
|
---|
| 67 | * \brief Run function
|
---|
| 68 | *
|
---|
| 69 | * Reimplemented from Thread.
|
---|
| 70 | *
|
---|
| 71 | */
|
---|
| 72 | void Run(void);
|
---|
[3] | 73 |
|
---|
[15] | 74 | /*!
|
---|
| 75 | * \brief Update using provided datas
|
---|
| 76 | *
|
---|
| 77 | * Reimplemented from IODevice.
|
---|
| 78 | *
|
---|
| 79 | * \param data data from the parent to process
|
---|
| 80 | */
|
---|
| 81 | void UpdateFrom(const core::io_data *data){};
|
---|
[158] | 82 |
|
---|
| 83 | std::string ShMemName(uint32_t modelId,uint32_t deviceId);
|
---|
[3] | 84 |
|
---|
[15] | 85 | size_t buf_size;
|
---|
[151] | 86 | char* shmemReadBuf;
|
---|
[15] | 87 | };
|
---|
[3] | 88 | } // end namespace sensor
|
---|
| 89 | } // end namespace flair
|
---|
[286] | 90 | #endif // SIMULATEDCAMERA_H
|
---|