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 :ref:`camera-receive-images-label`. 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: .. code-tabs:: .. code-tab:: cpp :title: C++ 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*: .. code-tabs:: .. code-tab:: cpp :title: C++ Listener listener; listener.EnableNotification(camera, EventType::CameraPreviewReady); camera.Subscription()->PreviewSubscription()->Subscribe(ImageFormat::JPEG); camera.TriggerCapture(); std::shared_ptr 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``. .. TODO: C# for enable previews