ML Reference
|
Base class for the calculation of pages of an output image (PagedImage) of a Module. More...
#include <mlModuleInterfaces.h>
Public Member Functions | |
virtual | ~CalculateOutputImageHandler () |
Destructor. | |
virtual SubImageBox | calculateInputSubImageBox (int, const SubImageBox &outputSubImageBox) |
Called by the host to determine which input image region (tile) of input inputIndex is required to calculate a certain output image region (page) of output image. | |
virtual void | calculateOutputSubImage (SubImage *outputSubImage, SubImage *inputSubImages, UserThreadData *userThreadData)=0 |
Calculate page outputSubImage of output image given the input image tiles in array inputSubImages . | |
virtual UserThreadData * | createUserThreadData () |
Create the thread local user data for a thread. | |
Base class for the calculation of pages of an output image (PagedImage) of a Module.
To use a CalculateOutputImageHandler as the handler of a Module output image, reimplement Module::createCalculateOutputImageHandler() and return a derived handler class with reimplemented virtual methods. By default, a handler does not store the output index nor the associated output image pointer itself, since there can be an individual handler class for each output image. If you want to use the same handler for different output images, you can store the output index of the PagedImage via PagedImage::getOutputIndex(). Please note that a new handler instance is created for each output image, so the same handler instance will never be called for different output images.
Definition at line 50 of file mlModuleInterfaces.h.
|
inlinevirtual |
Destructor.
Definition at line 53 of file mlModuleInterfaces.h.
|
inlinevirtual |
Called by the host to determine which input image region (tile) of input inputIndex
is required to calculate a certain output image region (page) of output image.
Default is that a region with position and location of outputSubImageBox
is requested from input image inputIndex
.
Reimplemented in ml::OrderedSingleInputProcessAllPagesHandler, and ml::OrderedProcessAllPagesHandler.
Definition at line 59 of file mlModuleInterfaces.h.
|
pure virtual |
Calculate page outputSubImage
of output image given the input image tiles in array inputSubImages
.
inputSubImages
contains as many images as inputs of the module exists (see Module::getNumInputImages()). If Module::handleInput() is reimplemented and returns Module::ALLOW_INVALID_INPUT for an invalid input image (either not connected or connected and invalid), the input sub image at that index will be empty and contain no data. If not reimplemented, the outputSubImage
will contain undefined data values.
Implemented in ml::internal::TypedHandlerBase< CalculateOutputImageHandler, Derived, NumberOfInputImages >, ml::internal::TypedHandlerBase< ProcessAllPagesHandler, Derived, NumberOfInputImages >, ml::OrderedSingleInputProcessAllPagesHandler, and ml::OrderedProcessAllPagesHandler.
|
inlinevirtual |
Create the thread local user data for a thread.
This method will be called before calculateOutputSubImage() is called the first time for a given thread and is passed as parameter into all calculateOutputSubImage() calls. The ownership of the UserThreadData is passed to the caller. The default implementation returns NULL. Reimplementing this method allows to have per-thread data that is shared for multiple calculateOutputSubImage() calls on that thread, for example to store a temporary buffer that is reused for multiple pages.
Definition at line 80 of file mlModuleInterfaces.h.