Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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>

Public Types

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

Public Member Functions

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

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 More...
 
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 More...
 
template<class V , class ITERATOR >
void setComponentScalarIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if scalar & scalar image More...
 
template<class V , class ITERATOR >
void setComponentScalarIsVector (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if scalar & vector image More...
 
template<class V , class ITERATOR >
void setComponentVectorIsScalar (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if vector & scalar image More...
 
template<class V , class ITERATOR >
void setComponentVectorIsVector (V const &value, ITERATOR const &i, int idx, vigra::VigraTrueType) const
 if vector & vector image More...
 

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

Definition at line 441 of file FunctorAccessor.h.

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

Definition at line 445 of file FunctorAccessor.h.

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

Definition at line 448 of file FunctorAccessor.h.

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.

Bug:
how to combine two value types into one?

Definition at line 455 of file FunctorAccessor.h.

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.

Definition at line 466 of file FunctorAccessor.h.

References vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentIsScalar().

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

if first dest image is vector image

Definition at line 540 of file FunctorAccessor.h.

References vigra_ext::ImageSplittingAccessor< Iter1, Acc1, Iter2, Acc2, SIZE >::setComponentVectorIsScalar().

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

if scalar & vector image

Definition at line 566 of file FunctorAccessor.h.

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

if vector & vector image

Definition at line 590 of file FunctorAccessor.h.

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: