• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

hsi.hh

00001 // Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
00002 //
00003 // This file is part of Olena.
00004 //
00005 // Olena is free software: you can redistribute it and/or modify it under
00006 // the terms of the GNU General Public License as published by the Free
00007 // Software Foundation, version 2 of the License.
00008 //
00009 // Olena 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 Olena.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 // As a special exception, you may use this file as part of a free
00018 // software project without restriction.  Specifically, if other files
00019 // instantiate templates or use macros or inline functions from this
00020 // file, or you compile this file and link it with other files to produce
00021 // an executable, this file does not by itself cause the resulting
00022 // executable to be covered by the GNU General Public License.  This
00023 // exception does not however invalidate any other reasons why the
00024 // executable file might be covered by the GNU General Public License.
00025 
00026 #include <mln/value/ops.hh>
00027 
00028 #include <mln/value/concept/vectorial.hh>
00029 #include <mln/value/int_u.hh>
00030 #include <mln/algebra/vec.hh>
00031 
00032 #include <mln/value/float01_8.hh>
00033 
00034 #ifndef MLN_VALUE_HSI_HH
00035 # define MLN_VALUE_HSI_HH
00036 
00037 
00038 namespace mln
00039 {
00040 
00041   namespace value
00042   {
00043 
00044     template <typename E>
00045     struct HSI
00046     {
00047     };
00048 
00049     template <typename H, typename S, typename I>
00050     class hsi_ : public HSI< hsi_<H,S,I> >
00051     {
00052     public:
00053 
00054       typedef H h_type;
00055       typedef S s_type;
00056       typedef I i_type;
00057 
00059       hsi_()
00060       {
00061       }
00062 
00064       hsi_(const H& hue, const S& sat, const I& inty)
00065         : hue_(hue),
00066           sat_(sat),
00067           int_(inty)
00068       {
00069       }
00070 
00072       const H& hue() const
00073       {
00074         return this->hue_;
00075       }
00076       const S& sat() const
00077       {
00078         return this->sat_;
00079       }
00080       const I& inty() const
00081       {
00082         return this->int_;
00083       }
00084 
00086       H& hue()
00087       {
00088         return this->hue_;
00089       }
00090       S& sat()
00091       {
00092         return this->sat_;
00093       }
00094       I& inty()
00095       {
00096         return this->int_;
00097       }
00098 
00099     private:
00100       H hue_;
00101       S sat_;
00102       I int_;
00103     };
00104 
00105     typedef hsi_<float, float, float> hsi_f;
00106 
00107     typedef hsi_<double, double, double> hsi_d;
00108 
00109   } // end of namespace mln::value
00110 
00111 } // end of namespace mln
00112 
00113 #endif // ! MLN_VALUE_HSI_HH

Generated on Tue Oct 4 2011 15:23:55 for Milena (Olena) by  doxygen 1.7.1