Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing a single pixel



> Seems like a lot of overhead just to draw a pixel, though.
>
> I have a neural network I'm working on and will need to plot error points as
> a network learns. Obviously, I'll want any screen draws to be as quick as
> possible, but I'd also like them real-time. IOW, I don't want to have to
> wait until the whole map is drawn (off screen) to look at it.
>
> ------BEGIN ORIGINAL POST------
>> Yes, he needs to use NSBitmapImageRep. However, I believe the reason he
>> wants to be able to change a single pixel is because he wants to build a
>> fractal picture up pixel by pixel and then display it. In that case, he
>> should just set all of the pixels in NSBitmapImageRep's bitmap to the proper
>> values and then display that.
>>
>> - Dennis D.
> ------END ORIGINAL POST------

Hey, Scott,

Maybe it shouldn't be thought of as a single pixel. I mean if you were going
to draw a single pixel only you would be drawing a window with a view that
is only one pixel large, right? If you are drawing into a 1 pixel by 1 pixel
window, then go ahead and draw the entire image each cycle :)

I think what you are saying, though, is that you want to draw a whole bunch
of pixels, maybe a million (maybe more?) to the screen, but you just want to
change one pixel in your million pixel image from white to black (or
whatever).

Consider how blazing fast a G4 is. What if "real time" means a pixel changes
every hundred thousandth of a second? Now you are wanting to draw a MILLION
or more pixels 100,000 times per second!

It seems like you should be able to find a way to refresh the screen often
enough that you are always getting a fairly current representation, but that
you are not taxing the graphics card by trying to have it keep up with a
computation rate far faster than human eyes can perceive :)

Best of luck,

Bob




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.