Go to the documentation of this file.
5 #ifndef CCF_COMMON_DATA_FRAME_HPP_H_
6 #define CCF_COMMON_DATA_FRAME_HPP_H_
8 #include <ctd/param/Parameter.hpp>
23 const int16_t frame_q_nb);
56 void Store(
const void* buffer,
59 const int64_t cam_frame_count,
60 const int64_t int_frame_count,
61 const int64_t sub_frame_count,
62 const int64_t exp_nb_sub_frames,
64 const int32_t offset_x,
65 const int32_t offset_y,
68 const int32_t depth = 1);
127 template <
class TYPE>
131 m_meta_data[name] = ctd::param::Parameter(name, std::to_string(value));
138 template <
class TYPE>
142 auto it = m_meta_data.find(name);
143 if (it == m_meta_data.end()) {
146 it->second.GetValue(value);
151 std::string
ToString(
const bool full =
false)
const;
179 void _Initialise(
const std::string& frame_id =
"",
180 const int64_t frame_nb = -1);
183 std::string m_frame_id;
184 int64_t m_frame_q_nb;
186 int64_t m_cam_frame_count;
187 int64_t m_int_frame_count;
189 int64_t m_sub_frame_count;
190 int64_t m_exp_nb_sub_frames;
192 uint8_t m_consumer_count;
194 double m_handling_start_time;
198 uint32_t m_cur_allocated;
209 std::map<std::string, ctd::param::Parameter> m_meta_data;
211 template <
class DATA_TYPE>
212 double _Sum()
const {
215 DATA_TYPE* p =
static_cast<DATA_TYPE*
>(m_buffer);
217 sum +=
static_cast<DATA_TYPE
>(*p++);
226 #endif // CCF_COMMON_DATA_FRAME_HPP_H_
ImageDataType
CCF image data types. Based on the values defined for BITPIX in the FITS standard.
Definition: base.hpp:153
uint32_t GetDataSize() const
Return the sizein bytes of the image.
Definition: dataFrame.cpp:222
int64_t GetCamFrameCount() const
Counter indicating the number of the frame received from the camera, if provided by the camera (first...
Definition: dataFrame.cpp:192
std::string ToString(const bool full=false) const
Generate a representative (short) string representation (summary) of the object.
Definition: dataFrame.cpp:79
int32_t GetWidth() const
Get the width of the ROI applied by the camera.
Definition: dataFrame.cpp:247
uint8_t GetConsumerCount() const
Definition: dataFrame.cpp:117
const std::string & GetFrameId() const
Return the frame ID allocated.
Definition: dataFrame.cpp:69
int32_t GetHeight() const
Get the height of the ROI applied by the camera.
Definition: dataFrame.cpp:252
void * GetBufferReadWrite() const
Definition: dataFrame.cpp:217
int32_t GetResolution() const
Get the resolution (bits/pixel) of the image currently stored in the object.
Definition: dataFrame.cpp:267
void RemoveMetaData(const std::string &name)
Remove a given metadata parameter from the object.
Definition: dataFrame.cpp:314
int64_t GetIntFrameCount() const
Internall frame counter, counting the frames receives since the last Start command (first frame == 1)...
Definition: dataFrame.cpp:197
void SetConsumerCount(const uint8_t count)
Definition: dataFrame.cpp:106
Class to be used as parent all CCF classes.
Definition: base.hpp:93
void ResetDataSize()
Reset the size of the image. This indicates that no image is stored in the object.
Definition: dataFrame.cpp:141
ImageDataType GetDataType() const
Get the type of the image pixels currently stored in the object. The types defined by the FITS specif...
Definition: dataFrame.cpp:262
const void * GetBuffer() const
Get read-only pointer to internal image buffer.
Definition: dataFrame.cpp:212
int16_t GetFrameQNb() const
Return the frame queue number, when used in a queue.
Definition: dataFrame.cpp:74
bool HasMetadata(const std::string &name, TYPE &value) const
Get a parameter value from the configuration.
Definition: dataFrame.hpp:139
static int16_t DataTypeToResolution(const ImageDataType data_type)
Derive resolution (bytes per pixel) from data type.
Definition: dataFrame.cpp:12
double GetDataSum() const
Compute the data sum of all pixels.
Definition: dataFrame.cpp:322
void Store(const void *buffer, const uint32_t size, const double time, const int64_t cam_frame_count, const int64_t int_frame_count, const int64_t sub_frame_count, const int64_t exp_nb_sub_frames, const ImageDataType data_type, const int32_t offset_x, const int32_t offset_y, const int32_t width, const int32_t height, const int32_t depth=1)
Store an image frame (or sub-frame) in the object.
Definition: dataFrame.cpp:146
void AddMetaData(const std::string &name, TYPE &value)
Definition: dataFrame.hpp:128
int64_t GetExpNbSubFrames() const
Expected number of sub-frames if the data of a frame is received in sub-frames (blocks).
Definition: dataFrame.cpp:207
int32_t GetOffsetY() const
Get vertical offset of the ROI applied by the camera.
Definition: dataFrame.cpp:242
void Reset()
Definition: dataFrame.cpp:65
~DataFrame()
Definition: dataFrame.cpp:57
DataFrame()
Definition: dataFrame.cpp:52
double GetHandlingStartTime() const
Get the time for starting the handling of the frame.
Definition: dataFrame.cpp:283
Definition: appBase.cpp:8
void DecrementConsumerCount(const uint8_t decr=1)
Definition: dataFrame.cpp:122
double GetHandlingTime() const
Get handling time (duration for handling the frame in the given context).
Definition: dataFrame.cpp:288
int32_t GetDepth() const
Get the number of frames if a three dimensional image is contained in the object.
Definition: dataFrame.cpp:257
uint32_t GetBufferSize() const
Get the internal buffer size in bytes.
Definition: dataFrame.cpp:227
#define CCFTRACE
TRACE log macro. Includes the location ("CCFLOC") in the log message.
Definition: base.hpp:403
int64_t GetSubFrameCount() const
Number of a sub-frame if the data of a frame is received in sub-frames (blocks) (first sub-frame == 1...
Definition: dataFrame.cpp:202
double GetTime() const
Get the current time stamp stored in the object.
Definition: dataFrame.cpp:232
int32_t GetOffsetX() const
Get horisontal offset of the ROI applied by the camera.
Definition: dataFrame.cpp:237
void SetHandlingStartTime(const double time)
Set the start time for handling handling the frame.
Definition: dataFrame.cpp:278
Frame class used to store the data and metadata for one frames received from the camera.
Definition: dataFrame.hpp:15
DataFrame & operator=(const DataFrame &source)
Definition: dataFrame.cpp:272