Re: [Pyobjc-dev] Anyone using Foundation.NSRectFillList?
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@cw...> - 2003-07-23 21:09:09
|
On woensdag, jul 23, 2003, at 18:22 Europe/Amsterdam, b.bum wrote: >> 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. What a lot of packages do nowadays (PyOpenGL for instance) is accept Numeric arrays. Numeric (and probably its upcoming successor NumArray too) exports its API in such a way that if a third-party package has Numeric available at compile time it does not need to have it available at runtime. At runtime you can use a hack to test for Numeric availability and query it for its API addresses if it is available. The hack is fairly well hidden in preprocessor magic, so your code looks basically normal. -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |