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

| FindSum< VALUETYPE > Class Template Reference |

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

`#include <vigra/inspectimage.hxx>`

Inherits UnaryReduceFunctorTag.

## Public Types

typedef VALUETYPE | argument_type
typedef NumericTraits< VALUETYPE >::Promote | result_type

## Public Member Functions

| FindSum ()
result_type | operator() () const
void | operator() (argument_type const &v)
void | operator() (FindSum const &v)
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

## ◆ argument_type

typedef VALUETYPE argument_type

the functor's argument type

## ◆ result_type

typedef NumericTraits<VALUETYPE>::Promote result_type

the functor's result type

## Constructor & Destructor Documentation

## ◆ FindSum()

FindSum | ( |  | ) |

init sum

## Member Function Documentation

## ◆ reset()

void reset | ( |  | ) |

(re-)init sum

## ◆ operator()() [1/3]

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

update sum

## ◆ operator()() [2/3]

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

merge two statistics

## ◆ sum()

result_type sum | ( |  | ) | const

return current sum

## ◆ operator()() [3/3]

result_type operator() | ( |  | ) | const

return current sum

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

- vigra/inspectimage.hxx

vigra::FindSum
Find the sum of the pixel values in an image or ROI.
Definition: inspectimage.hxx:1143
vigra::inspectImage
void inspectImage(...)
Apply read-only functor to every pixel in the image.
vigra::FindSum::sum
result_type sum() const
Definition: inspectimage.hxx:1185
vigra::BasicImage
Fundamental class template for images.
Definition: basicimage.hxx:475

© 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.11.1