Re: invertrect, any cocoa versions suggested?
Re: invertrect, any cocoa versions suggested?
- Subject: Re: invertrect, any cocoa versions suggested?
- From: Scott Anguish <email@hidden>
- Date: Tue, 24 Jan 2006 02:12:39 -0500
On Jan 23, 2006, at 11:01 PM, Robert Dell 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.
i also need to read and set individual pixels the same way
getcpixel and setcpixel did.
well, reading is doable with NSReadPixel (http://developer.apple.com/
documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Functions/
AppKitFunctions.html) (I'd be very surprised if there aren't direct
replaces in the CoreGraphics for the two old functions)
but that requires that the drawing be contained in a focus capable
view/bitmap image (which is easy to do mind you), and if that is a
requirement for using it, there there are other options available.
you can directly access the memory used by the NSBitmapImageRep that
an NSImage contains.
However.. MOST IMPORTANTLY...
CoreImage can most certainly accomplish this for you far faster
than using read/write pixel functions. In fact, the
CoreImageFunHouse example installed with the developer tools can do
it (including color invert). Grab a bitmap of the area of the view
you're drawing into, and transform it using CI. It really is trivial
this way
_______________________________________________
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