Initializer

init(filename:)

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

Declaration

init?(filename: UnsafePointer<Int8>)

Parameters

filename

The full or relative pathname to use for the data provider. When you supply Core Graphics data via the provider, it reads the data from the specified file.

Return Value

A new data provider or NULL if the file could not be opened. You are responsible for releasing this object using CGDataProviderRelease.

Discussion

You use this function to create a direct-access data provider that supplies data from a file. When you supply Core Graphics with a direct-access data provider, Core Graphics obtains data from your program in a single block.

See Also

Creating Direct-Access Data Providers

init?(data: CFData)

Creates a data provider that reads from a CFData object.

init?(url: CFURL)

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

struct CGDataProviderDirectCallbacks

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

typealias CGDataProviderGetBytePointerCallback

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

typealias CGDataProviderGetBytesAtPositionCallback

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

typealias CGDataProviderReleaseBytePointerCallback

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

typealias CGDataProviderReleaseInfoCallback

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

typealias CGDataProviderReleaseDataCallback

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