pixel-indices ( coords dim -- indices )


Vocabulary
terrain

Inputs
coordsan object
diman object


Outputs
indicesan object


Definition


:: pixel-indices ( coords dim -- indices )
coords vfloor v>integer dim clamp-coords
:> floor-coords floor-coords first2 dim first * +
:> base-index base-index dim first +
:> next-row-index base-index base-index 1 +
next-row-index next-row-index 1 + 4array ;