Coreimage Framework Composition
Apple has helped us classify image processing to see its structure:
Mainly divided into three parts:
1) Definition part: Coreimage coreimagedefines. See the name of Righteousness, represents the Coreimage this framework and its definition.
2) Operation section:
Filter (Cifliter): Cifilter produces a ciimage. Typically, take one or more pictures as input, and after some filtering, produce a picture of the specified output.
Detection (Cidetector): Cidetector detect the characteristics of processing pictures, such as using to detect the face of the image of the eyes, mouth, and so on.
Feature (Cifeature): Cifeature represents the characteristics that are produced by detector processing.
3) Image section:
Canvas (cicontext): A canvas class can be used with quartz 2D or OpenGL. You can use it to associate the Coreimage class. such as filters, colors and other rendering processing.
Color (cicolor): The Association of pictures with the canvas, image pixel color processing.
Vector (Civector): The image of the coordinate vector and other geometric methods of processing.
Picture (Ciimage): Represents an image that can represent the output of an association.
2. Processing steps:
1) Create a Ciimage object;
2) Create a Cifilter object and set input values
3) Create a Cicontext object.
4) render the filter output image into a cgimage
3. Note
A. Focus on the ways in which Ciimage is produced:
1) through the URL and data
2 through other pictures class conversion, cgimageref or other pictures.
3) through Cvpixelbufferref.
4) A set of pixel data.
B. Picture color, Kccimagecolorspace to overload the default color space.
C. Picture metadata.
4. Use filters.
Cisepiatone, Cicolorcontrols, Cihueblendmode.
Process: Multiple CImage input--"Ciheblendmode-" cisepiatone.
Render Output:
Process: Get context-"turn into ciimage-" rendering into Cgimageref-"convert to UIImage-" release cgimageref-"Use UIImage."
5. Face Detection
Automatic enhancements: ciredeyecorrection , cifacebalance (adjust picture to give better skin tone), civibrance (increase saturation without distorting skin tones), Citonecurve (adjust picture contrast), highlight shadow adjustment.