[package]
name = "okmain"
version = "0.1.0"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
description = "OK main colors of your image"
homepage = "https://github.com/si14/okmain"
repository = "https://github.com/si14/okmain/tree/main/crates/okmain"
readme = "README.md"
keywords = ["color", "image", "oklab", "palette"]
categories = ["multimedia::images"]
exclude = ["src/bin/*", "benches/*", "AGENTS.md"]

[dependencies]
snafu = { workspace = true }
oklab = { version = "1" }
fast-srgb8 = { version = "1" }
rand = { version = "0.10.0", default-features = false }
rand_xoshiro = { version = "0.8" }
image = { version = "0.25", optional = true, default-features = false }
clap = { version = "4", features = ["derive"], optional = true }
rgb = { version = "0.8" }

[dev-dependencies]
pretty_assertions = { version = "1", features = ["unstable"] }
criterion = { version = "0.8", features = ["html_reports"] }
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }

[features]
default = []
image = ["dep:image"]
unstable = []
# Opens up private modules for debug binaries and benchmarks
_debug = ["dep:clap", "image/png", "image/jpeg"]

[package.metadata.docs.rs]
# Not `all-features` because `_debug` is internal
features = ["image", "unstable"]

[[bin]]
name = "debug_sample"
required-features = ["image", "_debug"]

[[bin]]
name = "debug_centroids"
required-features = ["image", "_debug"]

[[bin]]
name = "debug_colors"
required-features = ["image", "_debug"]

[[bin]]
name = "debug_comparison_with_resize"
required-features = ["image", "_debug"]

[[bin]]
name = "debug_distance_mask"
required-features = ["image", "_debug"]

[[bench]]
name = "kmeans"
harness = false
required-features = ["image", "_debug"]

[[bench]]
name = "sample"
harness = false
required-features = ["image", "_debug"]