wangrong
2025-03-19 291afb9c81aae1d15d9e3edcea618d0a2e1fc5a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
#pragma once
 
#include "vp_record_task.h"
 
namespace vp_nodes {
    // image record task, each task instance responsible for recording only 1 image file.
    // create multi instances if multi images need to be record at the same time, and maintain these tasks in a list.
    // note, the cost of image record is very low but still let it work asynchronously (derived from vp_record_task).
    class vp_image_record_task: public vp_record_task {
    private:
    protected:
        // define how to record image
        virtual void record_task_run() override;
        // retrive .jpg as file extension
        virtual std::string get_file_ext() override;
    public:
        vp_image_record_task(int channel_index,
                            std::string file_name_without_ext,
                            std::string save_dir,
                            bool auto_sub_dir,
                            bool osd,
                            vp_objects::vp_size resolution_w_h,
                            std::string host_node_name = "host_node_not_specified",
                            bool auto_start = true);
        ~vp_image_record_task();
    };
}