]> git.sesse.net Git - movit/blobdiff - effect_chain.h
Update an outdated comment.
[movit] / effect_chain.h
index 071f9ebe51b33b511facbba7d7c2a68d8c542863..c6da2172d1e56b5c9f89a08607522536e9964632 100644 (file)
@@ -264,8 +264,8 @@ public:
        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).
+       // Currently, only 4:4:4 output is supported, 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, <format> and <alpha_format> must be
@@ -274,6 +274,12 @@ public:
                              const YCbCrFormat &ycbcr_format,
                              YCbCrOutputSplitting output_splitting = YCBCR_OUTPUT_INTERLEAVED);
 
+       // Change Y'CbCr output format. (This can be done also after finalize()).
+       // Note that you are not allowed to change subsampling parameters;
+       // however, you can change the color space parameters, ie.,
+       // luma_coefficients, full_range and num_levels.
+       void change_ycbcr_output_format(const YCbCrFormat &ycbcr_format);
+
        // Set number of output bits, to scale the dither.
        // 8 is the right value for most outputs.
        // The default, 0, is a special value that means no dither.
@@ -299,16 +305,16 @@ public:
        // no matter what you specify.
        //
        // Of special interest is GL_SRGB8_ALPHA8, which stores sRGB-encoded RGB
-       // and linear alpha; this is half the memory bandwidth og GL_RGBA16F,
+       // and linear alpha; this is half the memory bandwidth of GL_RGBA16F,
        // while retaining reasonable precision for typical image data. It will,
        // however, cause some gamut clipping if your colorspace is far from sRGB,
        // as it cannot represent values outside [0,1]. NOTE: If you construct
-       // a chain where you end up bouncing pixels in non-linear light this
-       // will not do the wrong thing. However, it's hard to see how this
-       // could happen in a non-contrived chain; few effects ever need texture
-       // bounce or resizing without also combining multiple pixels, which
-       // really needs linear light and thus triggers a conversion before the
-       // bounce.
+       // a chain where you end up bouncing pixels in non-linear light
+       // (gamma different from GAMMA_LINEAR), this will be the wrong thing.
+       // However, it's hard to see how this could happen in a non-contrived
+       // chain; few effects ever need texture bounce or resizing without also
+       // combining multiple pixels, which really needs linear light and thus
+       // triggers a conversion before the bounce.
        //
        // If you don't need alpha (or can do with very little of it), GL_RGB10_A2
        // is even better, as it has two more bits for each color component. There
@@ -318,7 +324,10 @@ public:
        // the sRGB curve, and reduces maximum error (in sRGB distance) by almost an
        // order of magnitude, well below what you can get from 8-bit true sRGB.
        // (Note that this strategy avoids the problem with bounced non-linear data
-       // above, since the square root is turned off in that case.)
+       // above, since the square root is turned off in that case.) However, texture
+       // filtering will happen on the transformed values, so if you have heavy
+       // downscaling or the likes (e.g. mipmaps), you could get subtly bad results.
+       // You'll need to see which of the two that works the best for you in practice.
        void set_intermediate_format(
                GLenum intermediate_format,
                FramebufferTransformation transformation = NO_FRAMEBUFFER_TRANSFORMATION)
@@ -338,7 +347,6 @@ public:
        void reset_phase_timing();
        void print_phase_timing();
 
-       //void render(unsigned char *src, unsigned char *dst);
        void render_to_screen()
        {
                render_to_fbo(0, 0, 0);
@@ -484,6 +492,7 @@ private:
        std::vector<Node *> nodes;
        std::map<Effect *, Node *> node_map;
        Effect *dither_effect;
+       Node *ycbcr_conversion_effect_node;
 
        std::vector<Input *> inputs;  // Also contained in nodes.
        std::vector<Phase *> phases;