pub struct BufferedElevations {
pub elevations: Vec<f64>,
pub buffer: u32,
pub tile_grid_size: u32,
}Expand description
Elevations sampled on a grid that extends buffer cells beyond the
tile on each side.
Used by buffered_gradient_normals so that adjacent tiles read the
same DEM samples at any shared physical position. This is the same
idea as a raster “buffer” or image “padding”: a strip of neighbour
data around the tile that lets edge vertices compute the same
gradient that the neighbour tile would compute.
§Layout
Row-major, north → south, (tile_grid_size + 2*buffer) samples per
side. The inner tile_grid_size × tile_grid_size block corresponds
to the tile itself; the surrounding strip of width buffer cells is
sampled from the neighbour tiles’ DEM (or any DEM source covering
that physical area), so vertices on the absolute tile edge can still
read their ±1 neighbours via the buffer cells.
Fields§
§elevations: Vec<f64>Elevation samples ((tile_grid_size + 2*buffer)² entries,
row-major north → south, NaN allowed for missing data).
buffer: u32Number of buffer cells on each side.
tile_grid_size: u32Tile grid size (e.g. 65 for a Cesium-style 64-cell tile).
The full buffered grid is (tile_grid_size + 2*buffer) per side.
Implementations§
Source§impl BufferedElevations
impl BufferedElevations
Sourcepub fn new(elevations: Vec<f64>, tile_grid_size: u32, buffer: u32) -> Self
pub fn new(elevations: Vec<f64>, tile_grid_size: u32, buffer: u32) -> Self
Create a buffer-extended elevation grid.
§Panics
Panics if elevations.len() does not equal
(tile_grid_size + 2*buffer)².
Sourcepub fn buffered_grid_size(&self) -> u32
pub fn buffered_grid_size(&self) -> u32
Width/height of the full buffer-extended grid in samples.
Trait Implementations§
Source§impl Clone for BufferedElevations
impl Clone for BufferedElevations
Source§fn clone(&self) -> BufferedElevations
fn clone(&self) -> BufferedElevations
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BufferedElevations
impl RefUnwindSafe for BufferedElevations
impl Send for BufferedElevations
impl Sync for BufferedElevations
impl Unpin for BufferedElevations
impl UnsafeUnpin for BufferedElevations
impl UnwindSafe for BufferedElevations
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more