[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Algorithms to Initialize Images | ![]() |
Functions | |
template<... > | |
void | initImage (...) |
Write a value to every pixel in an image or rectangular ROI. More... | |
template<... > | |
void | initImageBorder (...) |
Write value to the specified border pixels in the image. More... | |
template<... > | |
void | initImageIf (...) |
Write value to pixel in the image if mask is true. More... | |
template<... > | |
void | initImageWithFunctor (...) |
Write the result of a functor call to every pixel in an image or rectangular ROI. More... | |
Init images or image borders
void vigra::initImage | ( | ... | ) |
Write a value to every pixel in an image or rectangular ROI.
This function can be used to init the image.
The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer
yields VigraTrueType
. Since the functor is passed by const
reference, its operator()
must be const, and its internal state may need to be mutable
.
Function initMultiArray() implements the same functionality for arbitrary dimensional arrays. In many situations, the assignment functions of vigra::MultiArrayView offer a simpler and more readable alternative to the init functions.
Declarations:
pass 2D array views:
Usage:
#include <vigra/initimage.hxx>
Namespace: vigra
Initialize with a constant:
Initialize with a functor:
void vigra::initImageWithFunctor | ( | ... | ) |
Write the result of a functor call to every pixel in an image or rectangular ROI.
This function can be used to init the image by calling the given functor for each pixel. The functor is passed by reference, so that its internal state can be updated in each call.
Declarations:
pass 2D array views:
Usage:
#include <vigra/initimage.hxx>
Namespace: vigra
void vigra::initImageIf | ( | ... | ) |
Write value to pixel in the image if mask is true.
This function can be used to init a region-of-interest of the image.
The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer
yields VigraTrueType
. Since the functor is passed by const
reference, its operator()
must be const, and its internal state may need to be mutable
.
Declarations:
pass 2D array views:
Usage:
#include <vigra/initimage.hxx>
Namespace: vigra
void vigra::initImageBorder | ( | ... | ) |
Write value to the specified border pixels in the image.
A pixel is initialized if its distance to the border is at most 'borderwidth'.
The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer
yields VigraTrueType
. Since the functor is passed by const
reference, its operator()
must be const, and its internal state may need to be mutable
.
Declarations:
pass 2D array views:
Usage:
#include <vigra/initimage.hxx>
Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|