FlatInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height);
~FlatInput();
FlatInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height);
~FlatInput();
// On desktop OpenGL, there's also GL_SLUMINANCE8 which could give us
// support for single-channel sRGB decoding, but it's not supported
// on GLES, and we're already actively rewriting single-channel inputs
// to GL_RED (even on desktop), so we stick to 3- and 4-channel inputs.
// On desktop OpenGL, there's also GL_SLUMINANCE8 which could give us
// support for single-channel sRGB decoding, but it's not supported
// on GLES, and we're already actively rewriting single-channel inputs
// to GL_RED (even on desktop), so we stick to 3- and 4-channel inputs.
(pixel_format == FORMAT_RGB ||
pixel_format == FORMAT_RGBA_POSTMULTIPLIED_ALPHA) &&
(image_format.gamma_curve == GAMMA_LINEAR ||
image_format.gamma_curve == GAMMA_sRGB));
}
(pixel_format == FORMAT_RGB ||
pixel_format == FORMAT_RGBA_POSTMULTIPLIED_ALPHA) &&
(image_format.gamma_curve == GAMMA_LINEAR ||
image_format.gamma_curve == GAMMA_sRGB));
}
- unsigned get_width() const { return width; }
- unsigned get_height() const { return height; }
- Colorspace get_color_space() const { return image_format.color_space; }
- GammaCurve get_gamma_curve() const { return image_format.gamma_curve; }
- virtual bool is_single_texture() const { return true; }
+ unsigned get_width() const override { return width; }
+ unsigned get_height() const override { return height; }
+ Colorspace get_color_space() const override { return image_format.color_space; }
+ GammaCurve get_gamma_curve() const override { return image_format.gamma_curve; }
+ bool is_single_texture() const override { return true; }
// Tells the input where to fetch the actual pixel data. Note that if you change
// this data, you must either call set_pixel_data() again (using the same pointer
// Tells the input where to fetch the actual pixel data. Note that if you change
// this data, you must either call set_pixel_data() again (using the same pointer
// NOTE: The input does not take ownership of this texture; you are responsible
// for releasing it yourself. In particular, if you call invalidate_pixel_data()
// or anything calling it, the texture will silently be removed from the input.
// NOTE: The input does not take ownership of this texture; you are responsible
// for releasing it yourself. In particular, if you call invalidate_pixel_data()
// or anything calling it, the texture will silently be removed from the input.