X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=effect_chain.h;h=6698c6f70e6b7cf5ee0752fce39840613295810f;hb=9b95345e8e1dde29991638ed69def0cf187e28de;hp=f0d0003e9c87bf0fcfc83da512c6a6dbd2f62998;hpb=ba6838ec8b6fb972ccda17b3e6be6e793a4157a3;p=movit diff --git a/effect_chain.h b/effect_chain.h index f0d0003..6698c6f 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -1,15 +1,18 @@ -#ifndef _EFFECT_CHAIN_H -#define _EFFECT_CHAIN_H 1 +#ifndef _MOVIT_EFFECT_CHAIN_H +#define _MOVIT_EFFECT_CHAIN_H 1 +#include +#include +#include #include +#include #include -#include "effect.h" #include "image_format.h" -#include "input.h" -class EffectChain; -class Phase; +class Effect; +class Input; +struct Phase; // For internal use within Node. enum AlphaType { @@ -22,8 +25,8 @@ enum AlphaType { // Whether you want pre- or postmultiplied alpha in the output // (see effect.h for a discussion of pre- versus postmultiplied alpha). enum OutputAlphaFormat { - OUTPUT_ALPHA_PREMULTIPLIED, - OUTPUT_ALPHA_POSTMULTIPLIED, + OUTPUT_ALPHA_FORMAT_PREMULTIPLIED, + OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, }; // A node in the graph; basically an effect and some associated information. @@ -72,7 +75,7 @@ struct Phase { std::vector inputs; std::vector effects; // In order. - unsigned output_width, output_height; + unsigned output_width, output_height, virtual_output_width, virtual_output_height; }; class EffectChain { @@ -148,9 +151,10 @@ public: void insert_node_between(Node *sender, Node *middle, Node *receiver); private: - // Fits a rectangle of the given size to the current aspect ratio - // (aspect_nom/aspect_denom) and returns the new width and height. - unsigned fit_rectangle_to_aspect(unsigned width, unsigned height); + // Make sure the output rectangle is at least large enough to hold + // the given input rectangle in both dimensions, and is of the + // current aspect ratio (aspect_nom/aspect_denom). + void size_rectangle_to_fit(unsigned width, unsigned height, unsigned *output_width, unsigned *output_height); // Compute the input sizes for all inputs for all effects in a given phase, // and inform the effects about the results. @@ -225,13 +229,10 @@ private: Effect *dither_effect; std::vector inputs; // Also contained in nodes. - - GLuint fbo; std::vector phases; - GLenum format; - unsigned bytes_per_pixel, num_dither_bits; + unsigned num_dither_bits; bool finalized; }; -#endif // !defined(_EFFECT_CHAIN_H) +#endif // !defined(_MOVIT_EFFECT_CHAIN_H)