---
title: clipRect
framework: metalperformanceshaders
role: symbol
role_heading: Instance Property
path: metalperformanceshaders/mpsbinaryimagekernel/cliprect
---

# clipRect

An optional clip rectangle to use when writing data. Only the pixels in the rectangle will be overwritten.

## Declaration

```swift
var clipRect: MTLRegion { get set }
```

## Discussion

Discussion This value indicates which part of the destination to overwrite. If the clip rectangle does not lie completely within the destination image, then the intersection between the clip rectangle and destination bounds is used instead. The default value is MPSRectNoClip, indicating that the entire image is used.

## See Also

### Properties

- [primaryOffset](metalperformanceshaders/mpsbinaryimagekernel/primaryoffset.md)
- [secondaryOffset](metalperformanceshaders/mpsbinaryimagekernel/secondaryoffset.md)
- [primaryEdgeMode](metalperformanceshaders/mpsbinaryimagekernel/primaryedgemode.md)
- [secondaryEdgeMode](metalperformanceshaders/mpsbinaryimagekernel/secondaryedgemode.md)
