Initializer

init(device:linearGrayColorTransform:)

Initializes a Sobel filter on a given device using a specific color transform.

Declaration

init(device: MTLDevice, linearGrayColorTransform transform: UnsafePointer<Float>)

Parameters

device

The Metal device the filter will run on.

transform

The color transform to use. This matrix is an array of 3 floats that describes the RGB-to-grayscale color transform:

Luminance = transform[0] * pixel.x + transform[1] * pixel.y + transform[2] * pixel.z

Return Value

An initialized Sobel filter object.

See Also

Methods

init(device: MTLDevice)

Initializes a Sobel filter on a given device using the default color transform.