MeVisLab Toolbox Reference
ml::BackgroundTaskTileProcessorBase Class Referenceabstract

BackgroundTaskTileProcessorBase is the base class for processors that request an input image tile-by-tile. More...

#include <mlBackgroundTaskTileProcessor.h>

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

Public Member Functions

 BackgroundTaskTileProcessorBase ()
 
virtual ~BackgroundTaskTileProcessorBase ()
 Destructor.
 
Interface to reimplement.
virtual SubImageBox getNextTileBox ()=0
 Reimplement to return the next tile's SubImageBox.
 
virtual bool processTile (ManagedSubImage &image)=0
 Reimplement to process the given tile. Return true if everything was okay.
 
virtual ManagedSubImagecreateExternalBuffer (const SubImageBox &box)
 Only needs to be reimplemented to allocate the memory for your tiles yourself.
 
Tile properties to setup.
void setDataType (MLDataType dt)
 Sets the data type. If it is not set, it will use the input image data type.
 
MLDataType getDataType () const
 Returns the data type.
 
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.
 
void setAllocationPolicy (TileRequest::AllocationPolicy policy)
 Sets the allocation policy of the tiles that are passed to processTile().
 
void setMaximumQueuedTiles (int size)
 Sets the number of tiles that are allowed to be requested on the request queue.
 
Running the processing.
virtual bool doProcessing (ModuleBackgroundTask &task)
 Starts the processing and returns true if everything went fine.
 

Protected Member Functions

virtual bool setupProcessing (ModuleBackgroundTask &)
 Needs to be reimplemented to set up necessary elements before doProcessing() is called to requests tiles.
 
virtual bool cleanupProcessing (ModuleBackgroundTask &)
 Needs to be reimplemented to clean up elements after doProcessing() is called to finished processing tiles.
 
void setNumTiles (MLint tiles)
 Sets the number of tiles that will be processed.
 

Detailed Description

BackgroundTaskTileProcessorBase is the base class for processors that request an input image tile-by-tile.

Definition at line 34 of file mlBackgroundTaskTileProcessor.h.

Constructor & Destructor Documentation

◆ BackgroundTaskTileProcessorBase()

ml::BackgroundTaskTileProcessorBase::BackgroundTaskTileProcessorBase ( )

◆ ~BackgroundTaskTileProcessorBase()

virtual ml::BackgroundTaskTileProcessorBase::~BackgroundTaskTileProcessorBase ( )
inlinevirtual

Destructor.

Definition at line 40 of file mlBackgroundTaskTileProcessor.h.

Member Function Documentation

◆ cleanupProcessing()

virtual bool ml::BackgroundTaskTileProcessorBase::cleanupProcessing ( ModuleBackgroundTask & )
inlineprotectedvirtual

Needs to be reimplemented to clean up elements after doProcessing() is called to finished processing tiles.

Definition at line 104 of file mlBackgroundTaskTileProcessor.h.

◆ createExternalBuffer()

virtual ManagedSubImage * ml::BackgroundTaskTileProcessorBase::createExternalBuffer ( const SubImageBox & box)
virtual

Only needs to be reimplemented to allocate the memory for your tiles yourself.

It is only called if setAllocationPolicy() is called with TileRequest::ExternalBuffer.

◆ doProcessing()

virtual bool ml::BackgroundTaskTileProcessorBase::doProcessing ( ModuleBackgroundTask & task)
virtual

Starts the processing and returns true if everything went fine.

◆ getDataType()

MLDataType ml::BackgroundTaskTileProcessorBase::getDataType ( ) const
inline

Returns the data type.

Definition at line 71 of file mlBackgroundTaskTileProcessor.h.

◆ getInputImageIndex()

int ml::BackgroundTaskTileProcessorBase::getInputImageIndex ( ) const
inline

Returns the input image index.

Definition at line 76 of file mlBackgroundTaskTileProcessor.h.

◆ getNextTileBox()

virtual SubImageBox ml::BackgroundTaskTileProcessorBase::getNextTileBox ( )
pure virtual

Reimplement to return the next tile's SubImageBox.

Implemented in ml::BackgroundTaskTileProcessor.

◆ processTile()

virtual bool ml::BackgroundTaskTileProcessorBase::processTile ( ManagedSubImage & image)
pure virtual

Reimplement to process the given tile. Return true if everything was okay.

◆ setAllocationPolicy()

void ml::BackgroundTaskTileProcessorBase::setAllocationPolicy ( TileRequest::AllocationPolicy policy)
inline

Sets the allocation policy of the tiles that are passed to processTile().

The default is to use the MemoryManager.

Definition at line 80 of file mlBackgroundTaskTileProcessor.h.

◆ setDataType()

void ml::BackgroundTaskTileProcessorBase::setDataType ( MLDataType dt)
inline

Sets the data type. If it is not set, it will use the input image data type.

Definition at line 69 of file mlBackgroundTaskTileProcessor.h.

References mlrange_cast().

◆ setInputImageIndex()

void ml::BackgroundTaskTileProcessorBase::setInputImageIndex ( int index)
inline

Sets the input image from which data is requested. The default is 0.

Definition at line 74 of file mlBackgroundTaskTileProcessor.h.

◆ setMaximumQueuedTiles()

void ml::BackgroundTaskTileProcessorBase::setMaximumQueuedTiles ( int size)
inline

Sets the number of tiles that are allowed to be requested on the request queue.

Definition at line 83 of file mlBackgroundTaskTileProcessor.h.

◆ setNumTiles()

void ml::BackgroundTaskTileProcessorBase::setNumTiles ( MLint tiles)
inlineprotected

Sets the number of tiles that will be processed.

Definition at line 107 of file mlBackgroundTaskTileProcessor.h.

References mlrange_cast().

◆ setupProcessing()

virtual bool ml::BackgroundTaskTileProcessorBase::setupProcessing ( ModuleBackgroundTask & )
inlineprotectedvirtual

Needs to be reimplemented to set up necessary elements before doProcessing() is called to requests tiles.

Reimplemented in ml::BackgroundTaskTileProcessor.

Definition at line 101 of file mlBackgroundTaskTileProcessor.h.


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