Architecture
zphoto-core is the engine behind the zphoto desktop app. The defining decision is a single shared layer stack: Illustrator-style vector commands composite onto the same layers as Photoshop-style raster commands, rather than a separate vector document. Every operation is a string command plus JSON args routed through one surface, Engine::invoke(cmd, args) -> Result<Value>; the host renders the result. Pixels are edited at 8-, 16-, and 32-bit depth with f64 geometry. The same engine is reached natively (Rust), through a C FFI (ffi), and through a Tauri v2 plugin (tauri_plugin).
Module map
The engine's source modules (src/*.rs). All are real, implemented modules.
| module | responsibility | status |
|---|---|---|
| lib | the Engine type and invoke(cmd, args) command dispatch | implemented |
| model | document + layer-stack model — the shared raster/vector compositing surface | implemented |
| ops | ~55 dispatch ops the GUI, FFI, and Tauri plugin all call | implemented |
| filter | raster filters — blur · sharpen · noise · distort · stylize · render | implemented |
| fill | solid · gradient · pattern fills over 8/16/32-bit pixels | implemented |
| paint | brush · eraser · clone / heal · smudge primitives | implemented |
| vector | Bézier paths · shapes · strokes / fills · boolean ops on the shared layer stack | implemented |
| text | point / area type · type on a path · rasterize into layers | implemented |
| codec | decode / encode raster formats into and out of the document model | implemented |
| b64 | base64 transport of image buffers across the FFI / IPC boundary | implemented |
| ffi | C FFI surface for embedding the engine outside Rust | implemented |
| tauri_plugin | Tauri v2 plugin exposing the command surface to the desktop GUI and other apps | implemented |
| error | typed error model — unknown/unimplemented commands return errors, never panic or silently succeed | implemented |
Roadmap
Per-command coverage of the Photoshop / Illustrator surface (~371 raster + 71 vector) is tracked, source-derived, in zphoto's port report; no command is marked done without a verifiable engine symbol. Work proceeds area by area:
- Raster core — layer model, blend modes, codecs, and the filter / fill / paint command surface across 8/16/32-bit depth.
- Selections & masks — selections and layer masks feeding the raster commands.
- Vector on the shared stack — paths, shapes, strokes/fills, boolean ops compositing onto the same layers.
- Text — point / area type and type on a path, rasterized into layers.
- Embeds — the C FFI and Tauri plugin surfaces so the engine drops into the desktop GUI and other MenkeTechnologies apps.
Verification policy
Status is never asserted from a roadmap. A command counts as done only when a real, non-stub symbol exists and the port report can cite it. The engine ships 556+ #[test] functions; tests build documents in memory (no external fixtures) and confirm that unimplemented commands return a typed error rather than panicking or silently succeeding — runnable on headless Linux CI.