Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58301 - in branches/release/boost/gil: . extension/dynamic_image extension/io
From: chhenning_at_[hidden]
Date: 2009-12-11 16:41:00


Author: chhenning
Date: 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
New Revision: 58301
URL: http://svn.boost.org/trac/boost/changeset/58301

Log:
Updated gil release from boost trunk.
Text files modified:
   branches/release/boost/gil/algorithm.hpp | 4 ++--
   branches/release/boost/gil/bit_aligned_pixel_reference.hpp | 2 +-
   branches/release/boost/gil/channel_algorithm.hpp | 4 ++--
   branches/release/boost/gil/color_base.hpp | 12 ++++++------
   branches/release/boost/gil/color_base_algorithm.hpp | 4 ++--
   branches/release/boost/gil/deprecated.hpp | 2 ++
   branches/release/boost/gil/device_n.hpp | 4 +++-
   branches/release/boost/gil/extension/dynamic_image/apply_operation_base.hpp | 23 +++++++++++++++++++++++
   branches/release/boost/gil/extension/dynamic_image/variant.hpp | 3 +++
   branches/release/boost/gil/extension/io/dynamic_io.hpp | 1 +
   branches/release/boost/gil/extension/io/jpeg_io_private.hpp | 1 +
   branches/release/boost/gil/extension/io/png_io_private.hpp | 1 +
   branches/release/boost/gil/gil_concept.hpp | 2 +-
   branches/release/boost/gil/image_view_factory.hpp | 8 ++++----
   branches/release/boost/gil/packed_pixel.hpp | 8 ++++----
   branches/release/boost/gil/pixel.hpp | 8 ++++----
   branches/release/boost/gil/planar_pixel_iterator.hpp | 8 ++++----
   17 files changed, 64 insertions(+), 31 deletions(-)

Modified: branches/release/boost/gil/algorithm.hpp
==============================================================================
--- branches/release/boost/gil/algorithm.hpp (original)
+++ branches/release/boost/gil/algorithm.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -448,7 +448,7 @@
     }
 }
 template <typename It> GIL_FORCEINLINE
-void destruct_range_impl(It first, It last, mpl::false_) {}
+void destruct_range_impl(It, It, mpl::false_) {}
 
 template <typename It> GIL_FORCEINLINE
 void destruct_range(It first, It last) {
@@ -583,7 +583,7 @@
 }
 
 template <typename It> GIL_FORCEINLINE
-void default_construct_range_impl(It first, It last, mpl::false_) {}
+void default_construct_range_impl(It, It, mpl::false_) {}
 
 template <typename It> GIL_FORCEINLINE
 void default_construct_range(It first, It last) { default_construct_range_impl(first, last, typename is_pointer<It>::type()); }

Modified: branches/release/boost/gil/bit_aligned_pixel_reference.hpp
==============================================================================
--- branches/release/boost/gil/bit_aligned_pixel_reference.hpp (original)
+++ branches/release/boost/gil/bit_aligned_pixel_reference.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -145,7 +145,7 @@
 
     // Construct from another compatible pixel type
     bit_aligned_pixel_reference(const bit_aligned_pixel_reference& p) : _bit_range(p._bit_range) {}
- 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()) {
+ 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()) {
         check_compatible<packed_pixel<BF,CR,Layout> >();
     }
 

