visionx::imrec Namespace Reference

Namespaces

 strats
 

Classes

class  AbstractPlaybackStrategy
 
class  AbstractRecordingStrategy
 Abstract interface of a recording strategy. More...
 
class  AbstractSequencedRecordingStrategy
 An object of this class behaves likee a normal recording, but is in fact a sequence of images. More...
 
struct  RegistryEntry
 

Typedefs

using Playback = std::shared_ptr< visionx::imrec::AbstractPlaybackStrategy >
 Convenience alias for an instance of any playback strategy. More...
 
using Recording = std::shared_ptr< AbstractRecordingStrategy >
 Convenience alias for any recording strategy. More...
 

Enumerations

enum  Compression { lossy, lossless }
 
enum  Format {
  bmp_img_seq, png_img_seq, png_fast_img_seq, png_mt_img_seq,
  png_fast_mt_img_seq, jpg_img_seq, avi_default, mp4_default
}
 Supported recording Formats. More...
 
enum  Framerate { static_fps, dynamic_fps }
 

Functions

void convert (const CByteImage &in, cv::Mat &out)
 Converts an IVT CByteImage to OpenCV's BGR Mat. More...
 
void convert (const cv::Mat &in, CByteImage &out)
 Converts an OpenCV BGR Mat to IVT's CByteImage. More...
 
void convert_rgb2cbi (const cv::Mat &in, CByteImage &out)
 Converts an OpenCV RGB Mat to IVT's CByteImage. More...
 
std::string datetime_to_string (std::chrono::microseconds ts)
 
const std::string & format2hrstr (const Format format)
 
const std::string & format2str (const Format format)
 
void from_json (const nlohmann::json &j, ChannelConfig &cc)
 
void from_json (const nlohmann::json &j, Config &c)
 
std::vector< FormatgetFormats ()
 
std::map< Format, RegistryEntrygetFormatsMap ()
 
bool isFormatDynamicFramerate (Format format)
 
bool isFormatLossless (Format format)
 
visionx::imrec::Playback newPlayback (const std::filesystem::path &path)
 Instantiates and returns a new playback strategy which is capable of replaying the file or collection at path. More...
 
visionx::imrec::Recording newRecording (const std::filesystem::path &filePath, double fps)
 Creates a new recording given the file extension and additional parameters. More...
 
visionx::imrec::Recording newRecording (const std::filesystem::path &path, const std::string &name, const Format format, double fps)
 
Format str2format (const std::string &format_str)
 
void takeSnapshot (const CByteImage &image, const std::filesystem::path &filePath)
 Takes a snapshot using the default recording method for snapshots. More...
 
void takeSnapshot (const cv::Mat &image, const std::filesystem::path &filePath)
 Takes a snapshot using the default recording method for snapshots. More...
 
std::string timestamp_to_string (std::chrono::microseconds ts)
 
void to_json (nlohmann::json &j, const ChannelConfig &cc)
 
void to_json (nlohmann::json &j, const Config &c)
 

Typedef Documentation

◆ Playback

Convenience alias for an instance of any playback strategy.

Definition at line 48 of file AbstractPlaybackStrategy.h.

◆ Recording

using Recording = std::shared_ptr<AbstractRecordingStrategy>

Convenience alias for any recording strategy.

Definition at line 181 of file AbstractRecordingStrategy.h.

Enumeration Type Documentation

◆ Compression

enum Compression
strong
Enumerator
lossy 
lossless 

Definition at line 75 of file public_api.h.

◆ Format

enum Format
strong

Supported recording Formats.

Note
If you add new formats, also add them to the registry (declared in an anonymous namespace) in public_api.cpp.
Enumerator
bmp_img_seq 
png_img_seq 
png_fast_img_seq 
png_mt_img_seq 
png_fast_mt_img_seq 
jpg_img_seq 
avi_default 
mp4_default 

Definition at line 55 of file public_api.h.

◆ Framerate

enum Framerate
strong
Enumerator
static_fps 
dynamic_fps 

Definition at line 68 of file public_api.h.

Function Documentation

◆ convert() [1/2]

void convert ( const CByteImage &  in,
cv::Mat &  out 
)

Converts an IVT CByteImage to OpenCV's BGR Mat.

Parameters
inCByteImage
outOutput parameter

Definition at line 41 of file helper.cpp.

+ Here is the caller graph for this function:

◆ convert() [2/2]

