Ticket #3041: gil.patch

File gil.patch, 10.7 KB (added by Richard Webb <richard.webb@…>, 13 years ago)
  • boost/gil/bit_aligned_pixel_reference.hpp

     
    145145
    146146    // Construct from another compatible pixel type
    147147    bit_aligned_pixel_reference(const bit_aligned_pixel_reference& p) : _bit_range(p._bit_range) {}
    148     template <typename BF, typename CR> bit_aligned_pixel_reference(packed_pixel<BF,CR,Layout>& p) : _bit_range(static_cast<data_ptr_t>(&at_c<0>(p)), at_c<0>(p).first_bit()) {
     148    template <typename BF, typename CR> bit_aligned_pixel_reference(packed_pixel<BF,CR,Layout>& p) : _bit_range(static_cast<data_ptr_t>(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit()) {
    149149        check_compatible<packed_pixel<BF,CR,Layout> >();
    150150    }
    151151
  • boost/gil/color_base.hpp

     
    155155    homogeneous_color_base(Element v0, Element v1, Element v2) : _v0(v0), _v1(v1), _v2(v2) {}
    156156
    157157    template <typename E2, typename L2> homogeneous_color_base(const homogeneous_color_base<E2,L2,3>& c) :
    158         _v0(at_c<mapping_transform<Layout,L2,0>::value>(c)),
    159         _v1(at_c<mapping_transform<Layout,L2,1>::value>(c)),
    160         _v2(at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
     158        _v0(gil::at_c<mapping_transform<Layout,L2,0>::value>(c)),
     159        _v1(gil::at_c<mapping_transform<Layout,L2,1>::value>(c)),
     160        _v2(gil::at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
    161161
    162162    // Support for l-value reference proxy copy construction
    163163    template <typename E2, typename L2> homogeneous_color_base(      homogeneous_color_base<E2,L2,3>& c) :
    164         _v0(at_c<mapping_transform<Layout,L2,0>::value>(c)),
    165         _v1(at_c<mapping_transform<Layout,L2,1>::value>(c)),
    166         _v2(at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
     164        _v0(gil::at_c<mapping_transform<Layout,L2,0>::value>(c)),
     165        _v1(gil::at_c<mapping_transform<Layout,L2,1>::value>(c)),
     166        _v2(gil::at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
    167167
    168168    // Support for planar_pixel_iterator construction and dereferencing
    169169    template <typename P> homogeneous_color_base(P* p,bool) :
  • boost/gil/color_base_algorithm.hpp

     
    101101template <typename ColorBase, int K> struct kth_semantic_element_reference_type {
    102102    BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c<typename ColorBase::layout_t::channel_mapping_t,K>::type::value));
    103103    typedef typename kth_element_reference_type<ColorBase,semantic_index>::type type;
    104     static type       get(ColorBase& cb) { return at_c<semantic_index>(cb); }
     104    static type       get(ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
    105105};
    106106
    107107/// \brief Specifies the return type of the constant semantic_at_c<K>(color_base);
     
    109109template <typename ColorBase, int K> struct kth_semantic_element_const_reference_type {
    110110    BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c<typename ColorBase::layout_t::channel_mapping_t,K>::type::value));
    111111    typedef typename kth_element_const_reference_type<ColorBase,semantic_index>::type type;
    112     static type       get(const ColorBase& cb) { return at_c<semantic_index>(cb); }
     112    static type       get(const ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
    113113};
    114114
    115115/// \brief A mutable accessor to the K-th semantic element of a color base
  • boost/gil/image_view_factory.hpp

     
    102102    BOOST_STATIC_ASSERT((!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value));
    103103    BOOST_STATIC_ASSERT((boost::is_pointer<typename HomogeneousView::x_iterator>::value));
    104104
    105     return &at_c<0>(view(0,0));
     105    return &gil::at_c<0>(view(0,0));
    106106}
    107107
    108108/// \ingroup ImageViewConstructors
     
    430430            typedef typename type::xy_locator                             locator_t;
    431431            typedef typename type::x_iterator                            x_iterator_t;
    432432            typedef typename iterator_adaptor_get_base<x_iterator_t>::type x_iterator_base_t;
    433             x_iterator_t sit(x_iterator_base_t(&at_c<K>(src(0,0))),src.pixels().pixel_size());
     433            x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
    434434            return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
    435435        }
    436436    };
     
    444444        typedef typename view_type<channel_t, gray_layout_t, false, false, view_is_mutable<View>::value>::type type;
    445445        static type make(const View& src) {
    446446            typedef typename type::x_iterator x_iterator_t;
    447             return interleaved_view(src.width(),src.height(),(x_iterator_t)&at_c<K>(src(0,0)), src.pixels().row_size());
     447            return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
    448448        }
    449449    };
    450450
     
    494494        template <typename P> kth_channel_deref_fn(const kth_channel_deref_fn<K,P>&) {}
    495495
    496496        result_type operator()(argument_type srcP) const {
    497             return result_type(at_c<K>(srcP));
     497            return result_type(gil::at_c<K>(srcP));
    498498        }
    499499    };
    500500
  • boost/gil/packed_pixel.hpp

     
    8181    }
    8282    packed_pixel(int chan0, int chan1, int chan2) : _bitfield(0) {
    8383        BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==3));
    84         at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2;
     84        gil::at_c<0>(*this)=chan0; gil::at_c<1>(*this)=chan1; gil::at_c<2>(*this)=chan2;
    8585    }
    8686    packed_pixel(int chan0, int chan1, int chan2, int chan3) : _bitfield(0) {
    8787        BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==4));
  • boost/gil/pixel.hpp

     
    143143
    144144private:
    145145    static void check_gray() {  BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
    146     template <typename Channel> void assign(const Channel& chan, mpl::false_)       { check_gray(); at_c<0>(*this)=chan; }
    147     template <typename Channel> bool equal (const Channel& chan, mpl::false_) const { check_gray(); return at_c<0>(*this)==chan; }
     146    template <typename Channel> void assign(const Channel& chan, mpl::false_)       { check_gray(); gil::at_c<0>(*this)=chan; }
     147    template <typename Channel> bool equal (const Channel& chan, mpl::false_) const { check_gray(); return gil::at_c<0>(*this)==chan; }
    148148public:
    149     pixel&  operator= (channel_t chan)       { check_gray(); at_c<0>(*this)=chan; return *this; }
    150     bool    operator==(channel_t chan) const { check_gray(); return at_c<0>(*this)==chan; }
     149    pixel&  operator= (channel_t chan)       { check_gray(); gil::at_c<0>(*this)=chan; return *this; }
     150    bool    operator==(channel_t chan) const { check_gray(); return gil::at_c<0>(*this)==chan; }
    151151};
    152152
    153153/////////////////////////////
  • boost/gil/planar_pixel_iterator.hpp

     
    109109    reference operator->()                        const { return **this; }
    110110
    111111    // PERFORMANCE_CHECK: Remove?
    112     bool operator< (const planar_pixel_iterator& ptr)   const { return at_c<0>(*this)< at_c<0>(ptr); }
    113     bool operator!=(const planar_pixel_iterator& ptr)   const { return at_c<0>(*this)!=at_c<0>(ptr); }
     112    bool operator< (const planar_pixel_iterator& ptr)   const { return gil::at_c<0>(*this)< gil::at_c<0>(ptr); }
     113    bool operator!=(const planar_pixel_iterator& ptr)   const { return gil::at_c<0>(*this)!=gil::at_c<0>(ptr); }
    114114private:
    115115    friend class boost::iterator_core_access;
    116116
     
    119119    void advance(ptrdiff_t d)   { static_transform(*this,*this,std::bind2nd(detail::plus_asymmetric<ChannelPtr,ptrdiff_t>(),d)); }
    120120    reference dereference() const { return this->template deref<reference>(); }
    121121
    122     ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return at_c<0>(it)-at_c<0>(*this); }
    123     bool equal(const planar_pixel_iterator& it) const { return at_c<0>(*this)==at_c<0>(it); }
     122    ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); }
     123    bool equal(const planar_pixel_iterator& it) const { return gil::at_c<0>(*this)==gil::at_c<0>(it); }
    124124};
    125125
    126126namespace detail {
  • libs/gil/test/pixel.cpp

     
    3434// Testing pixel references and values, pixel operations, color conversion
    3535
    3636using namespace boost::gil;
    37 using namespace std;
     37using std::swap;
    3838using namespace boost;
     39
    3940void error_if(bool condition);
    4041
    4142struct increment {
     
    6364
    6465        // test homogeneous algorithms - fill, max, min
    6566        static const int num_chan = num_channels<typename C2::pixel_t>::value;
    66         static_fill(C2::_pixel, at_c<0>(C1::_pixel)+1);
    67         error_if(at_c<0>(C2::_pixel) != at_c<num_chan-1>(C2::_pixel));
     67        static_fill(C2::_pixel, gil::at_c<0>(C1::_pixel)+1);
     68        error_if(gil::at_c<0>(C2::_pixel) != gil::at_c<num_chan-1>(C2::_pixel));
    6869
    6970        C2::_pixel = C1::_pixel;
    7071        error_if(static_max(C2::_pixel) != static_max(C1::_pixel));
     
    107108        error_if(C1::_pixel!=C2::_pixel);
    108109
    109110        static_generate(C2::_pixel, set_to_one());
    110         error_if(at_c<0>(C2::_pixel) != 1);
     111        error_if(gil::at_c<0>(C2::_pixel) != 1);
    111112
    112113        // Test swap if both are mutable and if their value type is the same
    113114        // (We know the second one is mutable)
     
    313314    bgr8_pixel_t bgr8(rgb8);
    314315    error_if(bgr8[0] == rgb8[0]);
    315316    error_if(dynamic_at_c(bgr8,0) == dynamic_at_c(rgb8,0));
    316     error_if(at_c<0>(bgr8) == at_c<0>(rgb8));
     317    error_if(gil::at_c<0>(bgr8) == gil::at_c<0>(rgb8));
    317318    error_if(semantic_at_c<0>(bgr8) != semantic_at_c<0>(rgb8));
    318319    error_if(get_color(bgr8,blue_t()) != get_color(rgb8,blue_t()));
    319320