edgefirst-codec 0.26.0

Image codec for decoding JPEG/PNG into pre-allocated EdgeFirst tensors
Documentation
[package]
name = "edgefirst-codec"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Image codec for decoding JPEG/PNG into pre-allocated EdgeFirst tensors"
homepage.workspace = true
repository.workspace = true
readme = "README.md"
license.workspace = true
keywords = ["jpeg", "png", "image-decoding", "zero-copy", "edge-ai"]
categories = ["multimedia::images", "embedded"]
documentation = "https://docs.rs/edgefirst-codec"

[features]
# v4l2 and nvjpeg are on by default but their backend code is fully gated
# `#[cfg(all(target_os = "linux", feature = "..."))]`, so off Linux they compile
# to nothing. nvjpeg is pure dlopen (no link-time CUDA dependency) — it loads
# libnvjpeg.so.12 at runtime and degrades to the V4L2/CPU decoders when absent.
default = ["v4l2", "nvjpeg"]
v4l2 = ["dep:nix", "dep:libc"]
nvjpeg = ["dep:libloading"]
opencv = ["dep:opencv"]
turbojpeg = ["dep:turbojpeg"]

[dependencies]
edgefirst-tensor = { workspace = true }
kamadak-exif = { workspace = true }
libloading = { workspace = true, optional = true }
log = { workspace = true }
num-traits = { workspace = true }
opencv = { workspace = true, optional = true }
tracing = { workspace = true }
turbojpeg = { version = "1.4", optional = true }
zune-png = { workspace = true }

# Hardware JPEG decode (v4l2 feature). Linux-only: nix provides the ioctl
# macros (matching crates/tensor/src/dmabuf.rs), libc the open flags / mmap.
[target.'cfg(target_os = "linux")'.dependencies]
# `poll` adds to the workspace-declared nix features (fs/ioctl/mman).
nix = { workspace = true, optional = true, features = ["poll"] }
libc = { workspace = true, optional = true }

[dev-dependencies]
edgefirst-bench = { workspace = true }
env_logger = { workspace = true }
image = { workspace = true }
# zune-jpeg is used only by parity tests and the comparison benchmark.
zune-jpeg = { workspace = true }


[[bench]]
name = "codec_benchmark"
harness = false

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)'] }