Re: Faster way to test pixels?
Re: Faster way to test pixels?
- Subject: Re: Faster way to test pixels?
- From: Jens Alfke <email@hidden>
- Date: Sun, 25 May 2008 09:58:46 -0700
On 25 May '08, at 8:14 AM, Steve Christensen wrote:
Unless you know for a fact that your bitmap data is packed such that
each row begins immediately after the previous row, you'll need to
do a bit more work. Bitmaps can be created with [bits bytesPerRow] >
bytesPerPixel * [bits pixelsWide]. In that case you could have some
uninitialized bytes between the end of one row and the beginning of
the next, which could affect the outcome of your test.
I agree — I've been burned by this in the past. RowBytes often seems
to get rounded up to multiples of a power of 2, such as 8 or 16,
probably for better cache coherency or because GPUs are optimized for
it.
—Jens
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