4.6 Gradients and Normals
procedure
(flomap-gradient-x fm) → flomap
fm : flomap
procedure
(flomap-gradient-y fm) → flomap
fm : flomap
These return, per-component, estimates of the local x- and y-directional derivatives using a 3×3 Scharr operator.
procedure
(flomap-gradient fm) →
flomap flomap fm : flomap
Examples:
> (define-values (dx-fm dy-fm) (flomap-gradient (flomap-drop-components fm 1)))
> (values (flomap->bitmap (fm* 0.5 (fm+ 1.0 dx-fm))) (flomap->bitmap (fm* 0.5 (fm+ 1.0 dy-fm))))
procedure
(flomap-gradient-normal fm) → flomap
fm : flomap
Given a one-component flomap, returns a 3-component flomap containing estimated normals.
In other words, flomap-normal converts height maps to normal maps.
Examples:
> (flomap->bitmap sine-fm) > (flomap->bitmap (flomap-gradient-normal sine-fm)) > (flomap-gradient-normal fm) flomap-gradient-normal: expected argument of type <flomap
with 1 component>; given: (flomap (flvector 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0...