]> git.sesse.net Git - movit/commitdiff
Make the internal effects private to EffectChain.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Jan 2013 01:04:35 +0000 (02:04 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Jan 2013 01:06:04 +0000 (02:06 +0100)
ColorspaceConversionEffect, DitherEffect, GammaExpansionEffect and GammaCompressionEffect
are all supposed to be used by EffectChain only, so make them private; I've had
reports of users trying to use these directly, leaving the framework in a confused state.

colorspace_conversion_effect.h
dither_effect.h
gamma_compression_effect.h
gamma_expansion_effect.h

index 93db321d79a3f9e201efca2e5ee6d35fd19e195e..15ad0addbc04394d2f70650c211495e2b0c2cacb 100644 (file)
 #include "effect_chain.h"
 
 class ColorspaceConversionEffect : public Effect {
-public:
+private:
+       // Should not be instantiated by end users.
        ColorspaceConversionEffect();
+       friend class EffectChain;
+
+public:
        virtual std::string effect_type_id() const { return "ColorspaceConversionEffect"; }
        std::string output_fragment_shader();
 
index 535b783959a4a3355d16873ddbfe27f734baede6..cad6488921b67c5f60a3a1ac17fb97dec440b474 100644 (file)
 #include "effect.h"
 
 class DitherEffect : public Effect {
-public:
+private:
+       // Should not be instantiated by end users;
+       // call EffectChain::set_dither_bits() instead.
        DitherEffect();
+       friend class EffectChain;
+
+public:
        ~DitherEffect();
        virtual std::string effect_type_id() const { return "DitherEffect"; }
        std::string output_fragment_shader();
index 0155ee54b32fb28313d22785d91497e7f40a08c8..2744d2ddf65f809e96a301cdcb0e016e499c8f25 100644 (file)
 #define COMPRESSION_CURVE_SIZE 4096
 
 class GammaCompressionEffect : public Effect {
-public:
+private:
+       // Should not be instantiated by end users.
        GammaCompressionEffect();
+       friend class EffectChain;
+
+public:
        virtual std::string effect_type_id() const { return "GammaCompressionEffect"; }
        std::string output_fragment_shader();
 
index ce999902f7be24b4ddace89ea12384cb7dbf5def..043731baf15ef48c8812d1ec6fb6e5234a5b87a3 100644 (file)
 #define EXPANSION_CURVE_SIZE 256
 
 class GammaExpansionEffect : public Effect {
-public:
+private:
+       // Should not be instantiated by end users.
        GammaExpansionEffect();
+       friend class EffectChain;
+
+public:
        virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
        std::string output_fragment_shader();