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// ---------------------------------------------------------------------------
 
   40template <typename TI, typename TO>
 
   42DGtal::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// ---------------------------------------------------------------------------
 
   51template <typename TI, typename TO>
 
   53DGtal::Simple2x2DetComputer<TI,TO>::Simple2x2DetComputer(const DGtal::Simple2x2DetComputer<TI,TO>& aOther)
 
   61// ---------------------------------------------------------------------------
 
   62template <typename TI, typename TO>
 
   64DGtal::Simple2x2DetComputer<TI,TO>& 
 
   65DGtal::Simple2x2DetComputer<TI,TO>::operator=(const DGtal::Simple2x2DetComputer<TI,TO>& aOther)
 
   77// ---------------------------------------------------------------------------
 
   78template <typename TI, typename TO>
 
   80DGtal::Simple2x2DetComputer<TI,TO>::~Simple2x2DetComputer()
 
   84// ---------------------------------------------------------------------------
 
   85template <typename TI, typename TO>
 
   88DGtal::Simple2x2DetComputer<TI,TO>::init(const ArgumentInteger& aA, const ArgumentInteger& aB)
 
   90  myA = static_cast<ResultInteger>(aA); 
 
   91  myB = static_cast<ResultInteger>(aB);
 
   94// ---------------------------------------------------------------------------
 
   95template <typename TI, typename TO>
 
   97typename DGtal::Simple2x2DetComputer<TI,TO>::ResultInteger
 
   98DGtal::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// ---------------------------------------------------------------------------
 
  106template <typename TI, typename TO>
 
  108typename DGtal::Simple2x2DetComputer<TI,TO>::ResultInteger
 
  109DGtal::Simple2x2DetComputer<TI,TO>::operator()(const ArgumentInteger& aA, const ArgumentInteger& aB, 
 
  110                                               const ArgumentInteger& aX, const ArgumentInteger& aY)
 
  113  return operator()(aX, aY); 
 
  116// ---------------------------------------------------------------------------
 
  117template <typename TI, typename TO>
 
  120DGtal::Simple2x2DetComputer<TI,TO>::selfDisplay ( std::ostream & out ) const
 
  122  out << "[Simple2x2DetComputer]";
 
  125// ---------------------------------------------------------------------------
 
  126template <typename TI, typename TO>
 
  129DGtal::Simple2x2DetComputer<TI,TO>::isValid() const
 
  136///////////////////////////////////////////////////////////////////////////////
 
  137// Implementation of inline functions                                        //
 
  139template <typename TI, typename TO>
 
  142DGtal::operator<< ( std::ostream & out, 
 
  143                    const Simple2x2DetComputer<TI,TO> & object )
 
  145  object.selfDisplay( out );
 
  150///////////////////////////////////////////////////////////////////////////////