3 * Copyright (C) 2013 Dan Dennedy <dan@dennedy.org>
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.
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.
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.
20 #ifndef MLT_MOVIT_INPUT_H
21 #define MLT_MOVIT_INPUT_H
23 #include <movit/flat_input.h>
24 #include <movit/ycbcr_input.h>
25 #include <movit/effect_chain.h>
27 class MltInput : public Input
30 MltInput(unsigned width, unsigned height);
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 void inform_added(EffectChain *chain) { m_chain = chain; }
42 bool can_output_linear_gamma() const;
43 unsigned get_width() const { return m_width; }
44 unsigned get_height() const { return m_height; }
45 Colorspace get_color_space() const;
46 GammaCurve get_gamma_curve() const;
49 void useFlatInput(MovitPixelFormat pix_fmt, unsigned width, unsigned height);
50 void useYCbCrInput(const ImageFormat& image_format, const YCbCrFormat& ycbcr_format, unsigned width, unsigned height);
51 void set_pixel_data(const unsigned char* data);
52 void invalidate_pixel_data();
55 unsigned m_width, m_height;
56 int output_linear_gamma, needs_mipmaps;
59 YCbCrFormat m_ycbcr_format;
63 #endif // MLT_MOVIT_INPUT_H