O'Reilly logo

Programming with Quartz by Philip Schneider, Bunny Laden, David Gelphman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required