Dear all,
Solved the problem with the sample code: re: not producing color images:
By removing: kCGBitmapByteOrder32Host, the Image Writer sample code
now produces color images.
Would removing this have an impact on other platform architectures
(I'm on intel: MBP Core Duo 10.5.2)?
Why should having it result in unexpected results?
Working:
cgImage = CGImageCreate([qcImage bufferPixelsWide], [qcImage
bufferPixelsHigh], 8, (pixelFormat == QCPlugInPixelFormatI8 ? 8 : 32),
[qcImage bufferBytesPerRow], colorSpace, (pixelFormat ==
QCPlugInPixelFormatI8 ? 0 : kCGImageAlphaPremultipliedFirst),
dataProvider, NULL, false, kCGRenderingIntentDefault);
Original:
cgImage = CGImageCreate([qcImage bufferPixelsWide], [qcImage
bufferPixelsHigh], 8, (pixelFormat == QCPlugInPixelFormatI8 ? 8 :
32), [qcImage bufferBytesPerRow], colorSpace, (pixelFormat ==
QCPlugInPixelFormatI8 ? 0 : kCGImageAlphaPremultipliedFirst |
kCGBitmapByteOrder32Host), dataProvider, NULL, false,
kCGRenderingIntentDefault);
Regards, Ian
*******************************
Ian Grant
Senior Lecturer in Digital Art
Faculty of the Arts
Thames Valley University
Ealing, UK
W5 5DX
<[EMAIL PROTECTED]>
*******************************
On 1 Mar 2008, at 20:49, Ian Grant wrote:
Hi,
I was just playing with the Image Writer Plug-in sample code - and
seem to be getting unexpected color results:
Sample Code:
/* 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;
...
cgImage = CGImageCreate([qcImage bufferPixelsWide], [qcImage
bufferPixelsHigh], 8, (pixelFormat == QCPlugInPixelFormatI8 ? 8 :
32), [qcImage bufferBytesPerRow], colorSpace, (pixelFormat ==
QCPlugInPixelFormatI8 ? 0 : kCGImageAlphaPremultipliedFirst |
kCGBitmapByteOrder32Host), dataProvider, NULL, false,
kCGRenderingIntentDefault);
<PreviewScreenSnapz001.png>
I've experimented changing the parameters of CGImageCreate().
Is the CGImage (with the default example code) supposed to always be
greyscale? [ apologies if I simply have misunderstood the code]
What CGImageCreate() parameters would I need to match the colorspace
of the default QC context?
and
When would the [qcImage imageColorSpace] return anything other than
default [linear?] RGB?
In my composition QC generates the source image with a 'Render in
Image' patch. What colorspace would images created internal to QC be
- with color correction and without color correction?
If I imported an image with a color profile, do color spaces get
respected [I assume 'yes' with color correction selected]?
In what context with images created in QC would the colorSpace
return as Monochrome?
I read the threads from Jonas S 'QCRenderer colorspace problems [was
QCRenderer work area size]' and Raphael Sebbe 'QCRenderer and
colorspace parameterizing'.
Thanks, any insights would be welcome.
Regards, Ian
*******************************
Ian Grant
Senior Lecturer in Digital Art
Faculty of the Arts
Thames Valley University
Ealing, UK
W5 5DX
<[EMAIL PROTECTED]>
*******************************
_______________________________________________
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/ian.grant%40mac.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
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]