DGtal 1.4.2
|
An example file for DGtal::functors::FunctorHolder and DGtal::functors::holdFunctor. More...
#include <iostream>
#include <numeric>
#include <iterator>
#include <utility>
#include "DGtal/base/FunctorHolder.h"
#include "DGtal/kernel/PointVector.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/io/readers/PGMReader.h"
#include "DGtal/io/readers/GenericReader.h"
#include "DGtal/images/ImageContainerBySTLVector.h"
#include "DGtal/kernel/BasicPointPredicates.h"
Go to the source code of this file.
Functions | |
double | signed_dist_to_unit_circle (DGtal::PointVector< 2, double > const &pt) |
[signed_dist_to_unit_circle] | |
template<typename Point > | |
Point::Component | templated_signed_dist_to_unit_circle (Point const &pt) |
[signed_dist_to_unit_circle] | |
template<typename T > | |
decltype(DGtal::functors::holdFunctor(Binarizer< T >(128))) | get_trivial_binarizer () |
template<typename Iterator > | |
auto | get_mean_binarizer_from_range (Iterator first, Iterator last) -> decltype(DGtal::functors::holdFunctor(Binarizer< decltype(*first/std::distance(first, last))>(0))) |
[Returning a FunctorHolder] | |
template<typename Image > | |
auto | get_mean_binarizer_from_an_image (std::string const &file_name) -> decltype(get_mean_binarizer_from_range(std::declval< Image >().begin(), std::declval< Image >().end())) |
[Returning a FunctorHolder using trailing return] | |
template<typename T > | |
Binarizer< T > | makeBinarizer (T const &v) |
[Returning a FunctorHolder using trailing return and declval] | |
template<typename PointFunctor , typename Predicate > | |
DGtal::functors::PointFunctorPredicate< PointFunctor, Predicate > | makePointFunctorPredicate_Example (PointFunctor const &aFun, Predicate const &aPred) |
[Factory of Binarizer] | |
template<typename PointFunctor , typename Predicate > | |
DGtal::functors::PointFunctorPredicate< typename std::decay< PointFunctor >::type, typename std::decay< Predicate >::type > | makePointFunctorPredicate_Example2 (PointFunctor &&aFun, Predicate &&aPred) |
[Factory of PointFunctorPredicate] | |
int | main () |
[Factory of PointFunctorPredicate using perfect forwarding] | |
An example file for DGtal::functors::FunctorHolder and DGtal::functors::holdFunctor.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
This file is part of the DGtal library.
Definition in file exampleFunctorHolder.cpp.
auto get_mean_binarizer_from_an_image | ( | std::string const & | file_name | ) | -> decltype(get_mean_binarizer_from_range( std::declval<Image>().begin(), std::declval<Image>().end() )) |
[Returning a FunctorHolder using trailing return]
[Returning a FunctorHolder using trailing return and declval]
Definition at line 123 of file exampleFunctorHolder.cpp.
References get_mean_binarizer_from_range(), and DGtal::GenericReader< TContainer, Tdim, TValue >::import().
Referenced by main().
auto get_mean_binarizer_from_range | ( | Iterator | first, |
Iterator | last ) -> decltype(DGtal::functors::holdFunctor(Binarizer<decltype(*first / std::distance(first, last))>(0))) |
[Returning a FunctorHolder]
[Returning a FunctorHolder using trailing return]
Definition at line 110 of file exampleFunctorHolder.cpp.
References DGtal::functors::holdFunctor().
Referenced by get_mean_binarizer_from_an_image(), and main().
|
inline |
Definition at line 102 of file exampleFunctorHolder.cpp.
References DGtal::functors::holdFunctor().
Referenced by main().
int main | ( | void | ) |
[Factory of PointFunctorPredicate using perfect forwarding]
[Holding a function]
[Holding a function]
[Holding a templated function]
[Holding a templated function]
[Holding a function through a lambda]
[Holding a function through a lambda]
[Holding a templated function through a lambda]
[Holding a templated function through a lambda]
[Holding a functor by lvalue ref]
[Holding a functor by lvalue ref]
[Holding a functor by rvalue ref]
[Holding a functor by rvalue ref]
[Holding a functor by moving it]
[Holding a functor by moving it]
[Holding a lambda]
[Holding a lambda]
[Holding a non-unary lambda]
[Holding a non-unary lambda]
[Copying a functor by lvalue ref]
[Copying a functor by lvalue ref]
[Copying a lambda by rvalue ref]
[Copying a lambda by rvalue ref]
[Storing a FunctorHolder]
[Storing a FunctorHolder]
[Passing a FunctorHolder]
[Passing a FunctorHolder]
[Returning a FunctorHolder in caller]
[Returning a FunctorHolder in caller]
[Returning a FunctorHolder using trailing return in caller]
[Returning a FunctorHolder using trailing return in caller]
[Using the Binarizer factory]
[Using the Binarizer factory]
[Using the PointFunctorPredicate factory]
[Using the PointFunctorPredicate factory]
Definition at line 204 of file exampleFunctorHolder.cpp.
References get_mean_binarizer_from_an_image(), get_mean_binarizer_from_range(), get_trivial_binarizer(), DGtal::functors::holdFunctor(), DGtal::PGMReader< TImageContainer, TFunctor >::importPGM(), makeBinarizer(), makePointFunctorPredicate_Example(), makePointFunctorPredicate_Example2(), signed_dist_to_unit_circle(), and templated_signed_dist_to_unit_circle().
|
inline |
[Returning a FunctorHolder using trailing return and declval]
[Factory of Binarizer]
Definition at line 148 of file exampleFunctorHolder.cpp.
Referenced by main().
DGtal::functors::PointFunctorPredicate< PointFunctor, Predicate > makePointFunctorPredicate_Example | ( | PointFunctor const & | aFun, |
Predicate const & | aPred ) |
[Factory of Binarizer]
[Factory of PointFunctorPredicate]
Definition at line 176 of file exampleFunctorHolder.cpp.
Referenced by main().
DGtal::functors::PointFunctorPredicate< typename std::decay< PointFunctor >::type, typename std::decay< Predicate >::type > makePointFunctorPredicate_Example2 | ( | PointFunctor && | aFun, |
Predicate && | aPred ) |
[Factory of PointFunctorPredicate]
[Factory of PointFunctorPredicate using perfect forwarding]
Definition at line 191 of file exampleFunctorHolder.cpp.
Referenced by main().
|
inline |
[signed_dist_to_unit_circle]
Definition at line 52 of file exampleFunctorHolder.cpp.
References DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().
Referenced by main().
|
inline |
[signed_dist_to_unit_circle]
[Templated signed_dist_to_unit_circle]
Definition at line 62 of file exampleFunctorHolder.cpp.
Referenced by main().