abstractavatar 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- abstractavatar-0.1.0/ACKNOWLEDGEMENTS.md +10 -0
- abstractavatar-0.1.0/CHANGELOG.md +35 -0
- abstractavatar-0.1.0/CODE_OF_CONDUCT.md +8 -0
- abstractavatar-0.1.0/CONTRIBUTING.md +37 -0
- abstractavatar-0.1.0/Cargo.lock +107 -0
- abstractavatar-0.1.0/Cargo.toml +25 -0
- abstractavatar-0.1.0/LICENSE +21 -0
- abstractavatar-0.1.0/MANIFEST.in +12 -0
- abstractavatar-0.1.0/PKG-INFO +91 -0
- abstractavatar-0.1.0/README.md +79 -0
- abstractavatar-0.1.0/SECURITY.md +15 -0
- abstractavatar-0.1.0/avatar.h +41 -0
- abstractavatar-0.1.0/catalog.json +445 -0
- abstractavatar-0.1.0/docs/README.md +13 -0
- abstractavatar-0.1.0/docs/adr/0001-portable-procedural-generation.md +41 -0
- abstractavatar-0.1.0/docs/adr/0002-material-compositing.md +40 -0
- abstractavatar-0.1.0/docs/api.md +49 -0
- abstractavatar-0.1.0/docs/architecture.md +39 -0
- abstractavatar-0.1.0/docs/catalog.md +35 -0
- abstractavatar-0.1.0/docs/faq.md +36 -0
- abstractavatar-0.1.0/docs/frame-contract.md +71 -0
- abstractavatar-0.1.0/docs/getting-started.md +64 -0
- abstractavatar-0.1.0/docs/media/catalog.png +0 -0
- abstractavatar-0.1.0/docs/rendering.md +67 -0
- abstractavatar-0.1.0/docs/troubleshooting.md +31 -0
- abstractavatar-0.1.0/llms-full.txt +693 -0
- abstractavatar-0.1.0/llms.txt +31 -0
- abstractavatar-0.1.0/pyproject.toml +27 -0
- abstractavatar-0.1.0/python/abstractavatar/__init__.py +223 -0
- abstractavatar-0.1.0/python/abstractavatar/__main__.py +43 -0
- abstractavatar-0.1.0/python/abstractavatar.egg-info/PKG-INFO +91 -0
- abstractavatar-0.1.0/python/abstractavatar.egg-info/SOURCES.txt +48 -0
- abstractavatar-0.1.0/python/abstractavatar.egg-info/dependency_links.txt +1 -0
- abstractavatar-0.1.0/python/abstractavatar.egg-info/top_level.txt +1 -0
- abstractavatar-0.1.0/schema/descriptor.schema.json +17 -0
- abstractavatar-0.1.0/scripts/build_artifacts.py +75 -0
- abstractavatar-0.1.0/scripts/check_portability.mjs +37 -0
- abstractavatar-0.1.0/scripts/check_portability.py +48 -0
- abstractavatar-0.1.0/scripts/docs.py +64 -0
- abstractavatar-0.1.0/setup.cfg +4 -0
- abstractavatar-0.1.0/setup.py +43 -0
- abstractavatar-0.1.0/skills/abstractavatar/SKILL.md +99 -0
- abstractavatar-0.1.0/src/catalog.rs +170 -0
- abstractavatar-0.1.0/src/descriptor.rs +137 -0
- abstractavatar-0.1.0/src/ffi.rs +386 -0
- abstractavatar-0.1.0/src/lib.rs +1033 -0
- abstractavatar-0.1.0/src/raster.rs +244 -0
- abstractavatar-0.1.0/src/scenes.rs +2426 -0
- abstractavatar-0.1.0/tests/python/test_cli_and_capacity.py +64 -0
- abstractavatar-0.1.0/tests/test_python_api.py +103 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Acknowledgements
|
|
2
|
+
|
|
3
|
+
AbstractAvatar is part of AbstractFramework, created by Laurent-Philippe Albou.
|
|
4
|
+
|
|
5
|
+
The procedural catalog draws on the AbstractAssistant Apple Watch and iPhone artwork and the
|
|
6
|
+
AbstractTUI shaded activity avatars. Those implementations provide the design vocabulary and
|
|
7
|
+
provenance described in the [catalog](docs/catalog.md).
|
|
8
|
+
|
|
9
|
+
WebAssembly supplies the portable browser execution format. Python, Rust and platform UI toolkits
|
|
10
|
+
provide the integration surfaces. No machine-learning model is needed to render the catalog.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] - 2026-11-02
|
|
4
|
+
|
|
5
|
+
First release of the `abstractavatar` crate on crates.io. AbstractAvatar is a local procedural
|
|
6
|
+
avatar generator: your application supplies a style key, an activity state, time, audio level and
|
|
7
|
+
gaze, and the crate returns composited RGBA pixels. One Rust implementation serves terminal,
|
|
8
|
+
native and browser hosts.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- A catalog of 44 procedural designs (shaded characters, particle orbs, forms, portraits,
|
|
13
|
+
machines, nature scenes and a woven orb) with stable style keys, display names, families and
|
|
14
|
+
design provenance.
|
|
15
|
+
- Seven explicit activity states: ready, thinking, working, listening, speaking, waiting and
|
|
16
|
+
error. Audio level, eight optional audio bands and gaze add visual input to the chosen state;
|
|
17
|
+
listening and speaking poses respond to measured loudness.
|
|
18
|
+
- Rust API: `AvatarStyle`, `AvatarPose`, `Gaze`, `Frame::new` for repeated sampling, and
|
|
19
|
+
`Frame::rgba` for composited straight-alpha RGBA8 through host-owned `Palette` ramps, with
|
|
20
|
+
bounded pixel footprints and antialiasing. `Frame::sample` returns a single-material sample.
|
|
21
|
+
- Layered material compositing: overlapping material light keeps each color contribution, and
|
|
22
|
+
shaded surfaces and translucent ribbons composite in the shared rasterizer.
|
|
23
|
+
- `ffi` feature: a C ABI (`avatar.h`) with bounded handles (1..512 pixels, at most 16 live
|
|
24
|
+
handles), palette, gaze and audio-band setters, and `avatar_render_copy` into caller-owned
|
|
25
|
+
memory. The same exports build for `wasm32-unknown-unknown` for browser Canvas presenters.
|
|
26
|
+
- `json` feature: the versioned, inert parameter descriptor (`schema/descriptor.schema.json`).
|
|
27
|
+
- Python binding and `python -m abstractavatar` preview command, installed from a source
|
|
28
|
+
checkout with `python -m pip install .`.
|
|
29
|
+
|
|
30
|
+
### Compatibility
|
|
31
|
+
|
|
32
|
+
- Persist style keys. Numeric catalog codes are resolved at runtime and are not preference values.
|
|
33
|
+
- The first six ABI catalog codes (`halo`, `hover`, `vortex`, `eclipse`, `eye`, `rover`) keep
|
|
34
|
+
their ordering.
|
|
35
|
+
- Rust 1.87 or newer.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
Treat contributors and users respectfully. Discuss ideas and evidence, welcome different levels
|
|
4
|
+
of experience, and give actionable feedback. Harassment, threats, discrimination and disclosure
|
|
5
|
+
of another person's private information are unacceptable.
|
|
6
|
+
|
|
7
|
+
Report conduct concerns privately to contact@abstractframework.ai. Maintainers may moderate or
|
|
8
|
+
remove participation that violates these expectations and will handle reports with discretion.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use Rust 1.87+ and Python 3.10+. Build the library before trying its native integrations:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
cargo test
|
|
7
|
+
cargo test --all-features
|
|
8
|
+
cargo build --release --features ffi
|
|
9
|
+
python -m pip install .
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Keep procedural geometry in the shared Rust implementation. UI-specific clocks, preferences,
|
|
13
|
+
colors, focus and input capture belong in the host. New styles need distinct visual behavior,
|
|
14
|
+
source attribution, valid catalog metadata and examples of all supported activity states.
|
|
15
|
+
|
|
16
|
+
Preserve existing style keys and the published ABI contract. Add rather than repurpose catalog
|
|
17
|
+
entries. Changes to ownership or frame semantics belong in [architecture decisions](docs/adr/0001-portable-procedural-generation.md).
|
|
18
|
+
|
|
19
|
+
Document public API changes in [the API reference](docs/api.md) and [changelog](CHANGELOG.md).
|
|
20
|
+
Keep documentation indexes current with `python scripts/docs.py`; `python scripts/docs.py --check`
|
|
21
|
+
checks freshness without writing files.
|
|
22
|
+
|
|
23
|
+
For raster changes, compare native and WebAssembly output with identical ramps and inputs:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
rustup target add wasm32-unknown-unknown
|
|
27
|
+
python scripts/build_artifacts.py
|
|
28
|
+
python scripts/check_portability.py --native artifacts/libabstractavatar.so
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The comparison uses Node.js and a built native library. On macOS use
|
|
32
|
+
`artifacts/libabstractavatar.dylib`; on Windows use `artifacts/abstractavatar.dll`.
|
|
33
|
+
It exercises every style/state at 64 pixels plus the focused particle, ribbon and shaded-surface
|
|
34
|
+
designs at 32 and 128 pixels, including partial material alpha and eight voice bands.
|
|
35
|
+
Visual review still matters: pixel agreement establishes portability, not design fidelity.
|
|
36
|
+
|
|
37
|
+
Report security concerns using [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "abstractavatar"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"serde",
|
|
10
|
+
"serde_json",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[[package]]
|
|
14
|
+
name = "itoa"
|
|
15
|
+
version = "1.0.18"
|
|
16
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
17
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
18
|
+
|
|
19
|
+
[[package]]
|
|
20
|
+
name = "memchr"
|
|
21
|
+
version = "2.8.3"
|
|
22
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
23
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
24
|
+
|
|
25
|
+
[[package]]
|
|
26
|
+
name = "proc-macro2"
|
|
27
|
+
version = "1.0.107"
|
|
28
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
29
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
30
|
+
dependencies = [
|
|
31
|
+
"unicode-ident",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[[package]]
|
|
35
|
+
name = "quote"
|
|
36
|
+
version = "1.0.47"
|
|
37
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
38
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
39
|
+
dependencies = [
|
|
40
|
+
"proc-macro2",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[[package]]
|
|
44
|
+
name = "serde"
|
|
45
|
+
version = "1.0.229"
|
|
46
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
47
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
48
|
+
dependencies = [
|
|
49
|
+
"serde_core",
|
|
50
|
+
"serde_derive",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "serde_core"
|
|
55
|
+
version = "1.0.229"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"serde_derive",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "serde_derive"
|
|
64
|
+
version = "1.0.229"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
67
|
+
dependencies = [
|
|
68
|
+
"proc-macro2",
|
|
69
|
+
"quote",
|
|
70
|
+
"syn",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "serde_json"
|
|
75
|
+
version = "1.0.154"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"itoa",
|
|
80
|
+
"memchr",
|
|
81
|
+
"serde",
|
|
82
|
+
"serde_core",
|
|
83
|
+
"zmij",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "syn"
|
|
88
|
+
version = "3.0.9"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
91
|
+
dependencies = [
|
|
92
|
+
"proc-macro2",
|
|
93
|
+
"quote",
|
|
94
|
+
"unicode-ident",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "unicode-ident"
|
|
99
|
+
version = "1.0.27"
|
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
101
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "zmij"
|
|
105
|
+
version = "1.0.23"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "abstractavatar"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.87"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
description = "Platform-independent procedural activity avatars with optional native/WebAssembly ABI"
|
|
8
|
+
repository = "https://github.com/lpalbou/AbstractAvatar"
|
|
9
|
+
documentation = "https://docs.rs/abstractavatar"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
authors = ["Laurent-Philippe Albou"]
|
|
12
|
+
keywords = ["avatar", "procedural", "animation", "webassembly", "rgba"]
|
|
13
|
+
categories = ["graphics", "rendering", "multimedia::images", "wasm"]
|
|
14
|
+
exclude = [".github/", "docs/media/"]
|
|
15
|
+
[lib]
|
|
16
|
+
crate-type = ["rlib", "cdylib"]
|
|
17
|
+
[features]
|
|
18
|
+
default = []
|
|
19
|
+
ffi = []
|
|
20
|
+
json = ["dep:serde", "dep:serde_json"]
|
|
21
|
+
[dependencies]
|
|
22
|
+
serde = { version = "1", features = ["derive"], optional = true }
|
|
23
|
+
serde_json = { version = "1", optional = true }
|
|
24
|
+
[package.metadata.docs.rs]
|
|
25
|
+
all-features = true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Laurent-Philippe Albou <contact@abstractframework.ai>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include Cargo.toml Cargo.lock LICENSE avatar.h catalog.json
|
|
2
|
+
recursive-include src *.rs
|
|
3
|
+
recursive-include schema *.json
|
|
4
|
+
recursive-include python *.py
|
|
5
|
+
recursive-include scripts *.py *.mjs
|
|
6
|
+
recursive-include tests *.py
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
recursive-include docs/media *.png
|
|
9
|
+
recursive-include skills *.md
|
|
10
|
+
include llms.txt llms-full.txt
|
|
11
|
+
include ACKNOWLEDGEMENTS.md CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md SECURITY.md
|
|
12
|
+
recursive-exclude python/abstractavatar/_native *
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: abstractavatar
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Shared procedural avatar generation for native, terminal and web platforms
|
|
5
|
+
Author: Laurent-Philippe Albou
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/lpalbou/AbstractAvatar
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# AbstractAvatar
|
|
14
|
+
|
|
15
|
+
[](https://crates.io/crates/abstractavatar)
|
|
16
|
+
[](https://docs.rs/abstractavatar)
|
|
17
|
+
[](https://github.com/lpalbou/AbstractAvatar/actions/workflows/ci.yml)
|
|
18
|
+
|
|
19
|
+
AbstractAvatar generates procedural avatars from explicit activity state, time, audio level and
|
|
20
|
+
gaze. One Rust implementation supplies terminal, browser and native applications with a common
|
|
21
|
+
catalog and rendering behavior.
|
|
22
|
+
|
|
23
|
+
Use it for an assistant portrait, an activity indicator or a procedural character that responds
|
|
24
|
+
to your application's state. The host supplies state and presentation; AbstractAvatar generates
|
|
25
|
+
the picture locally.
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
**What's new in 0.1.0:** the first release of the `abstractavatar` crate. See the
|
|
30
|
+
[changelog](CHANGELOG.md#010---2026-11-02).
|
|
31
|
+
|
|
32
|
+
## Start with Rust
|
|
33
|
+
|
|
34
|
+
Add the crate from crates.io (Rust 1.87+):
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
cargo add abstractavatar
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```rust
|
|
41
|
+
use abstractavatar::{AvatarPose, AvatarStyle, Frame, Gaze, Palette};
|
|
42
|
+
|
|
43
|
+
let frame = Frame::new(AvatarStyle::Halo, AvatarPose::Speaking, 0.6, 1.2, Gaze::default());
|
|
44
|
+
let palette: Palette = [[0xffc060ff; 256], [0xff7070ff; 256], [0xd8e0ffff; 256]];
|
|
45
|
+
let rgba = frame.rgba(0.2, -0.1, 2.0 / 128.0, &palette);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Enable the `ffi` feature for the C ABI and WebAssembly exports, and `json` for the versioned
|
|
49
|
+
parameter descriptor.
|
|
50
|
+
|
|
51
|
+
## Start with Python
|
|
52
|
+
|
|
53
|
+
Build from the repository with Python 3.10+ and Rust 1.87+:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
git clone https://github.com/lpalbou/AbstractAvatar.git
|
|
57
|
+
cd AbstractAvatar
|
|
58
|
+
python -m pip install .
|
|
59
|
+
python -m abstractavatar catalog
|
|
60
|
+
python -m abstractavatar render --style halo --state speaking --level 0.6 --size 128 --output avatar.png
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The Python distribution includes the compiled native library. A source installation builds it
|
|
64
|
+
with Cargo. See [getting started](docs/getting-started.md) for library use and platform builds.
|
|
65
|
+
|
|
66
|
+
## Integrate a player
|
|
67
|
+
|
|
68
|
+
- **Rust:** create a `Frame` and sample composited RGBA through your theme's material ramps.
|
|
69
|
+
- **Browser:** run the bundled WebAssembly generator and present RGBA pixels on Canvas.
|
|
70
|
+
- **Python/native:** request RGBA pixels through the binding or the C interface and present them
|
|
71
|
+
with your UI toolkit.
|
|
72
|
+
|
|
73
|
+
Store catalog style identifiers, rather than numeric indices. Supply time explicitly, stop
|
|
74
|
+
animation while hidden, and use a static frame when reduced motion is enabled. Platform adapters
|
|
75
|
+
do not need their own geometry implementations.
|
|
76
|
+
|
|
77
|
+
The catalog includes shaded characters, particle orbs, forms, portraits, machines, nature scenes
|
|
78
|
+
and a woven orb. [Catalog guidance](docs/catalog.md) explains source variants and stable keys.
|
|
79
|
+
|
|
80
|
+
## Documentation
|
|
81
|
+
|
|
82
|
+
[Documentation index](docs/README.md) · [Architecture](docs/architecture.md) ·
|
|
83
|
+
[API](docs/api.md) · [Frame contract](docs/frame-contract.md) · [FAQ](docs/faq.md) ·
|
|
84
|
+
[Troubleshooting](docs/troubleshooting.md) · [Contributing](CONTRIBUTING.md) ·
|
|
85
|
+
[Security](SECURITY.md) · [Changelog](CHANGELOG.md)
|
|
86
|
+
|
|
87
|
+
## For AI agents
|
|
88
|
+
|
|
89
|
+
Use the [AbstractAvatar skill](skills/abstractavatar/SKILL.md) for the rendering workflow,
|
|
90
|
+
descriptor constraints and platform integration rules. The [LLM index](llms.txt) maps the public
|
|
91
|
+
documentation.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# AbstractAvatar
|
|
2
|
+
|
|
3
|
+
[](https://crates.io/crates/abstractavatar)
|
|
4
|
+
[](https://docs.rs/abstractavatar)
|
|
5
|
+
[](https://github.com/lpalbou/AbstractAvatar/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
AbstractAvatar generates procedural avatars from explicit activity state, time, audio level and
|
|
8
|
+
gaze. One Rust implementation supplies terminal, browser and native applications with a common
|
|
9
|
+
catalog and rendering behavior.
|
|
10
|
+
|
|
11
|
+
Use it for an assistant portrait, an activity indicator or a procedural character that responds
|
|
12
|
+
to your application's state. The host supplies state and presentation; AbstractAvatar generates
|
|
13
|
+
the picture locally.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
**What's new in 0.1.0:** the first release of the `abstractavatar` crate. See the
|
|
18
|
+
[changelog](CHANGELOG.md#010---2026-11-02).
|
|
19
|
+
|
|
20
|
+
## Start with Rust
|
|
21
|
+
|
|
22
|
+
Add the crate from crates.io (Rust 1.87+):
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
cargo add abstractavatar
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```rust
|
|
29
|
+
use abstractavatar::{AvatarPose, AvatarStyle, Frame, Gaze, Palette};
|
|
30
|
+
|
|
31
|
+
let frame = Frame::new(AvatarStyle::Halo, AvatarPose::Speaking, 0.6, 1.2, Gaze::default());
|
|
32
|
+
let palette: Palette = [[0xffc060ff; 256], [0xff7070ff; 256], [0xd8e0ffff; 256]];
|
|
33
|
+
let rgba = frame.rgba(0.2, -0.1, 2.0 / 128.0, &palette);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Enable the `ffi` feature for the C ABI and WebAssembly exports, and `json` for the versioned
|
|
37
|
+
parameter descriptor.
|
|
38
|
+
|
|
39
|
+
## Start with Python
|
|
40
|
+
|
|
41
|
+
Build from the repository with Python 3.10+ and Rust 1.87+:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
git clone https://github.com/lpalbou/AbstractAvatar.git
|
|
45
|
+
cd AbstractAvatar
|
|
46
|
+
python -m pip install .
|
|
47
|
+
python -m abstractavatar catalog
|
|
48
|
+
python -m abstractavatar render --style halo --state speaking --level 0.6 --size 128 --output avatar.png
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The Python distribution includes the compiled native library. A source installation builds it
|
|
52
|
+
with Cargo. See [getting started](docs/getting-started.md) for library use and platform builds.
|
|
53
|
+
|
|
54
|
+
## Integrate a player
|
|
55
|
+
|
|
56
|
+
- **Rust:** create a `Frame` and sample composited RGBA through your theme's material ramps.
|
|
57
|
+
- **Browser:** run the bundled WebAssembly generator and present RGBA pixels on Canvas.
|
|
58
|
+
- **Python/native:** request RGBA pixels through the binding or the C interface and present them
|
|
59
|
+
with your UI toolkit.
|
|
60
|
+
|
|
61
|
+
Store catalog style identifiers, rather than numeric indices. Supply time explicitly, stop
|
|
62
|
+
animation while hidden, and use a static frame when reduced motion is enabled. Platform adapters
|
|
63
|
+
do not need their own geometry implementations.
|
|
64
|
+
|
|
65
|
+
The catalog includes shaded characters, particle orbs, forms, portraits, machines, nature scenes
|
|
66
|
+
and a woven orb. [Catalog guidance](docs/catalog.md) explains source variants and stable keys.
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
[Documentation index](docs/README.md) · [Architecture](docs/architecture.md) ·
|
|
71
|
+
[API](docs/api.md) · [Frame contract](docs/frame-contract.md) · [FAQ](docs/faq.md) ·
|
|
72
|
+
[Troubleshooting](docs/troubleshooting.md) · [Contributing](CONTRIBUTING.md) ·
|
|
73
|
+
[Security](SECURITY.md) · [Changelog](CHANGELOG.md)
|
|
74
|
+
|
|
75
|
+
## For AI agents
|
|
76
|
+
|
|
77
|
+
Use the [AbstractAvatar skill](skills/abstractavatar/SKILL.md) for the rendering workflow,
|
|
78
|
+
descriptor constraints and platform integration rules. The [LLM index](llms.txt) maps the public
|
|
79
|
+
documentation.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Report suspected vulnerabilities privately to contact@abstractframework.ai. Include the affected
|
|
4
|
+
version, platform, input and a minimal reproduction. Avoid posting private application data or
|
|
5
|
+
an uncoordinated exploit in a public issue.
|
|
6
|
+
|
|
7
|
+
AbstractAvatar renders trusted built-in procedural designs. Descriptors are bounded parameters,
|
|
8
|
+
not scripts or arbitrary plug-ins. Use the bundled native library or WebAssembly artifact from a
|
|
9
|
+
trusted build. Do not load native libraries or WebAssembly supplied by an untrusted descriptor.
|
|
10
|
+
|
|
11
|
+
Hosts remain responsible for validating incoming application messages, controlling frame cadence,
|
|
12
|
+
and releasing renderer resources. The native API is a trusted in-process FFI boundary; callers
|
|
13
|
+
must obey buffer and synchronization requirements in [the frame contract](docs/frame-contract.md).
|
|
14
|
+
|
|
15
|
+
See [troubleshooting](docs/troubleshooting.md) for input and resource-limit errors.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#ifndef ABSTRACTAVATAR_H
|
|
2
|
+
#define ABSTRACTAVATAR_H
|
|
3
|
+
#include <stdint.h>
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
/* ABI1. Keys are durable; style indices are resolved from this catalog at runtime.
|
|
9
|
+
* Fields0..4: key,name,description,watch reference,family. String pointers static.
|
|
10
|
+
* Pose0..6: Ready,Thinking,Working,Listening,Speaking,Waiting,Error.
|
|
11
|
+
* Palette material0..2: Warm,Eye,Dim; index0..255; rgba0xRRGGBBAA.
|
|
12
|
+
* Set all768 shades before draw. Dimensions1..512; at most16 live handles.
|
|
13
|
+
* Negative results are explicit errors. create returns0 on refusal.
|
|
14
|
+
* Pixel pointers are borrowed until destroy; copy before another render/destroy.
|
|
15
|
+
* Native hosts serialize palette/draw and concurrent borrowed-pointer access.
|
|
16
|
+
*/
|
|
17
|
+
uint32_t avatar_abi_version(void);
|
|
18
|
+
uint32_t avatar_style_count(void);
|
|
19
|
+
const uint8_t *avatar_style_field_ptr(uint32_t style,uint32_t field);
|
|
20
|
+
size_t avatar_style_field_len(uint32_t style,uint32_t field);
|
|
21
|
+
uint32_t avatar_create(uint32_t width,uint32_t height);
|
|
22
|
+
int32_t avatar_set_shade(uint32_t handle,uint32_t material,uint32_t index,uint32_t rgba);
|
|
23
|
+
int32_t avatar_set_ground(uint32_t handle,uint32_t rgba);
|
|
24
|
+
/* Optional normalized Ready gaze; other poses ignore it. Host expires activity. */
|
|
25
|
+
int32_t avatar_set_gaze(uint32_t handle,float x,float y);
|
|
26
|
+
/* Eight measured normalized bands; clear restores scalar-level defaults. */
|
|
27
|
+
int32_t avatar_set_bands(uint32_t handle,float b0,float b1,float b2,float b3,float b4,float b5,float b6,float b7);
|
|
28
|
+
int32_t avatar_clear_bands(uint32_t handle);
|
|
29
|
+
int32_t avatar_render(uint32_t handle,uint32_t style,uint32_t pose,float level,float seconds,uint32_t transparent);
|
|
30
|
+
/* Atomic render/copy under the registry lock. Caller owns a writable output
|
|
31
|
+
* allocation of capacity bytes, disjoint from renderer buffers and other calls.
|
|
32
|
+
* Needs width*height*4 bytes. -6 means null or insufficient output capacity.
|
|
33
|
+
*/
|
|
34
|
+
int32_t avatar_render_copy(uint32_t handle,uint32_t style,uint32_t pose,float level,float seconds,uint32_t transparent,uint8_t *output,size_t capacity);
|
|
35
|
+
const uint8_t *avatar_pixels(uint32_t handle);
|
|
36
|
+
size_t avatar_pixels_len(uint32_t handle);
|
|
37
|
+
int32_t avatar_destroy(uint32_t handle);
|
|
38
|
+
#ifdef __cplusplus
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
#endif
|