From: Timothy Hunter Date: 2005-09-02T07:31:25+09:00 Subject: Re: rmagick question Ara.T.Howard wrote: > you just have to use my illicit narray extension ;-) works like this: > > mmap = Mmap::new 'data', 'rw', Mmap::MAP_SHARED > memory = mmap.to_str > na = NArray::str memory, width, height, NArray::BYTE > na += 1 > exit Sweet! So you load your pixel data into an mmap object, use the mmap object to create an NArray object, call some NArray methods, then hand the mmap object to import_pixels, which calls to_str on it to get a pointer to the pixel data. That'll do. ImageMagick _will_ make a copy of the data. There's no way around that. But we're still way ahead of the game. I think we're in agreement about the changes to import_pixels so unless I hear different I'll start coding. I've not scheduled another release of RMagick yet but I'll be glad to get one in the pipeline if you're anxious to use the new code. Otherwise I'll hold off a bit. Let me know if you have any other thoughts/comments/ideas, and thanks again for suggesting this approach! P.S. I won't be at Rubyconf this year but if you're there why not tug on Matz's coat about sharing memory?