1 #include <visp3/core/vpIoTools.h> 2 #include <visp3/core/vpDisplay.h> 3 #include <visp3/io/vpImageIo.h> 5 #include "record_helper.h" 15 bool record_helper(
const std::string &opt_seqname,
int opt_record_mode,
18 static bool start_record =
false;
19 static std::string text_record_mode = std::string(
"Record mode: ") + (opt_record_mode ? std::string(
"single") :
std::string(
"continuous"));
21 if (! opt_seqname.empty()) {
22 if (! opt_record_mode) {
39 if (! opt_seqname.empty()) {
44 if (! opt_seqname.empty()) {
46 start_record = !start_record;
57 static unsigned int counter = 1;
58 char filename[FILENAME_MAX];
59 sprintf(filename, opt_seqname.c_str(), counter);
62 static bool parent_exists =
false;
63 if (! parent_exists) {
65 if (! parent.empty()) {
75 std::string text = std::string(
"Save: ") + std::string(filename);
77 std::cout << text << std::endl;
79 if (opt_record_mode == 1) {
98 bool record_helper(
const std::string &opt_seqname_1,
const std::string &opt_seqname_2,
const int opt_record_mode,
101 static bool start_record =
false;
102 static std::string text_record_mode = std::string(
"Record mode: ") + (opt_record_mode ? std::string(
"single") :
std::string(
"continuous"));
104 if (! opt_seqname_1.empty() || ! opt_seqname_2.empty()) {
105 if (! opt_record_mode) {
127 if (! opt_seqname_1.empty() || ! opt_seqname_2.empty()) {
133 if (! opt_seqname_1.empty() || !opt_seqname_2.empty()) {
135 start_record = !start_record;
146 static unsigned int counter = 1;
147 char filename_1[FILENAME_MAX];
148 char filename_2[FILENAME_MAX];
149 sprintf(filename_1, opt_seqname_1.c_str(), counter);
152 static bool parent_exists =
false;
153 if (! parent_exists) {
155 if (! parent.empty()) {
160 parent_exists =
true;
164 sprintf(filename_2, opt_seqname_2.c_str(), counter);
167 static bool parent_exists =
false;
168 if (! parent_exists) {
170 if (! parent.empty()) {
175 parent_exists =
true;
180 std::string text_1 = std::string(
"Save: ") + std::string(filename_1);
181 std::string text_2 = std::string(
"Save: ") + std::string(filename_2);
184 std::cout << text_1 << std::endl;
185 std::cout << text_2 << std::endl;
188 if (opt_record_mode == 1) {
189 start_record =
false;
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
static void write(const vpImage< unsigned char > &I, const std::string &filename)