Skip to main content

Crate surtgis_relief

Crate surtgis_relief 

Source
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

§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§

ColormapParams
Parameters for colormap rendering.
RayShadeParams
Parameters for ray_shade.
ReliefBuilder
Order-preserving accumulator for relief layers.
RgbaImage
Row-major 8-bit RGBA pixel buffer.
SunSample
A single sun position.
WaterParams
Parameters for detect_water.

Enums§

ColorScheme
Available color schemes.
EncodeError
ReliefError
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 path as 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
Result alias scoped to this crate.