Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Data Management

Managing data is a task every graphics application needs to perform. For Quartz, data management refers to supplying data to or receiving data from Quartz 2D routines. Some Quartz 2D routines move blocks of data into Quartz, such as those that get image or PDF data from a file or another part of your application. Other routines accept blocks of Quartz data, such as those that write image or PDF data to a file or provide the data to another part of your application.

Quartz provides a variety of functions for managing data. By reading this chapter, you should be able to determine which functions are best for your application. As you’ll see, some routines are available only in Mac OS X v10.4 and later while others have been with Quartz since its beginning.

Note: The preferred way to read and write image data in Mac OS X v10.4 and later is to use the Image I/O framework. See Image I/O Programming Guide. This guide describes how to use the CGImageSourceRef and CGImageDestinationRef opaque data types.

Quartz recognizes three broad categories of data sources and destinations:

The data itself, whether represented by a URL, a CFData object, or a data buffer, can be image data or PDF data. Image data can use any type of file format. Quartz understands most of the common image file formats. Some of the Quartz data management functions work specifically with image data, a few work only with PDF data, while others are more generic and can be used either for PDF or image data.

URL, CFData, and raw data sources and destinations refer to data outside the realm of Mac OS X graphics technologies, as shown in Figure 10-1. Your application can also move data between Quartz 2D and Core Image, which is another Mac OS X graphics technology. Although this is a fairly trivial operation, it’s an important one to keep in mind because Core Image can add impressive capabilities to your graphics application.


Figure 10-1  Moving data to and from Quartz 2D

Moving data to and from Quartz 2D

These sections provide detailed information on data management in Quartz 2D:



< Previous PageNext Page > Hide TOC


Last updated: 2007-12-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice