ifw-rtmstools 4.0.0
 
Loading...
Searching...
No Matches
ddtImage.hpp
Go to the documentation of this file.
1
7
8 #pragma once
9
10#include <boost/lockfree/spsc_queue.hpp>
11#include <boost/atomic.hpp>
12#include <boost/bimap.hpp>
13#include <boost/assign.hpp>
14#include <boost/algorithm/string.hpp>
15
16#include <ddt/ddtDataPublisher.hpp>
17#include <ddt/ddtDataTransferFactory.hpp>
18#include <ddt/ddtEncDecImage3D.hpp>
19#include <ddt/ddtLogger.hpp>
20
21#include <ifw/fnd/defs/dataType.hpp>
22
23#include <ifw/rtmslib_llnetio/logger.hpp>
24
26
31 inline uint32_t GetDdtType(const ifw::fnd::datatype::DataType data_type) {
32 uint32_t ddt_type = ddt::SINT16;
33 switch (data_type) {
34 case ifw::fnd::datatype::DataType::BYTE:
35 ddt_type = ddt::UINT8;
36 break;
37 case ifw::fnd::datatype::DataType::INT16:
38 ddt_type = ddt::SINT16;
39 break;
40 case ifw::fnd::datatype::DataType::UINT16:
41 ddt_type = ddt::SINT16;
42 break;
43 case ifw::fnd::datatype::DataType::INT32:
44 ddt_type = ddt::SINT16;
45 break;
46 case ifw::fnd::datatype::DataType::UINT32:
47 ddt_type = ddt::SINT32;
48 break;
49 case ifw::fnd::datatype::DataType::FLOAT:
50 ddt_type = ddt::FLOAT32;
51 break;
52 default:
53 break;
54 }
55 return ddt_type;
56 }
57
64 class DdtImage {
65
66 public:
72 DdtImage(int width, int height, int bpp,
73 ifw::fnd::datatype::DataType datatype);
74
75 // Disable copy constructor and assignment
76 DdtImage(const DdtImage&) = delete;
78 virtual ~DdtImage();
79
83 int GetWidth();
84
88 int GetHeight();
89
93 int GetBpp();
94
98 ifw::fnd::datatype::DataType GetDataType() const;
99
105 int GetSize();
106
112 unsigned char* GetImage();
113
114 private:
115 int m_width{0};
116 int m_height{0};
117
118 int m_bpp{0};
119 int m_sample{0};
120 unsigned char* m_image{nullptr};
121 ifw::fnd::datatype::DataType m_data_type{
122 ifw::fnd::datatype::DataType::INVALID};
123
124 };
125
126}
DdtImage(int width, int height, int bpp, ifw::fnd::datatype::DataType datatype)
Constructor.
Definition ddtImage.cpp:14
DdtImage & operator=(DdtImage &)=delete
int GetWidth()
Get image width.
Definition ddtImage.cpp:33
int GetHeight()
Get image height.
Definition ddtImage.cpp:37
DdtImage(int width, int height, int bpp, ifw::fnd::datatype::DataType datatype)
Constructor.
Definition ddtImage.cpp:14
unsigned char * GetImage()
Get a pointer to the image data.
Definition ddtImage.cpp:49
virtual ~DdtImage()
Definition ddtImage.cpp:27
int GetSize()
Get image size.
Definition ddtImage.cpp:45
int GetBpp()
Get image bytes per pixel.
Definition ddtImage.cpp:41
ifw::fnd::datatype::DataType GetDataType() const
Get image data type.
Definition ddtImage.cpp:53
DdtImage Class Implementation.
Definition ddtImage.cpp:12
uint32_t GetDdtType(const ifw::fnd::datatype::DataType data_type)
Get DDT data type.
Definition ddtImage.hpp:31