Image Component Library (ICL)
Static Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
icl::filter::ImageSplitter Class Reference

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...
 

Detailed Description

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:

  1. 0,0,320,60
  2. 0,60,320,60
  3. 0,120,320,60
  4. 0,180,320,60

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.

Constructor & Destructor Documentation

◆ ImageSplitter()

icl::filter::ImageSplitter::ImageSplitter ( )
inlineprivate

private constructor

Member Function Documentation

◆ release()

static void icl::filter::ImageSplitter::release ( const std::vector< core::ImgBase * > &  v)
static

releases all images within the given vector

◆ split() [1/2]

static std::vector<core::ImgBase*> icl::filter::ImageSplitter::split ( core::ImgBase src,
int  nParts 
)
static

splits a source image into given number of parts

◆ split() [2/2]

static const std::vector<core::ImgBase*> icl::filter::ImageSplitter::split ( const core::ImgBase src,
int  nParts 
)
static

splits a const source image into a given number of const parts

◆ splitImage()

static void icl::filter::ImageSplitter::splitImage ( core::ImgBase src,
std::vector< core::ImgBase * > &  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.


The documentation for this class was generated from the following file: