Instance Method

initWithDevice:srcAlpha:destAlpha:backgroundColor:conversionInfo:

Initializes a filter that can convert texture color space, alpha, and pixel format.

Declaration

- (instancetype)initWithDevice:(id<MTLDevice>)device srcAlpha:(MPSAlphaType)srcAlpha destAlpha:(MPSAlphaType)destAlpha backgroundColor:(CGFloat *)backgroundColor conversionInfo:(CGColorConversionInfoRef)conversionInfo;

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 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.

See Also

Methods

MPSAlphaType

Premultiplication description for the color channels of an image.