From: John H. <jdh...@ac...> - 2004-11-04 15:59:30
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes: Steve> John, I've got draw_image() displaying an image for cairo Steve> and gtkcairo backends and have a few questions. - Why does Steve> draw_image() not have a gc argument like the other Steve> draw_methods? - What is the Image class image format or Steve> formats(s) ? Is it an array of float32 and RGBA32? - Steve> image_demo.py, image_demo2.py are working but colors are Steve> not same as gtkagg, Cairo supports A1, A8, RGB24 and ARGB32 I added a buffer_argb32 method to _image.cpp to return the image as a python buffer object in ARGB32 format in CVS. I haven't tested it extensively, just that the following doesn't crash and burn from matplotlib.matlab import * im = imshow(rand(5,5)) _im = im.make_image(flipy=False) print _im, dir(_im) b = _im.buffer_argb32() print len(b) im is an image.AxesImage, _im is an _image.Image object from extension code, the same thing draw_image gets. As an aside, after you get your backend finished, you may also want to run unit/memleak_hawaii3.py with the latest Numeric or numarray CVS to identify any potential memory leaks. JDH |