CVR-Lib last update 20 Sep 2009

cvrMergeRGBToImage.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1998 - 2005
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  * \file   cvrMergeRGBToImage.h
00043  * \author Pablo Alvarado
00044  * \author Stefan Syberichs
00045  * \author Thomas Rusert
00046  * \date   19.04.1999
00047  *
00048  * $Id: cvrMergeRGBToImage.h,v 1.1 2005/02/15 14:31:22 arndh Exp $
00049  */
00050 
00051 
00052 #ifndef _CVR_MERGE_RGB_TO_IMAGE_H_
00053 #define _CVR_MERGE_RGB_TO_IMAGE_H_
00054 
00055 #include "cvrMergeImage.h"
00056 #include "cvrRGBAPixel.h"
00057 
00058 namespace cvr {
00059 
00060   /**
00061    * Merge RGB channels
00062    *
00063    * Merge the three given channels in a color image.
00064    * @see splitImageToRGB
00065    * @ingroup gColor
00066    */
00067   class mergeRGBToImage : public mergeImage {
00068   public:
00069 
00070     /**
00071      * Returns the name of this type.
00072      */
00073     virtual const std::string& name() const;
00074 
00075     /**
00076      * Returns a pointer to a clone of the parameters
00077      */
00078     virtual mergeRGBToImage* clone() const;
00079 
00080     /**
00081      * Returns a pointer to a new instance of this functor.
00082      */
00083     virtual mergeRGBToImage* newInstance() const;
00084 
00085     /**
00086      * merge the channels red, green and blue to an image
00087      * @param red the red channel
00088      * @param green the green channel
00089      * @param blue the blue channel
00090      * @param img the merged image
00091      */
00092     virtual bool apply(const matrix<float>& red,
00093                        const matrix<float>& green,
00094                        const matrix<float>& blue,
00095                        image& img) const;
00096 
00097     /**
00098      * merge the channels red, green and blue to an image
00099      * @param red the red channel
00100      * @param green the green channel
00101      * @param blue the blue channel
00102      * @param img the merged image
00103      */
00104     virtual bool apply(const matrix<ubyte>& red,
00105                        const matrix<ubyte>& green,
00106                        const matrix<ubyte>& blue,
00107                        image& img) const;
00108 
00109     /**
00110      * Merge the channels red, green, blue and the dummy (or alpha) to an image
00111      * @param red the red channel
00112      * @param green the green channel
00113      * @param blue the blue channel
00114      * @param alpha the alpha or dummy channel
00115      * @param img the merged image
00116      */
00117     bool apply(const matrix<float>& red,
00118                const matrix<float>& green,
00119                const matrix<float>& blue,
00120                const matrix<float>& alpha,
00121                image& img) const;
00122 
00123     /**
00124      * Merge the channels red, green, blue and the dummy (or alpha) to an image
00125      * @param red the red channel
00126      * @param green the green channel
00127      * @param blue the blue channel
00128      * @param alpha the alpha or dummy channel
00129      * @param img the merged image
00130      */
00131     bool apply(const matrix<ubyte>& red,
00132                const matrix<ubyte>& green,
00133                const matrix<ubyte>& blue,
00134                const matrix<ubyte>& alpha,
00135                image& img) const;
00136 
00137     /**
00138      * merge the values red, green and blue to a pixel.
00139      * @param red the red value
00140      * @param green the green value
00141      * @param blue the blue value
00142      * @param pixel the pixel to be splitted
00143      */
00144     virtual bool apply(const float& red,
00145            const float& green,
00146            const float& blue,
00147            rgbaPixel& pixel) const;
00148 
00149     /**
00150      * merge the values red, green and blue to a pixel
00151      * @param red the red value
00152      * @param green the green value
00153      * @param blue the blue value
00154      * @param pixel the merged pixel
00155      */
00156     virtual bool apply(const ubyte& red,
00157            const ubyte& green,
00158            const ubyte& blue,
00159            rgbaPixel& pixel) const;
00160   };
00161 }
00162 
00163 #endif
00164 

Generated on Sun Sep 20 22:08:00 2009 for CVR-Lib by Doxygen 1.5.8