Contents

init(directInfo:size:callbacks:)

Creates a direct-access data provider.

Declaration

init?(directInfo info: UnsafeMutableRawPointer?, size: off_t, callbacks: UnsafePointer<CGDataProviderDirectCallbacks>)

Parameters

  • info:

    A pointer to data of any type or NULL. When Core Graphics calls the functions specified in the callbacks parameter, it sends each of the functions this pointer.

  • size:

    The number of bytes of data to provide.

  • callbacks:

    A pointer to a Cgdataproviderdirectcallbacks structure that specifies the callback functions you implement to handle the data provider’s basic memory management.

Return Value

A new data provider. In Objective-C, you’re responsible for releasing this object using CGDataProviderRelease.

Discussion

You use this function to create a direct-access data provider that uses callback functions to read data from your program in a single block.

See Also

Creating Direct-Access Data Providers