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

Resolve new_value_type new_reference issue

parent f1be63c8
......@@ -18,8 +18,8 @@ namespace mln::archetypes
struct Image
{
using new_pixel_type = Pixel;
using new_value_type = pixel_value_t<Pixel>;
using new_reference = pixel_reference_t<Pixel>;
using value_type = pixel_value_t<Pixel>;
using reference = pixel_reference_t<Pixel>;
using new_point_type = domain_point_t<Domain>;
using domain_type = Domain;
using category_type = forward_image_tag;
......@@ -80,7 +80,7 @@ namespace mln::archetypes
struct OutputImage : Image
{
using new_pixel_type = OutputPixel;
using new_reference = pixel_reference_t<OutputPixel>;
using reference = pixel_reference_t<OutputPixel>;
struct OutputPixelRange final
......@@ -150,7 +150,7 @@ namespace mln::archetypes
struct OutputIndexableImage final : IndexableImage
{
using new_pixel_type = OutputPixel;
using new_reference = pixel_reference_t<OutputPixel>;
using reference = pixel_reference_t<OutputPixel>;
image_reference_t<OutputIndexableImage> operator[](image_index_t<OutputIndexableImage>) const;
image_reference_t<OutputIndexableImage> operator[](image_index_t<OutputIndexableImage>);
......@@ -194,7 +194,7 @@ namespace mln::archetypes
struct OutputAccessibleImage final : AccessibleImage
{
using new_pixel_type = OutputPixel;
using new_reference = pixel_reference_t<OutputPixel>;
using reference = pixel_reference_t<OutputPixel>;
image_reference_t<OutputAccessibleImage> operator()(image_point_t<OutputAccessibleImage>) const;
image_reference_t<OutputAccessibleImage> operator()(image_point_t<OutputAccessibleImage>);
......@@ -254,7 +254,7 @@ namespace mln::archetypes
struct OutputBidirectionalImage : BidirectionalImage
{
using new_pixel_type = OutputPixel;
using new_reference = pixel_reference_t<OutputPixel>;
using reference = pixel_reference_t<OutputPixel>;
struct OutputPixelRange
{
......@@ -326,7 +326,7 @@ namespace mln::archetypes
struct OutputRawImage final : RawImage
{
using new_pixel_type = OutputPixel;
using new_reference = pixel_reference_t<OutputPixel>;
using reference = pixel_reference_t<OutputPixel>;
image_reference_t<OutputRawImage> operator[](image_index_t<OutputRawImage>) const;
image_reference_t<OutputRawImage> operator[](image_index_t<OutputRawImage>);
......
......@@ -171,12 +171,10 @@ namespace mln
using new_const_pixel_type = details::ndpixel<const T, dim>;
/// \copydoc image::value_type
using value_type[[deprecated]] = T;
using new_value_type = pixel_value_t<new_pixel_type>;
using value_type = T;
/// \copydoc image::reference
using reference[[deprecated]] = T&;
using new_reference[[deprecated]] = pixel_reference_t<new_pixel_type>;
using reference = T&;
/// \copydoc image::const_reference
using const_reference[[deprecated]] = const T&;
......@@ -248,27 +246,27 @@ namespace mln
/// \copydoc image::operator()(const site_type& p) const
[[deprecated]] reference operator()(const site_type& p);
new_reference operator()(const new_point_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;
new_reference operator()(const new_point_type& p) const;
reference operator()(const new_point_type& p) const;
/// \copydoc image::operator[](size_type i) const
[[deprecated]] reference operator[](size_type i);
new_reference operator[](index_type i);
reference operator[](index_type i);
/// \copydoc image::operator[](size_type i) const
[[deprecated]] const_reference operator[](size_type i) const;
new_reference operator[](index_type i) const;
reference operator[](index_type i) const;
/// \copydoc image::at(const site_type& p) const
[[deprecated]] reference at(const site_type& p);
new_reference at(const new_point_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;
new_reference at(const new_point_type& p) const;
reference at(const new_point_type& p) const;
/// \}
......
......@@ -8,10 +8,10 @@ namespace mln
using image_pixel_t = typename I::new_pixel_type;
template <class I>
using image_reference_t = typename I::new_reference;
using image_reference_t = typename I::reference;
template <class I>
using image_value_t = typename I::new_value_type;
using image_value_t = typename I::value_type;
template <class I>
using image_point_t = typename I::new_point_type;
......
......@@ -11,7 +11,7 @@
namespace concepts = mln::concepts;
#ifdef PYLENE_CONCEPT_TS_ENABLED
template <concepts::AccessibleImage Ima>
template <concepts::BidirectionalImage Ima>
void foo(Ima)
{
}
......@@ -27,7 +27,7 @@ TEST(Core, Image_Image2D)
static_assert(concepts::Image<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::BidirectionalImage<mln::image2d<int>>);
// static_assert(concepts::RawImage<mln::image2d<int>>);
#endif // PYLENE_CONCEPT_TS_ENABLED
}
......
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