Answer the question
In order to leave comments, you need to log in
iPhone programming. Fast analogue of CGDataProviderCopyData?
Hello Khabrovites.
Problem:
Where does the UIImage* im image come from. For example, from the iPhone's camera.
We need to take the pixel values from this picture. However, there is a condition - this process must occur quickly .
Now used:
CGImageRef imageRef = im.CGImage;<br/>
NSData *nsData = (NSData*)CGDataProviderCopyData(CGImageGetDataProvider(imageRef));<br/>
unsigned char const * pixels = (unsigned char*)[nsData bytes];
Answer the question
In order to leave comments, you need to log in
UIImagePNGRepresentation
Read the documentation carefully. But I do not guarantee that it does not copy.
The problem was solved. Info: link .
The private function UIGetScreenImage is used. Gives a picture with a resolution of 320 by 480.
The operation (NSData *) CGDataProviderCopyData (CGImageGetDataProvider (imageRef)) for such a picture is performed on my device 50 mls. It's still tolerable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question