();} // PERFORMANCE_CHECK: Is this constructor necessary? template planar_pixel_reference(pixel >& p) : parent_t(p) { check_compatible > >();} // Construct at offset from a given location template planar_pixel_reference(const planar_pixel_iterator& p, std::ptrdiff_t diff) : parent_t(p,diff) {} const planar_pixel_reference& operator=(const planar_pixel_reference& p) const { static_copy(p,*this); return *this; } template const planar_pixel_reference& operator=(const P& p) const { check_compatible(); static_copy(p,*this); return *this; } template bool operator==(const P& p) const { check_compatible(); return static_equal(*this,p); } template bool operator!=(const P& p) const { return !(*this==p); } ChannelReference operator[](std::size_t i) const { return this->at_c_dynamic(i); } const planar_pixel_reference* operator->() const { return this; } private: template static void check_compatible() { gil_function_requires >(); } }; ///////////////////////////// // ColorBasedConcept ///////////////////////////// template struct kth_element_type, K> { typedef ChannelReference type; }; template struct kth_element_reference_type, K> { typedef ChannelReference type; }; template struct kth_element_const_reference_type, K> : public add_reference::type> { // typedef typename channel_traits::const_reference type; }; ///////////////////////////// // PixelConcept ///////////////////////////// /// \brief Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept /// \ingroup PixelModelPlanarRef template struct is_pixel< planar_pixel_reference > : public mpl::true_{}; ///////////////////////////// // HomogeneousPixelBasedConcept ///////////////////////////// /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct color_space_type > { typedef ColorSpace type; }; /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_mapping_type > { typedef typename layout::channel_mapping_t type; }; /// \brief Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct is_planar > : mpl::true_ {}; /// \brief Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_type > { typedef typename channel_traits::value_type type; }; } } // namespace boost::gil namespace std { // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified. // swap with 'left bias': // - swap between proxy and anything // - swap between value type and proxy // - swap between proxy and proxy // Having three overloads allows us to swap between different (but compatible) models of PixelConcept /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, R& y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(typename boost::gil::planar_pixel_reference::value_type& x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } } // namespace std #endif
(); static_copy(p,*this); return *this; } template bool operator==(const P& p) const { check_compatible(); return static_equal(*this,p); } template bool operator!=(const P& p) const { return !(*this==p); } ChannelReference operator[](std::size_t i) const { return this->at_c_dynamic(i); } const planar_pixel_reference* operator->() const { return this; } private: template static void check_compatible() { gil_function_requires >(); } }; ///////////////////////////// // ColorBasedConcept ///////////////////////////// template struct kth_element_type, K> { typedef ChannelReference type; }; template struct kth_element_reference_type, K> { typedef ChannelReference type; }; template struct kth_element_const_reference_type, K> : public add_reference::type> { // typedef typename channel_traits::const_reference type; }; ///////////////////////////// // PixelConcept ///////////////////////////// /// \brief Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept /// \ingroup PixelModelPlanarRef template struct is_pixel< planar_pixel_reference > : public mpl::true_{}; ///////////////////////////// // HomogeneousPixelBasedConcept ///////////////////////////// /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct color_space_type > { typedef ColorSpace type; }; /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_mapping_type > { typedef typename layout::channel_mapping_t type; }; /// \brief Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct is_planar > : mpl::true_ {}; /// \brief Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_type > { typedef typename channel_traits::value_type type; }; } } // namespace boost::gil namespace std { // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified. // swap with 'left bias': // - swap between proxy and anything // - swap between value type and proxy // - swap between proxy and proxy // Having three overloads allows us to swap between different (but compatible) models of PixelConcept /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, R& y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(typename boost::gil::planar_pixel_reference::value_type& x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } } // namespace std #endif
(); return static_equal(*this,p); } template bool operator!=(const P& p) const { return !(*this==p); } ChannelReference operator[](std::size_t i) const { return this->at_c_dynamic(i); } const planar_pixel_reference* operator->() const { return this; } private: template static void check_compatible() { gil_function_requires >(); } }; ///////////////////////////// // ColorBasedConcept ///////////////////////////// template struct kth_element_type, K> { typedef ChannelReference type; }; template struct kth_element_reference_type, K> { typedef ChannelReference type; }; template struct kth_element_const_reference_type, K> : public add_reference::type> { // typedef typename channel_traits::const_reference type; }; ///////////////////////////// // PixelConcept ///////////////////////////// /// \brief Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept /// \ingroup PixelModelPlanarRef template struct is_pixel< planar_pixel_reference > : public mpl::true_{}; ///////////////////////////// // HomogeneousPixelBasedConcept ///////////////////////////// /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct color_space_type > { typedef ColorSpace type; }; /// \brief Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_mapping_type > { typedef typename layout::channel_mapping_t type; }; /// \brief Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept /// \ingroup PixelModelPlanarRef template struct is_planar > : mpl::true_ {}; /// \brief Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept /// \ingroup PixelModelPlanarRef template struct channel_type > { typedef typename channel_traits::value_type type; }; } } // namespace boost::gil namespace std { // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified. // swap with 'left bias': // - swap between proxy and anything // - swap between value type and proxy // - swap between proxy and proxy // Having three overloads allows us to swap between different (but compatible) models of PixelConcept /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, R& y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(typename boost::gil::planar_pixel_reference::value_type& x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } /// \brief swap for planar_pixel_reference /// \ingroup PixelModelPlanarRef template inline void swap(boost::gil::planar_pixel_reference x, boost::gil::planar_pixel_reference y) { boost::gil::swap_proxy::value_type>(x,y); } } // namespace std #endif