init(dataInfo:data:size:releaseData:)
Creates a direct-access data provider that uses data your program supplies.
Declaration
init?(dataInfo info: UnsafeMutableRawPointer?, data: UnsafeRawPointer, size: Int, releaseData: CGDataProviderReleaseDataCallback)Parameters
- info:
A pointer to data of any type, or
NULL. When Core Graphics calls the function specified in thereleaseDataparameter, it sends this pointer as its first argument. - data:
A pointer to the array of data that the provider contains.
- size:
A value that specifies the number of bytes that the data provider contains.
- releaseData:
A pointer to a release callback for the data provider, or
NULL. Your release function is called when Core Graphics frees the data provider. For more information, see Cgdataproviderreleasedatacallback.
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 an entire block at one time.