LTI-Lib latest version v1.9 - last update 10 Apr 2010

ltiColorNormalizationBase.h

00001 /*
00002  * Copyright (C) 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 .......: ltiColorNormalizationBase.h
00027  * authors ....: Suat Akyol, Pablo Alvarado
00028  * organization: LTI, RWTH Aachen
00029  * creation ...: 30.03.2003
00030  * revisions ..: $Id: ltiColorNormalizationBase.h,v 1.8 2006/02/07 18:39:07 ltilib Exp $
00031  */
00032 
00033 #ifndef _LTI_COLOR_NORMALIZATION_BASE_H_
00034 #define _LTI_COLOR_NORMALIZATION_BASE_H_
00035 
00036 #include "ltiImage.h"
00037 #include "ltiModifier.h"
00038 
00039 namespace lti {
00040   /**
00041    * Parent class for color normalization methods usually used to eliminate
00042    * the effects of illumination changes.
00043    *
00044    * \ingroup gColor
00045    */
00046   class colorNormalizationBase : public modifier {
00047   public:
00048     /**
00049      * the parameters for the class colorNormalizationBase
00050      */
00051     class parameters : public modifier::parameters {
00052     public:
00053       /**
00054        * default constructor
00055        */
00056       parameters();
00057 
00058       /**
00059        * copy constructor
00060        * @param other the parameters object to be copied
00061        */
00062       parameters(const parameters& other);
00063 
00064       /**
00065        * destructor
00066        */
00067       ~parameters();
00068 
00069       /**
00070        * returns name of this type
00071        */
00072       const char* getTypeName() const;
00073 
00074       /**
00075        * copy the contents of a parameters object
00076        * @param other the parameters object to be copied
00077        * @return a reference to this parameters object
00078        */
00079       parameters& copy(const parameters& other);
00080 
00081       /**
00082        * returns a pointer to a clone of the parameters
00083        */
00084       virtual functor::parameters* clone() const;
00085 
00086       /**
00087        * write the parameters in the given ioHandler
00088        * @param handler the ioHandler to be used
00089        * @param complete if true (the default) the enclosing begin/end will
00090        *        be also written, otherwise only the data block will be written.
00091        * @return true if write was successful
00092        */
00093       virtual bool write(ioHandler& handler,const bool complete=true) const;
00094 
00095       /**
00096        * write the parameters in the given ioHandler
00097        * @param handler the ioHandler to be used
00098        * @param complete if true (the default) the enclosing begin/end will
00099        *        be also written, otherwise only the data block will be written.
00100        * @return true if write was successful
00101        */
00102       virtual bool read(ioHandler& handler,const bool complete=true);
00103 
00104 #     ifdef _LTI_MSC_6
00105       /**
00106        * this function is required by MSVC only, as a workaround for a
00107        * very awful bug, which exists since MSVC V.4.0, and still by
00108        * V.6.0 with all bugfixes (so called "service packs") remains
00109        * there...  This method is public due to another bug, so please
00110        * NEVER EVER call this method directly: use read() instead!
00111        */
00112       bool readMS(ioHandler& handler,const bool complete=true);
00113 
00114       /**
00115        * this function is required by MSVC only, as a workaround for a
00116        * very awful bug, which exists since MSVC V.4.0, and still by
00117        * V.6.0 with all bugfixes (so called "service packs") remains
00118        * there...  This method is public due to another bug, so please
00119        * NEVER EVER call this method directly: use write() instead!
00120        */
00121       bool writeMS(ioHandler& handler,const bool complete=true) const;
00122 #     endif
00123 
00124       // ------------------------------------------------
00125       // the parameters
00126       // ------------------------------------------------
00127     };
00128 
00129     /**
00130      * default constructor
00131      */
00132     colorNormalizationBase();
00133 
00134     /**
00135      * copy constructor
00136      * @param other the object to be copied
00137      */
00138     colorNormalizationBase(const colorNormalizationBase& other);
00139 
00140     /**
00141      * destructor
00142      */
00143     virtual ~colorNormalizationBase();
00144 
00145     /**
00146      * returns the name of this type ("colorNormalizationBase")
00147      */
00148     virtual const char* getTypeName() const;
00149 
00150     /**
00151      * Normalize the colors on the given image and write the result there too.
00152      * @param srcdest image with the source data.
00153      * The result will be left here too.
00154      * @return true if successful, false otherwise.
00155      */
00156     virtual bool apply(image& srcdest) const=0;
00157 
00158     /**
00159      * Normalize the colors on the image \a src and leave the result on the
00160      * \a dest one.
00161      * @param src image with the source data.
00162      * @param dest image where the result will be left.
00163      * @return true if successful, false otherwise.
00164      */
00165     virtual bool apply(const image& src,image& dest) const=0;
00166 
00167     /**
00168      * copy data of "other" functor.
00169      * @param other the functor to be copied
00170      * @return a reference to this functor object
00171      */
00172     colorNormalizationBase& copy(const colorNormalizationBase& other);
00173 
00174     /**
00175      * returns a pointer to a clone of this functor.
00176      */
00177     virtual functor* clone() const = 0;
00178 
00179     /**
00180      * returns used parameters
00181      */
00182     const parameters& getParameters() const;
00183 
00184   };
00185 }
00186 
00187 #endif

Generated on Sat Apr 10 15:25:16 2010 for LTI-Lib by Doxygen 1.6.1