[ 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::inspectImage(srcImageRange(img), sum);
cout << "Sum: " << sum();
result_type sum() const
Definition inspectimage.hxx:1185
Class for a single RGB value.
Definition rgbvalue.hxx:128
void inspectImage(...)
Apply read-only functor to every pixel in the image.

Required Interface:

v1 += v2;

Member Typedef Documentation

◆ argument_type

the functor's argument type

◆ result_type

template<class VALUETYPE >
typedef NumericTraits<VALUETYPE>::Promote result_type

the functor's result type

Constructor & Destructor Documentation

◆ FindSum()

template<class VALUETYPE >
FindSum ( )

init sum

Member Function Documentation

◆ reset()

template<class VALUETYPE >
void reset ( )

(re-)init sum

◆ operator()() [1/3]

update sum

◆ operator()() [2/3]

template<class VALUETYPE >
void operator() ( FindSum< VALUETYPE > const v)

merge two statistics

◆ sum()

template<class VALUETYPE >
result_type sum ( ) const

return current sum

◆ operator()() [3/3]

template<class VALUETYPE >
result_type operator() ( ) const

return current sum


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

© 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