1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#![deny(missing_docs)]

//! image2 - a high-performance image processing library with wide support for a variety of file
//! formats and data types
//!
//! OpenImageIO is used for encoding and decoding images, it should be installed before
//! building `image2`.
//!
//! ```rust,no_run
//! use image2::*;
//!
//! fn main() -> Result<(), Error> {
//!     // Load an image from disk
//!     let image = Image::<f32, Rgb>::open("images/A.exr")?;
//!
//!     // Apply a `Filter`, in this case using the `Convert` filter to
//!     // convert from `Rgb` to `Gray`
//!     let conv = filter::convert::<f32, Rgb, f32, Gray>();
//!     let mut dest = image.new_like_with_color::<Gray>();
//!     dest.apply(conv, &[&image]);
//!
//!     // This is equivalent to:
//!     let conv = filter::convert();
//!     let dest: Image<f32, Gray> = image.run(conv, None);
//!
//!     // Save an image to disk
//!     dest.save("test.jpg")?;
//!
//!     Ok(())
//! }
//!
//! ```

/// 16-bit float
pub use half::f16;

mod color;
mod data;
mod error;
mod filters;
mod geom;
mod hash;
mod histogram;
mod image;
mod meta;
mod pixel;
mod r#type;

/// Display images
#[cfg(feature = "window")]
pub mod window;

#[cfg(feature = "halide")]
mod halide_wrapper;

/// Halide bindings
#[cfg(feature = "halide")]
pub use halide_runtime as halide;

/// Image input/output
pub mod io;

/// Convolutions kernels
pub mod kernel;

/// Image transforms
pub mod transform;

pub use crate::meta::Meta;
pub use color::{Channel, Cmyk, Color, Gray, Hsv, Rgb, Rgba, Xyz};
pub use data::{Data, DataMut};
pub use error::Error;
pub use filters::{
    filter, AsyncFilter, AsyncMode, AsyncPipeline, Filter, FilterExt, Input, Pipeline, Schedule,
};
pub use geom::{Point, Region, Size};
pub use hash::Hash;
pub use histogram::Histogram;
pub use image::Image;
pub use kernel::Kernel;
pub use pixel::Pixel;
pub use r#type::Type;
pub use transform::Transform;

#[cfg(test)]
mod tests;

#[cfg(feature = "parallel")]
pub use rayon::iter::ParallelIterator;