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
90
91
92
93
94
//! A library to generate multi-resolution cubemap tiles and Pannellum-compatible configurations
//! from equirectangular or cylindrical panoramas.
//!
//! # Overview
//! `panorama-tiler` processes a single stitched panorama image into:
//! 1. Six cubemap face images (`front`, `back`, `up`, `down`, `left`, `right`).
//! 2. A multi-resolution pyramid containing cropped tile segments at configurable zoom levels.
//! 3. A JSON configuration file (`config.json`) mapped directly to Pannellum's configuration format.
//!
//! # Feature Flags
//! - **`metadata`** (Enabled by default): Enables automatic projection angle and crop detection using XMP and EXIF tags.
//! - **`webp`** (Enabled by default): Adds support for encoding tile output in the WebP format.
//!
//! # Examples
//!
//! ### Automatic Metadata Processing
//! If the source panorama contains valid EXIF or `GPano` XMP tags, you can process the image with
//! automatic angle extraction:
//!
//! ```rust,no_run
//! # #[cfg(feature = "metadata")]
//! # {
//! use panorama_tiler::{OutputConfig, OutputFormat, tile_panorama_with_guessed_angles};
//! use std::path::Path;
//!
//! fn main() -> Result<(), panorama_tiler::TilerError> {
//! let input = Path::new("input_photosphere.jpg");
//! let output = Path::new("tiles_output");
//!
//! let config = OutputConfig {
//! format: OutputFormat::Webp,
//! quality: 85,
//! ..Default::default()
//! };
//!
//! tile_panorama_with_guessed_angles(input, output, Some(config))?;
//! Ok(())
//! }
//! # }
//! ```
//!
//! ### Manual Configuration Processing
//! If metadata tags are absent, parameters can be passed manually:
//!
//! ```rust,no_run
//! use panorama_tiler::{
//! TilerConfig, PanoAngles, OutputConfig, Projection, OutputFormat, tile_panorama
//! };
//! use std::path::Path;
//!
//! fn main() -> Result<(), panorama_tiler::TilerError> {
//! let config = TilerConfig {
//! angles: PanoAngles {
//! haov: 180.0,
//! vaov: 90.0,
//! projection: Projection::Cylindrical,
//! ..Default::default()
//! },
//! output: OutputConfig {
//! tile_size: 512,
//! format: OutputFormat::Jpeg,
//! quality: 85,
//! ..Default::default()
//! },
//! };
//!
//! tile_panorama(
//! Path::new("input_pano.jpg"),
//! Path::new("tiles_output"),
//! &config,
//! )?;
//! Ok(())
//! }
//! ```
pub use *;
pub use TilerError;
pub use *;
pub use *;