void convert ( const cv::Mat &  in,
CByteImage &  out 
)

Converts an OpenCV BGR Mat to IVT's CByteImage.

Parameters
incv::Mat with BGR format
outOutput parameter

Definition at line 54 of file helper.cpp.

+ Here is the call graph for this function:

◆ convert_rgb2cbi()

void convert_rgb2cbi ( const cv::Mat &  in,
CByteImage &  out 
)

Converts an OpenCV RGB Mat to IVT's CByteImage.

Parameters
incv::Mat with RGB format
outOutput parameter

Definition at line 65 of file helper.cpp.

+ Here is the caller graph for this function:

◆ datetime_to_string()

std::string datetime_to_string ( std::chrono::microseconds  ts)

Definition at line 77 of file helper.cpp.

+ Here is the caller graph for this function:

◆ format2hrstr()

const std::string & format2hrstr ( const Format  format)

Definition at line 152 of file public_api.cpp.

+ Here is the caller graph for this function:

◆ format2str()

const std::string & format2str ( const Format  format)

Definition at line 145 of file public_api.cpp.

◆ from_json() [1/2]

void visionx::imrec::from_json ( const nlohmann::json &  j,
ChannelConfig &  cc 
)

Definition at line 48 of file json_conversions.h.

◆ from_json() [2/2]

void visionx::imrec::from_json ( const nlohmann::json &  j,
Config &  c 
)

Definition at line 67 of file json_conversions.h.

◆ getFormats()

std::vector< visionx::imrec::Format > getFormats ( )

Definition at line 172 of file public_api.cpp.

+ Here is the call graph for this function:

◆ getFormatsMap()

std::map< visionx::imrec::Format, visionx::imrec::RegistryEntry > getFormatsMap ( )

Definition at line 184 of file public_api.cpp.

◆ isFormatDynamicFramerate()

bool isFormatDynamicFramerate ( Format  format)

Definition at line 198 of file public_api.cpp.

◆ isFormatLossless()

bool isFormatLossless ( Format  format)

Definition at line 191 of file public_api.cpp.

◆ newPlayback()

visionx::imrec::Playback newPlayback ( const std::filesystem::path &  path)

Instantiates and returns a new playback strategy which is capable of replaying the file or collection at path.

Parameters
pathPath to the recording file or collection (folder, glob, ...)
Returns
Concrete playback strategy capable of replaying the recording at path

Definition at line 205 of file public_api.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newRecording() [1/2]

visionx::imrec::Recording newRecording ( const std::filesystem::path &  filePath,
double  fps 
)

Creates a new recording given the file extension and additional parameters.

Parameters
filePathPath to where the recording file should be written to
fpsAmount of frames being recorded per second
Returns
Recording object

Definition at line 269 of file public_api.cpp.

+ Here is the call graph for this function:

◆ newRecording() [2/2]

visionx::imrec::Recording newRecording ( const std::filesystem::path &  path,
const std::string &  name,
const Format  format,
double  fps 
)

Definition at line 237 of file public_api.cpp.

+ Here is the caller graph for this function:

◆ str2format()

visionx::imrec::Format str2format ( const std::string &  format_str)

Definition at line 159 of file public_api.cpp.

+ Here is the caller graph for this function:

◆ takeSnapshot() [1/2]

void takeSnapshot ( const CByteImage &  image,
const std::filesystem::path &  filePath 
)

Takes a snapshot using the default recording method for snapshots.

Parameters
filePathPath to where the recording file should be written to
imageThe image to be saved

Definition at line 307 of file public_api.cpp.

+ Here is the caller graph for this function:

◆ takeSnapshot() [2/2]

void takeSnapshot ( const cv::Mat &  image,
const std::filesystem::path &  filePath 
)

Takes a snapshot using the default recording method for snapshots.

Parameters
filePathPath to where the recording file should be written to
imageThe image to be saved

Definition at line 314 of file public_api.cpp.

◆ timestamp_to_string()

std::string timestamp_to_string ( std::chrono::microseconds  ts)

Definition at line 113 of file helper.cpp.

+ Here is the call graph for this function:

◆ to_json() [1/2]

void visionx::imrec::to_json ( nlohmann::json &  j,
const ChannelConfig &  cc 
)

Definition at line 37 of file json_conversions.h.

◆ to_json() [2/2]

void visionx::imrec::to_json ( nlohmann::json &  j,
const Config &  c 
)

Definition at line 56 of file json_conversions.h.