Commit f453221b authored by Michaël Roynard's avatar Michaël Roynard
Browse files

Fix test semantic

parent 152bc858
......@@ -2,6 +2,8 @@
#include <boost/optional.hpp>
#include <mln/core/image/image.hpp>
// #include <mln/core/image/private/where.hpp>
// #include <mln/core/image/view/clip.hpp>
#include <mln/core/image_base.hpp>
#include <mln/core/iterator/transform_iterator.hpp>
#include <mln/core/pixel_utility.hpp>
......@@ -75,6 +77,14 @@ namespace mln
template <typename I, typename DomainOrMask>
auto operator|(Image<I>&& ima, const DomainOrMask& other) -> decltype(make_subimage(move_exact(ima), other));
/*
namespace experimental::ops
{
template <typename InputImage>
auto operator|(InputImage ima, const mln::ranges::where_t<InputImage>& dom);
} // namespace experimental::ops
*/
/******************************************/
/**** Implementation ****/
/******************************************/
......@@ -188,6 +198,19 @@ namespace mln
return make_subimage(move_exact(ima), other);
}
/*
namespace experimental::ops
{
template <typename InputImage>
auto operator|(InputImage ima, const mln::ranges::where_t<InputImage>& dom)
{
static_assert(is_a<InputImage, mln::experimental::Image>());
return view::clip(std::move(ima), dom);
}
} // namespace experimental::ops
*/
/******************************************/
/**** Traits ****/
/******************************************/
......
......@@ -3,7 +3,8 @@
#include <mln/core/algorithm/iota.hpp>
#include <mln/core/image/image2d.hpp>
#include <mln/core/image/private/image_operators.hpp>
#include <mln/core/image/view/mask.hpp>
#include <mln/core/image/private/where.hpp>
#include <mln/core/image/view/clip.hpp>
#include <mln/io/imprint.hpp>
#include <gtest/gtest.h>
......@@ -89,9 +90,7 @@ TEST(Core, SubImage_sub_domain)
};
iota(ima, 0);
auto ima_sup10 = ima > 10;
auto mask = view::mask(ima, ima_sup10);
mln::fill(mask, 42);
mln::fill(view::clip(ima, experimental::where(ima > 10)), 42);
ASSERT_TRUE(all_of(ima == ref));
}
......@@ -105,11 +104,7 @@ TEST(Core, SubImage_sub_domain)
};
iota(ima, 0);
auto ima_sup10 = ima > 10;
auto mask_sup10 = view::mask(ima, ima_sup10);
auto ima_sup20 = mask_sup10 > 20;
auto mask_sup20 = view::mask(mask_sup10, ima_sup20);
mln::fill(mask_sup20, 42);
mln::fill(view::clip(view::clip(ima, experimental::where(ima > 10)), experimental::where(ima < 20)), 42);
ASSERT_TRUE(all_of(ima == ref));
}
......@@ -122,13 +117,7 @@ TEST(Core, SubImage_sub_domain)
{20, 21, 22, 23, 24} //
};
iota(ima, 0);
auto ima_sup10_and_inf20 = ima > 10 && ima < 20;
[[maybe_unused]] auto mask = view::mask(ima, ima_sup10_and_inf20);
// FIXME : migrate rangev3 @HEAD
// mln::fill(mask, 42);
// mln::fill(view::clip(ima, experimental::where(ima > 10 && ima < 20)), 42);
// ASSERT_TRUE(all_of(ima == ref));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment