Previews On Capture
Caution
This feature requires your camera to run a newer firmware:
iXM: Firmware 4.23 or later
IQ4: Firmware 6.03 or later
You can subscribe to image previews, such that they are send to you automatically, when the camera takes a capture. This subscription is a lightweight alternative to receiving the entire IIQ image file, as described in Receive Captured Images.
The previews pushed from the camera after a capture, are delivered to you using notifications. Specifically, the CameraPreviewReady
type. This NotificationEvent includes the preview image in an in memory buffer, accessed using the Preview()
method.
Formats
The IPreviewSubscription
class allows you to specify your desired image format, eg. Jpeg or bitmap. However, remember to query the ImageFormatsSupported()
method, to confirm that the connected camera actually support your desired format. (Support for preview image encoding formats might differ with camera model and firmware.)
You can change the format of returned preview image by calling the designated method: SetFormat
. Or, you can set the format when you enable the subscription, using the special (Preview only) Subscribe(ImageFormat)
method:
camera.Subscription()->PreviewSubscription()->Subscribe(ImageFormat::JPEG);
At this point the camera will push Jpeg’s with image previews (large thumbnails) for every capture taken.
Note
To be able to takes captures, you still need to have storage available for the camera to use. this means either memory card or host storage must be present. Receiving previews is not regarded as a storage option, by the camera.
Receiving Previews
To catch the incoming preview notifications, enable the CameraPreviewReady
notification type on a listener:
Listener listener;
listener.EnableNotification(camera, EventType::CameraPreviewReady);
camera.Subscription()->PreviewSubscription()->Subscribe(ImageFormat::JPEG);
camera.TriggerCapture();
std::shared_ptr<const INotificationEvent const> notification;
notification = listener.WaitForNotification();
std::cout << notification->Preview() << "\n";
This code will trigger a capture, and catch the incoming preview. A description of the Preview()
object is written to the console, using a built-in <<
operator overload for ostream
.