CGImageCreate performance
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