Skip to content

Commit 7410e1e

Browse files
committed
Feature gate the main modules
1 parent 8e5ccd5 commit 7410e1e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ before_install:
2424
# fi
2525

2626
script:
27-
- cargo clean
28-
- cargo build
29-
- cargo test
27+
- cargo install cargo-all-features
28+
- cargo build-all-features
29+
- cargo test --all-features
3030

3131
# after_success: |
3232
# if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ keywords = ["image", "vision", "image-processing"]
1010
categories = ["science", "science::robotics", "multimedia", "multimedia::images", "graphics"]
1111
edition = "2018"
1212

13+
[features]
14+
default = ["enhancement", "format", "morphology", "processing", "transform"]
15+
enhancement = []
16+
format = []
17+
morphology = []
18+
processing = []
19+
transform =["ndarray-linalg"]
20+
1321
[dependencies]
1422
ndarray = { version = "0.14", default-features = false }
1523
ndarray-stats = { version = "0.4", default-features = false }
16-
ndarray-linalg = { version = "0.13", default-features = false }
24+
ndarray-linalg = { version = "0.13", default-features = false, optional = true }
1725
noisy_float = { version = "0.1", default-features = false }
1826
num-traits = { version = "0.2", default-features = false }
1927

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@
2828
/// The core of `ndarray-vision` contains the `Image` type and colour models
2929
pub mod core;
3030
/// Image enhancement intrinsics and algorithms
31+
#[cfg(feature="enhancement")]
3132
pub mod enhancement;
3233
/// Image formats - encoding and decoding images from bytes for saving and
3334
/// loading
35+
#[cfg(feature="format")]
3436
pub mod format;
3537
/// Operations relating to morphological image processing
38+
#[cfg(feature="morphology")]
3639
pub mod morphology;
3740
/// Image processing intrinsics and common filters/algorithms.
41+
#[cfg(feature="processing")]
3842
pub mod processing;
3943
/// Image transforms and warping
44+
#[cfg(feature="transform")]
4045
pub mod transform;

0 commit comments

Comments
 (0)