blob: 8834dd9232e3673fb8565ca874b58232af225f4e [file] [log] [blame]
TWIN: a tiny window system
2004/8/23
Keith Packard
HP Cambridge Research Laboratory
1. Introduction
twin is a window system designed for devices with constrained memory, CPU
and display space.
2. Pixel formats
twin supports a limited set of pixel formats; additional formats introduce
significant cost into the system.
Name Bits Content
A8 8 8-bit A
RGB16 16 5-6-5 RGB
ARGB32 32 8-8-8-8 ARGB
3. Objects
twin unifies onscreen and offscreen data in a single 'pixmap' object. The
screen is constructed from a list of pixmaps composited together to form the
final image. Pixmaps contain position, width height and stride
information and stacking information. A pixmap is "on screen" if it is
included in the list of on-screen pixmaps.
4. Operators
twin is architected with an abstract single operator that performs all of
the basic pixel manipulation. That operator is:
dest = source IN mask OP dest
IN is the Porter/Duff operator of the same name, OP is either OVER or
SOURCE. If necessary, OP may be extended in the future to cover additional
Porter/Duff operators.
In the above operator, Source and mask may be replaced with constant values,
mask may be elided (in which case it is implicitly replaced with a constant
opaque pixel).
5. Screen Generation
The screen image is generated by compositing the list of displayed pixmaps.
Displayed pixmaps may be in any format which contains RGB data. Underneath
all of the windows the screen is white.
6. Geometric figures
Geometry can be displayed by computing an appropriate A8 pixmap and
compositing the result to a pixmap.
7. Paths
To draw the A8 pixmap mentioned above, use a combination of move, draw
and curve primitives to construct a path and then fill it. To outline a
path, use the convolution operator to convolve a pen with the path to
construct a closed path surrounding the stroke.