DGtal  1.5.beta
DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue > Struct Template Reference

vec since the parameters are the vectors of digitized reflections More...

#include <DGtal/images/bijectiveRotations/CBDR_naiverotation.h>

Inheritance diagram for DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >:
[legend]

Public Types

typedef Reflection< TSpace, TInputValue > DigitizedReflection
 

Public Member Functions

 CBDR_naiverotation (const std::vector< DigitizedReflection > &bijectiveReflections={})
 
 CBDR_naiverotation (const std::vector< GAVector< TSpace >> &bijectiveGAvec)
 
TOutputValue operator() (const TInputValue &aInput) const
 
template<typename TImage >
TImage rotateImage (TImage img) const
 

Data Fields

std::vector< DigitizedReflectionbijectiveNormalVectors
 

Detailed Description

template<typename TSpace, typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
struct DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >

vec since the parameters are the vectors of digitized reflections

Definition at line 45 of file CBDR_naiverotation.h.

Member Typedef Documentation

◆ DigitizedReflection

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
typedef Reflection<TSpace,TInputValue> DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::DigitizedReflection

Definition at line 46 of file CBDR_naiverotation.h.

Constructor & Destructor Documentation

◆ CBDR_naiverotation() [1/2]

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::CBDR_naiverotation ( const std::vector< DigitizedReflection > &  bijectiveReflections = {})
inline

Definition at line 50 of file CBDR_naiverotation.h.

50 {} ):bijectiveNormalVectors(bijectiveReflections){ }
std::vector< DigitizedReflection > bijectiveNormalVectors

◆ CBDR_naiverotation() [2/2]

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::CBDR_naiverotation ( const std::vector< GAVector< TSpace >> &  bijectiveGAvec)
inlineexplicit

Definition at line 52 of file CBDR_naiverotation.h.

52  {
53  bijectiveNormalVectors.resize(bijectiveGAvec.size());
54  std::transform(bijectiveGAvec.begin(), bijectiveGAvec.end(), bijectiveNormalVectors.begin(),
55  [](const GAVector<TSpace>& p) { return DigitizedReflection(p); });
56  }

References DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::bijectiveNormalVectors.

Member Function Documentation

◆ operator()()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
TOutputValue DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::operator() ( const TInputValue &  aInput) const
inline

Operator

Returns
apply the composition of bijective digitized reflection to the point.

Definition at line 62 of file CBDR_naiverotation.h.

63  {
64  if(bijectiveNormalVectors.size()<=0){
65  return (TOutputValue)aInput;
66  }
67  int i =0;
68  DigitizedReflection firstReflection(bijectiveNormalVectors[i]);
69  TOutputValue resultat = firstReflection(aInput);
70 
71  i+=1;
72  for(; i < bijectiveNormalVectors.size(); ++i)
73  {
74  DigitizedReflection currentReflection(bijectiveNormalVectors[i]);
75  resultat = currentReflection(resultat);
76  }
77  return resultat;
78  }
Reflection< TSpace, TInputValue > DigitizedReflection

References DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::bijectiveNormalVectors.

◆ rotateImage()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
template<typename TImage >
TImage DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::rotateImage ( TImage  img) const
inline

Definition at line 81 of file CBDR_naiverotation.h.

81  {
82  typedef typename TImage::Domain TDomain;
84  typedef std::pair < typename TSpace::Point, typename TSpace::Point > Bounds;
85 
86  MyDomainTransformer domainTransformer ( *this );
87  Bounds bounds = domainTransformer ( img.domain() );
88  TDomain transformedDomain ( bounds.first, bounds.second );
89  TImage rotatedImage ( transformedDomain );
90 
91  for (typename TDomain::ConstIterator it = img.domain().begin(); it != img.domain().end(); ++it )
92  {
93  rotatedImage.setValue((*this)(*it),img(*it));
94  }
95  return rotatedImage;
96  }
Aim: implements bounds of transformed domain.
MyDigitalSurface::ConstIterator ConstIterator
HyperRectDomain< Space > Domain

Field Documentation

◆ bijectiveNormalVectors

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point>
std::vector<DigitizedReflection> DGtal::CBDR_naiverotation< TSpace, TInputValue, TOutputValue >::bijectiveNormalVectors

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