Chris@16: /* Chris@16: Copyright 2005-2007 Adobe Systems Incorporated Chris@16: Chris@16: Use, modification and distribution are subject to the Boost Software License, Chris@16: Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: http://www.boost.org/LICENSE_1_0.txt). Chris@16: Chris@16: See http://opensource.adobe.com/gil for most recent version including documentation. Chris@16: */ Chris@16: Chris@16: /*************************************************************************************************/ Chris@16: Chris@16: #ifndef GIL_METAFUNCTIONS_HPP Chris@16: #define GIL_METAFUNCTIONS_HPP Chris@16: Chris@16: //////////////////////////////////////////////////////////////////////////////////////// Chris@16: /// \file Chris@16: /// \brief metafunctions that construct types or return type properties Chris@16: /// \author Lubomir Bourdev and Hailin Jin \n Chris@16: /// Adobe Systems Incorporated Chris@16: /// Chris@16: /// \date 2005-2007 \n Last updated on February 6, 2007 Chris@16: /// Chris@16: //////////////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include "gil_config.hpp" Chris@16: #include "gil_concept.hpp" Chris@16: #include "channel.hpp" Chris@16: Chris@16: namespace boost { namespace gil { Chris@16: Chris@16: // forward declarations Chris@16: template struct pixel; Chris@16: template struct packed_pixel; Chris@16: template struct planar_pixel_reference; Chris@16: template struct planar_pixel_iterator; Chris@16: template class memory_based_step_iterator; Chris@16: template class memory_based_2d_locator; Chris@16: template class image_view; Chris@16: template class image; Chris@16: template struct channel_type; Chris@16: template struct color_space_type; Chris@16: template struct channel_mapping_type; Chris@16: template struct is_iterator_adaptor; Chris@16: template struct iterator_adaptor_get_base; Chris@16: template struct bit_aligned_pixel_reference; Chris@16: Chris@16: ////////////////////////////////////////////////// Chris@16: /// Chris@16: /// TYPE ANALYSIS METAFUNCTIONS Chris@16: /// Predicate metafunctions determining properties of GIL types Chris@16: /// Chris@16: ////////////////////////////////////////////////// Chris@16: Chris@16: Chris@16: /// \defgroup GILIsBasic xxx_is_basic Chris@16: /// \ingroup TypeAnalysis Chris@16: /// \brief Determines if GIL constructs are basic. Chris@16: /// Basic constructs are the ones that can be generated with the type Chris@16: /// factory methods pixel_reference_type, iterator_type, locator_type, view_type and image_type Chris@16: /// They can be mutable/immutable, planar/interleaved, step/nonstep. They must use GIL-provided models. Chris@16: Chris@16: /// \brief Determines if a given pixel reference is basic Chris@16: /// Basic references must use gil::pixel& (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules. Chris@16: /// \ingroup GILIsBasic Chris@16: template struct pixel_reference_is_basic : public mpl::false_ {}; Chris@16: template struct pixel_reference_is_basic< pixel&> : public mpl::true_ {}; Chris@16: template struct pixel_reference_is_basic&> : public mpl::true_ {}; Chris@16: template struct pixel_reference_is_basic > : public mpl::true_ {}; Chris@16: template struct pixel_reference_is_basic > : public mpl::true_ {}; Chris@16: Chris@16: Chris@16: /// \brief Determines if a given pixel iterator is basic Chris@16: /// Basic iterators must use gil::pixel (if interleaved), gil::planar_pixel_iterator (if planar) and gil::memory_based_step_iterator (if step). They must use the standard constness rules. Chris@16: /// \ingroup GILIsBasic Chris@16: template Chris@16: struct iterator_is_basic : public mpl::false_ {}; Chris@16: template // mutable interleaved Chris@16: struct iterator_is_basic< pixel* > : public mpl::true_ {}; Chris@16: template // immutable interleaved Chris@16: struct iterator_is_basic* > : public mpl::true_ {}; Chris@16: template // mutable planar Chris@16: struct iterator_is_basic > : public mpl::true_ {}; Chris@16: template // immutable planar Chris@16: struct iterator_is_basic > : public mpl::true_ {}; Chris@16: template // mutable interleaved step Chris@16: struct iterator_is_basic*> > : public mpl::true_ {}; Chris@16: template // immutable interleaved step Chris@16: struct iterator_is_basic*> > : public mpl::true_ {}; Chris@16: template // mutable planar step Chris@16: struct iterator_is_basic > > : public mpl::true_ {}; Chris@16: template // immutable planar step Chris@16: struct iterator_is_basic > > : public mpl::true_ {}; Chris@16: Chris@16: Chris@16: /// \ingroup GILIsBasic Chris@16: /// \brief Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator Chris@16: template struct locator_is_basic : public mpl::false_ {}; Chris@16: template struct locator_is_basic > > : public iterator_is_basic {}; Chris@16: Chris@16: /// \ingroup GILIsBasic Chris@16: /// \brief Basic views must be over basic locators Chris@16: template struct view_is_basic : public mpl::false_ {}; Chris@16: template struct view_is_basic > : public locator_is_basic {}; Chris@16: Chris@16: /// \ingroup GILIsBasic Chris@16: /// \brief Basic images must use basic views and std::allocator of char Chris@16: template struct image_is_basic : public mpl::false_ {}; Chris@16: template struct image_is_basic > : public mpl::true_ {}; Chris@16: Chris@16: Chris@16: /// \defgroup GILIsStep xxx_is_step Chris@16: /// \ingroup TypeAnalysis Chris@16: /// \brief Determines if the given iterator/locator/view has a step that could be set dynamically Chris@16: Chris@16: template struct iterator_is_step; Chris@16: namespace detail { Chris@16: template struct iterator_is_step_impl; Chris@16: // iterator that has the same type as its dynamic_x_step_type must be a step iterator Chris@16: template struct iterator_is_step_impl : public mpl::true_{}; Chris@16: Chris@16: // base iterator can never be a step iterator Chris@16: template struct iterator_is_step_impl : public mpl::false_{}; Chris@16: Chris@16: // for an iterator adaptor, see if its base is step Chris@16: template struct iterator_is_step_impl Chris@16: : public iterator_is_step::type>{}; Chris@16: } Chris@16: Chris@16: /// \ingroup GILIsStep Chris@16: /// \brief Determines if the given iterator has a step that could be set dynamically Chris@16: template struct iterator_is_step Chris@16: : public detail::iterator_is_step_impl::type::value, Chris@16: is_same::type>::value >{}; Chris@16: Chris@16: /// \ingroup GILIsStep Chris@16: /// \brief Determines if the given locator has a horizontal step that could be set dynamically Chris@16: template struct locator_is_step_in_x : public iterator_is_step {}; Chris@16: Chris@16: /// \ingroup GILIsStep Chris@16: /// \brief Determines if the given locator has a vertical step that could be set dynamically Chris@16: template struct locator_is_step_in_y : public iterator_is_step {}; Chris@16: Chris@16: /// \ingroup GILIsStep Chris@16: /// \brief Determines if the given view has a horizontal step that could be set dynamically Chris@16: template struct view_is_step_in_x : public locator_is_step_in_x {}; Chris@16: Chris@16: /// \ingroup GILIsStep Chris@16: /// \brief Determines if the given view has a vertical step that could be set dynamically Chris@16: template struct view_is_step_in_y : public locator_is_step_in_y {}; Chris@16: Chris@16: /// \brief Determines whether the given pixel reference is a proxy class or a native C++ reference Chris@16: /// \ingroup TypeAnalysis Chris@16: template Chris@16: struct pixel_reference_is_proxy Chris@16: : public mpl::not_::type, Chris@16: typename remove_const_and_reference::type::value_type> > {}; Chris@16: Chris@16: /// \brief Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value) Chris@16: /// \ingroup TypeAnalysis Chris@16: template Chris@16: struct pixel_is_reference : public mpl::or_, pixel_reference_is_proxy > {}; Chris@16: Chris@16: /// \defgroup GILIsMutable xxx_is_mutable Chris@16: /// \ingroup TypeAnalysis Chris@16: /// \brief Determines if the given pixel reference/iterator/locator/view is mutable (i.e. its pixels can be changed) Chris@16: Chris@16: /// \ingroup GILIsMutable Chris@16: /// \brief Determines if the given pixel reference is mutable (i.e. its channels can be changed) Chris@16: /// Chris@16: /// Note that built-in C++ references obey the const qualifier but reference proxy classes do not. Chris@16: template struct pixel_reference_is_mutable : public mpl::bool_::type::is_mutable> {}; Chris@16: template struct pixel_reference_is_mutable Chris@16: : public mpl::and_, pixel_reference_is_mutable > {}; Chris@16: Chris@16: /// \ingroup GILIsMutable Chris@16: /// \brief Determines if the given locator is mutable (i.e. its pixels can be changed) Chris@16: template struct locator_is_mutable : public iterator_is_mutable {}; Chris@16: /// \ingroup GILIsMutable Chris@16: /// \brief Determines if the given view is mutable (i.e. its pixels can be changed) Chris@16: template struct view_is_mutable : public iterator_is_mutable {}; Chris@16: Chris@16: Chris@16: ////////////////////////////////////////////////// Chris@16: /// Chris@16: /// TYPE FACTORY METAFUNCTIONS Chris@16: /// Metafunctions returning GIL types from other GIL types Chris@16: /// Chris@16: ////////////////////////////////////////////////// Chris@16: Chris@16: /// \defgroup TypeFactoryFromElements xxx_type Chris@16: /// \ingroup TypeFactory Chris@16: /// \brief Returns the type of a homogeneous GIL construct given its elements (channel, layout, whether it is planar, step, mutable, etc.) Chris@16: Chris@16: /// \defgroup TypeFactoryFromPixel xxx_type_from_pixel Chris@16: /// \ingroup TypeFactory Chris@16: /// \brief Returns the type of a GIL construct given its pixel type, whether it is planar, step, mutable, etc. Chris@16: Chris@16: /// \defgroup TypeFactoryDerived derived_xxx_type Chris@16: /// \ingroup TypeFactory Chris@16: /// \brief Returns the type of a homogeneous GIL construct given a related construct by changing some of its properties Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable Chris@16: template struct pixel_reference_type{}; Chris@16: template struct pixel_reference_type { typedef pixel& type; }; Chris@16: template struct pixel_reference_type { typedef const pixel& type; }; Chris@16: template struct pixel_reference_type { typedef const planar_pixel_reference::reference,typename color_space_type::type> type; }; // TODO: Assert M=identity Chris@16: template struct pixel_reference_type { typedef const planar_pixel_reference::const_reference,typename color_space_type::type> type; };// TODO: Assert M=identity Chris@16: Chris@16: /// \ingroup TypeFactoryFromPixel Chris@16: /// \brief Returns the type of a pixel iterator given the pixel type, whether it operates on planar data, whether it is a step iterator, and whether it is mutable Chris@16: template struct iterator_type_from_pixel{}; Chris@16: template struct iterator_type_from_pixel { typedef Pixel* type; }; Chris@16: template struct iterator_type_from_pixel { typedef const Pixel* type; }; Chris@16: template struct iterator_type_from_pixel { Chris@16: typedef planar_pixel_iterator::type>::pointer,typename color_space_type::type> type; Chris@16: }; Chris@16: template struct iterator_type_from_pixel { Chris@16: typedef planar_pixel_iterator::type>::const_pointer,typename color_space_type::type> type; Chris@16: }; Chris@16: template struct iterator_type_from_pixel { Chris@16: typedef memory_based_step_iterator::type> type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on planar data, whether it is a step iterator, and whether it is mutable Chris@16: template struct iterator_type{}; Chris@16: template struct iterator_type { typedef pixel* type; }; Chris@16: template struct iterator_type { typedef const pixel* type; }; Chris@16: template struct iterator_type { typedef planar_pixel_iterator type; }; // TODO: Assert M=identity Chris@16: template struct iterator_type { typedef planar_pixel_iterator type; }; // TODO: Assert M=identity Chris@16: template struct iterator_type { Chris@16: typedef memory_based_step_iterator::type> type; Chris@16: }; Chris@16: Chris@16: /// \brief Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view Chris@16: /// \ingroup TypeFactory Chris@16: template Chris@16: struct type_from_x_iterator { Chris@16: typedef memory_based_step_iterator step_iterator_t; Chris@16: typedef memory_based_2d_locator xy_locator_t; Chris@16: typedef image_view view_t; Chris@16: }; Chris@16: Chris@16: namespace detail { Chris@16: template Chris@16: struct packed_channel_reference_type { Chris@16: typedef const packed_channel_reference type; Chris@16: }; Chris@16: Chris@16: template Chris@16: class packed_channel_references_vector_type { Chris@16: // If ChannelBitSizesVector is mpl::vector Chris@16: // Then first_bits_vector will be mpl::vector Chris@16: typedef typename mpl::accumulate >, Chris@16: mpl::push_back, mpl::_2> > >::type first_bits_vector; Chris@16: public: Chris@16: typedef typename mpl::transform::type, ChannelBitSizesVector, Chris@16: packed_channel_reference_type >::type type; Chris@16: }; Chris@16: Chris@16: } Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout. Chris@16: /// Chris@16: /// A packed pixel has channels that cover bit ranges but itself is byte aligned. RGB565 pixel is an example. Chris@16: /// Chris@16: /// The size of ChannelBitSizeVector must equal the number of channels in the given layout Chris@16: /// The sum of bit sizes for all channels must be less than or equal to the number of bits in BitField (and cannot exceed 64). Chris@16: /// If it is less than the number of bits in BitField, the last bits will be unused. Chris@16: template Chris@16: struct packed_pixel_type { Chris@16: typedef packed_pixel::type, Layout> type; Chris@16: }; Chris@16: Chris@16: /// \defgroup TypeFactoryPacked packed_image_type,bit_aligned_image_type Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of an image whose channels are not byte-aligned. Chris@16: /// Chris@16: /// A packed image is an image whose pixels are byte aligned, such as "rgb565".
Chris@16: /// A bit-aligned image is an image whose pixels are not byte aligned, such as "rgb222".
Chris@16: /// Chris@16: /// The sum of the bit sizes of all channels cannot exceed 64. Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned. Chris@16: template > Chris@16: struct packed_image_type { Chris@16: typedef image::type,false,Alloc> type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a single-channel image given its bitfield type, the bit size of its channel and its layout Chris@16: template > Chris@16: struct packed_image1_type : public packed_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a two channel image given its bitfield type, the bit size of its channels and its layout Chris@16: template > Chris@16: struct packed_image2_type : public packed_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a three channel image given its bitfield type, the bit size of its channels and its layout Chris@16: template > Chris@16: struct packed_image3_type : public packed_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a four channel image given its bitfield type, the bit size of its channels and its layout Chris@16: template > Chris@16: struct packed_image4_type : public packed_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a five channel image given its bitfield type, the bit size of its channels and its layout Chris@16: template > Chris@16: struct packed_image5_type : public packed_image_type, Layout, Alloc> {}; Chris@16: Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a packed image whose pixels may not be byte aligned. For example, an "rgb222" image is bit-aligned because its pixel spans six bits. Chris@16: /// Chris@16: /// Note that the alignment parameter in the constructor of bit-aligned images is in bit units. For example, if you want to construct a bit-aligned Chris@16: /// image whose rows are byte-aligned, use 8 as the alignment parameter, not 1. Chris@16: Chris@16: template > Chris@16: struct bit_aligned_image_type { Chris@16: private: Chris@16: BOOST_STATIC_CONSTANT(int, bit_size = (mpl::accumulate, mpl::plus >::type::value)); Chris@16: typedef typename detail::min_fast_uint::type bitfield_t; Chris@16: typedef const bit_aligned_pixel_reference bit_alignedref_t; Chris@16: public: Chris@16: typedef image type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layout Chris@16: template > Chris@16: struct bit_aligned_image1_type : public bit_aligned_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout Chris@16: template > Chris@16: struct bit_aligned_image2_type : public bit_aligned_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a three channel bit-aligned image given the bit size of its channels and its layout Chris@16: template > Chris@16: struct bit_aligned_image3_type : public bit_aligned_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a four channel bit-aligned image given the bit size of its channels and its layout Chris@16: template > Chris@16: struct bit_aligned_image4_type : public bit_aligned_image_type, Layout, Alloc> {}; Chris@16: Chris@16: /// \ingroup TypeFactoryPacked Chris@16: /// \brief Returns the type of a five channel bit-aligned image given the bit size of its channels and its layout Chris@16: template > Chris@16: struct bit_aligned_image5_type : public bit_aligned_image_type, Layout, Alloc> {}; Chris@16: Chris@16: Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous pixel given the channel type and layout Chris@16: template Chris@16: struct pixel_value_type { Chris@16: typedef pixel type; // by default use gil::pixel. Specializations are provided for Chris@16: }; Chris@16: Chris@16: // Specializations for packed channels Chris@16: template Chris@16: struct pixel_value_type< packed_dynamic_channel_reference,Layout> : Chris@16: public packed_pixel_type, Layout> {}; Chris@16: template Chris@16: struct pixel_value_type,Layout> : Chris@16: public packed_pixel_type, Layout> {}; Chris@16: Chris@16: template Chris@16: struct pixel_value_type< packed_channel_reference,Layout> : Chris@16: public packed_pixel_type, Layout> {}; Chris@16: template Chris@16: struct pixel_value_type,Layout> : Chris@16: public packed_pixel_type, Layout> {}; Chris@16: Chris@16: template Chris@16: struct pixel_value_type,Layout> : Chris@16: public packed_pixel_type::type, mpl::vector1_c, Layout> {}; Chris@16: Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous locator given the channel type, layout, whether it operates on planar data and whether it has a step horizontally Chris@16: template Chris@16: struct locator_type { Chris@16: typedef typename type_from_x_iterator::type>::xy_locator_type type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar data and whether it has a step horizontally Chris@16: template Chris@16: struct view_type { Chris@16: typedef typename type_from_x_iterator::type>::view_t type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryFromElements Chris@16: /// \brief Returns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data Chris@16: template > Chris@16: struct image_type { Chris@16: typedef image, IsPlanar, Alloc> type; Chris@16: }; Chris@16: Chris@16: /// \ingroup TypeFactoryFromPixel Chris@16: /// \brief Returns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally Chris@16: template Chris@16: struct view_type_from_pixel { Chris@16: typedef typename type_from_x_iterator::type>::view_t type; Chris@16: }; Chris@16: Chris@16: Chris@16: /// \brief Constructs a pixel reference type from a source pixel reference type by changing some of the properties. Chris@16: /// \ingroup TypeFactoryDerived Chris@16: /// Use use_default for the properties of the source view that you want to keep Chris@16: template Chris@16: class derived_pixel_reference_type { Chris@16: typedef typename remove_reference::type pixel_t; Chris@16: typedef typename mpl::if_, typename channel_type::type, T >::type channel_t; Chris@16: typedef typename mpl::if_, Chris@16: layout::type, typename channel_mapping_type::type>, L>::type layout_t; Chris@16: static const bool mut =mpl::if_, pixel_reference_is_mutable, IsMutable>::type::value; Chris@16: static const bool planar=mpl::if_, is_planar, IsPlanar>::type::value; Chris@16: public: Chris@16: typedef typename pixel_reference_type::type type; Chris@16: }; Chris@16: Chris@16: /// \brief Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties. Chris@16: /// \ingroup TypeFactoryDerived Chris@16: /// Use use_default for the properties of the source view that you want to keep Chris@16: template Chris@16: class derived_iterator_type { Chris@16: typedef typename mpl::if_, typename channel_type::type, T >::type channel_t; Chris@16: typedef typename mpl::if_, Chris@16: layout::type, typename channel_mapping_type::type>, L>::type layout_t; Chris@16: Chris@16: static const bool mut =mpl::if_, iterator_is_mutable, IsMutable>::type::value; Chris@16: static const bool planar=mpl::if_, is_planar, IsPlanar>::type::value; Chris@16: static const bool step =mpl::if_, iterator_is_step, IsStep>::type::value; Chris@16: public: Chris@16: typedef typename iterator_type::type type; Chris@16: }; Chris@16: Chris@16: /// \brief Constructs an image view type from a source view type by changing some of the properties. Chris@16: /// \ingroup TypeFactoryDerived Chris@16: /// Use use_default for the properties of the source view that you want to keep Chris@16: template Chris@16: class derived_view_type { Chris@16: typedef typename mpl::if_, typename channel_type::type, T>::type channel_t; Chris@16: typedef typename mpl::if_, Chris@16: layout::type, typename channel_mapping_type::type>, L>::type layout_t; Chris@16: static const bool mut =mpl::if_, view_is_mutable, IsMutable>::type::value; Chris@16: static const bool planar=mpl::if_, is_planar, IsPlanar>::type::value; Chris@16: static const bool step =mpl::if_, view_is_step_in_x,StepX>::type::value; Chris@16: public: Chris@16: typedef typename view_type::type type; Chris@16: }; Chris@16: Chris@16: /// \brief Constructs a homogeneous image type from a source image type by changing some of the properties. Chris@16: /// \ingroup TypeFactoryDerived Chris@16: /// Use use_default for the properties of the source image that you want to keep Chris@16: template Chris@16: class derived_image_type { Chris@16: typedef typename mpl::if_, typename channel_type::type, T >::type channel_t; Chris@16: typedef typename mpl::if_, Chris@16: layout::type, typename channel_mapping_type::type>, L>::type layout_t; Chris@16: static const bool planar=mpl::if_, is_planar, IsPlanar>::type::value; Chris@16: public: Chris@16: typedef typename image_type::type type; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: Chris@16: } } // namespace boost::gil Chris@16: Chris@16: #endif