Extracts one channel from a four-channel interleaved 32-bit-per-component buffer.


func vImageExtractChannel_ARGBFFFF(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ channelIndex: Int, _ flags: vImage_Flags) -> vImage_Error



A valid pointer to a vImage buffer struct that describes an 32-bit-per-component, four-channel buffer. The pixels don't have to be ARGB; they can be BGRA, RGBA, CMYK, etc.


A valid pointer to a vImage buffer structure that describes an 32-bit-per-component, one-channel buffer. You allocate the buffer that dest points to, and the buffer is overwritten by the channel specified by channelIndex.


The index of the channel to extract. For alpha in an ARGB image, this is 0. For alpha in a BGRA image, this value is 3.


The options to use when performing the operation. If you plan to perform your own tiling or use multithreading, pass kvImageDoNotTile.

Return Value

kvImageNoError; otherwise, one of the error codes described in Data Types and Constants.


This function is the opposite operation from vImageOverwriteChannels_ARGBFFFF(_:_:_:_:_:). It reads one component from the four channel 32-bit-per-component buffer and writes it into a PlanarF buffer.

This function can work in place, provided that rowBytes is the same for src and dest images, and the start address matches. The data written to dest will be in the same format as the data provided in the src format, except only a single channel is present.

See Also

Extracting Channels