Re: invertrect, any cocoa versions suggested?
Re: invertrect, any cocoa versions suggested?
- Subject: Re: invertrect, any cocoa versions suggested?
- From: Ricky Sharp <email@hidden>
- Date: Tue, 24 Jan 2006 07:04:51 -0600
On Monday, January 23, 2006, at 10:42PM, Robert Dell <email@hidden> wrote:
>yes, i actually need to invert the color pixels within the rectangle.
>if i had access to the actual pixels, i could invert them myself (although that wouldn't be the fastest way) one pixel at a time.
Just what kind of speed do you need? I use direct pixel access of an NSBitmapImageRep and perform convert-to-grayscale (NTSC weighted algorithm) of 1024x768 images. On a dual 2GHz G5, it's only a few microseconds.
>i also need to read and set individual pixels the same way getcpixel and setcpixel did.
Those two routines were the slowest method of getting/setting pixel data. You could easily create your own wrappers that would involve direct pixel access.
>Nothing i've searched on the web, apple's site, or the frameworks gives me any indication of what i'm trying to do. the closest thing i can come up with is coreimage but i'm unsure on how it works and it can't invert the color data.
>
Depending on your speed needs, CI may not be the best. I had thought of using CI to do my grayscale effect. However, since both my input and output needed to be an NSBitmapImageRep, I'd spend too much time copying image data around to convert to/from formats needed by CI. So, at a Tiger Tech talk, an Apple engineer proposed I stick with the direct pixel access approach.
>implementing an apple2 hi-res graphics screen is the main thrust for this program segment. more specifically, the apple pascal's turtlegraphics routines in their entirety (other than textmode and grafmode procedures) for script programmers.
Hmm...how do you plan (if at all) to support anti-aliasing? If you're doing a simple drawing app, why not just draw with NSBezierPath?
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden