BN.com Gift Guide

Quartz 2D Graphics for Mac OS X Developers

Overview

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 ...

See more details below
$49.49
BN.com price
(Save 10%)$54.99 List Price
Other sellers (Other Format)
  • All (10) from $7.20   
  • New (5) from $30.13   
  • Used (5) from $7.20   
Sending request ...

Overview

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.

Read More Show Less

Product Details

  • ISBN-13: 9780321336637
  • Publisher: Addison-Wesley
  • Publication date: 3/13/2006
  • Pages: 352
  • Product dimensions: 6.90 (w) x 9.10 (h) x 0.70 (d)

Meet 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.

Read More Show Less

Read an Excerpt

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.

Read More Show Less

Table of Contents

Preface xv

Chapter 1: Getting Started 1

Chapter 2: From QuickDraw to Quartz 2D 15

Chapter 3: Introduction to Quartz 2D 37

Chapter 4: The Graphics Context 69

Chapter 5: Transformations 103

Chapter 6: Line Art–Building Paths 135

Chapter 7: Line Art–Drawing 163

Chapter 8: Image Basics 177

Chapter 9: Importing and Exporting Images 211

Chapter 10: Drawing with Core Image 223

Chapter 11: Drawing Text with Quartz 2D 249

Chapter 12: Drawing Offscreen 265

Chapter 13: Shadings and Patterns 277

Chapter 14: Working with PDF 299

Index: 313

Read More Show Less

Preface

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.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)