Page 123 Table of Contents Index Page 125
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

=> compose-out ink mask [Generic Function]
Composes a new design by clipping the design ink to the outside 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 1 minus the stencil opacity of mask.

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

If both arguments are regions, compose-out is the same as region-difference of mask and
ink.

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

14.2 Patterns and Stencils

Patterning creates a bounded rectangular arrangement of designs, like a checkerboard. Drawing
a pattern draws a different design in each rectangular cell of the pattern. To create an infinite
pattern, apply make-rectangular-tile to a pattern.

A stencil is a special kind of pattern that contains only opacities.

=> make-pattern array designs [Function]
Returns a pattern design that has (array-dimension array 0) cells in the vertical direction and
(array-dimension array 1) cells in the horizontal direction. array must be a two-dimensional
array of non-negative integers less than the length of designs. designs must be a sequence of
designs. The design in cell (i;j) of the resulting pattern is the nth element of designs, if n is the
value of (aref array i j). For example, array can be a bit-array and designs can be a list of
two designs, the design drawn for 0 and the one drawn for 1.

Each cell of a pattern can be regarded as a hole that allows the design in it to show through.
Each cell might have a different design in it. The portion of the design that shows through a
hole is the portion on the part of the drawing plane where the hole is located. In other words,
incorporating a design into a pattern does not change its alignment to the drawing plane, and
does not apply a coordinate transformation to the design. Drawing a pattern collects the pieces
of designs that show through all the holes and draws the pieces where the holes lie on the drawing
plane. The pattern is completely transparent outside the area defined by the array.

Each cell of a pattern occupies a 1 by 1 square. You can use transform-region to scale the
pattern to a different cell size and shape, or to rotate the pattern so that the rectangular cells


Page 123 Table of Contents Index Page 125
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