Re: Some questions about cocoa graphics2D
Re: Some questions about cocoa graphics2D
- Subject: Re: Some questions about cocoa graphics2D
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 20 Nov 2001 04:00:39 -0800
On Monday, November 19, 2001, at 08:06 AM, Andrea Perego wrote:
>
Hi!
>
>
I'm doing preliminary experiments to port a "classic" application to
>
Cocoa, and I could use some help & advice from more experienced
>
developers.
>
>
1) The purpose of my app is manipulating spectra, that are drawn in
>
form of histograms. My first idea was just to draw them as a single
>
bezier path (up to 4k or 8k channels = 8k or 16k lines), letting the
>
rendering engine take care of
>
actual rasterization and display. What I found out is that
>
[<myBezierPath> stroke] for such a path may be a very slow operation:
>
it takes about 2 seconds to stroke 8k lines on my G4-733 at work, while
>
the same operation on a 400Mhz iMac took about 15 seconds (does
>
"stroke" exploit altivec on G4 ?!?).
NSBezierPath falls apart when you have a whole lot of segments,
particularly if they intersect each other. In fact, I'm rather
surprised that a path with 8K segments didn't lock up the app altogether.
I've been plotting image histograms myself lately, but with far fewer
columns than your spectrograms.
I'd suggest doing your own data reduction, and then drawing the
histogram with NSRectFillListWithColors(), or one of the other
NSRectFill... functions.
-jcr
"Computers in the future may weigh no more than 1.5 tons." - Popular
Mechanics, 1949