Initializer

init(device:kernelWidth:kernelHeight:weights:)

Initializes a convolution filter.

Declaration

init(device: MTLDevice, kernelWidth: Int, kernelHeight: Int, weights kernelWeights: UnsafePointer<Float>)

Parameters

device

The Metal device the filter will run on.

kernelWidth

The width of the kernel. Must be an odd number.

kernelHeight

The height of the kernel. Must be an odd number.

kernelWeights

A pointer to an array of kernelWidth * kernelHeight values to be used as the kernel. These values should be in row-major order.

Return Value

An initialized convolution filter object.