Module rast_nif

rast_nif — native raster tile kernels.

Description

rast_nif — native raster tile kernels.

Low-level, binary-first, per-tile kernels implemented in Rust (see native/rast/src/lib.rs). All functions take and return little-endian binaries and run on dirty CPU schedulers.

Prefer the rast façade in application code; this module is the raw NIF surface.

Function Index

convolve_f32/6Valid 2-D cross-correlation of an f32 tile (SrcW × SrcH) with a KW × KH f32 kernel.
decode_u16_to_f32/2Decode a little-endian u16 tile binary to a little-endian f32 binary, multiplying each sample by Scale (1.0 for a plain widening cast).
ndvi_f32/2NDVI (NIR - Red) / (NIR + Red) from two little-endian f32 tile binaries.
ndvi_u16/2NDVI (NIR - Red) / (NIR + Red) from two u16 tile binaries, fused with u16 -> f32 widening.
pad_replicate_f32/7Replicate-pad an f32 tile by Left/Top/Right/Bottom rows/cols.

Function Details

convolve_f32/6

convolve_f32(Src::binary(), SrcW::pos_integer(), SrcH::pos_integer(), Kernel::binary(), KW::pos_integer(), KH::pos_integer()) -> {ok, binary()} | {error, term()}

Valid 2-D cross-correlation of an f32 tile (SrcW × SrcH) with a KW × KH f32 kernel. Output is (SrcW-KW+1) × (SrcH-KH+1) f32.

decode_u16_to_f32/2

decode_u16_to_f32(Data::binary(), Scale::float()) -> {ok, binary()} | {error, term()}

Decode a little-endian u16 tile binary to a little-endian f32 binary, multiplying each sample by Scale (1.0 for a plain widening cast).

ndvi_f32/2

ndvi_f32(Nir::binary(), Red::binary()) -> {ok, binary()} | {error, term()}

NDVI (NIR - Red) / (NIR + Red) from two little-endian f32 tile binaries. Returns an f32 binary; 0.0 where NIR + Red == 0.

ndvi_u16/2

ndvi_u16(Nir::binary(), Red::binary()) -> {ok, binary()} | {error, term()}

NDVI (NIR - Red) / (NIR + Red) from two u16 tile binaries, fused with u16 -> f32 widening. Returns an f32 binary; 0.0 where NIR + Red == 0.

pad_replicate_f32/7

pad_replicate_f32(Src::binary(), W::pos_integer(), H::pos_integer(), Left::non_neg_integer(), Top::non_neg_integer(), Right::non_neg_integer(), Bottom::non_neg_integer()) -> {ok, binary()} | {error, term()}

Replicate-pad an f32 tile by Left/Top/Right/Bottom rows/cols. Output is (W+Left+Right) × (H+Top+Bottom).


Generated by EDoc