histogramSize(forSourceFormat:)
The amount of space the histogram will take up in the output buffer.
Declaration
func histogramSize(forSourceFormat sourceFormat: MTLPixelFormat) -> IntParameters
- sourceFormat:
The pixel format of the source image, corresponding to the
sourceTextureobject of the Encode(to:sourcetexture:histogram:histogramoffset:) method.
Return Value
The number of bytes needed to store the histogram results.
Discussion
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.