ifw-rtmstools 3.0.0
Loading...
Searching...
No Matches
ddtImage.hpp
Go to the documentation of this file.
1
8#ifndef RTMS2DDTLIB_DDTIMAGE_HPP_
9#define RTMS2DDTLIB_DDTIMAGE_HPP_
10
11#define BOOST_BIND_NO_PLACEHOLDERS
12
13#include <boost/lockfree/spsc_queue.hpp>
14#include <boost/atomic.hpp>
15#include <boost/bimap.hpp>
16#include <boost/assign.hpp>
17#include <boost/algorithm/string.hpp>
18
19#include <ddt/ddtDataPublisher.hpp>
20#include <ddt/ddtDataTransferFactory.hpp>
21#include <ddt/ddtEncDecImage3D.hpp>
22#include <ddt/ddtLogger.hpp>
23
24//#include <ifw/rtmslib/dataType.hpp>
25#include <ifw/fnd/defs/dataType.hpp>
26
28
29namespace ifw::rtmstools {
30
35 inline uint32_t GetDdtType(const ifw::fnd::datatype::DataType data_type) {
36 uint32_t ddt_type = ddt::SINT16;
37 switch (data_type) {
38 case ifw::fnd::datatype::DataType::BYTE:
39 ddt_type = ddt::UINT8;
40 break;
41 case ifw::fnd::datatype::DataType::INT16:
42 ddt_type = ddt::SINT16;
43 break;
44 case ifw::fnd::datatype::DataType::UINT16:
45 ddt_type = ddt::SINT16;
46 break;
47 case ifw::fnd::datatype::DataType::INT32:
48 ddt_type = ddt::SINT16;
49 break;
50 case ifw::fnd::datatype::DataType::UINT32:
51 ddt_type = ddt::SINT32;
52 break;
53 case ifw::fnd::datatype::DataType::FLOAT:
54 ddt_type = ddt::FLOAT32;
55 break;
56 default:
57 break;
58 }
59 return ddt_type;
60 }
61
68 class DdtImage {
69
70 public:
76 DdtImage(int width, int height, int bpp);
77
78 // Disable copy constructor and assignment
79 DdtImage(const DdtImage&) = delete;
81 virtual ~DdtImage();
82
86 int GetWidth();
87
91 int GetHeight();
92
96 int GetBpp();
97
103 int GetSize();
104
110 unsigned char* GetImage();
111
112 private:
113 int m_width{0};
114 int m_height{0};
115
116 // Bytes per pixel will be deduced from the data type
117 int m_bpp{0};
118 int m_sample{0};
119 unsigned char* m_image{nullptr};
120
121 };
122
123}
124
125#endif // RTMS2DDTLIB_DDTIMAGE_HPP_
DDT Image Class.
Definition ddtImage.hpp:68
int GetBpp()
Get image bytes per pixel.
Definition ddtImage.cpp:33
virtual ~DdtImage()
Definition ddtImage.cpp:19
DdtImage(const DdtImage &)=delete
unsigned char * GetImage()
Get a pointer to the image data.
Definition ddtImage.cpp:41
int GetHeight()
Get image height.
Definition ddtImage.cpp:29
DdtImage & operator=(DdtImage &)=delete
int GetWidth()
Get image width.
Definition ddtImage.cpp:25
int GetSize()
Get image size.
Definition ddtImage.cpp:37
DdtImage(int width, int height, int bpp)
Constructor.
Definition ddtImage.cpp:12
DdtImage Class Implementation.
Definition ddtImage.cpp:10
uint32_t GetDdtType(const ifw::fnd::datatype::DataType data_type)
Get DDT data type.
Definition ddtImage.hpp:35