Debian Codegraph @

cvd/diskbuffer2_frame.h

raw symbols SCIP
1 #ifndef CVD_DISKBUFFER2_FRAME_H
2 #define CVD_DISKBUFFER2_FRAME_H
3
4 #include <cvd/localvideoframe.h>
5 #include <string>
6 #include <utility>
7
8 namespace CVD
9 {
10 template <class T>
11 class DiskBuffer2;
12
13 /// A frame from a DiskBuffer2. The frames in a DiskBuffer2 are image files loaded from disk.
14 /// @param T The pixel type of the frames to provide (usually <code>CVD::Rgb<CVD::byte></code>
15 /// or <code>CVD::byte</code>. If the image files are of a different type, they will be automatically
16 /// converted (see @link gImageIO Image loading and saving, and format conversion@endlink).
17 /// @ingroup gVideoFrame
18 template <typename T>
19 class DiskBuffer2Frame : public CVD::LocalVideoFrame<T>
20 {
21 /// Allow DiskBuffer2 to create a DiskBuffer2Frame
22 friend class CVD::DiskBuffer2<T>;
23
24 public:
25 /// What is the filename for this image?
26 const std::string& name() { return frame_name; };
27
28 /// set the time stamp, required for TimedDiskBuffer2
29 void timestamp(double time) { this->my_timestamp = time; }
30
31 private:
32 ~DiskBuffer2Frame()
33 {
34 }
35
36 DiskBuffer2Frame(double time, CVD::Image<T>&& from_disk, const std::string& file)
37 : LocalVideoFrame<T>(time, std::move(from_disk))
38 , frame_name(file)
39 {
40 }
41
42 private:
43 const std::string& frame_name;
44 };
45 }
46
47 #endif