[workspace]
members = [
    ".",
    "fuzz",
    "examples/*",
]
exclude = [
    "fuzz",
]

[workspace.package]
version = "0.1.0-alpha.1"
authors = ["Yuji Ota <yujota.oss@gmail.com>"]
license = "BSD-3-Clause"
edition = "2024"

[package]
name = "eozin"
description = "A pure-Rust decoder library for digital pathology"
readme = "README.md"
homepage = "https://github.com/yujota/eozin"
repository = "https://github.com/yujota/eozin"
keywords = ["pathology", "image-decoder", "wasm", "medical"]
categories = ["science::bioinformatics", "wasm", "multimedia::images"]

version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true


[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["std-io"]
wasm-node = [
    "dep:wasm-bindgen-futures", 
    "dep:wasm-bindgen", 
    "dep:js-sys", 
    "dep:serde", 
    "dep:tsify",
    "jp2k",
    "image",
]
wasm-web = [
    "jp2k",
    "image",
    "dep:web-sys", 
    "dep:wasm-bindgen-futures", 
    "dep:wasm-bindgen", 
    "dep:js-sys", 
    "dep:serde", 
    "dep:tsify",
]
jp2k = [
    "dep:hayro-jpeg2000",
    "dep:image",
]
std-io = []
image = ["jp2k", "dep:image"]

[dependencies]
thiserror = "2.0.18"
web-sys = { workspace=true, features=["Blob", "BlobPropertyBag", "console", "ImageData", "File"], optional = true}
wasm-bindgen = { workspace=true, optional=true }
wasm-bindgen-futures = { workspace=true, optional=true }
js-sys = { workspace=true, optional=true }
serde = { workspace=true, optional=true, features = ["derive"]}
tsify = { workspace=true, optional=true }
hayro-jpeg2000 = { workspace=true, optional=true }
image = { workspace=true, optional=true }

[workspace.dependencies]
web-sys = "^0.3.91"
wasm-bindgen = "^0.2.114"
wasm-bindgen-futures = "^0.4.64"
js-sys = "^0.3.91"
serde = "^1.0.228"
tsify = "^0.5.6"
futures = "^0.3.32"
hayro-jpeg2000 = "^0.3.4"
image = "^0.25.10"


[dev-dependencies]
reqwest = { version = "^0.13.2", features = ["blocking"] }
serde = { version = "^1.0", features = ["derive"] }
toml = "1.1.1"
