Pages

Friday, March 6, 2009

Quartz 2D Graphics for Mac OS X Developers


Product Description

Core Graphics is the new graphics framework for Mac OS X. Quartz, the 2D drawing system, and Core Image, which processes both video and still images, are the key new technologies in this framework and provide the tools Mac OS X developers need to create and draw graphics for their applications that target the design-savvy Mac consumer audience. With the evolution of Mac OS X, Apple is phasing out use of its previous graphics framework, QuickDraw, and encouraging all developers to begin using Core Graphics. The model for Quartz is completely unique and entirely different from QuickDraw creating a steep learning curve for all developers moving over. This book is in an introduction and guide to working with Core Graphics, specifically Quartz and Core Image. It carries the developer through the fundamental Quartz models and basic concepts such as drawing, coordinating system basics, virtual paint, and CGContext. Once the fundamentals are covered, author Scott Thompson delves into more advanced topics such as shading, patterns, and manipulating image effects. Practical code examples enhance the discussion and offer Mac developers the information they need to incorporate these powerful graphics into their own Mac OS X Applications.
Product Details

* Amazon Sales Rank: #655504 in Books
* Published on: 2006-03-20
* Format: Illustrated
* Original language: English
* Number of items: 1
* Binding: Paperback
* 352 pages

Editorial Reviews

From the Back Cover
A Hands-On Guide and Introduction to Quartz 2D



On Mac OS X, Macintosh developers depend on the graphics and imaging frameworks of the Core Graphics system to implement multimedia features in their applications. With Core Graphics Apple has answered the increasing demands of graphics developers with a powerful collection of tools, including Quartz 2D and Core Image. Quartz 2D is a modern drawing API with a powerful imaging model. Beginning with Mac OS X 10.4, Tiger, Quartz 2D replaces the QuickDraw® graphics library in legacy applications and provides the functionality developers need to take advantage of the latest hardware.



Quartz 2D Graphics for Mac OS X® Developers is a hands-on guide and introduction to Quartz 2D. Differences between the interfaces and features of QuickDraw and Quartz 2D are making the switch challenging for developers. Through in-depth practical coverage, Mac developer and consultant Scott Thompson leads you smoothly through the transition and sets you on the path to developing cutting edge graphics in Core Image.



Through this invaluable guide, you will learn how to

* Forge connections between Quartz 2D and graphics devices using CGContexts
* Simplify the drawing process using transformations
* Draw line art using path-drawing operations on Bezier paths
* Use pixel data to create images
* Import and export images from Quartz 2D with Image I/O and QuickTime
* Generate text and implement special text effects
* Draw in offscreen environments, such as CGLayers and offscreen bitmaps
* Create shadings and patterns
* Create PDFs from Quartz 2D drawings or import PDFs into your drawings



If you depend on QuickDraw for your graphics needs, or are interested in a system that pushes the envelope in computer graphics, now is the time to make the switch to Core Graphics (Quartz 2D, Core Image). This is the book that walks you through that change–step-by-step!



The companion CD-ROM contains projects and source code covered in this book so you can run each sample. The samples demonstrate how to call Quartz 2D from both Carbon and Cocoa applications as well as from Mac OS X’s Python scripting interface.

About the Author

R. Scott Thompson is currently a software engineer at Mindjet Corporation (www.mindjet.com). He has been a professional Macintosh developer since 1993. Working with Apple as an independent consultant he helped developers move their applications from the classic Mac OS to Mac OS X. Prior to that, Scott was an engineer with Macromedia helping to create a popular PostScript-based print publishing application.

Excerpt. © Reprinted by permission. All rights reserved.
Preface

The graphics systems available to Macintosh applications have evolved very quickly over the past few years. Prior to the introduction of Mac OS X, the primary focus of all Macintosh graphics was the QuickDraw graphics library. QuickDraw not only provided the tools that applications needed to draw into their windows, but it also played a role in managing the screen, handling events, and changing the cursor. As the demands placed on the graphics system increased, Apple discovered that a reliance on QuickDraw imparted some limitations to their capability to expand the graphics system. During the transition to Mac OS X, many of QuickDraw's responsibilities migrated to other portions of the system. To handle many of the drawing and screen management tasks, Apple introduced a new graphics system called Quartz. In programming circles, Quartz is also known as Core Graphics.

