2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU Lesser General Public License as
4 * published by the Free Software Foundation, either version 3 of the
5 * License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @file ArithDSSIterator.ih
19 * @author Isabelle Sivignon (\c isabelle.sivignon@gipsa-lab.grenoble-inp.fr )
20 * gipsa-lab Grenoble Images Parole Signal Automatique (CNRS, UMR 5216), CNRS, France
24 * Implementation of inline methods defined in ArithDSSIterator.h
26 * This file is part of the DGtal library.
29///////////////////////////////////////////////////////////////////////////////
30// IMPLEMENTATION of inline methods.
31///////////////////////////////////////////////////////////////////////////////
33//////////////////////////////////////////////////////////////////////////////
35//////////////////////////////////////////////////////////////////////////////
39///////////////////////////////////////////////////////////////////////////////
40// Implementation of inline methods //
42template<typename TInteger, int c>
44DGtal::ArithDSSIterator<TInteger,c>::ArithDSSIterator(const Integer a, const Integer b, const Integer mu, const Point & p)
52template<typename TInteger, int c>
54DGtal::ArithDSSIterator<TInteger,c>::ArithDSSIterator(const ArithDSSIterator<TInteger,c> &other):myA(other.myA),myB(other.myB),myMu(other.myMu),myP(other.myP)
61template<typename TInteger, int c>
63typename DGtal::ArithDSSIterator<TInteger,c>::Self & DGtal::ArithDSSIterator<TInteger,c>::operator=(const ArithDSSIterator<TInteger,c> & other)
79template<typename TInteger, int c>
81TInteger DGtal::ArithDSSIterator<TInteger,c>::remainder(const Point &Q)
83 return myA*Q[0] - myB*Q[1];
86template<typename TInteger, int c>
88typename DGtal::ArithDSSIterator<TInteger,c>::reference DGtal::ArithDSSIterator<TInteger,c>::operator*() const
94template<typename TInteger, int c>
96typename DGtal::ArithDSSIterator<TInteger,c>::Self & DGtal::ArithDSSIterator<TInteger,c>::operator++()
98 Integer r = remainder(myP);
101 if(r + myA >= myB + myMu)
105 else // connectivity = 4
115template<typename TInteger, int c>
117typename DGtal::ArithDSSIterator<TInteger,c>::Self DGtal::ArithDSSIterator<TInteger,c>::operator++(int)
125template<typename TInteger, int c>
127bool DGtal::ArithDSSIterator<TInteger,c>::operator==(const ArithDSSIterator<TInteger,c> & other) const
129 return myP == other.myP;
133template<typename TInteger, int c>
135bool DGtal::ArithDSSIterator<TInteger,c>::operator!=(const ArithDSSIterator<TInteger, c> & other) const
137 return ! (this->operator==(other));
147///////////////////////////////////////////////////////////////////////////////
148// Implementation of inline functions and external operators //
151 * Overloads 'operator<<' for displaying objects of class 'ArithDSSIterator'.
152 * @param out the output stream where the object is written.
153 * @param object the object of class 'ArithDSSIterator' to write.
154 * @return the output stream after the writing.
158// DGtal::operator<< ( std::ostream & out,
159// const ArithDSSIterator & object )
161// object.selfDisplay ( out );
166///////////////////////////////////////////////////////////////////////////////