It is quite easy to obtain the Image during live view operation using the method
EdsDownloadEvfImage(CameraRef, ImageRef);
This is quite handy to perform further image processing (with OpenCV etc)
In the same way, I would like to obtain the image data on taking a photo. In the documentation, I could only find a way to download image to PC using
EdsError EdsDownload(EdsDirectoryItemRef inDirItemRef, EdsUInt64 inReadSize, EdsStreamRef OutStreamRef)
Is there any convenient way to load the taken image to a stream or buffer directly?
There isn't, but it's also not that difficult to do either. Because there is more than one way to obtain an image, it can't be as easy as downloading a live view image.
If you want to get the image directly after taking it, do the following:
SaveToproperty toHostand listen to theObjectEvent.DirItemRequestTransferyou can get the necessary info withEdsGetDirectoryItemInfoEdsCreateMemoryStreamEdsDownloadwith theEdsDirectoryItemInfoyou got earlier and forinReadSizeyou just use thesizefield from said struct (if you want to use smaller chunks and progress events, check the docs for more info).EdsDownloadCompleteand of course release everythingIf you don't intend to download the image you must call
EdsDownloadCancelor the camera will retain the image in the buffer which will fill up and block the camera from switching off as well (you'll have to remove the battery to force it off).If you want to download an image that is saved on the memory card of the camera, it gets a bit more complicated because you first have to traverse the directory structure to find the image you want. I won't go into the full details and you best read the docs for that but here are the rough steps:
EdsGetChildCountwhereinRefis the cameraEdsGetChildAtIndex(again using the camera forinRef) andEdsGetVolumeInfoEdsGetDirectoryItemInfoinstead ofEdsGetVolumeInfo. ForinRefwithEdsGetChildCountandEdsGetChildAtIndexyou either use the volume reference or the directory item reference if it's a folder (check theisFolderfield of theEdsDirectoryItemInfostruct).EdsDownloadandEdsCreateMemoryStream