All_of, any_of, none_of
Include
<mln/core/algorithm/all_of.hpp>
Include
<mln/core/algorithm/any_of.hpp>
Include
<mln/core/algorithm/none_of.hpp>
-
bool all_of(InputImage ima, std::UnaryPredicate p)
-
bool all_of(InputImage ima, std::UnaryPredicate p)
-
bool all_of(InputImage ima)
-
bool all_of(InputImage ima)
-
bool any_of(InputImage ima, std::UnaryPredicate p)
-
bool any_of(InputImage ima, std::UnaryPredicate p)
-
bool any_of(InputImage ima)
-
bool any_of(InputImage ima)
-
bool none_of(InputImage ima, std::UnaryPredicate p)
-
bool none_of(InputImage ima, std::UnaryPredicate p)
-
bool none_of(InputImage ima)
1,3,5) Checks that all, any or none of the image values verify the preficate
2,4,6) Checks that all, any or none of the image values evaluate to
true
- Parameters:
ima – The image to test
p – The unary predicate that will be applied on values
- Template Parameters:
InputImage – A model of
InputImage
std::UnaryPredicate – A model of
std::UnaryPredicate
- Returns:
True or false
-
bool none_of(InputImage ima)
Examples
Check that all values are non-negative:
mln::image2d<uint8_t> f = ...; bool res1 = mln::all_of(f, [](uint8_t x) { x > 0; }); // Version 1 bool res2 = mln::all_of(f > 0);
Complexity
Linear in the number of pixels.