Type Alias

CGDataProviderGetBytesAtPositionCallback

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

Declaration

typealias CGDataProviderGetBytesAtPositionCallback = (UnsafeMutableRawPointer?, UnsafeMutableRawPointer, off_t, Int) -> Int

Parameters

info

A generic pointer to private data shared among your callback functions. This is the same pointer you supplied to init(directInfo:size:callbacks:).

buffer

The Core Graphics buffer into which you copy the specified number of bytes.

position

Specifies the relative location in the data provider at which to begin copying data.

count

The number of bytes to copy.

Return Value

The number of bytes copied. If no more data can be written to the buffer, you should return 0.

Discussion

When Core Graphics is ready to receive data from the provider, your function is called.

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.

init?(filename: UnsafePointer<Int8>)

Creates a direct-access data provider that uses a file 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 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:).

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software