camcom 1.0.3
 
Loading...
Searching...
No Matches
frameInfo.hpp
Go to the documentation of this file.
1
8
9#ifndef CAMCOM_COMMON_FRAMEINFO_HPP
10#define CAMCOM_COMMON_FRAMEINFO_HPP
11
12#include <cstdint>
13#include <string>
14#include <sstream>
15#include <map>
16
17#include "ifw/fnd/defs/base.hpp"
20
21namespace camcom::common {
22
23 class FrameInfo {
24 public:
25 FrameInfo() : start_x(0), start_y(0), width(0), height(0), data_type(DataType::UNSPECIFIED){}
26 FrameInfo(int32_t x, int32_t y, int32_t w, int32_t h, DataType dtype) :
27 start_x(x), start_y(y), width(w), height(h), data_type(dtype) {}
28
29 const std::string Print() const {
30 FNDTRACE();
31 std::stringstream msg;
32 msg << "Exposure start (camera timestamp): " << timestamp << ", Fr ID: " << frame_id <<
33 ", W: " << width << ", H: " << height << ", OffX: " << start_x << ", OffY: " <<
34 start_y << ", Type: " << camcom::common::DataTypeString(data_type) << ", Size: " << size;
35 return msg.str();
36 }
37
38 // Required parameters. 32-bit geometry: large/mosaic detectors can
39 // exceed the 16-bit range, and this matches BasicParams' uint32_t
40 // width/height (kept signed here to allow a transport to report a
41 // negative offset if it ever needs to).
42 int32_t start_x{0};
43 int32_t start_y{0};
44 int32_t width{1};
45 int32_t height{1};
46 int64_t frame_id{0};
47 uint64_t timestamp{0};
48 double exposure_time_us{0};
49 DataType data_type{DataType::UNSPECIFIED};
50 std::size_t size{0};
51
52 // Optional additional parameters may be stored in meta_data
53 std::map<std::string, Value> meta_data;
54 };
55}
56
57#endif
DataType data_type
Definition frameInfo.hpp:49
FrameInfo()
Definition frameInfo.hpp:25
int32_t start_x
Definition frameInfo.hpp:42
int64_t frame_id
Definition frameInfo.hpp:46
int32_t start_y
Definition frameInfo.hpp:43
std::size_t size
Definition frameInfo.hpp:50
uint64_t timestamp
Camera timestamp in nanoseconds.
Definition frameInfo.hpp:47
const std::string Print() const
Definition frameInfo.hpp:29
double exposure_time_us
Exposure time in microseconds.
Definition frameInfo.hpp:48
std::map< std::string, Value > meta_data
Definition frameInfo.hpp:53
FrameInfo(int32_t x, int32_t y, int32_t w, int32_t h, DataType dtype)
Definition frameInfo.hpp:26
int32_t height
Definition frameInfo.hpp:45
int32_t width
Definition frameInfo.hpp:44
CamCom data type — re-export of the ELT IFW (ifw-fnd) data type.
Definition adapterBase.cpp:18
ifw::fnd::datatype::DataType DataType
Definition datatype.hpp:27
std::string DataTypeString(DataType type)
Definition datatype.hpp:31
Header file for the CamCom Common Library.