Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep
Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep
- Subject: Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep
- From: "Adam R. Maxwell" <email@hidden>
- Date: Thu, 01 Oct 2009 19:36:20 -0700
On Oct 1, 2009, at 11:19 AM, Ken Ferry wrote:
Hi David,
Oh, yes, you're right. In the bitmapData, the first row is the top
row.
-getPixelAtX:y:, -setPixelAtX:y:, -getColorAtX:y: and setColorAtX:y:
are
the same. The first row is the top. Sorry that's confusing.
It might be nice if this was documented :). I filed a bug report on
it 2-1/2 years ago, after experiencing similar frustration and
confusion of flippedness (rdar://problem/5222982).
We don't recommend poking at the pixels of an NSBitmapImageRep, but if
you're going to and you aren't just poking one pixel, you're better
off
using a bulk interface. Message dispatch overhead is too high a
proportion
of the work to be done with the one-by-one approach.
Performance of getPixelAtX:y: was too abysmal to use, so I've never
gone back to it. IIRC most of the overhead was in CG acquiring a lock
and finding the image in a dictionary, but that was a while ago.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden