X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect_chain.h;h=bfe52c0dc6ddaf41d590557b984aabf2effa7d4a;hb=2322070a3dbeb6b46b39cca07a0fbf20e95f5468;hp=b51c2bb56cc0d97222ddf7ca99c98d5d8988df38;hpb=0b13d5089c5967a7a5706f20c1fbb6e98ca40f72;p=movit diff --git a/effect_chain.h b/effect_chain.h index b51c2bb..bfe52c0 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -9,7 +9,7 @@ #include "input.h" class EffectChain; -class Phase; +struct Phase; // For internal use within Node. enum AlphaType { @@ -72,7 +72,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 +148,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. @@ -175,6 +176,11 @@ private: // Output the current graph to the given file in a Graphviz-compatible format; // only useful for debugging. void output_dot(const char *filename); + std::vector get_labels_for_edge(const Node *from, const Node *to); + void output_dot_edge(FILE *fp, + const std::string &from_node_id, + const std::string &to_node_id, + const std::vector &labels); // Some of the graph algorithms assume that the nodes array is sorted // topologically (inputs are always before outputs), but some operations @@ -224,8 +230,7 @@ private: GLuint fbo; std::vector phases; - GLenum format; - unsigned bytes_per_pixel, num_dither_bits; + unsigned num_dither_bits; bool finalized; };