From CameraDemo example, you can get an image handle by calling maCameraSnapshot and then maCreateImageFromData. I am wondering if there is an API or a member variable which exposes raw image data?
Accessing raw image data?
If anybody could confirm whether this is doable or not, that will be very helpful. I need to access raw image data to do some image processing.
I'll experiment. I'm pretty sure that maCameraSnapshot data won't be raw - I'll be jpeg encoded most likely, but maCreateImageFromData may produce the bitmap.
Hi,
maCameraSnapshot can return both RAW and JPEG in Android.
Regards,
Diego
Thanks! Getting a raw bitmap pointer from maCreateImageFromData is totally fine.
I see. How can I access the raw data from maCameraSnapshot?
maCameraSnapshop() populates a MoSync handle (MAHandle). You can copy the contents of the handle into a byte array.
MAHandle imageData = maCreatePlaceholder(); maCameraSnapshot(<format>, imageData); byte rawData[maGetDataSize(imageData); maReadData(imageData, rawData, 0, maGetDataSize(imageData));
Thanks! I will try this!
Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)
Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)
Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)
Yep - look at the 'FileSystem' section here http://www.mosync.com/files/imports/doxygen/latest/html/index.html
In particular, look at maFileOpen http://www.mosync.com/files/imports/doxygen/latest/html/maapi_8h.html#a6007ebe538825f7d8c1954a441a943e5