35#include <opencv2/opencv.hpp>
38#include <Image/ByteImage.h>
52 const std::filesystem::path& filePath,
53 const std::filesystem::path& ext) :
72 std::filesystem::create_directory(pathStem);
88 return std::filesystem::canonical(path) /
"metadata.csv";
93 const unsigned int sequence_number,
94 const std::string& frame_name)
96 const std::filesystem::path frame_filename = frame_name +
getDotExtension().string();
100 unsigned int chunk_number = sequence_number /
CHUNK_SIZE;
101 m_frames_chunk =
"chunk_" + std::to_string(chunk_number);
102 std::filesystem::create_directory(std::filesystem::canonical(
getPath() /
getStem()) /
106 return std::filesystem::canonical(
getPath() /
getStem() / m_frames_chunk) / frame_filename;
virtual std::filesystem::path getPath() const
Gets the path to the recording without filename.
AbstractRecordingStrategy()
Default constructor to start the recording manually.
virtual std::filesystem::path getStem() const
Gets the stem of the configured file (filename without extension)
virtual void startRecording()
Starts the recording manually if constructed empty.
virtual void writeMetadataLine(const std::string &var_name, std::string_view var_type, std::string_view var_value)
std::filesystem::path getMetadataPath() const override
std::filesystem::path getDotExtension() const override
Gets the extension plus preceeded dot of the configured file (e.g.
void startRecording() override
Starts the recording manually if constructed empty.
AbstractSequencedRecordingStrategy()
Default constructor to manually start the recording.
~AbstractSequencedRecordingStrategy() override
Destruct the recording strategy.
std::filesystem::path deriveFramePath(const unsigned int sequence_number, const std::string &frame_name)
Returns the next sequenced full path and increments the sequence number.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...