macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

What Is Quartz (or Why Can't Windows Do That)
Pages: 1, 2, 3, 4

Quartz 2D

Quartz 2D commonly refers to both the OS X two-dimensional drawing engine and the drawing engine's client API. You might also hear Quartz 2D and Core Graphics used synonymously since much of Quartz 2D is exposed in the Core Graphics framework, which falls under the Application Services umbrella framework. Because Quartz is rooted in the PDF specification, it shouldn't come as any surprise to you that Quartz 2D provides a rich API for drawing to OpenGL graphics contexts, PDF and PostScript documents, and raster graphics (bitmaps), in addition to the screen.



Quartz is highly customizable and includes the ability to specify whether or not to anti-alias graphics and text, manage color with ColorSync, internally compress data, and specify the level of transparency among other things. If you're interested in enriching your Cocoa repertoire with some Quartz 2D skills or just want to know more about how it enhances your Aqua desktop experience, Mac DevCenter's A Simple Drawing Sample in Quartz 2D and Introduction to Quartz 2D for QuickDraw Programmers tutorials are great places to start before progressing into Apple's Introduction to Quartz 2D Programming Guide. Mac DevCenter also features a nice tutorial for using Python bindings to get a handle on Quartz 2D.

According to the latest Ars Technica review, Tiger comes loaded with a major enhancement called Quartz 2D Extreme, although this feature is disabled by default as of OS X 10.4.2. When Apple officially flips the switch (presumably using a software update if you have the right hardware), it appears that Quartz 2D Extreme will shake up the current architecture by moving Quartz 2D calculations onto the GPU, where OpenGL will crunch the numbers. Since much of Quartz Compositor's work is already done on the GPU, this makes perfectly good sense and would create another win-win situation by further freeing the CPU's load for other work.

Visual Programming with Quartz Composer

If all of that talk about Quartz 2D sounds pretty intense, you'll be glad to know that there's still a lot of fun that you can have without writing a single line of code. Tiger comes packed with Quartz Composer, a powerful visual programming environment that you can use to explore Quartz and create amazing demos that can also be turned into screen savers. Assuming you have the developer tools installed, you'll find Quartz Composer at /Developer/Applications/Graphics Tools. Apple's Introduction to Quartz Composer Programming Guide is the canonical starting point for development, but you'll find an assortment of slick examples out on the net if you do some scouring. Here are some particularly impressive samples of what you can do in Quartz Composer in a relatively short period of time.

brick cube
Follow Apple's tutorial to create a glowing cube that rotates. Augment it to float around the screen and then save it as a screen saver.

Pages: 1, 2, 3, 4

Next Pagearrow