Split effects into image and video effects, with VHS tracking as the first video effect
Effect::video() says which kind an effect is. The Add effect menu lists the two kinds in sections of their own, each scrolling on its own, and offers video effects only in a video project; a video stage carries a film icon in the chain and, in a still, is dimmed and skipped like a stage switched off. enabledStages takes whether the render is a video and is the one place that leaves video stages out of a still. --help groups the video effects under a heading of their own, --list-effects marks them, and a video effect given for a still is skipped with a warning. VideoEffect is the base every video effect builds on, and keeps the rules a moving stage has to follow: it takes one value from the shared rng, the same on every frame, and hands the effect steady and per-frame generators and loop-rounded time through a Moment, so a subclass writes only animate(). VHS tracking is the first, and the one to copy: the colour planes sway and shake and a tracking bar rolls down the picture. That motion moves out of channel split, which is an image effect again and renders stills exactly as before; forVideo() goes with it. Version 0.7.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+12
-11
@@ -58,21 +58,22 @@ public:
|
||||
return title();
|
||||
}
|
||||
|
||||
// Whether a stage with these values changes from one frame of a video to
|
||||
// the next. A stage that does not is rendered once for the whole clip.
|
||||
virtual bool animated(const ParamValues& values) const {
|
||||
(void)values;
|
||||
return false;
|
||||
}
|
||||
// Whether this is a video effect rather than an image effect. An image
|
||||
// effect makes a picture and holds still in a clip; a video effect is
|
||||
// motion and nothing else, so it is offered only in a video project and a
|
||||
// still skips it whole, as it skips a stage that is switched off. Video
|
||||
// effects derive from VideoEffect (effects/video_effect.hpp), which
|
||||
// answers true here and keeps the rules a moving stage has to follow.
|
||||
virtual bool video() const { return false; }
|
||||
|
||||
virtual Image render(const std::vector<Image>& sources, int width, int height, Rng& rng,
|
||||
const ParamValues& values) const = 0;
|
||||
|
||||
// One frame of a video, or a still when `frame` says so. An effect that
|
||||
// does not move needs only render(), which this falls back to. One that
|
||||
// does must leave `rng` in the same state on every frame -- a frame's own
|
||||
// randomness comes from a generator of its own -- so the stages after it
|
||||
// stay put while it moves.
|
||||
// One frame of a video, or a still when `frame` says so. An image effect
|
||||
// needs only render(), which this falls back to; a video effect renders
|
||||
// here, and must leave `rng` in the same state on every frame -- a
|
||||
// frame's own randomness comes from a generator of its own -- so the
|
||||
// stages after it stay put while it moves.
|
||||
virtual Image renderFrame(const std::vector<Image>& sources, int width, int height, Rng& rng,
|
||||
const ParamValues& values, const FrameTime& frame) const {
|
||||
(void)frame;
|
||||
|
||||
Reference in New Issue
Block a user