Re: Drawing noise in Cocoa (preferably fast)
Re: Drawing noise in Cocoa (preferably fast)
- Subject: Re: Drawing noise in Cocoa (preferably fast)
- From: David Duncan <email@hidden>
- Date: Wed, 15 Jun 2011 11:35:45 -0700
On Jun 15, 2011, at 11:30 AM, Stephen Blinkhorn wrote:
> On 14 Jun 2011, at 16:07, Quincey Morris wrote:
>
>> On Jun 14, 2011, at 14:56, Stephen Blinkhorn wrote:
>>
>>> I'm looking to fill a large custom view with noise. The solution I have arrived at so far is taking much too long to draw for it to be useable. Does anyone know any better ways of achieving this in Cocoa? The basic idea is to add an amount of noise to a base color pixel by pixel, for example:
>>
>> Have you looked into using Core Image, e.g. the CIRandomGenerator filter composited onto an image filled with the base color?
>
> I've got the random noise part working and it easily fast enough. Its a shame there isn't a way to specify the opacity when drawing CGLayers. I'd find that useful but I imagine there is a reason for it.
CGContextSetAlpha().
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden