Image Component Library (ICL)
|
Utility class to split an images roi into a set of shallow copies. More...
#include <ImageSplitter.h>
Static Public Member Functions | |
static std::vector< core::ImgBase * > | split (core::ImgBase *src, int nParts) |
splits a source image into given number of parts More... | |
static const std::vector< core::ImgBase * > | split (const core::ImgBase *src, int nParts) |
splits a const source image into a given number of const parts More... | |
static void | release (const std::vector< core::ImgBase * > &v) |
releases all images within the given vector More... | |
Private Member Functions | |
ImageSplitter () | |
private constructor More... | |
Static Private Member Functions | |
static void | splitImage (core::ImgBase *src, std::vector< core::ImgBase * > &parts) |
internally used static splitting function More... | |
Utility class to split an images roi into a set of shallow copies.
In some cases it is useful, to devide a task, that should be applied on an images ROI, into a set of disjoint subtasks. This can be achieved by generating a set of shallow copied images with disjoint ROIs. E.g. if we have a source image of size 320x240 (with full ROI). This can be split into e.g. 4 sub images with the following ROIs:
Of course, we can split the source images also vertically, but a horizontal cut is closer to the internal data representation, which is also aligned horizontally.
A common application for splitting images is multi-threading: Instead of applying a filter on an images ROI, the image can easily be split using the ImageSplitter, and the filter can be applied on each of the resulting images parts in a dedicated thread.
|
inlineprivate |
private constructor
|
static |
releases all images within the given vector
|
static |
splits a source image into given number of parts
|
static |
splits a const source image into a given number of const parts
|
staticprivate |
internally used static splitting function
Note: the resulting images must be deleted manually and the given parts vector must be given, initalized with NULL pointers.