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 | |
| 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:
- vector -> scalar, scalar
- vector -> vector, scalar
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
|
|||||
|
value type of image 1
|
|
|||||
|
value type of image 2
|
Constructor & Destructor Documentation
|
||||||||||||||||||||||||
|
Construct from two image iterators and associated accessors.
|
Member Function Documentation
|
||||||||||||||||||||||||
|
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. |
|
||||||||||||||||||||||||||||
|
if first dest image is vector image
|
|
||||||||||||||||||||||||||||
|
if first dest image is scalar
|
|
||||||||||||||||||||||||||||
|
if scalar & scalar image
|
|
||||||||||||||||||||||||||||
|
if scalar & vector image
|
|
||||||||||||||||||||||||||||
|
if vector & scalar image
|
|
||||||||||||||||||||||||||||
|
if vector & vector image
|
Member Data Documentation
|
|||||
|
|
|
|||||
|
|
|
|||||
|
|
|
|||||
|
|
The documentation for this class was generated from the following file:
- hugin_base/vigra_ext/FunctorAccessor.h
1.3.9.1