Datasheet

Quartz 2D
The Quartz 2D graphic library is Mac OS X’s native graphics library. It is responsible for all the two-
dimensional drawing performed by Mac OS X. As you might imagine, Quartz 2D provides an interface
for drawing two-dimensional shapes, such as lines and rectangles, and compositing images. It is also
capable of drawing sophisticated curves, arbitrary shapes expressed as paths or vectors, and drawing
color gradients. Quartz 2D also includes support for generating and displaying PDF files.
The Quartz 2D programming interface is provided by CoreGraphics, which is part of the
ApplicationServices framework:
/System/Library/Frameworks/ApplicationServices.framework.
The Quartz 2D API is very powerful and is best approached by an experienced programmer. In this book,
you focus more on the drawing API in the Application Frameworks layer, which is a little easier to use.
OpenGL
OpenGL is a powerful, cross-platform graphics library for doing 2D and 3D graphics. Although OpenGL
is owned by SGI, the OpenGL specification is governed by an independent consortium called the OpenGL
Architecture Review Board ARB for short. As a voting member of the ARB, Apple contributes to the
OpenGL community as a whole, in addition to improving the state of OpenGL on Mac OS X.
One of OpenGL’s most compelling features is its tight integration with video card technology. Many
OpenGL commands, such as image and shape drawing, blending and texture-mapping, can be per-
formed directly by the video card’s GPU. Recall that the GPU is optimized to perform these operations
very quickly, and once graphic operations have been unloaded onto the video card, the CPU is free to
perform other computational functions. The net result of this tight integration is very fast drawing.
Performance combined with its cross-platform nature makes OpenGL uniquely suited for certain kinds
of situations, including scientific research, professional video editing, and games. If you have played a
3D video game on Mac OS X, you’ve seen OpenGL in action. For that matter, if you have used one of
Mac OS X’s built-in screen saver modules, you’ve seen OpenGL.
OpenGL’s programming interface is spread across two frameworks: core OpenGL functionality lives in
the OpenGL framework (
/System/Library/Frameworks/OpenGL.framework), and a basic cross-
platform Application Framework called GLUT resides at
/System/Library/Frameworks /GLUT.
framework
. As with Quartz 2D, the OpenGL API is fairly advanced, and better suited for more experi-
enced programmers.
14
Chapter 1
What Are PDF Files?
PDF stands for Portable Document Format. The PDF standard was invented by Adobe
as a means for describing documents that can be displayed or printed virtually any-
where. The file specification itself is open, meaning the public-at-large can view the for-
mat and write their own tools for reading and generating PDF documents. Adobe
continues to own and develop the standard.
Mac OS X reads and writes PDF documents as its preferred native image file format.
You can save any document in PDF format simply by “printing” it and clicking Save
as PDF in Mac OS X’s print panel. PDF files can be displayed in Mac OS X’s Preview
application. Even screen shots are saved in PDF format.
05_573993 ch01.qxd 6/16/05 2:22 PM Page 14