views:

331

answers:

1

Hello all! I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView)

Everything displays fine

The button simply takes a snapshot using the following simple lines of code

- (void)takePicture:(id)sender {NSImage *currentImage = [outputView valueForOutputKey:@"ImageOutput"];
[[currentImage TIFFRepresentation] writeToFile:@"/Users/hendo13/Desktop/capture.tiff" atomically:NO];}

The exported image however has some very wonky colouring issues like so: http://kttns.org/gjhnj

No filters of any sort have been applied. Does anyone know what is causing this?

A: 

It's inverted. You can use the CIInvert filter to correct it (assuming there's no way to correct the actual output of the QC view).

Oh, and I think the blue and green alpha channels are the wrong way around, too (possibly an endianness problem?). If you go with the CIInvert solution, you can use CIColorMatrix to rearrange the channels, swapping blue and green back to their proper places. Here's a tutorial I wrote for it—I wrote it for the user interface in Core Image Fun House, but using it programmatically shouldn't be too hard once you understand how the filter works.

Peter Hosey