MPSCNNArithmetic(3) | MetalPerformanceShaders.framework | MPSCNNArithmetic(3) |
MPSCNNArithmetic
#import <MPSCNNMath.h>
Inherits MPSCNNBinaryKernel.
Inherited by MPSCNNAdd, MPSCNNDivide, MPSCNNMultiply, and MPSCNNSubtract.
(nonnull instancetype) - initWithDevice:
(void) -
encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationImage:
(void) -
encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationStates:destinationImages:
float primaryScale
float secondaryScale
float bias
NSUInteger primaryStrideInFeatureChannels
NSUInteger secondaryStrideInFeatureChannels
float minimumValue
float maximumValue
This depends on Metal.framework The MPSCNNArithmetic filter takes two source images, a primary source image and a secondary source image, and outputs a single destination image. It applies an element-wise arithmetic operator to each pixel in a primary source image and a corresponding pixel in a secondary source image over a specified region.
The supported arithmetic operators are the following:
This filter takes additional parameters: primaryScale, secondaryScale, and bias. The default value for primaryScale and secondaryScale is 1.0f. The default value for bias is 0.0f. This filter applies primaryScale, secondaryScale, and bias to the primary source pixel (x) and secondary source pixel (y) in the following way:
To clamp the result of an arithmetic operation, where result = clamp(result, minimumValue, maximumValue), set the minimumValue and maximumValue appropriately. The default value of minimumValue is -FLT_MAX. The default value of maximumValue is FLT_MAX.
This filter also takes the following additional parameters:
The number of output feature channels remains the same as the number of input feature channels.
You must use one of the sub-classes of MPSImageArithmetic.
Encode call that operates on a state for later consumption by a gradient kernel in training This is the older style of encode which reads the offset, doesn't change it, and ignores the padding method. Multiple images are processed concurrently. All images must have MPSImage.numberOfImages = 1.
Parameters:
Encode call that operates on a state for later consumption by a gradient kernel in training This is the older style of encode which reads the offset, doesn't change it, and ignores the padding method.
Parameters:
Standard init with default properties per filter type
Parameters:
Returns:
Reimplemented from MPSCNNBinaryKernel.
Reimplemented in MPSCNNAdd, MPSCNNSubtract, MPSCNNMultiply, and MPSCNNDivide.
maximumValue is used to clamp the result of an arithmetic operation: result = clamp(result, minimumValue, maximumValue). The default value of maximumValue is FLT_MAX.
minimumValue is to clamp the result of an arithmetic operation: result = clamp(result, minimumValue, maximumValue). The default value of minimumValue is -FLT_MAX.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |