latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * This file is part of the LTI-Computer Vision Library (LTI-Lib) 00006 * 00007 * The LTI-Lib is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License (LGPL) 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * The LTI-Lib is distributed in the hope that it will be 00013 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00014 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with the LTI-Lib; see the file LICENSE. If 00019 * not, write to the Free Software Foundation, Inc., 59 Temple Place - 00020 * Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 00023 00024 /*---------------------------------------------------------------- 00025 * project ....: LTI Digital Image/Signal Processing Library 00026 * file .......: ltiAddScalar.h 00027 * authors ....: Thomas Rusert 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 20.04.99 00030 * revisions ..: $Id: ltiAddScalar.h,v 1.3 2006/02/08 12:10:47 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_ADDSCALAR_H_ 00034 #define _LTI_ADDSCALAR_H_ 00035 00036 #include "ltiScalarFunctor.h" 00037 00038 namespace lti { 00039 /** 00040 * addScalar functor class. 00041 * Apply adds the given scalar value to each element of the MathObj. 00042 */ 00043 template<class T> 00044 class addScalar : public scalarFunctor<T> { 00045 public: 00046 typedef typename scalarFunctor<T>::parameters parameters; 00047 00048 /// default constructor 00049 addScalar() {}; 00050 00051 /// constructor, sets the scalar value. 00052 addScalar(const T& theValue) : scalarFunctor<T>(theValue) {}; 00053 00054 /// constructor, sets the parameters, i.e. the scalar value. 00055 addScalar(const parameters& theParams) 00056 : scalarFunctor<T>(theParams) {}; 00057 00058 /// destructor 00059 virtual ~addScalar(); 00060 00061 /** onPlace version of apply. 00062 applies the functor's function to <em>theObject</em>. */ 00063 virtual vector<T>& apply(vector<T>& theObject) const; 00064 00065 /** onCopy version of apply. 00066 applies the functor's function to the copy of <em>theObject</em>, 00067 <em>newObject</em>. */ 00068 virtual vector<T>& apply(const vector<T>& theObject, 00069 vector<T>& newObject) const; 00070 00071 /** onPlace version of apply. 00072 applies the functor's function to <em>theObject</em>. */ 00073 virtual matrix<T>& apply(matrix<T>& theObject) const; 00074 00075 /** onCopy version of apply. 00076 applies the functor's function to the copy of <em>theObject</em>, 00077 <em>newObject</em>. */ 00078 virtual matrix<T>& apply(const matrix<T>& theObject, 00079 matrix<T>& newObject) const; 00080 00081 /// returns a pointer to a clone of the functor. 00082 virtual functor* clone() const; 00083 00084 /// returns the name of this type 00085 virtual const char* getTypeName() const; 00086 }; 00087 } 00088 00089 #include "ltiAddScalar_template.h" 00090 00091 #endif