Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ before_build:
- git submodule --quiet update --init libs/algorithm
- git submodule --quiet update --init libs/array
- git submodule --quiet update --init libs/assert
- git submodule --quiet update --init libs/bind
- git submodule --quiet update --init libs/concept_check
- git submodule --quiet update --init libs/config
- git submodule --quiet update --init libs/core
Expand All @@ -91,14 +90,14 @@ before_build:
- git submodule --quiet update --init libs/function
- git submodule --quiet update --init libs/integer
- git submodule --quiet update --init libs/iterator
- git submodule --quiet update --init libs/lambda
- git submodule --quiet update --init libs/mpl
- git submodule --quiet update --init libs/numeric/conversion
- git submodule --quiet update --init libs/preprocessor
- git submodule --quiet update --init libs/test
- git submodule --quiet update --init libs/type_traits
## Transitive
- git submodule --quiet update --init libs/atomic
- git submodule --quiet update --init libs/bind
- git submodule --quiet update --init libs/chrono
- git submodule --quiet update --init libs/container
- git submodule --quiet update --init libs/container_hash
Expand All @@ -109,6 +108,7 @@ before_build:
- git submodule --quiet update --init libs/fusion
- git submodule --quiet update --init libs/intrusive
- git submodule --quiet update --init libs/io
- git submodule --quiet update --init libs/lambda
- git submodule --quiet update --init libs/math
- git submodule --quiet update --init libs/move
- git submodule --quiet update --init libs/optional
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ install:
- git submodule --quiet update --init libs/algorithm
- git submodule --quiet update --init libs/assert
- git submodule --quiet update --init libs/array
- git submodule --quiet update --init libs/bind
- git submodule --quiet update --init libs/concept_check
- git submodule --quiet update --init libs/config
- git submodule --quiet update --init libs/core
Expand All @@ -210,14 +209,14 @@ install:
- git submodule --quiet update --init libs/function
- git submodule --quiet update --init libs/integer
- git submodule --quiet update --init libs/iterator
- git submodule --quiet update --init libs/lambda
- git submodule --quiet update --init libs/mpl
- git submodule --quiet update --init libs/numeric/conversion
- git submodule --quiet update --init libs/preprocessor
- git submodule --quiet update --init libs/test
- git submodule --quiet update --init libs/type_traits
## Transitive
- git submodule --quiet update --init libs/atomic
- git submodule --quiet update --init libs/bind
- git submodule --quiet update --init libs/chrono
- git submodule --quiet update --init libs/container
- git submodule --quiet update --init libs/container_hash
Expand All @@ -228,6 +227,7 @@ install:
- git submodule --quiet update --init libs/fusion
- git submodule --quiet update --init libs/intrusive
- git submodule --quiet update --init libs/io
- git submodule --quiet update --init libs/lambda
- git submodule --quiet update --init libs/math
- git submodule --quiet update --init libs/move
- git submodule --quiet update --init libs/optional
Expand Down
11 changes: 8 additions & 3 deletions example/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
using namespace boost::gil;

