X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.h;h=c3dadffca3b115bbfdab3553bdbd81050b0ed9f7;hp=2e89c3bcc38717473c10f8b05cfffe80a68b9689;hb=3cb6aa45faa156fcb380aeacc13b03743bc471ec;hpb=419bbfe5e46add3df115882dbf489ccfe080d2f9 diff --git a/effect_chain.h b/effect_chain.h index 2e89c3b..c3dadff 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -222,12 +222,17 @@ public: } Effect *add_effect(Effect *effect, const std::vector &inputs); - // Adds an RGB output. Note that you can only have one output. + // Adds an RGBA output. Note that you can have at most one RGBA output and one + // Y'CbCr output (see below for details). void add_output(const ImageFormat &format, OutputAlphaFormat alpha_format); // Adds an YCbCr output. Note that you can only have one output. // Currently, only chunked packed output is supported, and only 4:4:4 // (so chroma_subsampling_x and chroma_subsampling_y must both be 1). + // + // If you have both RGBA and Y'CbCr output, the RGBA output will come + // in the last draw buffer. Also, and must be + // identical between the two. void add_ycbcr_output(const ImageFormat &format, OutputAlphaFormat alpha_format, const YCbCrFormat &ycbcr_format, YCbCrOutputSplitting output_splitting = YCBCR_OUTPUT_INTERLEAVED); @@ -298,6 +303,13 @@ public: // single-sampler input, or from an RTT texture. GLenum get_input_sampler(Node *node, unsigned input_num) const; + // Whether input of corresponds to a single sampler + // (see get_input_sampler()). Normally, you should not need to call this; + // however, if the input Effect has set override_texture_bounce(), + // this will return false, and you could be flexible and check it first + // if you want. + GLenum has_input_sampler(Node *node, unsigned input_num) const; + // Get the current resource pool assigned to this EffectChain. // Primarily to let effects allocate textures as needed. // Any resources you get from the pool must be returned to the pool @@ -388,10 +400,9 @@ private: ImageFormat output_format; OutputAlphaFormat output_alpha_format; - enum OutputColorType { OUTPUT_COLOR_RGB, OUTPUT_COLOR_YCBCR }; - OutputColorType output_color_type; - YCbCrFormat output_ycbcr_format; // If output_color_type == OUTPUT_COLOR_YCBCR. - YCbCrOutputSplitting output_ycbcr_splitting; // If output_color_type == OUTPUT_COLOR_YCBCR. + bool output_color_rgba, output_color_ycbcr; + YCbCrFormat output_ycbcr_format; // If output_color_ycbcr is true. + YCbCrOutputSplitting output_ycbcr_splitting; // If output_color_ycbcr is true. std::vector nodes; std::map node_map;