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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.