I need functionality in an iPhone app that converts an image to a mirror.
As if there is an image of a person with his left hand up, then the inverted image should have the same person with his right hand.
Any code or link will be truly appreciated.
Thanks in advance for your help.
You can try this
myImageView.transform = CGAffineTransformMake(-1,0,0,1,0,0);
Sorry, I can’t help anymore. Some time ago, I used this horizontally, flipping UIView, so I'm a bit rusty in specifics.
myView.transform = CGAffineTransformMake(-1,0,0,-1,0,0);
// convert CIImage to unsigned char* NSBitmapImageRep * bitRep = [[NSBitmapImageRep alloc] initWithCIImage:sourceImage]; unsigned char * pixels = (unsigned char *)[bitRep bitmapData]; // find mirrored pixel, for 1D pixels array // for 2D array it will be something like: // pixels2D[x,y] = pixels2D[Image.width-1-x,y] // convert modified unsigned char* back to CIImage CGColorSpaceRef colorSpaceToUse = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); NSData *_pixelsData = [NSData dataWithBytesNoCopy:pixels length:(sizeof(unsigned char)*4*Image.Width*Image.Height) freeWhenDone:YES ]; CIImage *_dataCIImage = [[[CIImage alloc] initWithBitmapData:_pixelsData bytesPerRow:(Image.Width*4*sizeof(unsigned char)) size:CGSizeMake(Image.Width,Image.Height) format:kCIFormatARGB8 colorSpace:colorSpaceToUse] autorelease];
Source: https://habr.com/ru/post/1771919/More articles:Как изменить версию рельсов в Max OS X Snow Leopard? - ruby-on-railsNSTimer or NSThread in the background iOs 4 - iphoneFacebook Authentication - Problem Returning to My iPhone App via Custom URL Scheme - iphoneHow to create a pdf file containing a Marati font using itext? - javaMerging a linked server? - sqlHTTPS proxy for an existing HTTP application - httpUse the sun. * Classes in an Eclipse Java project - javaUIGraphicsGetImageFromCurrentImageContext gives a low quality / low resolution image, how do I get better? - iphoneextract url from string with javascript - javascriptAsp.Net MVC - FluentValidation - validationAll Articles