The FrameSnapSink is a sink type used to grab a number frames from the video stream on demand.
This sink is useful in situations where the application only needs access to the image data of some of the images, for example as part of a snapshot operation or at regular intervals. Live video can still be displayed as it is received by the device. If the application needs to process all images, the FrameQueueSink is the preferred option.
A simple example is shown here:
// Create a FrameSnapSink, specify buffer type as RGB32, pre-allocate one buffer on connect auto pSink = FrameSnapSink::create( MEDIASUBTYPE_RGB32, 1 ); // Use the sink and start grabber grabber.setSinkType( pSink ); grabber.startLive(); // Snap 1 image with 3 second timeout auto pBuffer = pSink->snapSingle( 3000 ); // Save image saveToFileBMP( *pBuffer, "test.bmp" );
The sink is created by calling FrameSnapSink::create, and is passed MEDIASUBTYPE_RGB32 to specify that the sink wants to capture RGB32 color images. The second parameter instructs the sink to pre-allocate image buffers, instead having to create them on demand when snapSingle or snapSequence is called without a destination buffer.
Header File: tisudshl.h
Introduced in version 3.5
Creates a new FrameSnapSink.
Retrieves the FrameTypeInfo of the current connection.
This method lets the FrameSnapSink copy the next images to be recevied from the device into a collection of FrameQueueBuffers.
This method lets the FrameSnapSink copy the next image to be recevied from the device into a FrameQueueBuffer.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.