11-20-2012 04:32 AM
I am having trouble writing a C++ program to acquire a sequence of images into memory and save them onto my computer. My computer has 8GB of memory running Windows7 64bit.I try to use the LLGrab program.I create a buffer list for the camera. I create the buffer, and set the zeroeth entry in the buffer list to it. I further set that first and only entry such that the camera will stop
acquiring data after filling it with an image . Then “lock” the buffer into memory, and configure the camera to use this new buffer list.
imgCreateBufList( 1, &bid_ );
imgCreateBuffer( sid_, FALSE, buflen_,(void**)&buf_ );
imgSetBufferElement( bid_, 0, IMG_BUFF_ADDRESS,(unsigned long)buf_);
imgSetBufferElement( bid_, 0, IMG_BUFF_SIZE, buflen_ );
imgSetBufferElement( bid_, 0, IMG_BUFF_COMMAND,IMG_CMD_STOP );
imgMemLock( bid_ );
imgSessionConfigure( sid_, bid_ );
imgSessionAcquire(Sid, TRUE, NULL);
The problem is how can I copy the data from the buffers?i have used imgSessionCopyBufferByNumber to copy image data,but it don`t work.can i use which function?
11-20-2012 05:01 PM
If you are allocating the image buffer directly there, you already have the buffer (buf) and don't need to copy it --- you can just directly reference it (zero-copy). There is some hand-shaking with the driver you might need to do in certain circumstances to protect the buffer from being overridden while you access it, but if you are only acquiring a one-shot sequence then you probably can avoid it.
Eric