last update 20 Sep 2009 |
00001 /* 00002 * Copyright (C) 1998 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * 00006 * This file is part of the Computer Vision and Robotics Library (CVR-Lib) 00007 * 00008 * The CVR-Lib is free software; you can redistribute it and/or 00009 * modify it under the terms of the BSD License. 00010 * 00011 * All rights reserved. 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions are met: 00015 * 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 00023 * 3. Neither the name of the authors nor the names of its contributors may be 00024 * used to endorse or promote products derived from this software without 00025 * specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00028 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00031 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00032 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00033 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00034 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00035 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00036 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00037 * POSSIBILITY OF SUCH DAMAGE. 00038 */ 00039 00040 00041 00042 /** 00043 * \file cvrMergeImage.h 00044 * Contains mergeImage, which is a base class 00045 * all merge image functor classes. 00046 * \author Pablo Alvarado 00047 * \author Stefan Syberichs 00048 * \author Thomas Ruser 00049 * \date 19.04.1999 00050 * 00051 * $Id: cvrMergeImage.h,v 1.3 2006/06/07 12:40:27 doerfler Exp $ 00052 */ 00053 00054 #ifndef _CVR_MERGE_IMAGE_H_ 00055 #define _CVR_MERGE_IMAGE_H_ 00056 00057 #include "cvrFunctor.h" 00058 #include "cvrImage.h" 00059 #include "cvrMath.h" 00060 00061 namespace cvr { 00062 /** 00063 * Abstract base class for all merge image functor-classes. 00064 * 00065 * These functors merge color-channels to a color image. 00066 * 00067 * This is a virtual class, so you cannot instantiate it. 00068 * 00069 * @ingroup gColor 00070 */ 00071 class mergeImage : public functor { 00072 public: 00073 /** 00074 * default constructor 00075 */ 00076 mergeImage(); 00077 00078 /** 00079 * destructor 00080 */ 00081 virtual ~mergeImage(); 00082 00083 /** 00084 * returns a pointer to a clone of the functor. 00085 */ 00086 virtual mergeImage* clone() const = 0; 00087 00088 /** 00089 * returns a pointer to a new instance of the functor. 00090 */ 00091 virtual mergeImage* newInstance() const = 0; 00092 00093 /** 00094 * on-copy operator for 32-bit "floating-point" channels 00095 */ 00096 virtual bool apply(const matrix<float>& c1, 00097 const matrix<float>& c2, 00098 const matrix<float>& c3, 00099 image& img) const = 0; 00100 /** 00101 * on-copy operator for 8-bit channels 00102 */ 00103 virtual bool apply(const matrix<ubyte>& c1, 00104 const matrix<ubyte>& c2, 00105 const matrix<ubyte>& c3, 00106 image& img) const = 0; 00107 00108 /** 00109 * on-copy operator for 32-bit floating point values 00110 */ 00111 virtual bool apply(const float& c1, 00112 const float& c2, 00113 const float& c3, 00114 rgbaPixel& pixel) const = 0; 00115 00116 /** 00117 * on-copy operator for 8-bit values 00118 */ 00119 virtual bool apply(const ubyte& c1, 00120 const ubyte& c2, 00121 const ubyte& c3, 00122 rgbaPixel& pixel) const = 0; 00123 00124 }; 00125 } 00126 00127 #endif 00128