Initializer

init(device:histogramInfo:)

Initializes a histogram with specific information.

Declaration

init(device: MTLDevice, histogramInfo: UnsafePointer<MPSImageHistogramInfo>)

Parameters

device

The Metal device the filter will run on.

histogramInfo

A pointer to a structure describing the histogram content.

Return Value

An initialized histogram object.

See Also

Methods

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.

func histogramSize(forSourceFormat: MTLPixelFormat) -> Int

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