Contents

encode(to:sourceTexture:histogram:histogramOffset:)

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

Declaration

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

Parameters

  • commandBuffer:

    A valid command buffer.

  • source:

    A valid texture containing the source image for the filter.

  • histogram:

    A valid buffer to receive the histogram results.

  • histogramOffset:

    The byte offset into the histogram buffer at which to write the histogram results. Must be a multiple of 32 bytes. The histogram results per channel are stored together. The number of channels for which histogram results are stored is determined by the number of channels in the image. If the histogramForAlpha value of the Histograminfo property is False and the source image is RGBA, then only histogram results for RGB channels are stored.

Discussion

The filter will not begin to execute until after the command buffer has been enqueued and committed.

See Also

Methods