4.9 Compositing
Unless stated otherwise, compositing functions assume every flomap argument has an alpha component.
procedure
(flomap-pin fm1 x1 y1 fm2) → flomap
fm1 : flomap x1 : Integer y1 : Integer fm2 : flomap (flomap-pin fm1 x1 y1 fm2 x2 y2) → flomap fm1 : flomap x1 : Integer y1 : Integer fm2 : flomap x2 : Integer y2 : Integer
fm1 and fm2 must have the same number of components.
> (flomap-pin fm -10 -10 sine-fm) flomap-pin: expected two flomaps with the same number of
components; given one with 4 and one with 1
> (define circle-fm (draw-flomap (λ (fm-dc) (send fm-dc set-pen "black" 4 'short-dash) (send fm-dc set-brush "yellow" 'solid) (send fm-dc set-alpha 1/2) (send fm-dc draw-ellipse 2 2 124 124)) 128 128)) > (flomap->bitmap (flomap-pin fm 0 0 circle-fm 64 64)) > (flomap->bitmap (flomap-pin sine-fm 50 0 sine-fm))
The other compositing functions are defined in terms of flomap-pin.
procedure
(flomap-pin* x1-frac y1-frac x2-frac y2-frac fm0 fm ...) → flomap x1-frac : Real y1-frac : Real x2-frac : Real y2-frac : Real fm0 : flomap fm : flomap
The pin-over points are calculated from the four real arguments as follows. If fm1 is size w1×h1, then x1 = (* w1 x1-frac) and y1 = (* h1 y1-frac), and similarly for x2 and y2.
> (flomap->bitmap (flomap-pin* 1/8 1/8 0 0 circle-fm circle-fm circle-fm))
All the flomap superimpose and append functions are defined using flomap-pin* with different pin-over point fractions. For example, (flomap-lt-superimpose fm0 fm ...) = (flomap-pin* 0 0 0 0 fm0 fm ...), and (flomap-vc-append fm0 fm ...) = (flomap-pin* 1/2 1 1/2 0 fm0 fm ...).
procedure
(flomap-lt-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-lc-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-lb-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-ct-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-cc-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-cb-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-rt-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-rc-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-rb-superimpose fm0 fm ...) → flomap
fm0 : flomap fm : flomap
> (flomap->bitmap (flomap-lt-superimpose fm circle-fm))
procedure
(flomap-vl-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-vc-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-vr-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-ht-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-hc-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
procedure
(flomap-hb-append fm0 fm ...) → flomap
fm0 : flomap fm : flomap
> (flomap->bitmap (flomap-ht-append circle-fm fm (flomap-scale circle-fm 1/2)))