MeVisLab Toolbox Reference
ml::BackgroundTaskTileProcessor Class Reference

A BackgroundTaskTileProcessor can be used as a base class for processing an input image tile-by-tile without handling the details of an asynchronous request queue yourself. More...

#include <mlBackgroundTaskTileProcessor.h>

Inheritance diagram for ml::BackgroundTaskTileProcessor:
ml::BackgroundTaskTileProcessorBase

Public Member Functions

 BackgroundTaskTileProcessor ()
 
SubImageBox getNextTileBox () override
 Reimplemented to return the next tile's box as given by the iterator.
 
bool setupProcessing (ModuleBackgroundTask &task) override
 Reimplemented to setup things before doProcessing() requests tiles.
 
Specifying the tile extent and box to process.
void setRegion (const SubImageBox &box)
 Set the box that shall be processed tile-by-tile (default is the complete input image's box).
 
void setTileExtent (const ImageVector &extent)
 Set the desired extent of the individual tiles (a component value of -1 means to use the region's extent for that component).
 
void setClipTilesToRegion (bool clip)
 Set if the tiles are clipped to the requested region (default is true), which means that the tiles are smaller on borders if they do not fit the box to process.
 
- Public Member Functions inherited from ml::BackgroundTaskTileProcessorBase
 BackgroundTaskTileProcessorBase ()
 
virtual ~BackgroundTaskTileProcessorBase ()
 Destructor.
 
virtual bool processTile (ManagedSubImage &image)=0
 Reimplement to process the given tile, return true if everything was ok.
 
virtual ManagedSubImagecreateExternalBuffer (const SubImageBox &box)
 Only needs to be reimplemented to allocate the memory for your tiles yourself, is only called if setAllocationPolicy() is called with TileRequest::ExternalBuffer.
 
void setDataType (MLDataType dt)
 Set the datatype (if it is not set, it will use the input image datatype).
 
MLDataType getDataType () const
 Get the datatype.
 
void setInputImageIndex (int index)
 Set the input image from which data is requested (the default is 0).
 
int getInputImageIndex () const
 Get the input image index.
 
void setAllocationPolicy (TileRequest::AllocationPolicy policy)
 Set the allocation policy of the tiles that are passed to processTile() (The default is to use the MemoryManager).
 
void setMaximumQueuedTiles (int size)
 Set the number of tiles that are allowed to be requested on the request queue.
 
virtual bool doProcessing (ModuleBackgroundTask &task)
 Start the processing, returns true if everything went fine.
 

Additional Inherited Members

- Protected Member Functions inherited from ml::BackgroundTaskTileProcessorBase
virtual bool cleanupProcessing (ModuleBackgroundTask &)
 Needs to be reimplemented to cleanup things after doProcessing() finished processing tiles.
 
void setNumTiles (MLint tiles)
 Set the number of tiles that will be processed.
 

Detailed Description

A BackgroundTaskTileProcessor can be used as a base class for processing an input image tile-by-tile without handling the details of an asynchronous request queue yourself.

Typically you will just reimplement processTile().

Definition at line 126 of file mlBackgroundTaskTileProcessor.h.

Constructor & Destructor Documentation

◆ BackgroundTaskTileProcessor()

ml::BackgroundTaskTileProcessor::BackgroundTaskTileProcessor ( )

Member Function Documentation

◆ getNextTileBox()

SubImageBox ml::BackgroundTaskTileProcessor::getNextTileBox ( )
overridevirtual

Reimplemented to return the next tile's box as given by the iterator.

Implements ml::BackgroundTaskTileProcessorBase.

◆ setClipTilesToRegion()

void ml::BackgroundTaskTileProcessor::setClipTilesToRegion ( bool clip)
inline

Set if the tiles are clipped to the requested region (default is true), which means that the tiles are smaller on borders if they do not fit the box to process.

Definition at line 146 of file mlBackgroundTaskTileProcessor.h.

References mlrange_cast().

◆ setRegion()

void ml::BackgroundTaskTileProcessor::setRegion ( const SubImageBox & box)
inline

Set the box that shall be processed tile-by-tile (default is the complete input image's box).

Definition at line 139 of file mlBackgroundTaskTileProcessor.h.

◆ setTileExtent()

void ml::BackgroundTaskTileProcessor::setTileExtent ( const ImageVector & extent)
inline

Set the desired extent of the individual tiles (a component value of -1 means to use the region's extent for that component).

Definition at line 142 of file mlBackgroundTaskTileProcessor.h.

◆ setupProcessing()

bool ml::BackgroundTaskTileProcessor::setupProcessing ( ModuleBackgroundTask & task)
overridevirtual

Reimplemented to setup things before doProcessing() requests tiles.

Reimplemented from ml::BackgroundTaskTileProcessorBase.


The documentation for this class was generated from the following file: