• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGImageCreate performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGImageCreate performance


  • Subject: CGImageCreate performance
  • From: David Blanton <email@hidden>
  • Date: Thu, 7 Jan 2010 18:36:54 -0700

If David Duncan would comment on performance issues using his suggested approach:

CGColorSpaceRef colorSpace;
colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
CGDataProviderRef provider = CGDataProviderCreateWithData (NULL,m_bitmap.m_array, 4*m_bitmap.m_pixelsx*m_bitmap.m_pixelsy, NULL);
CGImageRelease(m_CGImageRef);
m_CGImageRef = CGImageCreate(m_bitmap.m_pixelsx, m_bitmap.m_pixelsy, 8, 32, 4*m_bitmap.m_pixelsx, colorSpace, kCGImageAlphaNoneSkipFirst| kCGBitmapByteOrder32Host, provider, NULL,YES, kCGRenderingIntentDefault);
CGImageRetain(m_CGImageRef);
CGColorSpaceRelease(colorSpace);
CGDataProviderRelease(provider);


Clearly I have kicked NSBitMapImageRep under the bus as the above gives what I am looking for.

The performance issue comes from the fact the user will be dragging this bitmap around so I a regenerating m_bitmap.m_array constantly.

Thanks for all the help ... I think I have learned something!

db
_______________________________________________

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


  • Follow-Ups:
    • Re: CGImageCreate performance
      • From: David Duncan <email@hidden>
    • Re: CGImageCreate performance
      • From: David Duncan <email@hidden>
    • Re: CGImageCreate performance
      • From: Graham Cox <email@hidden>
    • Re: CGImageCreate performance
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: Problems Fading Out Music
  • Next by Date: Re: CGImageCreate performance
  • Previous by thread: Re: Optimizing View Drawing Code
  • Next by thread: Re: CGImageCreate performance
  • Index(es):
    • Date
    • Thread