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 .......: ltiMergeOCPToImage.h 00027 * authors ....: Pablo Alvarado, Stefan Syberichs, Thomas Rusert 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 19.04.99 00030 * revisions ..: $Id: ltiMergeOCPToImage.h,v 1.3 2006/02/08 11:29:27 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_MERGE_OCP_TO_IMAGE_H_ 00034 #define _LTI_MERGE_OCP_TO_IMAGE_H_ 00035 00036 #include "ltiMergeImage.h" 00037 00038 namespace lti { 00039 00040 /** 00041 * Merge linear opponent color channels OCP 00042 * 00043 * The three opponent channels are defined here as follows: 00044 * 00045 * \f[ \begin{pmatrix} c1\\c2\\c3 \end{pmatrix} = 00046 * \begin{pmatrix} 0.5 & -0.5 & 0.0 \\ 00047 * -0.25 & -0.25 & 0.5 \\ 00048 * 0.33 & 0.33 & 0.33\end{pmatrix} 00049 * \begin{pmatrix} R\\G\\B \end{pmatrix} 00050 * \f] 00051 * 00052 * @ingroup gColor 00053 */ 00054 class mergeOCPToImage : public mergeImage { 00055 00056 public: 00057 /** 00058 * returns the name of this type 00059 */ 00060 virtual const char* getTypeName() const; 00061 00062 /** 00063 * returns a poinbter to a clone of the functor 00064 */ 00065 virtual functor* clone() const; 00066 00067 /** 00068 * on-copy operator for 32-bit "floating-point" channels 00069 */ 00070 virtual bool apply(const matrix<float>& c1, 00071 const matrix<float>& c2, 00072 const matrix<float>& c3, 00073 image& img) const; 00074 /** 00075 * on-copy operator for 8-bit channels. 00076 * expects positive values ! 00077 * @see OCPsplit operation 00078 */ 00079 virtual bool apply(const channel8& c1, 00080 const channel8& c2, 00081 const channel8& c3, 00082 image& img) const; 00083 00084 /** 00085 * on-copy operator for 32-bit "floating-point" values 00086 */ 00087 virtual bool apply(const float& c1, 00088 const float& c2, 00089 const float& c3, 00090 rgbPixel& pixel) const; 00091 /** 00092 * on-copy operator for 8-bit values. 00093 * expects positive values ! 00094 * @see OCPsplit operation 00095 */ 00096 virtual bool apply(const ubyte& c1, 00097 const ubyte& c2, 00098 const ubyte& c3, 00099 rgbPixel& pixel) const; 00100 }; 00101 } 00102 00103 #endif