Expand description
§SurtGIS Relief
Rayshader-style shaded-relief compositing on top of the terrain primitives
that already live in surtgis-algorithms. This crate is a compositor,
not a new set of algorithms — see SPEC_SURTGIS_RELIEF.md in the
repository root for the full design.
§What lives here
ray_shade— ray-traced cast shadows viasurtgis_algorithms::terrain::horizon_angle_map_fast, with optional soft-shadow averaging over multiple sun samples.sphere_shade— normal-based hillshade as an intensity layer in[0, 1], wrappingsurtgis_algorithms::terrain::hillshade.
§What is re-exported
Pixel-buffer and PNG output live in
surtgis_colormap; we re-export the relevant types
at the crate root for ergonomics.
ⓘ
use surtgis_relief::{ray_shade, sphere_shade, RayShadeParams, SunSample, RgbaImage};
let shadow_mask = ray_shade(&dem, &RayShadeParams::default())?;
let mut img = RgbaImage::from_intensity(&sphere_shade(&dem, Default::default())?);
let shadow_layer = RgbaImage::from_intensity(&shadow_mask);
img.multiply(&shadow_layer, 0.5)?;
img.save_png("relief.png")?;Structs§
- Colormap
Params - Parameters for colormap rendering.
- RayShade
Params - Parameters for
ray_shade. - Relief
Builder - Order-preserving accumulator for relief layers.
- Rgba
Image - Row-major 8-bit RGBA pixel buffer.
- SunSample
- A single sun position.
- Water
Params - Parameters for
detect_water.
Enums§
- Color
Scheme - Available color schemes.
- Encode
Error - Relief
Error - Errors produced by the relief crate.
Functions§
- ambient_
shade - Compute the ambient-occlusion intensity layer.
- cast_
shadow_ ray_ mask - Per-cell binary shadow mask:
1.0= lit,0.0= in shadow. - detect_
water - Detect water bodies as large flat connected components.
- horizon_
tan_ map - Per-cell maximum
tan(angle_to_occluder)along a single azimuth. - ray_
shade - Ray-traced cast shadows.
- rgba_
to_ png_ bytes - Encode an arbitrary RGBA byte buffer as PNG. Native target only.
- save_
png - Write an RGBA buffer to
pathas a PNG. Native target only. - sphere_
shade - Normal-based hillshade as intensity in
[0, 1]. - water_
depth - Compute per-cell water depth from a binary water mask. Returns a
Raster<f32>where every water cell holds its 8-connected Chebyshev distance (in cells) to the nearest non-water neighbour. Shore cells → 1.0, deepest centres of large lakes → large values. Non-water cells return 0.0.
Type Aliases§
- Result
Resultalias scoped to this crate.