---
title: MPSImageIntegralOfSquares
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsimageintegralofsquares
---

# MPSImageIntegralOfSquares

A filter that calculates the sum of squared pixels over a specified region in an image.

## Declaration

```swift
class MPSImageIntegralOfSquares
```

## Overview

Overview The value at each position is the sum of all squared pixels in a source image rectangle, sumRect. The following listing shows the pseudocode used to calculate sumRect. Listing 1. Pseudocode for sumRect sumRect.origin = filter.offset sumRect.size = dest_position - filter.clipRect.origin If the channels in the source image are normalized, half-float or floating values, the destination image is recommended to be a 32-bit floating-point image. If the channels in the source image are integer values, it is recommended that an appropriate 32-bit integer image destination format is used.

## Relationships

### Inherits From

- [MPSUnaryImageKernel](metalperformanceshaders/mpsunaryimagekernel.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 Integral Filters

- [MPSImageIntegral](metalperformanceshaders/mpsimageintegral.md)
