• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing a single pixel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing a single pixel


  • Subject: Re: Drawing a single pixel
  • From: Bob Savage <email@hidden>
  • Date: Mon, 28 May 2001 20:07:03 -0700

> 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


  • Prev by Date: Re: Exceptions
  • Next by Date: Drawer Content sizing.
  • Previous by thread: Re: Drawing a single pixel
  • Next by thread: grrr... NSString stringWithFormat: vs. SEL typecasting
  • Index(es):
    • Date
    • Thread