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

Resolve new_point_type and delete ambiguous calls in ndimage

TODO revert des-ambiguous call in API usage
parent e3ffe105
......@@ -20,7 +20,7 @@ namespace mln::archetypes
using new_pixel_type = Pixel;
using value_type = pixel_value_t<Pixel>;
using reference = pixel_reference_t<Pixel>;
using new_point_type = domain_point_t<Domain>;
using point_type = domain_point_t<Domain>;
using domain_type = Domain;
using category_type = forward_image_tag;
using concrete_type = Image;
......@@ -136,8 +136,8 @@ namespace mln::archetypes
using indexable = std::true_type;
image_reference_t<IndexableImage> operator[](image_index_t<IndexableImage>) const;
image_point_t<IndexableImage> new_point_at_index(image_index_t<IndexableImage>) const;
image_index_t<IndexableImage> new_index_of_point(image_point_t<IndexableImage>) const;
image_point_t<IndexableImage> point_at_index(image_index_t<IndexableImage>) const;
image_index_t<IndexableImage> index_of_point(image_point_t<IndexableImage>) const;
image_index_t<IndexableImage> delta_index(image_point_t<IndexableImage>) const;
};
......@@ -288,8 +288,8 @@ namespace mln::archetypes
using accessible = std::true_type;
image_reference_t<RawImage> operator[](image_index_t<RawImage>) const;
image_point_t<RawImage> new_point_at_index(image_index_t<RawImage>) const;
image_index_t<RawImage> new_index_of_point(image_point_t<RawImage>) const;
image_point_t<RawImage> point_at_index(image_index_t<RawImage>) const;
image_index_t<RawImage> index_of_point(image_point_t<RawImage>) const;
image_index_t<RawImage> delta_index(image_point_t<RawImage>) const;
image_reference_t<RawImage> operator()(image_point_t<RawImage>) const;
......
......@@ -52,7 +52,7 @@ namespace mln::concepts
Point<image_point_t<Ima>> &&
Value<image_value_t<Ima>> &&
Domain<image_domain_t<Ima>> &&
stl::Same<pixel_point_t<image_pixel_t<Ima>>, image_point_t<Ima>> &&
stl::ConvertibleTo<pixel_point_t<image_pixel_t<Ima>>, image_point_t<Ima>> &&
stl::Same<pixel_value_t<image_pixel_t<Ima>>, image_value_t<Ima>> &&
stl::ConvertibleTo<pixel_reference_t<image_pixel_t<Ima>>, image_reference_t<Ima>> &&
stl::CommonReference<image_reference_t<Ima>&&, image_value_t<Ima>&> &&
......@@ -106,11 +106,11 @@ namespace mln::concepts
typename image_index_t<Ima>;
} &&
image_indexable_v<Ima> &&
requires (const Ima cima, image_index_t<Ima> k, image_point_t<Ima> p) {
{ cima[k] } -> image_reference_t<Ima>;
{ cima.new_point_at_index(k) } -> image_point_t<Ima>;
{ cima.new_index_of_point(p) } -> image_index_t<Ima>;
{ cima.delta_index(p) } -> image_index_t<Ima>;
requires (Ima ima, const Ima cima, image_index_t<Ima> k, image_point_t<Ima> p) {
{ ima[k] } -> image_reference_t<Ima>;
{ cima.point_at_index(k) } -> image_point_t<Ima>;
{ cima.index_of_point(p) } -> image_index_t<Ima>;
{ cima.delta_index(p) } -> image_index_t<Ima>;
};
......@@ -134,11 +134,11 @@ namespace mln::concepts
concept AccessibleImage =
Image<Ima> &&
image_accessible_v<Ima> &&
requires (const Ima cima, image_point_t<Ima> p) {
{ cima(p) } -> image_reference_t<Ima>;
{ cima.at(p) } -> image_reference_t<Ima>;
{ cima.new_pixel(p) } -> image_pixel_t<Ima>;
{ cima.new_pixel_at(p) } -> image_pixel_t<Ima>;
requires (Ima ima, image_point_t<Ima> p) {
{ ima(p) } -> image_reference_t<Ima>;
{ ima.at(p) } -> image_reference_t<Ima>;
{ ima.new_pixel(p) } -> image_pixel_t<Ima>;
{ ima.new_pixel_at(p) } -> image_pixel_t<Ima>;
};
......@@ -188,8 +188,8 @@ namespace mln::concepts
AccessibleImage<Ima> &&
BidirectionalImage<Ima> &&
stl::DerivedFrom<image_category_t<Ima>, raw_image_tag> &&
requires (const Ima cima, int dim) {
{ cima.data() } -> stl::ConvertibleTo<const image_value_t<Ima>*>&&;
requires (Ima ima, const Ima cima, int dim) {
{ ima.data() } -> stl::ConvertibleTo<const image_value_t<Ima>*>&&;
{ cima.strides(dim) } -> std::size_t;
};
......
......@@ -159,8 +159,7 @@ namespace mln
using site_type[[deprecated]] = point<short, dim>;
/// \copydoc image::point_type
using point_type[[deprecated]] = point<short, dim>;
using new_point_type = point<std::ptrdiff_t, dim>;
using point_type = point<short, dim>;
/// \copydoc image::pixel_type
using pixel_type[[deprecated]] = ndimage_pixel<T, dim, E>;
......@@ -246,11 +245,9 @@ namespace mln
/// \copydoc image::operator()(const site_type& p) const
[[deprecated]] reference operator()(const site_type& p);
reference operator()(const new_point_type& p);
/// \copydoc image::operator()(const site_type& p) const
[[deprecated]] const_reference operator()(const site_type& p) const;
reference operator()(const new_point_type& p) const;
/// \copydoc image::operator[](size_type i) const
[[deprecated]] reference operator[](size_type i);
......@@ -262,11 +259,9 @@ namespace mln
/// \copydoc image::at(const site_type& p) const
[[deprecated]] reference at(const site_type& p);
reference at(const new_point_type& p);
/// \copydoc image::at(const site_type& p) const
[[deprecated]] const_reference at(const site_type& p) const;
reference at(const new_point_type& p) const;
/// \}
......@@ -274,14 +269,12 @@ namespace mln
/// \{
/// \copydoc image::pixel_at(const point_type&) const
[[deprecated]] pixel_type pixel_at(const point_type& p);
[[deprecated]] new_pixel_type new_pixel_at(const point_type& p);
new_pixel_type new_pixel_at(const new_point_type& p);
[[deprecated]] pixel_type pixel_at(const point_type& p);
new_pixel_type new_pixel_at(const point_type& p);
/// \copydoc image::pixel_at(const point_type&) const
[[deprecated]] const_pixel_type pixel_at(const point_type& p) const;
[[deprecated]] new_const_pixel_type new_pixel_at(const point_type& p) const;
new_pixel_type new_pixel_at(const new_point_type& p) const;
[[deprecated]] const_pixel_type pixel_at(const point_type& p) const;
new_const_pixel_type new_pixel_at(const point_type& p) const;
/// \copydoc image::pixel_at_index(size_type) const
[[deprecated]] pixel_type pixel_at_index(size_type i);
......@@ -292,14 +285,12 @@ namespace mln
// new_const_pixel_type new_pixel_at_index(size_type i) const;
/// \copydoc image::pixel(const point_type&) const
[[deprecated]] pixel_type pixel(const point_type& p);
[[deprecated]] new_pixel_type new_pixel(const point_type& p);
new_pixel_type new_pixel(const new_point_type& p);
[[deprecated]] pixel_type pixel(const point_type& p);
new_pixel_type new_pixel(const point_type& p);
/// \copydoc image::pixel(const point_type&) const
[[deprecated]] const_pixel_type pixel(const point_type& p) const;
[[deprecated]] new_const_pixel_type new_pixel(const point_type& p) const;
new_pixel_type new_pixel(const new_point_type& p) const;
[[deprecated]] const_pixel_type pixel(const point_type& p) const;
new_const_pixel_type new_pixel(const point_type& p) const;
/// \}
......@@ -339,12 +330,10 @@ namespace mln
/// \{
/// \copydoc image::index_of_point(const point_type&) const
[[deprecated]] size_type index_of_point(const point_type& p) const;
index_type new_index_of_point(const new_point_type& p) const;
size_type index_of_point(const point_type& p) const;
/// \copydoc image::point_at_index(size_type i) const
[[deprecated]] point_type point_at_index(size_type i) const;
new_point_type new_point_at_index(index_type i) const;
point_type point_at_index(size_type i) const;
/// \copydoc image::delta_index(const point_type&) const
difference_type delta_index(const point_type& p) const;
......
......@@ -14,7 +14,7 @@ namespace mln
using image_value_t = typename I::value_type;
template <class I>
using image_point_t = typename I::new_point_type;
using image_point_t = typename I::point_type;
template <class I>
using image_domain_t = typename I::domain_type;
......
......@@ -11,7 +11,7 @@
namespace concepts = mln::concepts;
#ifdef PYLENE_CONCEPT_TS_ENABLED
template <concepts::BidirectionalImage Ima>
template <concepts::AccessibleImage Ima>
void foo(Ima)
{
}
......
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