• 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: invertrect, any cocoa versions suggested?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >invertrect, any cocoa versions suggested? (From: Robert Dell <email@hidden>)
 >Re: invertrect, any cocoa versions suggested? (From: Jim Correia <email@hidden>)
 >Re: invertrect, any cocoa versions suggested? (From: Robert Dell <email@hidden>)

  • Prev by Date: Newbie-setting object used as variable of another object
  • Next by Date: Re: Can bindings be set to ignore certain values?
  • Previous by thread: Re: invertrect, any cocoa versions suggested?
  • Next by thread: Re: invertrect, any cocoa versions suggested?
  • Index(es):
    • Date
    • Thread