X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=input.h;h=6c9fca1a4050b8590ef4698c5863c90534029f3f;hp=ac03e8490c280c1aa2f86b65c465ecd9087de592;hb=1547d2758dbf397602f9805e23620c1d0211f33d;hpb=0dc1dfe6444a700ebd2c9f006cba000b90c3a7b0 diff --git a/input.h b/input.h index ac03e84..6c9fca1 100644 --- a/input.h +++ b/input.h @@ -1,15 +1,15 @@ -#ifndef _INPUT_H -#define _INPUT_H 1 +#ifndef _MOVIT_INPUT_H +#define _MOVIT_INPUT_H 1 #include #include "effect.h" #include "image_format.h" +namespace movit { + // An input is a degenerate case of an effect; it represents the picture data -// that comes from the user. As such, it has zero “inputs” itself. Also, it -// has an extra operation called finalize(), which runs when the effect chain -// is finalized. +// that comes from the user. As such, it has zero “inputs” itself. // // An input is, like any other effect, required to be able to output a GLSL // fragment giving a RGBA value (although that GLSL fragment will have zero @@ -17,15 +17,23 @@ // including possibly uploading the texture if so required. class Input : public Effect { public: - virtual unsigned num_inputs() const { return 0; } + unsigned num_inputs() const override { return 0; } + + // Whether this input can deliver linear gamma directly if it's + // asked to. (If so, set the parameter “output_linear_gamma” + // to activate it.) + virtual bool can_output_linear_gamma() const = 0; - // Create the texture itself. We cannot do this in the constructor, - // because we don't necessarily know all the settings (sRGB texture, - // mipmap generation) at that point. - virtual void finalize() = 0; + // Whether this input can supply mipmaps if asked to (by setting + // the "needs_mipmaps" integer parameter set to 1). + virtual bool can_supply_mipmaps() const { return true; } - virtual ColorSpace get_color_space() = 0; - virtual GammaCurve get_gamma_curve() = 0; + virtual unsigned get_width() const = 0; + virtual unsigned get_height() const = 0; + virtual Colorspace get_color_space() const = 0; + virtual GammaCurve get_gamma_curve() const = 0; }; -#endif // !defined(_INPUT_H) +} // namespace movit + +#endif // !defined(_MOVIT_INPUT_H)