13#ifndef ML_BACKGROUND_TASK_TILE_PROCESSOR_H
14#define ML_BACKGROUND_TASK_TILE_PROCESSOR_H
22#include <ThirdPartyWarningsDisable.h>
24#include <ThirdPartyWarningsRestore.h>
30class ModuleBackgroundTask;
111 std::deque<ImagingBackgroundTask::AsyncTileRequest > _queue;
113 int _inputImageIndex;
#define MLBACKGROUNDTASKS_EXPORT
MLDataType getDataType() const
Returns the data type.
BackgroundTaskTileProcessorBase()
virtual bool setupProcessing(ModuleBackgroundTask &)
Needs to be reimplemented to set up necessary elements before doProcessing() is called to requests ti...
void setAllocationPolicy(TileRequest::AllocationPolicy policy)
virtual bool doProcessing(ModuleBackgroundTask &task)
Starts the processing and returns true if everything went fine.
virtual ~BackgroundTaskTileProcessorBase()
Destructor.
void setNumTiles(MLint tiles)
Sets the number of tiles that will be processed.
void setInputImageIndex(int index)
Sets the input image from which data is requested. The default is 0.
int getInputImageIndex() const
Returns the input image index.
virtual SubImageBox getNextTileBox()=0
Reimplement to return the next tile's SubImageBox.
void setDataType(MLDataType dt)
Sets the data type. If it is not set, it will use the input image data type.
virtual bool cleanupProcessing(ModuleBackgroundTask &)
Needs to be reimplemented to clean up elements after doProcessing() is called to finished processing ...
void setMaximumQueuedTiles(int size)
Sets the number of tiles that are allowed to be requested on the request queue.
virtual bool processTile(ManagedSubImage &image)=0
Reimplement to process the given tile. Return true if everything was okay.
virtual ManagedSubImage * createExternalBuffer(const SubImageBox &box)
void setTileExtent(const ImageVector &extent)
void setRegion(const SubImageBox &box)
Sets the box that shall be processed tile-by-tile. Default is the complete input image's box.
SubImageBox getNextTileBox() override
Reimplemented to return the next tile's box as given by the iterator.
void setClipTilesToRegion(bool clip)
BackgroundTaskTileProcessor()
bool setupProcessing(ModuleBackgroundTask &task) override
Reimplemented to set up necessary elements before doProcessing() is called to requests tiles.
AllocationPolicy
Defines how the TileRequest will allocate its memory.
TSubImageBox< MLint > SubImageBox
Defines the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type...
TImageVector< MLint > ImageVector
Defines the standard ImageVector type that is used by the ML for indexing and coordinates.