Expand description
The zoom engine — a ZoomSegment as a pure function of the frame.
On an animation stand, the rostrum camera pushes in by riding a screw
drive toward the artwork — a slow, eased move from wide to tight and
back. This module is that move in software: given a zoom region and a
project frame, it returns the ZoomTransform (a scale about a focal
point) the renderer applies to the composed frame. It is the heart of
the editor’s signature look, and — because it is GPU-free arithmetic —
it is exhaustively unit-testable. Preview and export call the same
function, so what you scrub is what you ship.
The profile is three phases over a zoom’s [start, end) window: an
eased ramp-in from no-zoom to full amount, a hold at full,
and a symmetric eased ramp-out back to no-zoom. The ramp length is
clamped to half the window so the two ramps never overlap — a short
zoom degrades gracefully to a triangle (push-in straight into
push-out, no hold) instead of fighting itself.
Structs§
- Zoom
Keyframe - A dopesheet keyframe for a zoom: a project frame and the scale at it.
- Zoom
Transform - A scale-about-a-focal-point transform for one composed frame.
Functions§
- active_
zoom_ at - The active zoom transform at project
frameacross the whole project: the transform of the first zoom region whose window containsframe, orZoomTransform::identitywhen none do. The ramp is derived from the project’s frame rate. - default_
ramp_ frames - A sensible ramp length for
fps: about 0.6 s of ease-in / ease-out — the cinematic-but-snappy feel screen recorders converge on — floored at a single frame so even a 1 fps project still animates. - frac 🔒
num / denasf64, via a losslessu32hop (frame counts are tiny;denis always> 0at the call sites below).- zoom_at
- The zoom transform at project
framefor one segment. - zoom_
keyframes - The keyframes of a zoom’s scale curve, for the dopesheet (ED.13):
identity at both edges, full
amountacross the hold, eased between. Four keyframes when there’s a hold; three (a triangle peak) when the ramps fill the window. This is the dopesheet’s view ofzoom_at— pass the sameramp_frames.