QuickDraw - Principles of QuickDraw

Principles of QuickDraw

QuickDraw was grounded in the Apple Lisa's LisaGraph of the early 1980s and was designed to fit well with the Pascal-based interfaces and development environments of the early Apple systems. In addition, QuickDraw is a raster graphics system, which defines the pixel as its basic unit of graphical information. This is in contrast to vector graphics systems, where graphics primitives are defined in mathematical terms and rasterized as required to the display resolution. A raster system requires much less processing power however, and was the prevailing paradigm at the time that QuickDraw was developed.

QuickDraw defines a key data structure, the graphics port, or GrafPort. This is a logical drawing area where graphics can be drawn. The most obvious on-screen "object" corresponding to a GrafPort is a window, but the entire desktop view can be a GrafPort, and off-screen ports can also exist.

The GrafPort defines a coordinate system. In QuickDraw, this has a resolution of 16 bits, giving 65,536 unique vertical and horizontal locations. These are numbered from -32,767 on the extreme left (or top), to +32,768 on the extreme right (or bottom). A window is usually set up so that the top, left corner of its content area is located at 0,0 in the associated GrafPort . A window's content area does not include the window's frame, drop shadow or title bar (if any).

QuickDraw coordinates refer to the infinitely thin lines between pixel locations. An actual pixel is drawn in the space to the immediate right and below the coordinate. This makes it easier for programmers to avoid graphical glitches caused by off-by-one errors.

On the Macintosh, pixels are square and a GrafPort has a default resolution of 72 pixels per inch, chosen to match conventions established by the printing industry of having 72 points to the inch.

QuickDraw also contains a number of scaling and mapping functions.

QuickDraw maintains a number of global variables per process, chief among these being the current port. This originally simplified the API, since all operations pertain to "the current port", but as the OS has developed, this use of global state has also made QuickDraw much harder to integrate with modern design approaches such as multi-threading, pre-emptive multitasking and so on. To address these problems, the Carbon API (a bridge between Mac OS 9 and OS X) adds additional parameters to some of the routines, allowing for the (opaque) storage of thread information and a new (non-polled) event structure.

Read more about this topic:  QuickDraw

Famous quotes containing the words principles of and/or principles:

    It seems to me that man is made to act rather than to know: the principles of things escape our most persevering researches.
    Frederick The Great (1712–1786)

    Ah, I fancy it is just the same with most of what you call your “emancipation.” You have read yourself into a number of new ideas and opinions. You have got a sort of smattering of recent discoveries in various fields—discoveries that seem to overthrow certain principles which have hitherto been held impregnable and unassailable. But all this has only been a matter of intellect, Miss West—superficial acquisition. It has not passed into your blood.
    Henrik Ibsen (1828–1906)