MetalPetal is an image processing framework based on Metal designed to provide real-time processing for still images and video with easy-to-use programming interfaces. This chapter covers the key concepts of MetalPetal, and will help you to get a better understanding of its design, implementation, performance implications, and best practices. A MTIImage object is a representation of an image to be processed or produced. It does directly represent image bitmap data instead it has all the information necessary to produce an image or more precisely a MTLTexture. It consists of two parts, a recipe of how to produce the texture (MTIImagePromise) and other information such as how a context caches the image (cachePolicy), and how the texture should be sampled (samplerDescriptor). MetalPetal does a lot of optimizations for you under the hood.
Features
- Provides convenience APIs and avoids common pitfalls
 - Use CPU, GPU and memory efficiently
 - Easy to create custom filters as well as plugin your custom image processing unit
 - Provides a fluid experience for Swift programmers
 - Some of the core concepts of MetalPetal are very similar to those in Apple's Core Image framework
 - Provides an evaluation context for rendering MTIImages