diff --git a/Cargo.toml b/Cargo.toml index cdada855..92550168 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ uriparse = {version = "0.6", optional = true} chrono = { version = "0.4", default-features = false, features = ["clock", "std", "oldtime"] } chrono-tz = {version = "0.10", optional = true} image = {version = "=0.25.8", optional = true, default-features = false} -imageproc = {version = "0.25", optional = true} +imageproc = {version = "0.25", optional = true, default-features = false} unicode-segmentation = "1.13" codepage-437 = {version = "0.1", optional = true} rxing-one-d-proc-derive = {version = "0.9", path ="./crates/one-d-proc-derive", optional = true} @@ -46,6 +46,7 @@ default = [ "image", "client_support", "image_formats", + "rayon", "serde", "encoding_rs", "encoders", @@ -75,6 +76,10 @@ image_formats = [ "image/ff", ] +#/// Enable rayon-based parallelism inside imageproc operations (binarizers, filters). +#/// Off by default; correctness is unaffected, this only speeds up image processing. +rayon = ["image", "imageproc/rayon"] + #/// Enable barcode encoders encoders = [] diff --git a/README.md b/README.md index 6dce0cc5..3138ebd9 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ The following feature flags are available: ### Core & Engine * `image` (default): Enable features required for image manipulation and reading. * `image_formats` (default): Enabled by default. Compile all `image` crate image format support options. +* `rayon` (default): Enabled by default. Turns on `rayon`-based parallelism inside the `imageproc` operations rxing uses (binarizers, filters). * `encoders` (default): Enable barcode encoders. * `decoders` (default): Enable barcode decoders. * `multi_barcode_readers` (default): Enable support for reading multiple barcodes in a single image. @@ -106,6 +107,7 @@ default = [ "image", "client_support", "image_formats", + "rayon", "serde", "encoding_rs", "encoders",