Dewobble
Video motion stabilization with awareness of lens projection
filter_config.hpp
1 #ifndef DEWOBBLE_FILTER_CONFIG_HPP
2 #define DEWOBBLE_FILTER_CONFIG_HPP
3 
4 #include <CL/opencl.hpp>
5 
6 #include "camera.hpp"
7 #include "stabilizer.hpp"
8 
9 namespace dewobble
10 {
11 
15 typedef enum Interpolation {
19  DEWOBBLE_INTERPOLATION_NEAREST,
23  DEWOBBLE_INTERPOLATION_LINEAR,
27  DEWOBBLE_INTERPOLATION_CUBIC,
31  DEWOBBLE_INTERPOLATION_LANCZOS4,
32 } Interpolation;
33 
39 typedef enum BorderType {
43  DEWOBBLE_BORDER_CONSTANT,
47  DEWOBBLE_BORDER_REPLICATE,
51  DEWOBBLE_BORDER_REFLECT,
55  DEWOBBLE_BORDER_WRAP,
60  DEWOBBLE_BORDER_REFLECT_101,
61 } BorderType;
62 
66 class Color
67 {
68  public:
72  cv::Scalar scalar;
76  Color(double blue, double green, double red, double alpha);
77 };
78 
83 {
84  Camera m_input_camera;
85  Camera m_output_camera;
86  std::shared_ptr<Stabilizer> m_stabilizer;
87  Interpolation m_interpolation = DEWOBBLE_INTERPOLATION_LINEAR;
88  BorderType m_border_type = DEWOBBLE_BORDER_CONSTANT;
89  Color m_border_color = Color(0, 0, 0, 0);
90  bool m_debug = false;
91  cl_context m_opencl_context;
92  cl_device_id m_opencl_device;
93 
94  public:
107  Camera input_camera,
108  Camera output_camera,
109  std::shared_ptr<Stabilizer> stabilizer);
110 
115 
120 
125  std::shared_ptr<Stabilizer> get_stabilizer() const;
126 
131  void set_interpolation(Interpolation interpolation);
136  Interpolation get_interpolation() const;
137 
143  void set_border_type(BorderType border_type);
148  BorderType get_border_type() const;
149 
155  void set_border_color(const Color border_color);
161 
166  void set_debug(bool debug);
171  bool get_debug() const;
172 
176  void set_opencl_context(cl_context context);
180  cl_context get_opencl_context();
181 
185  void set_opencl_device(cl_device_id device);
189  cl_device_id get_opencl_device();
190 };
191 } // namespace dewobble
192 
193 #endif // DEWOBBLE_FILTER_CONFIG_HPP
Definition: camera.hpp:28
Definition: filter_config.hpp:67
cv::Scalar scalar
Definition: filter_config.hpp:72
Color(double blue, double green, double red, double alpha)
Construct a new Color object, with parameters in the range [0,1].
Definition: filter_config.hpp:83
void set_interpolation(Interpolation interpolation)
void set_border_type(BorderType border_type)
cl_device_id get_opencl_device()
void set_debug(bool debug)
void set_opencl_context(cl_context context)
BorderType get_border_type() const
Interpolation get_interpolation() const
Camera get_input_camera() const
FilterConfig(Camera input_camera, Camera output_camera, std::shared_ptr< Stabilizer > stabilizer)
Camera get_output_camera() const
bool get_debug() const
Get whether graphical debugging information is included in the output images.
Color get_border_color() const
std::shared_ptr< Stabilizer > get_stabilizer() const
void set_opencl_device(cl_device_id device)
void set_border_color(const Color border_color)
cl_context get_opencl_context()