mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
color_converter.h
Go to the documentation of this file.
1 #ifndef MF_COLOR_CONVERTER_FILTER_H_
2 #define MF_COLOR_CONVERTER_FILTER_H_
3 
4 #include <algorithm>
5 #include "filter.h"
6 #include "../color.h"
7 
8 namespace mf { namespace flow {
9 
11 
12 template<typename Input_color, typename Output_color>
14 public:
15  output_type<2, Output_color> output;
17 
19  filter(nd), output(*this), input(*this) { }
20 
21  void setup() override {
22  output.define_frame_shape(input.frame_shape());
23  }
24 
25  void process(node_job& job) override {
26  auto in = job.in(input);
27  auto out = job.out(output);
29  in.begin(),
30  in.end(),
31  out.begin(),
32  color_convert<Output_color, Input_color>
33  );
34  }
35 };
36 
37 // TODO insert automatically, make thin_node
38 
39 }}
40 
41 #endif
decltype(auto) out(Output &)
ndcoord< Dim, T > transform(const ndcoord< Dim, T > &a, Unary fct)
Definition: ndcoord.h:144
input_port< Dim, Elem > input_type
Definition: filter.h:24
void setup() override
Set up the filter, called prior to any frame being processed.
Definition: color_converter.h:21
Filter which performs concrete processing, base class.
Definition: filter.h:15
Color converter filter.
Definition: color_converter.h:13
Node which delegates concrete frame processing to associated filter object.
Definition: filter_node.h:15
input_type< 2, Input_color > input
Definition: color_converter.h:16
Work unit of flow graph node.
Definition: node_job.h:13
output_type< 2, Output_color > output
Definition: color_converter.h:15
color_converter_filter(filter_node &nd)
Definition: color_converter.h:18
decltype(auto) in(Input &)
void process(node_job &job) override
Process a frame.
Definition: color_converter.h:25