I am trying to migrate my application to the 7610 platform. And since (as far as i know) the only way to get 1-Mega pixel images on 7610 is to use the 7610 Camera plugin, I have to use the new CCamera module for the camera function.
The application need to have a view finder to display modified bitmaps (e.g. distorted images) real time. It has been very smooth using the old CameraServ module. But in the CCamera module, I just can't figure out a way to have the job done.
Here's what I need to do:
1. Get updated view finder image
2. Modify bitmap data of the image
3. Draw it out
4. Get the next updated view finder images
However since the ViewFinder of the CCamera will continuously write data to the same bitmap object, I cannot obtain a static image for me to do modification. I have tried a few methods to try to get around this problem but none are quick enough:
Method A: Use CaptureImage() instead of view finder.
Result: Each time the CaptureImage() returns a new bitmap, so I have to delete the old bitmap before Draw()ing the new one.
Method B: Call StopViewFinder() before I edit, Draw() it out, then call StartViewFinder()
Result: Very slow. I guess these two functions are not as simple as stopping the image data transfer between the camera device and the memory and it will take much time to return.
Method C: Copy the view finder image data to another bitmap object before edit and Draw()
Result: Too slow, because need to copy (even just 160*120*2 bytes) data to another memory location
I know that none of the above methods are good methods but I can think of no others.... Does anyone have any idea on this problem? Or did I miss something or some functions that can help me to do my task? In the old camera library things are so much easier, because the view finder bitmap object will only be updated when u issue another GetImage() function call.
Method C: how are you copying the bitmap? Using Mem::Copy should be fast enough...
Method D: a new view finder frame will not be fetched until you return from ViewFinderFrameReady() call back. So doing any image processing synchronously while in call back function should do the trick.