Re: CILinearGradient not linear?
Re: CILinearGradient not linear?
- Subject: Re: CILinearGradient not linear?
- From: George Orthwein <email@hidden>
- Date: Mon, 26 Jun 2006 15:34:23 -0400
I wanted to follow up this thread with the solution, even though I
also posted to quartz-dev.
CIContext does indeed default to a colorspace with a linear gamma
(1.0). The remedy is to create a context with a "normal" gamma using
kCGColorSpaceGenericRGB:
CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName
(kCGColorSpaceGenericRGB);
NSDictionary *contextOptions = [NSDictionary
dictionaryWithObjectsAndKeys:(id)colorSpace,
kCIContextWorkingColorSpace, (id)colorSpace,
kCIContextOutputColorSpace,nil];
myCIContext = [CIContext contextWithCGContext:[[NSGraphicsContext
currentContext] graphicsPort] options:contextOptions];
I've created a test app showing the differences:
http://home.comcast.net/~george.o/CITooLinearGradient.html
I plan to file a doc enhancement request as I don't believe it
behaves as expected. In fact, I bet most people are unknowingly using
it as is, effectively creating non-linear gradients, even though
technically they are linear for a specific colorspace.
(Also, as far as I can tell, this issue only affects the gradient
filters.)
Hope this helps someone!
George
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden