Best 'native' formats for NSImage and NSSound?
Best 'native' formats for NSImage and NSSound?
- Subject: Best 'native' formats for NSImage and NSSound?
- From: Matt <email@hidden>
- Date: Mon, 1 Sep 2008 10:18:36 -0700
I am building an app that uses NSImage to repeatedly draw subrects from a
set of large .PNG files. I am also using NSSound to play sound effects. I
have been using .WAV files for the NSSound's.
In running Shark on my app recently I noticed that by far, my app spent most
of its time in: CGSConvertBGR888toRGBA8888.
I'm having trouble understanding what this means. It appears that
CoreGraphics is having to convert some of my non-alpha channel images to
have an alpha, and perhaps re-order the bytes? But shouldn't these
conversions only occur once, when CG realizes it needs this additional
channel? My app is re-using the same NSImages each frame, simply compositing
various sub-rects from the original large images.
This leads me to my question, which is two-part: can I optimize my graphics
files or manipulate NSImage into avoiding this (CGSConvertBGR888toRGBA8888)
processing? Or this an unavoidable part of the drawing?
And also, seeing how much work NSImage is having to do, it got me wondering,
are there any image/sound file formats which require 'less work' on the part
of NSImage and NSSound? In terms of loading the initial data, unpacking the
bytes, etc.
I was wondering if switching to .TIFF or .AIFF (or any other formats) could
possibly provide a performance boost?
Thank you in advance for any help/advice,
-Matt
_______________________________________________
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