Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fast blitting with Quartz



Are you sure about the magnitude of your dimension there? I was under the impression (potentially mistaken) that the problems started around 10,000 (ten thousand) instead of 10,000,000 (10 million).

I had it my head that 100,000 was the magic number, for whatever reason, but I went and actually tested before posting, and in my particular test app, problems are hit at around 11.4 million pixels. But as I said, it really depends on your code as well - most significantly (in my experience) if you're using floats throughout (e.g. for consistency with CoreGraphics), you're adding additional rounding error versus using doubles for your own "internal" calculations. Always* use the highest floating-point precision available for intermediate calculations, even if you know you'll be reducing precision somewhere down the line.


it also depends on when and how you calculate clipping, how you do rounding, coalescing, etc etc etc. Very much implementation dependent. But if you're careful in your own code, like I've had to be in the aforementioned example case, you can get to 10 million pixels without noticeable glitches.

Wade

* = Converting doubles to floats does have a non-zero cost, but there's no point trying to guess whether this will matter; Shark your code once you've written the conservative, working version, and go from there.
_______________________________________________


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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >fast blitting with Quartz (From: Kenny Leung <email@hidden>)
 >Re: fast blitting with Quartz (From: Greg Titus <email@hidden>)
 >Re: fast blitting with Quartz (From: Kenny Leung <email@hidden>)
 >Re: fast blitting with Quartz (From: Wade Tregaskis <email@hidden>)
 >Re: fast blitting with Quartz (From: Scott Thompson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.