MPSImageHistogram(3) | MetalPerformanceShaders.framework | MPSImageHistogram(3) |
MPSImageHistogram
#import <MPSImageHistogram.h>
Inherits MPSKernel.
(nonnull instancetype) - initWithDevice:histogramInfo:
(nullable instancetype) - initWithCoder:device:
(void) - encodeToCommandBuffer:sourceTexture:histogram:histogramOffset:
(size_t) - histogramSizeForSourceFormat:
MTLRegion clipRectSource
BOOL zeroHistogram
vector_float4 minPixelThresholdValue
MPSImageHistogramInfo histogramInfo
The MPSImageHistogram computes the histogram of an image.
Encode the filter to a command buffer using a MTLComputeCommandEncoder. The filter will not begin to execute until after the command buffer has been enqueued and committed.
Parameters:
The histogram results are stored in the histogram buffer as follows:
The amount of space in the output MTLBuffer the histogram will take up. This convenience function calculates the minimum amount of space needed in the output histogram for the results. The MTLBuffer should be at least this length, longer if histogramOffset is non-zero.
Parameters:
Returns:
NSSecureCoding 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.
Parameters:
Returns:
Reimplemented from MPSKernel.
Specifies information to compute the histogram for channels of an image.
Parameters:
Returns:
The source rectangle to use when reading data. A MTLRegion that indicates which part of the source to read. If the clipRectSource does not lie completely within the source image, the intersection of the image bounds and clipRectSource will be used. The clipRectSource replaces the MPSUnaryImageKernel offset parameter for this filter. The latter is ignored. Default: MPSRectNoClip, use the entire source texture.
Return a structure describing the histogram content Returns a MPSImageHistogramInfo structure describing the format of the histogram.
The minimum pixel threshold value The histogram entries will be incremented only if pixel value is >= minPixelThresholdValue. The minPixelThresholdValue is a floating-point value. For unsigned normalized textures, the minPixelThresholdValue should be a value between 0.0f and 1.0f (for eg. MTLPixelFormatRGBA8Unorm). For signed normalized textures, the minPixelThresholdValue should be a value between -1.0f and 1.0f (for eg. MTLPixelFormatRGBA8Snorm). Default: vector_float4(0.0f).
Zero-initalize the histogram results Indicates that the memory region in which the histogram results are to be written in the histogram buffer are to be zero-initialized or not. Default: YES.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |