From 39b6975420669958ed9f4013440aea415134a902 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 23 Nov 2017 18:50:14 +0100 Subject: [PATCH] Use C++11 override everywhere it is appropriate. --- alpha_division_effect.h | 6 +- alpha_multiplication_effect.h | 6 +- blur_effect.h | 46 ++++----- colorspace_conversion_effect.h | 10 +- complex_modulate_effect.h | 22 ++-- deconvolution_sharpen_effect.h | 12 +-- deinterlace_effect.h | 48 ++++----- diffusion_effect.h | 20 ++-- dither_effect.h | 10 +- effect_chain.cpp | 4 +- effect_chain_test.cpp | 150 ++++++++++++++-------------- fft_convolution_effect.h | 6 +- fft_input.h | 26 ++--- fft_pass_effect.h | 20 ++-- flat_input.h | 22 ++-- gamma_compression_effect.h | 12 +-- gamma_expansion_effect.h | 14 +-- glow_effect.h | 20 ++-- input.h | 2 +- lift_gamma_gain_effect.h | 10 +- luma_mix_effect.h | 16 +-- mirror_effect.h | 12 +-- mix_effect.h | 10 +- multiply_effect.h | 6 +- overlay_effect.h | 12 +-- padding_effect.h | 28 +++--- resample_effect.h | 38 +++---- resize_effect.h | 16 +-- sandbox_effect.h | 6 +- saturation_effect.h | 8 +- slice_effect.h | 22 ++-- unsharp_mask_effect.h | 12 +-- vignette_effect.h | 14 +-- white_balance_effect.h | 10 +- ycbcr_422interleaved_input.h | 27 ++--- ycbcr_422interleaved_input_test.cpp | 10 +- ycbcr_conversion_effect.h | 10 +- ycbcr_input.h | 26 ++--- ycbcr_input_test.cpp | 12 +-- 39 files changed, 380 insertions(+), 381 deletions(-) diff --git a/alpha_division_effect.h b/alpha_division_effect.h index 2fd9082..9258171 100644 --- a/alpha_division_effect.h +++ b/alpha_division_effect.h @@ -12,9 +12,9 @@ namespace movit { class AlphaDivisionEffect : public Effect { public: AlphaDivisionEffect() {} - virtual std::string effect_type_id() const { return "AlphaDivisionEffect"; } - std::string output_fragment_shader(); - virtual bool one_to_one_sampling() const { return true; } + std::string effect_type_id() const override { return "AlphaDivisionEffect"; } + std::string output_fragment_shader() override; + bool one_to_one_sampling() const override { return true; } }; } // namespace movit diff --git a/alpha_multiplication_effect.h b/alpha_multiplication_effect.h index f342719..85f08f8 100644 --- a/alpha_multiplication_effect.h +++ b/alpha_multiplication_effect.h @@ -12,9 +12,9 @@ namespace movit { class AlphaMultiplicationEffect : public Effect { public: AlphaMultiplicationEffect() {} - virtual std::string effect_type_id() const { return "AlphaMultiplicationEffect"; } - std::string output_fragment_shader(); - virtual bool one_to_one_sampling() const { return true; } + std::string effect_type_id() const override { return "AlphaMultiplicationEffect"; } + std::string output_fragment_shader() override; + bool one_to_one_sampling() const override { return true; } }; } // namespace movit diff --git a/blur_effect.h b/blur_effect.h index 69bd663..6224ac3 100644 --- a/blur_effect.h +++ b/blur_effect.h @@ -31,26 +31,26 @@ class BlurEffect : public Effect { public: BlurEffect(); - virtual std::string effect_type_id() const { return "BlurEffect"; } + std::string effect_type_id() const override { return "BlurEffect"; } // We want this for the same reason as ResizeEffect; we could end up scaling // down quite a lot. - virtual bool needs_texture_bounce() const { return true; } - virtual bool needs_mipmaps() const { return true; } - virtual bool needs_srgb_primaries() const { return false; } + bool needs_texture_bounce() const override { return true; } + bool needs_mipmaps() const override { return true; } + bool needs_srgb_primaries() const override { return false; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; - virtual std::string output_fragment_shader() { + std::string output_fragment_shader() override { assert(false); } - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) { + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override { assert(false); } - virtual void rewrite_graph(EffectChain *graph, Node *self); - virtual bool set_float(const std::string &key, float value); - virtual bool set_int(const std::string &key, int value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_float(const std::string &key, float value) override; + bool set_int(const std::string &key, int value) override; private: void update_radius(); @@ -67,33 +67,33 @@ public: // so that it can make reasonable decisions for both blur passes. SingleBlurPassEffect(BlurEffect *parent); virtual ~SingleBlurPassEffect(); - virtual std::string effect_type_id() const { return "SingleBlurPassEffect"; } + std::string effect_type_id() const override { return "SingleBlurPassEffect"; } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; - virtual bool needs_texture_bounce() const { return true; } - virtual bool needs_mipmaps() const { return true; } - virtual bool needs_srgb_primaries() const { return false; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + bool needs_texture_bounce() const override { return true; } + bool needs_mipmaps() const override { return true; } + bool needs_srgb_primaries() const override { return false; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) { + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override { if (parent != nullptr) { parent->inform_input_size(input_num, width, height); } } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return true; } - virtual bool one_to_one_sampling() const { return false; } // Can sample outside the border. + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return true; } + bool one_to_one_sampling() const override { return false; } // Can sample outside the border. - virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const { + void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override { *width = this->width; *height = this->height; *virtual_width = this->virtual_width; *virtual_height = this->virtual_height; } - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); - void clear_gl_state(); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + void clear_gl_state() override; enum Direction { HORIZONTAL = 0, VERTICAL = 1 }; diff --git a/colorspace_conversion_effect.h b/colorspace_conversion_effect.h index 92bad1f..d875465 100644 --- a/colorspace_conversion_effect.h +++ b/colorspace_conversion_effect.h @@ -23,12 +23,12 @@ private: friend class EffectChain; public: - virtual std::string effect_type_id() const { return "ColorspaceConversionEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "ColorspaceConversionEffect"; } + std::string output_fragment_shader() override; - virtual bool needs_srgb_primaries() const { return false; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_srgb_primaries() const override { return false; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } // Get a conversion matrix from the given color space to XYZ. static Eigen::Matrix3d get_xyz_matrix(Colorspace space); diff --git a/complex_modulate_effect.h b/complex_modulate_effect.h index 335c900..45f8dde 100644 --- a/complex_modulate_effect.h +++ b/complex_modulate_effect.h @@ -33,23 +33,23 @@ class EffectChain; class ComplexModulateEffect : public Effect { public: ComplexModulateEffect(); - virtual std::string effect_type_id() const { return "ComplexModulateEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "ComplexModulateEffect"; } + std::string output_fragment_shader() override; // Technically we only need texture bounce for the second input // (to be allowed to mess with its sampler state), but there's // no way of expressing that currently. - virtual bool needs_texture_bounce() const { return true; } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } + bool needs_texture_bounce() const override { return true; } + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const; - virtual unsigned num_inputs() const { return 2; } - virtual void inform_added(EffectChain *chain) { this->chain = chain; } + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override; + unsigned num_inputs() const override { return 2; } + void inform_added(EffectChain *chain) override { this->chain = chain; } - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: EffectChain *chain; diff --git a/deconvolution_sharpen_effect.h b/deconvolution_sharpen_effect.h index c2ccbcb..d7800df 100644 --- a/deconvolution_sharpen_effect.h +++ b/deconvolution_sharpen_effect.h @@ -31,20 +31,20 @@ class DeconvolutionSharpenEffect : public Effect { public: DeconvolutionSharpenEffect(); virtual ~DeconvolutionSharpenEffect(); - virtual std::string effect_type_id() const { return "DeconvolutionSharpenEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "DeconvolutionSharpenEffect"; } + std::string output_fragment_shader() override; // Samples a lot of times from its input. - virtual bool needs_texture_bounce() const { return true; } + bool needs_texture_bounce() const override { return true; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override { this->width = width; this->height = height; } - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } private: // Input size. diff --git a/deinterlace_effect.h b/deinterlace_effect.h index 5841f86..773d6ad 100644 --- a/deinterlace_effect.h +++ b/deinterlace_effect.h @@ -64,15 +64,15 @@ class DeinterlaceComputeEffect; class DeinterlaceEffect : public Effect { public: DeinterlaceEffect(); - virtual std::string effect_type_id() const { return "DeinterlaceEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "DeinterlaceEffect"; } + std::string output_fragment_shader() override; // Replaces itself with DeinterlaceComputeEffect if compute shaders are supported. // Otherwise, does nothing. - void rewrite_graph(EffectChain *graph, Node *self); - bool set_int(const std::string &key, int value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_int(const std::string &key, int value) override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; // First = before previous, second = previous, third = current, // fourth = next, fifth = after next. These are treated symmetrically, @@ -80,15 +80,15 @@ public: // // Note that if you have interlaced _frames_ and not _fields_, you will // need to pull them apart first, for instance with SliceEffect. - virtual unsigned num_inputs() const { return 5; } - virtual bool needs_texture_bounce() const { return true; } - virtual bool changes_output_size() const { return true; } + unsigned num_inputs() const override { return 5; } + bool needs_texture_bounce() const override { return true; } + bool changes_output_size() const override { return true; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const; + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override; enum FieldPosition { TOP = 0, BOTTOM = 1 }; @@ -136,22 +136,22 @@ private: class DeinterlaceComputeEffect : public Effect { public: DeinterlaceComputeEffect(); - virtual std::string effect_type_id() const { return "DeinterlaceComputeEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "DeinterlaceComputeEffect"; } + std::string output_fragment_shader() override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; - virtual unsigned num_inputs() const { return 5; } - virtual bool changes_output_size() const { return true; } - virtual bool is_compute_shader() const { return true; } - virtual void get_compute_dimensions(unsigned output_width, unsigned output_height, - unsigned *x, unsigned *y, unsigned *z) const; + unsigned num_inputs() const override { return 5; } + bool changes_output_size() const override { return true; } + bool is_compute_shader() const override { return true; } + void get_compute_dimensions(unsigned output_width, unsigned output_height, + unsigned *x, unsigned *y, unsigned *z) const override; - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const; + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override; enum FieldPosition { TOP = 0, BOTTOM = 1 }; diff --git a/diffusion_effect.h b/diffusion_effect.h index 77625ae..253126e 100644 --- a/diffusion_effect.h +++ b/diffusion_effect.h @@ -29,15 +29,15 @@ class DiffusionEffect : public Effect { public: DiffusionEffect(); ~DiffusionEffect(); - virtual std::string effect_type_id() const { return "DiffusionEffect"; } + std::string effect_type_id() const override { return "DiffusionEffect"; } - virtual void rewrite_graph(EffectChain *graph, Node *self); - virtual bool set_float(const std::string &key, float value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_float(const std::string &key, float value) override; - virtual std::string output_fragment_shader() { + std::string output_fragment_shader() override { assert(false); } - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) { + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override { assert(false); } @@ -52,12 +52,12 @@ private: class OverlayMatteEffect : public Effect { public: OverlayMatteEffect(); - virtual std::string effect_type_id() const { return "OverlayMatteEffect"; } - std::string output_fragment_shader(); - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + std::string effect_type_id() const override { return "OverlayMatteEffect"; } + std::string output_fragment_shader() override; + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - unsigned num_inputs() const { return 2; } - virtual bool one_to_one_sampling() const { return true; } + unsigned num_inputs() const override { return 2; } + bool one_to_one_sampling() const override { return true; } private: float blurred_mix_amount; diff --git a/dither_effect.h b/dither_effect.h index 921a1ef..71bb6d3 100644 --- a/dither_effect.h +++ b/dither_effect.h @@ -59,16 +59,16 @@ private: public: ~DitherEffect(); - virtual std::string effect_type_id() const { return "DitherEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "DitherEffect"; } + std::string output_fragment_shader() override; // Note that if we did error diffusion, we'd actually want to diffuse the // premultiplied error. However, we need to do dithering in the same // space as quantization, whether that be pre- or postmultiply. - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: void update_texture(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); diff --git a/effect_chain.cpp b/effect_chain.cpp index c9d746f..23156cb 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -38,8 +38,8 @@ namespace { class IdentityEffect : public Effect { public: IdentityEffect() {} - virtual string effect_type_id() const { return "IdentityEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } + string effect_type_id() const override { return "IdentityEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } }; } // namespace diff --git a/effect_chain_test.cpp b/effect_chain_test.cpp index 63f574b..92fe52b 100644 --- a/effect_chain_test.cpp +++ b/effect_chain_test.cpp @@ -42,8 +42,8 @@ TEST(EffectChainTest, EmptyChain) { class IdentityEffect : public Effect { public: IdentityEffect() {} - virtual string effect_type_id() const { return "IdentityEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } + string effect_type_id() const override { return "IdentityEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } }; TEST(EffectChainTest, Identity) { @@ -63,10 +63,10 @@ TEST(EffectChainTest, Identity) { class BouncingIdentityEffect : public Effect { public: BouncingIdentityEffect() {} - virtual string effect_type_id() const { return "IdentityEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } - bool needs_texture_bounce() const { return true; } - AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + string effect_type_id() const override { return "IdentityEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } + bool needs_texture_bounce() const override { return true; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } }; TEST(EffectChainTest, TextureBouncePreservesIdentity) { @@ -122,12 +122,12 @@ TEST(EffectChainTest, TopLeftOrigin) { class InvertEffect : public Effect { public: InvertEffect() {} - virtual string effect_type_id() const { return "InvertEffect"; } - string output_fragment_shader() { return read_file("invert_effect.frag"); } + string effect_type_id() const override { return "InvertEffect"; } + string output_fragment_shader() override { return read_file("invert_effect.frag"); } // A real invert would actually care about its alpha, // but in this unit test, it only complicates things. - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } }; // Like IdentityEffect, but rewrites itself out of the loop, @@ -137,9 +137,9 @@ template class RewritingEffect : public Effect { public: RewritingEffect() : effect(new T()), replaced_node(nullptr) {} - virtual string effect_type_id() const { return "RewritingEffect[" + effect->effect_type_id() + "]"; } - string output_fragment_shader() { EXPECT_TRUE(false); return read_file("identity.frag"); } - virtual void rewrite_graph(EffectChain *graph, Node *self) { + string effect_type_id() const override { return "RewritingEffect[" + effect->effect_type_id() + "]"; } + string output_fragment_shader() override { EXPECT_TRUE(false); return read_file("identity.frag"); } + void rewrite_graph(EffectChain *graph, Node *self) override { replaced_node = graph->add_node(effect); graph->replace_receiver(self, replaced_node); graph->replace_sender(self, replaced_node); @@ -235,7 +235,7 @@ public: : FlatInput(format, pixel_format, type, width, height), overridden_color_space(format.color_space), overridden_gamma_curve(format.gamma_curve) {} - virtual string effect_type_id() const { return "UnknownColorspaceInput"; } + string effect_type_id() const override { return "UnknownColorspaceInput"; } void set_color_space(Colorspace colorspace) { overridden_color_space = colorspace; @@ -243,8 +243,8 @@ public: void set_gamma_curve(GammaCurve gamma_curve) { overridden_gamma_curve = gamma_curve; } - Colorspace get_color_space() const { return overridden_color_space; } - GammaCurve get_gamma_curve() const { return overridden_gamma_curve; } + Colorspace get_color_space() const override { return overridden_color_space; } + GammaCurve get_gamma_curve() const override { return overridden_gamma_curve; } private: Colorspace overridden_color_space; @@ -420,15 +420,14 @@ TEST(EffectChainTest, NoAlphaConversionsWhenPremultipliedAlphaNotNeeded) { class BlueInput : public Input { public: BlueInput() { register_int("needs_mipmaps", &needs_mipmaps); } - virtual string effect_type_id() const { return "IdentityEffect"; } - string output_fragment_shader() { return read_file("blue.frag"); } - virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; } - virtual void finalize() {} - virtual bool can_output_linear_gamma() const { return true; } - virtual unsigned get_width() const { return 1; } - virtual unsigned get_height() const { return 1; } - virtual Colorspace get_color_space() const { return COLORSPACE_sRGB; } - virtual GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; } + string effect_type_id() const override { return "IdentityEffect"; } + string output_fragment_shader() override { return read_file("blue.frag"); } + AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; } + bool can_output_linear_gamma() const override { return true; } + unsigned get_width() const override { return 1; } + unsigned get_height() const override { return 1; } + Colorspace get_color_space() const override { return COLORSPACE_sRGB; } + GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; } private: int needs_mipmaps; @@ -439,9 +438,9 @@ private: class RewritingToBlueInput : public Input { public: RewritingToBlueInput() : blue_node(nullptr) { register_int("needs_mipmaps", &needs_mipmaps); } - virtual string effect_type_id() const { return "RewritingToBlueInput"; } - string output_fragment_shader() { EXPECT_TRUE(false); return read_file("identity.frag"); } - virtual void rewrite_graph(EffectChain *graph, Node *self) { + string effect_type_id() const override { return "RewritingToBlueInput"; } + string output_fragment_shader() override { EXPECT_TRUE(false); return read_file("identity.frag"); } + void rewrite_graph(EffectChain *graph, Node *self) override { Node *blue_node = graph->add_node(new BlueInput()); graph->replace_receiver(self, blue_node); graph->replace_sender(self, blue_node); @@ -452,13 +451,12 @@ public: // Dummy values that we need to implement because we inherit from Input. // Same as BlueInput. - virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; } - virtual void finalize() {} - virtual bool can_output_linear_gamma() const { return true; } - virtual unsigned get_width() const { return 1; } - virtual unsigned get_height() const { return 1; } - virtual Colorspace get_color_space() const { return COLORSPACE_sRGB; } - virtual GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; } + AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; } + bool can_output_linear_gamma() const override { return true; } + unsigned get_width() const override { return 1; } + unsigned get_height() const override { return 1; } + Colorspace get_color_space() const override { return COLORSPACE_sRGB; } + GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; } Node *blue_node; @@ -490,9 +488,9 @@ TEST(EffectChainTest, NoAlphaConversionsWithBlankAlpha) { class BlankAlphaPreservingEffect : public Effect { public: BlankAlphaPreservingEffect() {} - virtual string effect_type_id() const { return "BlankAlphaPreservingEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + string effect_type_id() const override { return "BlankAlphaPreservingEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } }; TEST(EffectChainTest, NoAlphaConversionsWithBlankAlphaPreservingEffect) { @@ -549,16 +547,16 @@ TEST(EffectChainTest, AlphaConversionsWithNonBlankAlphaPreservingEffect) { class MipmapNeedingEffect : public Effect { public: MipmapNeedingEffect() {} - virtual bool needs_mipmaps() const { return true; } + bool needs_mipmaps() const override { return true; } // To be allowed to mess with the sampler state. - virtual bool needs_texture_bounce() const { return true; } + bool needs_texture_bounce() const override { return true; } - virtual string effect_type_id() const { return "MipmapNeedingEffect"; } - string output_fragment_shader() { return read_file("mipmap_needing_effect.frag"); } - virtual void inform_added(EffectChain *chain) { this->chain = chain; } + string effect_type_id() const override { return "MipmapNeedingEffect"; } + string output_fragment_shader() override { return read_file("mipmap_needing_effect.frag"); } + void inform_added(EffectChain *chain) override { this->chain = chain; } - void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) + void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) override { Node *self = chain->find_node_for_effect(this); glActiveTexture(chain->get_input_sampler(self, 0)); @@ -629,8 +627,8 @@ public: NonMipmapCapableInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height) : FlatInput(format, pixel_format, type, width, height) {} - virtual bool can_supply_mipmaps() const { return false; } - bool set_int(const std::string& key, int value) { + bool can_supply_mipmaps() const override { return false; } + bool set_int(const std::string& key, int value) override { if (key == "needs_mipmaps") { assert(value == 0); } @@ -761,10 +759,10 @@ TEST(EffectChainTest, ResizeDownByFourThenUpByFour) { class AddEffect : public Effect { public: AddEffect() {} - virtual string effect_type_id() const { return "AddEffect"; } - string output_fragment_shader() { return read_file("add.frag"); } - virtual unsigned num_inputs() const { return 2; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + string effect_type_id() const override { return "AddEffect"; } + string output_fragment_shader() override { return read_file("add.frag"); } + unsigned num_inputs() const override { return 2; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } }; // Constructs the graph @@ -937,12 +935,12 @@ TEST(EffectChainTest, EffectUsedTwiceOnlyGetsOneColorspaceConversion) { class SizeStoringEffect : public BouncingIdentityEffect { public: SizeStoringEffect() : input_width(-1), input_height(-1) {} - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) { + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override { assert(input_num == 0); input_width = width; input_height = height; } - virtual string effect_type_id() const { return "SizeStoringEffect"; } + string effect_type_id() const override { return "SizeStoringEffect"; } int input_width, input_height; }; @@ -1063,13 +1061,13 @@ public: height(height), virtual_width(virtual_width), virtual_height(virtual_height) {} - virtual string effect_type_id() const { return "VirtualResizeEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } + string effect_type_id() const override { return "VirtualResizeEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } - virtual bool changes_output_size() const { return true; } + bool changes_output_size() const override { return true; } - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const { + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override { *width = this->width; *height = this->height; *virtual_width = this->virtual_width; @@ -1111,17 +1109,17 @@ class NonVirtualResizeEffect : public VirtualResizeEffect { public: NonVirtualResizeEffect(int width, int height) : VirtualResizeEffect(width, height, width, height) {} - virtual string effect_type_id() const { return "NonVirtualResizeEffect"; } - virtual bool sets_virtual_output_size() const { return false; } + string effect_type_id() const override { return "NonVirtualResizeEffect"; } + bool sets_virtual_output_size() const override { return false; } }; // An effect that promises one-to-one sampling (unlike IdentityEffect). class OneToOneEffect : public Effect { public: OneToOneEffect() {} - virtual string effect_type_id() const { return "OneToOneEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } - virtual bool one_to_one_sampling() const { return true; } + string effect_type_id() const override { return "OneToOneEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } + bool one_to_one_sampling() const override { return true; } }; TEST(EffectChainTest, NoBounceWithOneToOneSampling) { @@ -1263,8 +1261,8 @@ TEST(EffectChainTest, IdentityWithOwnPool) { class PrintfingBlueEffect : public Effect { public: PrintfingBlueEffect() {} - virtual string effect_type_id() const { return "PrintfingBlueEffect"; } - string output_fragment_shader() { + string effect_type_id() const override { return "PrintfingBlueEffect"; } + string output_fragment_shader() override { stringstream ss; ss.imbue(locale("C")); ss.precision(8); @@ -1308,9 +1306,9 @@ TEST(EffectChainTest, StringStreamLocalesWork) { class IdentityComputeEffect : public Effect { public: IdentityComputeEffect() {} - virtual string effect_type_id() const { return "IdentityComputeEffect"; } - virtual bool is_compute_shader() const { return true; } - string output_fragment_shader() { return read_file("identity.comp"); } + string effect_type_id() const override { return "IdentityComputeEffect"; } + bool is_compute_shader() const override { return true; } + string output_fragment_shader() override { return read_file("identity.comp"); } }; class WithAndWithoutComputeShaderTest : public testing::TestWithParam { @@ -1343,19 +1341,19 @@ TEST(EffectChainTest, sRGBIntermediate) { class PassThroughEffect : public IdentityEffect { public: PassThroughEffect() {} - virtual string effect_type_id() const { return "PassThroughEffect"; } - virtual bool needs_linear_light() const { return false; } - AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + string effect_type_id() const override { return "PassThroughEffect"; } + bool needs_linear_light() const override { return false; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } }; // Same, just also bouncing. class BouncingPassThroughEffect : public BouncingIdentityEffect { public: BouncingPassThroughEffect() {} - virtual string effect_type_id() const { return "BouncingPassThroughEffect"; } - virtual bool needs_linear_light() const { return false; } - bool needs_texture_bounce() const { return true; } - AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + string effect_type_id() const override { return "BouncingPassThroughEffect"; } + bool needs_linear_light() const override { return false; } + bool needs_texture_bounce() const override { return true; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } }; TEST(EffectChainTest, Linear10bitIntermediateAccuracy) { @@ -1443,11 +1441,11 @@ TEST(EffectChainTest, SquareRootIntermediateIsTurnedOffForNonLinearData) { class RecordingIdentityEffect : public Effect { public: RecordingIdentityEffect() {} - virtual string effect_type_id() const { return "RecordingIdentityEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } + string effect_type_id() const override { return "RecordingIdentityEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } GLuint last_glsl_program_num; - void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) + void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override { last_glsl_program_num = glsl_program_num; } diff --git a/fft_convolution_effect.h b/fft_convolution_effect.h index e19a804..cbd0120 100644 --- a/fft_convolution_effect.h +++ b/fft_convolution_effect.h @@ -86,9 +86,9 @@ class FFTConvolutionEffect : public Effect { public: FFTConvolutionEffect(int input_width, int input_height, int convolve_width, int convolve_height); ~FFTConvolutionEffect(); - virtual std::string effect_type_id() const { return "FFTConvolutionEffect"; } - std::string output_fragment_shader() { assert(false); } - virtual void rewrite_graph(EffectChain *graph, Node *self); + std::string effect_type_id() const override { return "FFTConvolutionEffect"; } + std::string output_fragment_shader() override { assert(false); } + void rewrite_graph(EffectChain *graph, Node *self) override; // See FFTInput::set_pixel_data(). void set_convolution_kernel(const float *pixel_data) diff --git a/fft_input.h b/fft_input.h index 472a218..0e36eca 100644 --- a/fft_input.h +++ b/fft_input.h @@ -32,23 +32,23 @@ public: FFTInput(unsigned width, unsigned height); ~FFTInput(); - virtual std::string effect_type_id() const { return "FFTInput"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "FFTInput"; } + std::string output_fragment_shader() override; // FFTs the data and uploads the texture if it has changed since last time. - void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override; - unsigned get_width() const { return fft_width; } - unsigned get_height() const { return fft_height; } + unsigned get_width() const override { return fft_width; } + unsigned get_height() const override { return fft_height; } // Strictly speaking, FFT data doesn't have any colorspace or gamma; // these values are the Movit standards for “do nothing”. - Colorspace get_color_space() const { return COLORSPACE_sRGB; } - GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; } - virtual AlphaHandling alpha_handling() const { return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA; } - virtual bool is_single_texture() const { return true; } - virtual bool can_output_linear_gamma() const { return true; } - virtual bool can_supply_mipmaps() const { return false; } + Colorspace get_color_space() const override { return COLORSPACE_sRGB; } + GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; } + AlphaHandling alpha_handling() const override { return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA; } + bool is_single_texture() const override { return true; } + bool can_output_linear_gamma() const override { return true; } + bool can_supply_mipmaps() const override { return false; } // 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 @@ -62,12 +62,12 @@ public: void invalidate_pixel_data(); - virtual void inform_added(EffectChain *chain) + void inform_added(EffectChain *chain) override { resource_pool = chain->get_resource_pool(); } - virtual bool set_int(const std::string& key, int value); + bool set_int(const std::string& key, int value) override; private: GLuint texture_num; diff --git a/fft_pass_effect.h b/fft_pass_effect.h index 53428bd..a09304d 100644 --- a/fft_pass_effect.h +++ b/fft_pass_effect.h @@ -63,7 +63,7 @@ class FFTPassEffect : public Effect { public: FFTPassEffect(); ~FFTPassEffect(); - virtual std::string effect_type_id() const { + std::string effect_type_id() const override { char buf[256]; if (inverse) { snprintf(buf, sizeof(buf), "IFFTPassEffect[%d]", (1 << pass_number)); @@ -72,9 +72,9 @@ public: } return buf; } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; // We don't actually change the output size, but this flag makes sure // that no other effect is chained after us. This is important since @@ -83,24 +83,24 @@ public: // mode to GL_NEAREST, which other effects are not ready for; so, the // combination of these two flags guarantee that we're run entirely alone // in our own phase, which is exactly what we want. - virtual bool needs_texture_bounce() const { return true; } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } + bool needs_texture_bounce() const override { return true; } + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override { assert(input_num == 0); input_width = width; input_height = height; } - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const { + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override { *width = *virtual_width = input_width; *height = *virtual_height = input_height; } - virtual void inform_added(EffectChain *chain) { this->chain = chain; } + void inform_added(EffectChain *chain) override { this->chain = chain; } enum Direction { INVALID = -1, HORIZONTAL = 0, VERTICAL = 1 }; diff --git a/flat_input.h b/flat_input.h index 06cc6ab..eb9fff3 100644 --- a/flat_input.h +++ b/flat_input.h @@ -22,9 +22,9 @@ public: FlatInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height); ~FlatInput(); - virtual std::string effect_type_id() const { return "FlatInput"; } + std::string effect_type_id() const override { return "FlatInput"; } - virtual bool can_output_linear_gamma() const { + bool can_output_linear_gamma() const override { // 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 @@ -35,7 +35,7 @@ public: (image_format.gamma_curve == GAMMA_LINEAR || image_format.gamma_curve == GAMMA_sRGB)); } - virtual AlphaHandling alpha_handling() const { + AlphaHandling alpha_handling() const override { switch (pixel_format) { case FORMAT_RGBA_PREMULTIPLIED_ALPHA: return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA; @@ -50,16 +50,16 @@ public: } } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; // Uploads the texture if it has changed since last time. - void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override; - 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 @@ -149,7 +149,7 @@ public: this->owns_texture = false; } - virtual void inform_added(EffectChain *chain) + void inform_added(EffectChain *chain) override { resource_pool = chain->get_resource_pool(); } diff --git a/gamma_compression_effect.h b/gamma_compression_effect.h index d522911..f9c3297 100644 --- a/gamma_compression_effect.h +++ b/gamma_compression_effect.h @@ -24,16 +24,16 @@ private: friend class EffectChain; public: - virtual std::string effect_type_id() const { return "GammaCompressionEffect"; } - std::string output_fragment_shader(); - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + std::string effect_type_id() const override { return "GammaCompressionEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; - virtual bool needs_srgb_primaries() const { return false; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_srgb_primaries() const override { return false; } + bool one_to_one_sampling() const override { return true; } // Actually needs postmultiplied input as well as outputting it. // EffectChain will take care of that. - virtual AlphaHandling alpha_handling() const { return OUTPUT_POSTMULTIPLIED_ALPHA; } + AlphaHandling alpha_handling() const override { return OUTPUT_POSTMULTIPLIED_ALPHA; } private: GammaCurve destination_curve; diff --git a/gamma_expansion_effect.h b/gamma_expansion_effect.h index 429bd25..c4968b2 100644 --- a/gamma_expansion_effect.h +++ b/gamma_expansion_effect.h @@ -24,17 +24,17 @@ private: friend class EffectChain; public: - virtual std::string effect_type_id() const { return "GammaExpansionEffect"; } - std::string output_fragment_shader(); - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + std::string effect_type_id() const override { return "GammaExpansionEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; - virtual bool needs_linear_light() const { return false; } - virtual bool needs_srgb_primaries() const { return false; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_linear_light() const override { return false; } + bool needs_srgb_primaries() const override { return false; } + bool one_to_one_sampling() const override { return true; } // Actually processes its input in a nonlinear fashion, // but does not touch alpha, and we are a special case anyway. - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } private: GammaCurve source_curve; diff --git a/glow_effect.h b/glow_effect.h index 02520d7..e159999 100644 --- a/glow_effect.h +++ b/glow_effect.h @@ -21,17 +21,17 @@ class Node; class GlowEffect : public Effect { public: GlowEffect(); - virtual std::string effect_type_id() const { return "GlowEffect"; } + std::string effect_type_id() const override { return "GlowEffect"; } - virtual bool needs_srgb_primaries() const { return false; } + bool needs_srgb_primaries() const override { return false; } - virtual void rewrite_graph(EffectChain *graph, Node *self); - virtual bool set_float(const std::string &key, float value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_float(const std::string &key, float value) override; - virtual std::string output_fragment_shader() { + std::string output_fragment_shader() override { assert(false); } - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) { + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override { assert(false); } @@ -48,11 +48,11 @@ private: class HighlightCutoffEffect : public Effect { public: HighlightCutoffEffect(); - virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "HighlightCutoffEffect"; } + std::string output_fragment_shader() override; - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual bool one_to_one_sampling() const { return true; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + bool one_to_one_sampling() const override { return true; } private: float cutoff; diff --git a/input.h b/input.h index 08f18da..6c9fca1 100644 --- a/input.h +++ b/input.h @@ -17,7 +17,7 @@ namespace movit { // 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” diff --git a/lift_gamma_gain_effect.h b/lift_gamma_gain_effect.h index 7967448..19d9b20 100644 --- a/lift_gamma_gain_effect.h +++ b/lift_gamma_gain_effect.h @@ -30,12 +30,12 @@ namespace movit { class LiftGammaGainEffect : public Effect { public: LiftGammaGainEffect(); - virtual std::string effect_type_id() const { return "LiftGammaGainEffect"; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual bool one_to_one_sampling() const { return true; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "LiftGammaGainEffect"; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + bool one_to_one_sampling() const override { return true; } + std::string output_fragment_shader() override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: RGBTriplet lift, gamma, gain; diff --git a/luma_mix_effect.h b/luma_mix_effect.h index 3ff81bf..fec402f 100644 --- a/luma_mix_effect.h +++ b/luma_mix_effect.h @@ -20,14 +20,14 @@ namespace movit { class LumaMixEffect : public Effect { public: LumaMixEffect(); - virtual std::string effect_type_id() const { return "LumaMixEffect"; } - std::string output_fragment_shader(); - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); - - virtual bool needs_srgb_primaries() const { return false; } - virtual unsigned num_inputs() const { return 3; } - virtual bool one_to_one_sampling() const { return true; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + std::string effect_type_id() const override { return "LumaMixEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + + bool needs_srgb_primaries() const override { return false; } + unsigned num_inputs() const override { return 3; } + bool one_to_one_sampling() const override { return true; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } private: float transition_width, progress; diff --git a/mirror_effect.h b/mirror_effect.h index d9c3f71..da3a711 100644 --- a/mirror_effect.h +++ b/mirror_effect.h @@ -12,13 +12,13 @@ namespace movit { class MirrorEffect : public Effect { public: MirrorEffect(); - virtual std::string effect_type_id() const { return "MirrorEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "MirrorEffect"; } + std::string output_fragment_shader() override; - virtual bool needs_linear_light() const { return false; } - virtual bool needs_srgb_primaries() const { return false; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_linear_light() const override { return false; } + bool needs_srgb_primaries() const override { return false; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } }; } // namespace movit diff --git a/mix_effect.h b/mix_effect.h index d891eb5..1305433 100644 --- a/mix_effect.h +++ b/mix_effect.h @@ -13,12 +13,12 @@ namespace movit { class MixEffect : public Effect { public: MixEffect(); - virtual std::string effect_type_id() const { return "MixEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "MixEffect"; } + std::string output_fragment_shader() override; - virtual bool needs_srgb_primaries() const { return false; } - virtual unsigned num_inputs() const { return 2; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_srgb_primaries() const override { return false; } + unsigned num_inputs() const override { return 2; } + bool one_to_one_sampling() const override { return true; } // TODO: In the common case where a+b=1, it would be useful to be able to set // alpha_handling() to INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK. However, right now diff --git a/multiply_effect.h b/multiply_effect.h index c017e06..9e3542d 100644 --- a/multiply_effect.h +++ b/multiply_effect.h @@ -16,9 +16,9 @@ namespace movit { class MultiplyEffect : public Effect { public: MultiplyEffect(); - virtual std::string effect_type_id() const { return "MultiplyEffect"; } - std::string output_fragment_shader(); - virtual bool one_to_one_sampling() const { return true; } + std::string effect_type_id() const override { return "MultiplyEffect"; } + std::string output_fragment_shader() override; + bool one_to_one_sampling() const override { return true; } private: RGBATuple factor; diff --git a/overlay_effect.h b/overlay_effect.h index 40a6fff..2f88d12 100644 --- a/overlay_effect.h +++ b/overlay_effect.h @@ -19,19 +19,19 @@ namespace movit { class OverlayEffect : public Effect { public: OverlayEffect(); - virtual std::string effect_type_id() const { return "OverlayEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "OverlayEffect"; } + std::string output_fragment_shader() override; - virtual bool needs_srgb_primaries() const { return false; } - virtual unsigned num_inputs() const { return 2; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_srgb_primaries() const override { return false; } + unsigned num_inputs() const override { return 2; } + bool one_to_one_sampling() const override { return true; } // Actually, if _either_ image has blank alpha, our output will have // blank alpha, too (this only tells the framework that having _both_ // images with blank alpha would result in blank alpha). // However, understanding that would require changes // to EffectChain, so postpone that optimization for later. - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } private: // If true, overlays input1 on top of input2 instead of vice versa. diff --git a/padding_effect.h b/padding_effect.h index d922944..4925764 100644 --- a/padding_effect.h +++ b/padding_effect.h @@ -36,18 +36,18 @@ namespace movit { class PaddingEffect : public Effect { public: PaddingEffect(); - virtual std::string effect_type_id() const { return "PaddingEffect"; } - std::string output_fragment_shader(); - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + std::string effect_type_id() const override { return "PaddingEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; - virtual bool needs_linear_light() const; - virtual bool needs_srgb_primaries() const; - virtual AlphaHandling alpha_handling() const; + bool needs_linear_light() const override; + bool needs_srgb_primaries() const override; + AlphaHandling alpha_handling() const override; - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } - virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const; - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } + void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override; + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; private: RGBATuple border_color; @@ -64,10 +64,10 @@ private: class IntegralPaddingEffect : public PaddingEffect { public: IntegralPaddingEffect(); - virtual std::string effect_type_id() const { return "IntegralPaddingEffect"; } - virtual bool one_to_one_sampling() const { return true; } - virtual bool set_int(const std::string&, int value); - virtual bool set_float(const std::string &key, float value); + std::string effect_type_id() const override { return "IntegralPaddingEffect"; } + bool one_to_one_sampling() const override { return true; } + bool set_int(const std::string&, int value) override; + bool set_float(const std::string &key, float value) override; }; } // namespace movit diff --git a/resample_effect.h b/resample_effect.h index 5906a3c..4cde466 100644 --- a/resample_effect.h +++ b/resample_effect.h @@ -51,24 +51,24 @@ public: ResampleEffect(); ~ResampleEffect(); - virtual std::string effect_type_id() const { return "ResampleEffect"; } + std::string effect_type_id() const override { return "ResampleEffect"; } // We want this for the same reason as ResizeEffect; we could end up scaling // down quite a lot. - virtual bool needs_texture_bounce() const { return true; } - virtual bool needs_srgb_primaries() const { return false; } + bool needs_texture_bounce() const override { return true; } + bool needs_srgb_primaries() const override { return false; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; - virtual std::string output_fragment_shader() { + std::string output_fragment_shader() override { assert(false); } - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) { + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override { assert(false); } - virtual void rewrite_graph(EffectChain *graph, Node *self); - virtual bool set_float(const std::string &key, float value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_float(const std::string &key, float value) override; private: void update_size(); @@ -92,29 +92,29 @@ public: // resolutions. SingleResamplePassEffect(ResampleEffect *parent); ~SingleResamplePassEffect(); - virtual std::string effect_type_id() const { return "SingleResamplePassEffect"; } + std::string effect_type_id() const override { return "SingleResamplePassEffect"; } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; - virtual bool needs_texture_bounce() const { return true; } - virtual bool needs_srgb_primaries() const { return false; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + bool needs_texture_bounce() const override { return true; } + bool needs_srgb_primaries() const override { return false; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual void inform_added(EffectChain *chain) { this->chain = chain; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) { + void inform_added(EffectChain *chain) override { this->chain = chain; } + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override { if (parent != nullptr) { parent->inform_input_size(input_num, width, height); } } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } - virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const { + void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override { *virtual_width = *width = this->output_width; *virtual_height = *height = this->output_height; } - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; enum Direction { HORIZONTAL = 0, VERTICAL = 1 }; diff --git a/resize_effect.h b/resize_effect.h index 61efd8d..9d23806 100644 --- a/resize_effect.h +++ b/resize_effect.h @@ -14,18 +14,18 @@ namespace movit { class ResizeEffect : public Effect { public: ResizeEffect(); - virtual std::string effect_type_id() const { return "ResizeEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "ResizeEffect"; } + std::string output_fragment_shader() override; // We want processing done pre-filtering and mipmapped, // in case we need to scale down a lot. - virtual bool needs_texture_bounce() const { return true; } - virtual bool needs_mipmaps() const { return true; } - virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + bool needs_texture_bounce() const override { return true; } + bool needs_mipmaps() const override { return true; } + AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } - virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const; + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } + void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override; private: int width, height; diff --git a/sandbox_effect.h b/sandbox_effect.h index 25c7992..530511a 100644 --- a/sandbox_effect.h +++ b/sandbox_effect.h @@ -18,10 +18,10 @@ namespace movit { class SandboxEffect : public Effect { public: SandboxEffect(); - virtual std::string effect_type_id() const { return "SandboxEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "SandboxEffect"; } + std::string output_fragment_shader() override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: float parm; diff --git a/saturation_effect.h b/saturation_effect.h index bf97572..7e108e8 100644 --- a/saturation_effect.h +++ b/saturation_effect.h @@ -16,10 +16,10 @@ namespace movit { class SaturationEffect : public Effect { public: SaturationEffect(); - virtual std::string effect_type_id() const { return "SaturationEffect"; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "SaturationEffect"; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } + std::string output_fragment_shader() override; private: float saturation; diff --git a/slice_effect.h b/slice_effect.h index ef96ddd..9886df7 100644 --- a/slice_effect.h +++ b/slice_effect.h @@ -20,17 +20,17 @@ namespace movit { class SliceEffect : public Effect { public: SliceEffect(); - virtual std::string effect_type_id() const { return "SliceEffect"; } - std::string output_fragment_shader(); - virtual bool needs_texture_bounce() const { return true; } - virtual bool changes_output_size() const { return true; } - virtual bool sets_virtual_output_size() const { return false; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const; - - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); - virtual void inform_added(EffectChain *chain) { this->chain = chain; } + std::string effect_type_id() const override { return "SliceEffect"; } + std::string output_fragment_shader() override; + bool needs_texture_bounce() const override { return true; } + bool changes_output_size() const override { return true; } + bool sets_virtual_output_size() const override { return false; } + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override; + + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + void inform_added(EffectChain *chain) override { this->chain = chain; } enum Direction { HORIZONTAL = 0, VERTICAL = 1 }; diff --git a/unsharp_mask_effect.h b/unsharp_mask_effect.h index 7a2052b..62b2bf6 100644 --- a/unsharp_mask_effect.h +++ b/unsharp_mask_effect.h @@ -26,17 +26,17 @@ class Node; class UnsharpMaskEffect : public Effect { public: UnsharpMaskEffect(); - virtual std::string effect_type_id() const { return "UnsharpMaskEffect"; } + std::string effect_type_id() const override { return "UnsharpMaskEffect"; } - virtual bool needs_srgb_primaries() const { return false; } + bool needs_srgb_primaries() const override { return false; } - virtual void rewrite_graph(EffectChain *graph, Node *self); - virtual bool set_float(const std::string &key, float value); + void rewrite_graph(EffectChain *graph, Node *self) override; + bool set_float(const std::string &key, float value) override; - virtual std::string output_fragment_shader() { + std::string output_fragment_shader() override { assert(false); } - virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) { + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override { assert(false); } diff --git a/vignette_effect.h b/vignette_effect.h index 926a5be..8a2229c 100644 --- a/vignette_effect.h +++ b/vignette_effect.h @@ -14,15 +14,15 @@ namespace movit { class VignetteEffect : public Effect { public: VignetteEffect(); - virtual std::string effect_type_id() const { return "VignetteEffect"; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "VignetteEffect"; } + std::string output_fragment_shader() override; - virtual bool needs_srgb_primaries() const { return false; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + bool needs_srgb_primaries() const override { return false; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } - virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void inform_input_size(unsigned input_num, unsigned width, unsigned height) override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: Point2D center; diff --git a/white_balance_effect.h b/white_balance_effect.h index 2370847..cf2c58b 100644 --- a/white_balance_effect.h +++ b/white_balance_effect.h @@ -14,12 +14,12 @@ namespace movit { class WhiteBalanceEffect : public Effect { public: WhiteBalanceEffect(); - virtual std::string effect_type_id() const { return "WhiteBalanceEffect"; } - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } - std::string output_fragment_shader(); + std::string effect_type_id() const override { return "WhiteBalanceEffect"; } + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } + std::string output_fragment_shader() override; - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; private: // The neutral color, in linear sRGB. diff --git a/ycbcr_422interleaved_input.h b/ycbcr_422interleaved_input.h index a8c7773..88d1249 100644 --- a/ycbcr_422interleaved_input.h +++ b/ycbcr_422interleaved_input.h @@ -61,21 +61,21 @@ public: unsigned width, unsigned height); ~YCbCr422InterleavedInput(); - virtual std::string effect_type_id() const { return "YCbCr422InterleavedInput"; } + std::string effect_type_id() const override { return "YCbCr422InterleavedInput"; } - virtual bool can_output_linear_gamma() const { return false; } - virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; } + bool can_output_linear_gamma() const override { return false; } + AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; // Uploads the texture if it has changed since last time. - void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override; - 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 can_supply_mipmaps() const { return false; } + 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 can_supply_mipmaps() const override { return false; } // 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 @@ -97,19 +97,20 @@ public: void invalidate_pixel_data(); - void set_pitch(unsigned pitch) { + void set_pitch(unsigned pitch) + { assert(pitch % ycbcr_format.chroma_subsampling_x == 0); pitches[CHANNEL_LUMA] = pitch; pitches[CHANNEL_CHROMA] = pitch / ycbcr_format.chroma_subsampling_x; invalidate_pixel_data(); } - virtual void inform_added(EffectChain *chain) + void inform_added(EffectChain *chain) override { resource_pool = chain->get_resource_pool(); } - bool set_int(const std::string& key, int value); + bool set_int(const std::string& key, int value) override; private: ImageFormat image_format; diff --git a/ycbcr_422interleaved_input_test.cpp b/ycbcr_422interleaved_input_test.cpp index 59cc530..0d2c3fc 100644 --- a/ycbcr_422interleaved_input_test.cpp +++ b/ycbcr_422interleaved_input_test.cpp @@ -76,13 +76,13 @@ public: height(height), virtual_width(virtual_width), virtual_height(virtual_height) {} - virtual string effect_type_id() const { return "VirtualResizeEffect"; } - string output_fragment_shader() { return read_file("identity.frag"); } + string effect_type_id() const override { return "VirtualResizeEffect"; } + string output_fragment_shader() override { return read_file("identity.frag"); } - virtual bool changes_output_size() const { return true; } + bool changes_output_size() const override { return true; } - virtual void get_output_size(unsigned *width, unsigned *height, - unsigned *virtual_width, unsigned *virtual_height) const { + void get_output_size(unsigned *width, unsigned *height, + unsigned *virtual_width, unsigned *virtual_height) const override { *width = this->width; *height = this->height; *virtual_width = this->virtual_width; diff --git a/ycbcr_conversion_effect.h b/ycbcr_conversion_effect.h index f57e5fa..ce456ce 100644 --- a/ycbcr_conversion_effect.h +++ b/ycbcr_conversion_effect.h @@ -22,11 +22,11 @@ private: friend class EffectChain; public: - virtual std::string effect_type_id() const { return "YCbCrConversionEffect"; } - std::string output_fragment_shader(); - void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + std::string effect_type_id() const override { return "YCbCrConversionEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool one_to_one_sampling() const override { return true; } // Should not be called by end users; call // EffectChain::change_ycbcr_output_format() instead. diff --git a/ycbcr_input.h b/ycbcr_input.h index bb51049..0d24a40 100644 --- a/ycbcr_input.h +++ b/ycbcr_input.h @@ -61,22 +61,22 @@ public: GLenum type = GL_UNSIGNED_BYTE); ~YCbCrInput(); - virtual std::string effect_type_id() const { return "YCbCrInput"; } + std::string effect_type_id() const override { return "YCbCrInput"; } - virtual bool can_output_linear_gamma() const { return false; } - virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; } + bool can_output_linear_gamma() const override { return false; } + AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; } - std::string output_fragment_shader(); + std::string output_fragment_shader() override; // Uploads the texture if it has changed since last time. - void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num); + void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override; - 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 can_supply_mipmaps() const { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; } - virtual bool is_single_texture() const { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; } + 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 can_supply_mipmaps() const override { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; } + bool is_single_texture() const override { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; } // 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 @@ -171,12 +171,12 @@ public: // set_width() / set_height() again after this. void change_ycbcr_format(const YCbCrFormat &ycbcr_format); - virtual void inform_added(EffectChain *chain) + void inform_added(EffectChain *chain) override { resource_pool = chain->get_resource_pool(); } - bool set_int(const std::string& key, int value); + bool set_int(const std::string& key, int value) override; private: // Release the texture in the given channel if we have any, and it is owned by us. diff --git a/ycbcr_input_test.cpp b/ycbcr_input_test.cpp index adfdeb9..f90ffb7 100644 --- a/ycbcr_input_test.cpp +++ b/ycbcr_input_test.cpp @@ -1004,16 +1004,16 @@ TEST(YCbCrInputTest, TenBitPlanar) { class MipmapNeedingEffect : public Effect { public: MipmapNeedingEffect() {} - virtual bool needs_mipmaps() const { return true; } + bool needs_mipmaps() const override { return true; } // To be allowed to mess with the sampler state. - virtual bool needs_texture_bounce() const { return true; } + bool needs_texture_bounce() const override { return true; } - virtual string effect_type_id() const { return "MipmapNeedingEffect"; } - string output_fragment_shader() { return read_file("mipmap_needing_effect.frag"); } - virtual void inform_added(EffectChain *chain) { this->chain = chain; } + string effect_type_id() const override { return "MipmapNeedingEffect"; } + string output_fragment_shader() override { return read_file("mipmap_needing_effect.frag"); } + void inform_added(EffectChain *chain) override { this->chain = chain; } - void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) + void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) override { Node *self = chain->find_node_for_effect(this); glActiveTexture(chain->get_input_sampler(self, 0)); -- 2.39.2