diff --git a/html/_static/documentation_options.js b/html/_static/documentation_options.js index 4790c4d3c..2fa8c97fe 100644 --- a/html/_static/documentation_options.js +++ b/html/_static/documentation_options.js @@ -5,6 +5,7 @@ var DOCUMENTATION_OPTIONS = { COLLAPSE_INDEX: false, BUILDER: 'html', FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', NAVIGATION_WITH_KEYS: false diff --git a/html/_static/searchtools.js b/html/_static/searchtools.js index d11b33a78..ab5649965 100644 --- a/html/_static/searchtools.js +++ b/html/_static/searchtools.js @@ -251,6 +251,7 @@ var Search = { var item = results.pop(); var listItem = $('
  • '); var requestUrl = ""; + var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { // dirhtml builder var dirname = item[0] + '/'; @@ -260,13 +261,15 @@ var Search = { dirname = ''; } requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname; + linkUrl = requestUrl; } else { // normal html builders requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX; + linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX; } listItem.append($('').attr('href', - requestUrl + + linkUrl + highlightstring + item[2]).html(item[1])); if (item[3]) { listItem.append($(' (' + item[3] + ')')); diff --git a/html/design/basics.html b/html/design/basics.html index 634b722f4..9916b10c4 100644 --- a/html/design/basics.html +++ b/html/design/basics.html @@ -114,8 +114,8 @@ read the sections in order.

    \ No newline at end of file diff --git a/html/design/channel.html b/html/design/channel.html index 2a862ba82..814ef5ea2 100644 --- a/html/design/channel.html +++ b/html/design/channel.html @@ -263,8 +263,8 @@ channel-level algorithms that GIL provides:

    \ No newline at end of file diff --git a/html/design/color_base.html b/html/design/color_base.html index 8e41b9ffb..0ef79dd50 100644 --- a/html/design/color_base.html +++ b/html/design/color_base.html @@ -310,8 +310,8 @@ color base require that they all have the same color space.

    \ No newline at end of file diff --git a/html/design/color_space.html b/html/design/color_space.html index 35e5b6372..1a50c9da0 100644 --- a/html/design/color_space.html +++ b/html/design/color_space.html @@ -165,8 +165,8 @@ A color space and its associated mapping are often used together.

    \ No newline at end of file diff --git a/html/design/concepts.html b/html/design/concepts.html index a05a1b302..5a7460c21 100644 --- a/html/design/concepts.html +++ b/html/design/concepts.html @@ -143,8 +143,8 @@ Most of them are defined at the \ No newline at end of file diff --git a/html/design/conclusions.html b/html/design/conclusions.html index 7bfbcfdc3..5f590045b 100644 --- a/html/design/conclusions.html +++ b/html/design/conclusions.html @@ -121,8 +121,8 @@ raw pixel data from another image library.

    \ No newline at end of file diff --git a/html/design/dynamic_image.html b/html/design/dynamic_image.html index fe8852f35..911263800 100644 --- a/html/design/dynamic_image.html +++ b/html/design/dynamic_image.html @@ -334,8 +334,8 @@ uniformly as a collection and store them in the same container.

    \ No newline at end of file diff --git a/html/design/examples.html b/html/design/examples.html index b0b83c906..904374940 100644 --- a/html/design/examples.html +++ b/html/design/examples.html @@ -264,8 +264,8 @@ channel depth. They could be either planar or interleaved.

    \ No newline at end of file diff --git a/html/design/extending.html b/html/design/extending.html index e02f2300c..b5b0a9ffb 100644 --- a/html/design/extending.html +++ b/html/design/extending.html @@ -234,8 +234,8 @@ defines the Mandelbrot set.

    \ No newline at end of file diff --git a/html/design/image.html b/html/design/image.html index 515dc0a16..b55a7f83d 100644 --- a/html/design/image.html +++ b/html/design/image.html @@ -175,8 +175,8 @@ there are no padding bits at the end of rows of packed images.

    \ No newline at end of file diff --git a/html/design/image_view.html b/html/design/image_view.html index d4b4b825d..fdb617720 100644 --- a/html/design/image_view.html +++ b/html/design/image_view.html @@ -487,8 +487,8 @@ development and is not optimized for speed

    \ No newline at end of file diff --git a/html/design/index.html b/html/design/index.html index 04f035b41..f37c8bc57 100644 --- a/html/design/index.html +++ b/html/design/index.html @@ -102,8 +102,8 @@ structure and basic elements of the Generic Image Library (GIL).

    \ No newline at end of file diff --git a/html/design/metafunctions.html b/html/design/metafunctions.html index 5fd5fc500..038128257 100644 --- a/html/design/metafunctions.html +++ b/html/design/metafunctions.html @@ -302,8 +302,8 @@ is basic, but a color converted view or a virtual view is not.

    \ No newline at end of file diff --git a/html/design/pixel.html b/html/design/pixel.html index 253d11d0f..8c5e43330 100644 --- a/html/design/pixel.html +++ b/html/design/pixel.html @@ -348,8 +348,8 @@ different color spaces and channel types:

    \ No newline at end of file diff --git a/html/design/pixel_iterator.html b/html/design/pixel_iterator.html index 251473d5e..43e52a2e1 100644 --- a/html/design/pixel_iterator.html +++ b/html/design/pixel_iterator.html @@ -372,8 +372,8 @@ but not MemoryBased \ No newline at end of file diff --git a/html/design/pixel_locator.html b/html/design/pixel_locator.html index 70c54610b..068addb4b 100644 --- a/html/design/pixel_locator.html +++ b/html/design/pixel_locator.html @@ -358,8 +358,8 @@ using the x-iterators directly.

    \ No newline at end of file diff --git a/html/design/point.html b/html/design/point.html index dbb768634..b83bd0f4e 100644 --- a/html/design/point.html +++ b/html/design/point.html @@ -134,8 +134,8 @@ coordinate type.

    \ No newline at end of file diff --git a/html/design/technicalities.html b/html/design/technicalities.html index c3eb48e99..197ff5972 100644 --- a/html/design/technicalities.html +++ b/html/design/technicalities.html @@ -159,8 +159,8 @@ suggesting the above solution.

    \ No newline at end of file diff --git a/html/genindex.html b/html/genindex.html index 2e2db7fcb..67f3c684a 100644 --- a/html/genindex.html +++ b/html/genindex.html @@ -76,8 +76,8 @@ \ No newline at end of file diff --git a/html/image_processing/affine-region-detectors.html b/html/image_processing/affine-region-detectors.html index 2e9748d40..a4641af4d 100644 --- a/html/image_processing/affine-region-detectors.html +++ b/html/image_processing/affine-region-detectors.html @@ -162,8 +162,8 @@ detector.” In Alvey vision conference, vol. 15, no. 50, pp. 10-5244. \ No newline at end of file diff --git a/html/image_processing/basics.html b/html/image_processing/basics.html index 683ed8cde..fbe7936b8 100644 --- a/html/image_processing/basics.html +++ b/html/image_processing/basics.html @@ -123,8 +123,8 @@ gets sharper depending on it’s sigma value.

    \ No newline at end of file diff --git a/html/image_processing/index.html b/html/image_processing/index.html index 29679acea..a4c0f8782 100644 --- a/html/image_processing/index.html +++ b/html/image_processing/index.html @@ -99,8 +99,8 @@ features, structures and algorithms, for image processing and analysis.

    \ No newline at end of file diff --git a/html/image_processing/overview.html b/html/image_processing/overview.html index 4a8cadfb3..8ed2931fd 100644 --- a/html/image_processing/overview.html +++ b/html/image_processing/overview.html @@ -88,8 +88,8 @@ projects run in frame of the Google Summer of Code 2019:

    \ No newline at end of file diff --git a/html/index.html b/html/index.html index e5684ec92..d41c2492b 100644 --- a/html/index.html +++ b/html/index.html @@ -178,8 +178,8 @@ Blurring images (requires the optional Numeric extension)

    \ No newline at end of file diff --git a/html/installation.html b/html/installation.html index 82259dd34..f6b59bd6e 100644 --- a/html/installation.html +++ b/html/installation.html @@ -90,8 +90,8 @@ where to find Boost and GIL headers should be sufficient for most projects.

    \ No newline at end of file diff --git a/html/io.html b/html/io.html index 5d09fa360..d6a89e45e 100644 --- a/html/io.html +++ b/html/io.html @@ -736,8 +736,8 @@ to enable the tests:

    \ No newline at end of file diff --git a/html/naming.html b/html/naming.html index a77816951..e7db253aa 100644 --- a/html/naming.html +++ b/html/naming.html @@ -114,8 +114,8 @@ pixel.

    \ No newline at end of file diff --git a/html/numeric.html b/html/numeric.html index f7c8faa71..cbb583dd0 100644 --- a/html/numeric.html +++ b/html/numeric.html @@ -79,8 +79,8 @@ \ No newline at end of file diff --git a/html/objects.inv b/html/objects.inv index 329b8062d..11671adb0 100644 Binary files a/html/objects.inv and b/html/objects.inv differ diff --git a/html/reference/algorithm_8hpp_source.html b/html/reference/algorithm_8hpp_source.html index 4dbf124e5..be1db831d 100644 --- a/html/reference/algorithm_8hpp_source.html +++ b/html/reference/algorithm_8hpp_source.html @@ -52,7 +52,7 @@
    algorithm.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_ALGORITHM_HPP
    9 #define BOOST_GIL_ALGORITHM_HPP
    10 
    11 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
    12 #include <boost/gil/color_base_algorithm.hpp>
    13 #include <boost/gil/concepts.hpp>
    14 #include <boost/gil/image_view.hpp>
    15 #include <boost/gil/image_view_factory.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 #include <boost/gil/detail/type_traits.hpp>
    18 
    19 #include <boost/assert.hpp>
    20 #include <boost/config.hpp>
    21 
    22 #include <algorithm>
    23 #include <cstddef>
    24 #include <cstring>
    25 #include <iterator>
    26 #include <memory>
    27 #include <type_traits>
    28 #include <typeinfo>
    29 
    30 namespace boost { namespace gil {
    31 
    32 //forward declarations
    33 template <typename ChannelPtr, typename ColorSpace>
    35 template <typename Iterator>
    37 template <typename StepIterator>
    39 
    40 // a tag denoting incompatible arguments
    41 struct error_t {};
    42 
    67 
    71 
    80 template <typename Derived, typename Result=void>
    82 {
    83  using result_type = Result;
    84 
    85  template <typename V1, typename V2> BOOST_FORCEINLINE
    86  result_type operator()(const std::pair<const V1*,const V2*>& p) const {
    87  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
    88  }
    89 
    90  template <typename V1, typename V2> BOOST_FORCEINLINE
    91  result_type operator()(const V1& v1, const V2& v2) const {
    92  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
    93  }
    94 
    95  result_type operator()(const error_t&) const { throw std::bad_cast(); }
    96 private:
    97 
    98  // dispatch from apply overload to a function with distinct name
    99  template <typename V1, typename V2>
    100  BOOST_FORCEINLINE
    101  result_type apply(V1 const& v1, V2 const& v2, std::false_type) const
    102  {
    103  return ((const Derived*)this)->apply_incompatible(v1, v2);
    104  }
    105 
    106  // dispatch from apply overload to a function with distinct name
    107  template <typename V1, typename V2>
    108  BOOST_FORCEINLINE
    109  result_type apply(V1 const& v1, V2 const& v2, std::true_type) const
    110  {
    111  return ((const Derived*)this)->apply_compatible(v1, v2);
    112  }
    113 
    114  // function with distinct name - it can be overloaded by subclasses
    115  template <typename V1, typename V2>
    116  BOOST_FORCEINLINE
    117  result_type apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const
    118  {
    119  throw std::bad_cast();
    120  }
    121 };
    122 
    123 }} // namespace boost::gil
    124 
    126 // std::copy and gil::copy_pixels
    128 
    132 
    133 namespace std {
    134 
    137 template<typename T, typename CS>
    138 BOOST_FORCEINLINE
    139 auto copy(
    144 {
    145  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
    146  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
    147 }
    148 
    151 template<typename T, typename CS>
    152 BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
    155  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
    156 }
    157 } // namespace std
    158 
    159 namespace boost { namespace gil {
    160 namespace detail {
    161 template <typename I, typename O> struct copy_fn {
    162  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
    163 };
    164 } // namespace detail
    165 } } // namespace boost::gil
    166 
    167 namespace std {
    170 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
    172  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
    173  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
    174  return dst+(last-first);
    175 }
    176 } // namespace std
    177 
    178 namespace boost { namespace gil {
    179 namespace detail {
    182 template <typename I, typename O>
    183 struct copier_n {
    184  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
    185 };
    186 
    188 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
    189 struct copier_n<iterator_from_2d<IL>,O> {
    190  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
    191  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
    192  gil_function_requires<PixelLocatorConcept<IL>>();
    193  gil_function_requires<MutablePixelIteratorConcept<O>>();
    194  while (n>0) {
    195  diff_t l=src.width()-src.x_pos();
    196  diff_t numToCopy=(n<l ? n:l);
    197  detail::copy_n(src.x(), numToCopy, dst);
    198  dst+=numToCopy;
    199  src+=numToCopy;
    200  n-=numToCopy;
    201  }
    202  }
    203 };
    204 
    206 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
    207 struct copier_n<I,iterator_from_2d<OL>> {
    208  using diff_t = typename std::iterator_traits<I>::difference_type;
    209  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
    210  gil_function_requires<PixelIteratorConcept<I>>();
    211  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    212  while (n>0) {
    213  diff_t l=dst.width()-dst.x_pos();
    214  diff_t numToCopy=(n<l ? n:l);
    215  detail::copy_n(src, numToCopy, dst.x());
    216  dst+=numToCopy;
    217  src+=numToCopy;
    218  n-=numToCopy;
    219  }
    220  }
    221 };
    222 
    224 template <typename IL, typename OL>
    226  using diff_t = typename iterator_from_2d<IL>::difference_type;
    227  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
    228  gil_function_requires<PixelLocatorConcept<IL>>();
    229  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    230  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
    231  while(n-->0) {
    232  *dst++=*src++;
    233  }
    234  }
    235  while (n>0) {
    236  diff_t l=dst.width()-dst.x_pos();
    237  diff_t numToCopy=(n<l ? n : l);
    238  detail::copy_n(src.x(), numToCopy, dst.x());
    239  dst+=numToCopy;
    240  src+=numToCopy;
    241  n-=numToCopy;
    242  }
    243  }
    244 };
    245 
    246 template <typename SrcIterator, typename DstIterator>
    247 BOOST_FORCEINLINE DstIterator copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) {
    248  using src_x_iterator = typename SrcIterator::x_iterator;
    249  using dst_x_iterator = typename DstIterator::x_iterator;
    250 
    251  typename SrcIterator::difference_type n = last - first;
    252 
    253  if (first.is_1d_traversable()) {
    254  if (dst.is_1d_traversable())
    255  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
    256  else
    257  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
    258  } else {
    259  if (dst.is_1d_traversable())
    260  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
    261  else
    262  copier_n<SrcIterator,DstIterator>()(first,n,dst);
    263  }
    264  return dst+n;
    265 }
    266 } // namespace detail
    267 } } // namespace boost::gil
    268 
    269 namespace std {
    272 template <typename IL, typename OL>
    274  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
    275 }
    276 } // namespace std
    277 
    278 namespace boost { namespace gil {
    281 template <typename View1, typename View2> BOOST_FORCEINLINE
    282 void copy_pixels(const View1& src, const View2& dst)
    283 {
    284  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    285  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
    286 }
    287 
    289 // copy_and_convert_pixels
    291 
    297 
    298 namespace detail {
    299 template <typename CC>
    300 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
    301 {
    302 private:
    303  CC _cc;
    304 public:
    305  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
    306  copy_and_convert_pixels_fn() {}
    307  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
    308  // when the two color spaces are incompatible, a color conversion is performed
    309  template <typename V1, typename V2> BOOST_FORCEINLINE
    310  result_type apply_incompatible(const V1& src, const V2& dst) const {
    311  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
    312  }
    313 
    314  // If the two color spaces are compatible, copy_and_convert is just copy
    315  template <typename V1, typename V2> BOOST_FORCEINLINE
    316  result_type apply_compatible(const V1& src, const V2& dst) const {
    317  copy_pixels(src,dst);
    318  }
    319 };
    320 } // namespace detail
    321 
    323 template <typename V1, typename V2,typename CC>
    324 BOOST_FORCEINLINE
    325 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
    326  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
    327  ccp(src,dst);
    328 }
    329 
    331 
    333 template <typename View1, typename View2>
    334 BOOST_FORCEINLINE
    335 void copy_and_convert_pixels(const View1& src, const View2& dst) {
    336  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
    337  ccp(src,dst);
    338 }
    339 } } // namespace boost::gil
    340 
    342 // std::fill and gil::fill_pixels
    344 
    348 
    349 namespace std {
    358 template <typename IL, typename V>
    360  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
    361  if (first.is_1d_traversable()) {
    362  std::fill(first.x(), last.x(), val);
    363  } else {
    364  // fill row by row
    365  std::ptrdiff_t n=last-first;
    366  while (n>0) {
    367  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
    368  std::fill_n(first.x(), numToDo, val);
    369  first+=numToDo;
    370  n-=numToDo;
    371  }
    372  }
    373 }
    374 } // namespace std
    375 
    376 namespace boost { namespace gil {
    377 
    378 namespace detail {
    379 
    381 struct std_fill_t {
    382  template <typename It, typename P>
    383  void operator()(It first, It last, const P& p_in) {
    384  std::fill(first,last,p_in);
    385  }
    386 };
    387 
    389 template <typename It, typename P>
    390 BOOST_FORCEINLINE
    391 void fill_aux(It first, It last, P const& p, std::true_type)
    392 {
    393  static_for_each(first, last, p, std_fill_t());
    394 }
    395 
    397 template <typename It, typename P>
    398 BOOST_FORCEINLINE
    399 void fill_aux(It first, It last, P const& p, std::false_type)
    400 {
    401  std::fill(first, last, p);
    402 }
    403 
    404 } // namespace detail
    405 
    408 template <typename View, typename Value>
    409 BOOST_FORCEINLINE
    410 void fill_pixels(View const& view, Value const& value)
    411 {
    412  if (view.is_1d_traversable())
    413  {
    414  detail::fill_aux(
    415  view.begin().x(), view.end().x(), value, is_planar<View>());
    416  }
    417  else
    418  {
    419  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    420  detail::fill_aux(
    421  view.row_begin(y), view.row_end(y), value, is_planar<View>());
    422  }
    423 }
    424 
    426 // destruct_pixels
    428 
    432 
    433 namespace detail {
    434 template <typename Iterator>
    435 BOOST_FORCEINLINE
    436 void destruct_range_impl(Iterator first, Iterator last,
    437  typename std::enable_if
    438  <
    439  mp11::mp_and
    440  <
    441  std::is_pointer<Iterator>,
    442  mp11::mp_not
    443  <
    444  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    445  >
    446  >::value
    447  >::type* /*ptr*/ = 0)
    448 {
    449  while (first != last)
    450  {
    451  first->~value_t();
    452  ++first;
    453  }
    454 }
    455 
    456 template <typename Iterator>
    457 BOOST_FORCEINLINE
    458 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
    459  typename std::enable_if
    460  <
    461  mp11::mp_or
    462  <
    463  mp11::mp_not<std::is_pointer<Iterator>>,
    464  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    465  >::value
    466  >::type* /* ptr */ = nullptr)
    467 {
    468 }
    469 
    470 template <typename Iterator>
    471 BOOST_FORCEINLINE
    472 void destruct_range(Iterator first, Iterator last)
    473 {
    474  destruct_range_impl(first, last);
    475 }
    476 
    477 struct std_destruct_t
    478 {
    479  template <typename Iterator>
    480  void operator()(Iterator first, Iterator last) const
    481  {
    482  destruct_range(first,last);
    483  }
    484 };
    485 
    487 template <typename It>
    488 BOOST_FORCEINLINE
    489 void destruct_aux(It first, It last, std::true_type)
    490 {
    491  static_for_each(first,last,std_destruct_t());
    492 }
    493 
    495 template <typename It>
    496 BOOST_FORCEINLINE
    497 void destruct_aux(It first, It last, std::false_type)
    498 {
    499  destruct_range(first,last);
    500 }
    501 
    502 } // namespace detail
    503 
    506 template <typename View>
    507 BOOST_FORCEINLINE
    508 void destruct_pixels(View const& view)
    509 {
    510  if (view.is_1d_traversable())
    511  {
    512  detail::destruct_aux(
    513  view.begin().x(), view.end().x(), is_planar<View>());
    514  }
    515  else
    516  {
    517  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    518  detail::destruct_aux(
    519  view.row_begin(y), view.row_end(y), is_planar<View>());
    520  }
    521 }
    522 
    524 // uninitialized_fill_pixels
    526 
    530 
    531 namespace detail {
    532 
    535 template <typename It, typename P>
    536 BOOST_FORCEINLINE
    537 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
    538 {
    539  int channel = 0;
    540  try
    541  {
    542  using pixel_t = typename std::iterator_traits<It>::value_type;
    543  while (channel < num_channels<pixel_t>::value)
    544  {
    545  std::uninitialized_fill(
    546  dynamic_at_c(first,channel),
    547  dynamic_at_c(last,channel),
    548  dynamic_at_c(p,channel));
    549 
    550  ++channel;
    551  }
    552  }
    553  catch (...)
    554  {
    555  for (int c = 0; c < channel; ++c)
    556  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    557  throw;
    558  }
    559 }
    560 
    563 template <typename It, typename P>
    564 BOOST_FORCEINLINE
    565 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
    566 {
    567  std::uninitialized_fill(first,last,p);
    568 }
    569 
    570 } // namespace detail
    571 
    576 template <typename View, typename Value>
    577 void uninitialized_fill_pixels(const View& view, const Value& val) {
    578  if (view.is_1d_traversable())
    579  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
    580  val,is_planar<View>());
    581  else {
    582  typename View::y_coord_t y = 0;
    583  try {
    584  for (y=0; y<view.height(); ++y)
    585  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
    586  val,is_planar<View>());
    587  } catch(...) {
    588  for (typename View::y_coord_t y0=0; y0<y; ++y0)
    589  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
    590  throw;
    591  }
    592  }
    593 }
    594 
    596 // default_construct_pixels
    598 
    602 
    603 namespace detail {
    604 template <typename It> BOOST_FORCEINLINE
    605 void default_construct_range_impl(It first, It last, std::true_type)
    606 {
    607  It first1 = first;
    608  try
    609  {
    610  using value_t = typename std::iterator_traits<It>::value_type;
    611  while (first != last)
    612  {
    613  new (first) value_t();
    614  ++first;
    615  }
    616  }
    617  catch (...)
    618  {
    619  destruct_range(first1, first);
    620  throw;
    621  }
    622 }
    623 
    624 template <typename It>
    625 BOOST_FORCEINLINE
    626 void default_construct_range_impl(It, It, std::false_type) {}
    627 
    628 template <typename It>
    629 BOOST_FORCEINLINE
    630 void default_construct_range(It first, It last)
    631 {
    632  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
    633 }
    634 
    636 template <typename It>
    637 BOOST_FORCEINLINE
    638 void default_construct_aux(It first, It last, std::true_type)
    639 {
    640  int channel = 0;
    641  try
    642  {
    643  using pixel_t = typename std::iterator_traits<It>::value_type;
    644  while (channel < num_channels<pixel_t>::value)
    645  {
    646  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
    647  ++channel;
    648  }
    649  }
    650  catch (...)
    651  {
    652  for (int c = 0; c < channel; ++c)
    653  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    654  throw;
    655  }
    656 }
    657 
    659 template <typename It>
    660 BOOST_FORCEINLINE
    661 void default_construct_aux(It first, It last, std::false_type)
    662 {
    663  default_construct_range(first, last);
    664 }
    665 
    666 template <typename View, bool IsPlanar>
    667 struct has_trivial_pixel_constructor
    668  : detail::is_trivially_default_constructible<typename View::value_type>
    669 {};
    670 
    671 template <typename View>
    672 struct has_trivial_pixel_constructor<View, true>
    673  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
    674 {};
    675 
    676 template<typename View, bool IsTriviallyConstructible>
    677 BOOST_FORCEINLINE
    678 void default_construct_pixels_impl(
    679  View const& view,
    680  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
    681 {
    682  if (view.is_1d_traversable())
    683  {
    684  detail::default_construct_aux(
    685  view.begin().x(), view.end().x(), is_planar<View>());
    686  }
    687  else
    688  {
    689  typename View::y_coord_t y = 0;
    690  try
    691  {
    692  for( y = 0; y < view.height(); ++y )
    693  detail::default_construct_aux(
    694  view.row_begin(y), view.row_end(y), is_planar<View>());
    695  }
    696  catch(...)
    697  {
    698  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
    699  detail::destruct_aux(
    700  view.row_begin(y0), view.row_end(y0), is_planar<View>());
    701 
    702  throw;
    703  }
    704  }
    705 }
    706 
    707 } // namespace detail
    708 
    713 template <typename View>
    715 {
    716  detail::default_construct_pixels_impl
    717  <
    718  View,
    719  detail::has_trivial_pixel_constructor
    720  <
    721  View,
    722  is_planar<View>::value
    723  >::value
    724  >(view);
    725 }
    726 
    728 // uninitialized_copy_pixels
    730 
    734 
    735 namespace detail {
    736 
    738 template <typename It1, typename It2>
    739 BOOST_FORCEINLINE
    740 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::true_type)
    741 {
    742  int channel=0;
    743  try {
    744  using pixel_t = typename std::iterator_traits<It1>::value_type;
    745  while (channel < num_channels<pixel_t>::value)
    746  {
    747  std::uninitialized_copy(
    748  dynamic_at_c(first1, channel),
    749  dynamic_at_c(last1, channel),
    750  dynamic_at_c(first2, channel));
    751  ++channel;
    752  }
    753  }
    754  catch (...)
    755  {
    756  It2 last2 = first2;
    757  std::advance(last2, std::distance(first1, last1));
    758  for (int c = 0; c < channel; ++c)
    759  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
    760  throw;
    761  }
    762 }
    763 
    765 template <typename It1, typename It2>
    766 BOOST_FORCEINLINE
    767 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::false_type)
    768 {
    769  std::uninitialized_copy(first1, last1, first2);
    770 }
    771 } // namespace detail
    772 
    777 template <typename View1, typename View2>
    778 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
    779 {
    780  using is_planar = std::integral_constant<bool, is_planar<View1>::value && is_planar<View2>::value>;
    781  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
    782 
    783  if (view1.is_1d_traversable() && view2.is_1d_traversable())
    784  {
    785  detail::uninitialized_copy_aux(
    786  view1.begin().x(), view1.end().x(), view2.begin().x(), is_planar());
    787  }
    788  else
    789  {
    790  typename View1::y_coord_t y = 0;
    791  try
    792  {
    793  for (y = 0; y < view1.height(); ++y)
    794  detail::uninitialized_copy_aux(
    795  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), is_planar());
    796  }
    797  catch(...)
    798  {
    799  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
    800  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar());
    801  throw;
    802  }
    803  }
    804 }
    805 
    807 // for_each_pixel
    809 
    818 
    820 template <typename View, typename F>
    821 F for_each_pixel(View const& view, F fun)
    822 {
    823  if (view.is_1d_traversable())
    824  {
    825  return std::for_each(view.begin().x(), view.end().x(), fun);
    826  }
    827  else
    828  {
    829  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    830  std::for_each(view.row_begin(y), view.row_end(y), fun);
    831  return fun;
    832  }
    833 }
    834 
    838 
    840 template <typename View, typename F>
    841 F for_each_pixel_position(View const& view, F fun)
    842 {
    843  typename View::xy_locator loc = view.xy_at(0, 0);
    844  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    845  {
    846  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
    847  fun(loc);
    848  loc.x() -= view.width(); ++loc.y();
    849  }
    850  return fun;
    851 }
    852 
    854 // generate_pixels
    856 
    860 
    863 template <typename View, typename F>
    864 void generate_pixels(View const& view, F fun)
    865 {
    866  if (view.is_1d_traversable())
    867  {
    868  std::generate(view.begin().x(), view.end().x(), fun);
    869  }
    870  else
    871  {
    872  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    873  std::generate(view.row_begin(y), view.row_end(y), fun);
    874  }
    875 }
    876 
    878 // std::equal and gil::equal_pixels for GIL constructs
    880 
    884 
    885 template <typename I1, typename I2>
    886 BOOST_FORCEINLINE
    887 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
    888 
    889 namespace detail {
    890 
    891 template <typename I1, typename I2>
    892 struct equal_n_fn
    893 {
    894  BOOST_FORCEINLINE
    895  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
    896  {
    897  return std::equal(i1, i1 + n, i2);
    898  }
    899 };
    900 
    903 template<typename T, typename CS>
    904 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    905 {
    906  BOOST_FORCEINLINE
    907  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
    908  {
    909  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
    910  }
    911 };
    912 
    913 template<typename T, typename CS>
    914 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
    915  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    916 {};
    917 
    921 template<typename IC, typename CS>
    922 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
    923 {
    924  BOOST_FORCEINLINE
    925  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
    926  {
    927  // FIXME: ptrdiff_t vs size_t
    928  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
    929  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
    930  {
    931  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
    932  return false;
    933  }
    934  return true;
    935  }
    936 };
    937 
    941 template <typename Loc, typename It>
    942 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
    943 {
    944  BOOST_FORCEINLINE
    945  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
    946  {
    947  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    948  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    949  while (n > 0)
    950  {
    951  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
    952  if (!equal_n(i1.x(), num, i2))
    953  return false;
    954  i1 += num;
    955  i2 += num;
    956  n -= num;
    957  }
    958  return true;
    959  }
    960 };
    961 
    965 template <typename It, typename Loc>
    966 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
    967 {
    968  BOOST_FORCEINLINE
    969  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
    970  {
    971  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    972  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    973  while (n > 0)
    974  {
    975  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
    976  if (!equal_n(i1, num, i2.x()))
    977  return false;
    978  i1 += num;
    979  i2 += num;
    980  n -= num;
    981  }
    982  return true;
    983  }
    984 };
    985 
    987 template <typename Loc1, typename Loc2>
    989  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
    990  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    991  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    992  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
    993  while(n-->0) {
    994  if (*i1++!=*i2++) return false;
    995  }
    996  }
    997  while (n>0) {
    998  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
    999  if (!equal_n(i1.x(), num, i2.x()))
    1000  return false;
    1001  i1+=num;
    1002  i2+=num;
    1003  n-=num;
    1004  }
    1005  return true;
    1006  }
    1007 };
    1008 } // namespace detail
    1009 
    1010 template <typename I1, typename I2> BOOST_FORCEINLINE
    1011 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
    1012  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
    1013 }
    1014 } } // namespace boost::gil
    1015 
    1016 namespace std {
    1028 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
    1030  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    1031  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    1032  std::ptrdiff_t n=last-first;
    1033  if (first.is_1d_traversable()) {
    1034  if (first2.is_1d_traversable())
    1035  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
    1036  else
    1037  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
    1038  } else {
    1039  if (first2.is_1d_traversable())
    1040  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
    1041  else
    1042  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
    1043  }
    1044 }
    1045 } // namespace std
    1046 
    1047 namespace boost { namespace gil {
    1050 template <typename View1, typename View2> BOOST_FORCEINLINE
    1051 bool equal_pixels(const View1& v1, const View2& v2) {
    1052  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
    1053  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
    1054 }
    1055 
    1061 
    1065 
    1068 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1069 F transform_pixels(const View1& src,const View2& dst, F fun) {
    1070  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1071  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1072  typename View1::x_iterator srcIt=src.row_begin(y);
    1073  typename View2::x_iterator dstIt=dst.row_begin(y);
    1074  for (std::ptrdiff_t x=0; x<src.width(); ++x)
    1075  dstIt[x]=fun(srcIt[x]);
    1076  }
    1077  return fun;
    1078 }
    1079 
    1082 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1083 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
    1084  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
    1085  typename View1::x_iterator srcIt1=src1.row_begin(y);
    1086  typename View2::x_iterator srcIt2=src2.row_begin(y);
    1087  typename View3::x_iterator dstIt=dst.row_begin(y);
    1088  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
    1089  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
    1090  }
    1091  return fun;
    1092 }
    1093 
    1097 
    1100 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1101 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
    1102  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1103  typename View1::xy_locator loc=src.xy_at(0,0);
    1104  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1105  typename View2::x_iterator dstIt=dst.row_begin(y);
    1106  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
    1107  dstIt[x]=fun(loc);
    1108  loc.x()-=src.width(); ++loc.y();
    1109  }
    1110  return fun;
    1111 }
    1112 
    1115 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1116 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
    1117  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
    1118  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
    1119  typename View1::xy_locator loc1=src1.xy_at(0,0);
    1120  typename View2::xy_locator loc2=src2.xy_at(0,0);
    1121  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
    1122  typename View3::x_iterator dstIt=dst.row_begin(y);
    1123  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
    1124  dstIt[x]=fun(loc1,loc2);
    1125  loc1.x()-=src1.width(); ++loc1.y();
    1126  loc2.x()-=src2.width(); ++loc2.y();
    1127  }
    1128  return fun;
    1129 }
    1130 } } // namespace boost::gil
    1131 
    1132 #endif
    Definition: algorithm.hpp:30
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_ALGORITHM_HPP
    9 #define BOOST_GIL_ALGORITHM_HPP
    10 
    11 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
    12 #include <boost/gil/color_base_algorithm.hpp>
    13 #include <boost/gil/concepts.hpp>
    14 #include <boost/gil/image_view.hpp>
    15 #include <boost/gil/image_view_factory.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 #include <boost/gil/detail/type_traits.hpp>
    18 
    19 #include <boost/assert.hpp>
    20 #include <boost/config.hpp>
    21 
    22 #include <algorithm>
    23 #include <cstddef>
    24 #include <cstring>
    25 #include <iterator>
    26 #include <memory>
    27 #include <type_traits>
    28 #include <typeinfo>
    29 
    30 namespace boost { namespace gil {
    31 
    32 //forward declarations
    33 template <typename ChannelPtr, typename ColorSpace>
    35 template <typename Iterator>
    37 template <typename StepIterator>
    39 
    40 // a tag denoting incompatible arguments
    41 struct error_t {};
    42 
    67 
    71 
    80 template <typename Derived, typename Result=void>
    82 {
    83  using result_type = Result;
    84 
    85  template <typename V1, typename V2> BOOST_FORCEINLINE
    86  result_type operator()(const std::pair<const V1*,const V2*>& p) const {
    87  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
    88  }
    89 
    90  template <typename V1, typename V2> BOOST_FORCEINLINE
    91  result_type operator()(const V1& v1, const V2& v2) const {
    92  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
    93  }
    94 
    95  result_type operator()(const error_t&) const { throw std::bad_cast(); }
    96 private:
    97 
    98  // dispatch from apply overload to a function with distinct name
    99  template <typename V1, typename V2>
    100  BOOST_FORCEINLINE
    101  result_type apply(V1 const& v1, V2 const& v2, std::false_type) const
    102  {
    103  return ((const Derived*)this)->apply_incompatible(v1, v2);
    104  }
    105 
    106  // dispatch from apply overload to a function with distinct name
    107  template <typename V1, typename V2>
    108  BOOST_FORCEINLINE
    109  result_type apply(V1 const& v1, V2 const& v2, std::true_type) const
    110  {
    111  return ((const Derived*)this)->apply_compatible(v1, v2);
    112  }
    113 
    114  // function with distinct name - it can be overloaded by subclasses
    115  template <typename V1, typename V2>
    116  BOOST_FORCEINLINE
    117  result_type apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const
    118  {
    119  throw std::bad_cast();
    120  }
    121 };
    122 
    123 }} // namespace boost::gil
    124 
    126 // std::copy and gil::copy_pixels
    128 
    132 
    133 namespace std {
    134 
    137 template<typename T, typename CS>
    138 BOOST_FORCEINLINE
    139 auto copy(
    144 {
    145  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
    146  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
    147 }
    148 
    151 template<typename T, typename CS>
    152 BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
    155  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
    156 }
    157 } // namespace std
    158 
    159 namespace boost { namespace gil {
    160 namespace detail {
    161 template <typename I, typename O> struct copy_fn {
    162  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
    163 };
    164 } // namespace detail
    165 } } // namespace boost::gil
    166 
    167 namespace std {
    170 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
    172  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
    173  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
    174  return dst+(last-first);
    175 }
    176 } // namespace std
    177 
    178 namespace boost { namespace gil {
    179 namespace detail {
    182 template <typename I, typename O>
    183 struct copier_n {
    184  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
    185 };
    186 
    188 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
    189 struct copier_n<iterator_from_2d<IL>,O> {
    190  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
    191  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
    192  gil_function_requires<PixelLocatorConcept<IL>>();
    193  gil_function_requires<MutablePixelIteratorConcept<O>>();
    194  while (n>0) {
    195  diff_t l=src.width()-src.x_pos();
    196  diff_t numToCopy=(n<l ? n:l);
    197  detail::copy_n(src.x(), numToCopy, dst);
    198  dst+=numToCopy;
    199  src+=numToCopy;
    200  n-=numToCopy;
    201  }
    202  }
    203 };
    204 
    206 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
    207 struct copier_n<I,iterator_from_2d<OL>> {
    208  using diff_t = typename std::iterator_traits<I>::difference_type;
    209  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
    210  gil_function_requires<PixelIteratorConcept<I>>();
    211  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    212  while (n>0) {
    213  diff_t l=dst.width()-dst.x_pos();
    214  diff_t numToCopy=(n<l ? n:l);
    215  detail::copy_n(src, numToCopy, dst.x());
    216  dst+=numToCopy;
    217  src+=numToCopy;
    218  n-=numToCopy;
    219  }
    220  }
    221 };
    222 
    224 template <typename IL, typename OL>
    226  using diff_t = typename iterator_from_2d<IL>::difference_type;
    227  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
    228  gil_function_requires<PixelLocatorConcept<IL>>();
    229  gil_function_requires<MutablePixelLocatorConcept<OL>>();
    230  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
    231  while(n-->0) {
    232  *dst++=*src++;
    233  }
    234  }
    235  while (n>0) {
    236  diff_t l=dst.width()-dst.x_pos();
    237  diff_t numToCopy=(n<l ? n : l);
    238  detail::copy_n(src.x(), numToCopy, dst.x());
    239  dst+=numToCopy;
    240  src+=numToCopy;
    241  n-=numToCopy;
    242  }
    243  }
    244 };
    245 
    246 template <typename SrcIterator, typename DstIterator>
    247 BOOST_FORCEINLINE DstIterator copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) {
    248  using src_x_iterator = typename SrcIterator::x_iterator;
    249  using dst_x_iterator = typename DstIterator::x_iterator;
    250 
    251  typename SrcIterator::difference_type n = last - first;
    252 
    253  if (first.is_1d_traversable()) {
    254  if (dst.is_1d_traversable())
    255  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
    256  else
    257  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
    258  } else {
    259  if (dst.is_1d_traversable())
    260  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
    261  else
    262  copier_n<SrcIterator,DstIterator>()(first,n,dst);
    263  }
    264  return dst+n;
    265 }
    266 } // namespace detail
    267 } } // namespace boost::gil
    268 
    269 namespace std {
    272 template <typename IL, typename OL>
    274  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
    275 }
    276 } // namespace std
    277 
    278 namespace boost { namespace gil {
    281 template <typename View1, typename View2> BOOST_FORCEINLINE
    282 void copy_pixels(const View1& src, const View2& dst)
    283 {
    284  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    285  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
    286 }
    287 
    289 // copy_and_convert_pixels
    291 
    297 
    298 namespace detail {
    299 template <typename CC>
    300 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
    301 {
    302 private:
    303  CC _cc;
    304 public:
    305  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
    306  copy_and_convert_pixels_fn() {}
    307  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
    308  // when the two color spaces are incompatible, a color conversion is performed
    309  template <typename V1, typename V2> BOOST_FORCEINLINE
    310  result_type apply_incompatible(const V1& src, const V2& dst) const {
    311  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
    312  }
    313 
    314  // If the two color spaces are compatible, copy_and_convert is just copy
    315  template <typename V1, typename V2> BOOST_FORCEINLINE
    316  result_type apply_compatible(const V1& src, const V2& dst) const {
    317  copy_pixels(src,dst);
    318  }
    319 };
    320 } // namespace detail
    321 
    323 template <typename V1, typename V2,typename CC>
    324 BOOST_FORCEINLINE
    325 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
    326  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
    327  ccp(src,dst);
    328 }
    329 
    331 
    333 template <typename View1, typename View2>
    334 BOOST_FORCEINLINE
    335 void copy_and_convert_pixels(const View1& src, const View2& dst) {
    336  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
    337  ccp(src,dst);
    338 }
    339 } } // namespace boost::gil
    340 
    342 // std::fill and gil::fill_pixels
    344 
    348 
    349 namespace std {
    358 template <typename IL, typename V>
    360  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
    361  if (first.is_1d_traversable()) {
    362  std::fill(first.x(), last.x(), val);
    363  } else {
    364  // fill row by row
    365  std::ptrdiff_t n=last-first;
    366  while (n>0) {
    367  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
    368  std::fill_n(first.x(), numToDo, val);
    369  first+=numToDo;
    370  n-=numToDo;
    371  }
    372  }
    373 }
    374 } // namespace std
    375 
    376 namespace boost { namespace gil {
    377 
    378 namespace detail {
    379 
    381 struct std_fill_t {
    382  template <typename It, typename P>
    383  void operator()(It first, It last, const P& p_in) {
    384  std::fill(first,last,p_in);
    385  }
    386 };
    387 
    389 template <typename It, typename P>
    390 BOOST_FORCEINLINE
    391 void fill_aux(It first, It last, P const& p, std::true_type)
    392 {
    393  static_for_each(first, last, p, std_fill_t());
    394 }
    395 
    397 template <typename It, typename P>
    398 BOOST_FORCEINLINE
    399 void fill_aux(It first, It last, P const& p, std::false_type)
    400 {
    401  std::fill(first, last, p);
    402 }
    403 
    404 } // namespace detail
    405 
    408 template <typename View, typename Value>
    409 BOOST_FORCEINLINE
    410 void fill_pixels(View const& view, Value const& value)
    411 {
    412  if (view.is_1d_traversable())
    413  {
    414  detail::fill_aux(
    415  view.begin().x(), view.end().x(), value, is_planar<View>());
    416  }
    417  else
    418  {
    419  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    420  detail::fill_aux(
    421  view.row_begin(y), view.row_end(y), value, is_planar<View>());
    422  }
    423 }
    424 
    426 // destruct_pixels
    428 
    432 
    433 namespace detail {
    434 template <typename Iterator>
    435 BOOST_FORCEINLINE
    436 void destruct_range_impl(Iterator first, Iterator last,
    437  typename std::enable_if
    438  <
    439  mp11::mp_and
    440  <
    441  std::is_pointer<Iterator>,
    442  mp11::mp_not
    443  <
    444  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    445  >
    446  >::value
    447  >::type* /*ptr*/ = 0)
    448 {
    449  while (first != last)
    450  {
    451  first->~value_t();
    452  ++first;
    453  }
    454 }
    455 
    456 template <typename Iterator>
    457 BOOST_FORCEINLINE
    458 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
    459  typename std::enable_if
    460  <
    461  mp11::mp_or
    462  <
    463  mp11::mp_not<std::is_pointer<Iterator>>,
    464  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
    465  >::value
    466  >::type* /* ptr */ = nullptr)
    467 {
    468 }
    469 
    470 template <typename Iterator>
    471 BOOST_FORCEINLINE
    472 void destruct_range(Iterator first, Iterator last)
    473 {
    474  destruct_range_impl(first, last);
    475 }
    476 
    477 struct std_destruct_t
    478 {
    479  template <typename Iterator>
    480  void operator()(Iterator first, Iterator last) const
    481  {
    482  destruct_range(first,last);
    483  }
    484 };
    485 
    487 template <typename It>
    488 BOOST_FORCEINLINE
    489 void destruct_aux(It first, It last, std::true_type)
    490 {
    491  static_for_each(first,last,std_destruct_t());
    492 }
    493 
    495 template <typename It>
    496 BOOST_FORCEINLINE
    497 void destruct_aux(It first, It last, std::false_type)
    498 {
    499  destruct_range(first,last);
    500 }
    501 
    502 } // namespace detail
    503 
    506 template <typename View>
    507 BOOST_FORCEINLINE
    508 void destruct_pixels(View const& view)
    509 {
    510  if (view.is_1d_traversable())
    511  {
    512  detail::destruct_aux(
    513  view.begin().x(), view.end().x(), is_planar<View>());
    514  }
    515  else
    516  {
    517  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    518  detail::destruct_aux(
    519  view.row_begin(y), view.row_end(y), is_planar<View>());
    520  }
    521 }
    522 
    524 // uninitialized_fill_pixels
    526 
    530 
    531 namespace detail {
    532 
    535 template <typename It, typename P>
    536 BOOST_FORCEINLINE
    537 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
    538 {
    539  std::size_t channel = 0;
    540  try
    541  {
    542  using pixel_t = typename std::iterator_traits<It>::value_type;
    543  while (channel < num_channels<pixel_t>::value)
    544  {
    545  std::uninitialized_fill(
    546  dynamic_at_c(first,channel),
    547  dynamic_at_c(last,channel),
    548  dynamic_at_c(p,channel));
    549 
    550  ++channel;
    551  }
    552  }
    553  catch (...)
    554  {
    555  for (std::size_t c = 0; c < channel; ++c)
    556  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    557  throw;
    558  }
    559 }
    560 
    563 template <typename It, typename P>
    564 BOOST_FORCEINLINE
    565 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
    566 {
    567  std::uninitialized_fill(first,last,p);
    568 }
    569 
    570 } // namespace detail
    571 
    576 template <typename View, typename Value>
    577 void uninitialized_fill_pixels(const View& view, const Value& val) {
    578  if (view.is_1d_traversable())
    579  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
    580  val,is_planar<View>());
    581  else {
    582  typename View::y_coord_t y = 0;
    583  try {
    584  for (y=0; y<view.height(); ++y)
    585  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
    586  val,is_planar<View>());
    587  } catch(...) {
    588  for (typename View::y_coord_t y0=0; y0<y; ++y0)
    589  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
    590  throw;
    591  }
    592  }
    593 }
    594 
    596 // default_construct_pixels
    598 
    602 
    603 namespace detail {
    604 template <typename It> BOOST_FORCEINLINE
    605 void default_construct_range_impl(It first, It last, std::true_type)
    606 {
    607  It first1 = first;
    608  try
    609  {
    610  using value_t = typename std::iterator_traits<It>::value_type;
    611  while (first != last)
    612  {
    613  new (first) value_t();
    614  ++first;
    615  }
    616  }
    617  catch (...)
    618  {
    619  destruct_range(first1, first);
    620  throw;
    621  }
    622 }
    623 
    624 template <typename It>
    625 BOOST_FORCEINLINE
    626 void default_construct_range_impl(It, It, std::false_type) {}
    627 
    628 template <typename It>
    629 BOOST_FORCEINLINE
    630 void default_construct_range(It first, It last)
    631 {
    632  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
    633 }
    634 
    636 template <typename It>
    637 BOOST_FORCEINLINE
    638 void default_construct_aux(It first, It last, std::true_type)
    639 {
    640  std::size_t channel = 0;
    641  try
    642  {
    643  using pixel_t = typename std::iterator_traits<It>::value_type;
    644  while (channel < num_channels<pixel_t>::value)
    645  {
    646  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
    647  ++channel;
    648  }
    649  }
    650  catch (...)
    651  {
    652  for (std::size_t c = 0; c < channel; ++c)
    653  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
    654  throw;
    655  }
    656 }
    657 
    659 template <typename It>
    660 BOOST_FORCEINLINE
    661 void default_construct_aux(It first, It last, std::false_type)
    662 {
    663  default_construct_range(first, last);
    664 }
    665 
    666 template <typename View, bool IsPlanar>
    667 struct has_trivial_pixel_constructor
    668  : detail::is_trivially_default_constructible<typename View::value_type>
    669 {};
    670 
    671 template <typename View>
    672 struct has_trivial_pixel_constructor<View, true>
    673  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
    674 {};
    675 
    676 template<typename View, bool IsTriviallyConstructible>
    677 BOOST_FORCEINLINE
    678 void default_construct_pixels_impl(
    679  View const& view,
    680  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
    681 {
    682  if (view.is_1d_traversable())
    683  {
    684  detail::default_construct_aux(
    685  view.begin().x(), view.end().x(), is_planar<View>());
    686  }
    687  else
    688  {
    689  typename View::y_coord_t y = 0;
    690  try
    691  {
    692  for( y = 0; y < view.height(); ++y )
    693  detail::default_construct_aux(
    694  view.row_begin(y), view.row_end(y), is_planar<View>());
    695  }
    696  catch(...)
    697  {
    698  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
    699  detail::destruct_aux(
    700  view.row_begin(y0), view.row_end(y0), is_planar<View>());
    701 
    702  throw;
    703  }
    704  }
    705 }
    706 
    707 } // namespace detail
    708 
    713 template <typename View>
    715 {
    716  detail::default_construct_pixels_impl
    717  <
    718  View,
    719  detail::has_trivial_pixel_constructor
    720  <
    721  View,
    722  is_planar<View>::value
    723  >::value
    724  >(view);
    725 }
    726 
    728 // uninitialized_copy_pixels
    730 
    734 
    735 namespace detail {
    736 
    738 template <typename It1, typename It2>
    739 BOOST_FORCEINLINE
    740 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::true_type)
    741 {
    742  std::size_t channel=0;
    743  try {
    744  using pixel_t = typename std::iterator_traits<It1>::value_type;
    745  while (channel < num_channels<pixel_t>::value)
    746  {
    747  std::uninitialized_copy(
    748  dynamic_at_c(first1, channel),
    749  dynamic_at_c(last1, channel),
    750  dynamic_at_c(first2, channel));
    751  ++channel;
    752  }
    753  }
    754  catch (...)
    755  {
    756  It2 last2 = first2;
    757  std::advance(last2, std::distance(first1, last1));
    758  for (std::size_t c = 0; c < channel; ++c)
    759  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
    760  throw;
    761  }
    762 }
    763 
    765 template <typename It1, typename It2>
    766 BOOST_FORCEINLINE
    767 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, std::false_type)
    768 {
    769  std::uninitialized_copy(first1, last1, first2);
    770 }
    771 } // namespace detail
    772 
    777 template <typename View1, typename View2>
    778 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
    779 {
    780  using is_planar = std::integral_constant<bool, is_planar<View1>::value && is_planar<View2>::value>;
    781  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
    782 
    783  if (view1.is_1d_traversable() && view2.is_1d_traversable())
    784  {
    785  detail::uninitialized_copy_aux(
    786  view1.begin().x(), view1.end().x(), view2.begin().x(), is_planar());
    787  }
    788  else
    789  {
    790  typename View1::y_coord_t y = 0;
    791  try
    792  {
    793  for (y = 0; y < view1.height(); ++y)
    794  detail::uninitialized_copy_aux(
    795  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), is_planar());
    796  }
    797  catch(...)
    798  {
    799  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
    800  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar());
    801  throw;
    802  }
    803  }
    804 }
    805 
    807 // for_each_pixel
    809 
    818 
    820 template <typename View, typename F>
    821 F for_each_pixel(View const& view, F fun)
    822 {
    823  if (view.is_1d_traversable())
    824  {
    825  return std::for_each(view.begin().x(), view.end().x(), fun);
    826  }
    827  else
    828  {
    829  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    830  std::for_each(view.row_begin(y), view.row_end(y), fun);
    831  return fun;
    832  }
    833 }
    834 
    838 
    840 template <typename View, typename F>
    841 F for_each_pixel_position(View const& view, F fun)
    842 {
    843  typename View::xy_locator loc = view.xy_at(0, 0);
    844  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    845  {
    846  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
    847  fun(loc);
    848  loc.x() -= view.width(); ++loc.y();
    849  }
    850  return fun;
    851 }
    852 
    854 // generate_pixels
    856 
    860 
    863 template <typename View, typename F>
    864 void generate_pixels(View const& view, F fun)
    865 {
    866  if (view.is_1d_traversable())
    867  {
    868  std::generate(view.begin().x(), view.end().x(), fun);
    869  }
    870  else
    871  {
    872  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
    873  std::generate(view.row_begin(y), view.row_end(y), fun);
    874  }
    875 }
    876 
    878 // std::equal and gil::equal_pixels for GIL constructs
    880 
    884 
    885 template <typename I1, typename I2>
    886 BOOST_FORCEINLINE
    887 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
    888 
    889 namespace detail {
    890 
    891 template <typename I1, typename I2>
    892 struct equal_n_fn
    893 {
    894  BOOST_FORCEINLINE
    895  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
    896  {
    897  return std::equal(i1, i1 + n, i2);
    898  }
    899 };
    900 
    903 template<typename T, typename CS>
    904 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    905 {
    906  BOOST_FORCEINLINE
    907  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
    908  {
    909  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
    910  }
    911 };
    912 
    913 template<typename T, typename CS>
    914 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
    915  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
    916 {};
    917 
    921 template<typename IC, typename CS>
    922 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
    923 {
    924  BOOST_FORCEINLINE
    925  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
    926  {
    927  // FIXME: ptrdiff_t vs size_t
    928  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
    929  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
    930  {
    931  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
    932  return false;
    933  }
    934  return true;
    935  }
    936 };
    937 
    941 template <typename Loc, typename It>
    942 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
    943 {
    944  BOOST_FORCEINLINE
    945  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
    946  {
    947  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    948  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    949  while (n > 0)
    950  {
    951  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
    952  if (!equal_n(i1.x(), num, i2))
    953  return false;
    954  i1 += num;
    955  i2 += num;
    956  n -= num;
    957  }
    958  return true;
    959  }
    960 };
    961 
    965 template <typename It, typename Loc>
    966 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
    967 {
    968  BOOST_FORCEINLINE
    969  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
    970  {
    971  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
    972  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
    973  while (n > 0)
    974  {
    975  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
    976  if (!equal_n(i1, num, i2.x()))
    977  return false;
    978  i1 += num;
    979  i2 += num;
    980  n -= num;
    981  }
    982  return true;
    983  }
    984 };
    985 
    987 template <typename Loc1, typename Loc2>
    989  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
    990  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    991  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    992  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
    993  while(n-->0) {
    994  if (*i1++!=*i2++) return false;
    995  }
    996  }
    997  while (n>0) {
    998  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
    999  if (!equal_n(i1.x(), num, i2.x()))
    1000  return false;
    1001  i1+=num;
    1002  i2+=num;
    1003  n-=num;
    1004  }
    1005  return true;
    1006  }
    1007 };
    1008 } // namespace detail
    1009 
    1010 template <typename I1, typename I2> BOOST_FORCEINLINE
    1011 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
    1012  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
    1013 }
    1014 } } // namespace boost::gil
    1015 
    1016 namespace std {
    1028 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
    1030  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
    1031  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
    1032  std::ptrdiff_t n=last-first;
    1033  if (first.is_1d_traversable()) {
    1034  if (first2.is_1d_traversable())
    1035  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
    1036  else
    1037  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
    1038  } else {
    1039  if (first2.is_1d_traversable())
    1040  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
    1041  else
    1042  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
    1043  }
    1044 }
    1045 } // namespace std
    1046 
    1047 namespace boost { namespace gil {
    1050 template <typename View1, typename View2> BOOST_FORCEINLINE
    1051 bool equal_pixels(const View1& v1, const View2& v2) {
    1052  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
    1053  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
    1054 }
    1055 
    1061 
    1065 
    1068 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1069 F transform_pixels(const View1& src,const View2& dst, F fun) {
    1070  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1071  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1072  typename View1::x_iterator srcIt=src.row_begin(y);
    1073  typename View2::x_iterator dstIt=dst.row_begin(y);
    1074  for (std::ptrdiff_t x=0; x<src.width(); ++x)
    1075  dstIt[x]=fun(srcIt[x]);
    1076  }
    1077  return fun;
    1078 }
    1079 
    1082 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1083 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
    1084  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
    1085  typename View1::x_iterator srcIt1=src1.row_begin(y);
    1086  typename View2::x_iterator srcIt2=src2.row_begin(y);
    1087  typename View3::x_iterator dstIt=dst.row_begin(y);
    1088  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
    1089  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
    1090  }
    1091  return fun;
    1092 }
    1093 
    1097 
    1100 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
    1101 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
    1102  BOOST_ASSERT(src.dimensions() == dst.dimensions());
    1103  typename View1::xy_locator loc=src.xy_at(0,0);
    1104  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
    1105  typename View2::x_iterator dstIt=dst.row_begin(y);
    1106  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
    1107  dstIt[x]=fun(loc);
    1108  loc.x()-=src.width(); ++loc.y();
    1109  }
    1110  return fun;
    1111 }
    1112 
    1115 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
    1116 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
    1117  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
    1118  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
    1119  typename View1::xy_locator loc1=src1.xy_at(0,0);
    1120  typename View2::xy_locator loc2=src2.xy_at(0,0);
    1121  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
    1122  typename View3::x_iterator dstIt=dst.row_begin(y);
    1123  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
    1124  dstIt[x]=fun(loc1,loc2);
    1125  loc1.x()-=src1.width(); ++loc1.y();
    1126  loc2.x()-=src2.width(); ++loc2.y();
    1127  }
    1128  return fun;
    1129 }
    1130 } } // namespace boost::gil
    1131 
    1132 #endif
    Definition: algorithm.hpp:30
    void default_construct_pixels(View const &view)
    Invokes the in-place default constructor on every pixel of the (uninitialized) view. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place default-constructed pixels.
    Definition: algorithm.hpp:714
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.
    Definition: metafunctions.hpp:23
    BOOST_FORCEINLINE F transform_pixels(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
    transform_pixels with two sources
    Definition: algorithm.hpp:1083
    @@ -67,16 +67,16 @@
    Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation.
    Definition: algorithm.hpp:38
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1051
    void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
    std::fill(I,I,V) with I being a iterator_from_2d
    Definition: algorithm.hpp:359
    -
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:521
    +
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    BOOST_FORCEINLINE boost::gil::iterator_from_2d< OL > copy1(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst)
    std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    Definition: algorithm.hpp:273
    void uninitialized_fill_pixels(const View &view, const Value &val)
    std::uninitialized_fill for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed pixels
    Definition: algorithm.hpp:577
    BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
    std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    Definition: algorithm.hpp:1029
    A generic binary operation on viewsUse this class as a convenience superclass when defining an operat...
    Definition: algorithm.hpp:81
    struct to do std::fill
    Definition: algorithm.hpp:381
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    BOOST_FORCEINLINE F transform_pixel_positions(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
    transform_pixel_positions with two sources
    Definition: algorithm.hpp:1116
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:290
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:295
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    MEMORY-BASED STEP ITERATOR.
    Definition: algorithm.hpp:36
    diff --git a/html/reference/any__image__view_8hpp_source.html b/html/reference/any__image__view_8hpp_source.html index eed958b7c..42a59d635 100644 --- a/html/reference/any__image__view_8hpp_source.html +++ b/html/reference/any__image__view_8hpp_source.html @@ -58,7 +58,7 @@
    BOOST_FORCEINLINE auto apply_operation(variant< Types > &arg, UnaryOp op)
    Invokes a generic mutable operation (represented as a unary function object) on a variant...
    Definition: apply_operation.hpp:21
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    diff --git a/html/reference/basic_8hpp_source.html b/html/reference/basic_8hpp_source.html index 0c02fae6d..5e38ed8c5 100644 --- a/html/reference/basic_8hpp_source.html +++ b/html/reference/basic_8hpp_source.html @@ -52,16 +52,16 @@
    basic.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_BASIC_HPP
    9 #define BOOST_GIL_CONCEPTS_BASIC_HPP
    10 
    11 #include <boost/config.hpp>
    12 
    13 #if defined(BOOST_CLANG)
    14 #pragma clang diagnostic push
    15 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    16 #pragma clang diagnostic ignored "-Wuninitialized"
    17 #endif
    18 
    19 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    20 #pragma GCC diagnostic push
    21 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    22 #pragma GCC diagnostic ignored "-Wuninitialized"
    23 #endif
    24 
    25 #include <boost/gil/concepts/concept_check.hpp>
    26 
    27 #include <type_traits>
    28 #include <utility> // std::swap
    29 
    30 namespace boost { namespace gil {
    31 
    41 template <typename T>
    43 {
    44  void constraints()
    45  {
    46  function_requires<boost::DefaultConstructibleConcept<T>>();
    47  }
    48 };
    49 
    60 template <typename T>
    62 {
    63  void constraints()
    64  {
    65  function_requires<boost::CopyConstructibleConcept<T>>();
    66  }
    67 };
    68 
    79 template <typename T>
    80 struct Assignable
    81 {
    82  void constraints()
    83  {
    84  function_requires<boost::AssignableConcept<T>>();
    85  }
    86 };
    87 
    98 template <typename T>
    100 {
    101  void constraints()
    102  {
    103  function_requires<boost::EqualityComparableConcept<T>>();
    104  }
    105 };
    106 
    116 template <typename T>
    117 struct Swappable
    118 {
    119  void constraints()
    120  {
    121  using std::swap;
    122  swap(x,y);
    123  }
    124  T x,y;
    125 };
    126 
    139 template <typename T>
    140 struct Regular
    141 {
    142  void constraints()
    143  {
    144  gil_function_requires< boost::DefaultConstructibleConcept<T>>();
    145  gil_function_requires< boost::CopyConstructibleConcept<T>>();
    146  gil_function_requires< boost::EqualityComparableConcept<T>>(); // ==, !=
    147  gil_function_requires< boost::AssignableConcept<T>>();
    148  gil_function_requires< Swappable<T>>();
    149  }
    150 };
    151 
    161 template <typename T>
    163 {
    164  void constraints()
    165  {
    166  using type = typename T::type;
    167  }
    168 };
    169 
    176 template <typename T, typename U>
    177 struct SameType
    178 {
    179  void constraints()
    180  {
    181  static_assert(std::is_same<T, U>::value, "");
    182  }
    183 };
    184 
    185 }} // namespace boost::gil
    186 
    187 #if defined(BOOST_CLANG)
    188 #pragma clang diagnostic pop
    189 #endif
    190 
    191 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    192 #pragma GCC diagnostic pop
    193 #endif
    194 
    195 #endif
    Concept of == and != comparability requirement.
    Definition: basic.hpp:99
    -
    Concept of types equivalence requirement.
    Definition: basic.hpp:177
    -
    Concept of copy construction requirement.
    Definition: basic.hpp:61
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_BASIC_HPP
    9 #define BOOST_GIL_CONCEPTS_BASIC_HPP
    10 
    11 #include <boost/config.hpp>
    12 
    13 #if defined(BOOST_CLANG)
    14 #pragma clang diagnostic push
    15 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    16 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    17 #pragma clang diagnostic ignored "-Wuninitialized"
    18 #endif
    19 
    20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    21 #pragma GCC diagnostic push
    22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    23 #pragma GCC diagnostic ignored "-Wuninitialized"
    24 #endif
    25 
    26 #include <boost/gil/concepts/concept_check.hpp>
    27 
    28 #include <type_traits>
    29 #include <utility> // std::swap
    30 
    31 namespace boost { namespace gil {
    32 
    42 template <typename T>
    44 {
    45  void constraints()
    46  {
    47  function_requires<boost::DefaultConstructibleConcept<T>>();
    48  }
    49 };
    50 
    61 template <typename T>
    63 {
    64  void constraints()
    65  {
    66  function_requires<boost::CopyConstructibleConcept<T>>();
    67  }
    68 };
    69 
    80 template <typename T>
    81 struct Assignable
    82 {
    83  void constraints()
    84  {
    85  function_requires<boost::AssignableConcept<T>>();
    86  }
    87 };
    88 
    99 template <typename T>
    101 {
    102  void constraints()
    103  {
    104  function_requires<boost::EqualityComparableConcept<T>>();
    105  }
    106 };
    107 
    117 template <typename T>
    118 struct Swappable
    119 {
    120  void constraints()
    121  {
    122  using std::swap;
    123  swap(x,y);
    124  }
    125  T x,y;
    126 };
    127 
    140 template <typename T>
    141 struct Regular
    142 {
    143  void constraints()
    144  {
    145  gil_function_requires< boost::DefaultConstructibleConcept<T>>();
    146  gil_function_requires< boost::CopyConstructibleConcept<T>>();
    147  gil_function_requires< boost::EqualityComparableConcept<T>>(); // ==, !=
    148  gil_function_requires< boost::AssignableConcept<T>>();
    149  gil_function_requires< Swappable<T>>();
    150  }
    151 };
    152 
    162 template <typename T>
    164 {
    165  void constraints()
    166  {
    167  using type = typename T::type;
    168  }
    169 };
    170 
    177 template <typename T, typename U>
    178 struct SameType
    179 {
    180  void constraints()
    181  {
    182  static_assert(std::is_same<T, U>::value, "");
    183  }
    184 };
    185 
    186 }} // namespace boost::gil
    187 
    188 #if defined(BOOST_CLANG)
    189 #pragma clang diagnostic pop
    190 #endif
    191 
    192 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    193 #pragma GCC diagnostic pop
    194 #endif
    195 
    196 #endif
    Concept of == and != comparability requirement.
    Definition: basic.hpp:100
    +
    Concept of types equivalence requirement.
    Definition: basic.hpp:178
    +
    Concept of copy construction requirement.
    Definition: basic.hpp:62
    Definition: algorithm.hpp:30
    -
    Concept of swap operation requirement.
    Definition: basic.hpp:117
    -
    Concept of default construction requirement.
    Definition: basic.hpp:42
    -
    Concept for type as metafunction requirement.
    Definition: basic.hpp:162
    -
    Concept of copy assignment requirement.
    Definition: basic.hpp:80
    +
    Concept of swap operation requirement.
    Definition: basic.hpp:118
    +
    Concept of default construction requirement.
    Definition: basic.hpp:43
    +
    Concept for type as metafunction requirement.
    Definition: basic.hpp:163
    +
    Concept of copy assignment requirement.
    Definition: basic.hpp:81
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Concept for type regularity requirement.
    Definition: basic.hpp:140
    +
    Concept for type regularity requirement.
    Definition: basic.hpp:141
    diff --git a/html/reference/classboost_1_1gil_1_1image-members.html b/html/reference/classboost_1_1gil_1_1image-members.html index 6c5bb1c7e..cde57a099 100644 --- a/html/reference/classboost_1_1gil_1_1image-members.html +++ b/html/reference/classboost_1_1gil_1_1image-members.html @@ -73,8 +73,10 @@ image(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline image(const image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline image(const image< P2, IP2, Alloc2 > &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline - operator=(const image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline - operator=(const Img &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline + image(image &&img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline + operator=(const image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline + operator=(const Img &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline + operator=(image &&img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline point_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc > recreate(const point_t &dims, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline diff --git a/html/reference/classboost_1_1gil_1_1image.html b/html/reference/classboost_1_1gil_1_1image.html index 589362e14..dfa75df6d 100644 --- a/html/reference/classboost_1_1gil_1_1image.html +++ b/html/reference/classboost_1_1gil_1_1image.html @@ -126,6 +126,9 @@ y_coord_t height () co template<typename P2 , bool IP2, typename Alloc2 >  image (const image< P2, IP2, Alloc2 > &img)   +image (image &&img) +  imageoperator= (const image &img)   @@ -133,6 +136,9 @@ template<typename P2 , bool IP2, typename Alloc2 > template<typename Img > imageoperator= (const Img &img)   + +imageoperator= (image &&img) +  Alloc & allocator ()   diff --git a/html/reference/color_8hpp_source.html b/html/reference/color_8hpp_source.html index 7f020b35b..7ed2a278f 100644 --- a/html/reference/color_8hpp_source.html +++ b/html/reference/color_8hpp_source.html @@ -52,10 +52,10 @@
    color.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_COLOR_HPP
    9 #define BOOST_GIL_CONCEPTS_COLOR_HPP
    10 
    11 #include <boost/gil/concepts/concept_check.hpp>
    12 
    13 #include <type_traits>
    14 
    15 #if defined(BOOST_CLANG)
    16 #pragma clang diagnostic push
    17 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    18 #endif
    19 
    20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    21 #pragma GCC diagnostic push
    22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 namespace boost { namespace gil {
    26 
    35 template <typename CS>
    37 {
    38  void constraints()
    39  {
    40  // Boost.MP11-compatible list, whose elements are color tags
    41 
    42  // TODO: Is this incomplete?
    43  }
    44 };
    45 
    46 // Models ColorSpaceConcept
    47 template <typename CS1, typename CS2>
    48 struct color_spaces_are_compatible : std::is_same<CS1, CS2> {};
    49 
    58 template <typename CS1, typename CS2>
    60 {
    61  void constraints()
    62  {
    63  static_assert(color_spaces_are_compatible<CS1, CS2>::value, "");
    64  }
    65 };
    66 
    76 template <typename CM>
    78 {
    79  void constraints()
    80  {
    81  // Boost.MP11-compatible list, whose elements model
    82  // MPLIntegralConstant representing a permutation.
    83 
    84  // TODO: Is this incomplete?
    85  }
    86 };
    87 
    88 }} // namespace boost::gil
    89 
    90 #if defined(BOOST_CLANG)
    91 #pragma clang diagnostic pop
    92 #endif
    93 
    94 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    95 #pragma GCC diagnostic pop
    96 #endif
    97 
    98 #endif
    Definition: algorithm.hpp:30
    -
    Channel mapping concept.
    Definition: color.hpp:77
    -
    Color space type concept.
    Definition: color.hpp:36
    -
    Two color spaces are compatible if they are the same.
    Definition: color.hpp:59
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_COLOR_HPP
    9 #define BOOST_GIL_CONCEPTS_COLOR_HPP
    10 
    11 #include <boost/gil/concepts/concept_check.hpp>
    12 
    13 #include <type_traits>
    14 
    15 #if defined(BOOST_CLANG)
    16 #pragma clang diagnostic push
    17 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    18 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    19 #endif
    20 
    21 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    22 #pragma GCC diagnostic push
    23 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    24 #endif
    25 
    26 namespace boost { namespace gil {
    27 
    36 template <typename CS>
    38 {
    39  void constraints()
    40  {
    41  // Boost.MP11-compatible list, whose elements are color tags
    42 
    43  // TODO: Is this incomplete?
    44  }
    45 };
    46 
    47 // Models ColorSpaceConcept
    48 template <typename CS1, typename CS2>
    49 struct color_spaces_are_compatible : std::is_same<CS1, CS2> {};
    50 
    59 template <typename CS1, typename CS2>
    61 {
    62  void constraints()
    63  {
    64  static_assert(color_spaces_are_compatible<CS1, CS2>::value, "");
    65  }
    66 };
    67 
    77 template <typename CM>
    79 {
    80  void constraints()
    81  {
    82  // Boost.MP11-compatible list, whose elements model
    83  // MPLIntegralConstant representing a permutation.
    84 
    85  // TODO: Is this incomplete?
    86  }
    87 };
    88 
    89 }} // namespace boost::gil
    90 
    91 #if defined(BOOST_CLANG)
    92 #pragma clang diagnostic pop
    93 #endif
    94 
    95 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    96 #pragma GCC diagnostic pop
    97 #endif
    98 
    99 #endif
    Definition: algorithm.hpp:30
    +
    Channel mapping concept.
    Definition: color.hpp:78
    +
    Color space type concept.
    Definition: color.hpp:37
    +
    Two color spaces are compatible if they are the same.
    Definition: color.hpp:60
    diff --git a/html/reference/color__convert_8hpp_source.html b/html/reference/color__convert_8hpp_source.html index af5628b1c..4ef1b5441 100644 --- a/html/reference/color__convert_8hpp_source.html +++ b/html/reference/color__convert_8hpp_source.html @@ -52,7 +52,7 @@
    color_convert.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_COLOR_CONVERT_HPP
    9 #define BOOST_GIL_COLOR_CONVERT_HPP
    10 
    11 #include <boost/gil/channel_algorithm.hpp>
    12 #include <boost/gil/cmyk.hpp>
    13 #include <boost/gil/color_base_algorithm.hpp>
    14 #include <boost/gil/gray.hpp>
    15 #include <boost/gil/metafunctions.hpp>
    16 #include <boost/gil/pixel.hpp>
    17 #include <boost/gil/rgb.hpp>
    18 #include <boost/gil/rgba.hpp>
    19 #include <boost/gil/utilities.hpp>
    20 
    21 #include <algorithm>
    22 #include <functional>
    23 #include <type_traits>
    24 
    25 namespace boost { namespace gil {
    26 
    29 
    30 // Forward-declare
    31 template <typename P> struct channel_type;
    32 
    38 
    41 template <typename C1, typename C2>
    43 
    46 template <typename C>
    48  template <typename P1, typename P2>
    49  void operator()(const P1& src, P2& dst) const {
    50  static_for_each(src,dst,default_channel_converter());
    51  }
    52 };
    53 
    54 namespace detail {
    55 
    57 
    58 // The default implementation of to_luminance uses float0..1 as the intermediate channel type
    59 template <typename RedChannel, typename GreenChannel, typename BlueChannel, typename GrayChannelValue>
    61  GrayChannelValue operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const {
    62  return channel_convert<GrayChannelValue>(float32_t(
    63  channel_convert<float32_t>(red )*0.30f +
    64  channel_convert<float32_t>(green)*0.59f +
    65  channel_convert<float32_t>(blue )*0.11f) );
    66  }
    67 };
    68 
    69 // performance specialization for unsigned char
    70 template <typename GrayChannelValue>
    71 struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
    72  GrayChannelValue operator()(uint8_t red, uint8_t green, uint8_t blue) const {
    73  return channel_convert<GrayChannelValue>(uint8_t(
    74  ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
    75  }
    76 };
    77 
    78 template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
    79 typename channel_traits<GrayChannel>::value_type rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) {
    80  return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
    81  typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
    82 }
    83 
    84 } // namespace detail
    85 
    88 template <>
    89 struct default_color_converter_impl<gray_t,rgb_t> {
    90  template <typename P1, typename P2>
    91  void operator()(const P1& src, P2& dst) const {
    92  get_color(dst,red_t()) =
    93  channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
    94  get_color(dst,green_t())=
    95  channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
    96  get_color(dst,blue_t()) =
    97  channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
    98  }
    99 };
    100 
    103 template <>
    104 struct default_color_converter_impl<gray_t,cmyk_t> {
    105  template <typename P1, typename P2>
    106  void operator()(const P1& src, P2& dst) const {
    107  get_color(dst,cyan_t())=
    108  channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
    109  get_color(dst,magenta_t())=
    110  channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
    111  get_color(dst,yellow_t())=
    112  channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
    113  get_color(dst,black_t())=
    114  channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
    115  }
    116 };
    117 
    120 template <>
    121 struct default_color_converter_impl<rgb_t,gray_t> {
    122  template <typename P1, typename P2>
    123  void operator()(const P1& src, P2& dst) const {
    124  get_color(dst,gray_color_t()) =
    125  detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
    126  get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
    127  );
    128  }
    129 };
    130 
    131 
    139 template <>
    140 struct default_color_converter_impl<rgb_t,cmyk_t> {
    141  template <typename P1, typename P2>
    142  void operator()(const P1& src, P2& dst) const {
    143  using T2 = typename channel_type<P2>::type;
    144  get_color(dst,cyan_t()) = channel_invert(channel_convert<T2>(get_color(src,red_t()))); // c = 1 - r
    145  get_color(dst,magenta_t()) = channel_invert(channel_convert<T2>(get_color(src,green_t()))); // m = 1 - g
    146  get_color(dst,yellow_t()) = channel_invert(channel_convert<T2>(get_color(src,blue_t()))); // y = 1 - b
    147  get_color(dst,black_t()) = (std::min)(get_color(dst,cyan_t()),
    148  (std::min)(get_color(dst,magenta_t()),
    149  get_color(dst,yellow_t()))); // k = minimum(c, m, y)
    150  T2 x = channel_traits<T2>::max_value()-get_color(dst,black_t()); // x = 1 - k
    151  if (x>0.0001f) {
    152  float x1 = channel_traits<T2>::max_value()/float(x);
    153  get_color(dst,cyan_t()) = (T2)((get_color(dst,cyan_t()) - get_color(dst,black_t()))*x1); // c = (c - k) / x
    154  get_color(dst,magenta_t()) = (T2)((get_color(dst,magenta_t()) - get_color(dst,black_t()))*x1); // m = (m - k) / x
    155  get_color(dst,yellow_t()) = (T2)((get_color(dst,yellow_t()) - get_color(dst,black_t()))*x1); // y = (y - k) / x
    156  } else {
    157  get_color(dst,cyan_t())=get_color(dst,magenta_t())=get_color(dst,yellow_t())=0;
    158  }
    159  }
    160 };
    161 
    168 template <>
    169 struct default_color_converter_impl<cmyk_t,rgb_t> {
    170  template <typename P1, typename P2>
    171  void operator()(const P1& src, P2& dst) const {
    172  using T1 = typename channel_type<P1>::type;
    173  get_color(dst,red_t()) =
    174  channel_convert<typename color_element_type<P2,red_t>::type>(
    175  channel_invert<T1>(
    176  (std::min)(channel_traits<T1>::max_value(),
    178  get_color(dst,green_t())=
    179  channel_convert<typename color_element_type<P2,green_t>::type>(
    180  channel_invert<T1>(
    181  (std::min)(channel_traits<T1>::max_value(),
    183  get_color(dst,blue_t()) =
    184  channel_convert<typename color_element_type<P2,blue_t>::type>(
    185  channel_invert<T1>(
    186  (std::min)(channel_traits<T1>::max_value(),
    188  }
    189 };
    190 
    191 
    196 template <>
    197 struct default_color_converter_impl<cmyk_t,gray_t> {
    198  template <typename P1, typename P2>
    199  void operator()(const P1& src, P2& dst) const {
    200  get_color(dst,gray_color_t())=
    201  channel_convert<typename color_element_type<P2,gray_color_t>::type>(
    204  detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
    205  get_color(src,cyan_t()),
    206  get_color(src,magenta_t()),
    207  get_color(src,yellow_t())
    208  )
    209  ),
    210  channel_invert(get_color(src,black_t()))));
    211  }
    212 };
    213 
    214 namespace detail {
    215 
    216 template <typename Pixel>
    217 auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
    218 {
    219  return get_color(p,alpha_t());
    220 }
    221 template <typename Pixel>
    222 auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
    223 {
    224  return channel_traits<typename channel_type<Pixel>::type>::max_value();
    225 }
    226 
    227 } // namespace detail
    228 
    229 // Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
    230 template <typename Pixel>
    231 auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
    232 {
    233  return detail::alpha_or_max_impl(
    234  p,
    235  mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
    236 }
    237 
    238 
    241 template <typename C1>
    242 struct default_color_converter_impl<C1,rgba_t> {
    243  template <typename P1, typename P2>
    244  void operator()(const P1& src, P2& dst) const {
    245  using T2 = typename channel_type<P2>::type;
    248  get_color(dst,red_t()) =get_color(tmp,red_t());
    249  get_color(dst,green_t())=get_color(tmp,green_t());
    250  get_color(dst,blue_t()) =get_color(tmp,blue_t());
    251  get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
    252  }
    253 };
    254 
    261 template <typename C2>
    262 struct default_color_converter_impl<rgba_t,C2> {
    263  template <typename P1, typename P2>
    264  void operator()(const P1& src, P2& dst) const {
    265  using T1 = typename channel_type<P1>::type;
    270  ,dst);
    271  }
    272 };
    273 
    276 template <>
    277 struct default_color_converter_impl<rgba_t,rgba_t> {
    278  template <typename P1, typename P2>
    279  void operator()(const P1& src, P2& dst) const {
    280  static_for_each(src,dst,default_channel_converter());
    281  }
    282 };
    283 
    287 
    291  template <typename SrcP, typename DstP>
    292  void operator()(const SrcP& src,DstP& dst) const {
    293  using SrcColorSpace = typename color_space_type<SrcP>::type;
    294  using DstColorSpace = typename color_space_type<DstP>::type;
    296  }
    297 };
    298 
    303 template <typename SrcP, typename DstP>
    304 inline void color_convert(const SrcP& src, DstP& dst) {
    305  default_color_converter()(src,dst);
    306 }
    307 
    308 } } // namespace boost::gil
    309 
    310 #endif
    Magenta.
    Definition: cmyk.hpp:25
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_COLOR_CONVERT_HPP
    9 #define BOOST_GIL_COLOR_CONVERT_HPP
    10 
    11 #include <boost/gil/channel_algorithm.hpp>
    12 #include <boost/gil/cmyk.hpp>
    13 #include <boost/gil/color_base_algorithm.hpp>
    14 #include <boost/gil/gray.hpp>
    15 #include <boost/gil/metafunctions.hpp>
    16 #include <boost/gil/pixel.hpp>
    17 #include <boost/gil/rgb.hpp>
    18 #include <boost/gil/rgba.hpp>
    19 #include <boost/gil/utilities.hpp>
    20 
    21 #include <algorithm>
    22 #include <functional>
    23 #include <type_traits>
    24 
    25 namespace boost { namespace gil {
    26 
    29 
    30 // Forward-declare
    31 template <typename P> struct channel_type;
    32 
    38 
    41 template <typename C1, typename C2>
    43 {
    44  static_assert(
    45  std::is_same<C1, C2>::value,
    46  "default_color_converter_impl not specialized for given color spaces");
    47 };
    48 
    51 template <typename C>
    53  template <typename P1, typename P2>
    54  void operator()(const P1& src, P2& dst) const {
    55  static_for_each(src,dst,default_channel_converter());
    56  }
    57 };
    58 
    59 namespace detail {
    60 
    62 
    63 // The default implementation of to_luminance uses float0..1 as the intermediate channel type
    64 template <typename RedChannel, typename GreenChannel, typename BlueChannel, typename GrayChannelValue>
    66  GrayChannelValue operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const {
    67  return channel_convert<GrayChannelValue>(float32_t(
    68  channel_convert<float32_t>(red )*0.30f +
    69  channel_convert<float32_t>(green)*0.59f +
    70  channel_convert<float32_t>(blue )*0.11f) );
    71  }
    72 };
    73 
    74 // performance specialization for unsigned char
    75 template <typename GrayChannelValue>
    76 struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
    77  GrayChannelValue operator()(uint8_t red, uint8_t green, uint8_t blue) const {
    78  return channel_convert<GrayChannelValue>(uint8_t(
    79  ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
    80  }
    81 };
    82 
    83 template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
    84 typename channel_traits<GrayChannel>::value_type rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) {
    85  return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
    86  typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
    87 }
    88 
    89 } // namespace detail
    90 
    93 template <>
    94 struct default_color_converter_impl<gray_t,rgb_t> {
    95  template <typename P1, typename P2>
    96  void operator()(const P1& src, P2& dst) const {
    97  get_color(dst,red_t()) =
    98  channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
    99  get_color(dst,green_t())=
    100  channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
    101  get_color(dst,blue_t()) =
    102  channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
    103  }
    104 };
    105 
    108 template <>
    109 struct default_color_converter_impl<gray_t,cmyk_t> {
    110  template <typename P1, typename P2>
    111  void operator()(const P1& src, P2& dst) const {
    112  get_color(dst,cyan_t())=
    113  channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
    114  get_color(dst,magenta_t())=
    115  channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
    116  get_color(dst,yellow_t())=
    117  channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
    118  get_color(dst,black_t())=
    119  channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
    120  }
    121 };
    122 
    125 template <>
    126 struct default_color_converter_impl<rgb_t,gray_t> {
    127  template <typename P1, typename P2>
    128  void operator()(const P1& src, P2& dst) const {
    129  get_color(dst,gray_color_t()) =
    130  detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
    131  get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
    132  );
    133  }
    134 };
    135 
    136 
    144 template <>
    145 struct default_color_converter_impl<rgb_t,cmyk_t> {
    146  template <typename P1, typename P2>
    147  void operator()(const P1& src, P2& dst) const {
    148  using T2 = typename channel_type<P2>::type;
    149  get_color(dst,cyan_t()) = channel_invert(channel_convert<T2>(get_color(src,red_t()))); // c = 1 - r
    150  get_color(dst,magenta_t()) = channel_invert(channel_convert<T2>(get_color(src,green_t()))); // m = 1 - g
    151  get_color(dst,yellow_t()) = channel_invert(channel_convert<T2>(get_color(src,blue_t()))); // y = 1 - b
    152  get_color(dst,black_t()) = (std::min)(get_color(dst,cyan_t()),
    153  (std::min)(get_color(dst,magenta_t()),
    154  get_color(dst,yellow_t()))); // k = minimum(c, m, y)
    155  T2 x = channel_traits<T2>::max_value()-get_color(dst,black_t()); // x = 1 - k
    156  if (x>0.0001f) {
    157  float x1 = channel_traits<T2>::max_value()/float(x);
    158  get_color(dst,cyan_t()) = (T2)((get_color(dst,cyan_t()) - get_color(dst,black_t()))*x1); // c = (c - k) / x
    159  get_color(dst,magenta_t()) = (T2)((get_color(dst,magenta_t()) - get_color(dst,black_t()))*x1); // m = (m - k) / x
    160  get_color(dst,yellow_t()) = (T2)((get_color(dst,yellow_t()) - get_color(dst,black_t()))*x1); // y = (y - k) / x
    161  } else {
    162  get_color(dst,cyan_t())=get_color(dst,magenta_t())=get_color(dst,yellow_t())=0;
    163  }
    164  }
    165 };
    166 
    173 template <>
    174 struct default_color_converter_impl<cmyk_t,rgb_t> {
    175  template <typename P1, typename P2>
    176  void operator()(const P1& src, P2& dst) const {
    177  using T1 = typename channel_type<P1>::type;
    178  get_color(dst,red_t()) =
    179  channel_convert<typename color_element_type<P2,red_t>::type>(
    180  channel_invert<T1>(
    181  (std::min)(channel_traits<T1>::max_value(),
    183  get_color(dst,green_t())=
    184  channel_convert<typename color_element_type<P2,green_t>::type>(
    185  channel_invert<T1>(
    186  (std::min)(channel_traits<T1>::max_value(),
    188  get_color(dst,blue_t()) =
    189  channel_convert<typename color_element_type<P2,blue_t>::type>(
    190  channel_invert<T1>(
    191  (std::min)(channel_traits<T1>::max_value(),
    193  }
    194 };
    195 
    196 
    201 template <>
    202 struct default_color_converter_impl<cmyk_t,gray_t> {
    203  template <typename P1, typename P2>
    204  void operator()(const P1& src, P2& dst) const {
    205  get_color(dst,gray_color_t())=
    206  channel_convert<typename color_element_type<P2,gray_color_t>::type>(
    209  detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
    210  get_color(src,cyan_t()),
    211  get_color(src,magenta_t()),
    212  get_color(src,yellow_t())
    213  )
    214  ),
    215  channel_invert(get_color(src,black_t()))));
    216  }
    217 };
    218 
    219 namespace detail {
    220 
    221 template <typename Pixel>
    222 auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
    223 {
    224  return get_color(p,alpha_t());
    225 }
    226 template <typename Pixel>
    227 auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
    228 {
    229  return channel_traits<typename channel_type<Pixel>::type>::max_value();
    230 }
    231 
    232 } // namespace detail
    233 
    234 // Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
    235 template <typename Pixel>
    236 auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
    237 {
    238  return detail::alpha_or_max_impl(
    239  p,
    240  mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
    241 }
    242 
    243 
    246 template <typename C1>
    247 struct default_color_converter_impl<C1,rgba_t> {
    248  template <typename P1, typename P2>
    249  void operator()(const P1& src, P2& dst) const {
    250  using T2 = typename channel_type<P2>::type;
    253  get_color(dst,red_t()) =get_color(tmp,red_t());
    254  get_color(dst,green_t())=get_color(tmp,green_t());
    255  get_color(dst,blue_t()) =get_color(tmp,blue_t());
    256  get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
    257  }
    258 };
    259 
    266 template <typename C2>
    267 struct default_color_converter_impl<rgba_t,C2> {
    268  template <typename P1, typename P2>
    269  void operator()(const P1& src, P2& dst) const {
    270  using T1 = typename channel_type<P1>::type;
    275  ,dst);
    276  }
    277 };
    278 
    281 template <>
    282 struct default_color_converter_impl<rgba_t,rgba_t> {
    283  template <typename P1, typename P2>
    284  void operator()(const P1& src, P2& dst) const {
    285  static_for_each(src,dst,default_channel_converter());
    286  }
    287 };
    288 
    292 
    296  template <typename SrcP, typename DstP>
    297  void operator()(const SrcP& src,DstP& dst) const {
    298  using SrcColorSpace = typename color_space_type<SrcP>::type;
    299  using DstColorSpace = typename color_space_type<DstP>::type;
    301  }
    302 };
    303 
    308 template <typename SrcP, typename DstP>
    309 inline void color_convert(const SrcP& src, DstP& dst) {
    310  default_color_converter()(src,dst);
    311 }
    312 
    313 } } // namespace boost::gil
    314 
    315 #endif
    Magenta.
    Definition: cmyk.hpp:25
    channel_traits< Channel >::value_type channel_invert(Channel x)
    Default implementation. Provide overloads for performance.
    Definition: channel_algorithm.hpp:559
    Definition: algorithm.hpp:30
    Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.
    Definition: metafunctions.hpp:23
    @@ -66,13 +66,13 @@
    Definition: color_convert.hpp:31
    Color Convertion function object. To be specialized for every src/dst color space.
    Definition: color_convert.hpp:42
    Blue.
    Definition: rgb.hpp:30
    -
    void color_convert(const SrcP &src, DstP &dst)
    helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
    Definition: color_convert.hpp:304
    -
    red * .3 + green * .59 + blue * .11 + .5
    Definition: color_convert.hpp:60
    +
    void color_convert(const SrcP &src, DstP &dst)
    helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
    Definition: color_convert.hpp:309
    +
    red * .3 + green * .59 + blue * .11 + .5
    Definition: color_convert.hpp:65
    Black.
    Definition: cmyk.hpp:31
    Red.
    Definition: rgb.hpp:24
    Gray.
    Definition: gray.hpp:18
    Cyan.
    Definition: cmyk.hpp:22
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:290
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:295
    diff --git a/html/reference/concept__check_8hpp_source.html b/html/reference/concept__check_8hpp_source.html index e042e2d80..a6f65ffbe 100644 --- a/html/reference/concept__check_8hpp_source.html +++ b/html/reference/concept__check_8hpp_source.html @@ -52,7 +52,7 @@
    concept_check.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
    9 #define BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
    10 
    11 #include <boost/config.hpp>
    12 
    13 #if defined(BOOST_CLANG)
    14 #pragma clang diagnostic push
    15 #pragma clang diagnostic ignored "-Wconversion"
    16 #pragma clang diagnostic ignored "-Wfloat-equal"
    17 #pragma clang diagnostic ignored "-Wuninitialized"
    18 #endif
    19 
    20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    21 #pragma GCC diagnostic push
    22 #pragma GCC diagnostic ignored "-Wconversion"
    23 #pragma GCC diagnostic ignored "-Wfloat-equal"
    24 #pragma GCC diagnostic ignored "-Wuninitialized"
    25 #endif
    26 
    27 #include <boost/concept_check.hpp>
    28 
    29 #if defined(BOOST_CLANG)
    30 #pragma clang diagnostic pop
    31 #endif
    32 
    33 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    34 #pragma GCC diagnostic pop
    35 #endif
    36 
    37 // TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
    38 
    39 namespace boost { namespace gil {
    40 
    41 // TODO: What is BOOST_GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
    42 // TODO: What is gil_function_requires for; Why not function_requires?
    43 
    44 #ifdef BOOST_GIL_USE_CONCEPT_CHECK
    45  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept) \
    46  BOOST_CLASS_REQUIRE(type_var, ns, concept);
    47 
    48  template <typename Concept>
    49  void gil_function_requires() { function_requires<Concept>(); }
    50 #else
    51  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept)
    52 
    53  template <typename C>
    54  void gil_function_requires() {}
    55 #endif
    56 
    57 }} // namespace boost::gil:
    58 
    59 #endif
    Definition: algorithm.hpp:30
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
    9 #define BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
    10 
    11 #include <boost/config.hpp>
    12 
    13 #if defined(BOOST_CLANG)
    14 #pragma clang diagnostic push
    15 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    16 #pragma clang diagnostic ignored "-Wconversion"
    17 #pragma clang diagnostic ignored "-Wfloat-equal"
    18 #pragma clang diagnostic ignored "-Wuninitialized"
    19 #endif
    20 
    21 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    22 #pragma GCC diagnostic push
    23 #pragma GCC diagnostic ignored "-Wconversion"
    24 #pragma GCC diagnostic ignored "-Wfloat-equal"
    25 #pragma GCC diagnostic ignored "-Wuninitialized"
    26 #endif
    27 
    28 #include <boost/concept_check.hpp>
    29 
    30 #if defined(BOOST_CLANG)
    31 #pragma clang diagnostic pop
    32 #endif
    33 
    34 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    35 #pragma GCC diagnostic pop
    36 #endif
    37 
    38 // TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
    39 
    40 namespace boost { namespace gil {
    41 
    42 // TODO: What is BOOST_GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
    43 // TODO: What is gil_function_requires for; Why not function_requires?
    44 
    45 #ifdef BOOST_GIL_USE_CONCEPT_CHECK
    46  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept) \
    47  BOOST_CLASS_REQUIRE(type_var, ns, concept);
    48 
    49  template <typename Concept>
    50  void gil_function_requires() { function_requires<Concept>(); }
    51 #else
    52  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept)
    53 
    54  template <typename C>
    55  void gil_function_requires() {}
    56 #endif
    57 
    58 }} // namespace boost::gil:
    59 
    60 #endif
    Definition: algorithm.hpp:30
    diff --git a/html/reference/concepts_2channel_8hpp_source.html b/html/reference/concepts_2channel_8hpp_source.html index 334bb323f..308dd4525 100644 --- a/html/reference/concepts_2channel_8hpp_source.html +++ b/html/reference/concepts_2channel_8hpp_source.html @@ -52,16 +52,16 @@
    concepts/channel.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_CHANNEL_HPP
    9 #define BOOST_GIL_CONCEPTS_CHANNEL_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 
    15 #include <boost/concept_check.hpp>
    16 
    17 #include <utility> // std::swap
    18 #include <type_traits>
    19 
    20 #if defined(BOOST_CLANG)
    21 #pragma clang diagnostic push
    22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    26 #pragma GCC diagnostic push
    27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 namespace boost { namespace gil {
    31 
    32 // Forward declarations
    33 template <typename T>
    34 struct channel_traits;
    35 
    36 template <typename DstT, typename SrcT>
    37 auto channel_convert(SrcT const& val)
    38  -> typename channel_traits<DstT>::value_type;
    39 
    72 template <typename T>
    74 {
    75  void constraints()
    76  {
    77  gil_function_requires<boost::EqualityComparableConcept<T>>();
    78 
    79  using v = typename channel_traits<T>::value_type;
    80  using r = typename channel_traits<T>::reference;
    81  using p = typename channel_traits<T>::pointer;
    82  using cr = typename channel_traits<T>::const_reference;
    83  using cp = typename channel_traits<T>::const_pointer;
    84 
    85  channel_traits<T>::min_value();
    86  channel_traits<T>::max_value();
    87  }
    88 
    89  T c;
    90 };
    91 
    92 namespace detail
    93 {
    94 
    96 template <typename T>
    98 {
    99  void constraints()
    100  {
    101  c1 = c2;
    102  using std::swap;
    103  swap(c1, c2);
    104  }
    105  T c1;
    106  T c2;
    107 };
    108 
    109 } // namespace detail
    110 
    116 template <typename T>
    118 {
    119  void constraints()
    120  {
    121  gil_function_requires<ChannelConcept<T>>();
    122  gil_function_requires<detail::ChannelIsMutableConcept<T>>();
    123  }
    124 };
    125 
    131 template <typename T>
    133 {
    134  void constraints()
    135  {
    136  gil_function_requires<ChannelConcept<T>>();
    137  gil_function_requires<Regular<T>>();
    138  }
    139 };
    140 
    152 template <typename T1, typename T2> // Models GIL Pixel
    154  : std::is_same
    155  <
    156  typename channel_traits<T1>::value_type,
    157  typename channel_traits<T2>::value_type
    158  >
    159 {
    160 };
    161 
    171 template <typename Channel1, typename Channel2>
    173 {
    174  void constraints()
    175  {
    177  }
    178 };
    179 
    191 template <typename SrcChannel, typename DstChannel>
    193 {
    194  void constraints()
    195  {
    196  gil_function_requires<ChannelConcept<SrcChannel>>();
    197  gil_function_requires<MutableChannelConcept<DstChannel>>();
    198  dst = channel_convert<DstChannel, SrcChannel>(src);
    199  ignore_unused_variable_warning(dst);
    200  }
    201  SrcChannel src;
    202  DstChannel dst;
    203 };
    204 
    205 }} // namespace boost::gil
    206 
    207 #if defined(BOOST_CLANG)
    208 #pragma clang diagnostic pop
    209 #endif
    210 
    211 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    212 #pragma GCC diagnostic pop
    213 #endif
    214 
    215 #endif
    Definition: algorithm.hpp:30
    -
    Definition: concepts/channel.hpp:97
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_CHANNEL_HPP
    9 #define BOOST_GIL_CONCEPTS_CHANNEL_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 
    15 #include <boost/concept_check.hpp>
    16 
    17 #include <utility> // std::swap
    18 #include <type_traits>
    19 
    20 #if defined(BOOST_CLANG)
    21 #pragma clang diagnostic push
    22 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    23 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    24 #endif
    25 
    26 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    27 #pragma GCC diagnostic push
    28 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    29 #endif
    30 
    31 namespace boost { namespace gil {
    32 
    33 // Forward declarations
    34 template <typename T>
    35 struct channel_traits;
    36 
    37 template <typename DstT, typename SrcT>
    38 auto channel_convert(SrcT const& val)
    39  -> typename channel_traits<DstT>::value_type;
    40 
    73 template <typename T>
    75 {
    76  void constraints()
    77  {
    78  gil_function_requires<boost::EqualityComparableConcept<T>>();
    79 
    80  using v = typename channel_traits<T>::value_type;
    81  using r = typename channel_traits<T>::reference;
    82  using p = typename channel_traits<T>::pointer;
    83  using cr = typename channel_traits<T>::const_reference;
    84  using cp = typename channel_traits<T>::const_pointer;
    85 
    86  channel_traits<T>::min_value();
    87  channel_traits<T>::max_value();
    88  }
    89 
    90  T c;
    91 };
    92 
    93 namespace detail
    94 {
    95 
    97 template <typename T>
    99 {
    100  void constraints()
    101  {
    102  c1 = c2;
    103  using std::swap;
    104  swap(c1, c2);
    105  }
    106  T c1;
    107  T c2;
    108 };
    109 
    110 } // namespace detail
    111 
    117 template <typename T>
    119 {
    120  void constraints()
    121  {
    122  gil_function_requires<ChannelConcept<T>>();
    123  gil_function_requires<detail::ChannelIsMutableConcept<T>>();
    124  }
    125 };
    126 
    132 template <typename T>
    134 {
    135  void constraints()
    136  {
    137  gil_function_requires<ChannelConcept<T>>();
    138  gil_function_requires<Regular<T>>();
    139  }
    140 };
    141 
    153 template <typename T1, typename T2> // Models GIL Pixel
    155  : std::is_same
    156  <
    157  typename channel_traits<T1>::value_type,
    158  typename channel_traits<T2>::value_type
    159  >
    160 {
    161 };
    162 
    172 template <typename Channel1, typename Channel2>
    174 {
    175  void constraints()
    176  {
    178  }
    179 };
    180 
    192 template <typename SrcChannel, typename DstChannel>
    194 {
    195  void constraints()
    196  {
    197  gil_function_requires<ChannelConcept<SrcChannel>>();
    198  gil_function_requires<MutableChannelConcept<DstChannel>>();
    199  dst = channel_convert<DstChannel, SrcChannel>(src);
    200  ignore_unused_variable_warning(dst);
    201  }
    202  SrcChannel src;
    203  DstChannel dst;
    204 };
    205 
    206 }} // namespace boost::gil
    207 
    208 #if defined(BOOST_CLANG)
    209 #pragma clang diagnostic pop
    210 #endif
    211 
    212 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    213 #pragma GCC diagnostic pop
    214 #endif
    215 
    216 #endif
    Definition: algorithm.hpp:30
    +
    Definition: concepts/channel.hpp:98
    channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
    Converting from one channel type to another.
    Definition: channel_algorithm.hpp:451
    -
    A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
    Definition: concepts/channel.hpp:192
    -
    A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
    Definition: concepts/channel.hpp:73
    -
    A channel that supports default construction.
    Definition: concepts/channel.hpp:132
    -
    Predicate metafunction returning whether two channels are compatible.
    Definition: concepts/channel.hpp:153
    +
    A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
    Definition: concepts/channel.hpp:193
    +
    A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
    Definition: concepts/channel.hpp:74
    +
    A channel that supports default construction.
    Definition: concepts/channel.hpp:133
    +
    Predicate metafunction returning whether two channels are compatible.
    Definition: concepts/channel.hpp:154
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    -
    Channels are compatible if their associated value types (ignoring constness and references) are the s...
    Definition: concepts/channel.hpp:172
    -
    A channel that allows for modifying its value.
    Definition: concepts/channel.hpp:117
    +
    Channels are compatible if their associated value types (ignoring constness and references) are the s...
    Definition: concepts/channel.hpp:173
    +
    A channel that allows for modifying its value.
    Definition: concepts/channel.hpp:118
    diff --git a/html/reference/concepts_2color__base_8hpp_source.html b/html/reference/concepts_2color__base_8hpp_source.html index 051eff354..1312ca63b 100644 --- a/html/reference/concepts_2color__base_8hpp_source.html +++ b/html/reference/concepts_2color__base_8hpp_source.html @@ -52,17 +52,17 @@
    concepts/color_base.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
    9 #define BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/color.hpp>
    13 #include <boost/gil/concepts/concept_check.hpp>
    14 #include <boost/gil/concepts/fwd.hpp>
    15 
    16 #include <boost/core/ignore_unused.hpp>
    17 #include <type_traits>
    18 
    19 #if defined(BOOST_CLANG)
    20 #pragma clang diagnostic push
    21 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    22 #endif
    23 
    24 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    25 #pragma GCC diagnostic push
    26 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    27 #endif
    28 
    29 namespace boost { namespace gil {
    30 
    31 // Forward declarations of at_c
    32 namespace detail {
    33 
    34 template <typename Element, typename Layout, int K>
    35 struct homogeneous_color_base;
    36 
    37 } // namespace detail
    38 
    39 template <int K, typename E, typename L, int N>
    40 auto at_c(detail::homogeneous_color_base<E, L, N>& p)
    41  -> typename std::add_lvalue_reference<E>::type;
    42 
    43 template <int K, typename E, typename L, int N>
    44 auto at_c(detail::homogeneous_color_base<E, L, N> const& p)
    45  -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type;
    46 
    47 template <typename P, typename C, typename L>
    48 struct packed_pixel;
    49 
    50 template <int K, typename P, typename C, typename L>
    51 auto at_c(packed_pixel<P, C, L>& p)
    52  -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type;
    53 
    54 template <int K, typename P, typename C, typename L>
    55 auto at_c(packed_pixel<P, C, L> const& p)
    56  -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type;
    57 
    58 template <typename B, typename C, typename L, bool M>
    59 struct bit_aligned_pixel_reference;
    60 
    61 template <int K, typename B, typename C, typename L, bool M>
    62 inline auto at_c(bit_aligned_pixel_reference<B, C, L, M> const& p)
    63  -> typename kth_element_reference_type
    64  <
    65  bit_aligned_pixel_reference<B, C, L, M>,
    66  K
    67  >::type;
    68 
    69 // Forward declarations of semantic_at_c
    70 template <int K, typename ColorBase>
    71 auto semantic_at_c(ColorBase& p)
    72  -> typename std::enable_if
    73  <
    74  !std::is_const<ColorBase>::value,
    75  typename kth_semantic_element_reference_type<ColorBase, K>::type
    76  >::type;
    77 
    78 template <int K, typename ColorBase>
    79 auto semantic_at_c(ColorBase const& p)
    80  -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type;
    81 
    135 template <typename ColorBase>
    137 {
    138  void constraints()
    139  {
    140  gil_function_requires<CopyConstructible<ColorBase>>();
    141  gil_function_requires<EqualityComparable<ColorBase>>();
    142 
    143  using color_space_t = typename ColorBase::layout_t::color_space_t;
    144  gil_function_requires<ColorSpaceConcept<color_space_t>>();
    145 
    146  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
    147  // TODO: channel_mapping_t must be an Boost.MP11-compatible random access sequence
    148 
    149  static const int num_elements = size<ColorBase>::value;
    150 
    151  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
    152  using RN = typename kth_element_const_reference_type<ColorBase, num_elements - 1>::type;
    153 
    154  RN r = gil::at_c<num_elements - 1>(cb);
    155  boost::ignore_unused(r);
    156 
    157  // functions that work for every pixel (no need to require them)
    158  semantic_at_c<0>(cb);
    159  semantic_at_c<num_elements-1>(cb);
    160  // also static_max(cb), static_min(cb), static_fill(cb,value),
    161  // and all variations of static_for_each(), static_generate(), static_transform()
    162  }
    163  ColorBase cb;
    164 };
    165 
    181 template <typename ColorBase>
    183 {
    184  void constraints()
    185  {
    186  gil_function_requires<ColorBaseConcept<ColorBase>>();
    187  gil_function_requires<Assignable<ColorBase>>();
    188  gil_function_requires<Swappable<ColorBase>>();
    189 
    190  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
    191 
    192  R0 r = gil::at_c<0>(cb);
    193  gil::at_c<0>(cb) = r;
    194  }
    195  ColorBase cb;
    196 };
    197 
    205 template <typename ColorBase>
    207 {
    208  void constraints()
    209  {
    210  gil_function_requires<MutableColorBaseConcept<ColorBase>>();
    211  gil_function_requires<Regular<ColorBase>>();
    212  }
    213 };
    214 
    225 template <typename ColorBase>
    227 {
    228  void constraints()
    229  {
    230  gil_function_requires<ColorBaseConcept<ColorBase>>();
    231 
    232  static const int num_elements = size<ColorBase>::value;
    233 
    234  using T0 = typename kth_element_type<ColorBase, 0>::type;
    235  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
    236 
    237  static_assert(std::is_same<T0, TN>::value, ""); // better than nothing
    238 
    239  using R0 = typename kth_element_const_reference_type<ColorBase, 0>::type;
    240  R0 r = dynamic_at_c(cb, 0);
    241  boost::ignore_unused(r);
    242  }
    243  ColorBase cb;
    244 };
    245 
    255 template <typename ColorBase>
    257 {
    258  void constraints()
    259  {
    260  gil_function_requires<ColorBaseConcept<ColorBase>>();
    261  gil_function_requires<HomogeneousColorBaseConcept<ColorBase>>();
    262  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
    263  R0 r = dynamic_at_c(cb, 0);
    264  boost::ignore_unused(r);
    265  dynamic_at_c(cb, 0) = dynamic_at_c(cb, 0);
    266  }
    267  ColorBase cb;
    268 };
    269 
    280 template <typename ColorBase>
    282 {
    283  void constraints()
    284  {
    285  gil_function_requires<MutableHomogeneousColorBaseConcept<ColorBase>>();
    286  gil_function_requires<Regular<ColorBase>>();
    287  }
    288 };
    289 
    301 template <typename ColorBase1, typename ColorBase2>
    303 {
    304  void constraints()
    305  {
    306  static_assert(std::is_same
    307  <
    308  typename ColorBase1::layout_t::color_space_t,
    309  typename ColorBase2::layout_t::color_space_t
    310  >::value, "");
    311 
    312 // using e1 = typename kth_semantic_element_type<ColorBase1,0>::type;
    313 // using e2 = typename kth_semantic_element_type<ColorBase2,0>::type;
    314 // "e1 is convertible to e2"
    315  }
    316 };
    317 
    318 }} // namespace boost::gil
    319 
    320 #if defined(BOOST_CLANG)
    321 #pragma clang diagnostic pop
    322 #endif
    323 
    324 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    325 #pragma GCC diagnostic pop
    326 #endif
    327 
    328 #endif
    Homogeneous color base that also has a default constructor. Refines Regular.
    Definition: concepts/color_base.hpp:281
    -
    Homogeneous color base that allows for modifying its elements.
    Definition: concepts/color_base.hpp:256
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
    9 #define BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/color.hpp>
    13 #include <boost/gil/concepts/concept_check.hpp>
    14 #include <boost/gil/concepts/fwd.hpp>
    15 
    16 #include <boost/core/ignore_unused.hpp>
    17 #include <type_traits>
    18 
    19 #if defined(BOOST_CLANG)
    20 #pragma clang diagnostic push
    21 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    26 #pragma GCC diagnostic push
    27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 namespace boost { namespace gil {
    31 
    32 // Forward declarations of at_c
    33 namespace detail {
    34 
    35 template <typename Element, typename Layout, int K>
    36 struct homogeneous_color_base;
    37 
    38 } // namespace detail
    39 
    40 template <int K, typename E, typename L, int N>
    41 auto at_c(detail::homogeneous_color_base<E, L, N>& p)
    42  -> typename std::add_lvalue_reference<E>::type;
    43 
    44 template <int K, typename E, typename L, int N>
    45 auto at_c(detail::homogeneous_color_base<E, L, N> const& p)
    46  -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type;
    47 
    48 template <typename P, typename C, typename L>
    49 struct packed_pixel;
    50 
    51 template <int K, typename P, typename C, typename L>
    52 auto at_c(packed_pixel<P, C, L>& p)
    53  -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type;
    54 
    55 template <int K, typename P, typename C, typename L>
    56 auto at_c(packed_pixel<P, C, L> const& p)
    57  -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type;
    58 
    59 template <typename B, typename C, typename L, bool M>
    60 struct bit_aligned_pixel_reference;
    61 
    62 template <int K, typename B, typename C, typename L, bool M>
    63 inline auto at_c(bit_aligned_pixel_reference<B, C, L, M> const& p)
    64  -> typename kth_element_reference_type
    65  <
    66  bit_aligned_pixel_reference<B, C, L, M>,
    67  K
    68  >::type;
    69 
    70 // Forward declarations of semantic_at_c
    71 template <int K, typename ColorBase>
    72 auto semantic_at_c(ColorBase& p)
    73  -> typename std::enable_if
    74  <
    75  !std::is_const<ColorBase>::value,
    76  typename kth_semantic_element_reference_type<ColorBase, K>::type
    77  >::type;
    78 
    79 template <int K, typename ColorBase>
    80 auto semantic_at_c(ColorBase const& p)
    81  -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type;
    82 
    136 template <typename ColorBase>
    138 {
    139  void constraints()
    140  {
    141  gil_function_requires<CopyConstructible<ColorBase>>();
    142  gil_function_requires<EqualityComparable<ColorBase>>();
    143 
    144  using color_space_t = typename ColorBase::layout_t::color_space_t;
    145  gil_function_requires<ColorSpaceConcept<color_space_t>>();
    146 
    147  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
    148  // TODO: channel_mapping_t must be an Boost.MP11-compatible random access sequence
    149 
    150  static const int num_elements = size<ColorBase>::value;
    151 
    152  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
    153  using RN = typename kth_element_const_reference_type<ColorBase, num_elements - 1>::type;
    154 
    155  RN r = gil::at_c<num_elements - 1>(cb);
    156  boost::ignore_unused(r);
    157 
    158  // functions that work for every pixel (no need to require them)
    159  semantic_at_c<0>(cb);
    160  semantic_at_c<num_elements-1>(cb);
    161  // also static_max(cb), static_min(cb), static_fill(cb,value),
    162  // and all variations of static_for_each(), static_generate(), static_transform()
    163  }
    164  ColorBase cb;
    165 };
    166 
    182 template <typename ColorBase>
    184 {
    185  void constraints()
    186  {
    187  gil_function_requires<ColorBaseConcept<ColorBase>>();
    188  gil_function_requires<Assignable<ColorBase>>();
    189  gil_function_requires<Swappable<ColorBase>>();
    190 
    191  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
    192 
    193  R0 r = gil::at_c<0>(cb);
    194  gil::at_c<0>(cb) = r;
    195  }
    196  ColorBase cb;
    197 };
    198 
    206 template <typename ColorBase>
    208 {
    209  void constraints()
    210  {
    211  gil_function_requires<MutableColorBaseConcept<ColorBase>>();
    212  gil_function_requires<Regular<ColorBase>>();
    213  }
    214 };
    215 
    226 template <typename ColorBase>
    228 {
    229  void constraints()
    230  {
    231  gil_function_requires<ColorBaseConcept<ColorBase>>();
    232 
    233  static const int num_elements = size<ColorBase>::value;
    234 
    235  using T0 = typename kth_element_type<ColorBase, 0>::type;
    236  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
    237 
    238  static_assert(std::is_same<T0, TN>::value, ""); // better than nothing
    239 
    240  using R0 = typename kth_element_const_reference_type<ColorBase, 0>::type;
    241  R0 r = dynamic_at_c(cb, 0);
    242  boost::ignore_unused(r);
    243  }
    244  ColorBase cb;
    245 };
    246 
    256 template <typename ColorBase>
    258 {
    259  void constraints()
    260  {
    261  gil_function_requires<ColorBaseConcept<ColorBase>>();
    262  gil_function_requires<HomogeneousColorBaseConcept<ColorBase>>();
    263  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
    264  R0 r = dynamic_at_c(cb, 0);
    265  boost::ignore_unused(r);
    266  dynamic_at_c(cb, 0) = dynamic_at_c(cb, 0);
    267  }
    268  ColorBase cb;
    269 };
    270 
    281 template <typename ColorBase>
    283 {
    284  void constraints()
    285  {
    286  gil_function_requires<MutableHomogeneousColorBaseConcept<ColorBase>>();
    287  gil_function_requires<Regular<ColorBase>>();
    288  }
    289 };
    290 
    302 template <typename ColorBase1, typename ColorBase2>
    304 {
    305  void constraints()
    306  {
    307  static_assert(std::is_same
    308  <
    309  typename ColorBase1::layout_t::color_space_t,
    310  typename ColorBase2::layout_t::color_space_t
    311  >::value, "");
    312 
    313 // using e1 = typename kth_semantic_element_type<ColorBase1,0>::type;
    314 // using e2 = typename kth_semantic_element_type<ColorBase2,0>::type;
    315 // "e1 is convertible to e2"
    316  }
    317 };
    318 
    319 }} // namespace boost::gil
    320 
    321 #if defined(BOOST_CLANG)
    322 #pragma clang diagnostic pop
    323 #endif
    324 
    325 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    326 #pragma GCC diagnostic pop
    327 #endif
    328 
    329 #endif
    Homogeneous color base that also has a default constructor. Refines Regular.
    Definition: concepts/color_base.hpp:282
    +
    Homogeneous color base that allows for modifying its elements.
    Definition: concepts/color_base.hpp:257
    Definition: algorithm.hpp:30
    auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
    A mutable accessor to the K-th semantic element of a color base.
    Definition: color_base_algorithm.hpp:119
    -
    Two color bases are compatible if they have the same color space and their elements are compatible...
    Definition: concepts/color_base.hpp:302
    -
    A color base is a container of color elements (such as channels, channel references or channel pointe...
    Definition: concepts/color_base.hpp:136
    -
    Color base which allows for modifying its elements.
    Definition: concepts/color_base.hpp:182
    +
    Two color bases are compatible if they have the same color space and their elements are compatible...
    Definition: concepts/color_base.hpp:303
    +
    A color base is a container of color elements (such as channels, channel references or channel pointe...
    Definition: concepts/color_base.hpp:137
    +
    Color base which allows for modifying its elements.
    Definition: concepts/color_base.hpp:183
    auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
    Provides mutable access to the K-th element, in physical order.
    Definition: color_base.hpp:597
    -
    Color base that also has a default-constructor. Refines Regular.
    Definition: concepts/color_base.hpp:206
    +
    Color base that also has a default-constructor. Refines Regular.
    Definition: concepts/color_base.hpp:207
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    -
    Color base whose elements all have the same type.
    Definition: concepts/color_base.hpp:226
    +
    Color base whose elements all have the same type.
    Definition: concepts/color_base.hpp:227
    diff --git a/html/reference/concepts_2dynamic__step_8hpp_source.html b/html/reference/concepts_2dynamic__step_8hpp_source.html index 238b93c29..d5e2e1193 100644 --- a/html/reference/concepts_2dynamic__step_8hpp_source.html +++ b/html/reference/concepts_2dynamic__step_8hpp_source.html @@ -52,9 +52,9 @@
    concepts/dynamic_step.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
    9 #define BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
    10 
    11 #include <boost/gil/concepts/fwd.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 
    14 #if defined(BOOST_CLANG)
    15 #pragma clang diagnostic push
    16 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    17 #endif
    18 
    19 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    20 #pragma GCC diagnostic push
    21 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    22 #endif
    23 
    24 namespace boost { namespace gil {
    25 
    37 template <typename T>
    39 {
    40  void constraints()
    41  {
    42  using type = typename dynamic_x_step_type<T>::type;
    43  ignore_unused_variable_warning(type{});
    44  }
    45 };
    46 
    57 template <typename T>
    59 {
    60  void constraints()
    61  {
    62  using type = typename dynamic_y_step_type<T>::type;
    63  ignore_unused_variable_warning(type{});
    64  }
    65 };
    66 
    67 }} // namespace boost::gil
    68 
    69 #if defined(BOOST_CLANG)
    70 #pragma clang diagnostic pop
    71 #endif
    72 
    73 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    74 #pragma GCC diagnostic pop
    75 #endif
    76 
    77 #endif
    Concept for iterators, locators and views that can define a type just like the given iterator...
    Definition: concepts/dynamic_step.hpp:38
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
    9 #define BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
    10 
    11 #include <boost/gil/concepts/fwd.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 
    14 #if defined(BOOST_CLANG)
    15 #pragma clang diagnostic push
    16 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    17 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    18 #endif
    19 
    20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    21 #pragma GCC diagnostic push
    22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 namespace boost { namespace gil {
    26 
    38 template <typename T>
    40 {
    41  void constraints()
    42  {
    43  using type = typename dynamic_x_step_type<T>::type;
    44  ignore_unused_variable_warning(type{});
    45  }
    46 };
    47 
    58 template <typename T>
    60 {
    61  void constraints()
    62  {
    63  using type = typename dynamic_y_step_type<T>::type;
    64  ignore_unused_variable_warning(type{});
    65  }
    66 };
    67 
    68 }} // namespace boost::gil
    69 
    70 #if defined(BOOST_CLANG)
    71 #pragma clang diagnostic pop
    72 #endif
    73 
    74 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    75 #pragma GCC diagnostic pop
    76 #endif
    77 
    78 #endif
    Concept for iterators, locators and views that can define a type just like the given iterator...
    Definition: concepts/dynamic_step.hpp:39
    Definition: algorithm.hpp:30
    -
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/dynamic_step.hpp:58
    +
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/dynamic_step.hpp:59
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    diff --git a/html/reference/concepts_2image_8hpp_source.html b/html/reference/concepts_2image_8hpp_source.html index 870549e8f..87b6ebacf 100644 --- a/html/reference/concepts_2image_8hpp_source.html +++ b/html/reference/concepts_2image_8hpp_source.html @@ -52,13 +52,13 @@
    concepts/image.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_HPP
    9 #define BOOST_GIL_CONCEPTS_IMAGE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/image_view.hpp>
    15 #include <boost/gil/concepts/point.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <type_traits>
    19 
    20 #if defined(BOOST_CLANG)
    21 #pragma clang diagnostic push
    22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    26 #pragma GCC diagnostic push
    27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 namespace boost { namespace gil {
    31 
    55 template <typename Image>
    57 {
    58  void constraints()
    59  {
    60  gil_function_requires<Regular<Image>>();
    61 
    62  using view_t = typename Image::view_t;
    63  gil_function_requires<MutableRandomAccessNDImageViewConcept<view_t>>();
    64 
    65  using const_view_t = typename Image::const_view_t;
    66  using pixel_t = typename Image::value_type;
    67  using point_t = typename Image::point_t;
    68  gil_function_requires<PointNDConcept<point_t>>();
    69 
    70  const_view_t cv = const_view(image);
    71  ignore_unused_variable_warning(cv);
    72  view_t v = view(image);
    73  ignore_unused_variable_warning(v);
    74 
    75  pixel_t fill_value;
    76  point_t pt = image.dimensions();
    77  Image image1(pt);
    78  Image image2(pt, 1);
    79  Image image3(pt, fill_value, 1);
    80  image.recreate(pt);
    81  image.recreate(pt, 1);
    82  image.recreate(pt, fill_value, 1);
    83  }
    84  Image image;
    85 };
    86 
    87 
    107 template <typename Image>
    109 {
    110  void constraints()
    111  {
    112  gil_function_requires<RandomAccessNDImageConcept<Image>>();
    113  using x_coord_t = typename Image::x_coord_t;
    114  using y_coord_t = typename Image::y_coord_t;
    115  using value_t = typename Image::value_type;
    116 
    117  gil_function_requires<MutableRandomAccess2DImageViewConcept<typename Image::view_t>>();
    118 
    119  x_coord_t w=image.width();
    120  y_coord_t h=image.height();
    121  value_t fill_value;
    122  Image im1(w,h);
    123  Image im2(w,h,1);
    124  Image im3(w,h,fill_value,1);
    125  image.recreate(w,h);
    126  image.recreate(w,h,1);
    127  image.recreate(w,h,fill_value,1);
    128  }
    129  Image image;
    130 };
    131 
    142 template <typename Image>
    144 {
    145  void constraints()
    146  {
    147  gil_function_requires<RandomAccess2DImageConcept<Image>>();
    148  gil_function_requires<MutableImageViewConcept<typename Image::view_t>>();
    149  using coord_t = typename Image::coord_t;
    150  static_assert(num_channels<Image>::value == mp11::mp_size<typename color_space_type<Image>::type>::value, "");
    151 
    152  static_assert(std::is_same<coord_t, typename Image::x_coord_t>::value, "");
    153  static_assert(std::is_same<coord_t, typename Image::y_coord_t>::value, "");
    154  }
    155  Image image;
    156 };
    157 
    158 }} // namespace boost::gil
    159 
    160 #if defined(BOOST_CLANG)
    161 #pragma clang diagnostic pop
    162 #endif
    163 
    164 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    165 #pragma GCC diagnostic pop
    166 #endif
    167 
    168 #endif
    Definition: algorithm.hpp:30
    -
    N-dimensional container of values.
    Definition: concepts/image.hpp:56
    -
    2-dimensional image whose value type models PixelValueConcept
    Definition: concepts/image.hpp:143
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:40
    -
    2-dimensional container of values
    Definition: concepts/image.hpp:108
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    -
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:447
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_HPP
    9 #define BOOST_GIL_CONCEPTS_IMAGE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/image_view.hpp>
    15 #include <boost/gil/concepts/point.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <type_traits>
    19 
    20 #if defined(BOOST_CLANG)
    21 #pragma clang diagnostic push
    22 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    23 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    24 #endif
    25 
    26 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    27 #pragma GCC diagnostic push
    28 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    29 #endif
    30 
    31 namespace boost { namespace gil {
    32 
    56 template <typename Image>
    58 {
    59  void constraints()
    60  {
    61  gil_function_requires<Regular<Image>>();
    62 
    63  using view_t = typename Image::view_t;
    64  gil_function_requires<MutableRandomAccessNDImageViewConcept<view_t>>();
    65 
    66  using const_view_t = typename Image::const_view_t;
    67  using pixel_t = typename Image::value_type;
    68  using point_t = typename Image::point_t;
    69  gil_function_requires<PointNDConcept<point_t>>();
    70 
    71  const_view_t cv = const_view(image);
    72  ignore_unused_variable_warning(cv);
    73  view_t v = view(image);
    74  ignore_unused_variable_warning(v);
    75 
    76  pixel_t fill_value;
    77  point_t pt = image.dimensions();
    78  Image image1(pt);
    79  Image image2(pt, 1);
    80  Image image3(pt, fill_value, 1);
    81  image.recreate(pt);
    82  image.recreate(pt, 1);
    83  image.recreate(pt, fill_value, 1);
    84  }
    85  Image image;
    86 };
    87 
    88 
    108 template <typename Image>
    110 {
    111  void constraints()
    112  {
    113  gil_function_requires<RandomAccessNDImageConcept<Image>>();
    114  using x_coord_t = typename Image::x_coord_t;
    115  using y_coord_t = typename Image::y_coord_t;
    116  using value_t = typename Image::value_type;
    117 
    118  gil_function_requires<MutableRandomAccess2DImageViewConcept<typename Image::view_t>>();
    119 
    120  x_coord_t w=image.width();
    121  y_coord_t h=image.height();
    122  value_t fill_value;
    123  Image im1(w,h);
    124  Image im2(w,h,1);
    125  Image im3(w,h,fill_value,1);
    126  image.recreate(w,h);
    127  image.recreate(w,h,1);
    128  image.recreate(w,h,fill_value,1);
    129  }
    130  Image image;
    131 };
    132 
    143 template <typename Image>
    145 {
    146  void constraints()
    147  {
    148  gil_function_requires<RandomAccess2DImageConcept<Image>>();
    149  gil_function_requires<MutableImageViewConcept<typename Image::view_t>>();
    150  using coord_t = typename Image::coord_t;
    151  static_assert(num_channels<Image>::value == mp11::mp_size<typename color_space_type<Image>::type>::value, "");
    152 
    153  static_assert(std::is_same<coord_t, typename Image::x_coord_t>::value, "");
    154  static_assert(std::is_same<coord_t, typename Image::y_coord_t>::value, "");
    155  }
    156  Image image;
    157 };
    158 
    159 }} // namespace boost::gil
    160 
    161 #if defined(BOOST_CLANG)
    162 #pragma clang diagnostic pop
    163 #endif
    164 
    165 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    166 #pragma GCC diagnostic pop
    167 #endif
    168 
    169 #endif
    Definition: algorithm.hpp:30
    +
    N-dimensional container of values.
    Definition: concepts/image.hpp:57
    +
    2-dimensional image whose value type models PixelValueConcept
    Definition: concepts/image.hpp:144
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    +
    2-dimensional container of values
    Definition: concepts/image.hpp:109
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    +
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:539
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    diff --git a/html/reference/concepts_2image__view_8hpp_source.html b/html/reference/concepts_2image__view_8hpp_source.html index b1e7213a3..84cefa694 100644 --- a/html/reference/concepts_2image__view_8hpp_source.html +++ b/html/reference/concepts_2image__view_8hpp_source.html @@ -52,24 +52,24 @@
    concepts/image_view.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
    9 #define BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/pixel_dereference.hpp>
    16 #include <boost/gil/concepts/pixel_iterator.hpp>
    17 #include <boost/gil/concepts/pixel_locator.hpp>
    18 #include <boost/gil/concepts/point.hpp>
    19 #include <boost/gil/concepts/detail/utility.hpp>
    20 
    21 #include <cstddef>
    22 #include <iterator>
    23 #include <type_traits>
    24 
    25 #if defined(BOOST_CLANG)
    26 #pragma clang diagnostic push
    27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    31 #pragma GCC diagnostic push
    32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    33 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
    34 #endif
    35 
    36 namespace boost { namespace gil {
    37 
    41 
    45 
    49 
    101 template <typename View>
    103 {
    104  void constraints()
    105  {
    106  gil_function_requires<Regular<View>>();
    107 
    108  using value_type = typename View::value_type;
    109  using reference = typename View::reference; // result of dereferencing
    110  using pointer = typename View::pointer;
    111  using difference_type = typename View::difference_type; // result of operator-(1d_iterator,1d_iterator)
    112  using const_t = typename View::const_t; // same as this type, but over const values
    113  using point_t = typename View::point_t; // N-dimensional point
    114  using locator = typename View::locator; // N-dimensional locator
    115  using iterator = typename View::iterator;
    116  using const_iterator = typename View::const_iterator;
    117  using reverse_iterator = typename View::reverse_iterator;
    118  using size_type = typename View::size_type;
    119  static const std::size_t N=View::num_dimensions;
    120 
    121  gil_function_requires<RandomAccessNDLocatorConcept<locator>>();
    122  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator>>();
    123  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator>>();
    124 
    125  using first_it_type = typename View::template axis<0>::iterator;
    126  using last_it_type = typename View::template axis<N-1>::iterator;
    127  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
    128  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
    129 
    130 // static_assert(typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value, "");
    131 // static_assert(typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value, "");
    132 
    133  // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
    134  gil_function_requires<PointNDConcept<point_t>>();
    135  static_assert(point_t::num_dimensions == N, "");
    136  static_assert(std::is_same
    137  <
    138  typename std::iterator_traits<first_it_type>::difference_type,
    139  typename point_t::template axis<0>::coord_t
    140  >::value, "");
    141  static_assert(std::is_same
    142  <
    143  typename std::iterator_traits<last_it_type>::difference_type,
    144  typename point_t::template axis<N-1>::coord_t
    145  >::value, "");
    146 
    147  point_t p;
    148  locator lc;
    149  iterator it;
    150  reverse_iterator rit;
    151  difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
    152 
    153  View(p,lc); // view must be constructible from a locator and a point
    154 
    155  p = view.dimensions();
    156  lc = view.pixels();
    157  size_type sz = view.size(); ignore_unused_variable_warning(sz);
    158  bool is_contiguous = view.is_1d_traversable();
    159  ignore_unused_variable_warning(is_contiguous);
    160 
    161  it = view.begin();
    162  it = view.end();
    163  rit = view.rbegin();
    164  rit = view.rend();
    165 
    166  reference r1 = view[d]; ignore_unused_variable_warning(r1); // 1D access
    167  reference r2 = view(p); ignore_unused_variable_warning(r2); // 2D access
    168 
    169  // get 1-D iterator of any dimension at a given pixel location
    170  first_it_type fi = view.template axis_iterator<0>(p);
    171  ignore_unused_variable_warning(fi);
    172  last_it_type li = view.template axis_iterator<N-1>(p);
    173  ignore_unused_variable_warning(li);
    174 
    175  using deref_t = PixelDereferenceAdaptorArchetype<typename View::value_type>;
    176  using dtype = typename View::template add_deref<deref_t>::type;
    177  }
    178  View view;
    179 };
    180 
    219 template <typename View>
    221 {
    222  void constraints()
    223  {
    224  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
    225  static_assert(View::num_dimensions == 2, "");
    226 
    227  // TODO: This executes the requirements for RandomAccessNDLocatorConcept again. Fix it to improve compile time
    228  gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator>>();
    229 
    230  using dynamic_x_step_t = typename dynamic_x_step_type<View>::type;
    231  using dynamic_y_step_t = typename dynamic_y_step_type<View>::type;
    232  using transposed_t = typename transposed_type<View>::type;
    233  using x_iterator = typename View::x_iterator;
    234  using y_iterator = typename View::y_iterator;
    235  using x_coord_t = typename View::x_coord_t;
    236  using y_coord_t = typename View::y_coord_t;
    237  using xy_locator = typename View::xy_locator;
    238 
    239  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    240  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    241  x_iterator xit;
    242  y_iterator yit;
    243  typename View::point_t d;
    244 
    245  View(xd, yd, xy_locator()); // constructible with width, height, 2d_locator
    246 
    247  xy_locator lc = view.xy_at(xd, yd);
    248  lc = view.xy_at(d);
    249 
    250  typename View::reference r = view(xd, yd);
    251  ignore_unused_variable_warning(r);
    252  xd = view.width();
    253  yd = view.height();
    254 
    255  xit = view.x_at(d);
    256  xit = view.x_at(xd,yd);
    257  xit = view.row_begin(xd);
    258  xit = view.row_end(xd);
    259 
    260  yit = view.y_at(d);
    261  yit = view.y_at(xd,yd);
    262  yit = view.col_begin(xd);
    263  yit = view.col_end(xd);
    264  }
    265  View view;
    266 };
    267 
    272 template <typename View>
    274 {
    275  void constraints()
    276  {
    277  using value_type = typename View::value_type;
    278  using iterator = typename View::iterator;
    279  using const_iterator = typename View::const_iterator;
    280  using reference = typename View::reference;
    281  using const_reference = typename View::const_reference;
    282  using pointer = typename View::pointer;
    283  using difference_type = typename View::difference_type;
    284  using size_type= typename View::size_type;
    285 
    286  iterator i;
    287  i = view1.begin();
    288  i = view2.end();
    289 
    290  const_iterator ci;
    291  ci = view1.begin();
    292  ci = view2.end();
    293 
    294  size_type s;
    295  s = view1.size();
    296  s = view2.size();
    297  ignore_unused_variable_warning(s);
    298 
    299  view1.empty();
    300 
    301  view1.swap(view2);
    302  }
    303  View view1;
    304  View view2;
    305 };
    306 
    311 template <typename View>
    313 {
    314  void constraints()
    315  {
    316  gil_function_requires<CollectionImageViewConcept<View>>();
    317 
    318  using reference = typename View::reference;
    319  using const_reference = typename View::const_reference;
    320 
    321  reference r = view.front();
    322  ignore_unused_variable_warning(r);
    323 
    324  const_reference cr = view.front();
    325  ignore_unused_variable_warning(cr);
    326  }
    327  View view;
    328 };
    329 
    334 template <typename View>
    336 {
    337  void constraints()
    338  {
    339  gil_function_requires<CollectionImageViewConcept<View>>();
    340 
    341  using reverse_iterator = typename View::reverse_iterator;
    342  using reference = typename View::reference;
    343  using const_reference = typename View::const_reference;
    344 
    345  reverse_iterator i;
    346  i = view.rbegin();
    347  i = view.rend();
    348 
    349  reference r = view.back();
    350  ignore_unused_variable_warning(r);
    351 
    352  const_reference cr = view.back();
    353  ignore_unused_variable_warning(cr);
    354  }
    355  View view;
    356 };
    357 
    373 template <typename View>
    375 {
    376  void constraints()
    377  {
    378  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
    379 
    380  // TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
    381  gil_function_requires<PixelLocatorConcept<typename View::xy_locator>>();
    382 
    383  static_assert(std::is_same<typename View::x_coord_t, typename View::y_coord_t>::value, "");
    384 
    385  using coord_t = typename View::coord_t; // 1D difference type (same for all dimensions)
    386  std::size_t num_chan = view.num_channels(); ignore_unused_variable_warning(num_chan);
    387  }
    388  View view;
    389 };
    390 
    391 namespace detail {
    392 
    394 template <typename View>
    396 {
    397  void constraints()
    398  {
    399  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();
    400 
    401  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
    402 
    403  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    404  <
    405  typename View::reverse_iterator
    406  >>();
    407 
    408  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    409  <
    410  typename View::template axis<0>::iterator
    411  >>();
    412 
    413  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    414  <
    415  typename View::template axis<View::num_dimensions - 1>::iterator
    416  >>();
    417 
    418  typename View::difference_type diff;
    419  initialize_it(diff);
    420  ignore_unused_variable_warning(diff);
    421 
    422  typename View::point_t pt;
    423  typename View::value_type v;
    424  initialize_it(v);
    425 
    426  view[diff] = v;
    427  view(pt) = v;
    428  }
    429  View view;
    430 };
    431 
    433 template <typename View>
    435 {
    436  void constraints()
    437  {
    438  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
    439  typename View::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    440  typename View::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    441  typename View::value_type v; initialize_it(v);
    442  view(xd, yd) = v;
    443  }
    444  View view;
    445 };
    446 
    448 template <typename View>
    450 {
    451  void constraints()
    452  {
    453  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
    454  }
    455 };
    456 
    457 } // namespace detail
    458 
    468 template <typename View>
    470 {
    471  void constraints()
    472  {
    473  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
    474  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
    475  }
    476 };
    477 
    485 template <typename View>
    487 {
    488  void constraints()
    489  {
    490  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
    491  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
    492  }
    493 };
    494 
    502 template <typename View>
    504 {
    505  void constraints()
    506  {
    507  gil_function_requires<ImageViewConcept<View>>();
    508  gil_function_requires<detail::PixelImageViewIsMutableConcept<View>>();
    509  }
    510 };
    511 
    520 template <typename V1, typename V2>
    522  : pixels_are_compatible<typename V1::value_type, typename V2::value_type>
    523 {
    524 };
    525 
    537 template <typename V1, typename V2>
    539 {
    540  void constraints()
    541  {
    542  static_assert(views_are_compatible<V1, V2>::value, "");
    543  }
    544 };
    545 
    546 }} // namespace boost::gil
    547 
    548 #if defined(BOOST_CLANG)
    549 #pragma clang diagnostic pop
    550 #endif
    551 
    552 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    553 #pragma GCC diagnostic pop
    554 #endif
    555 
    556 #endif
    2-dimensional view over mutable values
    Definition: concepts/image_view.hpp:486
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
    9 #define BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/pixel_dereference.hpp>
    16 #include <boost/gil/concepts/pixel_iterator.hpp>
    17 #include <boost/gil/concepts/pixel_locator.hpp>
    18 #include <boost/gil/concepts/point.hpp>
    19 #include <boost/gil/concepts/detail/utility.hpp>
    20 
    21 #include <cstddef>
    22 #include <iterator>
    23 #include <type_traits>
    24 
    25 #if defined(BOOST_CLANG)
    26 #pragma clang diagnostic push
    27 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    28 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    29 #endif
    30 
    31 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    32 #pragma GCC diagnostic push
    33 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    34 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
    35 #endif
    36 
    37 namespace boost { namespace gil {
    38 
    42 
    46 
    50 
    102 template <typename View>
    104 {
    105  void constraints()
    106  {
    107  gil_function_requires<Regular<View>>();
    108 
    109  using value_type = typename View::value_type;
    110  using reference = typename View::reference; // result of dereferencing
    111  using pointer = typename View::pointer;
    112  using difference_type = typename View::difference_type; // result of operator-(1d_iterator,1d_iterator)
    113  using const_t = typename View::const_t; // same as this type, but over const values
    114  using point_t = typename View::point_t; // N-dimensional point
    115  using locator = typename View::locator; // N-dimensional locator
    116  using iterator = typename View::iterator;
    117  using const_iterator = typename View::const_iterator;
    118  using reverse_iterator = typename View::reverse_iterator;
    119  using size_type = typename View::size_type;
    120  static const std::size_t N=View::num_dimensions;
    121 
    122  gil_function_requires<RandomAccessNDLocatorConcept<locator>>();
    123  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator>>();
    124  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator>>();
    125 
    126  using first_it_type = typename View::template axis<0>::iterator;
    127  using last_it_type = typename View::template axis<N-1>::iterator;
    128  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
    129  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
    130 
    131 // static_assert(typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value, "");
    132 // static_assert(typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value, "");
    133 
    134  // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
    135  gil_function_requires<PointNDConcept<point_t>>();
    136  static_assert(point_t::num_dimensions == N, "");
    137  static_assert(std::is_same
    138  <
    139  typename std::iterator_traits<first_it_type>::difference_type,
    140  typename point_t::template axis<0>::coord_t
    141  >::value, "");
    142  static_assert(std::is_same
    143  <
    144  typename std::iterator_traits<last_it_type>::difference_type,
    145  typename point_t::template axis<N-1>::coord_t
    146  >::value, "");
    147 
    148  point_t p;
    149  locator lc;
    150  iterator it;
    151  reverse_iterator rit;
    152  difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
    153 
    154  View(p,lc); // view must be constructible from a locator and a point
    155 
    156  p = view.dimensions();
    157  lc = view.pixels();
    158  size_type sz = view.size(); ignore_unused_variable_warning(sz);
    159  bool is_contiguous = view.is_1d_traversable();
    160  ignore_unused_variable_warning(is_contiguous);
    161 
    162  it = view.begin();
    163  it = view.end();
    164  rit = view.rbegin();
    165  rit = view.rend();
    166 
    167  reference r1 = view[d]; ignore_unused_variable_warning(r1); // 1D access
    168  reference r2 = view(p); ignore_unused_variable_warning(r2); // 2D access
    169 
    170  // get 1-D iterator of any dimension at a given pixel location
    171  first_it_type fi = view.template axis_iterator<0>(p);
    172  ignore_unused_variable_warning(fi);
    173  last_it_type li = view.template axis_iterator<N-1>(p);
    174  ignore_unused_variable_warning(li);
    175 
    176  using deref_t = PixelDereferenceAdaptorArchetype<typename View::value_type>;
    177  using dtype = typename View::template add_deref<deref_t>::type;
    178  }
    179  View view;
    180 };
    181 
    220 template <typename View>
    222 {
    223  void constraints()
    224  {
    225  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
    226  static_assert(View::num_dimensions == 2, "");
    227 
    228  // TODO: This executes the requirements for RandomAccessNDLocatorConcept again. Fix it to improve compile time
    229  gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator>>();
    230 
    231  using dynamic_x_step_t = typename dynamic_x_step_type<View>::type;
    232  using dynamic_y_step_t = typename dynamic_y_step_type<View>::type;
    233  using transposed_t = typename transposed_type<View>::type;
    234  using x_iterator = typename View::x_iterator;
    235  using y_iterator = typename View::y_iterator;
    236  using x_coord_t = typename View::x_coord_t;
    237  using y_coord_t = typename View::y_coord_t;
    238  using xy_locator = typename View::xy_locator;
    239 
    240  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    241  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    242  x_iterator xit;
    243  y_iterator yit;
    244  typename View::point_t d;
    245 
    246  View(xd, yd, xy_locator()); // constructible with width, height, 2d_locator
    247 
    248  xy_locator lc = view.xy_at(xd, yd);
    249  lc = view.xy_at(d);
    250 
    251  typename View::reference r = view(xd, yd);
    252  ignore_unused_variable_warning(r);
    253  xd = view.width();
    254  yd = view.height();
    255 
    256  xit = view.x_at(d);
    257  xit = view.x_at(xd,yd);
    258  xit = view.row_begin(xd);
    259  xit = view.row_end(xd);
    260 
    261  yit = view.y_at(d);
    262  yit = view.y_at(xd,yd);
    263  yit = view.col_begin(xd);
    264  yit = view.col_end(xd);
    265  }
    266  View view;
    267 };
    268 
    273 template <typename View>
    275 {
    276  void constraints()
    277  {
    278  using value_type = typename View::value_type;
    279  using iterator = typename View::iterator;
    280  using const_iterator = typename View::const_iterator;
    281  using reference = typename View::reference;
    282  using const_reference = typename View::const_reference;
    283  using pointer = typename View::pointer;
    284  using difference_type = typename View::difference_type;
    285  using size_type= typename View::size_type;
    286 
    287  iterator i;
    288  i = view1.begin();
    289  i = view2.end();
    290 
    291  const_iterator ci;
    292  ci = view1.begin();
    293  ci = view2.end();
    294 
    295  size_type s;
    296  s = view1.size();
    297  s = view2.size();
    298  ignore_unused_variable_warning(s);
    299 
    300  view1.empty();
    301 
    302  view1.swap(view2);
    303  }
    304  View view1;
    305  View view2;
    306 };
    307 
    312 template <typename View>
    314 {
    315  void constraints()
    316  {
    317  gil_function_requires<CollectionImageViewConcept<View>>();
    318 
    319  using reference = typename View::reference;
    320  using const_reference = typename View::const_reference;
    321 
    322  reference r = view.front();
    323  ignore_unused_variable_warning(r);
    324 
    325  const_reference cr = view.front();
    326  ignore_unused_variable_warning(cr);
    327  }
    328  View view;
    329 };
    330 
    335 template <typename View>
    337 {
    338  void constraints()
    339  {
    340  gil_function_requires<CollectionImageViewConcept<View>>();
    341 
    342  using reverse_iterator = typename View::reverse_iterator;
    343  using reference = typename View::reference;
    344  using const_reference = typename View::const_reference;
    345 
    346  reverse_iterator i;
    347  i = view.rbegin();
    348  i = view.rend();
    349 
    350  reference r = view.back();
    351  ignore_unused_variable_warning(r);
    352 
    353  const_reference cr = view.back();
    354  ignore_unused_variable_warning(cr);
    355  }
    356  View view;
    357 };
    358 
    374 template <typename View>
    376 {
    377  void constraints()
    378  {
    379  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
    380 
    381  // TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
    382  gil_function_requires<PixelLocatorConcept<typename View::xy_locator>>();
    383 
    384  static_assert(std::is_same<typename View::x_coord_t, typename View::y_coord_t>::value, "");
    385 
    386  using coord_t = typename View::coord_t; // 1D difference type (same for all dimensions)
    387  std::size_t num_chan = view.num_channels(); ignore_unused_variable_warning(num_chan);
    388  }
    389  View view;
    390 };
    391 
    392 namespace detail {
    393 
    395 template <typename View>
    397 {
    398  void constraints()
    399  {
    400  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();
    401 
    402  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
    403 
    404  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    405  <
    406  typename View::reverse_iterator
    407  >>();
    408 
    409  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    410  <
    411  typename View::template axis<0>::iterator
    412  >>();
    413 
    414  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    415  <
    416  typename View::template axis<View::num_dimensions - 1>::iterator
    417  >>();
    418 
    419  typename View::difference_type diff;
    420  initialize_it(diff);
    421  ignore_unused_variable_warning(diff);
    422 
    423  typename View::point_t pt;
    424  typename View::value_type v;
    425  initialize_it(v);
    426 
    427  view[diff] = v;
    428  view(pt) = v;
    429  }
    430  View view;
    431 };
    432 
    434 template <typename View>
    436 {
    437  void constraints()
    438  {
    439  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
    440  typename View::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    441  typename View::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    442  typename View::value_type v; initialize_it(v);
    443  view(xd, yd) = v;
    444  }
    445  View view;
    446 };
    447 
    449 template <typename View>
    451 {
    452  void constraints()
    453  {
    454  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
    455  }
    456 };
    457 
    458 } // namespace detail
    459 
    469 template <typename View>
    471 {
    472  void constraints()
    473  {
    474  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
    475  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
    476  }
    477 };
    478 
    486 template <typename View>
    488 {
    489  void constraints()
    490  {
    491  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
    492  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
    493  }
    494 };
    495 
    503 template <typename View>
    505 {
    506  void constraints()
    507  {
    508  gil_function_requires<ImageViewConcept<View>>();
    509  gil_function_requires<detail::PixelImageViewIsMutableConcept<View>>();
    510  }
    511 };
    512 
    521 template <typename V1, typename V2>
    523  : pixels_are_compatible<typename V1::value_type, typename V2::value_type>
    524 {
    525 };
    526 
    538 template <typename V1, typename V2>
    540 {
    541  void constraints()
    542  {
    543  static_assert(views_are_compatible<V1, V2>::value, "");
    544  }
    545 };
    546 
    547 }} // namespace boost::gil
    548 
    549 #if defined(BOOST_CLANG)
    550 #pragma clang diagnostic pop
    551 #endif
    552 
    553 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    554 #pragma GCC diagnostic pop
    555 #endif
    556 
    557 #endif
    2-dimensional view over mutable values
    Definition: concepts/image_view.hpp:487
    Definition: algorithm.hpp:30
    - -
    N-dimensional view over mutable values.
    Definition: concepts/image_view.hpp:469
    -
    GIL view as Collection.
    Definition: concepts/image_view.hpp:273
    -
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:521
    -
    GIL view as ReversibleCollection.
    Definition: concepts/image_view.hpp:335
    - + +
    N-dimensional view over mutable values.
    Definition: concepts/image_view.hpp:470
    +
    GIL view as Collection.
    Definition: concepts/image_view.hpp:274
    +
    Returns whether two views are compatible.
    Definition: concepts/image_view.hpp:522
    +
    GIL view as ReversibleCollection.
    Definition: concepts/image_view.hpp:336
    +
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    GIL&#39;s 2-dimensional view over mutable GIL pixels.
    Definition: concepts/image_view.hpp:503
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:225
    -
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:374
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    -
    2-dimensional view over immutable values
    Definition: concepts/image_view.hpp:220
    -
    GIL view as ForwardCollection.
    Definition: concepts/image_view.hpp:312
    -
    Views are compatible if they have the same color spaces and compatible channel values.
    Definition: concepts/image_view.hpp:538
    -
    N-dimensional view over immutable values.
    Definition: concepts/image_view.hpp:102
    -
    Definition: concepts/image_view.hpp:449
    +
    GIL&#39;s 2-dimensional view over mutable GIL pixels.
    Definition: concepts/image_view.hpp:504
    +
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    +
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    +
    2-dimensional view over immutable values
    Definition: concepts/image_view.hpp:221
    +
    GIL view as ForwardCollection.
    Definition: concepts/image_view.hpp:313
    +
    Views are compatible if they have the same color spaces and compatible channel values.
    Definition: concepts/image_view.hpp:539
    +
    N-dimensional view over immutable values.
    Definition: concepts/image_view.hpp:103
    +
    Definition: concepts/image_view.hpp:450
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    diff --git a/html/reference/concepts_2pixel_8hpp_source.html b/html/reference/concepts_2pixel_8hpp_source.html index b29321b99..a4410cb04 100644 --- a/html/reference/concepts_2pixel_8hpp_source.html +++ b/html/reference/concepts_2pixel_8hpp_source.html @@ -52,18 +52,18 @@
    concepts/pixel.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/channel.hpp>
    13 #include <boost/gil/concepts/color.hpp>
    14 #include <boost/gil/concepts/color_base.hpp>
    15 #include <boost/gil/concepts/concept_check.hpp>
    16 #include <boost/gil/concepts/fwd.hpp>
    17 #include <boost/gil/concepts/pixel_based.hpp>
    18 #include <boost/gil/concepts/detail/type_traits.hpp>
    19 #include <boost/gil/detail/mp11.hpp>
    20 
    21 #include <cstddef>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    27 #endif
    28 
    29 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    30 #pragma GCC diagnostic push
    31 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    32 #endif
    33 
    34 namespace boost { namespace gil {
    35 
    61 template <typename P>
    63 {
    64  void constraints()
    65  {
    66  gil_function_requires<ColorBaseConcept<P>>();
    67  gil_function_requires<PixelBasedConcept<P>>();
    68 
    69  static_assert(is_pixel<P>::value, "");
    70  static const bool is_mutable = P::is_mutable;
    71  ignore_unused_variable_warning(is_mutable);
    72 
    73  using value_type = typename P::value_type;
    74  // TODO: Is the cyclic dependency intentional? --mloskot
    75  // gil_function_requires<PixelValueConcept<value_type>>();
    76 
    77  using reference = typename P::reference;
    78  gil_function_requires<PixelConcept
    79  <
    80  typename detail::remove_const_and_reference<reference>::type
    81  >>();
    82 
    83  using const_reference = typename P::const_reference;
    84  gil_function_requires<PixelConcept
    85  <
    86  typename detail::remove_const_and_reference<const_reference>::type
    87  >>();
    88  }
    89 };
    90 
    99 template <typename P>
    101 {
    102  void constraints()
    103  {
    104  gil_function_requires<PixelConcept<P>>();
    105  static_assert(P::is_mutable, "");
    106  }
    107 };
    108 
    121 template <typename P>
    123 {
    124  void constraints()
    125  {
    126  gil_function_requires<PixelConcept<P>>();
    127  gil_function_requires<HomogeneousColorBaseConcept<P>>();
    128  gil_function_requires<HomogeneousPixelBasedConcept<P>>();
    129  p[0];
    130  }
    131  P p;
    132 };
    133 
    146 template <typename P>
    148 {
    149  void constraints()
    150  {
    151  gil_function_requires<HomogeneousPixelConcept<P>>();
    152  gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
    153  p[0] = v;
    154  v = p[0];
    155  }
    156  typename P::template element_type<P>::type v;
    157  P p;
    158 };
    159 
    168 template <typename P>
    170 {
    171  void constraints()
    172  {
    173  gil_function_requires<PixelConcept<P>>();
    174  gil_function_requires<Regular<P>>();
    175  }
    176 };
    177 
    186 template <typename P>
    188 {
    189  void constraints()
    190  {
    191  gil_function_requires<HomogeneousPixelConcept<P>>();
    192  gil_function_requires<Regular<P>>();
    193  static_assert(std::is_same<P, typename P::value_type>::value, "");
    194  }
    195 };
    196 
    197 namespace detail {
    198 
    199 template <typename P1, typename P2, int K>
    200 struct channels_are_pairwise_compatible
    201  : mp11::mp_and
    202  <
    203  channels_are_pairwise_compatible<P1, P2, K - 1>,
    204  channels_are_compatible
    205  <
    206  typename kth_semantic_element_reference_type<P1, K>::type,
    207  typename kth_semantic_element_reference_type<P2, K>::type
    208  >
    209  >
    210 {
    211 };
    212 
    213 template <typename P1, typename P2>
    214 struct channels_are_pairwise_compatible<P1, P2, -1> : std::true_type {};
    215 
    216 } // namespace detail
    217 
    224 template <typename P1, typename P2>
    226  : mp11::mp_and
    227  <
    228  typename color_spaces_are_compatible
    229  <
    230  typename color_space_type<P1>::type,
    231  typename color_space_type<P2>::type
    232  >::type,
    233  detail::channels_are_pairwise_compatible
    234  <
    235  P1, P2, num_channels<P1>::value - 1
    236  >
    237  >
    238 {
    239 };
    240 
    254 template <typename P1, typename P2>
    256 {
    257  void constraints()
    258  {
    259  static_assert(pixels_are_compatible<P1, P2>::value, "");
    260  }
    261 };
    262 
    275 template <typename SrcP, typename DstP>
    277 {
    278  void constraints()
    279  {
    280  gil_function_requires<PixelConcept<SrcP>>();
    281  gil_function_requires<MutablePixelConcept<DstP>>();
    282  color_convert(src, dst);
    283  }
    284  SrcP src;
    285  DstP dst;
    286 };
    287 
    288 }} // namespace boost::gil
    289 
    290 #if defined(BOOST_CLANG)
    291 #pragma clang diagnostic pop
    292 #endif
    293 
    294 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    295 #pragma GCC diagnostic pop
    296 #endif
    297 
    298 #endif
    Homogeneous pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:147
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/channel.hpp>
    13 #include <boost/gil/concepts/color.hpp>
    14 #include <boost/gil/concepts/color_base.hpp>
    15 #include <boost/gil/concepts/concept_check.hpp>
    16 #include <boost/gil/concepts/fwd.hpp>
    17 #include <boost/gil/concepts/pixel_based.hpp>
    18 #include <boost/gil/concepts/detail/type_traits.hpp>
    19 #include <boost/gil/detail/mp11.hpp>
    20 
    21 #include <cstddef>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    31 #pragma GCC diagnostic push
    32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    33 #endif
    34 
    35 namespace boost { namespace gil {
    36 
    62 template <typename P>
    64 {
    65  void constraints()
    66  {
    67  gil_function_requires<ColorBaseConcept<P>>();
    68  gil_function_requires<PixelBasedConcept<P>>();
    69 
    70  static_assert(is_pixel<P>::value, "");
    71  static const bool is_mutable = P::is_mutable;
    72  ignore_unused_variable_warning(is_mutable);
    73 
    74  using value_type = typename P::value_type;
    75  // TODO: Is the cyclic dependency intentional? --mloskot
    76  // gil_function_requires<PixelValueConcept<value_type>>();
    77 
    78  using reference = typename P::reference;
    79  gil_function_requires<PixelConcept
    80  <
    81  typename detail::remove_const_and_reference<reference>::type
    82  >>();
    83 
    84  using const_reference = typename P::const_reference;
    85  gil_function_requires<PixelConcept
    86  <
    87  typename detail::remove_const_and_reference<const_reference>::type
    88  >>();
    89  }
    90 };
    91 
    100 template <typename P>
    102 {
    103  void constraints()
    104  {
    105  gil_function_requires<PixelConcept<P>>();
    106  static_assert(P::is_mutable, "");
    107  }
    108 };
    109 
    122 template <typename P>
    124 {
    125  void constraints()
    126  {
    127  gil_function_requires<PixelConcept<P>>();
    128  gil_function_requires<HomogeneousColorBaseConcept<P>>();
    129  gil_function_requires<HomogeneousPixelBasedConcept<P>>();
    130  p[0];
    131  }
    132  P p;
    133 };
    134 
    147 template <typename P>
    149 {
    150  void constraints()
    151  {
    152  gil_function_requires<HomogeneousPixelConcept<P>>();
    153  gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
    154  p[0] = v;
    155  v = p[0];
    156  }
    157  typename P::template element_type<P>::type v;
    158  P p;
    159 };
    160 
    169 template <typename P>
    171 {
    172  void constraints()
    173  {
    174  gil_function_requires<PixelConcept<P>>();
    175  gil_function_requires<Regular<P>>();
    176  }
    177 };
    178 
    187 template <typename P>
    189 {
    190  void constraints()
    191  {
    192  gil_function_requires<HomogeneousPixelConcept<P>>();
    193  gil_function_requires<Regular<P>>();
    194  static_assert(std::is_same<P, typename P::value_type>::value, "");
    195  }
    196 };
    197 
    198 namespace detail {
    199 
    200 template <typename P1, typename P2, int K>
    201 struct channels_are_pairwise_compatible
    202  : mp11::mp_and
    203  <
    204  channels_are_pairwise_compatible<P1, P2, K - 1>,
    205  channels_are_compatible
    206  <
    207  typename kth_semantic_element_reference_type<P1, K>::type,
    208  typename kth_semantic_element_reference_type<P2, K>::type
    209  >
    210  >
    211 {
    212 };
    213 
    214 template <typename P1, typename P2>
    215 struct channels_are_pairwise_compatible<P1, P2, -1> : std::true_type {};
    216 
    217 } // namespace detail
    218 
    225 template <typename P1, typename P2>
    227  : mp11::mp_and
    228  <
    229  typename color_spaces_are_compatible
    230  <
    231  typename color_space_type<P1>::type,
    232  typename color_space_type<P2>::type
    233  >::type,
    234  detail::channels_are_pairwise_compatible
    235  <
    236  P1, P2, num_channels<P1>::value - 1
    237  >
    238  >
    239 {
    240 };
    241 
    255 template <typename P1, typename P2>
    257 {
    258  void constraints()
    259  {
    260  static_assert(pixels_are_compatible<P1, P2>::value, "");
    261  }
    262 };
    263 
    276 template <typename SrcP, typename DstP>
    278 {
    279  void constraints()
    280  {
    281  gil_function_requires<PixelConcept<SrcP>>();
    282  gil_function_requires<MutablePixelConcept<DstP>>();
    283  color_convert(src, dst);
    284  }
    285  SrcP src;
    286  DstP dst;
    287 };
    288 
    289 }} // namespace boost::gil
    290 
    291 #if defined(BOOST_CLANG)
    292 #pragma clang diagnostic pop
    293 #endif
    294 
    295 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    296 #pragma GCC diagnostic pop
    297 #endif
    298 
    299 #endif
    Homogeneous pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:148
    Definition: algorithm.hpp:30
    -
    Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
    Definition: concepts/pixel.hpp:255
    -
    Pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:169
    +
    Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
    Definition: concepts/pixel.hpp:256
    +
    Pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:170
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    -
    Homogeneous pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:187
    -
    Homogeneous pixel concept.
    Definition: concepts/pixel.hpp:122
    -
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:100
    -
    Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
    Definition: concepts/pixel.hpp:276
    -
    void color_convert(const SrcP &src, DstP &dst)
    helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
    Definition: color_convert.hpp:304
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:225
    -
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:62
    +
    Homogeneous pixel concept that is a Regular type.
    Definition: concepts/pixel.hpp:188
    +
    Homogeneous pixel concept.
    Definition: concepts/pixel.hpp:123
    +
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    +
    Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
    Definition: concepts/pixel.hpp:277
    +
    void color_convert(const SrcP &src, DstP &dst)
    helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
    Definition: color_convert.hpp:309
    +
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    +
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:63
    diff --git a/html/reference/concepts_2pixel__iterator_8hpp_source.html b/html/reference/concepts_2pixel__iterator_8hpp_source.html index 7b37ddccb..b104c10ba 100644 --- a/html/reference/concepts_2pixel__iterator_8hpp_source.html +++ b/html/reference/concepts_2pixel__iterator_8hpp_source.html @@ -52,22 +52,22 @@
    concepts/pixel_iterator.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
    10 
    11 #include <boost/gil/concepts/channel.hpp>
    12 #include <boost/gil/concepts/color.hpp>
    13 #include <boost/gil/concepts/concept_check.hpp>
    14 #include <boost/gil/concepts/fwd.hpp>
    15 #include <boost/gil/concepts/pixel.hpp>
    16 #include <boost/gil/concepts/pixel_based.hpp>
    17 
    18 #include <boost/iterator/iterator_concepts.hpp>
    19 
    20 #include <cstddef>
    21 #include <iterator>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    27 #endif
    28 
    29 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    30 #pragma GCC diagnostic push
    31 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    32 #endif
    33 
    34 namespace boost { namespace gil {
    35 
    36 // Forward declarations
    37 template <typename It> struct const_iterator_type;
    38 template <typename It> struct iterator_is_mutable;
    39 template <typename It> struct is_iterator_adaptor;
    40 template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
    41 template <typename It> struct iterator_adaptor_get_base;
    42 
    43 // These iterator mutability concepts are taken from Boost concept_check.hpp.
    44 // Isolating mutability to result in faster compile time
    45 namespace detail {
    46 
    47 // Preconditions: TT Models boost_concepts::ForwardTraversalConcept
    48 template <class TT>
    49 struct ForwardIteratorIsMutableConcept
    50 {
    51  void constraints()
    52  {
    53  auto const tmp = *i;
    54  *i++ = tmp; // require postincrement and assignment
    55  }
    56  TT i;
    57 };
    58 
    59 // Preconditions: TT Models boost::BidirectionalIteratorConcept
    60 template <class TT>
    61 struct BidirectionalIteratorIsMutableConcept
    62 {
    63  void constraints()
    64  {
    65  gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
    66  auto const tmp = *i;
    67  *i-- = tmp; // require postdecrement and assignment
    68  }
    69  TT i;
    70 };
    71 
    72 // Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
    73 template <class TT>
    74 struct RandomAccessIteratorIsMutableConcept
    75 {
    76  void constraints()
    77  {
    78  gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();
    79 
    80  typename std::iterator_traits<TT>::difference_type n = 0;
    81  ignore_unused_variable_warning(n);
    82  i[n] = *i; // require element access and assignment
    83  }
    84  TT i;
    85 };
    86 
    87 // Iterators that can be used as the base of memory_based_step_iterator require some additional functions
    88 // \tparam Iterator Models boost_concepts::RandomAccessTraversalConcept
    89 template <typename Iterator>
    90 struct RandomAccessIteratorIsMemoryBasedConcept
    91 {
    92  void constraints()
    93  {
    94  std::ptrdiff_t bs = memunit_step(it);
    95  ignore_unused_variable_warning(bs);
    96 
    97  it = memunit_advanced(it, 3);
    98  std::ptrdiff_t bd = memunit_distance(it, it);
    99  ignore_unused_variable_warning(bd);
    100 
    101  memunit_advance(it,3);
    102  // for performace you may also provide a customized implementation of memunit_advanced_ref
    103  }
    104  Iterator it;
    105 };
    106 
    108 template <typename Iterator>
    110 {
    111  void constraints()
    112  {
    113  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator>>();
    114 
    115  using ref_t = typename std::remove_reference
    116  <
    117  typename std::iterator_traits<Iterator>::reference
    118  >::type;
    119  using channel_t = typename element_type<ref_t>::type;
    120  gil_function_requires<detail::ChannelIsMutableConcept<channel_t>>();
    121  }
    122 };
    123 
    124 } // namespace detail
    125 
    135 template <typename T>
    137 {
    138  void constraints()
    139  {
    140  using type = typename transposed_type<T>::type;
    141  ignore_unused_variable_warning(type{});
    142  }
    143 };
    144 
    148 
    168 template <typename Iterator>
    170 {
    171  void constraints()
    172  {
    173  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
    174  gil_function_requires<PixelBasedConcept<Iterator>>();
    175 
    176  using value_type = typename std::iterator_traits<Iterator>::value_type;
    177  gil_function_requires<PixelValueConcept<value_type>>();
    178 
    179  using const_t = typename const_iterator_type<Iterator>::type;
    180  static bool const is_mutable = iterator_is_mutable<Iterator>::value;
    181  ignore_unused_variable_warning(is_mutable);
    182 
    183  // immutable iterator must be constructible from (possibly mutable) iterator
    184  const_t const_it(it);
    185  ignore_unused_variable_warning(const_it);
    186 
    187  check_base(typename is_iterator_adaptor<Iterator>::type());
    188  }
    189 
    190  void check_base(std::false_type) {}
    191 
    192  void check_base(std::true_type)
    193  {
    194  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
    195  gil_function_requires<PixelIteratorConcept<base_t>>();
    196  }
    197 
    198  Iterator it;
    199 };
    200 
    207 template <typename Iterator>
    209 {
    210  void constraints()
    211  {
    212  gil_function_requires<PixelIteratorConcept<Iterator>>();
    213  gil_function_requires<detail::PixelIteratorIsMutableConcept<Iterator>>();
    214  }
    215 };
    216 
    220 
    234 template <typename Iterator>
    236 {
    237  void constraints()
    238  {
    239  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
    240  gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator>>();
    241  }
    242 };
    243 
    255 template <typename Iterator>
    257 {
    258  void constraints()
    259  {
    260  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
    261  it.set_step(0);
    262  }
    263  Iterator it;
    264 };
    265 
    266 
    273 template <typename Iterator>
    275 {
    276  void constraints()
    277  {
    278  gil_function_requires<StepIteratorConcept<Iterator>>();
    279  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
    280  }
    281 };
    282 
    286 
    315 template <typename Iterator>
    317 {
    318  void constraints()
    319  {
    320  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
    321 
    322  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
    323  gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t>>();
    324 
    325  static_assert(is_iterator_adaptor<Iterator>::value, "");
    326  using rebind_t = typename iterator_adaptor_rebind<Iterator, void*>::type;
    327 
    328  base_t base = it.base();
    329  ignore_unused_variable_warning(base);
    330  }
    331  Iterator it;
    332 };
    333 
    340 template <typename Iterator>
    342 {
    343  void constraints()
    344  {
    345  gil_function_requires<IteratorAdaptorConcept<Iterator>>();
    346  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
    347  }
    348 };
    349 
    350 }} // namespace boost::gil
    351 
    352 #if defined(BOOST_CLANG)
    353 #pragma clang diagnostic pop
    354 #endif
    355 
    356 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    357 #pragma GCC diagnostic pop
    358 #endif
    359 
    360 #endif
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    -
    Pixel iterator that allows for changing its pixel.
    Definition: concepts/pixel_iterator.hpp:208
    -
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
    Definition: concepts/pixel_iterator.hpp:235
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
    10 
    11 #include <boost/gil/concepts/channel.hpp>
    12 #include <boost/gil/concepts/color.hpp>
    13 #include <boost/gil/concepts/concept_check.hpp>
    14 #include <boost/gil/concepts/fwd.hpp>
    15 #include <boost/gil/concepts/pixel.hpp>
    16 #include <boost/gil/concepts/pixel_based.hpp>
    17 
    18 #include <boost/iterator/iterator_concepts.hpp>
    19 
    20 #include <cstddef>
    21 #include <iterator>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    31 #pragma GCC diagnostic push
    32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    33 #endif
    34 
    35 namespace boost { namespace gil {
    36 
    37 // Forward declarations
    38 template <typename It> struct const_iterator_type;
    39 template <typename It> struct iterator_is_mutable;
    40 template <typename It> struct is_iterator_adaptor;
    41 template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
    42 template <typename It> struct iterator_adaptor_get_base;
    43 
    44 // These iterator mutability concepts are taken from Boost concept_check.hpp.
    45 // Isolating mutability to result in faster compile time
    46 namespace detail {
    47 
    48 // Preconditions: TT Models boost_concepts::ForwardTraversalConcept
    49 template <class TT>
    50 struct ForwardIteratorIsMutableConcept
    51 {
    52  void constraints()
    53  {
    54  auto const tmp = *i;
    55  *i++ = tmp; // require postincrement and assignment
    56  }
    57  TT i;
    58 };
    59 
    60 // Preconditions: TT Models boost::BidirectionalIteratorConcept
    61 template <class TT>
    62 struct BidirectionalIteratorIsMutableConcept
    63 {
    64  void constraints()
    65  {
    66  gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
    67  auto const tmp = *i;
    68  *i-- = tmp; // require postdecrement and assignment
    69  }
    70  TT i;
    71 };
    72 
    73 // Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
    74 template <class TT>
    75 struct RandomAccessIteratorIsMutableConcept
    76 {
    77  void constraints()
    78  {
    79  gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();
    80 
    81  typename std::iterator_traits<TT>::difference_type n = 0;
    82  ignore_unused_variable_warning(n);
    83  i[n] = *i; // require element access and assignment
    84  }
    85  TT i;
    86 };
    87 
    88 // Iterators that can be used as the base of memory_based_step_iterator require some additional functions
    89 // \tparam Iterator Models boost_concepts::RandomAccessTraversalConcept
    90 template <typename Iterator>
    91 struct RandomAccessIteratorIsMemoryBasedConcept
    92 {
    93  void constraints()
    94  {
    95  std::ptrdiff_t bs = memunit_step(it);
    96  ignore_unused_variable_warning(bs);
    97 
    98  it = memunit_advanced(it, 3);
    99  std::ptrdiff_t bd = memunit_distance(it, it);
    100  ignore_unused_variable_warning(bd);
    101 
    102  memunit_advance(it,3);
    103  // for performace you may also provide a customized implementation of memunit_advanced_ref
    104  }
    105  Iterator it;
    106 };
    107 
    109 template <typename Iterator>
    111 {
    112  void constraints()
    113  {
    114  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator>>();
    115 
    116  using ref_t = typename std::remove_reference
    117  <
    118  typename std::iterator_traits<Iterator>::reference
    119  >::type;
    120  using channel_t = typename element_type<ref_t>::type;
    121  gil_function_requires<detail::ChannelIsMutableConcept<channel_t>>();
    122  }
    123 };
    124 
    125 } // namespace detail
    126 
    136 template <typename T>
    138 {
    139  void constraints()
    140  {
    141  using type = typename transposed_type<T>::type;
    142  ignore_unused_variable_warning(type{});
    143  }
    144 };
    145 
    149 
    169 template <typename Iterator>
    171 {
    172  void constraints()
    173  {
    174  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
    175  gil_function_requires<PixelBasedConcept<Iterator>>();
    176 
    177  using value_type = typename std::iterator_traits<Iterator>::value_type;
    178  gil_function_requires<PixelValueConcept<value_type>>();
    179 
    180  using const_t = typename const_iterator_type<Iterator>::type;
    181  static bool const is_mutable = iterator_is_mutable<Iterator>::value;
    182  ignore_unused_variable_warning(is_mutable);
    183 
    184  // immutable iterator must be constructible from (possibly mutable) iterator
    185  const_t const_it(it);
    186  ignore_unused_variable_warning(const_it);
    187 
    188  check_base(typename is_iterator_adaptor<Iterator>::type());
    189  }
    190 
    191  void check_base(std::false_type) {}
    192 
    193  void check_base(std::true_type)
    194  {
    195  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
    196  gil_function_requires<PixelIteratorConcept<base_t>>();
    197  }
    198 
    199  Iterator it;
    200 };
    201 
    208 template <typename Iterator>
    210 {
    211  void constraints()
    212  {
    213  gil_function_requires<PixelIteratorConcept<Iterator>>();
    214  gil_function_requires<detail::PixelIteratorIsMutableConcept<Iterator>>();
    215  }
    216 };
    217 
    221 
    235 template <typename Iterator>
    237 {
    238  void constraints()
    239  {
    240  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
    241  gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator>>();
    242  }
    243 };
    244 
    256 template <typename Iterator>
    258 {
    259  void constraints()
    260  {
    261  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
    262  it.set_step(0);
    263  }
    264  Iterator it;
    265 };
    266 
    267 
    274 template <typename Iterator>
    276 {
    277  void constraints()
    278  {
    279  gil_function_requires<StepIteratorConcept<Iterator>>();
    280  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
    281  }
    282 };
    283 
    287 
    316 template <typename Iterator>
    318 {
    319  void constraints()
    320  {
    321  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
    322 
    323  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
    324  gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t>>();
    325 
    326  static_assert(is_iterator_adaptor<Iterator>::value, "");
    327  using rebind_t = typename iterator_adaptor_rebind<Iterator, void*>::type;
    328 
    329  base_t base = it.base();
    330  ignore_unused_variable_warning(base);
    331  }
    332  Iterator it;
    333 };
    334 
    341 template <typename Iterator>
    343 {
    344  void constraints()
    345  {
    346  gil_function_requires<IteratorAdaptorConcept<Iterator>>();
    347  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
    348  }
    349 };
    350 
    351 }} // namespace boost::gil
    352 
    353 #if defined(BOOST_CLANG)
    354 #pragma clang diagnostic pop
    355 #endif
    356 
    357 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    358 #pragma GCC diagnostic pop
    359 #endif
    360 
    361 #endif
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    +
    Pixel iterator that allows for changing its pixel.
    Definition: concepts/pixel_iterator.hpp:209
    +
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
    Definition: concepts/pixel_iterator.hpp:236
    Definition: algorithm.hpp:30
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    -
    Iterator adaptor is a forward iterator adapting another forward iterator.
    Definition: concepts/pixel_iterator.hpp:316
    -
    Step iterator that allows for modifying its current value.
    Definition: concepts/pixel_iterator.hpp:274
    +
    Iterator adaptor is a forward iterator adapting another forward iterator.
    Definition: concepts/pixel_iterator.hpp:317
    +
    Step iterator that allows for modifying its current value.
    Definition: concepts/pixel_iterator.hpp:275
    Specifies the element type of a homogeneous color base.
    Definition: color_base_algorithm.hpp:221
    -
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/pixel_iterator.hpp:136
    +
    Concept for locators and views that can define a type just like the given locator or view...
    Definition: concepts/pixel_iterator.hpp:137
    Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
    Definition: pixel_iterator.hpp:36
    -
    Iterator adaptor that is mutable.
    Definition: concepts/pixel_iterator.hpp:341
    +
    Iterator adaptor that is mutable.
    Definition: concepts/pixel_iterator.hpp:342
    Metafunction predicate returning whether the given iterator allows for changing its values...
    Definition: pixel_iterator.hpp:49
    -
    Definition: concepts/pixel_iterator.hpp:109
    -
    An STL random access traversal iterator over a model of PixelConcept.
    Definition: concepts/pixel_iterator.hpp:169
    +
    Definition: concepts/pixel_iterator.hpp:110
    +
    An STL random access traversal iterator over a model of PixelConcept.
    Definition: concepts/pixel_iterator.hpp:170
    Returns the type of an iterator just like the input iterator, except operating over immutable values...
    Definition: pixel_iterator.hpp:40
    -
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:256
    +
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:257
    diff --git a/html/reference/concepts_2point_8hpp_source.html b/html/reference/concepts_2point_8hpp_source.html index ebbccc68e..258547449 100644 --- a/html/reference/concepts_2point_8hpp_source.html +++ b/html/reference/concepts_2point_8hpp_source.html @@ -52,9 +52,9 @@
    concepts/point.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_POINT_HPP
    9 #define BOOST_GIL_CONCEPTS_POINT_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 
    14 #include <cstddef>
    15 
    16 #if defined(BOOST_CLANG)
    17 #pragma clang diagnostic push
    18 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    19 #endif
    20 
    21 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    22 #pragma GCC diagnostic push
    23 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    24 #endif
    25 
    26 namespace boost { namespace gil {
    27 
    28 // Forward declarations
    29 template <typename T>
    30 class point;
    31 
    32 template <std::size_t K, typename T>
    33 T const& axis_value(point<T> const& p);
    34 
    35 template <std::size_t K, typename T>
    36 T& axis_value(point<T>& p);
    37 
    59 template <typename P>
    61 {
    62  void constraints()
    63  {
    64  gil_function_requires<Regular<P>>();
    65 
    66  using value_type = typename P::value_type;
    67  ignore_unused_variable_warning(value_type{});
    68 
    69  static const std::size_t N = P::num_dimensions;
    70  ignore_unused_variable_warning(N);
    71  using FT = typename P::template axis<0>::coord_t;
    72  using LT = typename P::template axis<N - 1>::coord_t;
    73  FT ft = gil::axis_value<0>(point);
    74  axis_value<0>(point) = ft;
    75  LT lt = axis_value<N - 1>(point);
    76  axis_value<N - 1>(point) = lt;
    77 
    78  //value_type v=point[0];
    79  //ignore_unused_variable_warning(v);
    80  }
    81  P point;
    82 };
    83 
    101 template <typename P>
    103 {
    104  void constraints()
    105  {
    106  gil_function_requires<PointNDConcept<P>>();
    107  static_assert(P::num_dimensions == 2, "");
    108  point.x = point.y;
    109  point[0] = point[1];
    110  }
    111  P point;
    112 };
    113 
    114 }} // namespace boost::gil
    115 
    116 #if defined(BOOST_CLANG)
    117 #pragma clang diagnostic pop
    118 #endif
    119 
    120 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    121 #pragma GCC diagnostic pop
    122 #endif
    123 
    124 #endif
    Definition: algorithm.hpp:30
    -
    N-dimensional point concept.
    Definition: concepts/point.hpp:60
    -
    2-dimensional point concept
    Definition: concepts/point.hpp:102
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_POINT_HPP
    9 #define BOOST_GIL_CONCEPTS_POINT_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 
    14 #include <cstddef>
    15 
    16 #if defined(BOOST_CLANG)
    17 #pragma clang diagnostic push
    18 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    19 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    20 #endif
    21 
    22 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    23 #pragma GCC diagnostic push
    24 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    25 #endif
    26 
    27 namespace boost { namespace gil {
    28 
    29 // Forward declarations
    30 template <typename T>
    31 class point;
    32 
    33 template <std::size_t K, typename T>
    34 T const& axis_value(point<T> const& p);
    35 
    36 template <std::size_t K, typename T>
    37 T& axis_value(point<T>& p);
    38 
    60 template <typename P>
    62 {
    63  void constraints()
    64  {
    65  gil_function_requires<Regular<P>>();
    66 
    67  using value_type = typename P::value_type;
    68  ignore_unused_variable_warning(value_type{});
    69 
    70  static const std::size_t N = P::num_dimensions;
    71  ignore_unused_variable_warning(N);
    72  using FT = typename P::template axis<0>::coord_t;
    73  using LT = typename P::template axis<N - 1>::coord_t;
    74  FT ft = gil::axis_value<0>(point);
    75  axis_value<0>(point) = ft;
    76  LT lt = axis_value<N - 1>(point);
    77  axis_value<N - 1>(point) = lt;
    78 
    79  //value_type v=point[0];
    80  //ignore_unused_variable_warning(v);
    81  }
    82  P point;
    83 };
    84 
    102 template <typename P>
    104 {
    105  void constraints()
    106  {
    107  gil_function_requires<PointNDConcept<P>>();
    108  static_assert(P::num_dimensions == 2, "");
    109  point.x = point.y;
    110  point[0] = point[1];
    111  }
    112  P point;
    113 };
    114 
    115 }} // namespace boost::gil
    116 
    117 #if defined(BOOST_CLANG)
    118 #pragma clang diagnostic pop
    119 #endif
    120 
    121 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    122 #pragma GCC diagnostic pop
    123 #endif
    124 
    125 #endif
    Definition: algorithm.hpp:30
    +
    N-dimensional point concept.
    Definition: concepts/point.hpp:61
    +
    2-dimensional point concept
    Definition: concepts/point.hpp:103
    2D point both axes of which have the same dimension typeModels: Point2DConcept
    Definition: locator.hpp:28
    diff --git a/html/reference/dynamic__io__new_8hpp_source.html b/html/reference/dynamic__io__new_8hpp_source.html index 7ed24ec14..1a2a62773 100644 --- a/html/reference/dynamic__io__new_8hpp_source.html +++ b/html/reference/dynamic__io__new_8hpp_source.html @@ -53,7 +53,7 @@
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP
    9 #define BOOST_GIL_IO_DYNAMIC_IO_NEW_HPP
    10 
    11 #include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
    12 
    13 #include <boost/gil/detail/mp11.hpp>
    14 #include <boost/gil/io/error.hpp>
    15 
    16 #include <type_traits>
    17 
    18 namespace boost { namespace gil {
    19 
    20 namespace detail {
    21 
    22 template <long N>
    23 struct construct_matched_t
    24 {
    25  template <typename Images,typename Pred>
    26  static bool apply(any_image<Images>& img, Pred pred)
    27  {
    28  if (pred.template apply<mp11::mp_at_c<Images, N-1>>())
    29  {
    30  using image_t = mp11::mp_at_c<Images, N-1>;
    31  image_t x;
    32  img = std::move(x);
    33  return true;
    34  }
    35  else
    36  return construct_matched_t<N-1>::apply(img, pred);
    37  }
    38 };
    39 template <>
    40 struct construct_matched_t<0>
    41 {
    42  template <typename Images,typename Pred>
    43  static bool apply(any_image<Images>&,Pred) { return false; }
    44 };
    45 
    46 // A function object that can be passed to apply_operation.
    47 // Given a predicate IsSupported taking a view type and returning an boolean integral coonstant,
    48 // calls the apply method of OpClass with the view if the given view IsSupported, or throws an exception otherwise
    49 template <typename IsSupported, typename OpClass>
    50 class dynamic_io_fnobj
    51 {
    52 private:
    53  OpClass* _op;
    54 
    55  template <typename View>
    56  void apply(View const& view, std::true_type) { _op->apply(view); }
    57 
    58  template <typename View, typename Info>
    59  void apply(View const& view, Info const & info, const std::true_type) { _op->apply(view, info); }
    60 
    61  template <typename View>
    62  void apply(View const& /* view */, std::false_type)
    63  {
    64  io_error("dynamic_io: unsupported view type for the given file format");
    65  }
    66 
    67  template <typename View, typename Info >
    68  void apply(View const& /* view */, Info const& /* info */, const std::false_type)
    69  {
    70  io_error("dynamic_io: unsupported view type for the given file format");
    71  }
    72 
    73 public:
    74  dynamic_io_fnobj(OpClass* op) : _op(op) {}
    75 
    76  using result_type = void;
    77 
    78  template <typename View>
    79  void operator()(View const& view)
    80  {
    81  apply(view, typename IsSupported::template apply<View>::type());
    82  }
    83 
    84  template< typename View, typename Info >
    85  void operator()(View const& view, Info const& info)
    86  {
    87  apply(view, info, typename IsSupported::template apply<View>::type());
    88  }
    89 };
    90 
    91 } // namespace detail
    92 
    95 template <typename Images,typename Pred>
    96 inline bool construct_matched(any_image<Images>& img, Pred pred)
    97 {
    98  constexpr auto size = mp11::mp_size<Images>::value;
    99  return detail::construct_matched_t<size>::apply(img, pred);
    100 }
    101 
    102 } } // namespace boost::gil
    103 
    104 #endif
    Definition: algorithm.hpp:30
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    diff --git a/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html b/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html index 07ebf710d..55de0a9d3 100644 --- a/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html +++ b/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html @@ -57,10 +57,10 @@
    BOOST_FORCEINLINE auto apply_operation(variant< Types > &arg, UnaryOp op)
    Invokes a generic mutable operation (represented as a unary function object) on a variant...
    Definition: apply_operation.hpp:21
    void fill_pixels(any_image_view< Types > const &view, Value const &val)
    fill_pixels for any image view. The pixel to fill with must be compatible with the current view ...
    Definition: extension/dynamic_image/algorithm.hpp:228
    A generic binary operation on viewsUse this class as a convenience superclass when defining an operat...
    Definition: algorithm.hpp:81
    -
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:225
    +
    Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
    Definition: concepts/pixel.hpp:226
    Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
    Definition: any_image_view.hpp:74
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:290
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:295
    bool equal_pixels(any_image_view< Types1 > const &src, any_image_view< Types2 > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:68
    void copy_and_convert_pixels(any_image_view< Types1 > const &src, any_image_view< Types2 > const &dst)
    Definition: extension/dynamic_image/algorithm.hpp:175
    diff --git a/html/reference/filter_8hpp_source.html b/html/reference/filter_8hpp_source.html index 744063687..546804e16 100644 --- a/html/reference/filter_8hpp_source.html +++ b/html/reference/filter_8hpp_source.html @@ -53,7 +53,7 @@
    1 //
    2 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
    3 //
    4 // Use, modification and distribution are subject to the Boost Software License,
    5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt)
    7 //
    8 
    9 #ifndef BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    10 #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    11 
    12 #include <boost/gil/extension/numeric/algorithm.hpp>
    13 #include <boost/gil/extension/numeric/kernel.hpp>
    14 #include <boost/gil/extension/numeric/convolve.hpp>
    15 
    16 #include <boost/gil/image.hpp>
    17 #include <boost/gil/image_view.hpp>
    18 
    19 #include <cstddef>
    20 #include <vector>
    21 
    22 
    23 
    24 
    25 namespace boost { namespace gil {
    26 
    27 template <typename SrcView, typename DstView>
    28 void box_filter(
    29  SrcView const& src_view,
    30  DstView const& dst_view,
    31  std::size_t kernel_size,
    32  long int anchor = -1,
    33  bool normalize=true,
    34  boundary_option option = boundary_option::extend_zero
    35 )
    36 {
    37  gil_function_requires<ImageViewConcept<SrcView>>();
    38  gil_function_requires<MutableImageViewConcept<DstView>>();
    39  static_assert(color_spaces_are_compatible
    40  <
    41  typename color_space_type<SrcView>::type,
    42  typename color_space_type<DstView>::type
    43  >::value, "Source and destination views must have pixels with the same color space");
    44 
    45  std::vector<float> kernel_values;
    46  if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
    47  else { kernel_values.resize(kernel_size, 1.0f); }
    48 
    49  if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
    50  kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
    51 
    52  detail::convolve_1d
    53  <
    54  pixel<float, typename SrcView::value_type::layout_t>
    55  >(src_view, kernel, dst_view, option);
    56 }
    57 
    58 template <typename SrcView, typename DstView>
    59 void blur(
    60  SrcView const& src_view,
    61  DstView const& dst_view,
    62  std::size_t kernel_size,
    63  long int anchor = -1,
    64  boundary_option option = boundary_option::extend_zero
    65 )
    66 {
    67  box_filter(src_view, dst_view, kernel_size, anchor, true, option);
    68 }
    69 
    70 
    71 namespace detail
    72 {
    73 template <typename SrcView, typename DstView>
    74 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    75 {
    76  std::size_t half_kernel_size = kernel_size / 2;
    77 
    78  // deciding output channel type and creating functor
    79  using src_channel_t = typename channel_type<SrcView>::type;
    80 
    81  std::vector<src_channel_t> values;
    82  values.reserve(kernel_size * kernel_size);
    83 
    84  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
    85  {
    86  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
    87 
    88  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
    89  {
    90  auto sub_view = subimage_view(
    91  src_view,
    92  x - half_kernel_size, y - half_kernel_size,
    93  kernel_size,
    94  kernel_size
    95  );
    96  values.assign(sub_view.begin(), sub_view.end());
    97 
    98  std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
    99  dst_it[x] = values[values.size() / 2];
    100  }
    101  }
    102 }
    103 } // namespace detail
    104 
    105 template <typename SrcView, typename DstView>
    106 void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
    107 {
    108  static_assert(color_spaces_are_compatible
    109  <
    110  typename color_space_type<SrcView>::type,
    111  typename color_space_type<DstView>::type
    112  >::value, "Source and destination views must have pixels with the same color space");
    113 
    114  std::size_t half_kernel_size = kernel_size / 2;
    115  auto extended_img = extend_boundary(
    116  src_view,
    117  half_kernel_size,
    118  boundary_option::extend_constant
    119  );
    120  auto extended_view = subimage_view(
    121  view(extended_img),
    122  half_kernel_size,
    123  half_kernel_size,
    124  src_view.width(),
    125  src_view.height()
    126  );
    127 
    128  for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
    129  {
    130  detail::filter_median_impl(
    131  nth_channel_view(extended_view, channel),
    132  nth_channel_view(dst_view, channel),
    133  kernel_size
    134  );
    135  }
    136 }
    137 
    138 }} //namespace boost::gil
    139 
    140 #endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
    Definition: algorithm.hpp:30
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    diff --git a/html/reference/image_8hpp_source.html b/html/reference/image_8hpp_source.html index 0def91b50..f988f8ac4 100644 --- a/html/reference/image_8hpp_source.html +++ b/html/reference/image_8hpp_source.html @@ -52,18 +52,18 @@
    image.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IMAGE_HPP
    9 #define BOOST_GIL_IMAGE_HPP
    10 
    11 #include <boost/gil/algorithm.hpp>
    12 #include <boost/gil/image_view.hpp>
    13 #include <boost/gil/metafunctions.hpp>
    14 #include <boost/gil/detail/mp11.hpp>
    15 
    16 #include <boost/assert.hpp>
    17 
    18 #include <cstddef>
    19 #include <memory>
    20 #include <utility>
    21 #include <type_traits>
    22 
    23 namespace boost { namespace gil {
    24 
    38 
    39 template< typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> >
    40 class image {
    41 public:
    42 #if defined(BOOST_NO_CXX11_ALLOCATOR)
    43  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
    44 #else
    45  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
    46 #endif
    47  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
    48  using const_view_t = typename view_t::const_t;
    49  using point_t = typename view_t::point_t;
    50  using coord_t = typename view_t::coord_t;
    51  using value_type = typename view_t::value_type;
    52  using x_coord_t = coord_t;
    53  using y_coord_t = coord_t;
    54 
    55  const point_t& dimensions() const { return _view.dimensions(); }
    56  x_coord_t width() const { return _view.width(); }
    57  y_coord_t height() const { return _view.height(); }
    58 
    59  explicit image(std::size_t alignment=0,
    60  const Alloc alloc_in = Alloc()) :
    61  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
    62 
    63  // Create with dimensions and optional initial value and alignment
    64  image(const point_t& dimensions,
    65  std::size_t alignment=0,
    66  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    67  , _allocated_bytes( 0 ) {
    68  allocate_and_default_construct(dimensions);
    69  }
    70 
    71  image(x_coord_t width, y_coord_t height,
    72  std::size_t alignment=0,
    73  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    74  , _allocated_bytes( 0 ) {
    75  allocate_and_default_construct(point_t(width,height));
    76  }
    77 
    78  image(const point_t& dimensions,
    79  const Pixel& p_in,
    80  std::size_t alignment = 0,
    81  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    82  , _allocated_bytes( 0 ) {
    83  allocate_and_fill(dimensions, p_in);
    84  }
    85  image(x_coord_t width, y_coord_t height,
    86  const Pixel& p_in,
    87  std::size_t alignment = 0,
    88  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    89  , _allocated_bytes ( 0 ) {
    90  allocate_and_fill(point_t(width,height),p_in);
    91  }
    92 
    93  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    94  , _allocated_bytes( img._allocated_bytes ) {
    95  allocate_and_copy(img.dimensions(),img._view);
    96  }
    97 
    98  template <typename P2, bool IP2, typename Alloc2>
    99  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    100  , _allocated_bytes( img._allocated_bytes ) {
    101  allocate_and_copy(img.dimensions(),img._view);
    102  }
    103 
    104  image& operator=(const image& img) {
    105  if (dimensions() == img.dimensions())
    106  copy_pixels(img._view,_view);
    107  else {
    108  image tmp(img);
    109  swap(tmp);
    110  }
    111  return *this;
    112  }
    113 
    114  template <typename Img>
    115  image& operator=(const Img& img) {
    116  if (dimensions() == img.dimensions())
    117  copy_pixels(img._view,_view);
    118  else {
    119  image tmp(img);
    120  swap(tmp);
    121  }
    122  return *this;
    123  }
    124 
    125  ~image() {
    126  destruct_pixels(_view);
    127  deallocate();
    128  }
    129 
    130  Alloc& allocator() { return _alloc; }
    131  Alloc const& allocator() const { return _alloc; }
    132 
    133  void swap(image& img) { // required by MutableContainerConcept
    134  using std::swap;
    135  swap(_align_in_bytes, img._align_in_bytes);
    136  swap(_memory, img._memory);
    137  swap(_view, img._view);
    138  swap(_alloc, img._alloc);
    139  swap(_allocated_bytes, img._allocated_bytes );
    140  }
    141 
    143  // recreate
    145 
    146  // without Allocator
    147  void recreate(const point_t& dims, std::size_t alignment = 0)
    148  {
    149  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    150  return;
    151 
    152  _align_in_bytes = alignment;
    153 
    154  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    155  {
    156  destruct_pixels(_view);
    157  create_view(dims, std::integral_constant<bool, IsPlanar>());
    159  }
    160  else
    161  {
    162  image tmp(dims, alignment);
    163  swap(tmp);
    164  }
    165  }
    166 
    167  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
    168  {
    169  recreate(point_t(width, height), alignment);
    170  }
    171 
    172  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment = 0)
    173  {
    174  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    175  return;
    176 
    177  _align_in_bytes = alignment;
    178 
    179  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    180  {
    181  destruct_pixels(_view);
    182  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
    183  uninitialized_fill_pixels(_view, p_in);
    184  }
    185  else
    186  {
    187  image tmp(dims, p_in, alignment);
    188  swap(tmp);
    189  }
    190  }
    191 
    192  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
    193  {
    194  recreate( point_t( width, height ), p_in, alignment );
    195  }
    196 
    197  // with Allocator
    198  void recreate(const point_t& dims, std::size_t alignment, const Alloc alloc_in)
    199  {
    200  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    201  return;
    202 
    203  _align_in_bytes = alignment;
    204 
    205  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    206  {
    207  destruct_pixels(_view);
    208  create_view(dims, std::integral_constant<bool, IsPlanar>());
    210  }
    211  else
    212  {
    213  image tmp(dims, alignment, alloc_in);
    214  swap(tmp);
    215  }
    216  }
    217 
    218  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
    219  {
    220  recreate(point_t(width, height), alignment, alloc_in);
    221  }
    222 
    223  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
    224  {
    225  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    226  return;
    227 
    228  _align_in_bytes = alignment;
    229 
    230  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    231  {
    232  destruct_pixels(_view);
    233  create_view(dims, std::integral_constant<bool, IsPlanar>());
    234  uninitialized_fill_pixels(_view, p_in);
    235  }
    236  else
    237  {
    238  image tmp(dims, p_in, alignment, alloc_in);
    239  swap(tmp);
    240  }
    241  }
    242 
    243  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
    244  {
    245  recreate(point_t(width, height), p_in, alignment, alloc_in);
    246  }
    247 
    248  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
    249 private:
    250  unsigned char* _memory;
    251  std::size_t _align_in_bytes;
    252  allocator_type _alloc;
    253 
    254  std::size_t _allocated_bytes;
    255 
    256  void allocate_and_default_construct(point_t const& dimensions)
    257  {
    258  try
    259  {
    260  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    262  }
    263  catch (...) { deallocate(); throw; }
    264  }
    265 
    266  void allocate_and_fill(const point_t& dimensions, Pixel const& p_in)
    267  {
    268  try
    269  {
    270  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    271  uninitialized_fill_pixels(_view, p_in);
    272  }
    273  catch(...) { deallocate(); throw; }
    274  }
    275 
    276  template <typename View>
    277  void allocate_and_copy(const point_t& dimensions, View const& v)
    278  {
    279  try
    280  {
    281  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    282  uninitialized_copy_pixels(v, _view);
    283  }
    284  catch(...) { deallocate(); throw; }
    285  }
    286 
    287  void deallocate()
    288  {
    289  if (_memory && _allocated_bytes > 0)
    290  _alloc.deallocate(_memory, _allocated_bytes);
    291  }
    292 
    293  std::size_t is_planar_impl(
    294  std::size_t const size_in_units,
    295  std::size_t const channels_in_image,
    296  std::true_type) const
    297  {
    298  return size_in_units * channels_in_image;
    299  }
    300 
    301  std::size_t is_planar_impl(
    302  std::size_t const size_in_units,
    303  std::size_t const,
    304  std::false_type) const
    305  {
    306  return size_in_units;
    307  }
    308 
    309  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
    310  {
    311  using x_iterator = typename view_t::x_iterator;
    312 
    313  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
    314  constexpr std::size_t _channels_in_image =
    315  std::conditional
    316  <
    317  is_pixel<value_type>::value,
    319  std::integral_constant<std::size_t, 1>
    320  >::type::value;
    321 
    322  std::size_t size_in_units = is_planar_impl(
    323  get_row_size_in_memunits(dimensions.x) * dimensions.y,
    324  _channels_in_image,
    325  std::integral_constant<bool, IsPlanar>());
    326 
    327  // return the size rounded up to the nearest byte
    328  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
    330  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
    331  }
    332 
    333  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
    334  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
    335  if (_align_in_bytes>0) {
    336  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
    337  return align(size_in_memunits, alignment_in_memunits);
    338  }
    339  return size_in_memunits;
    340  }
    341 
    342  void allocate_(point_t const& dimensions, std::false_type)
    343  {
    344  // if it throws and _memory!=0 the client must deallocate _memory
    345  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
    346  _memory=_alloc.allocate( _allocated_bytes );
    347 
    348  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    349  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
    350 
    351  BOOST_ASSERT(_view.width() == dimensions.x);
    352  BOOST_ASSERT(_view.height() == dimensions.y);
    353  }
    354 
    355  void allocate_(point_t const& dimensions, std::true_type)
    356  {
    357  // if it throws and _memory!=0 the client must deallocate _memory
    358  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
    359  std::size_t plane_size=row_size*dimensions.y;
    360 
    361  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
    362 
    363  _memory = _alloc.allocate( _allocated_bytes );
    364 
    365  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    366  typename view_t::x_iterator first;
    367  for (int i=0; i<num_channels<view_t>::value; ++i) {
    368  dynamic_at_c(first,i) = (typename channel_type<view_t>::type*)tmp;
    369  memunit_advance(dynamic_at_c(first,i), plane_size*i);
    370  }
    371  _view=view_t(dimensions, typename view_t::locator(first, row_size));
    372 
    373  BOOST_ASSERT(_view.width() == dimensions.x);
    374  BOOST_ASSERT(_view.height() == dimensions.y);
    375  }
    376 
    377  void create_view(point_t const& dims, std::true_type) // is planar
    378  {
    379  std::size_t row_size=get_row_size_in_memunits(dims.x);
    380  std::size_t plane_size=row_size*dims.y;
    381 
    382  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
    383  ,_align_in_bytes
    384  )
    385  : _memory;
    386  typename view_t::x_iterator first;
    387 
    388  for (int i = 0; i < num_channels< view_t >::value; ++i )
    389  {
    390  dynamic_at_c( first, i ) = (typename channel_type<view_t>::type*) tmp;
    391 
    392  memunit_advance( dynamic_at_c(first,i)
    393  , plane_size*i
    394  );
    395  }
    396 
    397  _view = view_t(dims, typename view_t::locator(first, row_size));
    398 
    399  BOOST_ASSERT(_view.width() == dims.x);
    400  BOOST_ASSERT(_view.height() == dims.y);
    401  }
    402 
    403  void create_view(point_t const& dims, std::false_type) // is planar
    404  {
    405  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
    406  , _align_in_bytes
    407  )
    408  : _memory;
    409 
    410  _view = view_t( dims
    411  , typename view_t::locator( typename view_t::x_iterator( tmp )
    412  , get_row_size_in_memunits( dims.x )
    413  )
    414  );
    415 
    416  BOOST_ASSERT(_view.width() == dims.x);
    417  BOOST_ASSERT(_view.height() == dims.y);
    418  }
    419 };
    420 
    421 template <typename Pixel, bool IsPlanar, typename Alloc>
    423  im1.swap(im2);
    424 }
    425 
    426 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    427 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {
    428  if ((void*)(&im1)==(void*)(&im2)) return true;
    429  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
    430  return equal_pixels(const_view(im1),const_view(im2));
    431 }
    432 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    433 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
    434 
    438 
    440 
    442 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    443 const typename image<Pixel,IsPlanar,Alloc>::view_t& view(image<Pixel,IsPlanar,Alloc>& img) { return img._view; }
    444 
    446 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    447 const typename image<Pixel,IsPlanar,Alloc>::const_view_t const_view(const image<Pixel,IsPlanar,Alloc>& img) {
    448  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
    449 }
    451 
    453 // PixelBasedConcept
    455 
    456 template <typename Pixel, bool IsPlanar, typename Alloc>
    457 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
    458 
    459 template <typename Pixel, bool IsPlanar, typename Alloc>
    460 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
    461 
    462 template <typename Pixel, bool IsPlanar, typename Alloc>
    463 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
    464 
    465 template <typename Pixel, bool IsPlanar, typename Alloc>
    466 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
    467 
    468 }} // namespace boost::gil
    469 
    470 #endif
    Definition: pixel_iterator.hpp:124
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IMAGE_HPP
    9 #define BOOST_GIL_IMAGE_HPP
    10 
    11 #include <boost/gil/algorithm.hpp>
    12 #include <boost/gil/image_view.hpp>
    13 #include <boost/gil/metafunctions.hpp>
    14 #include <boost/gil/detail/mp11.hpp>
    15 
    16 #include <boost/assert.hpp>
    17 #include <boost/core/exchange.hpp>
    18 
    19 #include <cstddef>
    20 #include <memory>
    21 #include <utility>
    22 #include <type_traits>
    23 
    24 namespace boost { namespace gil {
    25 
    39 
    40 template< typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> >
    41 class image
    42 {
    43 public:
    44 #if defined(BOOST_NO_CXX11_ALLOCATOR)
    45  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
    46 #else
    47  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
    48 #endif
    49  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
    50  using const_view_t = typename view_t::const_t;
    51  using point_t = typename view_t::point_t;
    52  using coord_t = typename view_t::coord_t;
    53  using value_type = typename view_t::value_type;
    54  using x_coord_t = coord_t;
    55  using y_coord_t = coord_t;
    56 
    57  const point_t& dimensions() const { return _view.dimensions(); }
    58  x_coord_t width() const { return _view.width(); }
    59  y_coord_t height() const { return _view.height(); }
    60 
    61  explicit image(std::size_t alignment=0,
    62  const Alloc alloc_in = Alloc()) :
    63  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
    64 
    65  // Create with dimensions and optional initial value and alignment
    66  image(const point_t& dimensions,
    67  std::size_t alignment=0,
    68  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    69  , _allocated_bytes( 0 )
    70  {
    71  allocate_and_default_construct(dimensions);
    72  }
    73 
    74  image(x_coord_t width, y_coord_t height,
    75  std::size_t alignment=0,
    76  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    77  , _allocated_bytes( 0 )
    78  {
    79  allocate_and_default_construct(point_t(width,height));
    80  }
    81 
    82  image(const point_t& dimensions,
    83  const Pixel& p_in,
    84  std::size_t alignment = 0,
    85  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    86  , _allocated_bytes( 0 )
    87  {
    88  allocate_and_fill(dimensions, p_in);
    89  }
    90 
    91  image(x_coord_t width, y_coord_t height,
    92  const Pixel& p_in,
    93  std::size_t alignment = 0,
    94  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
    95  , _allocated_bytes ( 0 )
    96  {
    97  allocate_and_fill(point_t(width,height),p_in);
    98  }
    99 
    100  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    101  , _allocated_bytes( img._allocated_bytes )
    102  {
    103  allocate_and_copy(img.dimensions(),img._view);
    104  }
    105 
    106  template <typename P2, bool IP2, typename Alloc2>
    107  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
    108  , _allocated_bytes( img._allocated_bytes )
    109  {
    110  allocate_and_copy(img.dimensions(),img._view);
    111  }
    112 
    113  // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
    114  image(image&& img) :
    115  _view(img._view),
    116  _memory(img._memory),
    117  _align_in_bytes(img._align_in_bytes),
    118  _alloc(std::move(img._alloc)),
    119  _allocated_bytes(img._allocated_bytes)
    120  {
    121  img._view = view_t();
    122  img._memory = nullptr;
    123  img._align_in_bytes = 0;
    124  img._allocated_bytes = 0;
    125  }
    126 
    127  image& operator=(const image& img)
    128  {
    129  if (dimensions() == img.dimensions())
    130  copy_pixels(img._view,_view);
    131  else
    132  {
    133  image tmp(img);
    134  swap(tmp);
    135  }
    136  return *this;
    137  }
    138 
    139  template <typename Img>
    140  image& operator=(const Img& img)
    141  {
    142  if (dimensions() == img.dimensions())
    143  copy_pixels(img._view,_view);
    144  else
    145  {
    146  image tmp(img);
    147  swap(tmp);
    148  }
    149  return *this;
    150  }
    151 
    152  private:
    153  using propagate_allocators = std::true_type;
    154  using no_propagate_allocators = std::false_type;
    155 
    156  template <class Alloc2>
    157  using choose_pocma = typename std::conditional<
    158  // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
    159  std::is_empty<Alloc2>::value,
    160  std::true_type,
    161  typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
    162  >::type;
    163 
    164  static void exchange_memory(image& lhs, image& rhs)
    165  {
    166  lhs._memory = boost::exchange(rhs._memory, nullptr);
    167  lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
    168  lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
    169  lhs._view = boost::exchange(rhs._view, image::view_t{});
    170  };
    171 
    172  void move_assign(image& img, propagate_allocators) noexcept {
    173  // non-sticky allocator, can adopt the memory, fast
    174  destruct_pixels(_view);
    175  this->deallocate();
    176  this->_alloc = img._alloc;
    177  exchange_memory(*this, img);
    178  }
    179 
    180  void move_assign(image& img, no_propagate_allocators) {
    181  if (_alloc == img._alloc) {
    182  // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
    183  destruct_pixels(_view);
    184  this->deallocate();
    185  exchange_memory(*this, img);
    186  } else {
    187  // cannot propagate the allocator and cannot adopt the memory
    188  if (img._memory)
    189  {
    190  allocate_and_copy(img.dimensions(), img._view);
    191  destruct_pixels(img._view);
    192  img.deallocate();
    193  img._view = image::view_t{};
    194  }
    195  else
    196  {
    197  destruct_pixels(this->_view);
    198  this->deallocate();
    199  this->_view = view_t{};
    200  }
    201  }
    202  }
    203 
    204  public:
    205  // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
    206  // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
    207  image& operator=(image&& img) {
    208  if (this != std::addressof(img))
    209  // Use rebinded alloc to choose pocma
    210  move_assign(img, choose_pocma<allocator_type>{});
    211 
    212  return *this;
    213  }
    214 
    215  ~image()
    216  {
    217  destruct_pixels(_view);
    218  deallocate();
    219  }
    220 
    221  Alloc& allocator() { return _alloc; }
    222  Alloc const& allocator() const { return _alloc; }
    223 
    224  void swap(image& img) // required by MutableContainerConcept
    225  {
    226  using std::swap;
    227  swap(_align_in_bytes, img._align_in_bytes);
    228  swap(_memory, img._memory);
    229  swap(_view, img._view);
    230  swap(_alloc, img._alloc);
    231  swap(_allocated_bytes, img._allocated_bytes );
    232  }
    233 
    235  // recreate
    237 
    238  // without Allocator
    239  void recreate(const point_t& dims, std::size_t alignment = 0)
    240  {
    241  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    242  return;
    243 
    244  _align_in_bytes = alignment;
    245 
    246  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    247  {
    248  destruct_pixels(_view);
    249  create_view(dims, std::integral_constant<bool, IsPlanar>());
    251  }
    252  else
    253  {
    254  image tmp(dims, alignment);
    255  swap(tmp);
    256  }
    257  }
    258 
    259  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
    260  {
    261  recreate(point_t(width, height), alignment);
    262  }
    263 
    264  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment = 0)
    265  {
    266  if (dims == _view.dimensions() && _align_in_bytes == alignment)
    267  return;
    268 
    269  _align_in_bytes = alignment;
    270 
    271  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    272  {
    273  destruct_pixels(_view);
    274  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
    275  uninitialized_fill_pixels(_view, p_in);
    276  }
    277  else
    278  {
    279  image tmp(dims, p_in, alignment);
    280  swap(tmp);
    281  }
    282  }
    283 
    284  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
    285  {
    286  recreate( point_t( width, height ), p_in, alignment );
    287  }
    288 
    289  // with Allocator
    290  void recreate(const point_t& dims, std::size_t alignment, const Alloc alloc_in)
    291  {
    292  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    293  return;
    294 
    295  _align_in_bytes = alignment;
    296 
    297  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    298  {
    299  destruct_pixels(_view);
    300  create_view(dims, std::integral_constant<bool, IsPlanar>());
    302  }
    303  else
    304  {
    305  image tmp(dims, alignment, alloc_in);
    306  swap(tmp);
    307  }
    308  }
    309 
    310  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
    311  {
    312  recreate(point_t(width, height), alignment, alloc_in);
    313  }
    314 
    315  void recreate(const point_t& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
    316  {
    317  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
    318  return;
    319 
    320  _align_in_bytes = alignment;
    321 
    322  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
    323  {
    324  destruct_pixels(_view);
    325  create_view(dims, std::integral_constant<bool, IsPlanar>());
    326  uninitialized_fill_pixels(_view, p_in);
    327  }
    328  else
    329  {
    330  image tmp(dims, p_in, alignment, alloc_in);
    331  swap(tmp);
    332  }
    333  }
    334 
    335  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
    336  {
    337  recreate(point_t(width, height), p_in, alignment, alloc_in);
    338  }
    339 
    340  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
    341 private:
    342  unsigned char* _memory;
    343  std::size_t _align_in_bytes;
    344  allocator_type _alloc;
    345 
    346  std::size_t _allocated_bytes;
    347 
    348  void allocate_and_default_construct(point_t const& dimensions)
    349  {
    350  try
    351  {
    352  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    354  }
    355  catch (...) { deallocate(); throw; }
    356  }
    357 
    358  void allocate_and_fill(const point_t& dimensions, Pixel const& p_in)
    359  {
    360  try
    361  {
    362  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    363  uninitialized_fill_pixels(_view, p_in);
    364  }
    365  catch(...) { deallocate(); throw; }
    366  }
    367 
    368  template <typename View>
    369  void allocate_and_copy(const point_t& dimensions, View const& v)
    370  {
    371  try
    372  {
    373  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
    374  uninitialized_copy_pixels(v, _view);
    375  }
    376  catch(...) { deallocate(); throw; }
    377  }
    378 
    379  void deallocate()
    380  {
    381  if (_memory && _allocated_bytes > 0)
    382  _alloc.deallocate(_memory, _allocated_bytes);
    383  }
    384 
    385  std::size_t is_planar_impl(
    386  std::size_t const size_in_units,
    387  std::size_t const channels_in_image,
    388  std::true_type) const
    389  {
    390  return size_in_units * channels_in_image;
    391  }
    392 
    393  std::size_t is_planar_impl(
    394  std::size_t const size_in_units,
    395  std::size_t const,
    396  std::false_type) const
    397  {
    398  return size_in_units;
    399  }
    400 
    401  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
    402  {
    403  using x_iterator = typename view_t::x_iterator;
    404 
    405  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
    406  constexpr std::size_t _channels_in_image =
    407  std::conditional
    408  <
    409  is_pixel<value_type>::value,
    411  std::integral_constant<std::size_t, 1>
    412  >::type::value;
    413 
    414  std::size_t size_in_units = is_planar_impl(
    415  get_row_size_in_memunits(dimensions.x) * dimensions.y,
    416  _channels_in_image,
    417  std::integral_constant<bool, IsPlanar>());
    418 
    419  // return the size rounded up to the nearest byte
    420  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
    422  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
    423  }
    424 
    425  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
    426  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
    427  if (_align_in_bytes>0) {
    428  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
    429  return align(size_in_memunits, alignment_in_memunits);
    430  }
    431  return size_in_memunits;
    432  }
    433 
    434  void allocate_(point_t const& dimensions, std::false_type)
    435  {
    436  // if it throws and _memory!=0 the client must deallocate _memory
    437  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
    438  _memory=_alloc.allocate( _allocated_bytes );
    439 
    440  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    441  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
    442 
    443  BOOST_ASSERT(_view.width() == dimensions.x);
    444  BOOST_ASSERT(_view.height() == dimensions.y);
    445  }
    446 
    447  void allocate_(point_t const& dimensions, std::true_type)
    448  {
    449  // if it throws and _memory!=0 the client must deallocate _memory
    450  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
    451  std::size_t plane_size=row_size*dimensions.y;
    452 
    453  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
    454 
    455  _memory = _alloc.allocate( _allocated_bytes );
    456 
    457  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
    458  typename view_t::x_iterator first;
    459  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    460  {
    461  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    462  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    463  }
    464  _view=view_t(dimensions, typename view_t::locator(first, row_size));
    465 
    466  BOOST_ASSERT(_view.width() == dimensions.x);
    467  BOOST_ASSERT(_view.height() == dimensions.y);
    468  }
    469 
    470  void create_view(point_t const& dims, std::true_type) // is planar
    471  {
    472  std::size_t row_size=get_row_size_in_memunits(dims.x);
    473  std::size_t plane_size=row_size*dims.y;
    474 
    475  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
    476  ,_align_in_bytes
    477  )
    478  : _memory;
    479  typename view_t::x_iterator first;
    480 
    481  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
    482  {
    483  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
    484  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
    485  }
    486 
    487  _view = view_t(dims, typename view_t::locator(first, row_size));
    488 
    489  BOOST_ASSERT(_view.width() == dims.x);
    490  BOOST_ASSERT(_view.height() == dims.y);
    491  }
    492 
    493  void create_view(point_t const& dims, std::false_type) // is planar
    494  {
    495  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
    496  , _align_in_bytes
    497  )
    498  : _memory;
    499 
    500  _view = view_t( dims
    501  , typename view_t::locator( typename view_t::x_iterator( tmp )
    502  , get_row_size_in_memunits( dims.x )
    503  )
    504  );
    505 
    506  BOOST_ASSERT(_view.width() == dims.x);
    507  BOOST_ASSERT(_view.height() == dims.y);
    508  }
    509 };
    510 
    511 template <typename Pixel, bool IsPlanar, typename Alloc>
    513 {
    514  im1.swap(im2);
    515 }
    516 
    517 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    518 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
    519 {
    520  if ((void*)(&im1)==(void*)(&im2)) return true;
    521  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
    522  return equal_pixels(const_view(im1),const_view(im2));
    523 }
    524 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
    525 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
    526 
    530 
    532 
    534 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    535 const typename image<Pixel,IsPlanar,Alloc>::view_t& view(image<Pixel,IsPlanar,Alloc>& img) { return img._view; }
    536 
    538 template <typename Pixel, bool IsPlanar, typename Alloc> inline
    539 const typename image<Pixel,IsPlanar,Alloc>::const_view_t const_view(const image<Pixel,IsPlanar,Alloc>& img)
    540 {
    541  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
    542 }
    544 
    546 // PixelBasedConcept
    548 
    549 template <typename Pixel, bool IsPlanar, typename Alloc>
    550 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
    551 
    552 template <typename Pixel, bool IsPlanar, typename Alloc>
    553 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
    554 
    555 template <typename Pixel, bool IsPlanar, typename Alloc>
    556 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
    557 
    558 template <typename Pixel, bool IsPlanar, typename Alloc>
    559 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
    560 
    561 }} // namespace boost::gil
    562 
    563 #endif
    Definition: pixel_iterator.hpp:124
    Definition: algorithm.hpp:30
    void default_construct_pixels(View const &view)
    Invokes the in-place default constructor on every pixel of the (uninitialized) view. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place default-constructed pixels.
    Definition: algorithm.hpp:714
    void uninitialized_copy_pixels(View1 const &view1, View2 const &view2)
    std::uninitialized_copy for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed objects
    Definition: algorithm.hpp:778
    BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
    std::equal for image views
    Definition: algorithm.hpp:1051
    BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
    std::copy for image views
    Definition: algorithm.hpp:282
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:40
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    void uninitialized_fill_pixels(const View &view, const Value &val)
    std::uninitialized_fill for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed pixels
    Definition: algorithm.hpp:577
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    Definition: color_convert.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    -
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:447
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    +
    const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
    Returns the constant-pixel view of an image.
    Definition: image.hpp:539
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
    Definition: metafunctions.hpp:556
    BOOST_FORCEINLINE void destruct_pixels(View const &view)
    Invokes the in-place destructor on every pixel of the view.
    Definition: algorithm.hpp:508
    diff --git a/html/reference/image__view_8hpp_source.html b/html/reference/image__view_8hpp_source.html index c5737cee1..5e19f4d1b 100644 --- a/html/reference/image__view_8hpp_source.html +++ b/html/reference/image__view_8hpp_source.html @@ -62,7 +62,7 @@
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
    swap for packed_channel_reference
    Definition: channel.hpp:529
    Definition: color_convert.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Returns an integral constant type specifying the number of elements in a color base.
    Definition: color_base_algorithm.hpp:42
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    diff --git a/html/reference/image__view__factory_8hpp_source.html b/html/reference/image__view__factory_8hpp_source.html index 14a68646d..2301acf7c 100644 --- a/html/reference/image__view__factory_8hpp_source.html +++ b/html/reference/image__view__factory_8hpp_source.html @@ -71,17 +71,17 @@
    Function object that returns a grayscale reference of the N-th channel of a given reference...
    Definition: image_view_factory.hpp:360
    detail::channel_pointer_type< HomogeneousView >::type planar_view_get_raw_data(const HomogeneousView &view, int plane_index)
    Returns C pointer to the the channels of a given color plane of a planar homogeneous view...
    Definition: image_view_factory.hpp:106
    auto interleaved_view(point< std::size_t > dim, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
    Constructing image views from raw interleaved pixel data.
    Definition: image_view_factory.hpp:67
    -
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:100
    +
    Pixel concept that allows for changing its channels.
    Definition: concepts/pixel.hpp:101
    Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
    Definition: metafunctions.hpp:266
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    detail::channel_pointer_type< HomogeneousView >::type interleaved_view_get_raw_data(const HomogeneousView &view)
    Returns C pointer to the the channels of an interleaved homogeneous view.
    Definition: image_view_factory.hpp:96
    Determines if the given view is mutable (i.e. its pixels can be changed)
    Definition: metafunctions.hpp:242
    Definition: color_convert.hpp:31
    -
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:374
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    GIL&#39;s 2-dimensional view over immutable GIL pixels.
    Definition: concepts/image_view.hpp:375
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    color_converted_view_type< View, DstP >::type color_converted_view(const View &src)
    overload of generic color_converted_view with the default color-converter
    Definition: image_view_factory.hpp:178
    Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
    Definition: metafunctions.hpp:216
    -
    class for color-converting one pixel to another
    Definition: color_convert.hpp:290
    +
    class for color-converting one pixel to another
    Definition: color_convert.hpp:295
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    Basic views must be over basic locators.
    Definition: metafunctions.hpp:129
    Given a source image view type View, returns the type of an image view over a given channel of View...
    Definition: image_view_factory.hpp:541
    diff --git a/html/reference/iterator__from__2d_8hpp_source.html b/html/reference/iterator__from__2d_8hpp_source.html index a2ed58670..b37d2fd8a 100644 --- a/html/reference/iterator__from__2d_8hpp_source.html +++ b/html/reference/iterator__from__2d_8hpp_source.html @@ -55,7 +55,7 @@
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_ITERATOR_FROM_2D_HPP
    9 #define BOOST_GIL_ITERATOR_FROM_2D_HPP
    10 
    11 #include <boost/gil/concepts.hpp>
    12 #include <boost/gil/locator.hpp>
    13 #include <boost/gil/pixel_iterator.hpp>
    14 #include <boost/gil/point.hpp>
    15 
    16 #include <boost/assert.hpp>
    17 #include <boost/iterator/iterator_facade.hpp>
    18 
    19 namespace boost { namespace gil {
    20 
    22 
    28 
    29 
    33 
    34 
    40 
    41 template <typename Loc2> // Models PixelLocatorConcept
    42 class iterator_from_2d : public iterator_facade<iterator_from_2d<Loc2>,
    43  typename Loc2::value_type,
    44  std::random_access_iterator_tag,
    45  typename Loc2::reference,
    46  typename Loc2::coord_t> {
    47  BOOST_GIL_CLASS_REQUIRE(Loc2, boost::gil, PixelLocatorConcept)
    48 public:
    49  using parent_t = iterator_facade<iterator_from_2d<Loc2>,
    50  typename Loc2::value_type,
    51  std::random_access_iterator_tag,
    52  typename Loc2::reference,
    53  typename Loc2::coord_t>;
    54  using reference = typename parent_t::reference;
    55  using difference_type = typename parent_t::difference_type;
    56  using x_iterator = typename Loc2::x_iterator;
    57  using point_t = typename Loc2::point_t;
    58 
    59  std::ptrdiff_t width() const { return _width; } // number of pixels per image row
    60  std::ptrdiff_t x_pos() const { return _coords.x; } // current x position
    61  std::ptrdiff_t y_pos() const { return _coords.y; } // current y position
    62 
    65  reference operator[](difference_type d) const { return *(*this+d); }
    66 
    67  bool is_1d_traversable() const { return _p.is_1d_traversable(width()); } // is there no gap at the end of each row?
    68  x_iterator& x() { return _p.x(); }
    69 
    70  iterator_from_2d() = default;
    71  iterator_from_2d(const Loc2& p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) : _coords(x,y), _width(width), _p(p) {}
    72  iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
    73  template <typename Loc> iterator_from_2d(const iterator_from_2d<Loc>& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
    74  iterator_from_2d& operator=(iterator_from_2d const& other) = default;
    75 
    76 private:
    77  template <typename Loc> friend class iterator_from_2d;
    78  friend class boost::iterator_core_access;
    79  reference dereference() const { return *_p; }
    80  void increment() {
    81  ++_coords.x;
    82  ++_p.x();
    83  if (_coords.x>=_width) {
    84  _coords.x=0;
    85  ++_coords.y;
    86  _p+=point_t(-_width,1);
    87  }
    88  }
    89  void decrement() {
    90  --_coords.x;
    91  --_p.x();
    92  if (_coords.x<0) {
    93  _coords.x=_width-1;
    94  --_coords.y;
    95  _p+=point_t(_width,-1);
    96  }
    97  }
    98 
    99  BOOST_FORCEINLINE void advance(difference_type d) {
    100  if (_width==0) return; // unfortunately we need to check for that. Default-constructed images have width of 0 and the code below will throw if executed.
    101  point_t delta;
    102  if (_coords.x+d>=0) { // not going back to a previous row?
    103  delta.x=(_coords.x+(std::ptrdiff_t)d)%_width - _coords.x;
    104  delta.y=(_coords.x+(std::ptrdiff_t)d)/_width;
    105  } else {
    106  delta.x=(_coords.x+(std::ptrdiff_t)d*(1-_width))%_width -_coords.x;
    107  delta.y=-(_width-_coords.x-(std::ptrdiff_t)d-1)/_width;
    108  }
    109  _p+=delta;
    110  _coords.x+=delta.x;
    111  _coords.y+=delta.y;
    112  }
    113 
    114  difference_type distance_to(const iterator_from_2d& it) const {
    115  if (_width==0) return 0;
    116  return (it.y_pos()-_coords.y)*_width + (it.x_pos()-_coords.x);
    117  }
    118 
    119  bool equal(iterator_from_2d const& it) const
    120  {
    121  BOOST_ASSERT(_width == it.width()); // they must belong to the same image
    122  return _coords == it._coords && _p == it._p;
    123  }
    124 
    125  point_t _coords;
    126  std::ptrdiff_t _width;
    127  Loc2 _p;
    128 };
    129 
    130 template <typename Loc> // Models PixelLocatorConcept
    131 struct const_iterator_type<iterator_from_2d<Loc> > {
    133 };
    134 
    135 template <typename Loc> // Models PixelLocatorConcept
    136 struct iterator_is_mutable<iterator_from_2d<Loc> > : public iterator_is_mutable<typename Loc::x_iterator> {};
    137 
    138 
    140 // HasDynamicXStepTypeConcept
    142 
    143 template <typename Loc>
    144 struct dynamic_x_step_type<iterator_from_2d<Loc> > {
    146 };
    147 
    148 
    150 // PixelBasedConcept
    152 
    153 template <typename Loc> // Models PixelLocatorConcept
    154 struct color_space_type<iterator_from_2d<Loc> > : public color_space_type<Loc> {};
    155 
    156 template <typename Loc> // Models PixelLocatorConcept
    157 struct channel_mapping_type<iterator_from_2d<Loc> > : public channel_mapping_type<Loc> {};
    158 
    159 template <typename Loc> // Models PixelLocatorConcept
    160 struct is_planar<iterator_from_2d<Loc> > : public is_planar<Loc> {};
    161 
    162 template <typename Loc> // Models PixelLocatorConcept
    163 struct channel_type<iterator_from_2d<Loc> > : public channel_type<Loc> {};
    164 
    165 } } // namespace boost::gil
    166 
    167 #endif
    Definition: algorithm.hpp:30
    Definition: algorithm.hpp:30
    Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.
    Definition: iterator_from_2d.hpp:42
    -
    GIL&#39;s 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:290
    +
    GIL&#39;s 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:291
    BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
    std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
    Definition: algorithm.hpp:1029
    reference operator[](difference_type d) const
    Definition: iterator_from_2d.hpp:65
    Definition: color_convert.hpp:31
    diff --git a/html/reference/locator_8hpp_source.html b/html/reference/locator_8hpp_source.html index 942dde10f..0176fcf70 100644 --- a/html/reference/locator_8hpp_source.html +++ b/html/reference/locator_8hpp_source.html @@ -62,7 +62,7 @@
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    Definition: color_convert.hpp:31
    Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
    Definition: pixel_iterator.hpp:36
    -
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:256
    +
    Step iterator concept.
    Definition: concepts/pixel_iterator.hpp:257
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    2D point both axes of which have the same dimension typeModels: Point2DConcept
    Definition: locator.hpp:28
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    diff --git a/html/reference/metafunctions_8hpp_source.html b/html/reference/metafunctions_8hpp_source.html index 4b4c1af0f..f4fbe4fc9 100644 --- a/html/reference/metafunctions_8hpp_source.html +++ b/html/reference/metafunctions_8hpp_source.html @@ -80,7 +80,7 @@
    Determines if the given locator is mutable (i.e. its pixels can be changed)
    Definition: metafunctions.hpp:239
    Constructs a homogeneous image type from a source image type by changing some of the properties...
    Definition: metafunctions.hpp:721
    Represents a color space and ordering of channels in memory.
    Definition: utilities.hpp:266
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:40
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and ...
    Definition: metafunctions.hpp:117
    Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
    Definition: metafunctions.hpp:266
    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.
    Definition: metafunctions.hpp:443
    diff --git a/html/reference/numeric_8hpp_source.html b/html/reference/numeric_8hpp_source.html index fd11ad584..74b1b909e 100644 --- a/html/reference/numeric_8hpp_source.html +++ b/html/reference/numeric_8hpp_source.html @@ -52,7 +52,7 @@
    numeric.hpp
    -
    1 //
    2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
    3 //
    4 // Use, modification and distribution are subject to the Boost Software License,
    5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt)
    7 //
    8 #ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
    9 #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
    10 
    11 #include <boost/gil/extension/numeric/kernel.hpp>
    12 #include <boost/gil/extension/numeric/convolve.hpp>
    13 #include <boost/gil/image_view.hpp>
    14 #include <boost/gil/typedefs.hpp>
    15 #include <boost/gil/detail/math.hpp>
    16 // fixes ambigious call to std::abs, https://stackoverflow.com/a/30084734/4593721
    17 #include <cstdlib>
    18 #include <cmath>
    19 
    20 namespace boost { namespace gil {
    21 
    33 inline double normalized_sinc(double x)
    34 {
    35  return std::sin(x * boost::gil::pi) / (x * boost::gil::pi);
    36 }
    37 
    45 inline double lanczos(double x, std::ptrdiff_t a)
    46 {
    47  // means == but <= avoids compiler warning
    48  if (0 <= x && x <= 0)
    49  return 1;
    50 
    51  if (-a < x && x < a)
    52  return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
    53 
    54  return 0;
    55 }
    56 
    57 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    58 #pragma warning(push)
    59 #pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
    60 #endif
    61 
    62 inline void compute_tensor_entries(
    63  boost::gil::gray16s_view_t dx,
    64  boost::gil::gray16s_view_t dy,
    65  boost::gil::gray32f_view_t m11,
    66  boost::gil::gray32f_view_t m12_21,
    67  boost::gil::gray32f_view_t m22)
    68 {
    69  for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
    70  for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
    71  auto dx_value = dx(x, y);
    72  auto dy_value = dy(x, y);
    73  m11(x, y) = dx_value * dx_value;
    74  m12_21(x, y) = dx_value * dy_value;
    75  m22(x, y) = dy_value * dy_value;
    76  }
    77  }
    78 }
    79 
    80 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    81 #pragma warning(pop)
    82 #endif
    83 
    90 template <typename T = float, typename Allocator = std::allocator<T>>
    91 inline detail::kernel_2d<T, Allocator> generate_normalized_mean(std::size_t side_length)
    92 {
    93  if (side_length % 2 != 1)
    94  throw std::invalid_argument("kernel dimensions should be odd and equal");
    95  const float entry = 1.0f / static_cast<float>(side_length * side_length);
    96 
    97  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
    98  for (auto& cell: result) {
    99  cell = entry;
    100  }
    101 
    102  return result;
    103 }
    104 
    109 template <typename T = float, typename Allocator = std::allocator<T>>
    110 inline detail::kernel_2d<T, Allocator> generate_unnormalized_mean(std::size_t side_length)
    111 {
    112  if (side_length % 2 != 1)
    113  throw std::invalid_argument("kernel dimensions should be odd and equal");
    114 
    115  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
    116  for (auto& cell: result) {
    117  cell = 1.0f;
    118  }
    119 
    120  return result;
    121 }
    122 
    128 template <typename T = float, typename Allocator = std::allocator<T>>
    129 inline detail::kernel_2d<T, Allocator> generate_gaussian_kernel(std::size_t side_length, double sigma)
    130 {
    131  if (side_length % 2 != 1)
    132  throw std::invalid_argument("kernel dimensions should be odd and equal");
    133 
    134 
    135  const double denominator = 2 * boost::gil::pi * sigma * sigma;
    136  auto middle = side_length / 2;
    137  std::vector<T, Allocator> values(side_length * side_length);
    138  for (std::size_t y = 0; y < side_length; ++y)
    139  {
    140  for (std::size_t x = 0; x < side_length; ++x)
    141  {
    142  const auto delta_x = middle > x ? middle - x : x - middle;
    143  const auto delta_y = middle > y ? middle - y : y - middle;
    144  const double power = (delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
    145  const double nominator = std::exp(-power);
    146  const float value = static_cast<float>(nominator / denominator);
    147  values[y * side_length + x] = value;
    148  }
    149  }
    150 
    151  return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
    152 }
    153 
    161 template <typename T = float, typename Allocator = std::allocator<T>>
    162 inline detail::kernel_2d<T, Allocator> generate_dx_sobel(unsigned int degree = 1)
    163 {
    164  switch (degree)
    165  {
    166  case 0:
    167  {
    168  return get_identity_kernel<T, Allocator>();
    169  }
    170  case 1:
    171  {
    172  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    173  std::copy(dx_sobel.begin(), dx_sobel.end(), result.begin());
    174  return result;
    175  }
    176  default:
    177  throw std::logic_error("not supported yet");
    178  }
    179 
    180  //to not upset compiler
    181  throw std::runtime_error("unreachable statement");
    182 }
    183 
    191 template <typename T = float, typename Allocator = std::allocator<T>>
    192 inline detail::kernel_2d<T, Allocator> generate_dx_scharr(unsigned int degree = 1)
    193 {
    194  switch (degree)
    195  {
    196  case 0:
    197  {
    198  return get_identity_kernel<T, Allocator>();
    199  }
    200  case 1:
    201  {
    202  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    203  std::copy(dx_scharr.begin(), dx_scharr.end(), result.begin());
    204  return result;
    205  }
    206  default:
    207  throw std::logic_error("not supported yet");
    208  }
    209 
    210  //to not upset compiler
    211  throw std::runtime_error("unreachable statement");
    212 }
    213 
    221 template <typename T = float, typename Allocator = std::allocator<T>>
    222 inline detail::kernel_2d<T, Allocator> generate_dy_sobel(unsigned int degree = 1)
    223 {
    224  switch (degree)
    225  {
    226  case 0:
    227  {
    228  return get_identity_kernel<T, Allocator>();
    229  }
    230  case 1:
    231  {
    232  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    233  std::copy(dy_sobel.begin(), dy_sobel.end(), result.begin());
    234  return result;
    235  }
    236  default:
    237  throw std::logic_error("not supported yet");
    238  }
    239 
    240  //to not upset compiler
    241  throw std::runtime_error("unreachable statement");
    242 }
    243 
    251 template <typename T = float, typename Allocator = std::allocator<T>>
    252 inline detail::kernel_2d<T, Allocator> generate_dy_scharr(unsigned int degree = 1)
    253 {
    254  switch (degree)
    255  {
    256  case 0:
    257  {
    258  return get_identity_kernel<T, Allocator>();
    259  }
    260  case 1:
    261  {
    262  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    263  std::copy(dy_scharr.begin(), dy_scharr.end(), result.begin());
    264  return result;
    265  }
    266  default:
    267  throw std::logic_error("not supported yet");
    268  }
    269 
    270  //to not upset compiler
    271  throw std::runtime_error("unreachable statement");
    272 }
    273 
    283 template <typename GradientView, typename OutputView>
    285  GradientView dx,
    286  GradientView dy,
    287  OutputView ddxx,
    288  OutputView dxdy,
    289  OutputView ddyy)
    290 {
    291  auto sobel_x = generate_dx_sobel();
    292  auto sobel_y = generate_dy_sobel();
    293  detail::convolve_2d(dx, sobel_x, ddxx);
    294  detail::convolve_2d(dx, sobel_y, dxdy);
    295  detail::convolve_2d(dy, sobel_y, ddyy);
    296 }
    297 
    298 }} // namespace boost::gil
    299 
    300 #endif
    Definition: algorithm.hpp:30
    +
    1 //
    2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
    3 //
    4 // Use, modification and distribution are subject to the Boost Software License,
    5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt)
    7 //
    8 #ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
    9 #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
    10 
    11 #include <boost/gil/extension/numeric/kernel.hpp>
    12 #include <boost/gil/extension/numeric/convolve.hpp>
    13 #include <boost/gil/image_view.hpp>
    14 #include <boost/gil/typedefs.hpp>
    15 #include <boost/gil/detail/math.hpp>
    16 // fixes ambigious call to std::abs, https://stackoverflow.com/a/30084734/4593721
    17 #include <cstdlib>
    18 #include <cmath>
    19 
    20 namespace boost { namespace gil {
    21 
    33 inline double normalized_sinc(double x)
    34 {
    35  return std::sin(x * boost::gil::detail::pi) / (x * boost::gil::detail::pi);
    36 }
    37 
    45 inline double lanczos(double x, std::ptrdiff_t a)
    46 {
    47  // means == but <= avoids compiler warning
    48  if (0 <= x && x <= 0)
    49  return 1;
    50 
    51  if (-a < x && x < a)
    52  return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
    53 
    54  return 0;
    55 }
    56 
    57 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    58 #pragma warning(push)
    59 #pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
    60 #endif
    61 
    62 inline void compute_tensor_entries(
    63  boost::gil::gray16s_view_t dx,
    64  boost::gil::gray16s_view_t dy,
    65  boost::gil::gray32f_view_t m11,
    66  boost::gil::gray32f_view_t m12_21,
    67  boost::gil::gray32f_view_t m22)
    68 {
    69  for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
    70  for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
    71  auto dx_value = dx(x, y);
    72  auto dy_value = dy(x, y);
    73  m11(x, y) = dx_value * dx_value;
    74  m12_21(x, y) = dx_value * dy_value;
    75  m22(x, y) = dy_value * dy_value;
    76  }
    77  }
    78 }
    79 
    80 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
    81 #pragma warning(pop)
    82 #endif
    83 
    90 template <typename T = float, typename Allocator = std::allocator<T>>
    91 inline detail::kernel_2d<T, Allocator> generate_normalized_mean(std::size_t side_length)
    92 {
    93  if (side_length % 2 != 1)
    94  throw std::invalid_argument("kernel dimensions should be odd and equal");
    95  const float entry = 1.0f / static_cast<float>(side_length * side_length);
    96 
    97  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
    98  for (auto& cell: result) {
    99  cell = entry;
    100  }
    101 
    102  return result;
    103 }
    104 
    109 template <typename T = float, typename Allocator = std::allocator<T>>
    110 inline detail::kernel_2d<T, Allocator> generate_unnormalized_mean(std::size_t side_length)
    111 {
    112  if (side_length % 2 != 1)
    113  throw std::invalid_argument("kernel dimensions should be odd and equal");
    114 
    115  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
    116  for (auto& cell: result) {
    117  cell = 1.0f;
    118  }
    119 
    120  return result;
    121 }
    122 
    128 template <typename T = float, typename Allocator = std::allocator<T>>
    129 inline detail::kernel_2d<T, Allocator> generate_gaussian_kernel(std::size_t side_length, double sigma)
    130 {
    131  if (side_length % 2 != 1)
    132  throw std::invalid_argument("kernel dimensions should be odd and equal");
    133 
    134 
    135  const double denominator = 2 * boost::gil::detail::pi * sigma * sigma;
    136  auto middle = side_length / 2;
    137  std::vector<T, Allocator> values(side_length * side_length);
    138  for (std::size_t y = 0; y < side_length; ++y)
    139  {
    140  for (std::size_t x = 0; x < side_length; ++x)
    141  {
    142  const auto delta_x = middle > x ? middle - x : x - middle;
    143  const auto delta_y = middle > y ? middle - y : y - middle;
    144  const double power = (delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
    145  const double nominator = std::exp(-power);
    146  const float value = static_cast<float>(nominator / denominator);
    147  values[y * side_length + x] = value;
    148  }
    149  }
    150 
    151  return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
    152 }
    153 
    161 template <typename T = float, typename Allocator = std::allocator<T>>
    162 inline detail::kernel_2d<T, Allocator> generate_dx_sobel(unsigned int degree = 1)
    163 {
    164  switch (degree)
    165  {
    166  case 0:
    167  {
    168  return detail::get_identity_kernel<T, Allocator>();
    169  }
    170  case 1:
    171  {
    172  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    173  std::copy(detail::dx_sobel.begin(), detail::dx_sobel.end(), result.begin());
    174  return result;
    175  }
    176  default:
    177  throw std::logic_error("not supported yet");
    178  }
    179 
    180  //to not upset compiler
    181  throw std::runtime_error("unreachable statement");
    182 }
    183 
    191 template <typename T = float, typename Allocator = std::allocator<T>>
    192 inline detail::kernel_2d<T, Allocator> generate_dx_scharr(unsigned int degree = 1)
    193 {
    194  switch (degree)
    195  {
    196  case 0:
    197  {
    198  return detail::get_identity_kernel<T, Allocator>();
    199  }
    200  case 1:
    201  {
    202  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    203  std::copy(detail::dx_scharr.begin(), detail::dx_scharr.end(), result.begin());
    204  return result;
    205  }
    206  default:
    207  throw std::logic_error("not supported yet");
    208  }
    209 
    210  //to not upset compiler
    211  throw std::runtime_error("unreachable statement");
    212 }
    213 
    221 template <typename T = float, typename Allocator = std::allocator<T>>
    222 inline detail::kernel_2d<T, Allocator> generate_dy_sobel(unsigned int degree = 1)
    223 {
    224  switch (degree)
    225  {
    226  case 0:
    227  {
    228  return detail::get_identity_kernel<T, Allocator>();
    229  }
    230  case 1:
    231  {
    232  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    233  std::copy(detail::dy_sobel.begin(), detail::dy_sobel.end(), result.begin());
    234  return result;
    235  }
    236  default:
    237  throw std::logic_error("not supported yet");
    238  }
    239 
    240  //to not upset compiler
    241  throw std::runtime_error("unreachable statement");
    242 }
    243 
    251 template <typename T = float, typename Allocator = std::allocator<T>>
    252 inline detail::kernel_2d<T, Allocator> generate_dy_scharr(unsigned int degree = 1)
    253 {
    254  switch (degree)
    255  {
    256  case 0:
    257  {
    258  return detail::get_identity_kernel<T, Allocator>();
    259  }
    260  case 1:
    261  {
    262  detail::kernel_2d<T, Allocator> result(3, 1, 1);
    263  std::copy(detail::dy_scharr.begin(), detail::dy_scharr.end(), result.begin());
    264  return result;
    265  }
    266  default:
    267  throw std::logic_error("not supported yet");
    268  }
    269 
    270  //to not upset compiler
    271  throw std::runtime_error("unreachable statement");
    272 }
    273 
    283 template <typename GradientView, typename OutputView>
    285  GradientView dx,
    286  GradientView dy,
    287  OutputView ddxx,
    288  OutputView dxdy,
    289  OutputView ddyy)
    290 {
    291  auto sobel_x = generate_dx_sobel();
    292  auto sobel_y = generate_dy_sobel();
    293  detail::convolve_2d(dx, sobel_x, ddxx);
    294  detail::convolve_2d(dx, sobel_y, dxdy);
    295  detail::convolve_2d(dy, sobel_y, ddyy);
    296 }
    297 
    298 }} // namespace boost::gil
    299 
    300 #endif
    Definition: algorithm.hpp:30
    detail::kernel_2d< T, Allocator > generate_dy_sobel(unsigned int degree=1)
    Generates Sobel operator in vertical directionGenerates a kernel which will represent Sobel operator ...
    Definition: numeric.hpp:222
    void compute_hessian_entries(GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
    Compute xy gradient, and second order x and y gradientsHessian matrix is defined as a matrix of parti...
    Definition: numeric.hpp:284
    double lanczos(double x, std::ptrdiff_t a)
    Lanczos response at point xLanczos response is defined as: x == 0: 1 -a < x && x < a: 0 otherwise: no...
    Definition: numeric.hpp:45
    diff --git a/html/reference/pixel__based_8hpp_source.html b/html/reference/pixel__based_8hpp_source.html index 0e8e1956a..77fb00be1 100644 --- a/html/reference/pixel__based_8hpp_source.html +++ b/html/reference/pixel__based_8hpp_source.html @@ -52,9 +52,9 @@
    pixel_based.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/channel.hpp>
    13 #include <boost/gil/concepts/color.hpp>
    14 #include <boost/gil/concepts/concept_check.hpp>
    15 #include <boost/gil/concepts/fwd.hpp>
    16 
    17 #include <cstddef>
    18 
    19 #if defined(BOOST_CLANG)
    20 #pragma clang diagnostic push
    21 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    22 #endif
    23 
    24 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    25 #pragma GCC diagnostic push
    26 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    27 #endif
    28 
    29 namespace boost { namespace gil {
    30 
    51 template <typename P>
    53 {
    54  void constraints()
    55  {
    56  using color_space_t = typename color_space_type<P>::type;
    57  gil_function_requires<ColorSpaceConcept<color_space_t>>();
    58 
    59  using channel_mapping_t = typename channel_mapping_type<P>::type ;
    60  gil_function_requires<ChannelMappingConcept<channel_mapping_t>>();
    61 
    62  static const bool planar = is_planar<P>::value;
    63  ignore_unused_variable_warning(planar);
    64 
    65  // This is not part of the concept, but should still work
    66  static const std::size_t nc = num_channels<P>::value;
    67  ignore_unused_variable_warning(nc);
    68  }
    69 };
    70 
    81 template <typename P>
    83 {
    84  void constraints()
    85  {
    86  gil_function_requires<PixelBasedConcept<P>>();
    87 
    88  using channel_t = typename channel_type<P>::type;
    89  gil_function_requires<ChannelConcept<channel_t>>();
    90  }
    91 };
    92 
    93 }} // namespace boost::gil
    94 
    95 #if defined(BOOST_CLANG)
    96 #pragma clang diagnostic pop
    97 #endif
    98 
    99 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    100 #pragma GCC diagnostic pop
    101 #endif
    102 
    103 #endif
    Definition: algorithm.hpp:30
    -
    Concept for homogeneous pixel-based GIL constructs.
    Definition: pixel_based.hpp:82
    -
    Concept for all pixel-based GIL constructs.
    Definition: pixel_based.hpp:52
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/channel.hpp>
    13 #include <boost/gil/concepts/color.hpp>
    14 #include <boost/gil/concepts/concept_check.hpp>
    15 #include <boost/gil/concepts/fwd.hpp>
    16 
    17 #include <cstddef>
    18 
    19 #if defined(BOOST_CLANG)
    20 #pragma clang diagnostic push
    21 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    23 #endif
    24 
    25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    26 #pragma GCC diagnostic push
    27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 namespace boost { namespace gil {
    31 
    52 template <typename P>
    54 {
    55  void constraints()
    56  {
    57  using color_space_t = typename color_space_type<P>::type;
    58  gil_function_requires<ColorSpaceConcept<color_space_t>>();
    59 
    60  using channel_mapping_t = typename channel_mapping_type<P>::type ;
    61  gil_function_requires<ChannelMappingConcept<channel_mapping_t>>();
    62 
    63  static const bool planar = is_planar<P>::value;
    64  ignore_unused_variable_warning(planar);
    65 
    66  // This is not part of the concept, but should still work
    67  static const std::size_t nc = num_channels<P>::value;
    68  ignore_unused_variable_warning(nc);
    69  }
    70 };
    71 
    82 template <typename P>
    84 {
    85  void constraints()
    86  {
    87  gil_function_requires<PixelBasedConcept<P>>();
    88 
    89  using channel_t = typename channel_type<P>::type;
    90  gil_function_requires<ChannelConcept<channel_t>>();
    91  }
    92 };
    93 
    94 }} // namespace boost::gil
    95 
    96 #if defined(BOOST_CLANG)
    97 #pragma clang diagnostic pop
    98 #endif
    99 
    100 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    101 #pragma GCC diagnostic pop
    102 #endif
    103 
    104 #endif
    Definition: algorithm.hpp:30
    +
    Concept for homogeneous pixel-based GIL constructs.
    Definition: pixel_based.hpp:83
    +
    Concept for all pixel-based GIL constructs.
    Definition: pixel_based.hpp:53
    Definition: color_convert.hpp:31
    Returns the number of channels of a pixel-based GIL construct.
    Definition: locator.hpp:38
    diff --git a/html/reference/pixel__dereference_8hpp_source.html b/html/reference/pixel__dereference_8hpp_source.html index f1f1cf0da..f37dcf9c1 100644 --- a/html/reference/pixel__dereference_8hpp_source.html +++ b/html/reference/pixel__dereference_8hpp_source.html @@ -52,9 +52,9 @@
    pixel_dereference.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/detail/type_traits.hpp>
    16 
    17 #include <boost/concept_check.hpp>
    18 
    19 #include <cstddef>
    20 #include <type_traits>
    21 
    22 #if defined(BOOST_CLANG)
    23 #pragma clang diagnostic push
    24 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    25 #endif
    26 
    27 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    28 #pragma GCC diagnostic push
    29 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    30 #endif
    31 
    32 namespace boost { namespace gil {
    33 
    51 template <typename D>
    53 {
    54  void constraints()
    55  {
    56  gil_function_requires
    57  <
    58  boost::UnaryFunctionConcept
    59  <
    60  D,
    61  typename detail::remove_const_and_reference<typename D::result_type>::type,
    62  typename D::argument_type
    63  >
    64  >();
    65  gil_function_requires<boost::DefaultConstructibleConcept<D>>();
    66  gil_function_requires<boost::CopyConstructibleConcept<D>>();
    67  gil_function_requires<boost::AssignableConcept<D>>();
    68 
    69  gil_function_requires<PixelConcept
    70  <
    71  typename detail::remove_const_and_reference<typename D::result_type>::type
    72  >>();
    73 
    74  using const_t = typename D::const_t;
    75  gil_function_requires<PixelDereferenceAdaptorConcept<const_t>>();
    76 
    77  using value_type = typename D::value_type;
    78  gil_function_requires<PixelValueConcept<value_type>>();
    79 
    80  // TODO: Should this be concept-checked after "if you remove const and reference"? --mloskot
    81  using reference = typename D::reference; // == PixelConcept (if you remove const and reference)
    82  using const_reference = typename D::const_reference; // == PixelConcept (if you remove const and reference)
    83 
    84  bool const is_mutable = D::is_mutable;
    85  ignore_unused_variable_warning(is_mutable);
    86  }
    87  D d;
    88 };
    89 
    90 template <typename P>
    91 struct PixelDereferenceAdaptorArchetype
    92 {
    93  using argument_type = P;
    94  using result_type = P;
    95  using const_t = PixelDereferenceAdaptorArchetype;
    96  using value_type = typename std::remove_reference<P>::type;
    97  using reference = typename std::add_lvalue_reference<P>::type;
    98  using const_reference = reference;
    99 
    100  static const bool is_mutable = false;
    101  P operator()(P) const { throw; }
    102 };
    103 
    104 }} // namespace boost::gil
    105 
    106 #if defined(BOOST_CLANG)
    107 #pragma clang diagnostic pop
    108 #endif
    109 
    110 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    111 #pragma GCC diagnostic pop
    112 #endif
    113 
    114 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:52
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/detail/type_traits.hpp>
    16 
    17 #include <boost/concept_check.hpp>
    18 
    19 #include <cstddef>
    20 #include <type_traits>
    21 
    22 #if defined(BOOST_CLANG)
    23 #pragma clang diagnostic push
    24 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    25 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    26 #endif
    27 
    28 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    29 #pragma GCC diagnostic push
    30 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    31 #endif
    32 
    33 namespace boost { namespace gil {
    34 
    52 template <typename D>
    54 {
    55  void constraints()
    56  {
    57  gil_function_requires
    58  <
    59  boost::UnaryFunctionConcept
    60  <
    61  D,
    62  typename detail::remove_const_and_reference<typename D::result_type>::type,
    63  typename D::argument_type
    64  >
    65  >();
    66  gil_function_requires<boost::DefaultConstructibleConcept<D>>();
    67  gil_function_requires<boost::CopyConstructibleConcept<D>>();
    68  gil_function_requires<boost::AssignableConcept<D>>();
    69 
    70  gil_function_requires<PixelConcept
    71  <
    72  typename detail::remove_const_and_reference<typename D::result_type>::type
    73  >>();
    74 
    75  using const_t = typename D::const_t;
    76  gil_function_requires<PixelDereferenceAdaptorConcept<const_t>>();
    77 
    78  using value_type = typename D::value_type;
    79  gil_function_requires<PixelValueConcept<value_type>>();
    80 
    81  // TODO: Should this be concept-checked after "if you remove const and reference"? --mloskot
    82  using reference = typename D::reference; // == PixelConcept (if you remove const and reference)
    83  using const_reference = typename D::const_reference; // == PixelConcept (if you remove const and reference)
    84 
    85  bool const is_mutable = D::is_mutable;
    86  ignore_unused_variable_warning(is_mutable);
    87  }
    88  D d;
    89 };
    90 
    91 template <typename P>
    92 struct PixelDereferenceAdaptorArchetype
    93 {
    94  using argument_type = P;
    95  using result_type = P;
    96  using const_t = PixelDereferenceAdaptorArchetype;
    97  using value_type = typename std::remove_reference<P>::type;
    98  using reference = typename std::add_lvalue_reference<P>::type;
    99  using const_reference = reference;
    100 
    101  static const bool is_mutable = false;
    102  P operator()(P) const { throw; }
    103 };
    104 
    105 }} // namespace boost::gil
    106 
    107 #if defined(BOOST_CLANG)
    108 #pragma clang diagnostic pop
    109 #endif
    110 
    111 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    112 #pragma GCC diagnostic pop
    113 #endif
    114 
    115 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:53
    Definition: algorithm.hpp:30
    -
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:62
    +
    Pixel concept - A color base whose elements are channels.
    Definition: concepts/pixel.hpp:63
    diff --git a/html/reference/pixel__iterator__adaptor_8hpp_source.html b/html/reference/pixel__iterator__adaptor_8hpp_source.html index 9502ab53f..604be2547 100644 --- a/html/reference/pixel__iterator__adaptor_8hpp_source.html +++ b/html/reference/pixel__iterator__adaptor_8hpp_source.html @@ -52,7 +52,7 @@
    pixel_iterator_adaptor.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
    9 #define BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
    10 
    11 #include <boost/gil/concepts.hpp>
    12 #include <boost/gil/pixel_iterator.hpp>
    13 
    14 #include <boost/iterator/iterator_facade.hpp>
    15 
    16 #include <iterator>
    17 
    18 namespace boost { namespace gil {
    19 
    23 
    26 
    27 template <typename Iterator, // Models Iterator
    28  typename DFn> // Models Returns the result of dereferencing a given iterator of type Iterator
    29 class dereference_iterator_adaptor : public iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
    30  Iterator,
    31  typename DFn::value_type,
    32  typename std::iterator_traits<Iterator>::iterator_category,
    33  typename DFn::reference,
    34  use_default> {
    35  DFn _deref_fn;
    36 public:
    37  using parent_t = iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
    38  Iterator,
    39  typename DFn::value_type,
    40  typename std::iterator_traits<Iterator>::iterator_category,
    41  typename DFn::reference,
    42  use_default>;
    43  using reference = typename DFn::result_type;
    44  using difference_type = typename std::iterator_traits<Iterator>::difference_type;
    45  using dereference_fn = DFn;
    46 
    48  template <typename Iterator1>
    49  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn>& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {}
    50  dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {}
    51  template <typename Iterator1, typename DFn1>
    52  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn1>& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {}
    55  reference operator[](difference_type d) const { return *(*this+d);}
    56 
    57  // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
    58  // it is often faster to just apply the relation operator to the base
    59  bool operator> (const dereference_iterator_adaptor& p) const { return this->base_reference()> p.base_reference(); }
    60  bool operator< (const dereference_iterator_adaptor& p) const { return this->base_reference()< p.base_reference(); }
    61  bool operator>=(const dereference_iterator_adaptor& p) const { return this->base_reference()>=p.base_reference(); }
    62  bool operator<=(const dereference_iterator_adaptor& p) const { return this->base_reference()<=p.base_reference(); }
    63  bool operator==(const dereference_iterator_adaptor& p) const { return this->base_reference()==p.base_reference(); }
    64  bool operator!=(const dereference_iterator_adaptor& p) const { return this->base_reference()!=p.base_reference(); }
    65 
    66  Iterator& base() { return this->base_reference(); }
    67  const Iterator& base() const { return this->base_reference(); }
    68  const DFn& deref_fn() const { return _deref_fn; }
    69 private:
    70  template <typename Iterator1, typename DFn1>
    71  friend class dereference_iterator_adaptor;
    72  friend class boost::iterator_core_access;
    73 
    74  reference dereference() const { return _deref_fn(*(this->base_reference())); }
    75 };
    76 
    77 template <typename I, typename DFn>
    78 struct const_iterator_type<dereference_iterator_adaptor<I,DFn> > {
    80 };
    81 
    82 template <typename I, typename DFn>
    83 struct iterator_is_mutable<dereference_iterator_adaptor<I, DFn>>
    84  : std::integral_constant<bool, DFn::is_mutable>
    85 {};
    86 
    87 
    88 template <typename I, typename DFn>
    89 struct is_iterator_adaptor<dereference_iterator_adaptor<I, DFn>> : std::true_type {};
    90 
    91 template <typename I, typename DFn>
    92 struct iterator_adaptor_get_base<dereference_iterator_adaptor<I, DFn>>
    93 {
    94  using type = I;
    95 };
    96 
    97 template <typename I, typename DFn, typename NewBaseIterator>
    98 struct iterator_adaptor_rebind<dereference_iterator_adaptor<I,DFn>,NewBaseIterator> {
    100 };
    101 
    103 // PixelBasedConcept
    105 
    106 template <typename I, typename DFn>
    107 struct color_space_type<dereference_iterator_adaptor<I,DFn> > : public color_space_type<typename DFn::value_type> {};
    108 
    109 template <typename I, typename DFn>
    110 struct channel_mapping_type<dereference_iterator_adaptor<I,DFn> > : public channel_mapping_type<typename DFn::value_type> {};
    111 
    112 template <typename I, typename DFn>
    113 struct is_planar<dereference_iterator_adaptor<I,DFn> > : public is_planar<typename DFn::value_type> {};
    114 
    115 template <typename I, typename DFn>
    116 struct channel_type<dereference_iterator_adaptor<I,DFn> > : public channel_type<typename DFn::value_type> {};
    117 
    118 
    120 // MemoryBasedIteratorConcept
    122 
    123 template <typename Iterator, typename DFn>
    124 struct byte_to_memunit<dereference_iterator_adaptor<Iterator,DFn> > : public byte_to_memunit<Iterator> {};
    125 
    126 template <typename Iterator, typename DFn>
    127 inline typename std::iterator_traits<Iterator>::difference_type
    128 memunit_step(const dereference_iterator_adaptor<Iterator,DFn>& p) {
    129  return memunit_step(p.base());
    130 }
    131 
    132 template <typename Iterator, typename DFn>
    133 inline typename std::iterator_traits<Iterator>::difference_type
    134 memunit_distance(const dereference_iterator_adaptor<Iterator,DFn>& p1,
    136  return memunit_distance(p1.base(),p2.base());
    137 }
    138 
    139 template <typename Iterator, typename DFn>
    140 inline void memunit_advance(dereference_iterator_adaptor<Iterator,DFn>& p,
    141  typename std::iterator_traits<Iterator>::difference_type diff) {
    142  memunit_advance(p.base(), diff);
    143 }
    144 
    145 template <typename Iterator, typename DFn>
    147 memunit_advanced(const dereference_iterator_adaptor<Iterator,DFn>& p,
    148  typename std::iterator_traits<Iterator>::difference_type diff) {
    149  return dereference_iterator_adaptor<Iterator,DFn>(memunit_advanced(p.base(), diff), p.deref_fn());
    150 }
    151 
    152 
    153 template <typename Iterator, typename DFn>
    154 inline
    155 typename std::iterator_traits<dereference_iterator_adaptor<Iterator,DFn> >::reference
    156 memunit_advanced_ref(const dereference_iterator_adaptor<Iterator,DFn>& p,
    157  typename std::iterator_traits<Iterator>::difference_type diff) {
    158  return *memunit_advanced(p, diff);
    159 }
    160 
    162 // HasDynamicXStepTypeConcept
    164 
    165 template <typename Iterator, typename DFn>
    166 struct dynamic_x_step_type<dereference_iterator_adaptor<Iterator,DFn> > {
    168 };
    169 
    172 template <typename Iterator, typename Deref>
    173 struct iterator_add_deref {
    174  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    175 
    177 
    178  static type make(const Iterator& it, const Deref& d) { return type(it,d); }
    179 };
    180 
    183 template <typename Iterator, typename PREV_DEREF, typename Deref>
    184 struct iterator_add_deref<dereference_iterator_adaptor<Iterator, PREV_DEREF>,Deref> {
    185 // BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    186 
    188 
    189  static type make(const dereference_iterator_adaptor<Iterator, PREV_DEREF>& it, const Deref& d) {
    190  return type(it.base(),deref_compose<Deref,PREV_DEREF>(d,it.deref_fn()));
    191  }
    192 };
    193 
    194 }} // namespace boost::gil
    195 
    196 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:52
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
    9 #define BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
    10 
    11 #include <boost/gil/concepts.hpp>
    12 #include <boost/gil/pixel_iterator.hpp>
    13 
    14 #include <boost/iterator/iterator_facade.hpp>
    15 
    16 #include <iterator>
    17 
    18 namespace boost { namespace gil {
    19 
    23 
    26 
    27 template <typename Iterator, // Models Iterator
    28  typename DFn> // Models Returns the result of dereferencing a given iterator of type Iterator
    29 class dereference_iterator_adaptor : public iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
    30  Iterator,
    31  typename DFn::value_type,
    32  typename std::iterator_traits<Iterator>::iterator_category,
    33  typename DFn::reference,
    34  use_default> {
    35  DFn _deref_fn;
    36 public:
    37  using parent_t = iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
    38  Iterator,
    39  typename DFn::value_type,
    40  typename std::iterator_traits<Iterator>::iterator_category,
    41  typename DFn::reference,
    42  use_default>;
    43  using reference = typename DFn::result_type;
    44  using difference_type = typename std::iterator_traits<Iterator>::difference_type;
    45  using dereference_fn = DFn;
    46 
    48  template <typename Iterator1>
    49  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn>& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {}
    50  dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {}
    51  template <typename Iterator1, typename DFn1>
    52  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn1>& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {}
    55  reference operator[](difference_type d) const { return *(*this+d);}
    56 
    57  // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
    58  // it is often faster to just apply the relation operator to the base
    59  bool operator> (const dereference_iterator_adaptor& p) const { return this->base_reference()> p.base_reference(); }
    60  bool operator< (const dereference_iterator_adaptor& p) const { return this->base_reference()< p.base_reference(); }
    61  bool operator>=(const dereference_iterator_adaptor& p) const { return this->base_reference()>=p.base_reference(); }
    62  bool operator<=(const dereference_iterator_adaptor& p) const { return this->base_reference()<=p.base_reference(); }
    63  bool operator==(const dereference_iterator_adaptor& p) const { return this->base_reference()==p.base_reference(); }
    64  bool operator!=(const dereference_iterator_adaptor& p) const { return this->base_reference()!=p.base_reference(); }
    65 
    66  Iterator& base() { return this->base_reference(); }
    67  const Iterator& base() const { return this->base_reference(); }
    68  const DFn& deref_fn() const { return _deref_fn; }
    69 private:
    70  template <typename Iterator1, typename DFn1>
    71  friend class dereference_iterator_adaptor;
    72  friend class boost::iterator_core_access;
    73 
    74  reference dereference() const { return _deref_fn(*(this->base_reference())); }
    75 };
    76 
    77 template <typename I, typename DFn>
    78 struct const_iterator_type<dereference_iterator_adaptor<I,DFn> > {
    80 };
    81 
    82 template <typename I, typename DFn>
    83 struct iterator_is_mutable<dereference_iterator_adaptor<I, DFn>>
    84  : std::integral_constant<bool, DFn::is_mutable>
    85 {};
    86 
    87 
    88 template <typename I, typename DFn>
    89 struct is_iterator_adaptor<dereference_iterator_adaptor<I, DFn>> : std::true_type {};
    90 
    91 template <typename I, typename DFn>
    92 struct iterator_adaptor_get_base<dereference_iterator_adaptor<I, DFn>>
    93 {
    94  using type = I;
    95 };
    96 
    97 template <typename I, typename DFn, typename NewBaseIterator>
    98 struct iterator_adaptor_rebind<dereference_iterator_adaptor<I,DFn>,NewBaseIterator> {
    100 };
    101 
    103 // PixelBasedConcept
    105 
    106 template <typename I, typename DFn>
    107 struct color_space_type<dereference_iterator_adaptor<I,DFn> > : public color_space_type<typename DFn::value_type> {};
    108 
    109 template <typename I, typename DFn>
    110 struct channel_mapping_type<dereference_iterator_adaptor<I,DFn> > : public channel_mapping_type<typename DFn::value_type> {};
    111 
    112 template <typename I, typename DFn>
    113 struct is_planar<dereference_iterator_adaptor<I,DFn> > : public is_planar<typename DFn::value_type> {};
    114 
    115 template <typename I, typename DFn>
    116 struct channel_type<dereference_iterator_adaptor<I,DFn> > : public channel_type<typename DFn::value_type> {};
    117 
    118 
    120 // MemoryBasedIteratorConcept
    122 
    123 template <typename Iterator, typename DFn>
    124 struct byte_to_memunit<dereference_iterator_adaptor<Iterator,DFn> > : public byte_to_memunit<Iterator> {};
    125 
    126 template <typename Iterator, typename DFn>
    127 inline typename std::iterator_traits<Iterator>::difference_type
    128 memunit_step(const dereference_iterator_adaptor<Iterator,DFn>& p) {
    129  return memunit_step(p.base());
    130 }
    131 
    132 template <typename Iterator, typename DFn>
    133 inline typename std::iterator_traits<Iterator>::difference_type
    134 memunit_distance(const dereference_iterator_adaptor<Iterator,DFn>& p1,
    136  return memunit_distance(p1.base(),p2.base());
    137 }
    138 
    139 template <typename Iterator, typename DFn>
    140 inline void memunit_advance(dereference_iterator_adaptor<Iterator,DFn>& p,
    141  typename std::iterator_traits<Iterator>::difference_type diff) {
    142  memunit_advance(p.base(), diff);
    143 }
    144 
    145 template <typename Iterator, typename DFn>
    147 memunit_advanced(const dereference_iterator_adaptor<Iterator,DFn>& p,
    148  typename std::iterator_traits<Iterator>::difference_type diff) {
    149  return dereference_iterator_adaptor<Iterator,DFn>(memunit_advanced(p.base(), diff), p.deref_fn());
    150 }
    151 
    152 
    153 template <typename Iterator, typename DFn>
    154 inline
    155 typename std::iterator_traits<dereference_iterator_adaptor<Iterator,DFn> >::reference
    156 memunit_advanced_ref(const dereference_iterator_adaptor<Iterator,DFn>& p,
    157  typename std::iterator_traits<Iterator>::difference_type diff) {
    158  return *memunit_advanced(p, diff);
    159 }
    160 
    162 // HasDynamicXStepTypeConcept
    164 
    165 template <typename Iterator, typename DFn>
    166 struct dynamic_x_step_type<dereference_iterator_adaptor<Iterator,DFn> > {
    168 };
    169 
    172 template <typename Iterator, typename Deref>
    173 struct iterator_add_deref {
    174  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    175 
    177 
    178  static type make(const Iterator& it, const Deref& d) { return type(it,d); }
    179 };
    180 
    183 template <typename Iterator, typename PREV_DEREF, typename Deref>
    184 struct iterator_add_deref<dereference_iterator_adaptor<Iterator, PREV_DEREF>,Deref> {
    185 // BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    186 
    188 
    189  static type make(const dereference_iterator_adaptor<Iterator, PREV_DEREF>& it, const Deref& d) {
    190  return type(it.base(),deref_compose<Deref,PREV_DEREF>(d,it.deref_fn()));
    191  }
    192 };
    193 
    194 }} // namespace boost::gil
    195 
    196 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:53
    Definition: pixel_iterator.hpp:124
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    Definition: algorithm.hpp:30
    diff --git a/html/reference/pixel__locator_8hpp_source.html b/html/reference/pixel__locator_8hpp_source.html index d7b745c22..9c5c19078 100644 --- a/html/reference/pixel__locator_8hpp_source.html +++ b/html/reference/pixel__locator_8hpp_source.html @@ -52,17 +52,17 @@
    pixel_locator.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/pixel_dereference.hpp>
    16 #include <boost/gil/concepts/pixel_iterator.hpp>
    17 #include <boost/gil/concepts/point.hpp>
    18 #include <boost/gil/concepts/detail/utility.hpp>
    19 
    20 #include <cstddef>
    21 #include <iterator>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    27 #endif
    28 
    29 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    30 #pragma GCC diagnostic push
    31 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    32 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
    33 #endif
    34 
    35 namespace boost { namespace gil {
    36 
    40 
    44 
    48 
    102 template <typename Loc>
    104 {
    105  void constraints()
    106  {
    107  gil_function_requires<Regular<Loc>>();
    108 
    109  // TODO: Should these be concept-checked instead of ignored? --mloskot
    110 
    111  using value_type = typename Loc::value_type;
    112  ignore_unused_variable_warning(value_type{});
    113 
    114  // result of dereferencing
    115  using reference = typename Loc::reference;
    116  //ignore_unused_variable_warning(reference{});
    117 
    118  // result of operator-(pixel_locator, pixel_locator)
    119  using difference_type = typename Loc::difference_type;
    120  ignore_unused_variable_warning(difference_type{});
    121 
    122  // type used to store relative location (to allow for more efficient repeated access)
    123  using cached_location_t = typename Loc::cached_location_t;
    124  ignore_unused_variable_warning(cached_location_t{});
    125 
    126  // same as this type, but over const values
    127  using const_t = typename Loc::const_t;
    128  ignore_unused_variable_warning(const_t{});
    129 
    130  // same as difference_type
    131  using point_t = typename Loc::point_t;
    132  ignore_unused_variable_warning(point_t{});
    133 
    134  static std::size_t const N = Loc::num_dimensions; ignore_unused_variable_warning(N);
    135 
    136  using first_it_type = typename Loc::template axis<0>::iterator;
    137  using last_it_type = typename Loc::template axis<N-1>::iterator;
    138  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
    139  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
    140 
    141  // point_t must be an N-dimensional point, each dimension of which must
    142  // have the same type as difference_type of the corresponding iterator
    143  gil_function_requires<PointNDConcept<point_t>>();
    144  static_assert(point_t::num_dimensions == N, "");
    145  static_assert(std::is_same
    146  <
    147  typename std::iterator_traits<first_it_type>::difference_type,
    148  typename point_t::template axis<0>::coord_t
    149  >::value, "");
    150  static_assert(std::is_same
    151  <
    152  typename std::iterator_traits<last_it_type>::difference_type,
    153  typename point_t::template axis<N-1>::coord_t
    154  >::value, "");
    155 
    156  difference_type d;
    157  loc += d;
    158  loc -= d;
    159  loc = loc + d;
    160  loc = loc - d;
    161  reference r1 = loc[d]; ignore_unused_variable_warning(r1);
    162  reference r2 = *loc; ignore_unused_variable_warning(r2);
    163  cached_location_t cl = loc.cache_location(d); ignore_unused_variable_warning(cl);
    164  reference r3 = loc[d]; ignore_unused_variable_warning(r3);
    165 
    166  first_it_type fi = loc.template axis_iterator<0>();
    167  fi = loc.template axis_iterator<0>(d);
    168  last_it_type li = loc.template axis_iterator<N-1>();
    169  li = loc.template axis_iterator<N-1>(d);
    170 
    171  using deref_t = PixelDereferenceAdaptorArchetype<typename Loc::value_type>;
    172  using dtype = typename Loc::template add_deref<deref_t>::type;
    173  // TODO: infinite recursion - FIXME?
    174  //gil_function_requires<RandomAccessNDLocatorConcept<dtype>>();
    175  }
    176  Loc loc;
    177 };
    178 
    219 template <typename Loc>
    221 {
    222  void constraints()
    223  {
    224  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
    225  static_assert(Loc::num_dimensions == 2, "");
    226 
    227  using dynamic_x_step_t = typename dynamic_x_step_type<Loc>::type;
    228  using dynamic_y_step_t = typename dynamic_y_step_type<Loc>::type;
    229  using transposed_t = typename transposed_type<Loc>::type;
    230 
    231  using cached_location_t = typename Loc::cached_location_t;
    232  gil_function_requires<Point2DConcept<typename Loc::point_t>>();
    233 
    234  using x_iterator = typename Loc::x_iterator;
    235  using y_iterator = typename Loc::y_iterator;
    236  using x_coord_t = typename Loc::x_coord_t;
    237  using y_coord_t = typename Loc::y_coord_t;
    238 
    239  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    240  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    241 
    242  typename Loc::difference_type d;
    243  typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
    244 
    245  dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
    246  dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
    247 
    248  using dynamic_xy_step_transposed_t = typename dynamic_y_step_type
    249  <
    251  >::type;
    252  dynamic_xy_step_transposed_t loc4(loc, xd,yd,true);
    253 
    254  bool is_contiguous = loc.is_1d_traversable(xd);
    255  ignore_unused_variable_warning(is_contiguous);
    256 
    257  loc.y_distance_to(loc, xd);
    258 
    259  loc = loc.xy_at(d);
    260  loc = loc.xy_at(xd, yd);
    261 
    262  x_iterator xit = loc.x_at(d);
    263  xit = loc.x_at(xd, yd);
    264  xit = loc.x();
    265 
    266  y_iterator yit = loc.y_at(d);
    267  yit = loc.y_at(xd, yd);
    268  yit = loc.y();
    269 
    270  cached_location_t cl = loc.cache_location(xd, yd);
    271  ignore_unused_variable_warning(cl);
    272  }
    273  Loc loc;
    274 };
    275 
    289 template <typename Loc>
    291 {
    292  void constraints()
    293  {
    294  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
    295  gil_function_requires<PixelIteratorConcept<typename Loc::x_iterator>>();
    296  gil_function_requires<PixelIteratorConcept<typename Loc::y_iterator>>();
    297  using coord_t = typename Loc::coord_t;
    298  static_assert(std::is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value, "");
    299  }
    300  Loc loc;
    301 };
    302 
    303 namespace detail {
    304 
    306 template <typename Loc>
    308 {
    309  void constraints()
    310  {
    311  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    312  <
    313  typename Loc::template axis<0>::iterator
    314  >>();
    315  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    316  <
    317  typename Loc::template axis<Loc::num_dimensions-1>::iterator
    318  >>();
    319 
    320  typename Loc::difference_type d; initialize_it(d);
    321  typename Loc::value_type v; initialize_it(v);
    322  typename Loc::cached_location_t cl = loc.cache_location(d);
    323  *loc = v;
    324  loc[d] = v;
    325  loc[cl] = v;
    326  }
    327  Loc loc;
    328 };
    329 
    330 // \tparam Loc Models RandomAccess2DLocatorConcept
    331 template <typename Loc>
    332 struct RandomAccess2DLocatorIsMutableConcept
    333 {
    334  void constraints()
    335  {
    336  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
    337  typename Loc::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    338  typename Loc::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    339  typename Loc::value_type v; initialize_it(v);
    340  loc(xd, yd) = v;
    341  }
    342  Loc loc;
    343 };
    344 
    345 } // namespace detail
    346 
    356 template <typename Loc>
    358 {
    359  void constraints()
    360  {
    361  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
    362  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
    363  }
    364 };
    365 
    373 template <typename Loc>
    375 {
    376  void constraints()
    377  {
    378  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
    379  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
    380  }
    381 };
    382 
    390 template <typename Loc>
    392 {
    393  void constraints()
    394  {
    395  gil_function_requires<PixelLocatorConcept<Loc>>();
    396  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
    397  }
    398 };
    399 
    400 }} // namespace boost::gil
    401 
    402 #if defined(BOOST_CLANG)
    403 #pragma clang diagnostic pop
    404 #endif
    405 
    406 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    407 #pragma GCC diagnostic pop
    408 #endif
    409 
    410 #endif
    N-dimensional locator over mutable pixels.
    Definition: pixel_locator.hpp:357
    - +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
    9 #define BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
    10 
    11 #include <boost/gil/concepts/basic.hpp>
    12 #include <boost/gil/concepts/concept_check.hpp>
    13 #include <boost/gil/concepts/fwd.hpp>
    14 #include <boost/gil/concepts/pixel.hpp>
    15 #include <boost/gil/concepts/pixel_dereference.hpp>
    16 #include <boost/gil/concepts/pixel_iterator.hpp>
    17 #include <boost/gil/concepts/point.hpp>
    18 #include <boost/gil/concepts/detail/utility.hpp>
    19 
    20 #include <cstddef>
    21 #include <iterator>
    22 #include <type_traits>
    23 
    24 #if defined(BOOST_CLANG)
    25 #pragma clang diagnostic push
    26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
    27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
    28 #endif
    29 
    30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    31 #pragma GCC diagnostic push
    32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    33 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
    34 #endif
    35 
    36 namespace boost { namespace gil {
    37 
    41 
    45 
    49 
    103 template <typename Loc>
    105 {
    106  void constraints()
    107  {
    108  gil_function_requires<Regular<Loc>>();
    109 
    110  // TODO: Should these be concept-checked instead of ignored? --mloskot
    111 
    112  using value_type = typename Loc::value_type;
    113  ignore_unused_variable_warning(value_type{});
    114 
    115  // result of dereferencing
    116  using reference = typename Loc::reference;
    117  //ignore_unused_variable_warning(reference{});
    118 
    119  // result of operator-(pixel_locator, pixel_locator)
    120  using difference_type = typename Loc::difference_type;
    121  ignore_unused_variable_warning(difference_type{});
    122 
    123  // type used to store relative location (to allow for more efficient repeated access)
    124  using cached_location_t = typename Loc::cached_location_t;
    125  ignore_unused_variable_warning(cached_location_t{});
    126 
    127  // same as this type, but over const values
    128  using const_t = typename Loc::const_t;
    129  ignore_unused_variable_warning(const_t{});
    130 
    131  // same as difference_type
    132  using point_t = typename Loc::point_t;
    133  ignore_unused_variable_warning(point_t{});
    134 
    135  static std::size_t const N = Loc::num_dimensions; ignore_unused_variable_warning(N);
    136 
    137  using first_it_type = typename Loc::template axis<0>::iterator;
    138  using last_it_type = typename Loc::template axis<N-1>::iterator;
    139  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
    140  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
    141 
    142  // point_t must be an N-dimensional point, each dimension of which must
    143  // have the same type as difference_type of the corresponding iterator
    144  gil_function_requires<PointNDConcept<point_t>>();
    145  static_assert(point_t::num_dimensions == N, "");
    146  static_assert(std::is_same
    147  <
    148  typename std::iterator_traits<first_it_type>::difference_type,
    149  typename point_t::template axis<0>::coord_t
    150  >::value, "");
    151  static_assert(std::is_same
    152  <
    153  typename std::iterator_traits<last_it_type>::difference_type,
    154  typename point_t::template axis<N-1>::coord_t
    155  >::value, "");
    156 
    157  difference_type d;
    158  loc += d;
    159  loc -= d;
    160  loc = loc + d;
    161  loc = loc - d;
    162  reference r1 = loc[d]; ignore_unused_variable_warning(r1);
    163  reference r2 = *loc; ignore_unused_variable_warning(r2);
    164  cached_location_t cl = loc.cache_location(d); ignore_unused_variable_warning(cl);
    165  reference r3 = loc[d]; ignore_unused_variable_warning(r3);
    166 
    167  first_it_type fi = loc.template axis_iterator<0>();
    168  fi = loc.template axis_iterator<0>(d);
    169  last_it_type li = loc.template axis_iterator<N-1>();
    170  li = loc.template axis_iterator<N-1>(d);
    171 
    172  using deref_t = PixelDereferenceAdaptorArchetype<typename Loc::value_type>;
    173  using dtype = typename Loc::template add_deref<deref_t>::type;
    174  // TODO: infinite recursion - FIXME?
    175  //gil_function_requires<RandomAccessNDLocatorConcept<dtype>>();
    176  }
    177  Loc loc;
    178 };
    179 
    220 template <typename Loc>
    222 {
    223  void constraints()
    224  {
    225  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
    226  static_assert(Loc::num_dimensions == 2, "");
    227 
    228  using dynamic_x_step_t = typename dynamic_x_step_type<Loc>::type;
    229  using dynamic_y_step_t = typename dynamic_y_step_type<Loc>::type;
    230  using transposed_t = typename transposed_type<Loc>::type;
    231 
    232  using cached_location_t = typename Loc::cached_location_t;
    233  gil_function_requires<Point2DConcept<typename Loc::point_t>>();
    234 
    235  using x_iterator = typename Loc::x_iterator;
    236  using y_iterator = typename Loc::y_iterator;
    237  using x_coord_t = typename Loc::x_coord_t;
    238  using y_coord_t = typename Loc::y_coord_t;
    239 
    240  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    241  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    242 
    243  typename Loc::difference_type d;
    244  typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
    245 
    246  dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
    247  dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
    248 
    249  using dynamic_xy_step_transposed_t = typename dynamic_y_step_type
    250  <
    252  >::type;
    253  dynamic_xy_step_transposed_t loc4(loc, xd,yd,true);
    254 
    255  bool is_contiguous = loc.is_1d_traversable(xd);
    256  ignore_unused_variable_warning(is_contiguous);
    257 
    258  loc.y_distance_to(loc, xd);
    259 
    260  loc = loc.xy_at(d);
    261  loc = loc.xy_at(xd, yd);
    262 
    263  x_iterator xit = loc.x_at(d);
    264  xit = loc.x_at(xd, yd);
    265  xit = loc.x();
    266 
    267  y_iterator yit = loc.y_at(d);
    268  yit = loc.y_at(xd, yd);
    269  yit = loc.y();
    270 
    271  cached_location_t cl = loc.cache_location(xd, yd);
    272  ignore_unused_variable_warning(cl);
    273  }
    274  Loc loc;
    275 };
    276 
    290 template <typename Loc>
    292 {
    293  void constraints()
    294  {
    295  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
    296  gil_function_requires<PixelIteratorConcept<typename Loc::x_iterator>>();
    297  gil_function_requires<PixelIteratorConcept<typename Loc::y_iterator>>();
    298  using coord_t = typename Loc::coord_t;
    299  static_assert(std::is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value, "");
    300  }
    301  Loc loc;
    302 };
    303 
    304 namespace detail {
    305 
    307 template <typename Loc>
    309 {
    310  void constraints()
    311  {
    312  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    313  <
    314  typename Loc::template axis<0>::iterator
    315  >>();
    316  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
    317  <
    318  typename Loc::template axis<Loc::num_dimensions-1>::iterator
    319  >>();
    320 
    321  typename Loc::difference_type d; initialize_it(d);
    322  typename Loc::value_type v; initialize_it(v);
    323  typename Loc::cached_location_t cl = loc.cache_location(d);
    324  *loc = v;
    325  loc[d] = v;
    326  loc[cl] = v;
    327  }
    328  Loc loc;
    329 };
    330 
    331 // \tparam Loc Models RandomAccess2DLocatorConcept
    332 template <typename Loc>
    333 struct RandomAccess2DLocatorIsMutableConcept
    334 {
    335  void constraints()
    336  {
    337  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
    338  typename Loc::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
    339  typename Loc::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
    340  typename Loc::value_type v; initialize_it(v);
    341  loc(xd, yd) = v;
    342  }
    343  Loc loc;
    344 };
    345 
    346 } // namespace detail
    347 
    357 template <typename Loc>
    359 {
    360  void constraints()
    361  {
    362  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
    363  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
    364  }
    365 };
    366 
    374 template <typename Loc>
    376 {
    377  void constraints()
    378  {
    379  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
    380  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
    381  }
    382 };
    383 
    391 template <typename Loc>
    393 {
    394  void constraints()
    395  {
    396  gil_function_requires<PixelLocatorConcept<Loc>>();
    397  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
    398  }
    399 };
    400 
    401 }} // namespace boost::gil
    402 
    403 #if defined(BOOST_CLANG)
    404 #pragma clang diagnostic pop
    405 #endif
    406 
    407 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
    408 #pragma GCC diagnostic pop
    409 #endif
    410 
    411 #endif
    N-dimensional locator over mutable pixels.
    Definition: pixel_locator.hpp:358
    +
    Definition: algorithm.hpp:30
    -
    2-dimensional locator over mutable pixels
    Definition: pixel_locator.hpp:374
    -
    2-dimensional locator over immutable values
    Definition: pixel_locator.hpp:220
    -
    GIL&#39;s 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:290
    +
    2-dimensional locator over mutable pixels
    Definition: pixel_locator.hpp:375
    +
    2-dimensional locator over immutable values
    Definition: pixel_locator.hpp:221
    +
    GIL&#39;s 2-dimensional locator over immutable GIL pixels.
    Definition: pixel_locator.hpp:291
    Base template for types that model HasDynamicYStepTypeConcept.
    Definition: dynamic_step.hpp:21
    -
    N-dimensional locator over immutable values.
    Definition: pixel_locator.hpp:103
    +
    N-dimensional locator over immutable values.
    Definition: pixel_locator.hpp:104
    Base template for types that model HasDynamicXStepTypeConcept.
    Definition: dynamic_step.hpp:17
    -
    GIL&#39;s 2-dimensional locator over mutable GIL pixels.
    Definition: pixel_locator.hpp:391
    +
    GIL&#39;s 2-dimensional locator over mutable GIL pixels.
    Definition: pixel_locator.hpp:392
    diff --git a/html/reference/read__and__convert__image_8hpp_source.html b/html/reference/read__and__convert__image_8hpp_source.html index e1a2a79e9..11cd8748d 100644 --- a/html/reference/read__and__convert__image_8hpp_source.html +++ b/html/reference/read__and__convert__image_8hpp_source.html @@ -55,7 +55,7 @@
    1 //
    2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
    9 #define BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
    10 
    11 #include <boost/gil/io/base.hpp>
    12 #include <boost/gil/io/conversion_policies.hpp>
    13 #include <boost/gil/io/device.hpp>
    14 #include <boost/gil/io/get_reader.hpp>
    15 #include <boost/gil/io/path_spec.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <type_traits>
    19 
    20 namespace boost{ namespace gil {
    21 
    23 
    30 template <typename Reader, typename Image>
    31 inline
    32 void read_and_convert_image(Reader& reader, Image& img,
    33  typename std::enable_if
    34  <
    35  mp11::mp_and
    36  <
    37  detail::is_reader<Reader>,
    38  is_format_tag<typename Reader::format_tag_t>
    39  >::value
    40  >::type* /*dummy*/ = nullptr)
    41 {
    42  reader.init_image(img, reader._settings);
    43  reader.apply(view(img));
    44 }
    45 
    52 template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
    53 inline
    55  Device& device,
    56  Image& img,
    57  image_read_settings<FormatTag> const& settings,
    58  ColorConverter const& cc,
    59  typename std::enable_if
    60  <
    61  mp11::mp_and
    62  <
    64  is_format_tag<FormatTag>
    65  >::value
    66  >::type* /*dummy*/ = nullptr)
    67 {
    68  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    70 
    71  reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
    72  read_and_convert_image(reader, img);
    73 }
    74 
    81 template <typename String, typename Image, typename ColorConverter, typename FormatTag>
    82 inline
    84  String const& file_name,
    85  Image& img,
    86  image_read_settings<FormatTag> const& settings,
    87  ColorConverter const& cc,
    88  typename std::enable_if
    89  <
    90  mp11::mp_and
    91  <
    92  is_format_tag<FormatTag>,
    93  detail::is_supported_path_spec<String>
    94  >::value
    95  >::type* /*dummy*/ = nullptr)
    96 {
    97  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    99 
    100  reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
    101  read_and_convert_image(reader, img);
    102 }
    103 
    110 template <typename String, typename Image, typename ColorConverter, typename FormatTag>
    111 inline
    113  String const& file_name,
    114  Image& img,
    115  ColorConverter const& cc,
    116  FormatTag const& tag,
    117  typename std::enable_if
    118  <
    119  mp11::mp_and
    120  <
    121  is_format_tag<FormatTag>,
    122  detail::is_supported_path_spec<String>
    123  >::value
    124  >::type* /*dummy*/ = nullptr)
    125 {
    126  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    128 
    129  reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
    130  read_and_convert_image(reader, img);
    131 }
    132 
    139 template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
    140 inline
    142  Device& device,
    143  Image& img,
    144  ColorConverter const& cc,
    145  FormatTag const& tag,
    146  typename std::enable_if
    147  <
    148  mp11::mp_and
    149  <
    151  is_format_tag<FormatTag>
    152  >::value
    153  >::type* /*dummy*/ = nullptr)
    154 {
    155  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    157 
    158  reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
    159  read_and_convert_image(reader, img);
    160 }
    161 
    167 template <typename String, typename Image, typename FormatTag>
    168 inline void read_and_convert_image(
    169  String const& file_name,
    170  Image& img,
    171  image_read_settings<FormatTag> const& settings,
    172  typename std::enable_if
    173  <
    174  mp11::mp_and
    175  <
    176  is_format_tag<FormatTag>,
    177  detail::is_supported_path_spec<String>
    178  >::value
    179  >::type* /*dummy*/ = nullptr)
    180 {
    181  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    183 
    184  reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
    185  read_and_convert_image(reader, img);
    186 }
    187 
    193 template <typename Device, typename Image, typename FormatTag>
    194 inline void read_and_convert_image(
    195  Device& device,
    196  Image& img,
    197  image_read_settings<FormatTag> const& settings,
    198  typename std::enable_if
    199  <
    200  mp11::mp_and
    201  <
    203  is_format_tag<FormatTag>
    204  >::value
    205  >::type* /*dummy*/ = nullptr)
    206 {
    207  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    209 
    210  reader_t reader = make_reader(device, settings, read_and_convert_t{});
    211  read_and_convert_image(reader, img);
    212 }
    213 
    219 template <typename String, typename Image, typename FormatTag>
    220 inline
    222  String const& file_name,
    223  Image& img,
    224  FormatTag const& tag,
    225  typename std::enable_if
    226  <
    227  mp11::mp_and
    228  <
    229  is_format_tag<FormatTag>,
    230  detail::is_supported_path_spec<String>
    231  >::value
    232  >::type* /*dummy*/ = nullptr)
    233 {
    234  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    236 
    237  reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
    238  read_and_convert_image(reader, img);
    239 }
    240 
    246 template <typename Device, typename Image, typename FormatTag>
    247 inline void read_and_convert_image(
    248  Device& device,
    249  Image& img,
    250  FormatTag const& tag,
    251  typename std::enable_if
    252  <
    253  mp11::mp_and
    254  <
    256  is_format_tag<FormatTag>
    257  >::value
    258  >::type* /*dummy*/ = nullptr)
    259 {
    260  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    262 
    263  reader_t reader = make_reader(device, tag, read_and_convert_t{});
    264  read_and_convert_image(reader, img);
    265 }
    266 
    267 }} // namespace boost::gil
    268 
    269 #endif
    Definition: algorithm.hpp:30
    void read_and_convert_image(Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
    Reads and color-converts an image. Image memory is allocated.
    Definition: read_and_convert_image.hpp:32
    Definition: device.hpp:575
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    diff --git a/html/reference/read__and__convert__view_8hpp_source.html b/html/reference/read__and__convert__view_8hpp_source.html index 7c6bd6717..df8dd4bee 100644 --- a/html/reference/read__and__convert__view_8hpp_source.html +++ b/html/reference/read__and__convert__view_8hpp_source.html @@ -55,7 +55,7 @@
    1 //
    2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
    9 #define BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
    10 
    11 #include <boost/gil/io/base.hpp>
    12 #include <boost/gil/io/conversion_policies.hpp>
    13 #include <boost/gil/io/device.hpp>
    14 #include <boost/gil/io/get_reader.hpp>
    15 #include <boost/gil/io/path_spec.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <type_traits>
    19 
    20 namespace boost{ namespace gil {
    21 
    23 
    30 template <typename Reader, typename View>
    31 inline
    32 void read_and_convert_view(Reader& reader, View const& view,
    33  typename std::enable_if
    34  <
    35  mp11::mp_and
    36  <
    37  detail::is_reader<Reader>,
    38  is_format_tag<typename Reader::format_tag_t>
    39  >::value
    40  >::type* /*dummy*/ = nullptr)
    41 {
    42  reader.check_image_size(view.dimensions());
    43  reader.init_view(view, reader._settings);
    44  reader.apply(view);
    45 }
    46 
    53 template <typename Device, typename View, typename ColorConverter, typename FormatTag>
    54 inline
    56  Device& device,
    57  View const& view,
    58  image_read_settings<FormatTag> const& settings,
    59  ColorConverter const& cc,
    60  typename std::enable_if
    61  <
    62  mp11::mp_and
    63  <
    65  is_format_tag<FormatTag>
    66  >::value
    67  >::type* /*dummy*/ = nullptr)
    68 {
    69  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    71 
    72  reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
    73  read_and_convert_view(reader, view);
    74 }
    75 
    82 template <typename String, typename View, typename ColorConverter, typename FormatTag>
    83 inline
    85  String const& file_name,
    86  View const& view,
    87  image_read_settings<FormatTag> const& settings,
    88  ColorConverter const& cc,
    89  typename std::enable_if
    90  <
    91  mp11::mp_and
    92  <
    93  is_format_tag<FormatTag>,
    94  detail::is_supported_path_spec<String>
    95  >::value
    96  >::type* /*dummy*/ = nullptr)
    97 {
    98  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    100 
    101  reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
    102  read_and_convert_view(reader, view);
    103 }
    104 
    111 template <typename String, typename View, typename ColorConverter, typename FormatTag>
    112 inline
    114  String const& file_name,
    115  View const& view,
    116  ColorConverter const& cc,
    117  FormatTag const& tag,
    118  typename std::enable_if
    119  <
    120  mp11::mp_and
    121  <
    122  is_format_tag<FormatTag>,
    123  detail::is_supported_path_spec<String>
    124  >::value
    125  >::type* /*dummy*/ = nullptr)
    126 {
    127  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    129 
    130  reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
    131  read_and_convert_view(reader, view);
    132 }
    133 
    140 template <typename Device, typename View, typename ColorConverter, typename FormatTag>
    141 inline
    143  Device& device,
    144  View const& view,
    145  ColorConverter const& cc,
    146  FormatTag const& tag,
    147  typename std::enable_if
    148  <
    149  mp11::mp_and
    150  <
    152  is_format_tag<FormatTag>
    153  >::value
    154  >::type* /*dummy*/ = nullptr)
    155 {
    156  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
    158 
    159  reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
    160  read_and_convert_view(reader, view);
    161 }
    162 
    168 template <typename String, typename View, typename FormatTag>
    169 inline
    171  String const& file_name,
    172  View const& view,
    173  image_read_settings<FormatTag> const& settings,
    174  typename std::enable_if
    175  <
    176  mp11::mp_and
    177  <
    178  is_format_tag<FormatTag>,
    179  detail::is_supported_path_spec<String>
    180  >::value
    181  >::type* /*dummy*/ = nullptr)
    182 {
    183  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    185 
    186  reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
    187  read_and_convert_view(reader, view);
    188 }
    189 
    195 template <typename Device, typename View, typename FormatTag>
    196 inline
    198  Device& device,
    199  View const& view,
    200  image_read_settings<FormatTag> const& settings,
    201  typename std::enable_if
    202  <
    203  mp11::mp_and
    204  <
    206  is_format_tag<FormatTag>
    207  >::value
    208  >::type* /*dummy*/ = nullptr)
    209 {
    210  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    212 
    213  reader_t reader = make_reader(device, settings, read_and_convert_t{});
    214  read_and_convert_view(reader, view);
    215 }
    216 
    222 template <typename String, typename View, typename FormatTag>
    223 inline
    225  String const& file_name,
    226  View const& view,
    227  FormatTag const& tag,
    228  typename std::enable_if
    229  <
    230  mp11::mp_and
    231  <
    232  is_format_tag<FormatTag>,
    233  detail::is_supported_path_spec<String>
    234  >::value
    235  >::type* /*dummy*/ = nullptr)
    236 {
    237  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    239 
    240  reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
    241  read_and_convert_view(reader, view);
    242 }
    243 
    249 template <typename Device, typename View, typename FormatTag>
    250 inline
    252  Device& device,
    253  View const& view,
    254  FormatTag const& tag,
    255  typename std::enable_if
    256  <
    257  mp11::mp_and
    258  <
    260  is_format_tag<FormatTag>
    261  >::value
    262  >::type* /*dummy*/ = nullptr)
    263 {
    264  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
    266 
    267  reader_t reader = make_reader(device, tag, read_and_convert_t{});
    268  read_and_convert_view(reader, view);
    269 }
    270 
    271 }} // namespace boost::gill
    272 
    273 #endif
    Definition: algorithm.hpp:30
    Definition: device.hpp:575
    void read_and_convert_view(Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
    Reads and color-converts an image view. No memory is allocated.
    Definition: read_and_convert_view.hpp:32
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    diff --git a/html/reference/read__image_8hpp_source.html b/html/reference/read__image_8hpp_source.html index bb91613df..bbd2a051e 100644 --- a/html/reference/read__image_8hpp_source.html +++ b/html/reference/read__image_8hpp_source.html @@ -57,7 +57,7 @@
    Represents a run-time specified image. Note it does NOT model ImageConcept.
    Definition: any_image.hpp:88
    Definition: base.hpp:78
    Definition: device.hpp:575
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    void read_image(Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
    Reads an image without conversion. Image memory is allocated.
    Definition: read_image.hpp:32
    diff --git a/html/reference/read__view_8hpp_source.html b/html/reference/read__view_8hpp_source.html index fa2e66ae1..9b66ae7ae 100644 --- a/html/reference/read__view_8hpp_source.html +++ b/html/reference/read__view_8hpp_source.html @@ -56,7 +56,7 @@
    Definition: base.hpp:78
    Definition: device.hpp:575
    void read_view(Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
    Reads an image view without conversion. No memory is allocated.
    Definition: read_view.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    Helper metafunction to generate image reader type.
    Definition: get_reader.hpp:26
    diff --git a/html/reference/reader__base_8hpp_source.html b/html/reference/reader__base_8hpp_source.html index 5efb52a16..af74fab43 100644 --- a/html/reference/reader__base_8hpp_source.html +++ b/html/reference/reader__base_8hpp_source.html @@ -54,7 +54,7 @@
    1 //
    2 // Copyright 2007-2008 Christian Henning
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IO_READER_BASE_HPP
    9 #define BOOST_GIL_IO_READER_BASE_HPP
    10 
    11 #include <boost/gil/io/base.hpp>
    12 
    13 #include <boost/assert.hpp>
    14 
    15 namespace boost { namespace gil {
    16 
    25 template< typename FormatTag
    26  , typename ConversionPolicy
    27  >
    29 {
    30 public:
    31 
    36  :_cc_policy()
    37  {}
    38 
    42  reader_base( const ConversionPolicy& cc )
    43  :_cc_policy( cc )
    44  {}
    45 
    52  template< typename Image >
    53  void init_image( Image& img
    54  , const image_read_settings< FormatTag >& settings
    55  )
    56  {
    57  //setup( backend._settings._dim );
    58 
    59  BOOST_ASSERT(settings._dim.x && settings._dim.y);
    60 
    61  img.recreate( settings._dim.x
    62  , settings._dim.y
    63  );
    64  }
    65 
    66  template< typename View >
    67  void init_view( const View& view
    68  , const image_read_settings< FormatTag >&
    69  )
    70  {
    71  setup( view.dimensions() );
    72  }
    73 
    74 private:
    75 
    76  void setup( const point_t& /* dim */ )
    77  {
    78  //check_coordinates( dim );
    79 
    80  //if( dim == point_t( 0, 0 ))
    81  //{
    82  // _settings._dim.x = _info._width;
    83  // _settings._dim.y = _info._height;
    84  //}
    85  //else
    86  //{
    87  // _settings._dim = dim;
    88  //}
    89  }
    90 
    91  void check_coordinates( const point_t& /* dim */ )
    92  {
    93  //using int_t = point_t::value_type;
    94 
    95  //int_t width = static_cast< int_t >( _info._width );
    96  //int_t height = static_cast< int_t >( _info._height );
    97 
    98  //io_error_if( ( _settings._top_left.x < 0
    99  // || _settings._top_left.y < 0
    100  // || dim.x < 0
    101  // || dim.y < 0
    102  // )
    103  // , "User provided view has incorrect size." );
    104 
    105 
    106  //io_error_if( ( ( width ) < _settings._top_left.x
    107  // && ( width ) <= dim.x
    108  // && ( height ) < _settings._top_left.y
    109  // && ( height ) <= dim.y )
    110  // , "User provided view has incorrect size." );
    111 
    112  //io_error_if( ( ( _settings._top_left.x + dim.x ) > width
    113  // || ( _settings._top_left.y + dim.y ) > height
    114  // )
    115  // , "User provided view has incorrect size." );
    116  }
    117 
    118 protected:
    119 
    120  ConversionPolicy _cc_policy;
    121 };
    122 
    123 } // namespace gil
    124 } // namespace boost
    125 
    126 #endif
    Definition: algorithm.hpp:30
    void init_image(Image &img, const image_read_settings< FormatTag > &settings)
    Definition: reader_base.hpp:53
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    reader_base()
    Definition: reader_base.hpp:35
    Definition: reader_base.hpp:28
    diff --git a/html/reference/step__iterator_8hpp_source.html b/html/reference/step__iterator_8hpp_source.html index 44163243f..a9066ff84 100644 --- a/html/reference/step__iterator_8hpp_source.html +++ b/html/reference/step__iterator_8hpp_source.html @@ -52,11 +52,11 @@
    step_iterator.hpp
    -
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_STEP_ITERATOR_HPP
    9 #define BOOST_GIL_STEP_ITERATOR_HPP
    10 
    11 #include <boost/gil/dynamic_step.hpp>
    12 #include <boost/gil/pixel_iterator.hpp>
    13 #include <boost/gil/pixel_iterator_adaptor.hpp>
    14 #include <boost/gil/utilities.hpp>
    15 
    16 #include <boost/iterator/iterator_facade.hpp>
    17 
    18 #include <cstddef>
    19 #include <iterator>
    20 #include <type_traits>
    21 
    22 namespace boost { namespace gil {
    23 
    27 
    28 namespace detail {
    29 
    36 
    37 template <typename Derived, // type of the derived class
    38  typename Iterator, // Models Iterator
    39  typename SFn> // A policy object that can compute the distance between two iterators of type Iterator
    40  // and can advance an iterator of type Iterator a given number of Iterator's units
    41 class step_iterator_adaptor : public iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>
    42 {
    43 public:
    44  using parent_t = iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>;
    45  using base_difference_type = typename std::iterator_traits<Iterator>::difference_type;
    46  using difference_type = typename SFn::difference_type;
    47  using reference = typename std::iterator_traits<Iterator>::reference;
    48 
    50  step_iterator_adaptor(const Iterator& it, SFn step_fn=SFn()) : parent_t(it), _step_fn(step_fn) {}
    51 
    52  difference_type step() const { return _step_fn.step(); }
    53 
    54 protected:
    55  SFn _step_fn;
    56 private:
    57  friend class boost::iterator_core_access;
    58 
    59  void increment() { _step_fn.advance(this->base_reference(),1); }
    60  void decrement() { _step_fn.advance(this->base_reference(),-1); }
    61  void advance(base_difference_type d) { _step_fn.advance(this->base_reference(),d); }
    62  difference_type distance_to(const step_iterator_adaptor& it) const { return _step_fn.difference(this->base_reference(),it.base_reference()); }
    63 };
    64 
    65 // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
    66 // it is often faster to just apply the relation operator to the base
    67 template <typename D,typename Iterator,typename SFn> inline
    69  return p1.step()>0 ? p1.base()> p2.base() : p1.base()< p2.base();
    70 }
    71 
    72 template <typename D,typename Iterator,typename SFn> inline
    73 bool operator<(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
    74  return p1.step()>0 ? p1.base()< p2.base() : p1.base()> p2.base();
    75 }
    76 
    77 template <typename D,typename Iterator,typename SFn> inline
    79  return p1.step()>0 ? p1.base()>=p2.base() : p1.base()<=p2.base();
    80 }
    81 
    82 template <typename D,typename Iterator,typename SFn> inline
    83 bool operator<=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
    84  return p1.step()>0 ? p1.base()<=p2.base() : p1.base()>=p2.base();
    85 }
    86 
    87 template <typename D,typename Iterator,typename SFn> inline
    89  return p1.base()==p2.base();
    90 }
    91 
    92 template <typename D,typename Iterator,typename SFn> inline
    94  return p1.base()!=p2.base();
    95 }
    96 
    97 } // namespace detail
    98 
    102 
    118 
    121 template <typename Iterator>
    123  using difference_type = std::ptrdiff_t;
    124 
    125  memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {}
    126 
    127  difference_type difference(const Iterator& it1, const Iterator& it2) const { return memunit_distance(it1,it2)/_step; }
    128  void advance(Iterator& it, difference_type d) const { memunit_advance(it,d*_step); }
    129  difference_type step() const { return _step; }
    130 
    131  void set_step(std::ptrdiff_t step) { _step=step; }
    132 private:
    133  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
    134  difference_type _step;
    135 };
    136 
    137 template <typename Iterator>
    138 class memory_based_step_iterator : public detail::step_iterator_adaptor<memory_based_step_iterator<Iterator>,
    139  Iterator,
    140  memunit_step_fn<Iterator>>
    141 {
    142  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
    143 public:
    145  Iterator,
    147  using reference = typename parent_t::reference;
    148  using difference_type = typename parent_t::difference_type;
    149  using x_iterator = Iterator;
    150 
    151  memory_based_step_iterator() : parent_t(Iterator()) {}
    152  memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) : parent_t(it, memunit_step_fn<Iterator>(memunit_step)) {}
    153  template <typename I2>
    155  : parent_t(it.base(), memunit_step_fn<Iterator>(it.step())) {}
    156 
    159  reference operator[](difference_type d) const { return *(*this+d); }
    160 
    161  void set_step(std::ptrdiff_t memunit_step) { this->_step_fn.set_step(memunit_step); }
    162 
    163  x_iterator& base() { return parent_t::base_reference(); }
    164  x_iterator const& base() const { return parent_t::base_reference(); }
    165 };
    166 
    167 template <typename Iterator>
    168 struct const_iterator_type<memory_based_step_iterator<Iterator>> {
    170 };
    171 
    172 template <typename Iterator>
    173 struct iterator_is_mutable<memory_based_step_iterator<Iterator>> : public iterator_is_mutable<Iterator> {};
    174 
    175 
    177 // IteratorAdaptorConcept
    179 
    180 template <typename Iterator>
    181 struct is_iterator_adaptor<memory_based_step_iterator<Iterator>> : std::true_type {};
    182 
    183 template <typename Iterator>
    184 struct iterator_adaptor_get_base<memory_based_step_iterator<Iterator>>
    185 {
    186  using type = Iterator;
    187 };
    188 
    189 template <typename Iterator, typename NewBaseIterator>
    190 struct iterator_adaptor_rebind<memory_based_step_iterator<Iterator>, NewBaseIterator>
    191 {
    193 };
    194 
    196 // PixelBasedConcept
    198 
    199 template <typename Iterator>
    200 struct color_space_type<memory_based_step_iterator<Iterator>> : public color_space_type<Iterator> {};
    201 
    202 template <typename Iterator>
    203 struct channel_mapping_type<memory_based_step_iterator<Iterator>> : public channel_mapping_type<Iterator> {};
    204 
    205 template <typename Iterator>
    206 struct is_planar<memory_based_step_iterator<Iterator>> : public is_planar<Iterator> {};
    207 
    208 template <typename Iterator>
    209 struct channel_type<memory_based_step_iterator<Iterator>> : public channel_type<Iterator> {};
    210 
    212 // MemoryBasedIteratorConcept
    214 template <typename Iterator>
    215 struct byte_to_memunit<memory_based_step_iterator<Iterator>> : public byte_to_memunit<Iterator> {};
    216 
    217 template <typename Iterator>
    218 inline std::ptrdiff_t memunit_step(const memory_based_step_iterator<Iterator>& p) { return p.step(); }
    219 
    220 template <typename Iterator>
    221 inline std::ptrdiff_t memunit_distance(const memory_based_step_iterator<Iterator>& p1,
    223  return memunit_distance(p1.base(),p2.base());
    224 }
    225 
    226 template <typename Iterator>
    227 inline void memunit_advance(memory_based_step_iterator<Iterator>& p,
    228  std::ptrdiff_t diff) {
    229  memunit_advance(p.base(), diff);
    230 }
    231 
    232 template <typename Iterator>
    234 memunit_advanced(const memory_based_step_iterator<Iterator>& p,
    235  std::ptrdiff_t diff) {
    236  return memory_based_step_iterator<Iterator>(memunit_advanced(p.base(), diff),p.step());
    237 }
    238 
    239 template <typename Iterator>
    240 inline typename std::iterator_traits<Iterator>::reference
    241 memunit_advanced_ref(const memory_based_step_iterator<Iterator>& p,
    242  std::ptrdiff_t diff) {
    243  return memunit_advanced_ref(p.base(), diff);
    244 }
    245 
    247 // HasDynamicXStepTypeConcept
    249 
    250 template <typename Iterator>
    251 struct dynamic_x_step_type<memory_based_step_iterator<Iterator>> {
    253 };
    254 
    255 // For step iterators, pass the function object to the base
    256 template <typename Iterator, typename Deref>
    257 struct iterator_add_deref<memory_based_step_iterator<Iterator>,Deref> {
    258  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    259 
    261 
    262  static type make(const memory_based_step_iterator<Iterator>& it, const Deref& d) { return type(iterator_add_deref<Iterator, Deref>::make(it.base(),d),it.step()); }
    263 };
    264 
    268 
    269 template <typename I> typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step);
    270 
    271 namespace detail {
    272 
    273 // if the iterator is a plain base iterator (non-adaptor), wraps it in memory_based_step_iterator
    274 template <typename I>
    275 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::false_type)
    276  -> typename dynamic_x_step_type<I>::type
    277 {
    278  return memory_based_step_iterator<I>(it, step);
    279 }
    280 
    281 // If the iterator is compound, put the step in its base
    282 template <typename I>
    283 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::true_type)
    284  -> typename dynamic_x_step_type<I>::type
    285 {
    286  return make_step_iterator(it.base(), step);
    287 }
    288 
    289 // If the iterator is memory_based_step_iterator, change the step
    290 template <typename BaseIt>
    291 auto make_step_iterator_impl(
    293  std::ptrdiff_t step,
    294  std::true_type)
    296 {
    297  return memory_based_step_iterator<BaseIt>(it.base(), step);
    298 }
    299 
    300 } // namespace detail
    301 
    315 template <typename I> // Models MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
    316 typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step) {
    317  return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor<I>::type());
    318 }
    319 
    320 }} // namespace boost::gil
    321 
    322 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:52
    +
    1 //
    2 // Copyright 2005-2007 Adobe Systems Incorporated
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_STEP_ITERATOR_HPP
    9 #define BOOST_GIL_STEP_ITERATOR_HPP
    10 
    11 #include <boost/gil/dynamic_step.hpp>
    12 #include <boost/gil/pixel_iterator.hpp>
    13 #include <boost/gil/pixel_iterator_adaptor.hpp>
    14 #include <boost/gil/utilities.hpp>
    15 
    16 #include <boost/iterator/iterator_facade.hpp>
    17 
    18 #include <cstddef>
    19 #include <iterator>
    20 #include <type_traits>
    21 
    22 namespace boost { namespace gil {
    23 
    27 
    28 namespace detail {
    29 
    36 
    37 template <typename Derived, // type of the derived class
    38  typename Iterator, // Models Iterator
    39  typename SFn> // A policy object that can compute the distance between two iterators of type Iterator
    40  // and can advance an iterator of type Iterator a given number of Iterator's units
    41 class step_iterator_adaptor : public iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>
    42 {
    43 public:
    44  using parent_t = iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>;
    45  using base_difference_type = typename std::iterator_traits<Iterator>::difference_type;
    46  using difference_type = typename SFn::difference_type;
    47  using reference = typename std::iterator_traits<Iterator>::reference;
    48 
    50  step_iterator_adaptor(const Iterator& it, SFn step_fn=SFn()) : parent_t(it), _step_fn(step_fn) {}
    51 
    52  difference_type step() const { return _step_fn.step(); }
    53 
    54 protected:
    55  SFn _step_fn;
    56 private:
    57  friend class boost::iterator_core_access;
    58 
    59  void increment() { _step_fn.advance(this->base_reference(),1); }
    60  void decrement() { _step_fn.advance(this->base_reference(),-1); }
    61  void advance(base_difference_type d) { _step_fn.advance(this->base_reference(),d); }
    62  difference_type distance_to(const step_iterator_adaptor& it) const { return _step_fn.difference(this->base_reference(),it.base_reference()); }
    63 };
    64 
    65 // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
    66 // it is often faster to just apply the relation operator to the base
    67 template <typename D,typename Iterator,typename SFn> inline
    69  return p1.step()>0 ? p1.base()> p2.base() : p1.base()< p2.base();
    70 }
    71 
    72 template <typename D,typename Iterator,typename SFn> inline
    73 bool operator<(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
    74  return p1.step()>0 ? p1.base()< p2.base() : p1.base()> p2.base();
    75 }
    76 
    77 template <typename D,typename Iterator,typename SFn> inline
    79  return p1.step()>0 ? p1.base()>=p2.base() : p1.base()<=p2.base();
    80 }
    81 
    82 template <typename D,typename Iterator,typename SFn> inline
    83 bool operator<=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
    84  return p1.step()>0 ? p1.base()<=p2.base() : p1.base()>=p2.base();
    85 }
    86 
    87 template <typename D,typename Iterator,typename SFn> inline
    89  return p1.base()==p2.base();
    90 }
    91 
    92 template <typename D,typename Iterator,typename SFn> inline
    94  return p1.base()!=p2.base();
    95 }
    96 
    97 } // namespace detail
    98 
    102 
    118 
    121 template <typename Iterator>
    123  using difference_type = std::ptrdiff_t;
    124 
    125  memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {}
    126 
    127  difference_type difference(const Iterator& it1, const Iterator& it2) const { return memunit_distance(it1,it2)/_step; }
    128  void advance(Iterator& it, difference_type d) const { memunit_advance(it,d*_step); }
    129  difference_type step() const { return _step; }
    130 
    131  void set_step(std::ptrdiff_t step) { _step=step; }
    132 private:
    133  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
    134  difference_type _step;
    135 };
    136 
    137 template <typename Iterator>
    138 class memory_based_step_iterator : public detail::step_iterator_adaptor<memory_based_step_iterator<Iterator>,
    139  Iterator,
    140  memunit_step_fn<Iterator>>
    141 {
    142  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
    143 public:
    145  Iterator,
    147  using reference = typename parent_t::reference;
    148  using difference_type = typename parent_t::difference_type;
    149  using x_iterator = Iterator;
    150 
    151  memory_based_step_iterator() : parent_t(Iterator()) {}
    152  memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) : parent_t(it, memunit_step_fn<Iterator>(memunit_step)) {}
    153  template <typename I2>
    155  : parent_t(it.base(), memunit_step_fn<Iterator>(it.step())) {}
    156 
    159  reference operator[](difference_type d) const { return *(*this+d); }
    160 
    161  void set_step(std::ptrdiff_t memunit_step) { this->_step_fn.set_step(memunit_step); }
    162 
    163  x_iterator& base() { return parent_t::base_reference(); }
    164  x_iterator const& base() const { return parent_t::base_reference(); }
    165 };
    166 
    167 template <typename Iterator>
    168 struct const_iterator_type<memory_based_step_iterator<Iterator>> {
    170 };
    171 
    172 template <typename Iterator>
    173 struct iterator_is_mutable<memory_based_step_iterator<Iterator>> : public iterator_is_mutable<Iterator> {};
    174 
    175 
    177 // IteratorAdaptorConcept
    179 
    180 template <typename Iterator>
    181 struct is_iterator_adaptor<memory_based_step_iterator<Iterator>> : std::true_type {};
    182 
    183 template <typename Iterator>
    184 struct iterator_adaptor_get_base<memory_based_step_iterator<Iterator>>
    185 {
    186  using type = Iterator;
    187 };
    188 
    189 template <typename Iterator, typename NewBaseIterator>
    190 struct iterator_adaptor_rebind<memory_based_step_iterator<Iterator>, NewBaseIterator>
    191 {
    193 };
    194 
    196 // PixelBasedConcept
    198 
    199 template <typename Iterator>
    200 struct color_space_type<memory_based_step_iterator<Iterator>> : public color_space_type<Iterator> {};
    201 
    202 template <typename Iterator>
    203 struct channel_mapping_type<memory_based_step_iterator<Iterator>> : public channel_mapping_type<Iterator> {};
    204 
    205 template <typename Iterator>
    206 struct is_planar<memory_based_step_iterator<Iterator>> : public is_planar<Iterator> {};
    207 
    208 template <typename Iterator>
    209 struct channel_type<memory_based_step_iterator<Iterator>> : public channel_type<Iterator> {};
    210 
    212 // MemoryBasedIteratorConcept
    214 template <typename Iterator>
    215 struct byte_to_memunit<memory_based_step_iterator<Iterator>> : public byte_to_memunit<Iterator> {};
    216 
    217 template <typename Iterator>
    218 inline std::ptrdiff_t memunit_step(const memory_based_step_iterator<Iterator>& p) { return p.step(); }
    219 
    220 template <typename Iterator>
    221 inline std::ptrdiff_t memunit_distance(const memory_based_step_iterator<Iterator>& p1,
    223  return memunit_distance(p1.base(),p2.base());
    224 }
    225 
    226 template <typename Iterator>
    227 inline void memunit_advance(memory_based_step_iterator<Iterator>& p,
    228  std::ptrdiff_t diff) {
    229  memunit_advance(p.base(), diff);
    230 }
    231 
    232 template <typename Iterator>
    234 memunit_advanced(const memory_based_step_iterator<Iterator>& p,
    235  std::ptrdiff_t diff) {
    236  return memory_based_step_iterator<Iterator>(memunit_advanced(p.base(), diff),p.step());
    237 }
    238 
    239 template <typename Iterator>
    240 inline typename std::iterator_traits<Iterator>::reference
    241 memunit_advanced_ref(const memory_based_step_iterator<Iterator>& p,
    242  std::ptrdiff_t diff) {
    243  return memunit_advanced_ref(p.base(), diff);
    244 }
    245 
    247 // HasDynamicXStepTypeConcept
    249 
    250 template <typename Iterator>
    251 struct dynamic_x_step_type<memory_based_step_iterator<Iterator>> {
    253 };
    254 
    255 // For step iterators, pass the function object to the base
    256 template <typename Iterator, typename Deref>
    257 struct iterator_add_deref<memory_based_step_iterator<Iterator>,Deref> {
    258  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
    259 
    261 
    262  static type make(const memory_based_step_iterator<Iterator>& it, const Deref& d) { return type(iterator_add_deref<Iterator, Deref>::make(it.base(),d),it.step()); }
    263 };
    264 
    268 
    269 template <typename I> typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step);
    270 
    271 namespace detail {
    272 
    273 // if the iterator is a plain base iterator (non-adaptor), wraps it in memory_based_step_iterator
    274 template <typename I>
    275 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::false_type)
    276  -> typename dynamic_x_step_type<I>::type
    277 {
    278  return memory_based_step_iterator<I>(it, step);
    279 }
    280 
    281 // If the iterator is compound, put the step in its base
    282 template <typename I>
    283 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::true_type)
    284  -> typename dynamic_x_step_type<I>::type
    285 {
    286  return make_step_iterator(it.base(), step);
    287 }
    288 
    289 // If the iterator is memory_based_step_iterator, change the step
    290 template <typename BaseIt>
    291 auto make_step_iterator_impl(
    293  std::ptrdiff_t step,
    294  std::true_type)
    296 {
    297  return memory_based_step_iterator<BaseIt>(it.base(), step);
    298 }
    299 
    300 } // namespace detail
    301 
    315 template <typename I> // Models MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
    316 typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step) {
    317  return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor<I>::type());
    318 }
    319 
    320 }} // namespace boost::gil
    321 
    322 #endif
    Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
    Definition: pixel_dereference.hpp:53
    Definition: pixel_iterator.hpp:124
    metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
    Definition: metafunctions.hpp:34
    Definition: algorithm.hpp:30
    -
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
    Definition: concepts/pixel_iterator.hpp:235
    +
    Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
    Definition: concepts/pixel_iterator.hpp:236
    Definition: algorithm.hpp:30
    returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
    Definition: metafunctions.hpp:35
    Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor ...
    Definition: locator.hpp:27
    diff --git a/html/reference/threshold_8hpp_source.html b/html/reference/threshold_8hpp_source.html index 6a0196f64..94eb1b861 100644 --- a/html/reference/threshold_8hpp_source.html +++ b/html/reference/threshold_8hpp_source.html @@ -61,9 +61,9 @@
    threshold_direction
    Definition: threshold.hpp:69
    threshold_optimal_value
    Method of optimal threshold value calculation.
    Definition: threshold.hpp:77
    Consider values less than or equal to threshold value.
    -
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:40
    +
    container interface over image view. Models ImageConcept, PixelBasedConcept
    Definition: image.hpp:41
    Definition: color_convert.hpp:31
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    void threshold_truncate(SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_truncate_mode mode=threshold_truncate_mode::threshold, threshold_direction direction=threshold_direction::regular)
    Applies truncating threshold to each pixel of image view. Takes an image view and performs truncating...
    Definition: threshold.hpp:173
    Consider values greater than threshold value.
    diff --git a/html/reference/write__view_8hpp_source.html b/html/reference/write__view_8hpp_source.html index 67efdd7a4..822fc9049 100644 --- a/html/reference/write__view_8hpp_source.html +++ b/html/reference/write__view_8hpp_source.html @@ -53,7 +53,7 @@
    1 //
    2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
    3 //
    4 // Distributed under the Boost Software License, Version 1.0
    5 // See accompanying file LICENSE_1_0.txt or copy at
    6 // http://www.boost.org/LICENSE_1_0.txt
    7 //
    8 #ifndef BOOST_GIL_IO_WRITE_VIEW_HPP
    9 #define BOOST_GIL_IO_WRITE_VIEW_HPP
    10 
    11 #include <boost/gil/io/base.hpp>
    12 #include <boost/gil/io/conversion_policies.hpp>
    13 #include <boost/gil/io/device.hpp>
    14 #include <boost/gil/io/get_writer.hpp>
    15 #include <boost/gil/io/path_spec.hpp>
    16 #include <boost/gil/detail/mp11.hpp>
    17 
    18 #include <type_traits>
    19 
    20 namespace boost{ namespace gil {
    21 
    23 template<typename Writer, typename View>
    24 inline
    25 void write_view(Writer& writer, View const& view,
    26  typename std::enable_if
    27  <
    28  mp11::mp_and
    29  <
    30  typename detail::is_writer<Writer>::type,
    31  typename is_format_tag<typename Writer::format_tag_t>::type,
    32  typename is_write_supported
    33  <
    34  typename get_pixel_type<View>::type,
    35  typename Writer::format_tag_t
    36  >::type
    37  >::value
    38  >::type* /* ptr */ = nullptr)
    39 {
    40  writer.apply(view);
    41 }
    42 
    44 template<typename Device, typename View, typename FormatTag>
    45 inline
    46 void write_view(Device& device, View const& view, FormatTag const& tag,
    47  typename std::enable_if
    48  <
    49  mp11::mp_and
    50  <
    51  typename detail::is_write_device<FormatTag, Device>::type,
    52  typename is_format_tag<FormatTag>::type,
    53  typename is_write_supported
    54  <
    55  typename get_pixel_type<View>::type,
    56  FormatTag
    57  >::type
    58  >::value
    59  >::type* /* ptr */ = nullptr)
    60 {
    61  using writer_t = typename get_writer<Device, FormatTag>::type;
    62  writer_t writer = make_writer(device, tag);
    63  write_view(writer, view);
    64 }
    65 
    67 template<typename String, typename View, typename FormatTag>
    68 inline
    69 void write_view(String const& file_name, View const& view, FormatTag const& tag,
    70  typename std::enable_if
    71  <
    72  mp11::mp_and
    73  <
    74  typename detail::is_supported_path_spec<String>::type,
    75  typename is_format_tag<FormatTag>::type,
    76  typename is_write_supported
    77  <
    78  typename get_pixel_type<View>::type,
    79  FormatTag
    80  >::type
    81  >::value
    82  >::type* /* ptr */ = nullptr)
    83 {
    84  using writer_t = typename get_writer<String, FormatTag>::type;
    85  writer_t writer = make_writer(file_name, tag);
    86  write_view(writer, view);
    87 }
    88 
    90 template<typename Device, typename View, typename FormatTag, typename Log>
    91 inline
    92 void write_view(
    93  Device& device, View const& view, image_write_info<FormatTag, Log> const& info,
    94  typename std::enable_if
    95  <
    96  mp11::mp_and
    97  <
    98  typename detail::is_write_device<FormatTag, Device>::type,
    99  typename is_format_tag<FormatTag>::type,
    100  typename is_write_supported
    101  <
    102  typename get_pixel_type<View>::type,
    103  FormatTag
    104  >::type
    105  >::value
    106  >::type* /* ptr */ = nullptr)
    107 {
    108  using writer_t = typename get_writer<Device, FormatTag>::type;
    109  writer_t writer = make_writer(device, info);
    110  write_view(writer, view);
    111 }
    112 
    114 template<typename String, typename View, typename FormatTag, typename Log>
    115 inline
    116 void write_view(
    117  String const& file_name, View const& view, image_write_info<FormatTag, Log> const& info,
    118  typename std::enable_if
    119  <
    120  mp11::mp_and
    121  <
    122  typename detail::is_supported_path_spec<String>::type,
    123  typename is_format_tag<FormatTag>::type,
    124  typename is_write_supported
    125  <
    126  typename get_pixel_type<View>::type,
    127  FormatTag
    128  >::type
    129  >::value
    130  >::type* /* ptr */ = nullptr)
    131 {
    132  using writer_t = typename get_writer<String, FormatTag>::type;
    133  writer_t writer = make_writer(file_name, info);
    134  write_view(writer, view);
    135 }
    136 
    138 
    139 // without image_write_info
    140 template <typename Writer, typename Views>
    141 inline
    142 void write_view(Writer& writer, any_image_view<Views> const& view,
    143  typename std::enable_if
    144  <
    145  mp11::mp_and
    146  <
    147  typename detail::is_dynamic_image_writer<Writer>::type,
    148  typename is_format_tag<typename Writer::format_tag_t>::type
    149  >::value
    150  >::type * /* ptr */ = nullptr)
    151 {
    152  writer.apply(view);
    153 }
    154 
    155 // without image_write_info
    156 template <typename Device, typename Views, typename FormatTag>
    157 inline
    158 void write_view(
    159  Device& device, any_image_view<Views> const& views, FormatTag const& tag,
    160  typename std::enable_if
    161  <
    162  mp11::mp_and
    163  <
    164  typename detail::is_write_device<FormatTag, Device>::type,
    165  typename is_format_tag<FormatTag>::type
    166  >::value
    167  >::type * /* ptr */ = 0)
    168 {
    169  using writer_t = typename get_dynamic_image_writer<Device, FormatTag>::type;
    170  writer_t writer = make_dynamic_image_writer(device, tag);
    171  write_view(writer, views);
    172 }
    173 
    174 template <typename String, typename Views, typename FormatTag>
    175 inline
    176 void write_view(
    177  String const& file_name, any_image_view<Views> const& views, FormatTag const& tag,
    178  typename std::enable_if
    179  <
    180  mp11::mp_and
    181  <
    182  typename detail::is_supported_path_spec<String>::type,
    183  typename is_format_tag<FormatTag>::type
    184  >::value
    185  >::type * /* ptr */ = nullptr)
    186 {
    187  using writer_t = typename get_dynamic_image_writer<String, FormatTag>::type;
    188  writer_t writer = make_dynamic_image_writer(file_name, tag);
    189  write_view(writer, views);
    190 }
    191 
    192 // with image_write_info
    194 template <typename Device, typename Views, typename FormatTag, typename Log>
    195 inline
    196 void write_view(
    197  Device& device, any_image_view<Views> const& views, image_write_info<FormatTag, Log> const& info,
    198  typename std::enable_if
    199  <
    200  mp11::mp_and
    201  <
    202  typename detail::is_write_device<FormatTag, Device>::type,
    203  typename is_format_tag<FormatTag>::type
    204  >::value
    205  >::type * /* ptr */ = 0)
    206 {
    207  using writer_t = typename get_dynamic_image_writer<Device, FormatTag>::type;
    208  writer_t writer = make_dynamic_image_writer(device, info);
    209  write_view(writer, views);
    210 }
    211 
    212 template <typename String, typename Views, typename FormatTag, typename Log>
    213 inline
    214 void write_view(
    215  String const& file_name, any_image_view<Views> const& views, image_write_info<FormatTag, Log> const& info,
    216  typename std::enable_if
    217  <
    218  mp11::mp_and
    219  <
    220  typename detail::is_supported_path_spec<String>::type,
    221  typename is_format_tag<FormatTag>::type
    222  >::value
    223  >::type * /* ptr */ = nullptr)
    224 {
    225  using writer_t = typename get_dynamic_image_writer<String, FormatTag>::type;
    226  writer_t writer = make_dynamic_image_writer(file_name, info);
    227  write_view(writer, views);
    228 }
    229 
    230 }} // namespace boost::gil
    231 
    232 #endif
    Definition: algorithm.hpp:30
    -
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:443
    +
    const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
    Returns the non-constant-pixel view of an image.
    Definition: image.hpp:535
    diff --git a/html/search.html b/html/search.html index c4f3f2fc9..3a43c9d02 100644 --- a/html/search.html +++ b/html/search.html @@ -63,10 +63,8 @@

    - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. + Searching for multiple words only shows matches that contain + all words.

    @@ -85,8 +83,8 @@
    \ No newline at end of file diff --git a/html/searchindex.js b/html/searchindex.js index 70c6f3413..94ec606b6 100644 --- a/html/searchindex.js +++ b/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["design/basics","design/channel","design/color_base","design/color_space","design/concepts","design/conclusions","design/dynamic_image","design/examples","design/extending","design/image","design/image_view","design/index","design/metafunctions","design/pixel","design/pixel_iterator","design/pixel_locator","design/point","design/technicalities","image_processing/affine-region-detectors","image_processing/basics","image_processing/index","image_processing/overview","index","installation","io","naming","numeric","toolbox","tutorial/gradient","tutorial/histogram","tutorial/video"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.index":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["design/basics.rst","design/channel.rst","design/color_base.rst","design/color_space.rst","design/concepts.rst","design/conclusions.rst","design/dynamic_image.rst","design/examples.rst","design/extending.rst","design/image.rst","design/image_view.rst","design/index.rst","design/metafunctions.rst","design/pixel.rst","design/pixel_iterator.rst","design/pixel_locator.rst","design/point.rst","design/technicalities.rst","image_processing/affine-region-detectors.rst","image_processing/basics.rst","image_processing/index.rst","image_processing/overview.rst","index.rst","installation.rst","io.rst","naming.rst","numeric.rst","toolbox.rst","tutorial/gradient.rst","tutorial/histogram.rst","tutorial/video.rst"],objects:{},objnames:{},objtypes:{},terms:{"0rrgggbb":13,"0x06":13,"0x0c":13,"0x11":13,"0x30":13,"0x60":13,"0x83":13,"0xc1":13,"1000s":18,"100s":18,"100x100":7,"200x200":28,"4x3":0,"50x50":10,"abstract":[0,5,10,22,28],"boolean":[12,28],"break":6,"byte":[1,6,9,10,13,14,15,17,22,28],"case":[2,5,7,8,10,12,13,15,18,24,28],"char":[7,9,10,12,13,14,24,28],"class":[1,2,4,6,8,9,10,12,13,14,15,17,24,28],"const":[1,2,6,7,8,9,10,12,13,14,15,16,17,24,25,28,29],"default":[1,3,6,7,8,9,10,12,14,17,25,28],"final":[2,7,8,28],"float":[1,7,12,24,25,28],"function":[2,6,8,10,12,14,15,17,18,22,24,28,29],"import":[6,9,17,24],"int":[1,2,3,7,10,13,15,24,28,29],"long":[4,7,8,10,12,28],"new":[5,28,29],"public":[6,8,10,14,15,24],"return":[1,2,4,6,7,8,10,12,13,14,15,17,24,28],"short":[12,24,28,29],"static":[1,2,6,7,8,10,13,14,15,28],"switch":[6,28],"throw":6,"true":[1,2,12,13,14,15,28],"try":[7,24,28],"var":[7,29],"void":[2,4,6,7,8,9,10,13,14,17,24,28,29],"while":[0,1,3,13,15,28],But:24,For:[1,2,3,4,6,7,8,10,12,13,14,15,18,24,25,28,29],Its:[1,2,13,14,28],Not:7,One:[15,17,18,24,28],Such:[1,6,15,28],That:[6,28],The:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,27,28,29],Their:[6,15,28],Then:[15,28],There:[0,2,6,12,19,24,28],These:[2,12,13,28],Use:[17,24],Using:[10,12,15,22,29],_bit:6,_bmp_test_fil:24,_concept_:28,_dimens:10,_dst:28,_dynamic_cast:6,_height:24,_imag:[12,25],_img_siz:28,_index:6,_info:24,_io_dev:24,_is_:12,_loc:[12,25],_pixel:[10,12,25],_planar:[12,25],_png_test_fil:24,_ptr:[12,25],_ref:[12,25],_scanline_length:24,_step:[12,25],_tiff_graphicsmagick_test_fil:24,_tiff_lib_tiff_test_fil:24,_variants_:28,_view:[12,25],_width:[15,24],abbrevi:28,abgr_layout_t:3,abil:24,abl:[14,24],about:[4,8,15,19,28,30],abov:[0,2,7,10,13,14,15,17,18,19,24,28,29],abraham:17,access:[1,2,3,6,7,8,13,15,24,28],accessor:[2,16],accordingli:8,account:7,achiev:19,acknowledg:22,actual:[8,29],adapt:1,adaptor:[8,10,15],add:[6,8,15,24],add_deref:[8,10,15],add_fs_path_support:24,add_ref_t:8,added:27,adding:[7,24],addit:[1,2,4,6,9,10,14,15,28],addition:28,address:[0,12,13],adjac:[10,14,28],adob:10,advanc:[10,14,15,24,28],advantag:[28,29],advis:24,affin:[20,22],after:[2,28],again:[15,18],against:[17,23],alex:17,algorithm:[0,4,5,6,7,8,9,14,15,17,20,21,22],align:[0,6,9,10,13,14,22,28,29],all:[0,1,2,3,4,6,7,8,10,13,14,15,17,18,24,27,28],alloc:[7,9,10,12,24,28,29],allocator_typ:9,allow:[0,1,2,5,6,8,9,10,12,13,14,15,17,22,24,28],alon:19,along:[10,12,14,15,16,28],alpha:[0,27],alpha_t:3,alreadi:[12,13,24,28],also:[0,1,2,3,7,10,12,13,14,15,16,24,28,29],altern:28,alvei:18,alwai:[6,13,17,25,28],amount:[14,15],analog:13,analysi:[12,20],andrew:18,ani:[0,2,5,6,7,8,10,12,14,15,18,19,23,28,29],anoth:[1,2,5,6,8,10,13,14,19,24,28],another_iter:14,any_imag:[6,24,28],any_image_view:[6,28],any_pixel:[6,28],any_pixel_iter:[6,28],anyth:[8,14,24],api:22,append:12,appendix:28,appli:[0,1,14,19,22,24,28],applic:[24,28],apply_oper:[6,28],appropri:[1,6,24],approxim:[13,14,28],arbitrari:[8,14,28],area:[7,10,24],aren:24,argb_layout_t:3,argument:[6,14,28],argument_typ:[8,10,28],aris:17,arithmet:[1,19],around:[7,14,15,24],arrai:[0,14,15,19],ascii:24,assembl:28,assert:[1,7,13,28],assert_sam:6,assign:[1,2,4,6,9,13,17,28],assignableconcept:14,associ:[1,2,3,6,12,28],assum:[18,28],at_c:[2,13],atom:28,author:24,auto:[4,24],avaialbl:4,avail:[6,10,15,20,24,28],averag:15,avoid:28,awai:[10,14],axi:[10,15,16,19,28],axis:19,axis_iter:[10,15],axis_valu:16,b16:7,back:[6,10,28],backend:24,backend_t:24,backward:25,bad_cast:6,base:[1,6,10,11,13,14,15,17,22,24,28,29],basic:[4,11,12,18,20,22,24],becam:24,becaus:[1,6,9,10,12,13,15,18,28],been:[5,24,28,29],befor:24,begin:[7,10,24,28,29],behav:6,being:[12,20,24],belong:27,below:[11,14,15,18,20,24,28],berlin:18,besid:[3,24],beta:10,better:28,between:[1,6,8,10,13,14,28],bgr16_view_t:7,bgr232:13,bgr232_pixel_t:13,bgr232_ptr_t:13,bgr232_ref_t:13,bgr556:13,bgr556_pixel_t:13,bgr8:13,bgr8_image_t:[12,25],bgr8_pixel_t:[7,13],bgr8_view_t:6,bgr:[0,2,7,12,13,25,28,29],bgr_layout_t:[3,13],bgra_layout_t:3,big:[18,24],biggest:[6,28],bilinear:22,bin:7,binari:[24,28],binaryfunctionconcept:10,bit:[0,1,2,7,8,9,10,13,14,15,24,25,28,29],bit_align:13,bit_aligned_image1_typ:12,bit_aligned_image2_typ:12,bit_aligned_image3_typ:12,bit_aligned_image4_typ:12,bit_aligned_image5_typ:12,bit_aligned_image_typ:12,bit_aligned_pixel_iter:[13,14],bit_aligned_pixel_refer:13,bitdepth:[12,25],bitfield:12,bitmask:22,bits16:1,bits32f:1,bits8:[7,10,13,14,28],bitwis:10,block:[3,6,10,28],blue:[2,7,13,17],blue_t:[2,3,7,13],blur:[18,22],bmp_filenam:24,bmp_test_fil:24,bmp_wiki:24,bodi:28,bool:[1,2,4,6,8,9,10,12,13,14,15,28],boost:[3,6,7,10,12,14,21,23,24,27,28,29],boost_check_equ:24,boost_concept:14,boost_gil_extension_io_jpeg_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_png_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_tiff_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_zlib_c_lib_compiled_as_cplusplu:24,boost_gil_io_add_fs_path_support:24,boost_gil_io_enable_gray_alpha:24,boost_gil_io_png_1_4_or_low:24,boost_gil_io_png_dithering_support:24,boost_gil_io_png_fixed_point_support:24,boost_gil_io_png_floating_point_support:24,boost_gil_io_test_allow_reading_imag:24,boost_gil_io_test_allow_writing_imag:24,boost_gil_io_use_bmp_test_suite_imag:24,boost_gil_io_use_png_test_suite_imag:24,boost_gil_io_use_pnm_test_suite_imag:24,boost_gil_io_use_tiff_graphicsmagick_test_suite_imag:24,boost_gil_io_use_tiff_libtiff_test_suite_imag:24,boost_gil_use_concept_check:[10,28],boost_mpl_assert:13,boostorg:23,bop:6,border:7,borrow:6,both:[0,6,7,13,15,16,18,24,28,29],bottom:[0,10,15,28],bound:[6,13],boundari:28,bourdev:30,buffer:[7,13,28],build:[0,24],built:[1,7,12,13,14,23,28],byte_to_memunit:14,c_str:24,cach:[15,28],cache_loc:[15,28],cached_location_t:[15,28],calcul:29,call:[6,7,8,10,13,17,18,24,28,29],can:[2,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,22,23,24,28,29],cannot:[7,10,19,28],canon:[13,28],capabl:24,captur:3,care:8,carriag:[15,28],cast:28,caus:[18,28],caution:6,cav:6,cb1:2,cb2:2,cb3:2,cc_t:24,ccv:10,ccv_imag:28,center:[7,19],centerimg:7,central:28,certain:19,challeng:[0,28],chan16:1,chang:[6,8,10,12,14,18,24,28,29],channel16_0_5_reference_t:1,channel16_11_5_reference_t:1,channel16_5_6_reference_t:1,channel1:1,channel2:1,channel3:1,channel:[0,2,3,5,6,7,10,11,12,13,14,17,19,22,24,25,28,29],channel_6bit:1,channel_convert:[1,7,8,13,28],channel_convert_to_unsign:28,channel_invert:[1,8],channel_mapping_t:3,channel_mapping_typ:[12,13,28],channel_multipli:1,channel_t:28,channel_trait:[1,8],channel_typ:[7,12,13,27,28],channel_type_to_index:27,channelbitsizevector:12,channelconcept:[1,13],channelconvertibleconcept:1,channelmap:3,channelmappingconcept:[3,13],channelptr:14,channelrefer:13,channelrefvec:14,channelscompatibleconcept:[1,13],channelvalu:[12,13,14],channelvalueconcept:[1,12],check:[6,7,10,15,28],choic:[15,18],choos:15,chose:7,christoph:18,chunki:28,claim:24,classtyp:[12,25],clear:[19,24],client:23,clockwis:28,close:24,closer:28,cmyk16_pixel_t:[12,13,25],cmyk16_planar_image_t:6,cmyk16_planar_step_view_t:6,cmyk16_planar_view_t:6,cmyk16c_planar_ref_t:25,cmyk16c_planar_view_t:6,cmyk16sc_planar_ref_t:12,cmyk8_image_t:24,cmyk:[0,12,25],cmyk_t:3,cmyka:27,code:[0,3,5,6,7,8,10,15,21,22,24,25,29],col:29,col_begin:10,col_end:10,collect:[6,27],color:[0,1,5,6,7,10,11,12,13,14,15,22,24,25,27,29],color_bas:2,color_const_reference_t:2,color_convert:[8,13,27],color_convert_deref_fn:[8,14],color_convert_view:8,color_converted_view:[7,8,10,28,29],color_converted_view_typ:[8,10],color_converter_typ:24,color_reference_t:2,color_spac:27,color_space_t:[2,3],color_space_typ:[7,8,12,13,28],colorbas:2,colorbaseconcept:[2,13],colorbasescompatibleconcept:[2,13],colorbasevalueconcept:2,colorconvert:10,colorspac:[3,12,13,14,25],colorspace1:3,colorspace2:3,colorspaceconcept:[3,13],colorspacescompatibleconcept:[2,3,28],column:[14,15,28,29],com:[10,23,30],combin:[6,14,15,18,28],come:[12,24],commerci:29,common:[0,2,4,6,24],commonli:13,commun:27,compact:1,compactli:[7,28],compar:[0,1,2,5,6,7,28],comparison:[1,6,15,18],compat:[1,2,3,6,7,10,13,24,28],compil:[1,2,5,6,7,10,13,14,17,23,28],complement:5,complet:[24,28],complex:[6,7,13,15,18,28],complic:[8,9,17],compon:[0,1,25],compos:[10,14],comprehend:28,comprehens:28,compris:3,comput:[7,15,18,19,28,29],computexgradientgray8:28,concept:[0,1,2,5,8,9,10,11,13,14,15,16,18,19,22,28],concept_check:[10,28],concept_map:4,conceptc:4,conceptu:13,conclus:[11,22],concret:[6,28],condit:[15,18],confer:18,consid:[1,3,6,13,19,29],consist:[2,15,23,28],const_iterator_typ:14,const_point:1,const_refer:[1,8,10,13,14,28],const_t:[6,8,9,10,14,15,28],const_view:[9,28],const_view_t:[6,9],constant:[10,12,13,17,18,28],constexpr:[8,28],construct:[1,4,5,6,7,8,9,10,12,13,14,17,28],constructor:[1,6,7,9,17,28],consult:24,contain:[1,2,3,6,7,9,13,14,24,28],content:[11,20,27],context:[19,24],contigu:2,conveni:8,convent:[22,28],convers:[1,13,14,15,24],conversionpolici:24,convert:[1,2,7,8,10,12,13,14,24,27,28],convolut:[10,20,22],convolv:[7,19],coord:28,coord_t:[9,10,15],coordin:[15,16,24,28],copi:[1,2,6,7,8,9,10,13,15,17,24,28,29],copy_and_convert_pixel:[10,28],copy_pixel:[6,7,10,24,28],copyabl:10,copyconstruct:[2,4],copyconstructibleconcept:14,cordelia:18,corner:[7,10,18,28],correct:28,correctli:[4,17],correspond:[1,2,5,8,10,14,19,28],cost:5,could:[6,7,10,14,15,19,24,28],count:7,counter:28,counterpart:24,coupl:24,cours:[15,24],cover:18,cpp:[3,22],creat:[1,3,6,7,8,12,13,14,15,22,24],create_with_margin:7,current:[3,6,14,15,24,28],current_type_i:6,curvatur:[18,20],custom:[1,10,15],d_channel_t:28,data:[1,5,8,9,10,24,25,28],dave:17,deal:28,dealloc:28,debug:28,decent:24,declar:28,decrement:15,dedic:[11,20],deep:[6,9,17,28],deeper:18,default_color_convert:10,default_color_converter_impl:8,defaultconstruct:4,defaultconstructibleconcept:14,defin:[0,1,2,3,4,6,10,12,13,14,15,16,17,22,24,28],definit:[3,27],degrad:28,degre:28,delai:15,deleg:10,delet:9,demand:24,demonstr:[10,24,28],denot:[14,17,28],depend:[19,23,24],depth:[0,6,7,10,12,14,25,28,29],deref:[10,15],deref_compos:14,deref_t:8,derefer:[8,28],dereferenc:[7,8,10,12,14,15,17],dereference_iterator_adaptor:14,deriv:[10,18,20],derived_image_typ:[12,28],derived_iterator_typ:[12,28],derived_pixel_reference_typ:[12,28],derived_view_typ:[12,28],describ:[0,2,4,11,15,16,20,24],descript:[24,25],design:[0,2,5,22,24,28],desir:28,despit:6,destin:[1,6,7,8,24,28],destroi:6,destructor:[9,28],det:18,detail:[2,6,14,24],detect:[20,28],detector:[20,22],determin:[14,15,18],develop:[10,21],devic:24,devicen_t:3,diagram:15,diff:14,differ:[1,6,13,14,15,17,18,19,24,28],difference_typ:[10,15],difficult:[0,28],dim:[6,9,28],dimens:[6,9,10,15,16,18,24,28],dimension:[7,9,10,15,16,28],direct:[12,14,15,18,19,24,28],directli:[7,13,15,17,24,28,29],directori:27,disadvantag:28,discrimin:18,discuss:0,disk:[6,8,28],dispatch:8,displai:24,distanc:[14,28],distinct:[1,13,18,28],distribut:13,dither:24,divis:14,do_swap:6,document:[0,4,19,20,24,28],doe:[1,7,10,12,17,23,28],doesn:[24,28],doing:[6,8,13],don:[6,8,9,10,12,13,15,28],done:[7,15,19,24,28],doubl:[8,28],down:[6,7,10],download:[10,23],draw:19,drawback:28,drive:24,dst:[1,2,7,8,10,24,28],dst_channel_t:28,dst_it:28,dst_pixel:28,dst_row_byt:28,dst_view:24,dstchannel:1,dstcolorspac:8,dstimag:7,dstp:[8,10],dstpixel:13,dstview:28,due:13,duplic:29,dure:[21,24],dxdx:18,dxdy:18,dydi:18,dynam:[11,12,14,15,22,24],dynamic_at_c:[2,13],dynamic_imag:[6,22,28],dynamic_image_al:[6,28],dynamic_x_step_typ:[6,10,14],dynamic_xy_step_transposed_typ:10,dynamic_xy_step_typ:[6,10],dynamic_y_step_typ:[10,15],each:[0,2,7,8,10,13,15,16,24,28],earli:[10,28],easi:[24,28],easier:[6,10,28],easili:28,edg:[18,28],effect:[19,28],effici:[0,7,10,14,15,28,29],either:[6,7,8,10,14,24,28],element:[2,3,10,11,13,14,19,28],element_const_reference_typ:[2,13],element_recurs:2,element_reference_typ:[2,13],element_typ:2,els:[8,15],email:24,enabl:24,encod:24,end:[0,7,9,10,15,24,28,29],enough:[6,18],ensur:[10,28],entir:28,enumer:[6,24,28],epipolar:21,equal:[1,2,3,6,10,13,15,28],equal_pixel:10,equalitycompar:[1,2,4],equival:[2,6,10,14,15],error:[1,6,7,10,17,28],especi:6,essenti:0,establish:25,etc:[0,6,10,13,23,24,28],european:18,evalu:[12,14],even:[6,7,8,24,28,29],ever:7,everi:[5,6,10,14,15,25,28,29],everyth:8,exact:19,exactli:13,exampl:[1,2,3,4,6,8,10,11,12,13,14,15,17,19,24,25,28,29],except:[2,6,8,10,14,15,23,28],exclud:28,execut:[6,28],exercis:28,exist:[5,7,8,24,29],expect:24,expens:28,explan:[10,18,24],explicit:[6,13,28],explicitli:28,extend:[5,11,22,28],extending_gil__io_with_new_format:24,extens:[6,8,10,23,28,29],extern:24,extra:[7,10,13,28,29],extract:28,extrem:18,fact:[24,28],factori:[8,10,28],fail:28,fall:[7,10],fals:[8,12,15,28],familiar:28,far:28,fast:[10,15,28],faster:[1,5,9,15,28],fastest:7,featr:29,featur:[18,20,21,24,29],fetch:28,few:24,file:[6,8,23,24,28],file_nam:6,filenam:24,filesystem:24,fill:[2,7,10,13,15,24,28],fill_pixel:[7,10,24],fill_valu:9,filter:[15,20],find:[15,23],first:[0,1,2,3,6,7,8,10,13,15,21,24],first_argument_typ:10,firstbit:1,fit:13,five:[3,5,12],flat:19,flavour:24,flexibl:[1,6,12,29],flip:[10,14,28],flipped_left_right_view:10,flipped_up_down_view:10,float_on:1,float_zero:1,fly:14,focu:28,focus:28,folder:[19,22,24],follow:[0,1,2,3,5,6,7,9,10,12,13,15,16,18,24,25,27,28,29],for_each:[2,7,10,28],for_each_pixel:[7,10,28,29],for_each_pixel_posit:[10,28],form:[0,9,12,13,18,19,28],format:[13,23,28],format_tag:24,formattag:24,forward:14,forwardtraversalconcept:14,found:24,four:[15,28],fourth:7,frame:21,framework:24,frederik:18,free:[15,23,28],freeli:[7,10],frequent:15,friend:6,friendli:[15,28],from:[0,1,5,6,7,8,12,13,14,15,18,22,23,24,28,29],fulfil:4,full:[6,13],fulli:[8,24,28],fun:10,function_requir:13,fundament:[1,15,21],fundamental_step:14,further:17,furthermor:[24,28],futur:29,gap:10,gaussian:[18,19],gener:[0,2,4,6,7,9,10,11,14,16,18,19,25],generate_pixel:10,geometri:21,get:[1,6,8,10,12,14,18,19,28],get_color:[2,7,8,13],get_info:24,get_num_bit:27,get_num_it:28,get_pixel_typ:27,get_read_devic:24,get_reader_backend:24,gil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20,22,23,25,27,30],gil_function_requir:[2,7,10,28],github:23,give:[7,15,24],given:[0,2,6,8,9,10,12,13,14,15,17,18,28],glimps:28,global:28,goal:5,goe:28,going:15,good:[19,28],googl:21,gool:18,gradient:[18,19,22],grai:[7,8,18,27],graph:19,grate:17,gray16:24,gray16_image_t:[24,28],gray16_pixel_t:28,gray16_step_view_t:10,gray16c_view_t:28,gray1:[24,28],gray1_image_t:24,gray2:24,gray32s_pixel_t:28,gray32s_view_t:28,gray4:24,gray4_image_t:24,gray7:24,gray8:24,gray8_image_t:[6,24,28],gray8_pixel_t:[7,8,28,29],gray8_view_t:7,gray8c_loc_t:28,gray8c_view_t:28,gray8s_image_t:28,gray8s_pixel_t:28,gray8s_view_t:28,gray_alpha:24,gray_alpha_16:24,gray_alpha_8:24,gray_channel_t:7,gray_color_t:[7,8],gray_cs_t:7,gray_image_t:28,gray_layout_t:28,gray_pixel_t:28,gray_t:[3,7,8,12],gray_to_rgb:7,grayimage_histogram:[7,29],graypixel:7,grayscal:[7,8,10,12,14,15,28],grayview:[7,29],green:[7,10,13,17,29],green_t:[2,3,7,13],grid:28,group:[0,3],guarante:4,guid:[10,22,28],guidelin:24,gv8:7,half:28,half_x_differ:28,halfdiff_cast_channel:28,hand:[0,5,18,22,28,29],handl:28,happen:[6,18,28],hard:[12,24],hardli:28,harrismatrix:18,has:[2,5,6,7,9,10,12,14,15,24,28],has_typ:6,hasdynamicxsteptypeconcept:[14,15],hasdynamicysteptypeconcept:15,hassl:28,hastransposedtypeconcept:15,have:[0,1,2,3,5,6,7,8,9,10,12,13,14,15,18,24,27,28,29],hcb:2,header:[23,24,27],heidelberg:18,height:[6,7,9,10,28,29],help:19,helper:12,henc:6,here:[0,1,2,3,4,6,7,8,10,12,13,14,15,19,24,28],hessianmatrix:18,heterogen:[12,13,28],higher:8,hill:[18,19],his:24,hist:[7,29],histogram:22,hold:6,homogen:[2,13,14,28],homogeneous_color_bas:[2,14],homogeneouscolorbaseconcept:[2,13,14],homogeneouscolorbasevalueconcept:2,homogeneouspixel:13,homogeneouspixelbasedconcept:[12,13],homogeneouspixelconcept:13,homogeneouspixelvalueconcept:13,hopefulli:[24,27],horizont:[7,12,14,15,19,28],how:[1,3,6,7,8,10,12,13,14,18,24,28],howev:[2,10,28],hpp:[6,8,22,23,24,27,28],hsl:27,hsv:27,html:10,http:[10,23,30],ident:[7,8],identifi:6,ifstream:24,ignor:[13,28],illustr:[6,7,28],imag:[0,5,11,13,14,16,18,19,21,23,25,27,29],image_read_info:24,image_read_set:24,image_t:[6,24],image_typ:[8,12,27,28],image_view:[6,9,10,28],image_write_info:24,imageconcept:[6,7,9,12],imagemagick:24,imagetyp:6,imageviewconcept:[6,7,9,10,12,28],imageviewtyp:6,imagin:19,img:[6,7,9,10,15,24,28,29],img_view:8,immut:[6,9,10,12,14,15,25,28],impact:[10,28],implement:[1,2,6,8,10,13,14,15,17,18,23,24],impos:1,improv:[27,28],in1:28,in2:28,in_buff:24,inaccuraci:24,inc:14,includ:[4,6,23,24,27,28],incompat:[1,6,7,24,28],incomplet:24,incorrect:28,incorrectli:17,increas:10,increment:[14,15,28],independ:[15,24,28],index:[2,10,13,15,24,28,29],indexed_imag:27,indic:[1,12,15,19,25,28],indica:25,ineffici:6,info:24,inform:[1,15,24],inher:14,inherit:13,initi:[7,13,21,28],inlin:[6,8,28],inner:28,input:[10,19,28],insid:[6,7,8,10,15,16,28],instal:[22,24],instanc:[6,8,14,24,28],instanti:[6,10,15,28],instead:[1,2,9,28],instruct:28,instrument:5,int_:2,integ:[1,7,10,15,24,28],integr:[1,3,12,14,25,28],intel:15,intens:[1,18,19],interest:18,interfac:[6,15],interleav:[0,6,7,8,9,10,12,13,14,15,25,28,29],interleaved_ptr:22,interleaved_ref:22,interleaved_view:[10,24,28],intermedi:7,intern:[14,18,29],internet:8,interpret:[3,10],introduc:24,invari:18,invert:8,invert_pixel:17,invok:[2,6,7,8,10,12,14,15,28],involv:28,ios:24,ios_bas:24,is_1d_travers:[10,15],is_bit_align:27,is_homogen:27,is_iterator_adaptor:14,is_mut:[1,8,13,14,28],is_pixel:13,is_planar:[12,13],is_sam:[6,7,13],is_similar:27,ismut:12,isplanar:[9,12],isstep:12,isstepx:12,issu:[17,28,29],isxstep:12,isystep:12,iter:[1,2,5,7,8,9,10,11,13,17,22,25,29],iterator_adaptor_get_bas:14,iterator_adaptor_rebind:14,iterator_from_2d:[10,15],iterator_is_mut:14,iterator_t:24,iterator_trait:[13,17,28],iterator_typ:12,iterator_type_from_pixel:12,iteratoradaptorconcept:14,its:[1,3,6,7,9,12,13,14,15,27,28],itself:[7,13],jiri:18,journal:18,jpeg:[8,28],jpeg_dynamic_io:[6,28],jpeg_lib:24,jpeg_read_imag:[6,7,28],jpeg_tag:24,jpeg_wiki:24,jpeg_write_view:[6,7,28],jpg:[7,24,28],just:[7,8,9,12,13,15,24,27,28],kadir:18,keep:[0,14,28],kei:18,kernel:[7,20],kind:24,know:24,krystian:18,kth_element_const_reference_typ:2,kth_element_reference_typ:2,kth_element_typ:[2,13],kth_semantic_element_const_reference_typ:2,kth_semantic_element_reference_typ:2,kth_semantic_element_typ:[2,13],lab:27,lack:[24,28],laid:7,lambda:[7,29],larg:[6,24],larger:7,largest:[6,7],last:[10,13,24,28],lastli:17,later:[2,15],latest:23,latter:[7,13],layout:[2,5,11,12,13,14,22,25,28],layout_t:2,least:[6,28],leav:28,lectur:22,left:[7,10,14,15,24,28,29],let:[8,18,19,28,29],level:[1,6,24,28],lib:24,libjpeg:[23,24],libpng:[23,24],librari:[0,5,8,10,11,20,23,24,27,29],libraw:24,libtiff:24,lightweight:[7,10,15,28],like:[0,6,7,8,12,13,14,18,19,23,24,28],limit:[5,6],line:28,linear:[1,6],linearli:[1,28],link:[23,24,30],list:[11,20,24],littl:[13,19],live:8,load:[6,28],loc2:15,loc:15,local:24,locat:[5,8,9,10,11,12,13,14,16,22,25],locator_t:28,locator_typ:12,look:[8,18,19,24,28],loop:[10,15,28],lossi:[1,13],lot:[24,28],lower:24,lubomir:30,luc:18,lumin:19,luminos:[7,28,29],luminosity8bit_hist:29,luminosity_hist:29,luminosity_histogram:7,macro:[24,29],made:27,magnitud:28,mai:[0,1,3,4,6,7,8,10,13,14,15,28],main:27,maintain:[27,28],make:[0,6,7,8,10,15,24,28],make_scanline_read:24,make_step_iter:14,mandel:28,mandel_grad:28,mandelbrot:[8,14,15,22,28],mandelbrot_fn:28,mani:[5,6,9,10,24,28],manipul:5,manual:24,map:[1,3,7,13],margin:7,mark:0,mata:18,match:[1,10,17,24,28],matric:[18,19],matrix:[18,19],matter:18,max:1,max_el:2,max_valu:1,maximum:1,mayb:17,mean:[6,7,9,15,19,23,28],meant:24,measur:[6,15,28],mechan:[6,8,15,28],median:19,member:[8,14,17,24],memmov:[7,10],memori:[0,2,3,7,13,14,15,28,29],memory_based_2d_loc:15,memory_based_step_iter:[14,15],memorybasediteratorconcept:[14,15],memunit:[14,15],memunit_adv:14,memunit_advanc:14,memunit_advanced_ref:14,memunit_dist:14,memunit_step:14,mention:24,meta:28,metafunct:[2,4,10,11,13,14,15,16,22,27,28],metaprogram:24,method:[7,8,10,14,15,28],might:[18,19,24,28],mike:18,mikolajczyk:18,mileston:24,min:1,min_el:2,min_valu:1,mind:5,minimum:1,minisblack:24,minor:5,miss:28,mitig:28,mix:7,mode:[24,28],model:[0,4,5,6,7,8,12,17,28],modern:[24,28],modifi:[10,13,14,16,28],modul:[6,8],moment:18,monkei:7,monkey_transform:7,mono:24,moravec:18,more:[1,2,4,6,7,8,9,10,12,13,14,15,24,28],most:[2,4,8,9,10,13,15,16,23,24,28],motiv:1,move:[10,15,18,24,28],move_in:6,mpl:[2,3,6,12,13,14,24,28],much:28,multi:24,multipl:[7,10,15,28],multipli:[1,14,28],must:[2,4,10,13,14,15,17,28],mutabl:[1,9,10,12,13,14,15,17,25,28],mutable_forwarditeratorconcept:14,mutablechannelconcept:1,mutablecolorbaseconcept:[2,13],mutablehomogeneouscolorbaseconcept:[2,13],mutablehomogeneouspixelconcept:[7,13],mutableimageviewconcept:[9,10,28],mutableiteratoradaptorconcept:14,mutablepixelconcept:[7,13,17],mutablepixeliteratorconcept:14,mutablepixellocatorconcept:[10,15],mutablerandomaccess2dimageviewconcept:10,mutablerandomaccess2dlocatorconcept:15,mutablerandomaccessiteratorconcept:14,mutablerandomaccessndimageviewconcept:[9,10],mutablerandomaccessndlocatorconcept:15,mutablestepiteratorconcept:[14,15],my_any_image_t:6,my_color_convert:8,my_color_converter_impl:8,my_images_t:6,my_img_typ:[24,28],my_reference_proxi:17,my_valu:17,my_view:7,my_virt_view_t:28,myimg:6,myit:17,n2081:4,name:[6,7,13,15,19,22,28,29],namespac:[2,6,17,24,27,28],nativ:[1,28],natur:15,navig:[10,14,15],necessari:[14,15,17,24,28],need:[1,4,7,8,10,12,13,14,15,24,27,28],neg:14,negat:10,neighbor:[15,28],neighborhood:15,neighbour:10,nest:[10,28],never:[7,28],new_dim:9,next:[8,10,24,28,29],nice:28,noisi:18,non:[6,7,10,12,13,15,17,24,25,28],none:[24,28],normal:28,note:[0,1,2,6,7,9,10,13,18,24,28],noth:13,notic:[2,7,18,28],notion:28,now:[18,24,28],nth_channel_deref_fn:14,nth_channel_view:[7,10,28,29],nth_channel_view_typ:10,nth_channel_x_gradi:28,num_channel:[6,10,12,13,28],num_dimens:[10,15,16],number:[2,6,7,10,13,14,15,18,28],numbit:1,numer:[10,18,22],numeric_limit:1,obj:6,object:[6,8,10,12,14,15,17,24,25,28,29],obtain:[15,28],occupi:13,off:28,offer:15,offset:[1,14,15,28],ofstream:24,often:[3,6,13,28],onc:[0,5,10,28],one:[2,4,6,7,8,10,12,13,14,15,19,24,28],ones:[6,8,13,18],onli:[1,2,6,7,8,10,13,14,15,17,18,23,24,27,28,29],onlin:24,open:6,oper:[1,2,4,6,8,9,10,13,14,15,16,17,22,24,25,28,29],oppos:[7,10,12,25,28],optim:[5,7,10,15,28],option:[0,8,18,22,24,28],order:[0,2,3,6,7,10,12,13,15,18,23,25,28,29],organ:[12,13,15,25],origin:[6,10,28,30],other:[2,4,8,13,14,15,18,19,24,25,28,29],otherwis:[8,13],our:[6,7,8,28],out:[24,28],out_buff:24,outdoor:18,output:28,outsid:28,over:[1,9,10,13,14,18,25,28],overhead:[6,28],overlai:18,overload:[6,10,17,28],overrid:[7,8,15],overview:[20,22],own:[4,8,9,10,15,22,24,28],ownership:[9,28],pack:[9,13,14,28],packed_channel_refer:1,packed_channel_valu:1,packed_dynamic_channel_refer:1,packed_image1_typ:12,packed_image2_typ:12,packed_image3_typ:12,packed_image4_typ:12,packed_image5_typ:12,packed_image_typ:12,packed_pixel:[2,13,14,22],packed_pixel_typ:13,pad:[0,7,9,15],page:24,pair:[2,13,28],pairwis:[1,10,13],palett:24,paper:[4,18],paramet:[0,1,5,6,7,8,9,10,14,15,17,24,28],parent:17,parent_t:6,part:[24,29],partial:24,particular:[6,18,28],pass:[6,8,10,28],past:10,patch:18,path:[6,24],pattern:[1,7,12,28],peopl:27,per:[6,10,14,15,28],percent:24,perform:[6,8,10,14,15,22,28],perhap:6,permut:2,physic:[1,2,3,7,13],pick:24,pipe:28,pix_buff:13,pix_it:13,pixel1:13,pixel2:13,pixel:[0,1,2,3,4,5,6,8,9,11,16,17,19,22,25,29],pixel_2d_locator_bas:15,pixel_bit_s:27,pixel_refer:12,pixel_reference_typ:12,pixel_value_typ:12,pixelbasedconcept:[12,13,14,28],pixelconcept:[4,7,8,10,12,13,14,15],pixelconvertibleconcept:13,pixeldata:14,pixeldereferenceadaptorconcept:[8,10,14,15,28],pixeliteratorconcept:[10,12,14,15],pixellocatorconcept:[10,15],pixelrefer:12,pixelscompatibleconcept:[10,13],pixelvalueconcept:[8,9,10,13,14,15],place:28,plain:14,planar:[0,2,6,7,9,10,12,13,14,15,17,24,25,28,29],planar_pixel_iter:[14,15],planar_pixel_refer:[13,17],planar_rgb_view:[10,28],plane:[0,7,10,19,28],platform:[15,22],pleas:[18,24],plot:19,plu:15,png_lib:24,png_test_fil:24,png_wiki:24,pnm_wiki:24,point2dconcept:[15,16],point:[0,1,6,10,11,12,13,15,18,22,24,25,28],point_t:[6,9,10,15,24,28],point_typ:10,pointer:[1,7,8,10,13,14,15,24,25,28],pointndconcept:[10,15,16],polici:[0,10,29],popular:23,posit:[14,15,28],position_iter:14,possibl:[6,10,13,24,28],potenti:[0,24],pow:28,power:[6,7,18,28],practic:[6,28],pre:28,precis:1,prefix:2,presenc:0,present:[28,29,30],pretend:14,previou:[0,6],previous:[10,28],price:12,privat:[8,10,15,24,28],probabl:24,problem:[12,17,28],process:[0,10,21,22,28],processor:28,produc:19,product:[28,29],profil:8,program:[4,24,28,29],project:[0,21,23],propag:[10,28],proper:28,properli:[1,2,7,8,24,28],properti:[12,13,22,28],propos:4,provid:[0,1,2,3,5,6,8,9,10,12,13,14,15,16,17,19,24,27,28,29],proxi:[1,2,13],ptr:7,ptrdiff_t:[6,10,14,15,28],pull:14,purpos:13,put:[19,28],quadrant:29,qualifi:17,qualiti:[8,24],queri:28,r565:13,rais:28,random:[3,6,14,15,28],randomaccess2dimageconcept:9,randomaccess2dimageviewconcept:10,randomaccess2dlocatorconcept:15,randomaccessndimageconcept:9,randomaccessndimageviewconcept:10,randomaccessndlocatorconcept:[10,15],randomaccesstraversalconcept:[10,14,15],randomaccesstraversaliteratorconcept:14,rang:[1,2,9,10,28],range_c:3,rare:[9,28],rather:24,raw:[5,15,28],raw_wiki:24,rbegin:10,rbg323:24,rdbuf:24,read:[0,8,10,12,13,14,15,28],read_and_convert_imag:24,read_and_convert_view:24,read_imag:24,read_image_info:24,read_view:24,read_xxx:24,reader:[24,28],reader_bas:24,reader_t:24,real:[17,28],realiz:28,rebind:14,recommend:[0,24],recreat:[6,7,9],rectangular:[10,28],recurs:[2,14,28],red:[0,1,2,7,13,14,17],red_in_cmyk16:13,red_in_rgb8:13,red_t:[2,3,13],redefin:8,ref2:7,ref:[7,13],refer:[1,2,7,8,10,12,13,14,15,18,22,24,25,28],refin:16,regardless:28,region:[20,22,28],regist:28,regular:[1,2,4,9,10,13,15,16],rel:[15,28],relat:[4,12,28],releas:21,relev:24,remain:8,rememb:[15,17],remov:[24,28,29],remove_refer:14,rend:10,repeat:15,replac:12,repres:[0,6,15,17,24,28],represent:[0,5,22,28],request:24,requir:[1,2,4,6,8,9,10,13,14,15,22,23,24,28],resampl:10,rescal:22,resembl:[6,10],resid:28,resiz:[10,22],resolut:[5,6],respect:[7,13,28],respons:18,rest:[12,28],restrict:24,result:[0,2,5,6,7,8,10,12,13,14,15,18,24,28],result_typ:[4,6,8,10,14,28],reus:28,reverse_iter:10,review:[24,27],rewrit:28,rewritten:29,rgb16:24,rgb16_image_t:[10,28],rgb16c_planar_view_t:28,rgb16s_pixel_t:28,rgb16s_view_t:28,rgb222:28,rgb32f_planar_step_ptr_t:[12,25],rgb32f_planar_view_t:7,rgb32fc_view_t:28,rgb32s_pixel_t:28,rgb32s_view_t:28,rgb565:13,rgb565_channel0_t:13,rgb565_channel1_t:13,rgb565_channel2_t:13,rgb565_pixel_t:13,rgb64_image_t:8,rgb64_pixel:8,rgb64_pixel_ptr_t:8,rgb64_pixel_t:8,rgb8:[13,24],rgb8_image_t:[6,24,28],rgb8_pixel_t:[7,13,28],rgb8_planar_ptr_t:14,rgb8_planar_ref_t:[7,13],rgb8_planar_view_t:12,rgb8_ptr_t:10,rgb8_step_view_t:6,rgb8_view_t:[6,7],rgb8c_planar_ptr_t:[7,14],rgb8c_planar_ref_t:[7,13],rgb8c_ptr_t:10,rgb8c_view_t:[6,28],rgb:[0,1,2,7,8,10,12,13,14,24,25,28,29],rgb_channel_t:7,rgb_cs_t:7,rgb_full:13,rgb_layout_t:[7,8,13],rgb_planar_pixel_iter:17,rgb_t:[3,7,13,14],rgba16:24,rgba8:24,rgba8_image_t:24,rgba:[0,3,12,25,27],rgba_image_t:24,rgba_layout_t:[3,7],rgba_t:3,rgbpixel:7,rgbtograi:29,right:[7,10,14,15,28],rise:15,rotat:[6,10,28],rotated180_view:[6,7,10],rotated180_view_fn:6,rotated90ccw_view:[10,28],rotated90cw_view:[10,28],row:[0,7,9,10,13,14,15,24,28,29],row_begin:[10,28],row_end:10,rowsiz:10,rpv32:7,rule:23,run:[0,1,5,6,7,10,21,22],runtim:6,runtime_imag:[24,28],rview:10,said:6,sake:10,same:[1,2,3,6,7,8,10,13,15,16,18,19,24,28],sametyp:[1,2,4,10,13,14,16],sampl:[15,22,24,28,29],satisfi:[2,4,9,10,15,28],sav:6,save:[6,24,28],save_180rot:6,scale:28,scanlin:24,scanline_read:24,scanline_read_iter:24,scenario:[2,28],schaffalitzki:18,scharr:19,scharrx:19,schmid:18,scoped_channel_valu:1,sean:17,second:[0,1,7,13,15,17,18,24,28,29],second_argument_typ:10,section:[0,2,10,11,20,24,27],see:[2,4,8,10,14,15,24,28],seek:24,select:6,semant:[2,3,13,28],semantic_at_c:[2,7,13],send:24,separ:[0,8,10,18,28],sequenc:[1,3,6],serv:24,set:[0,1,3,4,6,7,8,9,10,13,14,15,24,28],set_step:14,sever:[5,6,14,24,28],shallow:[6,7,10,14,17,28],shape:19,share:[6,13,24],sharper:19,she:24,shift:1,shortli:29,should:[6,15,18,23,24,28],show:[7,24,28],shown:[7,28],side:28,sigma:19,sign:[12,25,28],signific:10,similar:[1,6,10,14,15,22,24,28],similarli:[9,14],simpl:[12,15,19,24,28,29],simpler:[18,24,29],simplest:[19,28],simpli:[7,8,15,18,19,28],simplic:28,simplifi:[7,18,28],simultan:28,sinc:[6,7,13,14,24,27,28,29],singl:[6,10,14,19,24,28],size1:12,size2:12,size3:12,size4:12,size5:12,size:[2,3,6,7,10,13,14,15,24,28],size_t:[2,6,9,10,13,15,16],size_typ:[6,10],sizeof:13,skeleton:24,skip:[10,14,28,29],slightli:[8,28],slow:28,slower:[15,28],small:[18,24,27],smaller:7,sobel:19,softwar:29,solut:17,some:[0,4,6,7,8,10,12,13,14,15,17,24,28],sometim:[1,10,13,14,15,17,24,28],somewher:8,soon:24,sort:19,sourc:[1,6,7,8,10,24,25,28,29,30],space:[0,2,5,6,7,10,11,13,14,22,24,27,28,29],special:[8,13,25,28],specif:[0,5,22,24,28],specifi:[0,1,3,5,6,8,9,12,14,22,24],speed:[0,5,6,10,28],spirit:[6,15],springer:18,sr8wjg0pcee:30,src1:10,src1_it:28,src2:10,src2_it:28,src:[1,2,6,7,8,10,24,28],src_b:28,src_g:28,src_it:28,src_loc:28,src_pix_ref:8,src_pixel:28,src_r:28,src_row_byt:28,srcchannel:1,srccolorspac:8,srcconstrefp:8,srcp:8,srcpixel:13,srcview:[7,8,10,28],srowbyt:29,stabl:18,stage:10,standalon:27,standard:[3,4,10,12,14,15],start:[10,13,15,24,28],state:10,statement:[6,28],static_:2,static_assert:[6,7,12,13],static_copi:2,static_equ:2,static_fil:[2,7,28],static_for_each:[2,28],static_gener:[2,28],static_max:2,static_min:2,static_transform:[2,14,28],std:[1,2,6,7,9,10,12,13,14,15,17,24,28,29],step1:7,step2:7,step3:7,step4:7,step5:7,step:[6,10,12,15,20,25,28],step_iterator_t:12,stepanov:17,stephen:18,stepiter:15,stepiteratorconcept:[14,15],still:28,stl:[2,5,6,9,15,17],stlab:10,store:[6,7,15,24,28],straightforward:[10,24],stream:24,strength:19,stretch:19,string:[6,24],stringstream:24,strip:24,strongli:24,struct:[1,2,3,6,8,10,12,13,14,15,16,17,24,28],structur:[0,6,10,11,18,20,22,28],studio:28,sub:[1,17,24,27],subclass:[6,14,15],subimag:28,subimage_view:[7,10,24,28,29],subject:24,suboptim:28,subsampl:[10,14,28],subsampled_view:[7,10,28,29],substitut:4,succinct:10,suffici:[15,23],suffix:25,suggest:[17,27],suit:24,suitabl:28,sum:18,summer:21,suppli:[8,10,14,15,24],support:[0,1,6,7,8,10,12,14,22,28,29],supported_image_format:24,suppos:[6,7,8,28],sure:24,swap:[4,6,15,17],swappabl:[1,2,4,6],symmetr:13,synopsi:[6,10,15],syntact:4,syntax:4,synthet:[8,22,28],system:[24,28],tabl:[11,20,24],tag:[24,25],tag_t:24,take:[2,6,7,8,9,10,14,15,17,24,28,29],taken:28,targa_wiki:24,target:[5,24,28],task:28,technic:[11,22],techniqu:[6,24],tell:23,templat:[1,2,3,4,6,7,8,9,10,12,13,14,15,16,17,24,28,29],temporari:[17,28],term:[16,18],test:[22,25],test_imag:24,text:24,than:[2,6,7,13,14,15,24,28],thank:[24,27],thei:[1,2,3,5,6,7,8,10,12,13,14,15,18,19,28],them:[1,4,6,9,10,12,13,24,28],therefor:1,thi:[0,1,2,4,6,7,8,10,12,13,14,15,17,18,19,24,25,27,28,29,30],thing:[7,19,24],think:28,third:24,thorough:24,those:[13,19],though:[6,7,19,28],three:[1,13,14,18,19,28],threshold:18,through:[7,15,24,28],thrown:28,thu:[1,2,3,8,15],tif:24,tiff_base_tag:24,tiff_extension_tag:24,tiff_graphicsmagick_test_fil:24,tiff_lib:24,tiff_lib_tiff_test_fil:24,tiff_t:24,tiff_tag:24,tiff_wiki:24,tile:24,time:[0,1,2,5,6,7,8,10,14,22],timor:18,tinn:18,tmp:[14,17],todo:26,togeth:[0,3,13,28],toll:[6,28],too:27,toolbox:[22,24],top:[0,7,10,12,15,24,28,29],top_left:10,total:[10,15],trace:18,track:[10,14,28],transform:[1,2,6,8,10,18,22],transform_pixel:[10,28],transform_pixel_posit:[10,28],transpos:[10,15,28],transposed_typ:[10,15],transposed_view:10,travers:[9,10,14,15,24,25,28],treat:[6,28],tricki:17,trickier:28,trigger:[6,28],trivial:25,troubl:24,true_:[12,14],turn:6,tutori:[8,10,15,22],tuytelaar:18,tweak:19,twice:28,two:[0,1,2,3,6,7,9,10,13,14,15,16,18,19,21,24,28],type:[0,1,2,3,4,5,6,7,9,10,13,14,15,16,17,22,24,27,28,29],type_from_x_iter:12,typedef:[1,6,7,8,10,12,13,14,17,24,28],typenam:[1,2,3,4,6,7,8,9,10,12,13,14,15,16,17,24,28,29],types1:6,types2:6,types_t:6,typic:[1,6,8,10],ud_fud:10,uint16_t:[1,13],uint8_t:[1,18,29],unari:[14,28],unary_compos:14,unary_funct:14,unaryfunctionconcept:[10,14],unchang:28,unclear:15,under:[18,24],underli:[6,10,14,24],understand:[1,18,19,24],unfamiliar:28,unfortun:28,uniformli:6,uninitialized_copi:10,uninitialized_copy_pixel:10,uninitialized_fil:10,uninitialized_fill_pixel:10,uniqu:[3,6],unit:[14,15,24],unless:19,unlik:[9,13],unnam:3,unnecessari:[7,13,28],unpack:13,unrel:29,unrol:28,unset:10,unsign:[6,7,9,10,12,13,14,25,28],unspecifi:4,until:18,unus:[13,28],unusu:28,uop:6,upon:[6,8,10,12,14,15,17],upper:29,upsid:[6,10],usag:[19,24],use:[1,2,4,7,8,10,12,13,15,17,19,23,24,28],use_default:12,used:[2,3,4,5,6,7,9,13,14,15,16,18,19,24,25,28],useful:[8,9,14,15,28],user:[0,4,8,10,15,24,27,28],uses:[2,6,10,12,14,15,16,24,28],using:[1,2,3,6,7,8,9,10,12,13,15,22,24,28,29],using_io:24,usual:[14,18,19,24],val:10,valid:[1,10,28],valu:[0,1,2,3,6,7,8,9,10,12,13,14,15,16,17,18,19,24,25,28],value_typ:[1,8,9,10,13,14,15,16,24,28],van:18,vari:[0,3,28],variabl:[0,28,29],variant:[6,24,28],variat:[0,24],varieti:[22,28],variou:24,vector2:6,vector3_c:13,vector4:3,vector4_c:3,vector:[6,24,28],veri:[9,12,18,28,29],version:[10,14,15,23,24,29],vertic:[12,14,15,19,28],via:[6,10],video:[0,22,28],view1:10,view2:10,view:[5,9,11,13,14,15,22,24,25,29],view_is_mut:12,view_t:[6,7,9,10,12,24],view_typ:12,view_type_from_pixel:12,viewer:24,viewscompatibleconcept:[7,10],viewtyp:6,virtual:[5,6,8,12,14,15,24],virtual_2d_loc:[15,28],vision:[0,18],visit:[10,15],visual:28,vol:18,wai:[2,6,13,17,19,24,25,28],walk:[24,28],want:[7,8,14,15,24,28],warn:28,watch:30,web:4,websit:24,weight:[18,20],well:[2,13,24,28],were:[21,28],what:[6,19,20,24,28],when:[2,7,8,9,10,14,15,17,18,19,24,28],where:[1,2,7,9,10,12,13,14,15,16,23,24,25,28],wherea:[0,2,6,19,24,28],whether:[1,10,12,14,15,28],which:[0,1,2,3,6,7,8,9,10,12,14,15,16,19,23,24,25,27,28],who:27,whose:[0,2,10,12,13,14,22,28],why:28,width:[6,7,9,10,15,28,29],window:[18,24],within:10,without:18,word:[0,9,10,14,19,28],work:[0,5,6,7,8,10,13,17,18,22,28,29],worth:[7,24,28],would:[0,6,14,19,24,28],wrap:[6,10,14],wrapper:[14,15],write:[0,5,6,7,10,17,22,28],write_view:24,writer:24,written:[15,19,24,28,29],wstring:24,www:30,x_at:[10,15],x_coord_t:[6,9,10,15],x_diff:15,x_gradient:[22,28],x_gradient_obj:28,x_gradient_rgb_luminos:28,x_gradient_unguard:28,x_iter:[9,10,13,15,24,28],x_luminosity_gradi:28,x_min:28,xbm:24,xgradientgray16_gray32:28,xgradientplanarrgb8_rgb32:28,xgradientrgb8_bgr16:28,xiter:[12,15],xpm:24,xxx:24,xxx_all:24,xxx_and_convert_xxx:24,xxx_read:24,xxx_tag:24,xxx_write:24,xy_at:[10,15,28],xy_loc:[10,28],xy_locator_t:12,xyz:27,y_at:[10,15],y_coord_t:[6,9,10,15],y_distance_to:15,y_gradient:28,y_iter:[10,15,28],y_min:28,ycbcr:24,ycck:24,yellow:18,yet:[0,24,28],you:[7,8,12,17,24,28],your:[8,17,22,23,24,28],yourself:24,youtub:30,zero:[13,18,28],zisserman:18,zlib:24},titles:["Basics","Channel","Color Base","Color Space and Layout","Concepts","Conclusions","Dynamic images and image views","Examples","Extending","Image","Image View","Design Guide","Metafunctions","Pixel","Pixel Iterator","Pixel Locator","Point","Technicalities","Affine region detectors","Basics","Image Processing","Overview","Boost Generic Image Library","Installation","IO extensions","Naming Conventions","Numeric extension","ToolBox extension","Tutorial: Image Gradient","Tutorial: Histogram","Tutorial: Video Lecture"],titleterms:{"new":[8,24],And:24,Using:[7,24,28],acknowledg:27,adaptor:14,affin:18,algorithm:[1,2,10,13,18,28],align:12,avail:18,base:[2,12],basic:[0,19],being:18,bit:12,bmp:24,boost:22,buffer:24,canva:7,channel:[1,8],code:28,color:[2,3,8,28],compat:5,compil:24,compon:12,concept:4,conclus:[5,28],concret:25,convent:25,convers:[8,28],convolut:19,core:22,creat:[10,17,28],curvatur:19,defin:8,derefer:14,deriv:[12,19],design:11,detect:18,detector:18,document:22,dynam:6,equival:28,exampl:[7,22],exist:12,extend:[8,24],extens:[5,22,24,26,27],filter:19,first:28,flexibl:5,folder:27,format:24,from:10,fundament:14,gener:[5,22,24,28],gil:[24,28,29],glue:28,gradient:28,guid:11,harri:18,hessian:18,histogram:[7,29],homogen:12,imag:[6,7,8,9,10,12,15,20,22,24,28],implement:[28,29],instal:23,interfac:[24,28],iter:[12,14,15,28],jpeg:24,kernel:19,layout:3,lectur:30,level:7,librari:22,locat:[15,28],manipul:12,memori:[12,24],metafunct:12,model:[1,2,3,9,10,13,14,15,16],name:25,numer:26,oper:7,origin:29,other:10,over:15,overload:8,overview:[1,2,3,8,9,10,12,13,14,15,16,21,24,26,27],pack:12,perform:5,pixel:[7,10,12,13,14,15,28],platform:24,png:24,pnm:24,point:16,process:20,proxi:17,quickstart:22,raw:[10,24],read:24,refer:[17,27],region:18,resiz:7,run:[24,28],space:[3,8],specifi:28,step:[14,18],stl:[10,28],structur:27,style:10,support:24,symbol:24,targa:24,technic:17,test:24,tiff:24,time:28,toolbox:27,trait:12,transform:28,tutori:[24,28,29,30],type:[8,12,25],version:28,video:30,view:[6,7,8,10,12,28],virtual:28,weight:19,what:18,write:24}}) \ No newline at end of file +Search.setIndex({docnames:["design/basics","design/channel","design/color_base","design/color_space","design/concepts","design/conclusions","design/dynamic_image","design/examples","design/extending","design/image","design/image_view","design/index","design/metafunctions","design/pixel","design/pixel_iterator","design/pixel_locator","design/point","design/technicalities","image_processing/affine-region-detectors","image_processing/basics","image_processing/index","image_processing/overview","index","installation","io","naming","numeric","toolbox","tutorial/gradient","tutorial/histogram","tutorial/video"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["design/basics.rst","design/channel.rst","design/color_base.rst","design/color_space.rst","design/concepts.rst","design/conclusions.rst","design/dynamic_image.rst","design/examples.rst","design/extending.rst","design/image.rst","design/image_view.rst","design/index.rst","design/metafunctions.rst","design/pixel.rst","design/pixel_iterator.rst","design/pixel_locator.rst","design/point.rst","design/technicalities.rst","image_processing/affine-region-detectors.rst","image_processing/basics.rst","image_processing/index.rst","image_processing/overview.rst","index.rst","installation.rst","io.rst","naming.rst","numeric.rst","toolbox.rst","tutorial/gradient.rst","tutorial/histogram.rst","tutorial/video.rst"],objects:{},objnames:{},objtypes:{},terms:{"0rrgggbb":13,"0x06":13,"0x0c":13,"0x11":13,"0x30":13,"0x60":13,"0x83":13,"0xc1":13,"1000s":18,"100s":18,"100x100":7,"200x200":28,"4x3":0,"50x50":10,"abstract":[0,5,10,22,28],"boolean":[12,28],"break":6,"byte":[1,6,9,10,13,14,15,17,22,28],"case":[2,5,7,8,10,12,13,15,18,24,28],"char":[7,9,10,12,13,14,24,28],"class":[1,2,4,6,8,9,10,12,13,14,15,17,24,28],"const":[1,2,6,7,8,9,10,12,13,14,15,16,17,24,25,28,29],"default":[1,3,6,7,8,9,10,12,14,17,25,28],"final":[2,7,8,28],"float":[1,7,12,24,25,28],"function":[2,6,8,10,12,14,15,17,18,22,24,28,29],"import":[6,9,17,24],"int":[1,2,3,7,10,13,15,24,28,29],"long":[4,7,8,10,12,28],"new":[5,28,29],"public":[6,8,10,14,15,24],"return":[1,2,4,6,7,8,10,12,13,14,15,17,24,28],"short":[12,24,28,29],"static":[1,2,6,7,8,10,13,14,15,28],"switch":[6,28],"throw":6,"true":[1,2,12,13,14,15,28],"try":[7,24,28],"var":[7,29],"void":[2,4,6,7,8,9,10,13,14,17,24,28,29],"while":[0,1,3,13,15,28],But:24,For:[1,2,3,4,6,7,8,10,12,13,14,15,18,24,25,28,29],Its:[1,2,13,14,28],Not:7,One:[15,17,18,24,28],Such:[1,6,15,28],That:[6,28],The:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,27,28,29],Their:[6,15,28],Then:[15,28],There:[0,2,6,12,19,24,28],These:[2,12,13,28],Use:[17,24],Using:[10,12,15,22,29],_bit:6,_bmp_test_fil:24,_concept_:28,_dimens:10,_dst:28,_dynamic_cast:6,_height:24,_imag:[12,25],_img_siz:28,_index:6,_info:24,_io_dev:24,_is_:12,_loc:[12,25],_pixel:[10,12,25],_planar:[12,25],_png_test_fil:24,_ptr:[12,25],_ref:[12,25],_scanline_length:24,_step:[12,25],_tiff_graphicsmagick_test_fil:24,_tiff_lib_tiff_test_fil:24,_variants_:28,_view:[12,25],_width:[15,24],abbrevi:28,abgr_layout_t:3,abil:24,abl:[14,24],about:[4,8,15,19,28,30],abov:[0,2,7,10,13,14,15,17,18,19,24,28,29],abraham:17,access:[1,2,3,6,7,8,13,15,24,28],accessor:[2,16],accordingli:8,account:7,achiev:19,acknowledg:22,actual:[8,29],adapt:1,adaptor:[8,10,15],add:[6,8,15,24],add_deref:[8,10,15],add_fs_path_support:24,add_ref_t:8,added:27,adding:[7,24],addit:[1,2,4,6,9,10,14,15,28],addition:28,address:[0,12,13],adjac:[10,14,28],adob:10,advanc:[10,14,15,24,28],advantag:[28,29],advis:24,affin:[20,22],after:[2,28],again:[15,18],against:[17,23],alex:17,algorithm:[0,4,5,6,7,8,9,14,15,17,20,21,22],align:[0,6,9,10,13,14,22,28,29],all:[0,1,2,3,4,6,7,8,10,13,14,15,17,18,24,27,28],alloc:[7,9,10,12,24,28,29],allocator_typ:9,allow:[0,1,2,5,6,8,9,10,12,13,14,15,17,22,24,28],alon:19,along:[10,12,14,15,16,28],alpha:[0,27],alpha_t:3,alreadi:[12,13,24,28],also:[0,1,2,3,7,10,12,13,14,15,16,24,28,29],altern:28,alvei:18,alwai:[6,13,17,25,28],amount:[14,15],analog:13,analysi:[12,20],andrew:18,ani:[0,2,5,6,7,8,10,12,14,15,18,19,23,28,29],anoth:[1,2,5,6,8,10,13,14,19,24,28],another_iter:14,any_imag:[6,24,28],any_image_view:[6,28],any_pixel:[6,28],any_pixel_iter:[6,28],anyth:[8,14,24],api:22,append:12,appendix:28,appli:[0,1,14,19,22,24,28],applic:[24,28],apply_oper:[6,28],appropri:[1,6,24],approxim:[13,14,28],arbitrari:[8,14,28],area:[7,10,24],aren:24,argb_layout_t:3,argument:[6,14,28],argument_typ:[8,10,28],aris:17,arithmet:[1,19],around:[7,14,15,24],arrai:[0,14,15,19],ascii:24,assembl:28,assert:[1,7,13,28],assert_sam:6,assign:[1,2,4,6,9,13,17,28],assignableconcept:14,associ:[1,2,3,6,12,28],assum:[18,28],at_c:[2,13],atom:28,author:24,auto:[4,24],avaialbl:4,avail:[6,10,15,20,24,28],averag:15,avoid:28,awai:[10,14],axi:[10,15,16,19,28],axis:19,axis_iter:[10,15],axis_valu:16,b16:7,back:[6,10,28],backend:24,backend_t:24,backward:25,bad_cast:6,base:[1,6,10,11,13,14,15,17,22,24,28,29],basic:[4,11,12,18,20,22,24],becam:24,becaus:[1,6,9,10,12,13,15,18,28],been:[5,24,28,29],befor:24,begin:[7,10,24,28,29],behav:6,being:[12,20,24],belong:27,below:[11,14,15,18,20,24,28],berlin:18,besid:[3,24],beta:10,better:28,between:[1,6,8,10,13,14,28],bgr16_view_t:7,bgr232:13,bgr232_pixel_t:13,bgr232_ptr_t:13,bgr232_ref_t:13,bgr556:13,bgr556_pixel_t:13,bgr8:13,bgr8_image_t:[12,25],bgr8_pixel_t:[7,13],bgr8_view_t:6,bgr:[0,2,7,12,13,25,28,29],bgr_layout_t:[3,13],bgra_layout_t:3,big:[18,24],biggest:[6,28],bilinear:22,bin:7,binari:[24,28],binaryfunctionconcept:10,bit:[0,1,2,7,8,9,10,13,14,15,24,25,28,29],bit_align:13,bit_aligned_image1_typ:12,bit_aligned_image2_typ:12,bit_aligned_image3_typ:12,bit_aligned_image4_typ:12,bit_aligned_image5_typ:12,bit_aligned_image_typ:12,bit_aligned_pixel_iter:[13,14],bit_aligned_pixel_refer:13,bitdepth:[12,25],bitfield:12,bitmask:22,bits16:1,bits32f:1,bits8:[7,10,13,14,28],bitwis:10,block:[3,6,10,28],blue:[2,7,13,17],blue_t:[2,3,7,13],blur:[18,22],bmp_filenam:24,bmp_test_fil:24,bmp_wiki:24,bodi:28,bool:[1,2,4,6,8,9,10,12,13,14,15,28],boost:[3,6,7,10,12,14,21,23,24,27,28,29],boost_check_equ:24,boost_concept:14,boost_gil_extension_io_jpeg_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_png_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_tiff_c_lib_compiled_as_cplusplu:24,boost_gil_extension_io_zlib_c_lib_compiled_as_cplusplu:24,boost_gil_io_add_fs_path_support:24,boost_gil_io_enable_gray_alpha:24,boost_gil_io_png_1_4_or_low:24,boost_gil_io_png_dithering_support:24,boost_gil_io_png_fixed_point_support:24,boost_gil_io_png_floating_point_support:24,boost_gil_io_test_allow_reading_imag:24,boost_gil_io_test_allow_writing_imag:24,boost_gil_io_use_bmp_test_suite_imag:24,boost_gil_io_use_png_test_suite_imag:24,boost_gil_io_use_pnm_test_suite_imag:24,boost_gil_io_use_tiff_graphicsmagick_test_suite_imag:24,boost_gil_io_use_tiff_libtiff_test_suite_imag:24,boost_gil_use_concept_check:[10,28],boost_mpl_assert:13,boostorg:23,bop:6,border:7,borrow:6,both:[0,6,7,13,15,16,18,24,28,29],bottom:[0,10,15,28],bound:[6,13],boundari:28,bourdev:30,buffer:[7,13,28],build:[0,24],built:[1,7,12,13,14,23,28],byte_to_memunit:14,c_str:24,cach:[15,28],cache_loc:[15,28],cached_location_t:[15,28],calcul:29,call:[6,7,8,10,13,17,18,24,28,29],can:[2,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,22,23,24,28,29],cannot:[7,10,19,28],canon:[13,28],capabl:24,captur:3,care:8,carriag:[15,28],cast:28,caus:[18,28],caution:6,cav:6,cb1:2,cb2:2,cb3:2,cc_t:24,ccv:10,ccv_imag:28,center:[7,19],centerimg:7,central:28,certain:19,challeng:[0,28],chan16:1,chang:[6,8,10,12,14,18,24,28,29],channel16_0_5_reference_t:1,channel16_11_5_reference_t:1,channel16_5_6_reference_t:1,channel1:1,channel2:1,channel3:1,channel:[0,2,3,5,6,7,10,11,12,13,14,17,19,22,24,25,28,29],channel_6bit:1,channel_convert:[1,7,8,13,28],channel_convert_to_unsign:28,channel_invert:[1,8],channel_mapping_t:3,channel_mapping_typ:[12,13,28],channel_multipli:1,channel_t:28,channel_trait:[1,8],channel_typ:[7,12,13,27,28],channel_type_to_index:27,channelbitsizevector:12,channelconcept:[1,13],channelconvertibleconcept:1,channelmap:3,channelmappingconcept:[3,13],channelptr:14,channelrefer:13,channelrefvec:14,channelscompatibleconcept:[1,13],channelvalu:[12,13,14],channelvalueconcept:[1,12],check:[6,7,10,15,28],choic:[15,18],choos:15,chose:7,christoph:18,chunki:28,claim:24,classtyp:[12,25],clear:[19,24],client:23,clockwis:28,close:24,closer:28,cmyk16_pixel_t:[12,13,25],cmyk16_planar_image_t:6,cmyk16_planar_step_view_t:6,cmyk16_planar_view_t:6,cmyk16c_planar_ref_t:25,cmyk16c_planar_view_t:6,cmyk16sc_planar_ref_t:12,cmyk8_image_t:24,cmyk:[0,12,25],cmyk_t:3,cmyka:27,code:[0,3,5,6,7,8,10,15,21,22,24,25,29],col:29,col_begin:10,col_end:10,collect:[6,27],color:[0,1,5,6,7,10,11,12,13,14,15,22,24,25,27,29],color_bas:2,color_const_reference_t:2,color_convert:[8,13,27],color_convert_deref_fn:[8,14],color_convert_view:8,color_converted_view:[7,8,10,28,29],color_converted_view_typ:[8,10],color_converter_typ:24,color_reference_t:2,color_spac:27,color_space_t:[2,3],color_space_typ:[7,8,12,13,28],colorbas:2,colorbaseconcept:[2,13],colorbasescompatibleconcept:[2,13],colorbasevalueconcept:2,colorconvert:10,colorspac:[3,12,13,14,25],colorspace1:3,colorspace2:3,colorspaceconcept:[3,13],colorspacescompatibleconcept:[2,3,28],column:[14,15,28,29],com:[10,23,30],combin:[6,14,15,18,28],come:[12,24],commerci:29,common:[0,2,4,6,24],commonli:13,commun:27,compact:1,compactli:[7,28],compar:[0,1,2,5,6,7,28],comparison:[1,6,15,18],compat:[1,2,3,6,7,10,13,24,28],compil:[1,2,5,6,7,10,13,14,17,23,28],complement:5,complet:[24,28],complex:[6,7,13,15,18,28],complic:[8,9,17],compon:[0,1,25],compos:[10,14],comprehend:28,comprehens:28,compris:3,comput:[7,15,18,19,28,29],computexgradientgray8:28,concept:[0,1,2,5,8,9,10,11,13,14,15,16,18,19,22,28],concept_check:[10,28],concept_map:4,conceptc:4,conceptu:13,conclus:[11,22],concret:[6,28],condit:[15,18],confer:18,consid:[1,3,6,13,19,29],consist:[2,15,23,28],const_iterator_typ:14,const_point:1,const_refer:[1,8,10,13,14,28],const_t:[6,8,9,10,14,15,28],const_view:[9,28],const_view_t:[6,9],constant:[10,12,13,17,18,28],constexpr:[8,28],construct:[1,4,5,6,7,8,9,10,12,13,14,17,28],constructor:[1,6,7,9,17,28],consult:24,contain:[1,2,3,6,7,9,13,14,24,28],content:[11,20,27],context:[19,24],contigu:2,conveni:8,convent:[22,28],convers:[1,13,14,15,24],conversionpolici:24,convert:[1,2,7,8,10,12,13,14,24,27,28],convolut:[10,20,22],convolv:[7,19],coord:28,coord_t:[9,10,15],coordin:[15,16,24,28],copi:[1,2,6,7,8,9,10,13,15,17,24,28,29],copy_and_convert_pixel:[10,28],copy_pixel:[6,7,10,24,28],copyabl:10,copyconstruct:[2,4],copyconstructibleconcept:14,cordelia:18,corner:[7,10,18,28],correct:28,correctli:[4,17],correspond:[1,2,5,8,10,14,19,28],cost:5,could:[6,7,10,14,15,19,24,28],count:7,counter:28,counterpart:24,coupl:24,cours:[15,24],cover:18,cpp:[3,22],creat:[1,3,6,7,8,12,13,14,15,22,24],create_with_margin:7,current:[3,6,14,15,24,28],current_type_i:6,curvatur:[18,20],custom:[1,10,15],d_channel_t:28,data:[1,5,8,9,10,24,25,28],dave:17,deal:28,dealloc:28,debug:28,decent:24,declar:28,decrement:15,dedic:[11,20],deep:[6,9,17,28],deeper:18,default_color_convert:10,default_color_converter_impl:8,defaultconstruct:4,defaultconstructibleconcept:14,defin:[0,1,2,3,4,6,10,12,13,14,15,16,17,22,24,28],definit:[3,27],degrad:28,degre:28,delai:15,deleg:10,delet:9,demand:24,demonstr:[10,24,28],denot:[14,17,28],depend:[19,23,24],depth:[0,6,7,10,12,14,25,28,29],deref:[10,15],deref_compos:14,deref_t:8,derefer:[8,28],dereferenc:[7,8,10,12,14,15,17],dereference_iterator_adaptor:14,deriv:[10,18,20],derived_image_typ:[12,28],derived_iterator_typ:[12,28],derived_pixel_reference_typ:[12,28],derived_view_typ:[12,28],describ:[0,2,4,11,15,16,20,24],descript:[24,25],design:[0,2,5,22,24,28],desir:28,despit:6,destin:[1,6,7,8,24,28],destroi:6,destructor:[9,28],det:18,detail:[2,6,14,24],detect:[20,28],detector:[20,22],determin:[14,15,18],develop:[10,21],devic:24,devicen_t:3,diagram:15,diff:14,differ:[1,6,13,14,15,17,18,19,24,28],difference_typ:[10,15],difficult:[0,28],dim:[6,9,28],dimens:[6,9,10,15,16,18,24,28],dimension:[7,9,10,15,16,28],direct:[12,14,15,18,19,24,28],directli:[7,13,15,17,24,28,29],directori:27,disadvantag:28,discrimin:18,discuss:0,disk:[6,8,28],dispatch:8,displai:24,distanc:[14,28],distinct:[1,13,18,28],distribut:13,dither:24,divis:14,do_swap:6,document:[0,4,19,20,24,28],doe:[1,7,10,12,17,23,28],doesn:[24,28],doing:[6,8,13],don:[6,8,9,10,12,13,15,28],done:[7,15,19,24,28],doubl:[8,28],down:[6,7,10],download:[10,23],draw:19,drawback:28,drive:24,dst:[1,2,7,8,10,24,28],dst_channel_t:28,dst_it:28,dst_pixel:28,dst_row_byt:28,dst_view:24,dstchannel:1,dstcolorspac:8,dstimag:7,dstp:[8,10],dstpixel:13,dstview:28,due:13,duplic:29,dure:[21,24],dxdx:18,dxdy:18,dydi:18,dynam:[11,12,14,15,22,24],dynamic_at_c:[2,13],dynamic_imag:[6,22,28],dynamic_image_al:[6,28],dynamic_x_step_typ:[6,10,14],dynamic_xy_step_transposed_typ:10,dynamic_xy_step_typ:[6,10],dynamic_y_step_typ:[10,15],each:[0,2,7,8,10,13,15,16,24,28],earli:[10,28],easi:[24,28],easier:[6,10,28],easili:28,edg:[18,28],effect:[19,28],effici:[0,7,10,14,15,28,29],either:[6,7,8,10,14,24,28],element:[2,3,10,11,13,14,19,28],element_const_reference_typ:[2,13],element_recurs:2,element_reference_typ:[2,13],element_typ:2,els:[8,15],email:24,enabl:24,encod:24,end:[0,7,9,10,15,24,28,29],enough:[6,18],ensur:[10,28],entir:28,enumer:[6,24,28],epipolar:21,equal:[1,2,3,6,10,13,15,28],equal_pixel:10,equalitycompar:[1,2,4],equival:[2,6,10,14,15],error:[1,6,7,10,17,28],especi:6,essenti:0,establish:25,etc:[0,6,10,13,23,24,28],european:18,evalu:[12,14],even:[6,7,8,24,28,29],ever:7,everi:[5,6,10,14,15,25,28,29],everyth:8,exact:19,exactli:13,exampl:[1,2,3,4,6,8,10,11,12,13,14,15,17,19,24,25,28,29],except:[2,6,8,10,14,15,23,28],exclud:28,execut:[6,28],exercis:28,exist:[5,7,8,24,29],expect:24,expens:28,explan:[10,18,24],explicit:[6,13,28],explicitli:28,extend:[5,11,22,28],extending_gil__io_with_new_format:24,extens:[6,8,10,23,28,29],extern:24,extra:[7,10,13,28,29],extract:28,extrem:18,fact:[24,28],factori:[8,10,28],fail:28,fall:[7,10],fals:[8,12,15,28],familiar:28,far:28,fast:[10,15,28],faster:[1,5,9,15,28],fastest:7,featr:29,featur:[18,20,21,24,29],fetch:28,few:24,file:[6,8,23,24,28],file_nam:6,filenam:24,filesystem:24,fill:[2,7,10,13,15,24,28],fill_pixel:[7,10,24],fill_valu:9,filter:[15,20],find:[15,23],first:[0,1,2,3,6,7,8,10,13,15,21,24],first_argument_typ:10,firstbit:1,fit:13,five:[3,5,12],flat:19,flavour:24,flexibl:[1,6,12,29],flip:[10,14,28],flipped_left_right_view:10,flipped_up_down_view:10,float_on:1,float_zero:1,fly:14,focu:28,focus:28,folder:[19,22,24],follow:[0,1,2,3,5,6,7,9,10,12,13,15,16,18,24,25,27,28,29],for_each:[2,7,10,28],for_each_pixel:[7,10,28,29],for_each_pixel_posit:[10,28],form:[0,9,12,13,18,19,28],format:[13,23,28],format_tag:24,formattag:24,forward:14,forwardtraversalconcept:14,found:24,four:[15,28],fourth:7,frame:21,framework:24,frederik:18,free:[15,23,28],freeli:[7,10],frequent:15,friend:6,friendli:[15,28],from:[0,1,5,6,7,8,12,13,14,15,18,22,23,24,28,29],fulfil:4,full:[6,13],fulli:[8,24,28],fun:10,function_requir:13,fundament:[1,15,21],fundamental_step:14,further:17,furthermor:[24,28],futur:29,gap:10,gaussian:[18,19],gener:[0,2,4,6,7,9,10,11,14,16,18,19,25],generate_pixel:10,geometri:21,get:[1,6,8,10,12,14,18,19,28],get_color:[2,7,8,13],get_info:24,get_num_bit:27,get_num_it:28,get_pixel_typ:27,get_read_devic:24,get_reader_backend:24,gil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20,22,23,25,27,30],gil_function_requir:[2,7,10,28],github:23,give:[7,15,24],given:[0,2,6,8,9,10,12,13,14,15,17,18,28],glimps:28,global:28,goal:5,goe:28,going:15,good:[19,28],googl:21,gool:18,gradient:[18,19,22],grai:[7,8,18,27],graph:19,grate:17,gray16:24,gray16_image_t:[24,28],gray16_pixel_t:28,gray16_step_view_t:10,gray16c_view_t:28,gray1:[24,28],gray1_image_t:24,gray2:24,gray32s_pixel_t:28,gray32s_view_t:28,gray4:24,gray4_image_t:24,gray7:24,gray8:24,gray8_image_t:[6,24,28],gray8_pixel_t:[7,8,28,29],gray8_view_t:7,gray8c_loc_t:28,gray8c_view_t:28,gray8s_image_t:28,gray8s_pixel_t:28,gray8s_view_t:28,gray_alpha:24,gray_alpha_16:24,gray_alpha_8:24,gray_channel_t:7,gray_color_t:[7,8],gray_cs_t:7,gray_image_t:28,gray_layout_t:28,gray_pixel_t:28,gray_t:[3,7,8,12],gray_to_rgb:7,grayimage_histogram:[7,29],graypixel:7,grayscal:[7,8,10,12,14,15,28],grayview:[7,29],green:[7,10,13,17,29],green_t:[2,3,7,13],grid:28,group:[0,3],guarante:4,guid:[10,22,28],guidelin:24,gv8:7,half:28,half_x_differ:28,halfdiff_cast_channel:28,hand:[0,5,18,22,28,29],handl:28,happen:[6,18,28],hard:[12,24],hardli:28,harrismatrix:18,has:[2,5,6,7,9,10,12,14,15,24,28],has_typ:6,hasdynamicxsteptypeconcept:[14,15],hasdynamicysteptypeconcept:15,hassl:28,hastransposedtypeconcept:15,have:[0,1,2,3,5,6,7,8,9,10,12,13,14,15,18,24,27,28,29],hcb:2,header:[23,24,27],heidelberg:18,height:[6,7,9,10,28,29],help:19,helper:12,henc:6,here:[0,1,2,3,4,6,7,8,10,12,13,14,15,19,24,28],hessianmatrix:18,heterogen:[12,13,28],higher:8,hill:[18,19],his:24,hist:[7,29],histogram:22,hold:6,homogen:[2,13,14,28],homogeneous_color_bas:[2,14],homogeneouscolorbaseconcept:[2,13,14],homogeneouscolorbasevalueconcept:2,homogeneouspixel:13,homogeneouspixelbasedconcept:[12,13],homogeneouspixelconcept:13,homogeneouspixelvalueconcept:13,hopefulli:[24,27],horizont:[7,12,14,15,19,28],how:[1,3,6,7,8,10,12,13,14,18,24,28],howev:[2,10,28],hpp:[6,8,22,23,24,27,28],hsl:27,hsv:27,html:10,http:[10,23,30],ident:[7,8],identifi:6,ifstream:24,ignor:[13,28],illustr:[6,7,28],imag:[0,5,11,13,14,16,18,19,21,23,25,27,29],image_read_info:24,image_read_set:24,image_t:[6,24],image_typ:[8,12,27,28],image_view:[6,9,10,28],image_write_info:24,imageconcept:[6,7,9,12],imagemagick:24,imagetyp:6,imageviewconcept:[6,7,9,10,12,28],imageviewtyp:6,imagin:19,img:[6,7,9,10,15,24,28,29],img_view:8,immut:[6,9,10,12,14,15,25,28],impact:[10,28],implement:[1,2,6,8,10,13,14,15,17,18,23,24],impos:1,improv:[27,28],in1:28,in2:28,in_buff:24,inaccuraci:24,inc:14,includ:[4,6,23,24,27,28],incompat:[1,6,7,24,28],incomplet:24,incorrect:28,incorrectli:17,increas:10,increment:[14,15,28],independ:[15,24,28],index:[2,10,13,15,24,28,29],indexed_imag:27,indic:[1,12,15,19,25,28],indica:25,ineffici:6,info:24,inform:[1,15,24],inher:14,inherit:13,initi:[7,13,21,28],inlin:[6,8,28],inner:28,input:[10,19,28],insid:[6,7,8,10,15,16,28],instal:[22,24],instanc:[6,8,14,24,28],instanti:[6,10,15,28],instead:[1,2,9,28],instruct:28,instrument:5,int_:2,integ:[1,7,10,15,24,28],integr:[1,3,12,14,25,28],intel:15,intens:[1,18,19],interest:18,interfac:[6,15],interleav:[0,6,7,8,9,10,12,13,14,15,25,28,29],interleaved_ptr:22,interleaved_ref:22,interleaved_view:[10,24,28],intermedi:7,intern:[14,18,29],internet:8,interpret:[3,10],introduc:24,invari:18,invert:8,invert_pixel:17,invok:[2,6,7,8,10,12,14,15,28],involv:28,ios:24,ios_bas:24,is_1d_travers:[10,15],is_bit_align:27,is_homogen:27,is_iterator_adaptor:14,is_mut:[1,8,13,14,28],is_pixel:13,is_planar:[12,13],is_sam:[6,7,13],is_similar:27,ismut:12,isplanar:[9,12],isstep:12,isstepx:12,issu:[17,28,29],isxstep:12,isystep:12,iter:[1,2,5,7,8,9,10,11,13,17,22,25,29],iterator_adaptor_get_bas:14,iterator_adaptor_rebind:14,iterator_from_2d:[10,15],iterator_is_mut:14,iterator_t:24,iterator_trait:[13,17,28],iterator_typ:12,iterator_type_from_pixel:12,iteratoradaptorconcept:14,its:[1,3,6,7,9,12,13,14,15,27,28],itself:[7,13],jiri:18,journal:18,jpeg:[8,28],jpeg_dynamic_io:[6,28],jpeg_lib:24,jpeg_read_imag:[6,7,28],jpeg_tag:24,jpeg_wiki:24,jpeg_write_view:[6,7,28],jpg:[7,24,28],just:[7,8,9,12,13,15,24,27,28],kadir:18,keep:[0,14,28],kei:18,kernel:[7,20],kind:24,know:24,krystian:18,kth_element_const_reference_typ:2,kth_element_reference_typ:2,kth_element_typ:[2,13],kth_semantic_element_const_reference_typ:2,kth_semantic_element_reference_typ:2,kth_semantic_element_typ:[2,13],lab:27,lack:[24,28],laid:7,lambda:[7,29],larg:[6,24],larger:7,largest:[6,7],last:[10,13,24,28],lastli:17,later:[2,15],latest:23,latter:[7,13],layout:[2,5,11,12,13,14,22,25,28],layout_t:2,least:[6,28],leav:28,lectur:22,left:[7,10,14,15,24,28,29],let:[8,18,19,28,29],level:[1,6,24,28],lib:24,libjpeg:[23,24],libpng:[23,24],librari:[0,5,8,10,11,20,23,24,27,29],libraw:24,libtiff:24,lightweight:[7,10,15,28],like:[0,6,7,8,12,13,14,18,19,23,24,28],limit:[5,6],line:28,linear:[1,6],linearli:[1,28],link:[23,24,30],list:[11,20,24],littl:[13,19],live:8,load:[6,28],loc2:15,loc:15,local:24,locat:[5,8,9,10,11,12,13,14,16,22,25],locator_t:28,locator_typ:12,look:[8,18,19,24,28],loop:[10,15,28],lossi:[1,13],lot:[24,28],lower:24,lubomir:30,luc:18,lumin:19,luminos:[7,28,29],luminosity8bit_hist:29,luminosity_hist:29,luminosity_histogram:7,macro:[24,29],made:27,magnitud:28,mai:[0,1,3,4,6,7,8,10,13,14,15,28],main:27,maintain:[27,28],make:[0,6,7,8,10,15,24,28],make_scanline_read:24,make_step_iter:14,mandel:28,mandel_grad:28,mandelbrot:[8,14,15,22,28],mandelbrot_fn:28,mani:[5,6,9,10,24,28],manipul:5,manual:24,map:[1,3,7,13],margin:7,mark:0,mata:18,match:[1,10,17,24,28],matric:[18,19],matrix:[18,19],matter:18,max:1,max_el:2,max_valu:1,maximum:1,mayb:17,mean:[6,7,9,15,19,23,28],meant:24,measur:[6,15,28],mechan:[6,8,15,28],median:19,member:[8,14,17,24],memmov:[7,10],memori:[0,2,3,7,13,14,15,28,29],memory_based_2d_loc:15,memory_based_step_iter:[14,15],memorybasediteratorconcept:[14,15],memunit:[14,15],memunit_adv:14,memunit_advanc:14,memunit_advanced_ref:14,memunit_dist:14,memunit_step:14,mention:24,meta:28,metafunct:[2,4,10,11,13,14,15,16,22,27,28],metaprogram:24,method:[7,8,10,14,15,28],might:[18,19,24,28],mike:18,mikolajczyk:18,mileston:24,min:1,min_el:2,min_valu:1,mind:5,minimum:1,minisblack:24,minor:5,miss:28,mitig:28,mix:7,mode:[24,28],model:[0,4,5,6,7,8,12,17,28],modern:[24,28],modifi:[10,13,14,16,28],modul:[6,8],moment:18,monkei:7,monkey_transform:7,mono:24,moravec:18,more:[1,2,4,6,7,8,9,10,12,13,14,15,24,28],most:[2,4,8,9,10,13,15,16,23,24,28],motiv:1,move:[10,15,18,24,28],move_in:6,mpl:[2,3,6,12,13,14,24,28],much:28,multi:24,multipl:[7,10,15,28],multipli:[1,14,28],must:[2,4,10,13,14,15,17,28],mutabl:[1,9,10,12,13,14,15,17,25,28],mutable_forwarditeratorconcept:14,mutablechannelconcept:1,mutablecolorbaseconcept:[2,13],mutablehomogeneouscolorbaseconcept:[2,13],mutablehomogeneouspixelconcept:[7,13],mutableimageviewconcept:[9,10,28],mutableiteratoradaptorconcept:14,mutablepixelconcept:[7,13,17],mutablepixeliteratorconcept:14,mutablepixellocatorconcept:[10,15],mutablerandomaccess2dimageviewconcept:10,mutablerandomaccess2dlocatorconcept:15,mutablerandomaccessiteratorconcept:14,mutablerandomaccessndimageviewconcept:[9,10],mutablerandomaccessndlocatorconcept:15,mutablestepiteratorconcept:[14,15],my_any_image_t:6,my_color_convert:8,my_color_converter_impl:8,my_images_t:6,my_img_typ:[24,28],my_reference_proxi:17,my_valu:17,my_view:7,my_virt_view_t:28,myimg:6,myit:17,n2081:4,name:[6,7,13,15,19,22,28,29],namespac:[2,6,17,24,27,28],nativ:[1,28],natur:15,navig:[10,14,15],necessari:[14,15,17,24,28],need:[1,4,7,8,10,12,13,14,15,24,27,28],neg:14,negat:10,neighbor:[15,28],neighborhood:15,neighbour:10,nest:[10,28],never:[7,28],new_dim:9,next:[8,10,24,28,29],nice:28,noisi:18,non:[6,7,10,12,13,15,17,24,25,28],none:[24,28],normal:28,note:[0,1,2,6,7,9,10,13,18,24,28],noth:13,notic:[2,7,18,28],notion:28,now:[18,24,28],nth_channel_deref_fn:14,nth_channel_view:[7,10,28,29],nth_channel_view_typ:10,nth_channel_x_gradi:28,num_channel:[6,10,12,13,28],num_dimens:[10,15,16],number:[2,6,7,10,13,14,15,18,28],numbit:1,numer:[10,18,22],numeric_limit:1,obj:6,object:[6,8,10,12,14,15,17,24,25,28,29],obtain:[15,28],occupi:13,off:28,offer:15,offset:[1,14,15,28],ofstream:24,often:[3,6,13,28],onc:[0,5,10,28],one:[2,4,6,7,8,10,12,13,14,15,19,24,28],ones:[6,8,13,18],onli:[1,2,6,7,8,10,13,14,15,17,18,23,24,27,28,29],onlin:24,open:6,oper:[1,2,4,6,8,9,10,13,14,15,16,17,22,24,25,28,29],oppos:[7,10,12,25,28],optim:[5,7,10,15,28],option:[0,8,18,22,24,28],order:[0,2,3,6,7,10,12,13,15,18,23,25,28,29],organ:[12,13,15,25],origin:[6,10,28,30],other:[2,4,8,13,14,15,18,19,24,25,28,29],otherwis:[8,13],our:[6,7,8,28],out:[24,28],out_buff:24,outdoor:18,output:28,outsid:28,over:[1,9,10,13,14,18,25,28],overhead:[6,28],overlai:18,overload:[6,10,17,28],overrid:[7,8,15],overview:[20,22],own:[4,8,9,10,15,22,24,28],ownership:[9,28],pack:[9,13,14,28],packed_channel_refer:1,packed_channel_valu:1,packed_dynamic_channel_refer:1,packed_image1_typ:12,packed_image2_typ:12,packed_image3_typ:12,packed_image4_typ:12,packed_image5_typ:12,packed_image_typ:12,packed_pixel:[2,13,14,22],packed_pixel_typ:13,pad:[0,7,9,15],page:24,pair:[2,13,28],pairwis:[1,10,13],palett:24,paper:[4,18],paramet:[0,1,5,6,7,8,9,10,14,15,17,24,28],parent:17,parent_t:6,part:[24,29],partial:24,particular:[6,18,28],pass:[6,8,10,28],past:10,patch:18,path:[6,24],pattern:[1,7,12,28],peopl:27,per:[6,10,14,15,28],percent:24,perform:[6,8,10,14,15,22,28],perhap:6,permut:2,physic:[1,2,3,7,13],pick:24,pipe:28,pix_buff:13,pix_it:13,pixel1:13,pixel2:13,pixel:[0,1,2,3,4,5,6,8,9,11,16,17,19,22,25,29],pixel_2d_locator_bas:15,pixel_bit_s:27,pixel_refer:12,pixel_reference_typ:12,pixel_value_typ:12,pixelbasedconcept:[12,13,14,28],pixelconcept:[4,7,8,10,12,13,14,15],pixelconvertibleconcept:13,pixeldata:14,pixeldereferenceadaptorconcept:[8,10,14,15,28],pixeliteratorconcept:[10,12,14,15],pixellocatorconcept:[10,15],pixelrefer:12,pixelscompatibleconcept:[10,13],pixelvalueconcept:[8,9,10,13,14,15],place:28,plain:14,planar:[0,2,6,7,9,10,12,13,14,15,17,24,25,28,29],planar_pixel_iter:[14,15],planar_pixel_refer:[13,17],planar_rgb_view:[10,28],plane:[0,7,10,19,28],platform:[15,22],pleas:[18,24],plot:19,plu:15,png_lib:24,png_test_fil:24,png_wiki:24,pnm_wiki:24,point2dconcept:[15,16],point:[0,1,6,10,11,12,13,15,18,22,24,25,28],point_t:[6,9,10,15,24,28],point_typ:10,pointer:[1,7,8,10,13,14,15,24,25,28],pointndconcept:[10,15,16],polici:[0,10,29],popular:23,posit:[14,15,28],position_iter:14,possibl:[6,10,13,24,28],potenti:[0,24],pow:28,power:[6,7,18,28],practic:[6,28],pre:28,precis:1,prefix:2,presenc:0,present:[28,29,30],pretend:14,previou:[0,6],previous:[10,28],price:12,privat:[8,10,15,24,28],probabl:24,problem:[12,17,28],process:[0,10,21,22,28],processor:28,produc:19,product:[28,29],profil:8,program:[4,24,28,29],project:[0,21,23],propag:[10,28],proper:28,properli:[1,2,7,8,24,28],properti:[12,13,22,28],propos:4,provid:[0,1,2,3,5,6,8,9,10,12,13,14,15,16,17,19,24,27,28,29],proxi:[1,2,13],ptr:7,ptrdiff_t:[6,10,14,15,28],pull:14,purpos:13,put:[19,28],quadrant:29,qualifi:17,qualiti:[8,24],queri:28,r565:13,rais:28,random:[3,6,14,15,28],randomaccess2dimageconcept:9,randomaccess2dimageviewconcept:10,randomaccess2dlocatorconcept:15,randomaccessndimageconcept:9,randomaccessndimageviewconcept:10,randomaccessndlocatorconcept:[10,15],randomaccesstraversalconcept:[10,14,15],randomaccesstraversaliteratorconcept:14,rang:[1,2,9,10,28],range_c:3,rare:[9,28],rather:24,raw:[5,15,28],raw_wiki:24,rbegin:10,rbg323:24,rdbuf:24,read:[0,8,10,12,13,14,15,28],read_and_convert_imag:24,read_and_convert_view:24,read_imag:24,read_image_info:24,read_view:24,read_xxx:24,reader:[24,28],reader_bas:24,reader_t:24,real:[17,28],realiz:28,rebind:14,recommend:[0,24],recreat:[6,7,9],rectangular:[10,28],recurs:[2,14,28],red:[0,1,2,7,13,14,17],red_in_cmyk16:13,red_in_rgb8:13,red_t:[2,3,13],redefin:8,ref2:7,ref:[7,13],refer:[1,2,7,8,10,12,13,14,15,18,22,24,25,28],refin:16,regardless:28,region:[20,22,28],regist:28,regular:[1,2,4,9,10,13,15,16],rel:[15,28],relat:[4,12,28],releas:21,relev:24,remain:8,rememb:[15,17],remov:[24,28,29],remove_refer:14,rend:10,repeat:15,replac:12,repres:[0,6,15,17,24,28],represent:[0,5,22,28],request:24,requir:[1,2,4,6,8,9,10,13,14,15,22,23,24,28],resampl:10,rescal:22,resembl:[6,10],resid:28,resiz:[10,22],resolut:[5,6],respect:[7,13,28],respons:18,rest:[12,28],restrict:24,result:[0,2,5,6,7,8,10,12,13,14,15,18,24,28],result_typ:[4,6,8,10,14,28],reus:28,reverse_iter:10,review:[24,27],rewrit:28,rewritten:29,rgb16:24,rgb16_image_t:[10,28],rgb16c_planar_view_t:28,rgb16s_pixel_t:28,rgb16s_view_t:28,rgb222:28,rgb32f_planar_step_ptr_t:[12,25],rgb32f_planar_view_t:7,rgb32fc_view_t:28,rgb32s_pixel_t:28,rgb32s_view_t:28,rgb565:13,rgb565_channel0_t:13,rgb565_channel1_t:13,rgb565_channel2_t:13,rgb565_pixel_t:13,rgb64_image_t:8,rgb64_pixel:8,rgb64_pixel_ptr_t:8,rgb64_pixel_t:8,rgb8:[13,24],rgb8_image_t:[6,24,28],rgb8_pixel_t:[7,13,28],rgb8_planar_ptr_t:14,rgb8_planar_ref_t:[7,13],rgb8_planar_view_t:12,rgb8_ptr_t:10,rgb8_step_view_t:6,rgb8_view_t:[6,7],rgb8c_planar_ptr_t:[7,14],rgb8c_planar_ref_t:[7,13],rgb8c_ptr_t:10,rgb8c_view_t:[6,28],rgb:[0,1,2,7,8,10,12,13,14,24,25,28,29],rgb_channel_t:7,rgb_cs_t:7,rgb_full:13,rgb_layout_t:[7,8,13],rgb_planar_pixel_iter:17,rgb_t:[3,7,13,14],rgba16:24,rgba8:24,rgba8_image_t:24,rgba:[0,3,12,25,27],rgba_image_t:24,rgba_layout_t:[3,7],rgba_t:3,rgbpixel:7,rgbtograi:29,right:[7,10,14,15,28],rise:15,rotat:[6,10,28],rotated180_view:[6,7,10],rotated180_view_fn:6,rotated90ccw_view:[10,28],rotated90cw_view:[10,28],row:[0,7,9,10,13,14,15,24,28,29],row_begin:[10,28],row_end:10,rowsiz:10,rpv32:7,rule:23,run:[0,1,5,6,7,10,21,22],runtim:6,runtime_imag:[24,28],rview:10,said:6,sake:10,same:[1,2,3,6,7,8,10,13,15,16,18,19,24,28],sametyp:[1,2,4,10,13,14,16],sampl:[15,22,24,28,29],satisfi:[2,4,9,10,15,28],sav:6,save:[6,24,28],save_180rot:6,scale:28,scanlin:24,scanline_read:24,scanline_read_iter:24,scenario:[2,28],schaffalitzki:18,scharr:19,scharrx:19,schmid:18,scoped_channel_valu:1,sean:17,second:[0,1,7,13,15,17,18,24,28,29],second_argument_typ:10,section:[0,2,10,11,20,24,27],see:[2,4,8,10,14,15,24,28],seek:24,select:6,semant:[2,3,13,28],semantic_at_c:[2,7,13],send:24,separ:[0,8,10,18,28],sequenc:[1,3,6],serv:24,set:[0,1,3,4,6,7,8,9,10,13,14,15,24,28],set_step:14,sever:[5,6,14,24,28],shallow:[6,7,10,14,17,28],shape:19,share:[6,13,24],sharper:19,she:24,shift:1,shortli:29,should:[6,15,18,23,24,28],show:[7,24,28],shown:[7,28],side:28,sigma:19,sign:[12,25,28],signific:10,similar:[1,6,10,14,15,22,24,28],similarli:[9,14],simpl:[12,15,19,24,28,29],simpler:[18,24,29],simplest:[19,28],simpli:[7,8,15,18,19,28],simplic:28,simplifi:[7,18,28],simultan:28,sinc:[6,7,13,14,24,27,28,29],singl:[6,10,14,19,24,28],size1:12,size2:12,size3:12,size4:12,size5:12,size:[2,3,6,7,10,13,14,15,24,28],size_t:[2,6,9,10,13,15,16],size_typ:[6,10],sizeof:13,skeleton:24,skip:[10,14,28,29],slightli:[8,28],slow:28,slower:[15,28],small:[18,24,27],smaller:7,sobel:19,softwar:29,solut:17,some:[0,4,6,7,8,10,12,13,14,15,17,24,28],sometim:[1,10,13,14,15,17,24,28],somewher:8,soon:24,sort:19,sourc:[1,6,7,8,10,24,25,28,29,30],space:[0,2,5,6,7,10,11,13,14,22,24,27,28,29],special:[8,13,25,28],specif:[0,5,22,24,28],specifi:[0,1,3,5,6,8,9,12,14,22,24],speed:[0,5,6,10,28],spirit:[6,15],springer:18,sr8wjg0pcee:30,src1:10,src1_it:28,src2:10,src2_it:28,src:[1,2,6,7,8,10,24,28],src_b:28,src_g:28,src_it:28,src_loc:28,src_pix_ref:8,src_pixel:28,src_r:28,src_row_byt:28,srcchannel:1,srccolorspac:8,srcconstrefp:8,srcp:8,srcpixel:13,srcview:[7,8,10,28],srowbyt:29,stabl:18,stage:10,standalon:27,standard:[3,4,10,12,14,15],start:[10,13,15,24,28],state:10,statement:[6,28],static_:2,static_assert:[6,7,12,13],static_copi:2,static_equ:2,static_fil:[2,7,28],static_for_each:[2,28],static_gener:[2,28],static_max:2,static_min:2,static_transform:[2,14,28],std:[1,2,6,7,9,10,12,13,14,15,17,24,28,29],step1:7,step2:7,step3:7,step4:7,step5:7,step:[6,10,12,15,20,25,28],step_iterator_t:12,stepanov:17,stephen:18,stepiter:15,stepiteratorconcept:[14,15],still:28,stl:[2,5,6,9,15,17],stlab:10,store:[6,7,15,24,28],straightforward:[10,24],stream:24,strength:19,stretch:19,string:[6,24],stringstream:24,strip:24,strongli:24,struct:[1,2,3,6,8,10,12,13,14,15,16,17,24,28],structur:[0,6,10,11,18,20,22,28],studio:28,sub:[1,17,24,27],subclass:[6,14,15],subimag:28,subimage_view:[7,10,24,28,29],subject:24,suboptim:28,subsampl:[10,14,28],subsampled_view:[7,10,28,29],substitut:4,succinct:10,suffici:[15,23],suffix:25,suggest:[17,27],suit:24,suitabl:28,sum:18,summer:21,suppli:[8,10,14,15,24],support:[0,1,6,7,8,10,12,14,22,28,29],supported_image_format:24,suppos:[6,7,8,28],sure:24,swap:[4,6,15,17],swappabl:[1,2,4,6],symmetr:13,synopsi:[6,10,15],syntact:4,syntax:4,synthet:[8,22,28],system:[24,28],tabl:[11,20,24],tag:[24,25],tag_t:24,take:[2,6,7,8,9,10,14,15,17,24,28,29],taken:28,targa_wiki:24,target:[5,24,28],task:28,technic:[11,22],techniqu:[6,24],tell:23,templat:[1,2,3,4,6,7,8,9,10,12,13,14,15,16,17,24,28,29],temporari:[17,28],term:[16,18],test:[22,25],test_imag:24,text:24,than:[2,6,7,13,14,15,24,28],thank:[24,27],thei:[1,2,3,5,6,7,8,10,12,13,14,15,18,19,28],them:[1,4,6,9,10,12,13,24,28],therefor:1,thi:[0,1,2,4,6,7,8,10,12,13,14,15,17,18,19,24,25,27,28,29,30],thing:[7,19,24],think:28,third:24,thorough:24,those:[13,19],though:[6,7,19,28],three:[1,13,14,18,19,28],threshold:18,through:[7,15,24,28],thrown:28,thu:[1,2,3,8,15],tif:24,tiff_base_tag:24,tiff_extension_tag:24,tiff_graphicsmagick_test_fil:24,tiff_lib:24,tiff_lib_tiff_test_fil:24,tiff_t:24,tiff_tag:24,tiff_wiki:24,tile:24,time:[0,1,2,5,6,7,8,10,14,22],timor:18,tinn:18,tmp:[14,17],todo:26,togeth:[0,3,13,28],toll:[6,28],too:27,toolbox:[22,24],top:[0,7,10,12,15,24,28,29],top_left:10,total:[10,15],trace:18,track:[10,14,28],transform:[1,2,6,8,10,18,22],transform_pixel:[10,28],transform_pixel_posit:[10,28],transpos:[10,15,28],transposed_typ:[10,15],transposed_view:10,travers:[9,10,14,15,24,25,28],treat:[6,28],tricki:17,trickier:28,trigger:[6,28],trivial:25,troubl:24,true_:[12,14],turn:6,tutori:[8,10,15,22],tuytelaar:18,tweak:19,twice:28,two:[0,1,2,3,6,7,9,10,13,14,15,16,18,19,21,24,28],type:[0,1,2,3,4,5,6,7,9,10,13,14,15,16,17,22,24,27,28,29],type_from_x_iter:12,typedef:[1,6,7,8,10,12,13,14,17,24,28],typenam:[1,2,3,4,6,7,8,9,10,12,13,14,15,16,17,24,28,29],types1:6,types2:6,types_t:6,typic:[1,6,8,10],ud_fud:10,uint16_t:[1,13],uint8_t:[1,18,29],unari:[14,28],unary_compos:14,unary_funct:14,unaryfunctionconcept:[10,14],unchang:28,unclear:15,under:[18,24],underli:[6,10,14,24],understand:[1,18,19,24],unfamiliar:28,unfortun:28,uniformli:6,uninitialized_copi:10,uninitialized_copy_pixel:10,uninitialized_fil:10,uninitialized_fill_pixel:10,uniqu:[3,6],unit:[14,15,24],unless:19,unlik:[9,13],unnam:3,unnecessari:[7,13,28],unpack:13,unrel:29,unrol:28,unset:10,unsign:[6,7,9,10,12,13,14,25,28],unspecifi:4,until:18,unus:[13,28],unusu:28,uop:6,upon:[6,8,10,12,14,15,17],upper:29,upsid:[6,10],usag:[19,24],use:[1,2,4,7,8,10,12,13,15,17,19,23,24,28],use_default:12,used:[2,3,4,5,6,7,9,13,14,15,16,18,19,24,25,28],useful:[8,9,14,15,28],user:[0,4,8,10,15,24,27,28],uses:[2,6,10,12,14,15,16,24,28],using:[1,2,3,6,7,8,9,10,12,13,15,22,24,28,29],using_io:24,usual:[14,18,19,24],val:10,valid:[1,10,28],valu:[0,1,2,3,6,7,8,9,10,12,13,14,15,16,17,18,19,24,25,28],value_typ:[1,8,9,10,13,14,15,16,24,28],van:18,vari:[0,3,28],variabl:[0,28,29],variant:[6,24,28],variat:[0,24],varieti:[22,28],variou:24,vector2:6,vector3_c:13,vector4:3,vector4_c:3,vector:[6,24,28],veri:[9,12,18,28,29],version:[10,14,15,23,24,29],vertic:[12,14,15,19,28],via:[6,10],video:[0,22,28],view1:10,view2:10,view:[5,9,11,13,14,15,22,24,25,29],view_is_mut:12,view_t:[6,7,9,10,12,24],view_typ:12,view_type_from_pixel:12,viewer:24,viewscompatibleconcept:[7,10],viewtyp:6,virtual:[5,6,8,12,14,15,24],virtual_2d_loc:[15,28],vision:[0,18],visit:[10,15],visual:28,vol:18,wai:[2,6,13,17,19,24,25,28],walk:[24,28],want:[7,8,14,15,24,28],warn:28,watch:30,web:4,websit:24,weight:[18,20],well:[2,13,24,28],were:[21,28],what:[6,19,20,24,28],when:[2,7,8,9,10,14,15,17,18,19,24,28],where:[1,2,7,9,10,12,13,14,15,16,23,24,25,28],wherea:[0,2,6,19,24,28],whether:[1,10,12,14,15,28],which:[0,1,2,3,6,7,8,9,10,12,14,15,16,19,23,24,25,27,28],who:27,whose:[0,2,10,12,13,14,22,28],why:28,width:[6,7,9,10,15,28,29],window:[18,24],within:10,without:18,word:[0,9,10,14,19,28],work:[0,5,6,7,8,10,13,17,18,22,28,29],worth:[7,24,28],would:[0,6,14,19,24,28],wrap:[6,10,14],wrapper:[14,15],write:[0,5,6,7,10,17,22,28],write_view:24,writer:24,written:[15,19,24,28,29],wstring:24,www:30,x_at:[10,15],x_coord_t:[6,9,10,15],x_diff:15,x_gradient:[22,28],x_gradient_obj:28,x_gradient_rgb_luminos:28,x_gradient_unguard:28,x_iter:[9,10,13,15,24,28],x_luminosity_gradi:28,x_min:28,xbm:24,xgradientgray16_gray32:28,xgradientplanarrgb8_rgb32:28,xgradientrgb8_bgr16:28,xiter:[12,15],xpm:24,xxx:24,xxx_all:24,xxx_and_convert_xxx:24,xxx_read:24,xxx_tag:24,xxx_write:24,xy_at:[10,15,28],xy_loc:[10,28],xy_locator_t:12,xyz:27,y_at:[10,15],y_coord_t:[6,9,10,15],y_distance_to:15,y_gradient:28,y_iter:[10,15,28],y_min:28,ycbcr:24,ycck:24,yellow:18,yet:[0,24,28],you:[7,8,12,17,24,28],your:[8,17,22,23,24,28],yourself:24,youtub:30,zero:[13,18,28],zisserman:18,zlib:24},titles:["Basics","Channel","Color Base","Color Space and Layout","Concepts","Conclusions","Dynamic images and image views","Examples","Extending","Image","Image View","Design Guide","Metafunctions","Pixel","Pixel Iterator","Pixel Locator","Point","Technicalities","Affine region detectors","Basics","Image Processing","Overview","Boost Generic Image Library","Installation","IO extensions","Naming Conventions","Numeric extension","ToolBox extension","Tutorial: Image Gradient","Tutorial: Histogram","Tutorial: Video Lecture"],titleterms:{"new":[8,24],And:24,Using:[7,24,28],acknowledg:27,adaptor:14,affin:18,algorithm:[1,2,10,13,18,28],align:12,avail:18,base:[2,12],basic:[0,19],being:18,bit:12,bmp:24,boost:22,buffer:24,canva:7,channel:[1,8],code:28,color:[2,3,8,28],compat:5,compil:24,compon:12,concept:4,conclus:[5,28],concret:25,convent:25,convers:[8,28],convolut:19,core:22,creat:[10,17,28],curvatur:19,defin:8,derefer:14,deriv:[12,19],design:11,detect:18,detector:18,document:22,dynam:6,equival:28,exampl:[7,22],exist:12,extend:[8,24],extens:[5,22,24,26,27],filter:19,first:28,flexibl:5,folder:27,format:24,from:10,fundament:14,gener:[5,22,24,28],gil:[24,28,29],glue:28,gradient:28,guid:11,harri:18,hessian:18,histogram:[7,29],homogen:12,imag:[6,7,8,9,10,12,15,20,22,24,28],implement:[28,29],instal:23,interfac:[24,28],iter:[12,14,15,28],jpeg:24,kernel:19,layout:3,lectur:30,level:7,librari:22,locat:[15,28],manipul:12,memori:[12,24],metafunct:12,model:[1,2,3,9,10,13,14,15,16],name:25,numer:26,oper:7,origin:29,other:10,over:15,overload:8,overview:[1,2,3,8,9,10,12,13,14,15,16,21,24,26,27],pack:12,perform:5,pixel:[7,10,12,13,14,15,28],platform:24,png:24,pnm:24,point:16,process:20,proxi:17,quickstart:22,raw:[10,24],read:24,refer:[17,27],region:18,resiz:7,run:[24,28],space:[3,8],specifi:28,step:[14,18],stl:[10,28],structur:27,style:10,support:24,symbol:24,targa:24,technic:17,test:24,tiff:24,time:28,toolbox:27,trait:12,transform:28,tutori:[24,28,29,30],type:[8,12,25],version:28,video:30,view:[6,7,8,10,12,28],virtual:28,weight:19,what:18,write:24}}) \ No newline at end of file diff --git a/html/toolbox.html b/html/toolbox.html index 06eebbbf1..2d757c26c 100644 --- a/html/toolbox.html +++ b/html/toolbox.html @@ -128,8 +128,8 @@ made suggestions for improvements.

    \ No newline at end of file diff --git a/html/tutorial/gradient.html b/html/tutorial/gradient.html index e85d8572a..54e6b6ce0 100644 --- a/html/tutorial/gradient.html +++ b/html/tutorial/gradient.html @@ -953,8 +953,8 @@ code with different compilers.

    \ No newline at end of file diff --git a/html/tutorial/histogram.html b/html/tutorial/histogram.html index 1120e37fc..6d4acb400 100644 --- a/html/tutorial/histogram.html +++ b/html/tutorial/histogram.html @@ -171,8 +171,8 @@ memory is allocated and no images are copied.

    \ No newline at end of file diff --git a/html/tutorial/video.html b/html/tutorial/video.html index 20a249721..839b602bc 100644 --- a/html/tutorial/video.html +++ b/html/tutorial/video.html @@ -82,8 +82,8 @@ \ No newline at end of file