2D grayscale image from an array of floats
2D grayscale image from an array of floats
- Subject: 2D grayscale image from an array of floats
- From: Martin Beroiz <email@hidden>
- Date: Wed, 16 Dec 2009 12:32:48 -0600
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 subclassed NSView in preparation for the render of the image. Then I searched through the cocoa documentation, and I think the primitive to draw that I need is NSImage. The problem is that NSImage deals basically with existing files, and I didn't find any class that deals with drawing individual pixels or anything like that on the view.
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 too.
Thanks,
Martin.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden