]> git.sesse.net Git - nageru/blobdiff - futatabi/ycbcr_converter.h
Make Futatabi fades apply white balance.
[nageru] / futatabi / ycbcr_converter.h
index 4618f1e9d51bee6fb0e41b4f63b75f3a6ad05567..c2ad2fad98c1a5b33e34de14e91b6cc1696e6c74 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <epoxy/gl.h>
 #include <memory>
+#include <movit/effect.h>
 #include <movit/ycbcr_input.h>
 
 namespace movit {
@@ -10,6 +11,7 @@ namespace movit {
 class EffectChain;
 class MixEffect;
 class ResourcePool;
+class WhiteBalanceEffect;
 struct YCbCrFormat;
 
 }  // namespace movit
@@ -25,12 +27,13 @@ public:
        };
        YCbCrConverter(OutputMode output_mode, movit::ResourcePool *resource_pool);
 
-       // Returns the appropriate chain for rendering.
+       // Returns the appropriate chain for rendering. Fades apply white balance,
+       // straight-up conversion does not.
        movit::EffectChain *prepare_chain_for_conversion(std::shared_ptr<Frame> frame);
        movit::EffectChain *prepare_chain_for_fade(std::shared_ptr<Frame> frame, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
 
        // <tex> must be interleaved Y'CbCr.
-       movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, unsigned width, unsigned height, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
+       movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, movit::RGBTriplet neutral_color, unsigned width, unsigned height, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
 
 private:
        movit::YCbCrFormat ycbcr_format;
@@ -45,6 +48,7 @@ private:
        struct FadeChain {
                std::unique_ptr<movit::EffectChain> chain;
                movit::YCbCrInput *input[2];
+               movit::WhiteBalanceEffect *wb_effect[2];
                movit::MixEffect *mix_effect;
        };
        FadeChain fade_chains[2][2];