yiq.hh

00001 // Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development
00002 // Laboratory
00003 //
00004 // This file is part of the Olena Library.  This library is free
00005 // software; you can redistribute it and/or modify it under the terms
00006 // of the GNU General Public License version 2 as published by the
00007 // Free Software Foundation.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this library; see the file COPYING.  If not, write to
00016 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017 // Boston, MA 02110-1301, USA.
00018 //
00019 // As a special exception, you may use this file as part of a free
00020 // software library without restriction.  Specifically, if other files
00021 // instantiate templates or use macros or inline functions from this
00022 // file, or you compile this file and link it with other files to
00023 // produce an executable, this file does not by itself cause the
00024 // resulting executable to be covered by the GNU General Public
00025 // License.  This exception does not however invalidate any other
00026 // reasons why the executable file might be covered by the GNU General
00027 // Public License.
00028 
00029 #ifndef NTG_COLOR_YIQ_HH
00030 # define NTG_COLOR_YIQ_HH
00031 
00032 # include <ntg/color/color.hh>
00033 
00034 namespace ntg
00035 {
00036 
00037   enum yiq_comp
00038     {
00039       yiq_Y = 0,
00040       yiq_I = 1,
00041       yiq_Q = 2
00042     };
00043 
00044   template<unsigned icomp> struct yiq_traits;
00045   template<> struct yiq_traits<yiq_Y> : public interval<0,1> {};
00046 
00047   template<> struct yiq_traits<yiq_I>
00048   {
00049     static float lower_bound() { return -.4192; }
00050     static float upper_bound() { return .5346; }
00051   };
00052 
00053   template<> struct yiq_traits<yiq_Q>
00054   {
00055     static float lower_bound() { return -.6783; }
00056     static float upper_bound() { return .6527; }
00057   };
00058 
00059   typedef color<3,8,yiq_traits>  yiq_8;
00060   typedef color<3,16,yiq_traits> yiq_16;
00061   typedef color<3,32,yiq_traits> yiq_32;
00062 
00063 } // end of ntg.
00064 
00065 #endif // !NTG_COLOR_YIQ_HH

Generated on Tue Feb 20 20:21:19 2007 for Olena by  doxygen 1.5.1