]> git.sesse.net Git - movit/blob - input.h
In EffectChainTest, do not re-call init_movit()
[movit] / input.h
1 #ifndef _MOVIT_INPUT_H
2 #define _MOVIT_INPUT_H 1
3
4 #include <assert.h>
5
6 #include "effect.h"
7 #include "image_format.h"
8
9 // An input is a degenerate case of an effect; it represents the picture data
10 // that comes from the user. As such, it has zero “inputs” itself. Also, it
11 // has an extra operation called finalize(), which runs when the effect chain
12 // is finalized.
13 //
14 // An input is, like any other effect, required to be able to output a GLSL
15 // fragment giving a RGBA value (although that GLSL fragment will have zero
16 // inputs itself), and set the required OpenGL state on set_gl_state(),
17 // including possibly uploading the texture if so required.
18 class Input : public Effect {
19 public:
20         virtual unsigned num_inputs() const { return 0; }
21
22         // Create the texture itself. We cannot do this in the constructor,
23         // because we don't necessarily know all the settings (sRGB texture,
24         // mipmap generation) at that point.
25         virtual void finalize() = 0;
26
27         // Whether this input can deliver linear gamma directly if it's
28         // asked to. (If so, set the parameter “output_linear_gamma”
29         // to activate it.)
30         virtual bool can_output_linear_gamma() const = 0;
31
32         virtual unsigned get_width() const = 0;
33         virtual unsigned get_height() const = 0;
34         virtual Colorspace get_color_space() const = 0;
35         virtual GammaCurve get_gamma_curve() const = 0;
36 };
37
38 #endif // !defined(_MOVIT_INPUT_H)