Macintosh computers have enjoyed a strong association with graphics since they were first introduced to the world in 1984. That association undeniably began with the novelty of the graphical user interface. The platform evolved from its humble beginnings as a consumer computer, and as it grew, it retained its strong association to graphics. The platform attracted professionals in many graphics disciplines. In serving those needs, application developers have firmly established the Macintosh as an invaluable asset in today's graphics industry. Apple, for their part, works hard to meet the needs of graphics professionals and application developers alike. They have focused their efforts on creating a system with the power to satisfy the needs of professionals on both sides of the development equation. Macintosh has already taken a leadership role in emerging fields like digital photography and professional digital video production. The future promises to continue or even accelerate this trend. The classic Macintosh operating systems relied on the QuickDraw graphics library to provide a graphics system for the platform. As the demands of developers evolved, QuickDraw itself evolved, often in unexpected directions. Eventually, the needs of application developers began to outpace the ability of the QuickDraw technology to adapt. Apple took advantage of a rare opportunity when they introduced Mac OS X with a new graphics architecture. Quartz 2D is a portion of that architecture and carries the functionality that is closest to the drawing capabilities of QuickDraw. Quartz 2D itself is a modern, device independent library for creating 2D graphics. It is a vital component of the operating system and plays a prominent role in many other parts of the system, like the Aqua user interface and the Mac OS X printing system. This book offers an introduction to Quartz 2D for application developers. The objective is to introduce the Quartz 2D imaging model and explore some drawing techniques for applying that imaging model when creating graphics on Mac OS X. While Quartz 2D plays the many of the same roles that QuickDraw played on older operating systems, or that GDI plays on Windows, the imaging model it uses is quite different from those other libraries. This makes learning to use Quartz 2D a challenge. Because Apple has deprecated QuickDraw, many developers are now in a position of needing to rework their application's graphics system to use Quartz 2D. Developers porting applications from Windows or X11 also may find the differences in the imaging models troublesome. Many of the same techniques that a developer might use to optimize graphics with other graphics libraries cannot be applied to Quartz 2D. This book is designed to help programmers understand the differences among Quartz 2D and other graphics libraries and to learn new techniques they can apply through Quartz 2D. At times, this text focuses on QuickDraw because that technology is representative of a pixel-based graphics library and is likely to be familiar to Macintosh developers. However, the discussions should serve those who are bringing their applications to the Macintosh as well. As an added bonus, a very brief introduction to Core Image is given. Core Image is a high-performance architecture for creating and applying image processing filters to images. It has been included in this book not only because of its novelty, but because it is a very useful tool for creating 2D graphics. Core Image is remarkably easy to use and can generate impressive results quickly. The primary reason for including Core Image, however, is that along with Quartz 2D, Core Image represents the future of graphics on the Macintosh platform. This first chapter presents some preliminary information. We begin with an overview of the book and a short synopsis of the discussions to follow. Some of the more mundane aspects of accessing the library are covered, such as understanding the naming conventions in the Quartz 2D API. Also presented is a brief description of the Core Image API with some pointers on finding more information about Objective-C. |