[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE > Class Template Reference

An accessor to encapsulate write access to a multiband image, and move divide it into two images. More...

#include <FunctorAccessor.h>

List of all members.

Public Types

typedef Acc1::value_type image_type1
 value type of image 1
typedef Acc2::value_type image_type2
 value type of image 2

Public Member Functions

 ImageSplittingAccessor (Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2)
 Construct from two image iterators and associated accessors.
template<class V, class ITERATOR>
void setComponent (V const &value, ITERATOR const &i, int idx) const
 write value V into the two images.

Protected Member Functions

template<class V, class ITERATOR>
void setComponentIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if first dest image is scalar
template<class V, class ITERATOR>
void setComponentIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraFalseType) const
 if first dest image is vector image
template<class V, class ITERATOR>
void setComponentScalarIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if scalar & scalar image
template<class V, class ITERATOR>
void setComponentScalarIsVector (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if scalar & vector image
template<class V, class ITERATOR>
void setComponentVectorIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if vector & scalar image
template<class V, class ITERATOR>
void setComponentVectorIsVector (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if vector & vector image

Protected Attributes

Iter1 i1_
Acc1 a1_
Iter2 i2_
Acc2 a2_


Detailed Description

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
class vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >

An accessor to encapsulate write access to a multiband image, and move divide it into two images.

This is particulary useful, if a multiband image should be splitted into separate images during import operations. Then one doesn't need to create a temporary image.

This can be used to copy a 4 band image into a 3 band image and a 1 band image, with a single copyImage, or during other operations.

For example, some images contain an alpha channel, and depending on the application, this doesn't need to have the same type, for example, float RGB channels, uint8 mask channel. Many algorithms provided by vigra also expect the masks and the image in separate images.

The following image combinations are supported so far:

This accessor is quite slow. It checks the vector indicies on every access.

Bug:
This is not a complete accessor, only write operations are supported.

value_type is not specified correctly, I don't know how to merge them properly with template programming.

Requirements: both images need to have the same elementary type


Member Typedef Documentation

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
typedef Acc1::value_type vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::image_type1
 

value type of image 1

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
typedef Acc2::value_type vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::image_type2
 

value type of image 2


Constructor & Destructor Documentation

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::ImageSplittingAccessor Iter1  i1,
Acc1  a1,
Iter2  i2,
Acc2  a2
[inline]
 

Construct from two image iterators and associated accessors.


Member Function Documentation

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponent V const &  value,
ITERATOR const &  i,
int  idx
const [inline]
 

write value V into the two images.

V has to be a stl compatible vector type, the two images can be of vector or scalar types.

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentIsScalar V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraFalseType 
const [inline, protected]
 

if first dest image is vector image

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentIsScalar V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraTrueType 
const [inline, protected]
 

if first dest image is scalar

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentScalarIsScalar V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraTrueType 
const [inline, protected]
 

if scalar & scalar image

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentScalarIsVector V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraTrueType 
const [inline, protected]
 

if scalar & vector image

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentVectorIsScalar V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraTrueType 
const [inline, protected]
 

if vector & scalar image

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
template<class V, class ITERATOR>
void vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentVectorIsVector V const &  value,
ITERATOR const &  i,
int  idx,
vigra::VigraTrueType 
const [inline, protected]
 

if vector & vector image


Member Data Documentation

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
Acc1 vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::a1_ [protected]
 

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
Acc2 vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::a2_ [protected]
 

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
Iter1 vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::i1_ [protected]
 

template<class Iter1, class Acc1, class Iter2, class Acc2, int SIZE>
Iter2 vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::i2_ [protected]
 


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

Generated on Mon Sep 20 01:01:37 2010 for Hugintrunk by doxygen 1.3.9.1