40class ProcessAllPagesHandler;
42class PageRequestProcessorBase;
43class PageRequestProcessor;
44class ProcessingTimeLine;
49#define ML_HOST_UPDATE_PROGRESS_INTERVAL 0.3
253 void* progressCallbackUserData =
nullptr);
287 void* progressCallbackUserData =
nullptr);
307 void* progressCallbackUserData =
nullptr);
319 void* progressCallbackUserData =
nullptr);
328 void* progressCallbackUserData =
nullptr);
341 void* progressCallbackUserData =
nullptr);
353 void* progressCallbackUserData =
nullptr);
419 bool clearPages =
true,
421 void* progressCallbackUserData =
nullptr);
452 bool _insideUpdateProgress;
458 void* _breakCheckUserData;
467 MLint32 _restrictMaxNumThreads;
474 static unsigned int _memoryManagerId;
477 static Host* _instance;
485 bool _useClassicMLHost;
Base class for TileRequest based jobs.
MLErrorCode processAllPages(Module &module, ProcessAllPagesHandler &handler, SubImageBox region=SubImageBox(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
void setMaxNumThreads(MLint32 numThreads)
MLErrorCode getTile(PagedImage &outputImage, SubImage &subImage, const ScaleShiftData &scaleShiftData=ScaleShiftData(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
friend class PageRequestProcessor
ProcessingTimeLine & getProcessingTimeLine()
Returns access to the processing timeline.
static void registerWithMemoryManager()
Field * getPressedNotifyField()
bool shouldTerminate() const
MLErrorCode processAllPagesWithInputImage(PagedImage &inputImage, ProcessAllPagesHandler &handler, const SubImageBox ®ion=SubImageBox(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
void * getProgressCBUserData() const
Returns user data of current callback for progress/busy cursor updates.
MLint32 getMaxNumThreads() const
Returns the maximum number of permitted worker threads.
void * getBreakCheckCBUserData() const
Returns user data of the current callback for break checking.
bool getUseClassicHost() const
Returns whether the classic ML host is used.
MLHostProgressCB * getProgressCB() const
Returns current callback for progress/busy cursor updates.
MLHostBreakCheckCB * getBreakCheckCB() const
Returns the current callback for break checking.
void _unsetProcessingActive()
void _setProcessingActive()
void enableTimeLineProfiling(bool flag)
Enables/disables timeline profiling.
void freeTile(void *data)
MLErrorCode updateImageProperties(Module &module, MLint outputIndex)
void setUseClassicHost(bool flag)
Enables/disables usage of the classic ML host.
static unsigned int getMemoryManagerId()
Returns the memory manager ID that is used for allocation of memory by the ML.
MLErrorCode processMissingPages(Module &module, MLint outputIndex, SubImageBox region=SubImageBox(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
ClassicHost * getClassicHostDebug()
Returns access to the classic ML host (for debugging purposes only!).
void updateProgress(const char *info1, const char *info2)
static SubImageBox calculateInputSubImageBoxDebug(Module &module, int inIndex, const SubImageBox &outputSubImageBox, int outputIndex)
MLErrorCode processAllPagesWithInputImages(const std::vector< PagedImage * > &inputImages, ProcessAllPagesHandler &handler, const SubImageBox ®ion=SubImageBox(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
void setBreakCheckCB(void *userData, MLHostBreakCheckCB *callback)
Sets callback for break checking.
PageRequestProcessor * getPageRequestProcessor()
Returns the currently responsible page request processor.
static Host & getDefaultHost()
Returns a reference to the Host singleton.
void setProgressCB(void *userData, MLHostProgressCB *callback)
Sets callback for progress/busy cursor updates.
friend class MultiThreadedPageRequestProcessor
static void destroyDefaultHost()
Destroys and cleans up allocated memory of default Host.
MLErrorCode getTile(PagedImage &outputImage, SubImageBox location, MLDataType dataType, void **data, const ScaleShiftData &scaleShiftData=ScaleShiftData(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
friend class SingleThreadedPageRequestProcessor
virtual ~Host()
Destructor.
void setRestrictMaxNumThreads(MLint32 numThreads)
MLint32 getRestrictMaxNumThreads() const
Returns the restriction for setMaxNumThreads().
MLuint32 isProcessingActive() const
Non-zero return values mean that (image) processing is currently active.
MLErrorCode updateImageProperties(PagedImage &outputImage)
MLErrorCode processAllPages(Module &module, MLint outputIndex, SubImageBox region=SubImageBox(), MLRequestProgressCB *progressCallback=nullptr, void *progressCallbackUserData=nullptr)
Stores a processing timeline for multiple threads.
#define ML_DISALLOW_COPY_AND_ASSIGN(className)
Defines basic macros.
MLint32 MLErrorCode
Type of an ML Error code.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
MLint32 MLHostBreakCheckCB(void *usrData, void **hitField)
void MLRequestProgressCB(void *usrData, double progress)
void MLHostProgressCB(void *usrData, const char *info1, const char *info2)
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...
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator '<<' for stream output of Field objects.