DGtal  0.9.3beta
Public Types | Public Member Functions | Private Attributes
DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor Class Reference

#include <DGtal/images/ArrayImageAdapter.h>

Public Types

using Domain = typename Self::Domain
 
using Point = typename Self::Point
 
using Difference = typename Self::Difference
 

Public Member Functions

 DistanceFunctor (Self const *anImage)
 
Difference operator() (Point const &aPoint) const
 

Private Attributes

Domain myDomain
 

Detailed Description

template<typename TArrayIterator, typename TDomain>
class DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor

Functor that returns the distance between the domain's lower bound and a given point.

See also
SimpleRandomAccessRangeFromPoint and SimpleRandomAccessConstRangeFromPoint.

Definition at line 398 of file ArrayImageAdapter.h.

Member Typedef Documentation

template<typename TArrayIterator , typename TDomain >
using DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::Difference = typename Self::Difference

Type of the difference between two iterators.

Definition at line 403 of file ArrayImageAdapter.h.

template<typename TArrayIterator , typename TDomain >
using DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::Domain = typename Self::Domain

Domain type.

Definition at line 401 of file ArrayImageAdapter.h.

template<typename TArrayIterator , typename TDomain >
using DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::Point = typename Self::Point

Point type.

Definition at line 402 of file ArrayImageAdapter.h.

Constructor & Destructor Documentation

template<typename TArrayIterator , typename TDomain >
DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::DistanceFunctor ( Self const *  anImage)
inline

Constructor from an image.

Parameters
anImageConstant pointer to an image.

Definition at line 408 of file ArrayImageAdapter.h.

409  : myDomain( anImage->domain() )
410  {}
Domain myDomain
Stored domain to avoid iterator corruption if domain changed.

Member Function Documentation

template<typename TArrayIterator , typename TDomain >
Difference DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::operator() ( Point const &  aPoint) const
inline

Return the distance between the domain's lower bound and the given point.

Parameters
aPointThe point.
Returns
the distance.

Definition at line 416 of file ArrayImageAdapter.h.

417  {
418  ASSERT_MSG(
419  myDomain.isInside(aPoint),
420  "The point is outside the domain !"
421  );
422  return Linearizer<Domain, ColMajorStorage>::getIndex( aPoint, myDomain );
423  }
Domain myDomain
Stored domain to avoid iterator corruption if domain changed.

Field Documentation

template<typename TArrayIterator , typename TDomain >
Domain DGtal::IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, TDomain > >::DistanceFunctor::myDomain
private

Stored domain to avoid iterator corruption if domain changed.

Definition at line 426 of file ArrayImageAdapter.h.


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