iOS Guides | Samples

MetalPerformanceShaders Namespace

Highly-optimized image and computer shaders.

Remarks

The Metal Performance Shaders namespace defines the MPSKernel class and a number of subclasses that provide highly-optimized shaders tuned for available GPU hardware.

Classes

TypeReason
MPSAlphaTypeEnumerates values that indicate if and what kind of color premultiplication will be applied to color values.
MPSBinaryImageKernelA image kernel that combines two textures into one texture result.
MPSCnnConvolution
MPSCnnConvolutionDescriptor
MPSCnnConvolutionFlags
MPSCnnCrossChannelNormalization
MPSCnnFullyConnected
MPSCnnKernel
MPSCnnLocalContrastNormalization
MPSCnnLogSoftMax
MPSCnnNeuron
MPSCnnNeuronAbsolute
MPSCnnNeuronLinear
MPSCnnNeuronReLU
MPSCnnNeuronSigmoid
MPSCnnNeuronTanH
MPSCnnPooling
MPSCnnPoolingAverage
MPSCnnPoolingMax
MPSCnnSoftMax
MPSCnnSpatialNormalization
MPSCopyAllocatorCommands to copy a source texture to a new location. Used for out-of-place filters.
MPSDataTypeEnumerates values that specify floating point data types.
MPSImageAn image that may contain more than 4 channels. (For example, an image in a layer of a convolutional neural network.)
MPSImageAreaMaxFilter that finds the maximum pixel value in a window around each pixel in the source image.(Individual channels are processed separately.)
MPSImageAreaMinFilter that finds the minimum pixel value in a window around each pixel in the source image.(Individual channels are processed separately.)
MPSImageBoxFilter that blurs by transforming each pixel of the source image to the average of itself and its neighbors.
MPSImageConversionAn image that can convert its color space, alpha, or pixel format.
MPSImageConvolutionFilter that represents a convolution.
MPSImageDescriptorContains the attributes for a new or existing MPSImage.
MPSImageDilateFinds the maximum value in a region, offset by a corresponding value in a mask.
MPSImageEdgeModeEnumerates shader behavior at the edges of regions and images.
MPSImageErodeFinds the mininum value in a region, offset by a corresponding value in a mask.
MPSImageFeatureChannelFormatEnumerates image channel descriptions.
MPSImageGaussianBlurFilter that applies a fast Gaussian blur to an image.
MPSImageGaussianPyramidRepresents a Gaussian image pyramid.
MPSImageHistogramCalculates a histogram of image data.
MPSImageHistogramEqualizationA MPSUnaryImageKernel that equalizes the histogram of an image.
MPSImageHistogramInfoSpecifies the range of histogram data in a histogram, the number of entries, and whether to encode the alpha channel.
MPSImageHistogramSpecificationTransforms an image so that its histogram matches a desired histogram.
MPSImageIntegralFilter that sums the values of pixels in a region.
MPSImageIntegralOfSquaresFilter that sums the squared values of pixels in a region.
MPSImageLanczosScaleFilter that performs a scaling operation with Lanczos resampling.
MPSImageLaplacianAn optimized Laplacian filter.
MPSImageMedianFilter that finds the median value of each channel for pixels in the region around each source image pixel.
MPSImagePyramidBase class for image pyramids.
MPSImageSobelFilter that detects edges by using a Sobel filter.
MPSImageTentFilter that blurs an image with a tent function.
MPSImageThresholdBinaryFilter that changes all pixels above a threshold luminance to a specified maximum single-channel value, and completely darkens the rest.
MPSImageThresholdBinaryInverseFilter that changes all pixels above a threshold luminance to 0, and brightens the rest to a specified maximum single-channel value.
MPSImageThresholdToZeroFilter that darkens all pixels dimmer than or equal in brightness to a threshold luminance to 0, and leaves the rest unchanged.
MPSImageThresholdToZeroInverseFilter that leaves all pixels dimmer than or equal in brightness to a threshold luminance unchangedt, and darkens the rest to 0.
MPSImageThresholdTruncateFilter that clamps brightness values to a threshold value.
MPSImageTransposeFilter that transposes an image.
MPSKernelBase class that represents the kernel of a shader.
MPSKernelOptionsEnumerates ORable kernel options that improve performance in certain cases.
MPSMatrixA matrix that represents the kernel of a linear transformation.
MPSMatrixDescriptorDescribes the size, data type, and stride of a row-major matrix.
MPSMatrixMultiplicationRepresents a weighted matrix multiplication operation, followed by a weighted addition operation.
MPSOffsetA coordinate that represents an offset.
MPSOriginA coordinate that represents the origin of a coordinate system.
MPSPurgeableStateEnumerates an image's underlying texture's purgeable state.
MPSRegionStructure that represents a region as an origin and a size.
MPSScaleTransformA transformation for use with a Lanczos kernel.
MPSSizeA structure that represents a width, height, and depth.
MPSTemporaryImageDiscardable image data.
MPSUnaryImageKernelRepresents a shader transformation produces one texture from another.