[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

| Algorithms to Copy Images |

## Functions
template<... >
void | copyImage (...)
| Copy source image into destination image.
template<... >
void | copyImageIf (...)
| Copy source ROI into destination image.

## Detailed Description

Copy images or regions

## Function Documentation

template<... >
void vigra::copyImage | ( |  | ... | ) |

Copy source image into destination image.

If necessary, type conversion takes place. The function uses accessors to access the pixel data.

Declarations:

pass arguments explicitly:

        namespace vigra {
            template <class SrcImageIterator, class SrcAccessor,
                  class DestImageIterator, class DestAccessor>
            void
            copyImage(SrcImageIterator src_upperleft,
                  SrcImageIterator src_lowerright, SrcAccessor sa,
                  DestImageIterator dest_upperleft, DestAccessor da)
        }

use argument objects in conjunction with Argument Object Factories :

        namespace vigra {
            template <class SrcImageIterator, class SrcAccessor,
                  class DestImageIterator, class DestAccessor>
            void
            copyImage(triple<SrcImageIterator, SrcImageIterator, SrcAccessor> src,
                  pair<DestImageIterator, DestAccessor> dest)
        }

Usage:

#include <vigra/copyimage.hxx>
Namespace: vigra

        vigra::copyImage(srcImageRange(src), destImage(dest));

Required Interface:

        SrcImageIterator src_upperleft, src_lowerright;
        DestImageIterator      dest_upperleft;
        SrcImageIterator::row_iterator sx = src_upperleft.rowIterator();
        DestImageIterator::row_iterator dx = dest_upperleft.rowIterator();

        SrcAccessor src_accessor;
        DestAccessor dest_accessor;

        dest_accessor.set(src_accessor(sx), dx);

template<... >
void vigra::copyImageIf | ( |  | ... | ) |

Copy source ROI into destination image.

Pixel values are copied whenever the return value of the mask's accessor is not zero. If necessary, type conversion takes place. The function uses accessors to access the pixel data.

Declarations:

pass arguments explicitly:

        namespace vigra {
            template <class SrcImageIterator, class SrcAccessor,
                  class MaskImageIterator, class MaskAccessor,
                  class DestImageIterator, clas DestAccessor>
            void
            copyImageIf(SrcImageIterator src_upperleft,
                SrcImageIterator src_lowerright, SrcAccessor sa,
                MaskImageIterator mask_upperleft, MaskAccessor ma,
                DestImageIterator dest_upperleft, DestAccessor da)
        }

use argument objects in conjunction with Argument Object Factories :

        namespace vigra {
            template <class SrcImageIterator, class SrcAccessor,
                  class MaskImageIterator, class MaskAccessor,
                  class DestImageIterator, clas DestAccessor>
            void
            copyImageIf(triple<SrcImageIterator, SrcImageIterator, SrcAccessor> src,
                pair<MaskImageIterator, MaskAccessor> mask,
                pair<DestImageIterator, DestAccessor> dest)
        }

Usage:

#include <vigra/copyimage.hxx>
Namespace: vigra

        vigra::copyImageIf(srcImageRange(src), maskImage(mask), destImage(dest));

Required Interface:

        SrcImageIterator src_upperleft, src_lowerright;
        DestImageIterator dest_upperleft;
        MaskImageIterator mask_upperleft;
        SrcImageIterator::row_iterator sx = src_upperleft.rowIterator();
        MaskImageIterator::row_iterator mx = mask_upperleft.rowIterator();
        DestImageIterator::row_iterator dx = dest_upperleft.rowIterator();

        SrcAccessor src_accessor;
        DestAccessor dest_accessor;
        MaskAccessor mask_accessor;
        Functor functor;

        if(mask_accessor(mx))
            dest_accessor.set(src_accessor(sx), dx);

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.7.1 (3 Dec 2010)