template <typename GrayView, typename R>
void gray_image_hist(const GrayView& img_view, R& hist) {
// for_each_pixel(img_view,++lambda::var(hist)[lambda::_1]);
for (typename GrayView::iterator it=img_view.begin(); it!=img_view.end(); ++it)
void gray_image_hist(GrayView const& img_view, R& hist)
{
for (auto it = img_view.begin(); it != img_view.end(); ++it)
++hist[*it];

// Alternatively, prefer the algorithm with lambda
// for_each_pixel(img_view, [&hist](gray8_pixel_t const& pixel) {
// ++hist[pixel];
// });
}

template <typename V, typename R>
Expand Down
8 changes: 4 additions & 4 deletions include/boost/gil/extension/dynamic_image/reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,11 @@ namespace detail {
//resize_clobber_image_fnobj
//image_default_construct_fnobj
//fill_converted_pixels_fn
//bind(gil::detail::copy_pixels_fn(), _1, dst)
//bind(gil::detail::copy_pixels_fn(), src,_1)
//std::bind(gil::detail::copy_pixels_fn(), std::placeholders::_1, dst)
//std::bind(gil::detail::copy_pixels_fn(), src, std::placeholders::_1)

//bind(detail::copy_and_convert_pixels_fn(), _1, dst)
//bind(detail::copy_and_convert_pixels_fn(), src, _1)
//std::bind(detail::copy_and_convert_pixels_fn(), std::placeholders::_1, dst)
//std::bind(detail::copy_and_convert_pixels_fn(), src, std::placeholders::_1)
//gil::detail::fill_pixels_fn<Value>(val)

//detail::copy_construct_in_place_fn<base_t>
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/extension/dynamic_image/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <boost/gil/utilities.hpp>

#include <boost/bind.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/fold.hpp>
Expand Down
21 changes: 15 additions & 6 deletions include/boost/gil/extension/numeric/resample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <boost/gil/extension/numeric/affine.hpp>
#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>

#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <algorithm>
#include <functional>

namespace boost { namespace gil {

Expand Down Expand Up @@ -71,16 +71,25 @@ namespace detail {
/// If invoked on incompatible views, throws std::bad_cast()
/// \ingroup ImageAlgorithms
template <typename Sampler, typename Types1, typename V2, typename MapFn>
void resample_pixels(const any_image_view<Types1>& src, const V2& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) {
apply_operation(src,bind(detail::resample_pixels_fn<Sampler,MapFn>(dst_to_src,sampler), _1, dst));
void resample_pixels(const any_image_view<Types1>& src, const V2& dst, const MapFn& dst_to_src, Sampler sampler=Sampler())
{
apply_operation(src, std::bind(
detail::resample_pixels_fn<Sampler, MapFn>(dst_to_src, sampler),
std::placeholders::_1,
dst));
}

/// \brief resample_pixels when the destination is run-time specified
/// If invoked on incompatible views, throws std::bad_cast()
/// \ingroup ImageAlgorithms
template <typename Sampler, typename V1, typename Types2, typename MapFn>
void resample_pixels(const V1& src, const any_image_view<Types2>& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) {
apply_operation(dst,bind(detail::resample_pixels_fn<Sampler,MapFn>(dst_to_src,sampler), src, _1));
void resample_pixels(const V1& src, const any_image_view<Types2>& dst, const MapFn& dst_to_src, Sampler sampler=Sampler())
{
using namespace std::placeholders;
apply_operation(dst, std::bind(
detail::resample_pixels_fn<Sampler, MapFn>(dst_to_src, sampler),
src,
std::placeholders::_1));
}

/// \brief resample_pixels when both the source and the destination are run-time specified
Expand Down
1 change: 0 additions & 1 deletion include/boost/gil/io/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <boost/gil/io/error.hpp>
#include <boost/gil/io/typedefs.hpp>

#include <boost/bind.hpp>
#include <boost/type_traits/is_base_of.hpp>

#include <istream>
Expand Down
13 changes: 8 additions & 5 deletions test/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#include <boost/core/ignore_unused.hpp>
#include <boost/crc.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/mpl/vector.hpp>

#include <ios>
Expand Down Expand Up @@ -50,10 +48,15 @@ void error_if(bool condition);
////////////////////////////////////////////////////

template <typename GrayView, typename R>
void gray_image_hist(const GrayView& img_view, R& hist) {
// for_each_pixel(img_view,++lambda::var(hist)[lambda::_1]);
for (typename GrayView::iterator it=img_view.begin(); it!=img_view.end(); ++it)
void gray_image_hist(GrayView const& img_view, R& hist)
{
for (auto it = img_view.begin(); it != img_view.end(); ++it)
++hist[*it];

// Alternatively, prefer the algorithm with lambda
// for_each_pixel(img_view, [&hist](gray8_pixel_t const& pixel) {
// ++hist[pixel];
// });
}

template <typename V, typename R>
Expand Down
3 changes: 1 addition & 2 deletions test/recreate_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#endif

#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>

#include <boost/mpl/vector.hpp>
#include <boost/test/unit_test.hpp>

Expand Down