Programming with Quartz: 2D and PDF Graphics in Mac OS X

The Apple Mac OS X operating system contains a powerful 2D graphics imaging library called Quartz. A large part of what gives the Mac OS X user interface the rich look that it has is the use of Quartz drawing by the Aqua user interface and the built-in application toolkits.
The Quartz 2D drawing library allows applications to draw text, curves and shapes, images, and Portable Document Format (PDF) documents in amazingly flexible ways. This rich drawing library supports drawing graphics to an onscreen window or an offscreen bitmap and creating new PDF documents or PostScript output data.
Quartz 2D is also known as Core Graphics, which is frequently abbreviated as CG. Quartz is a term aimed at consumers, whereas Core Graphics is known to many programmers. The Quartz 2D technology is implemented primarily in the Apple Core Graphics framework (ApplicationServices.framework/Frameworks/CoreGraphics.framework), so it's important that you equate one term with the other. All Quartz 2D function calls use the prefix CG. In this book, the terms Quartz, Quartz 2D, and Core Graphics are synonymous with "Quartz 2D drawing library" unless stated otherwise.
The history of Quartz is partly told by the story of the evolution of graphics programming on the Macintosh computer, starting with the Mac's introduction in 1984. While not strictly necessary to understand Quartz itself, its history provides insight into its power and what you can accomplish with it. There are two main players in this story the graphics capabilities provided by the Macintosh and...