![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/SequentialImageProcessor.h>
Interface for algorithms that are able to repeatedly process individual images. More...
Inheritance diagram for SequentialImageProcessor: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:
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 >, DataComponentList > | processImage (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. | |
|
pure virtual |
Processes a single image without modifying the algorithm's status.
The algorithm parameters should be configured in advance.
Implemented in ApplyMaskAlgorithm, BasicImageProcessing, GlFilterSet, ImageResamplingAlgorithm, OperationsSequenceAlgorithm, MorphologicalOperationsAlgorithm, and RemoveDuplicateFrames.
|
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().
|
inlinevirtual |
Returns of the algorithm should only run in sequential mode.
Algorithm controllers may use this flag to not call compute().