Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Static Public Member Functions | Private Member Functions | Static Private Member Functions
icl::filter::ImageSplitter Class Reference

Utility class to split an images roi into a set of shallow copies. More...

#include <ImageSplitter.h>

List of all members.

Static Public Member Functions

static std::vector
< core::ImgBase * > 
split (core::ImgBase *src, int nParts)
 splits a source image into given number of parts
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
static void release (const std::vector< core::ImgBase * > &v)
 releases all images within the given vector

Private Member Functions

 ImageSplitter ()
 private constructor

Static Private Member Functions

static void splitImage (core::ImgBase *src, std::vector< core::ImgBase * > &parts)
 internally used static splitting function

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

private constructor


Member Function Documentation

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

releases all images within the given vector

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

splits a source image into given number of parts

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

static void icl::filter::ImageSplitter::splitImage ( core::ImgBase src,
std::vector< core::ImgBase * > &  parts 
) [static, private]

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines