init(device:srcAlpha:destAlpha:backgroundColor:conversionInfo:)
Initializes a filter that can convert texture color space, alpha, and pixel format.
Declaration
init(device: any MTLDevice, srcAlpha: MPSAlphaType, destAlpha: MPSAlphaType, backgroundColor: UnsafeMutablePointer<CGFloat>?, conversionInfo: CGColorConversionInfo?)Parameters
- device:
The device that the filter will run on.
- srcAlpha:
The alpha encoding for the source texture.
- destAlpha:
The alpha encoding for the destination texture.
- backgroundColor:
An array of Cgfloat Swift.struct values giving the background color to use when flattening an image.
The color is in the source color space. The length of the array is the number of color channels in the source color space. If this parameter is not applicable to your desired conversion, use
{0}. - conversionInfo:
The color space conversion to use. This value may be
NULL, indicating that no color space conversions need to be done.
Return Value
An MPSImageConversion object.