last update 20 Sep 2009 |
00001 /* 00002 * Copyright (C) 1999 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 cvrMergeYIQToImage.h 00044 * Merge YIQ channels into a color image 00045 * \author Pablo Alvarado 00046 * \author Stefan Syberichs 00047 * \author Thomas Rusert 00048 * \date 19.04.1999 00049 * 00050 * $Id: cvrMergeYIQToImage.h,v 1.1 2007/04/05 22:56:36 alvarado Exp $ 00051 */ 00052 00053 00054 #ifndef _CVR_MERGE_YIQ_TO_IMAGE_H_ 00055 #define _CVR_MERGE_YIQ_TO_IMAGE_H_ 00056 00057 #include "cvrMergeImage.h" 00058 00059 namespace cvr { 00060 00061 /** 00062 * Merge YIQ channels (Luminance, Inphase, Quadrature) 00063 * 00064 * This is an almost forgotten color space, as the standards use now 00065 * the YCbCr, YPbPr or YUV spaces. 00066 * 00067 * @see cvr::mergeYUVToImage, cvr::mergeYCbCrToImage, cvr::mergeYPbPrToImage 00068 * @see cvr::splitImageToYIQ 00069 * 00070 * @ingroup gColor 00071 */ 00072 class mergeYIQToImage : public mergeImage { 00073 public: 00074 00075 /** 00076 * returns the name of this type 00077 */ 00078 const std::string& name() const; 00079 00080 /** 00081 * returns a poinbter to a clone of the functor 00082 */ 00083 virtual mergeYIQToImage* clone() const; 00084 00085 /** 00086 * Returns a pointer to a new instance of this functor. 00087 */ 00088 virtual mergeYIQToImage* newInstance() const; 00089 00090 /** 00091 * merge the Y,I,Q channel to an image 00092 * YIQ merging requires unnormalized channels ! 00093 * @param Y the perceived luminance 00094 * @param I color information and some luminance 00095 * @param Q color information and some luminance 00096 * @param img the merged image 00097 */ 00098 virtual bool apply(const matrix<float>& Y, 00099 const matrix<float>& I, 00100 const matrix<float>& Q, 00101 image& img) const; 00102 00103 /** 00104 * merge the Y,I,Q channel to an image 00105 * YIQ merging requires unnormalized channels ! 00106 * @param Y the perceived luminance 00107 * @param I color information and some luminance 00108 * @param Q color information and some luminance 00109 * @param img the merged image 00110 */ 00111 virtual bool apply(const matrix<ubyte>& Y, 00112 const matrix<ubyte>& I, 00113 const matrix<ubyte>& Q, 00114 image& img) const; 00115 00116 /** 00117 * merge the Y,I,Q values to a pixel 00118 * YIQ merging requires unnormalized values ! 00119 * @param Y the perceived luminance 00120 * @param I color information and some luminance 00121 * @param Q color information and some luminance 00122 * @param pixel the merged pixel 00123 */ 00124 virtual bool apply(const float& Y, 00125 const float& I, 00126 const float& Q, 00127 rgbaPixel& pixel) const; 00128 00129 /** 00130 * merge the Y,I,Q values to a pixel 00131 * YIQ merging requires unnormalized values ! 00132 * @param Y the perceived luminance 00133 * @param I color information and some luminance 00134 * @param Q color information and some luminance 00135 * @param pixel the merged pixel 00136 */ 00137 virtual bool apply(const ubyte& Y, 00138 const ubyte& I, 00139 const ubyte& Q, 00140 rgbaPixel& pixel) const; 00141 }; 00142 } 00143 00144 #endif