is_similar.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
  3. Use, modification and distribution are subject to the Boost Software License,
  4. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. */
  7. /*************************************************************************************************/
  8. #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP
  9. #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP
  10. ////////////////////////////////////////////////////////////////////////////////////////
  11. /// \file is_similar.hpp
  12. /// \brief is_similar metafunction.
  13. /// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n
  14. ///
  15. /// \date 2012 \n
  16. ///
  17. ////////////////////////////////////////////////////////////////////////////////////////
  18. #include <boost/gil/channel.hpp>
  19. namespace boost{ namespace gil {
  20. /// is_similar metafunctions
  21. /// \brief Determines if two pixel types are similar.
  22. template< typename A, typename B >
  23. struct is_similar : mpl::false_ {};
  24. template<typename A>
  25. struct is_similar< A, A > : mpl::true_ {};
  26. template<typename B,int I, int S, bool M, int I2>
  27. struct is_similar< packed_channel_reference< B, I, S, M >
  28. , packed_channel_reference< B, I2, S, M >
  29. > : mpl::true_ {};
  30. } // namespace gil
  31. } // namespace boost
  32. #endif // BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP