Re: [Pyobjc-dev] initWithBitmapDataPlanes?
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2003-12-06 07:03:21
|
On Dec 5, 2003, at 10:40 PM, Francesco Pierfederici wrote: > The reason I am asking is that I am writing an application that > receives a raster through a socket connection. The raster is a > (potentially large) array of bytes that I would like to display as a > grey-scale bitmap. Hence the need for NSBitmapImageRep and its > initWithBitmapDataPlanes:...., unless, of course, there is a better > way of doing displaying that data, other than using a > NSBitmapImageRep! It is already partially mapped, but the assumption is that you have -- effectively -- five data planes worth of color information passed in as a tuple. I believe that this means it will just work in your case -- you would need to pass a tuple like (greyScaleBytes, None, None, None, None) in as the first argument. See Modules/Appkit/_AppKitMapping_NSBitmap.m for the mapping code. It is incomplete. Better yet, see -- Lib/AppKit/test/test_nsbitmapimagerep.py -- as it contains a set of unit tests that are passing and do pass bitmap data across the bridge. So -- maybe -- Guido's time machine has been effective once again for your particular use case. ;-) b.bum |