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

| FindSum< VALUETYPE > Class Template Reference Functors To Inspect Images |

Find the sum of the pixel values in an image or ROI. More...

`#include <vigra/inspectimage.hxx>`

Inherits UnaryReduceFunctorTag.

List of all members.

## Public Types
typedef VALUETYPE | argument_type
typedef NumericTraits < VALUETYPE >::Promote | result_type
## Public Member Functions
| FindSum ()
void | operator() (argument_type const &v)
void | operator() (FindSum const &v)
result_type | operator() () const
void | reset ()
result_type | sum () const

## Detailed Description

### template<class VALUETYPE>
class vigra::FindSum< VALUETYPE >

Find the sum of the pixel values in an image or ROI.

This Functor can also be used in conjunction with ArrayOfRegionStatistics to find the sum of all regions in a labeled image, and with the reduce mode of transformMultiArray().

Traits defined:

`FunctorTraits::isUnaryAnalyser` and `FunctorTraits::isInitializer` are true (`VigraTrueType`)

Usage:

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

        vigra::BImage img;

        vigra::FindSum<vigra::BImage::PixelType> sum;   // init functor

        vigra::inspectImage(srcImageRange(img), sum);

        cout << "Sum: " << sum();

Required Interface:

        VALUETYPE v1, v2(v1);

        v1 += v2;

## Member Typedef Documentation

typedef VALUETYPE argument_type

the functor's argument type

typedef NumericTraits<VALUETYPE>::Promote result_type

the functor's result type

## Constructor & Destructor Documentation

FindSum | ( |  | ) |

init sum

## Member Function Documentation

void reset | ( |  | ) |

(re-)init sum

void operator() | ( | argument_type const & | v | ) |

update sum

void operator() | ( | FindSum< VALUETYPE > const & | v | ) |

merge two statistics

result_type sum | ( |  | ) | const

return current sum

result_type operator() | ( |  | ) | const

return current sum

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

- vigra/inspectimage.hxx

© 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.9.0 (Tue Nov 6 2012)