Function

vImageExtractChannel_ARGBFFFF

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

Declaration

vImage_Error vImageExtractChannel_ARGBFFFF(const vImage_Buffer *src, const vImage_Buffer *dest, long channelIndex, vImage_Flags flags);

Parameters

src

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.

dest

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.

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.

flags

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.

Discussion

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

vImageExtractChannel_ARGB8888

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

vImageExtractChannel_ARGB16U

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