]> git.sesse.net Git - mlt/blob - src/modules/opengl/mlt_movit_input.h
bbeac078af3ffa67aa4f388f7045a066c7e180c2
[mlt] / src / modules / opengl / mlt_movit_input.h
1 /*
2  * mlt_movit_input.h
3  * Copyright (C) 2013 Dan Dennedy <dan@dennedy.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef MLT_MOVIT_INPUT_H
21 #define MLT_MOVIT_INPUT_H
22
23 #include <movit/flat_input.h>
24 #include <movit/ycbcr_input.h>
25 #include <movit/effect_chain.h>
26
27 class MltInput : public Input
28 {
29 public:
30         MltInput(unsigned width, unsigned height);
31         ~MltInput();
32
33         // Effect overrides
34         std::string effect_type_id() const { return "MltInput"; }
35         Effect::AlphaHandling alpha_handling() const;
36         std::string output_fragment_shader();
37         void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
38
39         // Input ovverrides
40         void finalize();
41         bool can_output_linear_gamma() const;
42         unsigned get_width() const { return m_width; }
43         unsigned get_height() const { return m_height; }
44         Colorspace get_color_space() const;
45         GammaCurve get_gamma_curve() const;
46
47         // Custom methods
48         void useFlatInput(MovitPixelFormat pix_fmt, unsigned width, unsigned height);
49         void useYCbCrInput(const ImageFormat& image_format, const YCbCrFormat& ycbcr_format, unsigned width, unsigned height);
50         void set_pixel_data(const unsigned char* data);
51
52 private:
53         unsigned m_width, m_height;
54         int output_linear_gamma, needs_mipmaps;
55         Input *input;
56         bool isRGB;
57         YCbCrFormat m_ycbcr_format;
58 };
59
60 #endif // MLT_MOVIT_INPUT_H