MPSImageThresholdTruncate
A filter that clamps the return value to an upper specified value.
Declaration
class MPSImageThresholdTruncateOverview
An MPSImageThresholdTruncate filter converts a single channel image to a binary image. If the input image is not a single channel image, the function first converts the input image into a single channel luminance image using the linear gray color transform, and then it applies the threshold.
The following listing shows the threshold truncate function.
Listing 1. Threshold truncate function
destinationPixelValue = sourcePixelValue > thresholdValue ? thresholdValue : sourcePixelValue