.TH "MPSImageThresholdBinary" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSImageThresholdBinary .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSUnaryImageKernel\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:\fP" .br .ti -1c .RI "(nullable instancetype) \- \fBinitWithCoder:device:\fP" .br .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "float \fBthresholdValue\fP" .br .ti -1c .RI "float \fBmaximumValue\fP" .br .ti -1c .RI "const float * \fBtransform\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP \fBMPSImageThreshold\&.h\fP MetalPerformanceShaders .PP \fBCopyright:\fP .RS 4 Copyright (c) 2015 Apple Inc\&. All rights reserved\&. MetalPerformanceShaders thresholding filters .RE .PP The MPSThreshold filter applies a fixed-level threshold to each pixel in the image\&. The threshold functions convert a single channel image to a binary image\&. If the input image is not a single channel image, convert the inputimage to a single channel luminance image using the linearGrayColorTransform and then apply the threshold\&. The ThresholdBinary function is: destinationPixelValue = sourcePixelValue > thresholdValue ? maximumValue : 0 .SH "Method Documentation" .PP .SS "\- (nullable instancetype) \fBinitWithCoder:\fP (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device" \fBNSSecureCoding\fP compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly\&. To avoid that problem, use initWithCoder:device instead\&. .PP \fBParameters:\fP .RS 4 \fIaDecoder\fP The NSCoder subclass with your serialized \fBMPSKernel\fP .br \fIdevice\fP The MTLDevice on which to make the \fBMPSKernel\fP .RE .PP \fBReturns:\fP .RS 4 \fBA\fP new \fBMPSKernel\fP object, or nil if failure\&. .RE .PP .PP Reimplemented from \fBMPSUnaryImageKernel\fP\&. .SS "\- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device" Standard init with default properties per filter type .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device that the filter will be used on\&. May not be NULL\&. .RE .PP \fBReturns:\fP .RS 4 a pointer to the newly initialized object\&. This will fail, returning nil if the device is not supported\&. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later\&. .RE .PP .PP Reimplemented from \fBMPSUnaryImageKernel\fP\&. .SS "\- (nonnull instancetype) \fBinitWithDevice:\fP (nonnull id< MTLDevice >) device(float) thresholdValue(float) maximumValue(const float *__nullable) transform" initialize a \fBMPSImageThresholdBinary\fP filter .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device the filter will run on .br \fIthresholdValue\fP The threshold value to use .br \fImaximumValue\fP The maximum value to use .br \fItransform\fP This matrix is an array of 3 floats\&. The default if no transform is specifed is BT\&.601/JPEG: {0\&.299f, 0\&.587f, 0\&.114f}; .RE .PP .SH "Property Documentation" .PP .SS "\- maximumValue\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The maximum value used to init the threshold filter .SS "\- thresholdValue\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The threshold value used to init the threshold filter .SS "\- transform\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The color transform used to init the threshold filter .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.