A filter that finds the maximum pixel value in a rectangular region centered around each pixel in the source image.
- iOS 9.0+
- macOS 10.13+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Metal Performance Shaders
MPSImage filter behaves like the
MPSImage filter, except that the intensity at each position is calculated relative to a different value before determining which is the maximum pixel value, allowing for shaped, non-rectangular morphological probes.
Listing 1 shows pseudocode for the calculation used to return each pixel value.
A filter that contains all zeros is identical to an
MPSImage filter. The center filter element is assumed to be
0 to avoid causing a general darkening of the image. The
edge property value is assumed to always be
MPSImage for this filter.