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
//! [`RasterLayer`] trait — what a raster-format reader exposes.
//!
//! Mirrors the vector [`Layer`](crate::Layer) trait but with raster
//! semantics: instead of iterating features, callers issue
//! `read_tile(level, x, y)` to pull one chunk of pixels at a chosen
//! pyramid level. The level-0 origin is the full-resolution image;
//! higher levels are coarser overviews (level 1 = ½ resolution per side,
//! level 2 = ¼, …).
//!
//! ## Object safety
//!
//! Object-safe so format-polymorphic code (`geonative-convert`'s
//! `RasterSource`) can dispatch on `Box<dyn RasterLayer>`. The trait
//! intentionally returns owned [`RasterTile`]s (not borrows) so
//! implementations can either decode into a fresh buffer or hand off a
//! pre-decoded one without lifetime gymnastics.
use crateResult;
use ;
/// Read-only access to a raster layer.
/// Resampling strategies used by `processing::raster::reproject` and
/// `processing::raster::resample`. Defined here in `core` so format
/// crates that produce overviews can pick one without depending on
/// `geonative-processing`.