Re: Best 'native' formats for NSImage and NSSound?
Re: Best 'native' formats for NSImage and NSSound?
- Subject: Re: Best 'native' formats for NSImage and NSSound?
- From: Negm-Awad Amin <email@hidden>
- Date: Tue, 9 Sep 2008 09:19:04 +0200
Hi,
do you load the image with -imageNamed: and add the suffix? IIRC, this
forces NSImage to reload the image file. Did you try to refer to the
image without suffx? In this case NSImage looks for a appropiate image
in iits image heap and takes this one instead of the file. If it does
not find a image with this name, it looks inside the bundle for the
image, accepting all suffixes.
Maybe this helps.
Cheers,
Amin
Am Mo,01.09.2008 um 19:18 schrieb Matt:
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
Amin Negm-Awad
email@hidden
_______________________________________________
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