Module rast_tiling

rast_tiling — pure tile-grid geometry.

Description

rast_tiling — pure tile-grid geometry.

Splits a Width × Height raster into a regular grid of TileW × TileH tiles. Right/bottom edge tiles are clipped to the raster bounds (partial tiles), so every pixel is covered exactly once and no tile reads out of bounds.

No I/O, no processes — just arithmetic. This is the addressing layer the coordinator uses to drive windowed reads.

Data Types

tile()

tile() = #{x := non_neg_integer(), y := non_neg_integer(), w := pos_integer(), h := pos_integer()}

Function Index

tile_count/4Number of tiles covering a Width × Height raster with TileW × TileH tiles (edge tiles included).
tile_grid/4List every tile window, row-major (left-to-right, top-to-bottom).

Function Details

tile_count/4

tile_count(Width::pos_integer(), Height::pos_integer(), TileW::pos_integer(), TileH::pos_integer()) -> non_neg_integer()

Number of tiles covering a Width × Height raster with TileW × TileH tiles (edge tiles included).

tile_grid/4

tile_grid(Width::pos_integer(), Height::pos_integer(), TileW::pos_integer(), TileH::pos_integer()) -> [tile()]

List every tile window, row-major (left-to-right, top-to-bottom). Each tile is #{x, y, w, h} in pixel coordinates; edge tiles are clipped.


Generated by EDoc