I currently have the following
CIImage *img = [CIImage imageWithCVImageBuffer: imageBuffer];
NSCIImageRep *imageRep = [NSCIImageRep imageRepWithCIImage:img];
NSImage *image = [[[NSImage alloc] initWithSize: [imageRep size]] autorelease];
[image addRepresentation:imageRep];
This works fine, I can use NSImage, and when it is written to the file, the image exactly matches me.
However, I am pulling this image from iSight users using QTKit, so I need to flip this image along the y axis.
My first thought was to convert CIImage using something like this, however my final image always comes out completely blank. When writing to a file, the dimensions are correct, but appear empty.
- (CIImage *)flipImage:(CIImage *)image
{
return [image imageByApplyingTransform:CGAffineTransformMakeScale(-1, 1)];
}
Am I approaching this wrong? Or did I make a mistake in my code?
source
share