1 |
|
2 |
|
3 | //! Read and write OpenEXR images.
|
4 | //! This library uses no foreign code or unsafe Rust.
|
5 | //!
|
6 | //! See the [README.md](https://github.com/johannesvollmer/exrs/blob/master/README.md) for crate information.
|
7 | //! Read __the [GUIDE.md](https://github.com/johannesvollmer/exrs/blob/master/GUIDE.md) for a API introduction__.
|
8 | //! Check out the [examples](https://github.com/johannesvollmer/exrs/tree/master/examples) for a first impression.
|
9 |
|
10 | #![warn (
|
11 | rust_2018_idioms,
|
12 | future_incompatible,
|
13 | unused_extern_crates,
|
14 | unused,
|
15 |
|
16 | missing_copy_implementations,
|
17 | missing_debug_implementations,
|
18 |
|
19 | clippy::all,
|
20 | clippy::restriction,
|
21 | clippy::pedantic,
|
22 | clippy::nursery,
|
23 | clippy::cargo,
|
24 | )]
|
25 |
|
26 | #![deny (
|
27 | unused_variables,
|
28 | unused_assignments,
|
29 | dead_code,
|
30 | unused_must_use,
|
31 | missing_copy_implementations,
|
32 | trivial_numeric_casts,
|
33 | redundant_semicolons
|
34 | )]
|
35 |
|
36 | #![forbid (unsafe_code)]
|
37 | #![warn (missing_docs)]
|
38 |
|
39 | pub mod io; // public to allow for custom attribute byte parsing
|
40 |
|
41 | pub mod math;
|
42 | pub mod compression;
|
43 | pub mod meta;
|
44 | pub mod image;
|
45 |
|
46 | pub mod error;
|
47 | pub mod block;
|
48 |
|
49 | #[macro_use ]
|
50 | extern crate smallvec;
|
51 |
|
52 | /// Export the most important items from `exrs`.
|
53 | /// _Note: This includes a type called `Result`, possibly overwriting the default `std::Result` type usage._
|
54 | pub mod prelude {
|
55 |
|
56 | /// Import this specifically if you want to be explicit but still use the extension traits.
|
57 | pub mod traits {
|
58 | pub use crate::image::write::{WritableImage, channels::GetPixel};
|
59 | pub use crate::image::read::{
|
60 | read, any_channels::ReadSamples, image::ReadLayers,
|
61 | image::ReadImage, layers::ReadChannels,
|
62 | specific_channels::{ReadSpecificChannel}
|
63 | };
|
64 |
|
65 | pub use crate::image::crop::{Crop, CropWhere, CropResult, InspectSample, CroppedChannels, ApplyCroppedView};
|
66 | }
|
67 |
|
68 | pub use traits::*;
|
69 |
|
70 | pub use crate::image::write::{write_rgb_file, write_rgba_file};
|
71 | pub use crate::image::read::{
|
72 | read_first_rgba_layer_from_file,
|
73 | read_all_rgba_layers_from_file,
|
74 | read_all_data_from_file,
|
75 | read_all_flat_layers_from_file,
|
76 | read_first_flat_layer_from_file
|
77 | };
|
78 |
|
79 | // image data structures
|
80 | pub use crate::image::*;
|
81 | pub use crate::meta::{ attribute, MetaData, header::{ LayerAttributes, ImageAttributes } };
|
82 | pub use crate::block::samples::Sample;
|
83 | pub use crate::meta::attribute::{
|
84 | AttributeValue, Compression, Text, IntegerBounds,
|
85 | LineOrder, SampleType, TileDescription, ChannelDescription
|
86 | };
|
87 |
|
88 | // common math
|
89 | pub use crate::math::Vec2;
|
90 |
|
91 | // error handling
|
92 | pub use crate::error::{ Result, Error };
|
93 |
|
94 | // re-export external stuff
|
95 | pub use half::f16;
|
96 | pub use smallvec::SmallVec;
|
97 | }
|
98 |
|
99 |
|
100 |
|
101 | |