tiff_forge/lib.rs
1#![doc = include_str!("../README.md")]
2
3extern crate byteorder;
4
5pub mod ifd;
6pub mod write;
7
8mod file;
9pub use file::{BigTiffFile, TiffFile};
10
11/// Common imports that are necessary for almost every use of the `tiff_forge`
12/// library.
13///
14/// # Usage
15/// ```
16/// use tiff_forge::prelude::*;
17/// ```
18///
19/// # Other common imports
20///
21/// The following imports, although also often used for this library, are not
22/// included in the prelude to avoid polluting the user's namespace.
23///
24/// ```
25/// use tiff_forge::write; // Helpers to write data to the file, particularly `Datablock`
26/// use tiff_forge::ifd::tags; // Constants for common tags in IFD entries
27/// ```
28///
29/// Note that `macro_rules!` for using [`ifd::types`] cannot (unfortunately) be re-exported
30/// in the prelude. This means you'll either have to explicitely import them or use `#[macro_use]`.
31///
32/// ```
33/// // Either
34/// #[macro_use]
35/// extern crate tiff_forge;
36///
37/// // Or
38/// use tiff_forge::{
39/// ASCII, BYTE, DOUBLE, FLOAT, LONG, RATIONAL,
40/// SBYTE, SHORT, SLONG, SRATIONAL, SSHORT, UNDEFINED
41/// };
42///
43/// # fn main() {}
44/// ```
45///
46/// [`ifd::types`]: ../ifd/types/index.html
47pub mod prelude {
48 #[doc(no_inline)]
49 pub use crate::file::BigTiffFile;
50 #[doc(no_inline)]
51 pub use crate::file::TiffFile;
52 #[doc(no_inline)]
53 pub use crate::ifd::Ifd;
54 #[doc(no_inline)]
55 pub use crate::ifd::IfdChain;
56 #[doc(no_inline)]
57 pub use crate::write::ByteBlock;
58
59 /// Type alias for BigTIFF IFD (64-bit offsets)
60 pub type BigIfd = crate::ifd::Ifd<u64>;
61 /// Type alias for BigTIFF IFD chain (64-bit offsets)
62 pub type BigIfdChain = crate::ifd::IfdChain<u64>;
63}