---
title: MPSBinaryImageKernel
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsbinaryimagekernel
---

# MPSBinaryImageKernel

A kernel that consumes two textures and produces one texture.

## Declaration

```swift
class MPSBinaryImageKernel
```

## Mentioned in

The MPSKernel Class

## Overview

Overview MPSBinaryImageKernel defines shared behavior for most image processing kernels (filters) such as edging modes, clipping, and tiling support for image operations that consume two source textures. It is not meant to be used directly, but provides API abstraction and in some cases may allow some level of polymorphic manipulation of image kernel objects.

## Topics

### Initializers

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

### Methods

- [encode(commandBuffer:primaryTexture:inPlaceSecondaryTexture:fallbackCopyAllocator:)](metalperformanceshaders/mpsbinaryimagekernel/encode(commandbuffer:primarytexture:inplacesecondarytexture:fallbackcopyallocator:).md)
- [encode(commandBuffer:inPlacePrimaryTexture:secondaryTexture:fallbackCopyAllocator:)](metalperformanceshaders/mpsbinaryimagekernel/encode(commandbuffer:inplaceprimarytexture:secondarytexture:fallbackcopyallocator:).md)
- [encode(commandBuffer:primaryTexture:secondaryTexture:destinationTexture:)](metalperformanceshaders/mpsbinaryimagekernel/encode(commandbuffer:primarytexture:secondarytexture:destinationtexture:).md)
- [encode(commandBuffer:primaryImage:secondaryImage:destinationImage:)](metalperformanceshaders/mpsbinaryimagekernel/encode(commandbuffer:primaryimage:secondaryimage:destinationimage:).md)
- [primarySourceRegion(forDestinationSize:)](metalperformanceshaders/mpsbinaryimagekernel/primarysourceregion(fordestinationsize:).md)
- [secondarySourceRegion(forDestinationSize:)](metalperformanceshaders/mpsbinaryimagekernel/secondarysourceregion(fordestinationsize:).md)

### Properties

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

## Relationships

### Inherits From

- [MPSKernel](metalperformanceshaders/mpskernel.md)

### Inherited By

- [MPSImageArithmetic](metalperformanceshaders/mpsimagearithmetic.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Image Filter Base Classes

- [MPSUnaryImageKernel](metalperformanceshaders/mpsunaryimagekernel.md)
