Function

vImageErode_ARGB8888(_:_:_:_:_:_:_:_:)

Erodes a region of interest within an ARGB8888 source image using an M x N kernel.

Declaration

func vImageErode_ARGB8888(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ srcOffsetToROI_X: vImagePixelCount, _ srcOffsetToROI_Y: vImagePixelCount, _ kernel: UnsafePointer<UInt8>, _ kernel_height: vImagePixelCount, _ kernel_width: vImagePixelCount, _ flags: vImage_Flags) -> vImage_Error

Parameters

src

A pointer to a vImage buffer structure that contains data for the source image.

dest

A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.

The size (number of rows and number of columns) of the destination buffer also specifies the size of the region of interest in the source buffer.

srcOffsetToROI_X

The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.

srcOffsetToROI_Y

The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.

kernel

A pointer to the kernel data, which must be a packed array without any padding. The function uses the same kernel for all channels.

kernel_height

The height of the kernel in pixels. This value must be odd.

kernel_width

The width of the kernel in pixels. This value must be odd.

flags

The options to use when performing the morphological operation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading. Set the kvImageLeaveAlphaUnchanged flag to specify that the alpha channel should be copied to the destination image unchanged.

Return Value

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