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 .......: ltiSplitImageToHSV.h 00027 * authors ....: Pablo Alvarado, Stefan Syberichs, Thomas Rusert 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 19.04.99 00030 * revisions ..: $Id: ltiSplitImageToHSV.h,v 1.4 2006/02/08 11:53:40 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_SPLIT_IMAGE_TO_HSV_H_ 00034 #define _LTI_SPLIT_IMAGE_TO_HSV_H_ 00035 00036 #include "ltiSplitImage.h" 00037 00038 namespace lti { 00039 00040 /** 00041 * Split image in its Hue - Saturation - Value channels. 00042 * 00043 * The "value" corresponds to the maximum of the three R,G,B values. 00044 * 00045 * @ingroup gColor 00046 */ 00047 class splitImageToHSV : public splitImage { 00048 public: 00049 00050 /** 00051 * returns the name of this type 00052 */ 00053 virtual const char* getTypename() const; 00054 00055 /** 00056 * returns a pointer to a clone of the functor 00057 */ 00058 virtual functor* clone() const; 00059 00060 /** 00061 * split the image in hue channel H, saturation S and value 00062 * channel V. 00063 * The values of each image will be between 0.0f and 1.0f 00064 * @param img the image to be splitted 00065 * @param H the hue channel 00066 * @param S the saturation channel 00067 * @param V the value channel 00068 */ 00069 virtual bool apply(const image& img, 00070 channel& H, 00071 channel& S, 00072 channel& V) const; 00073 00074 /** 00075 * split the image in hue channel H, saturation S and value 00076 * channel V. 00077 * The values of each image will be between 0 and 255 00078 * @param img the image to be splitted 00079 * @param H the hue channel 00080 * @param S the saturation channel 00081 * @param V the value channel 00082 */ 00083 virtual bool apply(const image& img, 00084 channel8& H, 00085 channel8& S, 00086 channel8& V) const; 00087 00088 /** 00089 * split the pixel in hue value H, saturation S and Value V. 00090 * The values of each pixel will be between 0.0f and 1.0f 00091 * @param pixel the pixel to be splitted 00092 * @param H the hue value 00093 * @param S the saturation value 00094 * @param V the Value value 00095 */ 00096 virtual bool apply(const rgbPixel& pixel, 00097 float& H, 00098 float& S, 00099 float& V) const; 00100 00101 /** 00102 * split the pixel in hue value H, saturation S and Value V. 00103 * The values of each pixel will be between 0 and 255 00104 * @param pixel the pixel to be splitted 00105 * @param H the hue value 00106 * @param S the saturation value 00107 * @param V the Value value 00108 */ 00109 virtual bool apply(const rgbPixel& pixel, 00110 ubyte& H, 00111 ubyte& S, 00112 ubyte& V) const; 00113 00114 /** 00115 * shortcut to get the value channel only The values of each pixel 00116 * will be between 0.0f and 1.0f. 00117 * @param img the image to be splitted 00118 * @param value the value channel 00119 */ 00120 bool getValue(const image& img, 00121 channel& value) const; 00122 00123 00124 /** 00125 * shortcut to get the value channel only The values of each pixel 00126 * will be between 0 and 255. 00127 * @param img the image to be splitted 00128 * @param value the value channel 00129 */ 00130 bool getValue(const image& img, 00131 channel8& value) const; 00132 00133 /** 00134 * Returns the third of the three channels into which the image is split. 00135 * If you need only one channel, this might be faster than calling apply(). 00136 * @param img the source image 00137 * @param c3 the extracted channel 00138 */ 00139 virtual bool getThird(const image& img, channel& c3) const; 00140 00141 /** 00142 * Returns the third of the three channels into which the image is split. 00143 * If you need only one channel, this might be faster than calling apply(). 00144 * @param img the source image 00145 * @param c3 the extracted channel 00146 */ 00147 virtual bool getThird(const image& img, channel8& c3) const; 00148 00149 }; 00150 00151 } // namespace lti 00152 #endif