objective c - Flipping Quicktime preview & capture -
I need to flip some videos horizontally, which I am previewing and capturing A-la IISHAT, I have a webcam and have to show it as if the user is looking in the mirror.
I'm previewing QuickTime video in a QTCaptureView . My capturing frame-by-frame (I will not get anything from the reasons) has been done with:
imageRep = [NSCIMAJRP image copy CImage: [CIMS imageViscivz buffer: frame]]; Image = [[NSImage alloc] initWithSize: [imageRep size]]; [Image Add Report: Image]; [Movie addImage: Duration for Image: with some scary next: someAttributes]; Any tips?
You can do this by taking the CIImage you are getting from catching it and it's a core image Moving the image to flip around through the filter. You will then pass the resulting image in the image representation instead of the original image. The code will look something like this:
CImage * CaptureImage = [CImage ImageVithCVM buffer: buffer]; NSaphine Transform * FlipTransform = [NSaphine Transformer Transform]; CIFF filter * flip filter; CIImage * Flipped Image; [Fliptransform scale bx: -1.0 y: 1.0]; // horizontal flip flip filter = [CII's filterwidth name: @ "CIFFFIN transcens"]; [Flipfilter set value: flip transform fork: @ "inputtransform"]; [Flipfilter set value: key for cache image: @ "input image"]; FlippedImage = [FlipFilterManFor: @ "Output Image"]; ImageRep = [NSCIImageRep imageRepWithCIImage: flippedImage]; ...
Comments
Post a Comment