Modified: branches/release/boost/gil/channel_algorithm.hpp
==============================================================================
--- branches/release/boost/gil/channel_algorithm.hpp (original)
+++ branches/release/boost/gil/channel_algorithm.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -348,7 +348,7 @@
 /// \brief A unary function object converting between channel types
 template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
 struct channel_converter : public std::unary_function<SrcChannelV,DstChannelV> {
- DstChannelV operator()(SrcChannelV src) const {
+ DstChannelV operator()(const SrcChannelV& src) const {
         typedef detail::channel_convert_to_unsigned<SrcChannelV> to_unsigned;
         typedef detail::channel_convert_from_unsigned<DstChannelV> from_unsigned;
         typedef channel_converter_unsigned<typename to_unsigned::result_type, typename from_unsigned::argument_type> converter_unsigned;
@@ -359,7 +359,7 @@
 /// \ingroup ChannelConvertAlgorithm
 /// \brief Converting from one channel type to another.
 template <typename DstChannel, typename SrcChannel> // Model ChannelConcept (could be channel references)
-inline typename channel_traits<DstChannel>::value_type channel_convert(SrcChannel src) {
+inline typename channel_traits<DstChannel>::value_type channel_convert(const SrcChannel& src) {
     return channel_converter<typename channel_traits<SrcChannel>::value_type,
                              typename channel_traits<DstChannel>::value_type>()(src);
 }

Modified: branches/release/boost/gil/color_base.hpp
==============================================================================
--- branches/release/boost/gil/color_base.hpp (original)
+++ branches/release/boost/gil/color_base.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -155,15 +155,15 @@
     homogeneous_color_base(Element v0, Element v1, Element v2) : _v0(v0), _v1(v1), _v2(v2) {}
 
     template <typename E2, typename L2> homogeneous_color_base(const homogeneous_color_base<E2,L2,3>& c) :
- _v0(at_c<mapping_transform<Layout,L2,0>::value>(c)),
- _v1(at_c<mapping_transform<Layout,L2,1>::value>(c)),
- _v2(at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
+ _v0(gil::at_c<mapping_transform<Layout,L2,0>::value>(c)),
+ _v1(gil::at_c<mapping_transform<Layout,L2,1>::value>(c)),
+ _v2(gil::at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
 
     // Support for l-value reference proxy copy construction
     template <typename E2, typename L2> homogeneous_color_base( homogeneous_color_base<E2,L2,3>& c) :
- _v0(at_c<mapping_transform<Layout,L2,0>::value>(c)),
- _v1(at_c<mapping_transform<Layout,L2,1>::value>(c)),
- _v2(at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
+ _v0(gil::at_c<mapping_transform<Layout,L2,0>::value>(c)),
+ _v1(gil::at_c<mapping_transform<Layout,L2,1>::value>(c)),
+ _v2(gil::at_c<mapping_transform<Layout,L2,2>::value>(c)) {}
 
     // Support for planar_pixel_iterator construction and dereferencing
     template <typename P> homogeneous_color_base(P* p,bool) :

Modified: branches/release/boost/gil/color_base_algorithm.hpp
==============================================================================
--- branches/release/boost/gil/color_base_algorithm.hpp (original)
+++ branches/release/boost/gil/color_base_algorithm.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -101,7 +101,7 @@
 template <typename ColorBase, int K> struct kth_semantic_element_reference_type {
     BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c<typename ColorBase::layout_t::channel_mapping_t,K>::type::value));
     typedef typename kth_element_reference_type<ColorBase,semantic_index>::type type;
- static type get(ColorBase& cb) { return at_c<semantic_index>(cb); }
+ static type get(ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
 };
 
 /// \brief Specifies the return type of the constant semantic_at_c<K>(color_base);
@@ -109,7 +109,7 @@
 template <typename ColorBase, int K> struct kth_semantic_element_const_reference_type {
     BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c<typename ColorBase::layout_t::channel_mapping_t,K>::type::value));
     typedef typename kth_element_const_reference_type<ColorBase,semantic_index>::type type;
- static type get(const ColorBase& cb) { return at_c<semantic_index>(cb); }
+ static type get(const ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
 };
 
 /// \brief A mutable accessor to the K-th semantic element of a color base

Modified: branches/release/boost/gil/deprecated.hpp
==============================================================================
--- branches/release/boost/gil/deprecated.hpp (original)
+++ branches/release/boost/gil/deprecated.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -25,6 +25,8 @@
 ///
 ////////////////////////////////////////////////////////////////////////////////////////
 
+#include <cstddef>
+
 #define planar_ptr planar_pixel_iterator
 #define planar_ref planar_pixel_reference
 #define membased_2d_locator memory_based_2d_locator

Modified: branches/release/boost/gil/device_n.hpp
==============================================================================
--- branches/release/boost/gil/device_n.hpp (original)
+++ branches/release/boost/gil/device_n.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -18,11 +18,13 @@
 /// \brief Support for color space of N channels and variants
 /// \author Lubomir Bourdev and Hailin Jin \n
 /// Adobe Systems Incorporated
-/// \date 2005-2007 \n Last updated on October 10, 2007
+/// \date 2005-2009 \n Last updated on February 20, 2009
 ////////////////////////////////////////////////////////////////////////////////////////
 
 #include <cstddef>
 #include "gil_config.hpp"
+#include "utilities.hpp"
+#include "metafunctions.hpp"
 #include <boost/type_traits.hpp>
 #include <boost/mpl/range_c.hpp>
 #include <boost/mpl/vector_c.hpp>

Modified: branches/release/boost/gil/extension/dynamic_image/apply_operation_base.hpp
==============================================================================
--- branches/release/boost/gil/extension/dynamic_image/apply_operation_base.hpp (original)
+++ branches/release/boost/gil/extension/dynamic_image/apply_operation_base.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -69,6 +69,9 @@
 #define GIL_FWD_CASE(z, N, SUM) case N: return op(*gil_reinterpret_cast<typename mpl::deref<T##N>::type*>(&bits));
 #define GIL_FWD_CONST_CASE(z, N, SUM) case N: return op(*gil_reinterpret_cast_c<const typename mpl::deref<T##N>::type*>(&bits));
 
+#define GIL_FWD_CASE_WITH_INFO(z, N, SUM) case N: return op(*gil_reinterpret_cast<typename mpl::deref<T##N>::type*>(&bits), info);
+#define GIL_FWD_CONST_CASE_WITH_INFO(z, N, SUM) case N: return op(*gil_reinterpret_cast_c<const typename mpl::deref<T##N>::type*>(&bits), info);
+
 #define GIL_APPLY_FWD_OP(z, N, text) \
     template <> struct apply_operation_fwd_fn<BOOST_PP_ADD(N,1)> { \
         template <typename Types, typename Bits, typename UnaryOp> \
@@ -91,6 +94,26 @@
             } \
             throw; \
         } \
+ template <typename Types, typename Info, typename Bits, typename UnaryOp> \
+ typename UnaryOp::result_type apply(Bits& bits, std::size_t index, const Info& info, UnaryOp op) const { \
+ typedef typename mpl::begin<Types>::type \
+ BOOST_PP_REPEAT(N, GIL_FWD_TYPEDEFS, BOOST_PP_EMPTY) \
+ T##N; \
+ switch (index) { \
+ BOOST_PP_REPEAT(BOOST_PP_ADD(N,1), GIL_FWD_CASE_WITH_INFO, BOOST_PP_EMPTY) \
+ } \
+ throw; \
+ } \
+ template <typename Types, typename Bits, typename Info, typename UnaryOp> \
+ typename UnaryOp::result_type applyc(const Bits& bits, std::size_t index, const Info& info, UnaryOp op) const { \
+ typedef typename mpl::begin<Types>::type \
+ BOOST_PP_REPEAT(N, GIL_FWD_TYPEDEFS, BOOST_PP_EMPTY) \
+ T##N; \
+ switch (index) { \
+ BOOST_PP_REPEAT(BOOST_PP_ADD(N,1), GIL_FWD_CONST_CASE_WITH_INFO,BOOST_PP_EMPTY) \
+ } \
+ throw; \
+ } \
     };
 
 #define GIL_GENERATE_APPLY_FWD_OPS(N) BOOST_PP_REPEAT(N, GIL_APPLY_FWD_OP, BOOST_PP_EMPTY)

Modified: branches/release/boost/gil/extension/dynamic_image/variant.hpp
==============================================================================
--- branches/release/boost/gil/extension/dynamic_image/variant.hpp (original)
+++ branches/release/boost/gil/extension/dynamic_image/variant.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -119,6 +119,9 @@
 
     template <typename T> bool current_type_is() const { return type_id<T>()==_index; }
 
+ base_t bits() const { return _bits; }
+ std::size_t index() const { return _index; }
+
 private:
     template <typename T> static std::size_t type_id() { return detail::type_to_index<Types,T>::value; }
 

Modified: branches/release/boost/gil/extension/io/dynamic_io.hpp
==============================================================================
--- branches/release/boost/gil/extension/io/dynamic_io.hpp (original)
+++ branches/release/boost/gil/extension/io/dynamic_io.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -22,6 +22,7 @@
 #include <boost/mpl/at.hpp>
 #include <boost/mpl/size.hpp>
 #include "../../gil_config.hpp"
+#include "io_error.hpp"
 #include "../dynamic_image/any_image.hpp"
 
 namespace boost { namespace gil {

Modified: branches/release/boost/gil/extension/io/jpeg_io_private.hpp
==============================================================================
--- branches/release/boost/gil/extension/io/jpeg_io_private.hpp (original)
+++ branches/release/boost/gil/extension/io/jpeg_io_private.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -24,6 +24,7 @@
 #include <vector>
 #include "../../gil_all.hpp"
 #include "io_error.hpp"
+#include <jpeglib.h>
 
 namespace boost { namespace gil {
 

Modified: branches/release/boost/gil/extension/io/png_io_private.hpp
==============================================================================
--- branches/release/boost/gil/extension/io/png_io_private.hpp (original)
+++ branches/release/boost/gil/extension/io/png_io_private.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -23,6 +23,7 @@
 #include <boost/static_assert.hpp>
 #include "../../gil_all.hpp"
 #include "io_error.hpp"
+#include <png.h>
 
 namespace boost { namespace gil {
 

Modified: branches/release/boost/gil/gil_concept.hpp
==============================================================================
--- branches/release/boost/gil/gil_concept.hpp (original)
+++ branches/release/boost/gil/gil_concept.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -35,7 +35,7 @@
 template <typename T> struct channel_traits;
 template <typename P> struct is_pixel;
 template <typename dstT, typename srcT>
-typename channel_traits<dstT>::value_type channel_convert(srcT val);
+typename channel_traits<dstT>::value_type channel_convert(const srcT& val);
 template <typename T> class point2;
 template <std::size_t K, typename T> const T& axis_value(const point2<T>& p);
 template <std::size_t K, typename T> T& axis_value( point2<T>& p);

Modified: branches/release/boost/gil/image_view_factory.hpp
==============================================================================
--- branches/release/boost/gil/image_view_factory.hpp (original)
+++ branches/release/boost/gil/image_view_factory.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -102,7 +102,7 @@
     BOOST_STATIC_ASSERT((!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value));
     BOOST_STATIC_ASSERT((boost::is_pointer<typename HomogeneousView::x_iterator>::value));
 
- return &at_c<0>(view(0,0));
+ return &gil::at_c<0>(view(0,0));
 }
 
 /// \ingroup ImageViewConstructors
@@ -430,7 +430,7 @@
             typedef typename type::xy_locator locator_t;
             typedef typename type::x_iterator x_iterator_t;
             typedef typename iterator_adaptor_get_base<x_iterator_t>::type x_iterator_base_t;
- x_iterator_t sit(x_iterator_base_t(&at_c<K>(src(0,0))),src.pixels().pixel_size());
+ x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
             return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
         }
     };
@@ -444,7 +444,7 @@
         typedef typename view_type<channel_t, gray_layout_t, false, false, view_is_mutable<View>::value>::type type;
         static type make(const View& src) {
             typedef typename type::x_iterator x_iterator_t;
- return interleaved_view(src.width(),src.height(),(x_iterator_t)&at_c<K>(src(0,0)), src.pixels().row_size());
+ return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
         }
     };
 
@@ -494,7 +494,7 @@
         template <typename P> kth_channel_deref_fn(const kth_channel_deref_fn<K,P>&) {}
 
         result_type operator()(argument_type srcP) const {
- return result_type(at_c<K>(srcP));
+ return result_type(gil::at_c<K>(srcP));
         }
     };
 

Modified: branches/release/boost/gil/packed_pixel.hpp
==============================================================================
--- branches/release/boost/gil/packed_pixel.hpp (original)
+++ branches/release/boost/gil/packed_pixel.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -18,7 +18,7 @@
 /// \brief A model of a heterogeneous pixel whose channels are bit ranges. For example 16-bit RGB in '565' format
 /// \author Lubomir Bourdev and Hailin Jin \n
 /// Adobe Systems Incorporated
-/// \date 2005-2007 \n Last updated on September 28, 2006
+/// \date 2005-2009 \n Last updated on February 20, 2009
 ///
 ////////////////////////////////////////////////////////////////////////////////////////
 
@@ -81,15 +81,15 @@
     }
     packed_pixel(int chan0, int chan1, int chan2) : _bitfield(0) {
         BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==3));
- at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2;
+ gil::at_c<0>(*this)=chan0; gil::at_c<1>(*this)=chan1; gil::at_c<2>(*this)=chan2;
     }
     packed_pixel(int chan0, int chan1, int chan2, int chan3) : _bitfield(0) {
         BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==4));
