Add vtracer-py: Python bindings with a rich API

New crates/vtracer-py (pyo3 + maturin, abi3) wrapping the vtracer framework.
Rather than a thin CLI-style wrapper, it exposes a mutable `Config` class with
named properties and `bw`/`poster`/`photo` preset constructors, plus three
input paths — `convert_file`, `convert_bytes` (encoded image, optional format),
and `convert_pixels` (raw RGBA8) — available as `Config` methods and
module-level functions. Palette is a list of `#rrggbb` strings; bad inputs
raise ValueError.

The core crate stays pure: image decoding lives here. The crate is excluded
from the cargo workspace (pyo3 extension-module cdylibs don't link libpython,
which breaks `cargo test` at the root) and is built with maturin. Ships a
vtracer.pyi type stub. README updated.
This commit is contained in:
Chris Tsang
2026-07-24 11:53:47 +01:00
parent 57d768e37e
commit f76aed78b2
7 changed files with 636 additions and 1 deletions
+2
View File
@@ -9,6 +9,8 @@ members = [
# build. It is superseded by the crates/ workspace above.
exclude = [
"webapp",
# pyo3 extension-module cdylib; built with maturin, not the core workspace.
"crates/vtracer-py",
]
resolver = "2"