Function

vImageDilate_ARGBFFFF(_:_:_:_:_:_:_:_:)

Dilates a region of interest within an ARGBFFFF source image using an M x N kernel.

Declaration

func vImageDilate_ARGBFFFF(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ srcOffsetToROI_X: vImagePixelCount, _ srcOffsetToROI_Y: vImagePixelCount, _ kernel: UnsafePointer<Float>, _ 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.

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.

Discussion

This function uses the same kernel is for all channels. In addition to supplying space for the destination image, the dest parameter also specifies the size of the region of interest in within the source image. The region of interest has the same height and width (in pixels) as the destination buffer pointed to by dest.