mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
frame_exporter.h
Go to the documentation of this file.
1 #ifndef MF_FRAME_EXPORTER_H_
2 #define MF_FRAME_EXPORTER_H_
3 
4 #include "../common.h"
5 #include "../ndarray/ndcoord.h"
6 #include "../ndarray/ndarray_view.h"
7 
8 namespace mf {
9 
11 template<std::size_t Dim, typename Elem>
13 private:
14  ndsize<Dim> frame_shape_;
15 
16 protected:
18  frame_shape_(frame_shape) { }
19 
20 public:
22  using elem_type = Elem;
23  constexpr static std::size_t dimension = Dim;
24 
25  virtual ~frame_exporter() { }
26 
27  const ndsize<Dim>& frame_shape() { return frame_shape_; }
28 
29  virtual void write_frame(const frame_view_type&) = 0;
30  virtual void close() { }
31 };
32 // TODO specify frame shape after construction, in setup step
33 
34 
35 }
36 
37 #endif
38 
Mapping between coordinates, indices, and addresses of multi-dimensional data.
Definition: ndarray_view.h:16
virtual void write_frame(const frame_view_type &)=0
virtual ~frame_exporter()
Definition: frame_exporter.h:25
Frame exporter, abstract base class.
Definition: frame_exporter.h:12
static constexpr std::size_t dimension
Definition: frame_exporter.h:23
Vector of n-dimensional coordinates.
Definition: ndcoord.h:18
ndarray_view< Dim, Elem > frame_view_type
Definition: frame_exporter.h:21
frame_exporter(const ndsize< Dim > &frame_shape)
Definition: frame_exporter.h:17
const ndsize< Dim > & frame_shape()
Definition: frame_exporter.h:27
RGB color, 8 bit.
Definition: color.h:27
virtual void close()
Definition: frame_exporter.h:30