---
title: "init(device:linearGrayColorTransform:)"
framework: metalperformanceshaders
role: symbol
role_heading: Initializer
path: "metalperformanceshaders/mpsimagesobel/init(device:lineargraycolortransform:)"
---

# init(device:linearGrayColorTransform:)

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

## Declaration

```swift
init(device: any 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

Return Value An initialized Sobel filter object.

## See Also

### Methods

- [init(device:)](metalperformanceshaders/mpsimagesobel/init(device:).md)
