webpkit 0.1.0

A pure-Rust WebP codec: lossless (VP8L) and lossy (VP8) behind one decode/encode API.
Documentation
[package]
name = "webpkit"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
description = "A pure-Rust WebP codec: lossless (VP8L) and lossy (VP8) behind one decode/encode API."
keywords = ["webp", "image", "codec", "lossless", "lossy"]
categories = ["multimedia::images", "encoding", "no-std"]
homepage = "https://github.com/P4suta/webpkit"
documentation = "https://docs.rs/webpkit"
readme = "README.md"
# Keep the published tarball lean and dependency-free: the integration tests carry
# ~200 KB of golden fixtures + oracle sources that need dev-only path deps
# (`webpkit-samples`, `webpkit-lossy-proptest`) which are stripped on publish, so
# they cannot build from the crate anyway. `examples/roundtrip.rs` stays (it is the
# doc-linked quick-start); `examples/vs_libwebp.rs` is `required-features = ["oracle"]`
# and therefore inert in a default build.
exclude = ["tests/"]

# Render every feature's items on docs.rs (the `rayon`/`oracle` gated code included).
# No `--cfg docsrs` / `doc_cfg`: no optional feature changes a *public* signature
# (`rayon` only swaps in parallelism, `oracle` is dev-only, `std`/`alloc` are the
# baseline), so a feature-badge pass would annotate internal items for no reader gain.
[package.metadata.docs.rs]
all-features = true

[features]
default = ["std"]
std = ["alloc"]
alloc = []
# Opt-in encoder data-parallelism (rayon). Off by default; every parallel path is
# byte-identical to its serial fallback, so it changes only wall-clock, never output.
rayon = ["dep:rayon", "std"]
# Opt-in interop with the `image` crate: `TryFrom` conversions between
# `image::DynamicImage`/`RgbaImage` and `Image` (see `interop.rs`). Off by default,
# so a plain build keeps the zero-dependency baseline; needs an allocator.
image = ["dep:image", "alloc"]
# Differential oracle: links the libwebp C reference in-process for the
# `tests/oracle*.rs` cross-checks. Dev/test only; never part of a normal build.
oracle = ["dep:libwebp-sys"]
# Deterministic algorithmic-work counters (the work-cost measurement plane).
# Off by default: production builds link no counter code and behave identically.
work-count = []
# Dev-only: re-exports internal numeric kernels (and their pre-optimization
# `*_reference` twins) through `crate::{lossless,lossy}::bench` so `webpkit-bench`'s
# `kernels` microbench can time them in isolation. Adds no dependency and no
# production code; never enabled in a real build.
bench = []

[dependencies]
# Optional `image`-crate interop (the `image` feature). `default-features = false`
# keeps it to the buffer/`DynamicImage` types — no image format codecs are pulled —
# so a plain build has zero dependencies and this never enters it.
image = { version = "0.25", optional = true, default-features = false }
libwebp-sys = { workspace = true, optional = true }
# Declared locally (not `workspace = true`) so rayon can never enter a default build.
rayon = { version = "1", optional = true }

[dev-dependencies]
proptest = { workspace = true }
webpkit-lossy-proptest = { path = "../webpkit-lossy-proptest" }
# The shared synthetic corpus, for the in-process comparison report against the
# libwebp C reference (`examples/vs_libwebp.rs`, `oracle` feature).
webpkit-samples = { path = "../webpkit-samples" }

# In-process size/quality/speed comparison vs the libwebp C reference, rendered to a
# self-contained HTML dashboard. Needs the `oracle` feature (libwebp-sys), so it is
# skipped by ordinary `cargo build --examples`.
#   just report-vs-libwebp
[[example]]
name = "vs_libwebp"
required-features = ["oracle"]

[lints]
workspace = true