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:

    That, upon the whole, we may conclude that the Christian religion not only was at first attended with miracles, but even at this day cannot be believed by any reasonable person without one. Mere reason is insufficient to convince us of its veracity: And whoever is moved by Faith to assent to it, is conscious of a continued miracle in his own person, which subverts all the principles of his understanding, and gives him a determination to believe what is most contrary to custom and experience.
    David Hume (1711–1776)

    When great changes occur in history, when great principles are involved, as a rule the majority are wrong.
    Eugene V. Debs (1855–1926)