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 Simple2x2DetComputer.ih
19 * @author Tristan Roussillon (\c tristan.roussillon@liris.cnrs.fr )
20 * Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
24 * Implementation of inline methods defined in Simple2x2DetComputer.h
26 * This file is part of the DGtal library.
30 //////////////////////////////////////////////////////////////////////////////
32 //////////////////////////////////////////////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////////
35 // IMPLEMENTATION of inline methods.
36 ///////////////////////////////////////////////////////////////////////////////
38 ///////////////////////////////////////////////////////////////////////////////
39 // ---------------------------------------------------------------------------
40 template <typename TI, typename TO>
42 DGtal::Simple2x2DetComputer<TI,TO>::Simple2x2DetComputer()
43 : myA (NumberTraits<ResultInteger>::ZERO),
44 myB (NumberTraits<ResultInteger>::ZERO),
45 myAY (NumberTraits<ResultInteger>::ZERO),
46 myBX (NumberTraits<ResultInteger>::ZERO)
50 // ---------------------------------------------------------------------------
51 template <typename TI, typename TO>
53 DGtal::Simple2x2DetComputer<TI,TO>::Simple2x2DetComputer(const DGtal::Simple2x2DetComputer<TI,TO>& aOther)
61 // ---------------------------------------------------------------------------
62 template <typename TI, typename TO>
64 DGtal::Simple2x2DetComputer<TI,TO>&
65 DGtal::Simple2x2DetComputer<TI,TO>::operator=(const DGtal::Simple2x2DetComputer<TI,TO>& aOther)
77 // ---------------------------------------------------------------------------
78 template <typename TI, typename TO>
80 DGtal::Simple2x2DetComputer<TI,TO>::~Simple2x2DetComputer()
84 // ---------------------------------------------------------------------------
85 template <typename TI, typename TO>
88 DGtal::Simple2x2DetComputer<TI,TO>::init(const ArgumentInteger& aA, const ArgumentInteger& aB)
90 myA = static_cast<ResultInteger>(aA);
91 myB = static_cast<ResultInteger>(aB);
94 // ---------------------------------------------------------------------------
95 template <typename TI, typename TO>
97 typename DGtal::Simple2x2DetComputer<TI,TO>::ResultInteger
98 DGtal::Simple2x2DetComputer<TI,TO>::operator()(const ArgumentInteger& aX, const ArgumentInteger& aY) const
100 myAY = myA * static_cast<ResultInteger>(aY);
101 myBX = myB * static_cast<ResultInteger>(aX);
105 // ---------------------------------------------------------------------------
106 template <typename TI, typename TO>
108 typename DGtal::Simple2x2DetComputer<TI,TO>::ResultInteger
109 DGtal::Simple2x2DetComputer<TI,TO>::operator()(const ArgumentInteger& aA, const ArgumentInteger& aB,
110 const ArgumentInteger& aX, const ArgumentInteger& aY)
113 return operator()(aX, aY);
116 // ---------------------------------------------------------------------------
117 template <typename TI, typename TO>
120 DGtal::Simple2x2DetComputer<TI,TO>::selfDisplay ( std::ostream & out ) const
122 out << "[Simple2x2DetComputer]";
125 // ---------------------------------------------------------------------------
126 template <typename TI, typename TO>
129 DGtal::Simple2x2DetComputer<TI,TO>::isValid() const
136 ///////////////////////////////////////////////////////////////////////////////
137 // Implementation of inline functions //
139 template <typename TI, typename TO>
142 DGtal::operator<< ( std::ostream & out,
143 const Simple2x2DetComputer<TI,TO> & object )
145 object.selfDisplay( out );
150 ///////////////////////////////////////////////////////////////////////////////