Bit-Boundary Block Transfer

In the 1980s, bitmap graphics used a powerful primitive called bitblt. Bitblt combined a rectangle of a source image with a similarly-sized rectangle in a destination image using a boolean function and replaced the destination rectangle with the boolean result.

Dan Ingalls invented bitblt for the Alto workstation developed at Xerox PARC. Rob Pike and Bart Locanthi used bitblt as the graphics primitive and the name for the Blit, the first graphical terminal for Unix.

At the 1984 SIGGRAPH conference, Ingalls, Leo Guibas (also at Xerox PARC), and Pike gave a course on the history, use, and implementation of bitblt. The course notes from 1984 (pdf, 68 pages, 5MB) have a wealth of information about bitblt, including area-filling, bitmap rotation, bitmap magnification, implementation via on-the-fly code generation, line-drawing, text manipulation, and more.

Posted on Monday, January 7, 2008. page by Russ Cox

~

Bitmap Graphics SIGGRAPH’84 Course Notes

When the bitmap display on the Alto, Xerox's personal computer, was first being used, its programmers wrote a number of subroutines for special purpose tasks such as character draw­ing, highlighting, and copying rectangles. These subroutines all contained similar code to deal with problems such as bitfield insertion and rectangles with edges within words. Dealing with all these problems in a single, general operator looked forbidding, but the time spent reinvent­ ing the inner loops was becoming frustrating, so in 1975 Dan Ingalls and Diana Merry at Xerox PARC encapsulated the operation of copying a bit string from one location to another in a prim­itive they called bitbit for [[bit-boundary block transfer.

The first bitbit operated on a single scan line, but the outer loop was later added, making bitbit a rectangle operator. As bitbit was experimented with, it proved to be so useful that it is now the central graphics primitive on a number of bitmap displays.

These notes explain why bitbit is so successful. They are an overview of our understanding of bitmap graphics based on bitbit. They address the basic properties of bitmap displays, bitbit itself, and associated operators such as line-drawing primitives. Because the pixels on 'bitmap displays are usually represented by a single bit, Boolean algebra applies to the pixels, and the rectangular operators form a simple algebra. Using this algebra, the primitives may be com­ posed to build algorithms for rotation, magnification, area filling and other traditional graphics applications.

Bitmap displays demand large amounts of memory and processing power. It is important that bitbit be implemented efficiently, since inefficiencies can result in (literally) visible degrada­tions of performance, even for a single invocation. Unfortunately, though, implementing bitbit efficiently is a difficult problem. Later, we will present a complete, correct, very slow imple­mentation of bitbit, but one simple and small enough to be understood easily. The following sections discuss techniques for improving its performance, and illustrate these by showing how they have been used, and how well they worked, in actual systems.

Next, we discuss how bitbit can be used for programming interactive graphics applications. Structured picture elements such as text, menus and windows are easily implemented using bitbit, but using them well requires some understanding of how bitbit itself behaves. Applica­tions such as bitmap paint programs also depend critically on the semantics of bitbit.

The most important consideration through all these discussions is the integrated Viewpoint that bitbit provides. The details of hardware and software implementation focus on a single operator that provides a rational, powerful model for raster graphics. Bitmap devices are popu­lar because their style of graphics is convenient and flexible, but it is bitbit that makes that style, manageable. By simultaneously addressing the issues of efficiency, representation and access, bitbit makes it possible to ignore the low-level detail inherent in bitmap displays, and attend to the more important and useful task of building an interactive graphics environment. Represen­ tative displays from some of the systems that have been built using bitbit are shown in Figure 1.

The reason we have assembled these notes is that, despite its importance, little has been written about bitblt in the literature, to the point that hardware manufacturers who are not 'in the know' make serious mistakes in the implementation of their systems. Until now, too much information about bitblt has been available only as folklore. By discussing the algorithmic, implementation and systems-level basics and implications of bitblt, we hope to enlarge the com­munity of bitblt-knowledgeable people, and prevent the development of bitblt-antagonistic hardware.