mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
scrawl-core
Pure, GPUI-free, platform-toolkit-free core library for Scrawl captures inside
Hex. Imported with git history from /Users/kit/code/open-source/scrawl.
License
MIT License (LICENSE, Copyright (c) 2026 Kit Langton). See also the root
LICENSE and THIRD_PARTY_NOTICES.md.
Composable Call Site
Inputs are grouped into four domain types (Recording, Interactions,
TranscriptData, OutputOptions) and flow through four pure, swappable stages
(plan_keyframes → solve_crop → render_frames → assemble_bundle):
use scrawl_core::{
Interactions, OutputOptions, Recording, TranscriptData,
assemble_bundle, plan_keyframes, render_frames, solve_crop,
};
let recording = Recording {
target,
duration_ms,
frames: captured.frames,
video: Some("recording.mp4".into()),
video_offset_ms: captured.video_offset_ms,
audio: Some("audio.wav".into()),
..Default::default()
};
let interactions = Interactions {
strokes,
events,
cursor: activity.cursor,
windows: activity.windows,
flags: Vec::new(),
};
let options = OutputOptions::for_target(&recording.target);
// Run stages individually (to inspect or swap a stage) or call `build_bundle`:
let plan = plan_keyframes(&recording, &interactions, &transcript, options.full_frames.as_deref());
let cropped = solve_crop(plan, &recording, &interactions, options.auto_crop.as_ref());
let rendered = render_frames(recording.duration_ms, cropped);
let built = assemble_bundle(bundle_id, recording, interactions, transcript, options.note, rendered);
let (dir, bundle, summary) = built.write_to(&bundle_dir)?;
Scope
model:.scrawlbundle schema (ScrawlBundle,Keyframe,Stroke,Mark,InteractionEvent,TranscriptData,WordTiming,RgbaFrame).keyframes: keyframe selection, mark grouping, scene-transition diffing, spoken-cue snapping, and narration alignment.sketch: stroke shape classification (circle, box, arrow, underline, line, cross, scribble, laser, pin, flag), freehand geometry, andsummary_markdown.autocrop: activity-weighted auto-crop solver, content-edge snapping, and theautocrop-corpus.jsonregression suite.render: deterministic CPU RGBA frame annotation, keyframe badge stamping, justified contact-sheet packing, zoom-sheet rendering, and PNG encode/decode.hold: pureSwitcherandRevealstate machines for the⌥⇧Stap/hold gesture.windows:ActivityLog,WindowSnapshot,CursorSample, pure window filtering, andWindowLoggerover theWindowProbetrait.zoom&export: moment/phrase lookup, zoom window sampling, and pure camera / crop / ink vector export planning.traits&pipeline: platform traits (Clock,FrameSource,InputSource,WordTranscriber,WindowProbe), boundedCandidateBuffer, grouped inputs (Recording,Interactions,OutputOptions), and composable stages (plan_keyframes,solve_crop,render_frames,assemble_bundle,build_bundle,BundleBuilder).