Initializes a vImage buffer with the contents of a Core Graphics image.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
vstructure. The fields of the structure
bufare updated to point to a vImage buffer representation of the image.
vstructure specifying the desired image format associated with the output
Image _CGImage Format
NULL, sRGB is used.
If the image encodes an alpha or mask, and the output format doesn't have alpha, the result is flattened against a background color.
CGImageinstance to be used as the source.
The options to use when performing this operation. The following flags are supported:
Uses the passed-in
buf->rowvalues without modification, allowing you to allocate your own buffer to hold the result.
Prints a debug message if the operation fails.
Disables internal multithreading.
This function is a convenience method to help you initialize a
v structure with an image from a
CGImage instance. It initializes the vImage buffer by copying the image's pixel data to the buffer's memory. By default, a newly allocated piece of memory is used to hold the image.
You're responsible for releasing the memory that
buf->data points to back to the system using
CGImage instance may have other associated metadata, such as camera orientation, that may require further processing downstream. vImage does 1:1 pixel conversions from the raw image source.