Re: drawing an array of pixels to the screen
Re: drawing an array of pixels to the screen
- Subject: Re: drawing an array of pixels to the screen
- From: John Stiles <email@hidden>
- Date: Fri, 9 Nov 2007 20:56:33 -0800
+NSBitmapImageRep
initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerP
ixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPi
xel: is pretty efficient. You're not copying the whole byte array, it
just takes a reference to it.
However, another poster hit the nail on the head—if performance is
important to you, might as well go OpenGL. You can't get any faster
than that on OS X.
On Nov 9, 2007, at 7:27 PM, Jason Horn wrote:
I am working on a computer vision based app that detects objects in
video images. I have to implement custom algorithms to locate and
track objects, so I need to write code that has direct access to
the pixel values and keep track of the x,y coordinates of certain
objects. This is easiest to do with the image represented as a 2D
array of int values. However, it seems that the only way to draw
bitmaps to the screen is with NSImage and NSBitmapImageRep or
CIImage. Is there another way? It seems like a waste (and a
performance hit) to convert a 2D array of pixel values into a byte
stream every time you want to display the image. Is there a way to
draw the pixel values directly to the screen (and do it quickly).
Thanks for any ideas.
_______________________________________________
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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