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. More...
 
bool setupProcessing (ModuleBackgroundTask &task) override
 Reimplemented to set up necessary elements before doProcessing() is called to requests tiles. More...
 
Specifying the tile extent and box to process.
void setRegion (const SubImageBox &box)
 Sets the box that shall be processed tile-by-tile. Default is the complete input image's box. More...
 
void setTileExtent (const ImageVector &extent)
 Sets the desired extent of the individual tiles A component value of -1 means to use the region's extent for that component. More...
 
void setClipTilesToRegion (bool clip)
 Sets whether the tiles are clipped to the requested region, which means that the tiles are smaller on borders if they do not fit the box to process. More...
 
- Public Member Functions inherited from ml::BackgroundTaskTileProcessorBase
 BackgroundTaskTileProcessorBase ()
 
virtual ~BackgroundTaskTileProcessorBase ()
 Destructor. More...
 
virtual bool processTile (ManagedSubImage &image)=0
 Reimplement to process the given tile. Return true if everything was okay. More...
 
virtual ManagedSubImagecreateExternalBuffer (const SubImageBox &box)
 Only needs to be reimplemented to allocate the memory for your tiles yourself. More...
 
void setDataType (MLDataType dt)
 Sets the data type. If it is not set, it will use the input image data type. More...
 
MLDataType getDataType () const
 Returns the data type. More...
 
void setInputImageIndex (int index)
 Sets the input image from which data is requested. The default is 0. More...
 
int getInputImageIndex () const
 Returns the input image index. More...
 
void setAllocationPolicy (TileRequest::AllocationPolicy policy)
 Sets the allocation policy of the tiles that are passed to processTile(). More...
 
void setMaximumQueuedTiles (int size)
 Sets the number of tiles that are allowed to be requested on the request queue. More...
 
virtual bool doProcessing (ModuleBackgroundTask &task)
 Starts the processing and returns true if everything went fine. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ml::BackgroundTaskTileProcessorBase
virtual bool cleanupProcessing (ModuleBackgroundTask &)
 Needs to be reimplemented to clean up elements after doProcessing() is called to finished processing tiles. More...
 
void setNumTiles (MLint tiles)
 Sets the number of tiles that will be processed. More...
 

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 127 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

Sets whether the tiles are clipped to the requested region, which means that the tiles are smaller on borders if they do not fit the box to process.

Default is true.

Definition at line 149 of file mlBackgroundTaskTileProcessor.h.

◆ setRegion()

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

Sets the box that shall be processed tile-by-tile. Default is the complete input image's box.

Definition at line 140 of file mlBackgroundTaskTileProcessor.h.

◆ setTileExtent()

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

Sets 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 144 of file mlBackgroundTaskTileProcessor.h.

◆ setupProcessing()

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

Reimplemented to set up necessary elements before doProcessing() is called to requests tiles.

Reimplemented from ml::BackgroundTaskTileProcessorBase.


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