13 #ifndef ML_PROCESS_ALL_PAGES_HANDLER_H
14 #define ML_PROCESS_ALL_PAGES_HANDLER_H
23 #include <ThirdPartyWarningsDisable.h>
24 #include <boost/unordered_map.hpp>
25 #include <ThirdPartyWarningsRestore.h>
61 virtual const char*
getName() {
return nullptr; }
65 static void calcOutImagePropsCB(
void* userData,
PagedImage* outImg) {
static_cast<ProcessAllPagesHandler*
>(userData)->calculateOutputImageProperties(outImg); }
103 boost::unordered_map<MLint, SubImage> _bufferedImages;
137 boost::unordered_map<MLint, std::vector<SubImage> > _bufferedImages;
Base class for the calculation of pages of an output image (PagedImage) of a Module.
A ProcessAllPages handler that offers ordered tile delivery on any number of input images.
void calculateOutputSubImage(SubImage *outputSubImage, SubImage *inputSubImages, UserThreadData *) override
Internal method, do not reimplement!
void calculateOutputImageProperties(PagedImage *image) override
Reimplement this method to specify the virtual output image's data type/size/page extent.
virtual MLErrorCode processTiles(SubImage *images)=0
Reimplement this method to perform the processing, return ML_RESULT_OK if processing should go on; ot...
SubImageBox calculateInputSubImageBox(int, const SubImageBox &outputSubImageBox) override
Reimplement this method to specify the input image box for the input images.
OrderedProcessAllPagesHandler()
A ProcessAllPages handler that offers ordered tile delivery on a single input image.
virtual MLErrorCode processTile(const SubImage &image)=0
Reimplement this method to perform the processing, return ML_RESULT_OK if processing should go on; ot...
void calculateOutputImageProperties(PagedImage *image) override
Reimplement this method to specify the virtual output image's data type/size/page extent.
virtual SubImageBox calculateInputSubImageBox(const SubImageBox &outputSubImageBox)
Reimplement this method to specify the input image box for the input image with index == _inputIndex.
OrderedSingleInputProcessAllPagesHandler(int inputIndex=0)
SubImageBox calculateInputSubImageBox(int inputIndex, const SubImageBox &outputSubImageBox) override
Internal method, do not reimplement!
void calculateOutputSubImage(SubImage *outputSubImage, SubImage *inputSubImages, UserThreadData *) override
Internal method, do not reimplement!
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
Base class for handlers that are used for the Module::processAllPages facility.
virtual void calculateOutputImageProperties(PagedImage *)
Calculates the (temporary and virtual) output image's properties, which by default has the properties...
virtual const char * getName()
Returns the name of the handler.
virtual void updateProgress(double)
Called in regular intervals if wantsProgressUpdates() == true.
void install(PagedImage *outImg)
Installs the handler on the PagedImage, which is typically called by the ML Host; do not call it your...
virtual bool wantsProgressUpdates()
Returns whether the handler wants to receive progress updates via updateProgress().
This class manages/represents a rectangular 6D image region that is organized linearly in memory.
Base class for thread local data that is passed to CalculateOutputImageHandler::calculateOutputSubIma...
MLint32 MLErrorCode
Type of an ML Error code.
#define MLEXPORT
To export symbols from a DLL/shared object, we need to mark them with the MLEXPORT symbol.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...