You can use the method syncGetImage to synchronously get an image. The method will send the appropriate command, and wait for the result, thus blocking your thread until the image is received.
client->send("camera.resolution = 0;camera.gain = 2;");
int width, height;
client->syncGetImage("camera", myBuffer, myBufferSize, IMAGE_JPEG, URBI_TRANSMIT_JPEG, width, height);
The first parameter is the name of the camera device. The second is the buffer (void*) which will be filled with the image data. The third must be an integer variable equal to the size of the buffer. The function will set this variable to the size of the data. If the buffer is too small, data will be truncated .
The fourth parameter is the format in which you want to receive the image data. Possible values are IMAGE_RGB for a raw RGB 24 bit per pixel image, IMAGE_PPM for a PPM file, IMAGE_YCbCr for raw YCbCr data, and IMAGE_JPEG for a jpeg-compressed file.
The fifth parameter can be either URBI_TRANSMIT_JPEG or URBI_TRANSMIT_YCbCR and specifies how the image will be transmitted between the robot and the client. Transmitting JPEG images increases the frame rate and should be used for better performances.
Finaly the width and height parameters are filled with the with and height of the image on return.