Hey there guys,

I was hoping that you could help me with a little problem I can't figure out a 
solution for.
I had some code for image processing that's returning a monochrome image.

The next patch however is expecting an RGB input image so I'm blowing up the 
monochrome image to RGBA in a simple for loop.
When I then export the image by doing: 

self.outputImage = [context 
outputImageProviderFromBufferWithPixelFormat:QCPlugInPixelFormatRGBAf
                                                                  
pixelsWide:width
                                                                  
pixelsHigh:height
                                                                 
baseAddress:tempFloatArray
                                                                 
bytesPerRow:width * sizeof(float) *4 //RGBA
                                                             
releaseCallback:_BufferReleaseCallback
                                                              
releaseContext:self
                                                                  
colorSpace:CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear)
                                                            
shouldColorMatch:YES];

It works just fine.
To reduce both the processing time and also the memory footprint I wanted to 
pass on the monochrome image as is without the unnecessary RGB blowup.

However, I keep getting weird exceptions when I try to use this:

self.outputImage = [context 
outputImageProviderFromBufferWithPixelFormat:QCPlugInPixelFormatIf
                                                                  
pixelsWide:width
                                                                  
pixelsHigh:height
                                                                 
baseAddress:tempFloatArray
                                                                 
bytesPerRow:width * sizeof(float)
                                                             
releaseCallback:_BufferReleaseCallback
                                                              
releaseContext:self
                                                                  
colorSpace:CGColorSpaceCreateWithName(kCGColorSpaceGenericGray)
                                                            
shouldColorMatch:NO];


  
QC terminates with an exception saying:

-[_NSWindowTransformAnimation retain]: message sent to deallocated instance 
0x18bf7c0

I checked in Instruments and tried to hunt down the zombie but I couldn't find 
out where it is coming from.
It must be related to the output image because if I set it to nil, the 
exception isn't thrown although the processing path is the same until there.

Is it possible that having an output image with a different pixel format than 
the context is problematic?
I remember having had problems with textures with different pixel formats. 

All tips are very welcome!
Thanks very much in advance!

Best regards,

Flo

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to