Re: Branch: Drawing noise in Cocoa (preferably fast)

2011-06-18 Thread Seth Willits
On Jun 17, 2011, at 7:29 PM, Ken Tozier wrote: > Keying off Stephen's idea of drawing noise quickly, I came up with a solution > that I can use for my own purposes. It seems like splitting up large image > manipulations for execution on different processor cores could be a good > introduction t

Re: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Stephen Blinkhorn
On 17 Jun 2011, at 19:45, Scott Ellsworth wrote: That seems a bit strange - have you put the code up somewhere? No, not yet. I might post something here over the weekend. It's puzzled me a bit for a year or so off and on now. Stephen Scott On Fri, Jun 17, 2011 at 4:24 PM, Stephen Blink

Branch: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Ken Tozier
Keying off Stephen's idea of drawing noise quickly, I came up with a solution that I can use for my own purposes. It seems like splitting up large image manipulations for execution on different processor cores could be a good introduction to GCD and blocks. I read the intro to GCD docs but am st

Re: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Scott Ellsworth
That seems a bit strange - have you put the code up somewhere? Scott On Fri, Jun 17, 2011 at 4:24 PM, Stephen Blinkhorn wrote: > > On 17 Jun 2011, at 10:30, Stephen Blinkhorn wrote: > >> Saying that, I've found that the CPU requirements of the raw drawing code >> (even with relatively fast refre

Re: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Stephen Blinkhorn
On 17 Jun 2011, at 10:30, Stephen Blinkhorn wrote: Saying that, I've found that the CPU requirements of the raw drawing code (even with relatively fast refresh rates of 20-25 FPS) pales into insignificance when compared to the objective-c messaging overhead of co-ordinating the redrawing.

Re: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Stephen Blinkhorn
On 17 Jun 2011, at 00:18, Uli Kusterer wrote: On 17.06.2011, at 03:08, Ken Tozier wrote: On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote: A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to generate a 10,000 X 10,000 CGLayer of noise. Stephen Thanks. Difference

Re: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Uli Kusterer
On 17.06.2011, at 03:08, Ken Tozier wrote: > On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote: >> A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to >> generate a 10,000 X 10,000 CGLayer of noise. >> >> Stephen > > Thanks. Difference could just be the processor. My lapt

Re: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Ken Tozier
On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote: > A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to > generate a 10,000 X 10,000 CGLayer of noise. > > Stephen Thanks. Difference could just be the processor. My laptop has a 2.4 GHz core i5__

Re: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Stephen Blinkhorn
Hi Ken, On 15 Jun 2011, at 19:24, Ken Tozier wrote: Just curious, what kind of speed are you getting with the CIImage methods? I saw the usefulness of generating random images for my own purposes and polished the posted code a bit today. It was generating 100 million pixel images (10,000 x

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread Ken Tozier
Just curious, what kind of speed are you getting with the CIImage methods? I saw the usefulness of generating random images for my own purposes and polished the posted code a bit today. It was generating 100 million pixel images (10,000 x 10,000) with per-pixel randomization in about 2.2 seconds

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread Stephen Blinkhorn
On 15 Jun 2011, at 12:35, David Duncan wrote: CGContextSetAlpha Brilliant ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lis

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread David Duncan
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

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread Stephen Blinkhorn
Thanks Ken, will test this out. Stephen On 14 Jun 2011, at 23:44, Ken Tozier wrote: I didn't test this (basically cut and pasted from some existing code I have) but it should run plenty fast #define RGB_BYTES_PER_PIXEL 3 - (NSBitmapImageRep *) noiseImageRepWithBaseRed:(float) in

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread Stephen Blinkhorn
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

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Ken Tozier
I didn't test this (basically cut and pasted from some existing code I have) but it should run plenty fast #define RGB_BYTES_PER_PIXEL 3 - (NSBitmapImageRep *) noiseImageRepWithBaseRed:(float) inRed green:(float) inGreen blue:(float) inBlue

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Ken Tozier
Is there any reason the noise has to be unique each time? Could you just generate a noise file and composite that over whatever you want? Unless you're doing something with cryptography, noise, is noise, is noise. It all basically looks the same so reusing a single file seems like it could serve

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Stephen Blinkhorn
Thanks for all the Core Image tips. Completely missed that somehow. At the moment I'm drawing a lot of stuff into CGLayers to save redrawing the same thing over and over. I see CIImage provides imageWithCGLayer: so this could be very fruitful. Thanks! Stephen On 14 Jun 2011, at 16:07, Quin

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Wim Lewis
On 14 Jun 2011, at 2:56 PM, 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 a

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/14/11 2:56 PM, Stephen Blinkhorn wrote: > Hi all, > > 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 achievin

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Quincey Morris
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 am

Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Stephen Blinkhorn
Hi all, 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,