nigig-org/crates/apps/nigig_doc_scanner/Cargo.toml
andodeki f535296b43 feat(scanner-ocr): on-device recognition behind ocr feature; gate pdf seam
nigig_doc_scanner splits the app shell (Makepad UI, nigig-core/uikit,
device location) from a new ocr feature: pure-Rust TemplateOcr
(Otsu plus 8-connected components plus embedded 5x7 templates for
0-9A-Z, confidence floor 0.80 plus runner-up margin, checked
budgets) with field suggestions and a deterministic fixture renderer
shared with downstream crates. Downstream device crates enable
nigig_doc_scanner/ocr with default-features=false (dep tree proven
free of UI/location crates). Binary requires app.

nigig-pdf-document gates its engine-free ocr seam behind an ocr
cargo feature (default on); recognition must not pull the
document/signing stack.

Verified: scanner ocr-only check plus 11 lib tests green;
pdf-document check green with default and --no-default-features;
pdf ocr tests 5/5. Pre-existing xmp.rs unused_mut warning untouched.
2026-09-25 22:41:38 +03:00

37 lines
1.4 KiB
TOML

[package]
name = "nigig_doc_scanner"
version = "0.1.0"
edition = "2021"
# Feature layout (see SITE-14 in `nigig-site/EXECUTION_PLAN.md`):
# - `app`: full scanner application — Makepad UI, nigig-core/uikit services,
# device location. Needed only to run the scanner binary itself.
# - `ocr`: on-device text recognition — pure Rust plus `image` buffers only.
# No UI, no location, no network, no model download. Downstream device
# crates (e.g. `nigig-site`) enable `ocr` with `default-features = false`
# so recognition never drags the app shell into their production graph.
# - `default = ["app", "ocr"]`: building/running the scanner app itself.
[features]
default = ["app", "ocr"]
app = [
"dep:makepad-widgets",
"dep:nigig-core",
"dep:nigig-uikit",
"dep:robius-location",
]
ocr = []
[[bin]]
name = "nigig_doc_scanner"
path = "src/main.rs"
required-features = ["app"]
[dependencies]
makepad-widgets = { workspace = true, optional = true }
nigig-core = { path = "../../nigig-core", optional = true }
nigig-uikit = { path = "../../nigig-uikit", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = { version = "0.4", features = ["serde"] }
robius-location = { git = "https://github.com/project-robius/robius", rev = "b766e62b0600f5d2ee21cc6995648346fc277bd8", optional = true }
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }