Re: [Pyobjc-dev] Anyone using Foundation.NSRectFillList?
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2003-07-23 16:22:41
|
On Tuesday, July 22, 2003, at 12:16 PM, Ronald Oussoren wrote: > I just noticed that the interface of the wrapped NSRectFillList is a > bit odd. Is anyone using this function at the moment, I'd like to > clean up the interface. > > The current interface accepts a string containing the struct.pack-ed > representation of an array of NSRects, > it should accept a sequence of NSRects instead. If you are talking about a sequence of python tuples/lists, it should not though accepting both would certainly be preferable. That implementation came out of my quest to see how fast I could get individual pixels to the screen. The answer is an array of 1x1 rectangles passed to NSRectFillList(). Packing/unpacking across the bridge is painfully slow -- an order of magnitude slower -- than using an array of of struct packed floats. I have been meaning to turn the app I used to do the testing into an example. Using NSBezierPath generated about 10,000 points every 2 seconds... NSBitmapImageRep could plot around 25,000 or something.... NSRectFillList as currently implemented could do 250,000 points every 2 seconds. b.bum |