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

Fix ndimage for Indexable

parent dc530938
......@@ -125,8 +125,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_of_index(image_index_t<IndexableImage>) const;
image_index_t<IndexableImage> index_at_point(image_point_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_index_t<IndexableImage> delta_index(image_point_t<IndexableImage>) const;
};
......@@ -277,8 +277,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_of_index(image_index_t<RawImage>) const;
image_index_t<RawImage> index_at_point(image_point_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_index_t<RawImage> delta_index(image_point_t<RawImage>) const;
image_reference_t<RawImage> operator()(image_point_t<RawImage>) const;
......
......@@ -108,8 +108,8 @@ namespace mln::concepts
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_of_index(k) } -> image_point_t<Ima>;
{ cima.index_at_point(p) } -> image_index_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>;
};
......
......@@ -184,7 +184,7 @@ namespace mln
/// \copydoc image::size_type
using size_type[[deprecated]] = unsigned;
using index_type = unsigned;
using index_type = int;
using pointer = T*;
using const_pointer = const T*;
......@@ -251,10 +251,12 @@ namespace mln
const_reference operator()(const site_type& p) const;
/// \copydoc image::operator[](size_type i) const
reference operator[](size_type i);
[[deprecated]] reference operator[](size_type i);
reference operator[](index_type i);
/// \copydoc image::operator[](size_type i) const
const_reference operator[](size_type i) const;
[[deprecated]] const_reference operator[](size_type i) const;
reference operator[](index_type i) const;
/// \copydoc image::at(const site_type& p) const
reference at(const site_type& p);
......@@ -329,7 +331,8 @@ namespace mln
/// \{
/// \copydoc image::index_of_point(const point_type&) const
size_type index_of_point(const point_type& p) const;
[[deprecated]] size_type index_of_point(const point_type& p) const;
index_type new_index_of_point(const new_point_type& p) const;
/// \copydoc image::point_at_index(size_type i) const
[[deprecated]] point_type point_at_index(size_type i) const;
......
......@@ -11,7 +11,7 @@
namespace concepts = mln::concepts;
#ifdef PYLENE_CONCEPT_TS_ENABLED
template <concepts::Image Ima>
template <concepts::IndexableImage Ima>
void foo(Ima)
{
}
......@@ -25,7 +25,7 @@ TEST(Core, Image_Image2D)
foo(mln::image2d<int>{});
static_assert(concepts::Image<mln::image2d<int>>);
// static_assert(concepts::IndexableImage<mln::image2d<int>>);
static_assert(concepts::IndexableImage<mln::image2d<int>>);
// static_assert(concepts::AccessibleImage<mln::image2d<int>>);
// static_assert(concepts::BidirectionalImage<mln::image2d<int>>);
// static_assert(concepts::RawImage<mln::image2d<int>>);
......
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