ImFusion SDK 4.3
SequentialImageProcessor Class Referenceabstract

#include <ImFusion/Base/SequentialImageProcessor.h>

Interface for algorithms that are able to repeatedly process individual images. More...

+ Inheritance diagram for SequentialImageProcessor:

Detailed Description

Interface for algorithms that are able to repeatedly process individual images.

The central idea behind this interface is to create algorithms once and use them on multiple images, without having to re-configure, re-compile shaders, or performing other unnecessary and time-consuming steps for every image.

Algorithms implementing this interface must support instantiation through the algorithm factory with a single, exemplary image as the only input. This input may be used to set configuration, prepare shader programs etc. It must not be used for processing within processImage(), though, because it may only exist temporarily.

A common way to use such an algorithm is as follows:

ImageResamplingAlgorithm resampler({exampleImage});
resampler.setSequentialMode(true);
resampler.configure(&p); // configure with some properties
for (int i = 0; i < testSIS->size(); i++)
{
auto resampledImg = resampler.processImage(testSIS->get(i), testSIS->components(i));
...
}
Algorithm for resampling an image to a target dimension or resolution, optionally with respect to ano...
Definition ImageResamplingAlgorithm.h:53
virtual void setSequentialMode(bool b)
This method should be called to let the algorithm know that it should only run in sequential mode.
Definition SequentialImageProcessor.h:65

Note that the standard compute() method is not called. Mixing standard operation via compute() and sequential operation is not necessarily supported as supporting algorithms may bind framebuffers etc. on demand, which are not transferrable across GL contexts.

See StreamAlgorithmExecutor for exemplary usage of this interface.

Public Member Functions

virtual std::pair< std::shared_ptr< SharedImage >, DataComponentListprocessImage (const SharedImage &image, const DataComponentList &components) const =0
 Processes a single image without modifying the algorithm's status.
 
virtual void setSequentialMode (bool b)
 This method should be called to let the algorithm know that it should only run in sequential mode.
 
virtual bool isSequentialMode () const
 Returns of the algorithm should only run in sequential mode.
 

Protected Attributes

bool m_isSequentialMode = false
 Flag to determine if algorithm is running in sequential mode.
 

Member Function Documentation

◆ processImage()

virtual std::pair< std::shared_ptr< SharedImage >, DataComponentList > processImage ( const SharedImage & image,
const DataComponentList & components ) const
pure virtual

Processes a single image without modifying the algorithm's status.

The algorithm parameters should be configured in advance.

Returns
the result of the computation (may be null, e.g. if some frame should be dropped)

Implemented in ApplyMaskAlgorithm, BasicImageProcessing, GlFilterSet, ImageResamplingAlgorithm, OperationsSequenceAlgorithm, MorphologicalOperationsAlgorithm, and RemoveDuplicateFrames.

◆ setSequentialMode()

virtual void setSequentialMode ( bool b)
inlinevirtual

This method should be called to let the algorithm know that it should only run in sequential mode.

It is set to true by the StreamAlgorithmExecutor. Algorithm controllers may use this flag to not call compute().

◆ isSequentialMode()

virtual bool isSequentialMode ( ) const
inlinevirtual

Returns of the algorithm should only run in sequential mode.

Algorithm controllers may use this flag to not call compute().


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close