MeVisLab Toolbox Reference
ml::GetTileJob Class Reference

Public interface for requesting a tile from a an ML PagedImage using the PageRequestProcessor. More...

#include <mlGetTileJob.h>

Inheritance diagram for ml::GetTileJob:
ml::GetTileJobBase

Public Member Functions

 GetTileJob (PagedImage &image, const SubImageBox &box, MLDataType datatype, const ScaleShiftData &scaleShiftData=ScaleShiftData())
 Creates a GetTileJob for the given PagedImage image with the requested box, datatype and optional shifting/scaling. More...
 
 ~GetTileJob () override
 Destructor. More...
 
MLErrorCode init (PageRequestProcessor &processor) override
 Initializes the tile request and add it to the processor if no error occurs. More...
 
void setAllocationPolicy (TileRequest::AllocationPolicy policy)
 Sets which allocation policy should be used. More...
 
void setRequestAsReadOnlyPage ()
 Sets that the tile is used read-only (so that a ML page can be passed directly as tile data) This will only work under special conditions: The tile's box/datatype/shiftScale needs to exactly match the input page. More...
 
void setExternalDataBuffer (void *data)
 This allows to set the data buffer from an external buffer. More...
 
const SubImagegetSubImage ()
 Returns access to the stored subimage (including the data, which is allocated using the AllocationPolicy). More...
 
- Public Member Functions inherited from ml::GetTileJobBase
 GetTileJobBase ()
 
virtual ~GetTileJobBase ()
 
double getProgress () const
 Returns the current progress of the tile request ([0..1] range). More...
 
bool hasFinished ()
 Returns if the request has finished (If an error happened, true will be returned as well). More...
 
bool hasError () const
 Returns if the request has an error (and the data is thus unusable/invalid). More...
 
MLErrorCode getError () const
 Returns the error that happened (return ML_RESULT_OK if everything is ok). More...
 
void setTileRequestFinishedCB (TileRequestFinishedCB *cb, void *data)
 Sets the tile request finished cb, which is called when the tile is ready. More...
 
void cancel ()
 Cancels the GetTileJob, this only sets the flag, the real cancellation needs to be done on the PageRequestProcessor. More...
 
void updateProgress ()
 Called by host to allow custom progress updates. More...
 
virtual void delegateProgressUpdate (double)
 Emits the progress when it changes, to be reimplemented in derived classes. More...
 
void setProgressCB (MLRequestProgressCB *progressCallback, void *progressCallbackUserData)
 Set the progress callback. It will be called when updateProgress() is called. More...
 

Additional Inherited Members

- Protected Attributes inherited from ml::GetTileJobBase
TileRequest_request
 The root TileRequest that is used internally. More...
 
MLRequestProgressCB_progressCB
 
void * _progressCBUserData
 
double _lastProgress
 

Detailed Description

Public interface for requesting a tile from a an ML PagedImage using the PageRequestProcessor.

Definition at line 80 of file mlGetTileJob.h.

Constructor & Destructor Documentation

◆ GetTileJob()

ml::GetTileJob::GetTileJob ( PagedImage image,
const SubImageBox box,
MLDataType  datatype,
const ScaleShiftData scaleShiftData = ScaleShiftData() 
)

Creates a GetTileJob for the given PagedImage image with the requested box, datatype and optional shifting/scaling.

After creation, the job needs to be initialized using init(), see below.

◆ ~GetTileJob()

ml::GetTileJob::~GetTileJob ( )
override

Destructor.

Member Function Documentation

◆ getSubImage()

const SubImage& ml::GetTileJob::getSubImage ( )
inline

Returns access to the stored subimage (including the data, which is allocated using the AllocationPolicy).

Definition at line 118 of file mlGetTileJob.h.

◆ init()

MLErrorCode ml::GetTileJob::init ( PageRequestProcessor processor)
overridevirtual

Initializes the tile request and add it to the processor if no error occurs.

It returns ML_REQUEST_OUTSIDE_OF_IMAGE if the request lies completely outside of the image. In that case, the data is allocated as uninitialized memory according to the allocation policy.

Implements ml::GetTileJobBase.

◆ setAllocationPolicy()

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

Sets which allocation policy should be used.

NOTE: This can only be changed directly after the constructor of the class, it has no affect when the data is already allocated. The default policy is to use the MLMemoryManager.

Definition at line 101 of file mlGetTileJob.h.

◆ setExternalDataBuffer()

void ml::GetTileJob::setExternalDataBuffer ( void *  data)
inline

This allows to set the data buffer from an external buffer.

The buffer will not be managed by the GetTileJob, the ownership stays with the user.

Definition at line 112 of file mlGetTileJob.h.

◆ setRequestAsReadOnlyPage()

void ml::GetTileJob::setRequestAsReadOnlyPage ( )
inline

Sets that the tile is used read-only (so that a ML page can be passed directly as tile data) This will only work under special conditions: The tile's box/datatype/shiftScale needs to exactly match the input page.

This sets the allocation policy to NoAllocation, since the data should be taken from the existing page. If it fails to get the data read-only, no data will be received.

Definition at line 108 of file mlGetTileJob.h.


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