The information used to compute the histogram channels of an image.
SDKs
- iOS 9.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Metal Performance Shaders
Declaration
struct MPSImageHistogramInfo
The information used to compute the histogram channels of an image.
SDKs
Framework
struct MPSImageHistogramInfo
var histogram For Alpha: Obj CBool
Specifies whether the histogram for the alpha channel should be computed or not.
var max Pixel Value: vector _float4
Specifies the maximum pixel value. Any pixel value greater than this will be clipped to this value (for the purposes of histogram calculation), and assigned to the first histogram entry. This maximum value is applied to each of the four channels separately.
var min Pixel Value: vector _float4
Specifies the minimum pixel value. Any pixel value less than this will be clipped to this value (for the purposes of histogram calculation), and assigned to the first histogram entry. This minimum value is applied to each of the four channels separately.
var number Of Histogram Entries: Int
Specifies the number of histogram entries (bins) for each channel.
init(device: MTLDevice, histogram Info: Unsafe Pointer<MPSImage Histogram Info>)
Initializes a histogram with specific information.
func encode(to: MTLCommand Buffer, source Texture: MTLTexture, histogram: MTLBuffer, histogram Offset: Int)
Encodes the filter to a command buffer using a compute command encoder.
func histogram Size(for Source Format: MTLPixel Format) -> Int
The amount of space the histogram will take up in the output buffer.