Page 95 Table of Contents Index Page 97
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 12. GRAPHICS

costly intermediate results and to take advantage of available hardware.

12.4 Rendering Conventions for Geometric Shapes

The intent of this section is to describe the conventions for how CLIM should render a shape on
a display device. These conventions and the accompanying examples are meant to describe a set
of goals that a CLIM implementation should try to meet. However, compliant CLIM implemen-
tations may deviate from these goals if necessary (for example, if the rendering performance on
a specific platform would be unacceptably slow if these goals were met exactly and implementors
feel that users would be better served by speed than by accuracy). Note that we discuss only
pixel-based display devices here, which are the most common, but by no means the only, sort of
display device that can be supported by CLIM.

When CLIM draws a geometric shape on some sort of display device, the idealized geometric
shape must somehow be rendered on the display device. The geometric shapes are made up of a
set of mathematical points, which have no size; the rendering of the shape is usually composed
of pixels, which are roughly square. These pixels exist in "device coordinates", which are gotten
by transforming the user-supplied coordinates by all of the user-supplied transformation, the
medium transformation, and the transformation that maps from the sheet to the display device.
(Note that if the last transformation is a pure translation that translates by an integer multiple
of device units, then it has no effect on the rendering other than placement of the figure drawn
on the display device.)

Roughly speaking, a pixel is affected by drawing a shape only when it is inside the shape (we will
define what we mean by "inside" in a moment). Since pixels are little squares and the abstract
points have no size, for most shapes there will be many pixels that lie only partially inside
the shape. Therefore, it is important to describe the conventions used by CLIM as to which
pixels should be affected when drawing a shape, so that the proper interface to the per-platform
rendering engine can be constructed. (It is worth noting that on devices that support color or
grayscale, the rendering engine may attempt to draw a pixel that is partially inside the shape
darker or lighter, depending on how much of it is inside the shape. This is called anti-aliasing.)
The conventions used by CLIM is the same as the conventions used by X11:


Page 95 Table of Contents Index Page 97
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