Function

vImageOverwriteChannelsWithScalar_ARGB8888(_:_:_:_:_:)

Overwrites the pixels of one or more planes of an ARGB8888 image buffer with the provided scalar value.

Declaration

func vImageOverwriteChannelsWithScalar_ARGB8888(_ scalar: Pixel_8, _ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ copyMask: UInt8, _ flags: vImage_Flags) -> vImage_Error

Parameters

scalar

An 8-bit pixel value.

src

A pointer to a vImage buffer structure that contains the source image whose data you want to overwrite.

dest

A pointer to a vImage buffer data structure. You're responsible for filling out the height, width, and rowBytes fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.

copyMask

An output value that selects the plane (or planes) from the ARGB8888 source buffer that you want replaced with the scalar value. The value 0x8 selects the alpha channel, 0x4 the red channel, 0x2 the green channel, and 0x1 the blue channel. You can add these values together to select multiple channels.

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.