Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mpsimagetypes.h(3) [mojave man page]

MPSImageTypes.h(3)					 MetalPerformanceShaders.framework					MPSImageTypes.h(3)

NAME
MPSImageTypes.h SYNOPSIS
#import <MPSCore/MPSCoreTypes.h> Typedefs typedef enum MPSAlphaType MPSAlphaType Enumerations enum MPSAlphaType { MPSAlphaTypeNonPremultiplied, MPSAlphaTypeAlphaIsOne, MPSAlphaTypePremultiplied } Typedef Documentation typedef enum MPSAlphaType MPSAlphaType" Enumeration Type Documentation enum MPSAlphaType Premultiplication description for the color channels of a texture Some image data is premultiplied. That is to say that the color channels are stored instead as color * alpha. This is an optimization for image compositing (alpha blending), but it can get in the way of most other image filters, especially those that apply non-linear affects like the MPSImageParametricCurveTransform multidimensional lookup tables, and functions like convolution or resampling filters that look at adjacent pixels, where the alpha may not be the same. Some basic conversion cases: source destination operation ------ ----------- --------- MPSAlphaTypeNonPremultiplied MPSAlphaTypeNonPremultiplied <none> MPSAlphaTypeNonPremultiplied MPSAlphaTypeAlphaIsOne composite with opaque background color MPSAlphaTypeNonPremultiplied MPSAlphaTypePremultiplied multiply color channels by alpha MPSAlphaTypeAlphaIsOne MPSAlphaTypeNonPremultiplied set alpha to 1 MPSAlphaTypeAlphaIsOne MPSAlphaTypeAlphaIsOne set alpha to 1 MPSAlphaTypeAlphaIsOne MPSAlphaTypePremultiplied set alpha to 1 MPSAlphaTypePremultiplied MPSAlphaTypeNonPremultiplied divide color channels by alpha MPSAlphaTypePremultiplied MPSAlphaTypeAlphaIsOne composite with opaque background color MPSAlphaTypePremultiplied MPSAlphaTypePremultiplied <none> Color space conversion operations require the format to be either MPSPixelAlpha_NonPremultiplied or MPSPixelAlpha_AlphaIsOne to work correctly. A number of MPSKernels have similar requirements. If premultiplied data is provided or requested, extra operations will be added to the conversion to ensure correct operation. Fully opaque images should use MPSAlphaTypeAlphaIsOne. MPSAlphaTypeNonPremultiplied Image is not premultiplied by alpha. Alpha is not guaranteed to be 1. (kCGImageAlphaFirst/Last) MPSAlphaTypeAlphaIsOne Alpha is guaranteed to be 1, even if it is not encoded as 1 or not encoded at all. (kCGImageAlphaNoneSkipFirst/Last, kCGImageAlphaNone) MPSAlphaTypePremultiplied Image is premultiplied by alpha. Alpha is not guaranteed to be 1. (kCGImageAlphaPremultipliedFirst/Last) Enumerator MPSAlphaTypeNonPremultiplied MPSAlphaTypeAlphaIsOne MPSAlphaTypePremultiplied Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSImageTypes.h(3)

Check Out this Related Man Page

MPSImageConversion(3)					 MetalPerformanceShaders.framework				     MPSImageConversion(3)

NAME
MPSImageConversion SYNOPSIS
#import <MPSImageConversion.h> Inherits MPSUnaryImageKernel. Instance Methods (nonnull instancetype) - initWithDevice:srcAlpha:destAlpha:backgroundColor:conversionInfo: Properties MPSAlphaType sourceAlpha MPSAlphaType destinationAlpha Additional Inherited Members Detailed Description MPSImageConversions.h MetalPerformanceShaders.framework Copyright: Copyright (c) 2015 Apple Inc. All rights reserved. MetalPerformanceShaders conversion filters MPS_CLASS_AVAILABLE_STARTING The MPSImageConversion filter performs a conversion from source to destination Method Documentation - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(MPSAlphaType) srcAlpha(MPSAlphaType) destAlpha(nullable CGFloat *) backgroundColor(nullable CGColorConversionInfoRef) conversionInfo Create a converter that can convert texture colorspace, alpha and texture format Create a converter that can convert texture colorspace, alpha and MTLPixelFormat. Optimized cases exist for NULL color space converter and no alpha conversion. Parameters: device The device 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 CGFloats giving the background color to use when flattening an image. The color is in the source colorspace. The length of the array is the number of color channels in the src colorspace. If NULL, use {0}. conversionInfo The colorspace conversion to use. May be NULL, indicating no color space conversions need to be done. Returns: An initialized MPSImageConversion object. Property Documentation - destinationAlpha [read], [nonatomic], [assign] Premultiplication description for the destinationAlpha texture Colorspace conversion operations produce non-premultiplied data. Use this property to tag cases where premultiplied results are required. If MPSPixelAlpha_AlphaIsOne is used, the alpha channel will be set to 1. Default: MPSPixelAlpha_AlphaIsOne - sourceAlpha [read], [nonatomic], [assign] Premultiplication description for the source texture Most colorspace conversion operations can not work directly on premultiplied data. Use this property to tag premultiplied data so that the source texture can be unpremultiplied prior to application of these transforms. Default: MPSPixelAlpha_AlphaIsOne Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSImageConversion(3)
Man Page