There seems to be an issue with the Image Writer plugin (from the 
Developer/Examples/Quartz Composer/Plugins folder) on Intel machines. I've done 
some tests, and determined that it's swapping the RGBA channels of the captured 
image so that they become GRAB (ie Red becomes Green, Green becomes Red, Blue 
becomes Alpha, and the Alpha is swapped with the Blue channel).


I've tried swizzling the color channels of the image before they go into the 
Image Writer plugin, but this doesn't seem to make any difference to the 
output, which is odd, because if I pipe the output of the swizzle CIFilter to a 
billboard, the channels appear reordered as I'd expect.


I'm guessing this is some kind of endian-related issue. Anyone know how this 
might be fixed?


I've managed to isolate the part of the code in the XCode project relating to 
colorspaces, if this helps at all:


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


/* Figure out pixel format and colorspace to use */
        colorSpace = [qcImage imageColorSpace];
        if(CGColorSpaceGetModel(colorSpace) == kCGColorSpaceModelMonochrome)
        pixelFormat = QCPlugInPixelFormatI8;
        else if(CGColorSpaceGetModel(colorSpace) == kCGColorSpaceModelRGB)
        pixelFormat = QCPlugInPixelFormatARGB8;
        else
        return NO;
        
        /* Get a buffer representation from the image in its native colorspace 
*/
        if(![qcImage lockBufferRepresentationWithPixelFormat:pixelFormat 
colorSpace:colorSpace forBounds:[qcImage imageBounds]])
        return NO;
        
        /* Create CGImage from buffer */
        dataProvider = CGDataProviderCreateWithData(NULL, [qcImage 
bufferBaseAddress], [qcImage bufferPixelsHigh] * [qcImage bufferBytesPerRow], 
NULL);
        cgImage = CGImageCreate([qcImage bufferPixelsWide], [qcImage 
bufferPixelsHigh], 8, (pixelFormat == QCPlugInPixelFormatI8 ? 8 : 32), [qcImage 
bufferBytesPerRow], colorSpace, (pixelFormat == QCPlugInPixelFormatI8 ? 0 : 
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host), dataProvider, 
NULL, false, kCGRenderingIntentDefault);
        CGDataProviderRelease(dataProvider);
        if(cgImage == NULL) {
                [qcImage unlockBufferRepresentation];
                return NO;
        }





= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


Cheers,


alx
http://machinesdontcare.wordpress.com






      ___________________________________________________________ 
Yahoo! For Good helps you make a difference  

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

This email sent to [EMAIL PROTECTED]

Reply via email to