MeVisLab Toolbox Reference
|
Public interface for requesting a tile from a an ML PagedImage using the PageRequestProcessor. More...
#include <mlGetTileJob.h>
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. | |
~GetTileJob () override | |
Destructor. | |
MLErrorCode | init (PageRequestProcessor &processor) override |
Initializes the tile request and adds it to the processor if no error occurs. | |
void | setAllocationPolicy (TileRequest::AllocationPolicy policy) |
Sets which allocation policy should be used. | |
void | setRequestAsReadOnlyPage () |
Sets that the tile is used read-only so that an ML page can be passed directly as tile data. | |
void | setExternalDataBuffer (void *data) |
This allows to set the data buffer from an external buffer. | |
const SubImage & | getSubImage () |
Returns access to the stored subimage including the data, which is allocated using the AllocationPolicy. | |
![]() | |
GetTileJobBase () | |
virtual | ~GetTileJobBase () |
double | getProgress () const |
Returns the current progress of the tile request ([0..1] range). | |
bool | hasFinished () |
Returns whether the request has finished. | |
bool | hasError () const |
Returns whether the request has an error and the data is thus unusable/invalid. | |
MLErrorCode | getError () const |
Returns the error that happened. It returns ML_RESULT_OK if everything is ok. | |
void | setTileRequestFinishedCB (TileRequestFinishedCB *cb, void *data) |
Sets the tile request finished callback that is called when the tile is ready. | |
void | cancel () |
Cancels the GetTileJob. This only sets the flag, the real cancellation needs to be done on the PageRequestProcessor. | |
void | updateProgress () |
Called by host to allow custom progress updates. | |
virtual void | delegateProgressUpdate (double) |
Emits the progress when it changes, to be reimplemented in derived classes. | |
void | setProgressCB (MLRequestProgressCB *progressCallback, void *progressCallbackUserData) |
Sets the progress callback. It will be called when updateProgress() is called. | |
Additional Inherited Members | |
![]() | |
TileRequest * | _request |
The root TileRequest that is used internally. | |
MLRequestProgressCB * | _progressCB |
void * | _progressCBUserData |
double | _lastProgress |
Public interface for requesting a tile from a an ML PagedImage using the PageRequestProcessor.
Definition at line 81 of file mlGetTileJob.h.
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.
|
override |
Destructor.
Returns access to the stored subimage including the data, which is allocated using the AllocationPolicy.
Definition at line 119 of file mlGetTileJob.h.
|
overridevirtual |
Initializes the tile request and adds 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.
|
inline |
Sets which allocation policy should be used.
Note: This can only be changed directly after the constructor of the class, it has no effect when the data is already allocated. The default policy is to use the MLMemoryManager.
Definition at line 102 of file mlGetTileJob.h.
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 113 of file mlGetTileJob.h.
|
inline |
Sets that the tile is used read-only so that an 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 109 of file mlGetTileJob.h.