Chapter 8 Data Provider and Data Consumers

Just about all the examples in the book so far create content using Quartz line art drawing routines to draw to a graphics context. But what if an application needs to draw from other sources–JPEG, GIF, PDF, and so forth–or write content to such destinations as the hard disk, the Clipboard, a location on the Web, or a block of memory? Quartz provides two opaque data types–CGDataProviderRef and CGDataConsumerRef–that abstract the data access process, making it easy to obtain data from a variety of sources as well as to write data to various destinations. Data providers (CGDataProviderRef) read data from a source, while data consumers (CGDataConsumerRef) write data to a destination, as Figure 8.1 depicts. ...

Get Programming with Quartz now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.