]> git.sesse.net Git - movit/blob - ycbcr_conversion_effect.h
Add support for Y'CbCr output split between multiple textures.
[movit] / ycbcr_conversion_effect.h
1 #ifndef _MOVIT_YCBCR_CONVERSION_EFFECT_H
2 #define _MOVIT_YCBCR_CONVERSION_EFFECT_H 1
3
4 // Converts from R'G'B' to Y'CbCr; that is, more or less the opposite of YCbCrInput,
5 // except that it keeps the data as 4:4:4 chunked Y'CbCr; you'll need to subsample
6 // and/or convert to planar somehow else.
7
8 #include <epoxy/gl.h>
9 #include <string>
10
11 #include "effect.h"
12 #include "ycbcr.h"
13
14 namespace movit {
15
16 class YCbCrConversionEffect : public Effect {
17 private:
18         // Should not be instantiated by end users;
19         // call EffectChain::add_ycbcr_output() instead.
20         YCbCrConversionEffect(const YCbCrFormat &ycbcr_format);
21         friend class EffectChain;
22
23 public:
24         virtual std::string effect_type_id() const { return "YCbCrConversionEffect"; }
25         std::string output_fragment_shader();
26         virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
27         virtual bool one_to_one_sampling() const { return true; }
28
29 private:
30         YCbCrFormat ycbcr_format;
31 };
32
33 }  // namespace movit
34
35 #endif // !defined(_MOVIT_YCBCR_CONVERSION_EFFECT_H)