Quartz not only handles many of the responsibilities of QuickDraw, it is the platform on which many of the innovations in the Mac OS X graphics system are built. For example, Core Graphics has taken over the job of collecting the images of windows and combing them on the screen. In performing this task, it takes advantage of modern graphics hardware to improve performance and introduce features such as translucent windows to the system. The end result is a remarkably flexible graphics system. Quartz allows applications to seamlessly integrate technologies as diverse as the motion graphics of QuickTime and the 3D graphics of OpenGL onto the same screen or even into the same window.

With the introduction of Mac OS X 10.4, Tiger, Apple has deprecated QuickDraw—and that library will not evolve any farther. Applications that only rely on QuickDraw for drawing will not enjoy any innovations Apple makes in the graphics system. Even worse, in the future, applications that rely on QuickDraw may actually pay a performance penalty. Any program that wants to take full advantage of the graphics system on Mac OS X will have to replace their QuickDraw drawing code with a more modern alternative. Apple recommends that application developers replace their QuickDraw graphics code with similar code that uses Quartz 2D.

Quartz 2D is a part of the Core Graphics system. It is a modern graphics library based on the imaging model that Adobe created originally for PostScript printers and later as part of the PDF graphics file format. This is the same imaging model that graphics professionals have used for several years to create the artwork on everything from books and advertisements to application splash screens and on-line games.

The Quartz 2D drawing model allows you to create sophisticated graphics with a simple API. The Quartz 2D imaging model is quite different from the drawing models of other graphics libraries. Its library can draw to many kinds of graphics devices while maximizing the fidelity of the graphics on each device. As a result, developers familiar other graphics libraries such as QuickDraw, GDI from Microsoft Windows, or the graphics portions of X11's XLib face a learning curve when trying to work with the device and resolution independent drawing model in Quartz 2D.

The objective of this book is to present a practical introduction to Quartz 2D. Its aim is to help all programmers understand the Quartz 2D imaging model and make effective use of the library from any application environment. Most importantly, the text compares and contrasts the Quartz 2D imaging model with the pixel-based graphics models of other libraries. While this will be of particular value to developers making the transition from QuickDraw or GDI to Quartz 2D, it also provides valuable insight into how to use Quartz 2D effectively. The hope is that this information will be invaluable to anyone trying to draw graphics using Quartz 2D.

© Copyright Pearson Education. All rights reserved.

Customer Reviews

Informative but Irrelevant. Obsolete!2
This was great for learning quartz in TIGER but a lot of the examples don't compile in Leopard. A lot of stuff is also (bizarrely) written in C++ in Carbon. Almost the first sentence of every other Mac programming book I've ever read was "Use Cocoa and Objective C". Almost every paragraph in the book tells Cocoa programmers where to look for documentation instead. Even the examples that are written in Cocoa are in "Objective-C++" (.mm).

Granted it was a decent introduction to Quartz and drawing, but if you want to take anything out of the book you have to follow the author's links to where to learn about Cocoa, open up your developer library, and translate everything into actual Objective-C yourself.

So unless you plan on developing for Tiger for the rest of your life, stick to Apple's online documentation for learning how to write Mac OS X applications.

Good, albeit overpriced, overview of Quartz 2D Graphics4
I just purchased this book today at the full list price of $49.99. This is too much IMO for a 300 page overview of a graphics system (no matter how well written.) That said, by chapter 2 I've already noticed a number of mistakes not picked up by editors (probably because the words substituted are not incorrectly spelled: ie. 'inherit' instead of 'inherent', or 'combing' instead of 'combining') Maybe I'm just being nitpicky, but I'm growing tired of laziness on the part of publishing houses.

All in all, this is a good introduction to the topic. For the discounted Amazon price, it's worth the money.

Great Overview5
Well presented material. Good overview of state-of-the-art Mac graphics. Simply written. Good reference.