Re: 2D grayscale image from an array of floats

2009-12-19 Thread Martin Beroiz
Thanks for the reply, I'm a newbie and I'm still trying to figure out how are things done in Cocoa. I have another related question I'd like to ask you guys, cause I've searched through documentation and tutorials but I cannot find the exact answer. I'm trying to implement Model-Controller-Vie

Re: 2D grayscale image from an array of floats

2009-12-18 Thread Scott Ribe
A couple more things I've thought of: - There is such a thing as a grayscale image that uses floats instead of bytes for values. You may not even need to do a conversion. - You may even be able to wrap your buffer up in an image rep without copying it. I don't use NSImage; my custom image views

Re: 2D grayscale image from an array of floats

2009-12-18 Thread douglas welton
Martin, Have you looked at the API for CGImage? If not, this may be helpful as well. regards, douglas On Dec 17, 2009, at 9:25 AM, Martin Beroiz wrote: > > On Dec 17, 2009, at 6:17 AM, Graham Cox wrote: > >> >> On 17/12/2009, at 5:32 AM, Martin Beroiz wrote: >> >>> Can anyone please give

Re: 2D grayscale image from an array of floats

2009-12-17 Thread Scott Ribe
> Thanks, I'm trying that already. I don't need high performance right now, but > just out of curiosity, what would I use if I wanted ultra high performance? You would use the methods of NSBitmapImageRep that allow you to get/set the entire image buffer at once. -- Scott Ribe scott_r...@killerby

Re: 2D grayscale image from an array of floats

2009-12-17 Thread Martin Beroiz
On Dec 17, 2009, at 6:17 AM, Graham Cox wrote: > > On 17/12/2009, at 5:32 AM, Martin Beroiz wrote: > >> Can anyone please give me any hint on what would be the best approach to >> this problem? or may be point me some relevant documentation I might read? I >> know nothing about bitmap image r

Re: 2D grayscale image from an array of floats

2009-12-17 Thread Graham Cox
On 17/12/2009, at 5:32 AM, Martin Beroiz wrote: > Can anyone please give me any hint on what would be the best approach to this > problem? or may be point me some relevant documentation I might read? I know > nothing about bitmap image representation, so any pointer on that would > appreciated

2D grayscale image from an array of floats

2009-12-17 Thread Martin Beroiz
Hello, I'm new in cocoa, and I want to accomplish something in a program i'm developing. I have an array of floats, that is basically a matrix, and I want to display it on a view as a 2D grayscale image, with each pixel in a gray tone proportional the value of that float. So far I have subc