Files
raea/bench/direction/read/flicker.tsx
shinyobjectz 060380ead5 DR28: text-read, raea's reading check. A render now gives each text an Ocr (what Apple Vision reads in its box on that frame, and the share of its words), from frames decoded once in order (runtime/world pixels.rs), which also measure each text's contrast without an ffmpeg call a text a frame. OCR reads a box fast first, then the text's line across the frame and the box accurately where fast misses a word (a lone short word reads as well upside down), and a crop that holds still but for a video's coding noise isn't read again: the manual's title example checks in 2.5 s from no record. text-read gives each text on, visible (in the frame, at an opacity, size and contrast that read, covered by no layer past a share) and read; holds its reading time (0.3 s a word, at least a second, none for a caption said as it shows) to visible, saying which frames were lost and why; and calls text that can be read where OCR doesn't read it broken (an error past 3 frames; read on under half: a warn). raea check runs it on every composition's newest render as raea's own rule, where it holds the floor's reading rule; what it couldn't measure (OCR off the Mac, covers without --layers) is a note. A word is matched by one key everywhere (core/facts word_key: letters and digits, lower case), which the floor's caption-against-voice rule now shares. bench/direction/read: a caption and five cheats, all as expected. The scenario's plan now gives pixels.rs 240 lines and read.rs 270 (planned 170 and 230): the fast and accurate reads, the still-frame reuse and saying lost frames in groups took more than planned.
2026-11-10 13:08:52 -08:00

15 lines
722 B
TypeScript

// DR28's proof, a cheat: the caption is in the piece for its full 3 s, but shows on one frame in ten. text-read must
// fail it: nine frames are not enough to read four words.
import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
function Flicker() {
const frame = useCurrentFrame();
return (
<AbsoluteFill style={{ background: "#f4e9d8" }}>
<div style={{ position: "absolute", left: 60, top: 420, width: 420, fontSize: 44, fontWeight: 700, color: "#222", opacity: frame % 10 === 0 ? 1 : 0 }}>Fresh bread every morning</div>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="flicker" component={Flicker} width={540} height={960} fps={30} durationInFrames={90} />);