[IOS] UIImage entry and related classes

Image iOS
UIImage
creation process
UIImage conventional process of creating
UIImage * image = [UIImage imageNamed: @ "xx.png"];

CGmage的创建过程
CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage,CGRectMake(0,0,size.width,size.height));
或者
UIImage *image =[ UIImage imageNamed:@"xx.png"];
CGImageRef imageRef = [image CGImage];

CGImage
CGmage的创建过程
CGImageRef imageRef =CGImageCreateWithImageInRect(image.CGImage,CGRectMake(0,0,size.width,size.height));

or

UIImage *image =[ UIImage imageNamed:@"xx.png"];
CGImageRef imageRef = [image CGImage];

CIImage
创建
NSString *path = [[NSBundle mainBundle] pathForResource:@"bbg" ofType:@"jpg"];
NSURL *myURL = [NSURL fileURLWithPath:path];

CIImage *ciImage = [CIImage imageWithContentsOfURL:myURL];


Between the three types
CIImage contains all necessary data to create the image, but does not have to render the image, which represents the image data or image data generation process (e.g., filter);
the CGImage is based on a pixel matrix, each point corresponds to a pixel information pictures midpoint;
UIImage picture data management, is mainly used to show, such as UIImageView, the control medium, can also be used to draw directly view or other context.
All necessary data CIImage contain pictures, such as author information, picture type, location, image size and so forth.
UIImage also included some pictures necessary data, such as image size, width and height of the picture. But when CIImage turn UIImage, it will lose some information, such as author information, and other non-essential data.

Guess you like

Origin www.cnblogs.com/mamamia/p/12171053.html