.TH "MPSImageMedian" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSImageMedian .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSUnaryImageKernel\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:kernelDiameter:\fP" .br .ti -1c .RI "(nullable instancetype) \- \fBinitWithCoder:device:\fP" .br .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:\fP" .br .in -1c .SS "Class Methods" .in +1c .ti -1c .RI "(NSUInteger) + \fBmaxKernelDiameter\fP" .br .ti -1c .RI "(NSUInteger) + \fBminKernelDiameter\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "NSUInteger \fBkernelDiameter\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP \fBMPSImageMedian\&.h\fP MetalPerformanceShaders\&.framework .PP \fBCopyright:\fP .RS 4 Copyright (c) 2015 Apple Inc\&. All rights reserved\&. MetalPerformanceShaders median filters .RE .PP The \fBMPSImageMedian\fP applies a median filter to an image\&. \fBA\fP median filter finds the median color value for each channel within a kernelDiameter x kernelDiameter window surrounding the pixel of interest\&. It is a common means of noise reduction and also as a smoothing filter with edge preserving qualities\&. .PP NOTE: The \fBMPSImageMedian\fP filter currently only supports images with <= 8 bits/channel\&. .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(NSUInteger) kernelDiameter" Initialize a filter for a particular kernel size and device .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device the filter will run on .br \fIkernelDiameter\fP Diameter of the median filter\&. Must be an odd number\&. .RE .PP \fBReturns:\fP .RS 4 \fBA\fP valid object or nil, if failure\&. .RE .PP .SS "+ (NSUInteger) maxKernelDiameter " The maximum diameter in pixels of the filter window supported by the median filter\&. .SS "+ (NSUInteger) minKernelDiameter " The minimum diameter in pixels of the filter window supported by the median filter\&. .SH "Property Documentation" .PP .SS "\- kernelDiameter\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The diameter in pixels of the filter window\&. The median filter is applied to a kernelDiameter x kernelDiameter window of pixels centered on the corresponding source pixel for each destination pixel\&. The kernel diameter must be an odd number\&. .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.