4.1 The Role of Quartz

Quartz is the foundation of Cocoa's 2D graphics capabilities. It provides many advanced graphics capabilities, including color management, path-based drawing, transparency, and anti-aliasing. It uses the same fundamental model of drawing as Adobe's Portable Document Format (PDF).

Quartz is actually two individual pieces of software in Mac OS XQuartz Compositor and Quartz 2D. The Quartz Compositor is the underlying system service responsible for drawing the graphical user interface to screen from sources such as Quartz 2D, QuickTime, OpenGL, and QuickDraw. Quartz 2D, on the other hand, is an Application Programming Interface (API) for drawing and manipulating 2D graphics. This chapter concentrates on Quartz 2D's drawing functionality.

You can access the Quartz 2D API directly through the CoreGraphics framework, but it is far more convenient to use the Cocoa classes that provide an easy-to-use interface to Quartz, including NSBezierPath, NSView, NSImage, and NSGraphicsContext. These classes provide the functionality to render paths, text, and images to screen or to the printed page.

    Part II: API Quick Reference