Skip to main content

raster

Macro raster 

Source
macro_rules! raster {
    ($expr:expr) => { ... };
    ({ $($stmt:stmt);+ }) => { ... };
}
Expand description

Macro for compile-time raster algebra expressions

§Examples

use oxigdal_algorithms::raster;

// Simple NDVI calculation
let ndvi = raster!((NIR - RED) / (NIR + RED));

// Complex multi-band analysis with conditions
let result = raster! {
    let ndvi = (B8 - B4) / (B8 + B4);
    if ndvi > 0.6 then 1 else 0
};