Instance Method


The amount of space the histogram will take up in the output buffer.


func histogramSize(forSourceFormat sourceFormat: MTLPixelFormat) -> Int



The pixel format of the source image, corresponding to the sourceTexture object of the encode(to:sourceTexture:histogram:histogramOffset:) method.

Return Value

The number of bytes needed to store the histogram results.


This convenience function calculates the minimum amount of space needed in the output histogram for the results. The buffer should be at least this length and longer if the histogramOffset value in the encode(to:sourceTexture:histogram:histogramOffset:) method is non-zero.

See Also


struct MPSImageHistogramInfo

The information used to compute the histogram channels of an image.

func encode(to: MTLCommandBuffer, sourceTexture: MTLTexture, histogram: MTLBuffer, histogramOffset: Int)

Encodes the filter to a command buffer using a compute command encoder.