Ok, I know that it's not possible to actually disable color correction in quartz. What I'm looking for is a device-independent color space setting that dosn't change the RGB values I draw in a CGLayer.
I tried all the ICC profiles from the system library, they all shift the colors.
This is the best result I got:
const CGFloat whitePoint[] = {0.95047, 1.0, 1.08883};
const CGFloat blackPoint[] = {0, 0, 0};
const CGFloat gamma[] = {1, 1, 1};
const CGFloat matrix[] = {0.449695, 0.244634, 0.0251829, 0.316251, 0.672034, 0.141184, 0.18452, 0.0833318, 0.922602 };
CGColorSpaceRef colorSpace = CGColorSpaceCreateCalibratedRGB(whitePoint, blackPoint, gamma, matrix);
This uses Apple RGB's color conversion matrix and D65 white point.
The colors still shift a bit, although I'm a lot happier with this than with the device dependent settings.
Here's how I write the CGLayer to a TIFF:
CIImage *image = [CIImage imageWithCGLayer:cgLayer];
NSBitmapImageRep *bitmapImage = [[NSBitmapImageRep alloc] initWithCIImage:image];
[[bitmapImage TIFFRepresentation] writeToFile:fileName atomically:YES];
Any help would be greatly appreciated.