13#ifndef ML_GET_TILE_JOB_H
14#define ML_GET_TILE_JOB_H
28class PageRequestProcessor;
115 _request->setExternalDataBuffer(data);
TileRequest * _request
The root TileRequest that is used internally.
void setTileRequestFinishedCB(TileRequestFinishedCB *cb, void *data)
Sets the tile request finished callback that is called when the tile is ready.
void * _progressCBUserData
MLRequestProgressCB * _progressCB
virtual MLErrorCode init(PageRequestProcessor &processor)=0
Initializes the tile request and adds it to the processor if no error occurs.
virtual void delegateProgressUpdate(double)
Emits the progress when it changes, to be reimplemented in derived classes.
bool hasError() const
Returns whether the request has an error and the data is thus unusable/invalid.
virtual ~GetTileJobBase()
MLErrorCode getError() const
Returns the error that happened. It returns ML_RESULT_OK if everything is ok.
void setProgressCB(MLRequestProgressCB *progressCallback, void *progressCallbackUserData)
Sets the progress callback. It will be called when updateProgress() is called.
double getProgress() const
Returns the current progress of the tile request ([0..1] range).
void cancel()
Cancels the GetTileJob. This only sets the flag, the real cancellation needs to be done on the PageRe...
MLErrorCode init(PageRequestProcessor &processor) override
const SubImage & getSubImage()
Returns access to the stored subimage including the data, which is allocated using the AllocationPoli...
GetTileJob(PagedImage &image, const SubImageBox &box, MLDataType datatype, const ScaleShiftData &scaleShiftData=ScaleShiftData())
void setAllocationPolicy(TileRequest::AllocationPolicy policy)
void setRequestAsReadOnlyPage()
void setExternalDataBuffer(void *data)
~GetTileJob() override
Destructor.
AllocationPolicy
Defines how the TileRequest will allocate its memory.
MLint32 MLErrorCode
Type of an ML Error code.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
void MLRequestProgressCB(void *usrData, double progress)
void TileRequestFinishedCB(void *data, TileRequest *request)
Callback for a finished TileRequest.
TScaleShiftData< MLdouble > ScaleShiftData
Double version of TScaleShiftData for maximum reasonable precision.
TSubImageBox< MLint > SubImageBox
Defines the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type...