- at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<2>(*this)=chan3;
+ gil::at_c<0>(*this)=chan0; gil::at_c<1>(*this)=chan1; gil::at_c<2>(*this)=chan2; gil::at_c<3>(*this)=chan3;
     }
     packed_pixel(int chan0, int chan1, int chan2, int chan3, int chan4) : _bitfield(0) {
         BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==5));
- at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<2>(*this)=chan3; at_c<3>(*this)=chan4;
+ gil::at_c<0>(*this)=chan0; gil::at_c<1>(*this)=chan1; gil::at_c<2>(*this)=chan2; gil::at_c<3>(*this)=chan3; gil::at_c<4>(*this)=chan4;
     }
 
     packed_pixel& operator=(const packed_pixel& p) { _bitfield=p._bitfield; return *this; }

Modified: branches/release/boost/gil/pixel.hpp
==============================================================================
--- branches/release/boost/gil/pixel.hpp (original)
+++ branches/release/boost/gil/pixel.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -143,11 +143,11 @@
 
 private:
     static void check_gray() { BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
- template <typename Channel> void assign(const Channel& chan, mpl::false_) { check_gray(); at_c<0>(*this)=chan; }
- template <typename Channel> bool equal (const Channel& chan, mpl::false_) const { check_gray(); return at_c<0>(*this)==chan; }
+ template <typename Channel> void assign(const Channel& chan, mpl::false_) { check_gray(); gil::at_c<0>(*this)=chan; }
+ template <typename Channel> bool equal (const Channel& chan, mpl::false_) const { check_gray(); return gil::at_c<0>(*this)==chan; }
 public:
- pixel& operator= (channel_t chan) { check_gray(); at_c<0>(*this)=chan; return *this; }
- bool operator==(channel_t chan) const { check_gray(); return at_c<0>(*this)==chan; }
+ pixel& operator= (channel_t chan) { check_gray(); gil::at_c<0>(*this)=chan; return *this; }
+ bool operator==(channel_t chan) const { check_gray(); return gil::at_c<0>(*this)==chan; }
 };
 
 /////////////////////////////

