CGDataProvider

An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer.

Overview

Data provider objects abstract the data-access task and eliminate the need for applications to manage data through a raw memory buffer.

For information on how to use CGDataProvider functions, see Quartz 2D Programming Guide Programming Guide.

See also CGDataConsumer.

Symbols

CGDataProvider Miscellaneous Functions

init?(url: CFURL)

Creates a direct-access data provider that uses a URL to supply data.

init?(filename: UnsafePointer<Int8>)

Creates a direct-access data provider that uses a file to supply data.

init?(data: CFData)

Creates a data provider that reads from a CFData object.

class var typeID: CFTypeID

Returns the Core Foundation type identifier for data providers.

var data: CFData?

Returns a copy of the provider’s data.

Callbacks

CGDataProviderGetBytesCallback

A callback function that copies from a provider data stream into a Core Graphics buffer.

CGDataProviderReleaseInfoCallback

A callback function that releases any private data or resources associated with the data provider.

CGDataProviderRewindCallback

A callback function that moves the current position in the data stream back to the beginning.

CGDataProviderSkipForwardCallback

A callback function that advances the current position in the data stream supplied by the provider.

CGDataProviderGetBytePointerCallback

A callback function that returns a generic pointer to the provider data.

CGDataProviderReleaseBytePointerCallback

A callback function that releases the pointer Core Graphics obtained by calling CGDataProviderGetBytePointerCallback.

CGDataProviderReleaseDataCallback

A callback function that releases data you supply to the function init(dataInfo:data:size:releaseData:).

CGDataProviderGetBytesAtPositionCallback

A callback function that copies data from the provider into a Core Graphics buffer.

Data Types

CGDataProvider

An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer.

CGDataProviderDirectCallbacks

Defines pointers to client-defined callback functions that manage the sending of data for a direct-access data provider.

CGDataProviderSequentialCallbacks

Defines a structure containing pointers to client-defined callback functions that manage the sending of data for a sequential-access data provider.