Page 122 Table of Contents Index Page 124
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 14. GENERAL DESIGNS


14.1 The Compositing Protocol

Compositing creates a design whose appearance at each point is a composite of the appearances
of two other designs at that point. Three varieties of compositing are provided: composing over,
composing in, and composing out.

The methods for compose-over, compose-in, and compose-out will typically specialize both of
the design arguments.

In Release 2, compositing might only be supported for uniform designs.

=> compose-over design1 design2 [Generic Function]
Composes a new design that is equivalent to the design design1 on top of the design design2.
Drawing the resulting design produces the same visual appearance as drawing design2 and then
drawing design1, but might be faster and might not allow the intermediate state to be visible
on the screen.

If both arguments are regions, compose-over is the same as region-union.

This function is permitted to capture its mutable inputs; the consequences of modifying those
objects are unspecified. The result returned by compose-over might be freshly constructed or
might be an existing object.

=> compose-in ink mask [Generic Function]
Composes a new design by clipping the design ink to the inside of the design mask. The first
design, ink, supplies the color, while the second design, mask, changes the shape of the design
by adjusting the opacity.

More precisely, at each point in the drawing plane the resulting design specifies a color and an
opacity as follows: the color is the same color that ink specifies. The opacity is the opacity that
ink specifies, multiplied by the stencil opacity of mask.

The stencil opacity of a design at a point is defined as the opacity that would result from drawing
the design onto a fictitious medium whose drawing plane is initially completely transparent black
(opacity and all color components are zero), and whose foreground and background are both
opaque black. With this definition, the stencil opacity of a member of class opacity is simply
its value.

If mask is a solid design, the effect of compose-in is to clip ink to mask. If mask is translucent,
the effect is a soft matte.

If both arguments are regions, compose-in is the same as region-intersection.

This function is permitted to capture its mutable inputs; the consequences of modifying those
objects are unspecified. The result returned by compose-in might be freshly constructed or
might be an existing object.


Page 122 Table of Contents Index Page 124
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E