Modified: branches/release/boost/gil/planar_pixel_iterator.hpp
==============================================================================
--- branches/release/boost/gil/planar_pixel_iterator.hpp (original)
+++ branches/release/boost/gil/planar_pixel_iterator.hpp 2009-12-11 16:40:58 EST (Fri, 11 Dec 2009)
@@ -109,8 +109,8 @@
     reference operator->() const { return **this; }
 
     // PERFORMANCE_CHECK: Remove?
- bool operator< (const planar_pixel_iterator& ptr) const { return at_c<0>(*this)< at_c<0>(ptr); }
- bool operator!=(const planar_pixel_iterator& ptr) const { return at_c<0>(*this)!=at_c<0>(ptr); }
+ bool operator< (const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)< gil::at_c<0>(ptr); }
+ bool operator!=(const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)!=gil::at_c<0>(ptr); }
 private:
     friend class boost::iterator_core_access;
 
@@ -119,8 +119,8 @@
     void advance(ptrdiff_t d) { static_transform(*this,*this,std::bind2nd(detail::plus_asymmetric<ChannelPtr,ptrdiff_t>(),d)); }
     reference dereference() const { return this->template deref<reference>(); }
 
- ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return at_c<0>(it)-at_c<0>(*this); }
- bool equal(const planar_pixel_iterator& it) const { return at_c<0>(*this)==at_c<0>(it); }
+ ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); }
+ bool equal(const planar_pixel_iterator& it) const { return gil::at_c<0>(*this)==gil::at_c<0>(it); }
 };
 
 namespace detail {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk