mirror of
https://github.com/visioncortex/vtracer.git
synced 2026-09-29 07:21:22 -07:00
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:
@@ -0,0 +1,26 @@
|
||||
[build-system]
|
||||
requires = ["maturin>=1.5,<2.0"]
|
||||
build-backend = "maturin"
|
||||
|
||||
[project]
|
||||
name = "vtracer"
|
||||
description = "Raster to vector graphics converter — Python bindings for the vtracer framework."
|
||||
requires-python = ">=3.8"
|
||||
license = { text = "MIT OR Apache-2.0" }
|
||||
authors = [{ name = "Chris Tsang", email = "tyt2y7@gmail.com" }]
|
||||
keywords = ["svg", "vectorization", "raster", "computer-graphics"]
|
||||
classifiers = [
|
||||
"Programming Language :: Rust",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Topic :: Multimedia :: Graphics",
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "http://www.visioncortex.org/vtracer"
|
||||
Repository = "https://github.com/visioncortex/vtracer/"
|
||||
|
||||
[tool.maturin]
|
||||
# Pure-Rust extension module; the compiled library is imported as `vtracer`.
|
||||
module-name = "vtracer"
|
||||
features = ["pyo3/extension-module"]
|
||||
Reference in New Issue
Block a user