Expand description
smix-annotate — screenshot annotation.
Compose circle / arrow / text / box / line primitives onto a PNG, then emit compressed output.
§Quick tour
ⓘ
use smix_annotate::{Annotator, Annotation, Color, Position, Compression};
let png = std::fs::read("input.png")?;
let out = Annotator::new(&png)?
.add(Annotation::circle(Position::pixel(100, 100))
.color(Color::RED)
.radius(40))
.compression(Compression::BALANCED)
.render()?;
std::fs::write("output.png", out)?;§Scope
- 5 primitives: circle, arrow, text, box, line
- Position resolvers: absolute pixel + normalized (0..1)
(selector-relative via a11y tree — wire lives in
smix-adapter-maestroruntime, not in this crate; caller resolves selector → pixel before adding annotation) - Named + hex + rgba color palette
- Compression 3 presets: fast, balanced, aggressive
- Text rendering via
ab_glyph; bundled Inter + Noto Sans SC by default, overridable by the caller via.font(bytes)
Re-exports§
pub use color::Color;
Modules§
Structs§
- Annotator
- Annotator builder.
- Arrow
Builder - BoxBuilder
- Circle
Builder - Line
Builder - Text
Builder
Enums§
- Annotate
Error - Annotation
- One drawing primitive.
- Compression
- PNG output compression preset.
- Position
- Position of an annotation on the image.