color_palette.tpp

Go to the documentation of this file.
00001 /*
00002   CLAW - a C++ Library Absolutely Wonderful
00003 
00004   CLAW is a free library without any particular aim but being useful to 
00005   anyone.
00006 
00007   Copyright (C) 2005-2008 Julien Jorge
00008 
00009   This library is free software; you can redistribute it and/or
00010   modify it under the terms of the GNU Lesser General Public
00011   License as published by the Free Software Foundation; either
00012   version 2.1 of the License, or (at your option) any later version.
00013 
00014   This library is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017   Lesser General Public License for more details.
00018 
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with this library; if not, write to the Free Software
00021   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023   contact: julien_jorge@yahoo.fr
00024 */
00030 #include <cassert>
00031 
00032 /*----------------------------------------------------------------------------*/
00037 template< typename Color >
00038 claw::graphic::color_palette<Color>::color_palette(unsigned int n)
00039   : m_palette(n)
00040 {
00041 
00042 } // color_palette::color_palette()
00043 
00044 /*----------------------------------------------------------------------------*/
00048 template< typename Color >
00049 unsigned int claw::graphic::color_palette<Color>::size() const
00050 {
00051   return m_palette.size();
00052 } // color_palette::size()
00053 
00054 /*----------------------------------------------------------------------------*/
00060 template< typename Color >
00061 typename claw::graphic::color_palette<Color>::color_type&
00062 claw::graphic::color_palette<Color>::operator[]( unsigned int i )
00063 {
00064   assert( i < m_palette.size() );
00065 
00066   return m_palette[i];
00067 } // color_palette::operator[]()
00068 
00069 /*----------------------------------------------------------------------------*/
00075 template< typename Color >
00076 const typename claw::graphic::color_palette<Color>::color_type&
00077 claw::graphic::color_palette<Color>::operator[]( unsigned int i ) const
00078 {
00079   assert( i < m_palette.size() );
00080 
00081   return m_palette[i];
00082 } // color_palette::operator[]() [const]
00083 
00084 /*----------------------------------------------------------------------------*/
00090 template< typename Color >
00091 const typename claw::graphic::color_palette<Color>::color_type&
00092 claw::graphic::color_palette<Color>::operator()( unsigned int i ) const
00093 {
00094   assert( i < m_palette.size() );
00095 
00096   return m_palette[i];
00097 } // color_palette::operator()()
00098 

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1