Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
7d850b1e
Commit
7d850b1e
authored
Jun 16, 2020
by
Edwin Carlinet
Browse files
Old API cleaning.
Rename new_pixel/new_pixel_type -> pixel/pixel_type.
parent
cdd0912b
Changes
24
Hide whitespace changes
Inline
Side-by-side
pylene/include/mln/core/concepts/archetype/image.hpp
View file @
7d850b1e
...
...
@@ -44,7 +44,7 @@ namespace mln::archetypes
struct
ConcreteImage
{
using
new_
pixel_type
=
archetypes
::
Pixel
;
using
pixel_type
=
archetypes
::
Pixel
;
using
value_type
=
pixel_value_t
<
mln
::
archetypes
::
Pixel
>
;
using
reference
=
pixel_reference_t
<
mln
::
archetypes
::
Pixel
>
;
using
point_type
=
::
ranges
::
range_value_t
<
Domain
>
;
...
...
@@ -72,8 +72,8 @@ namespace mln::archetypes
struct
pixel_range
{
const
new_
pixel_type
*
begin
();
const
new_
pixel_type
*
end
();
const
pixel_type
*
begin
();
const
pixel_type
*
end
();
};
pixel_range
pixels
();
...
...
@@ -104,13 +104,13 @@ namespace mln::archetypes
struct
OutputImage
:
Image
{
using
new_
pixel_type
=
archetypes
::
OutputPixel
;
using
pixel_type
=
archetypes
::
OutputPixel
;
using
reference
=
pixel_reference_t
<
mln
::
archetypes
::
OutputPixel
>
;
struct
pixel_range
{
const
new_
pixel_type
*
begin
();
const
new_
pixel_type
*
end
();
const
pixel_type
*
begin
();
const
pixel_type
*
end
();
};
pixel_range
pixels
();
...
...
@@ -164,8 +164,8 @@ namespace mln::archetypes
reference
operator
()(
point_type
);
reference
at
(
point_type
);
new_
pixel_type
new_
pixel
(
point_type
);
new_
pixel_type
new_
pixel_at
(
point_type
);
pixel_type
pixel
(
point_type
);
pixel_type
pixel_at
(
point_type
);
};
...
...
@@ -179,8 +179,8 @@ namespace mln::archetypes
reference
operator
()(
point_type
);
reference
at
(
point_type
);
new_
pixel_type
new_
pixel
(
point_type
);
new_
pixel_type
new_
pixel_at
(
point_type
);
pixel_type
pixel
(
point_type
);
pixel_type
pixel_at
(
point_type
);
};
...
...
@@ -225,8 +225,8 @@ namespace mln::archetypes
struct
pixel_range
{
const
new_
pixel_type
*
begin
();
const
new_
pixel_type
*
end
();
const
pixel_type
*
begin
();
const
pixel_type
*
end
();
pixel_range
reversed
();
};
...
...
@@ -245,7 +245,7 @@ namespace mln::archetypes
struct
OutputBidirectionalImage
:
BidirectionalImage
{
using
new_
pixel_type
=
archetypes
::
OutputPixel
;
using
pixel_type
=
archetypes
::
OutputPixel
;
using
reference
=
pixel_reference_t
<
mln
::
archetypes
::
OutputPixel
>
;
struct
value_range
...
...
@@ -259,8 +259,8 @@ namespace mln::archetypes
struct
pixel_range
{
const
new_
pixel_type
*
begin
();
const
new_
pixel_type
*
end
();
const
pixel_type
*
begin
();
const
pixel_type
*
end
();
pixel_range
reversed
();
};
...
...
pylene/include/mln/core/concepts/image.hpp
View file @
7d850b1e
...
...
@@ -156,13 +156,13 @@ namespace mln::concepts
#if __GNUC__ == 9
{
ima
(
p
)
}
->
::
concepts
::
same_as
<
image_reference_t
<
I
>>&&
;
// For concrete image it returns a const_reference
{
ima
.
at
(
p
)
}
->
::
concepts
::
same_as
<
image_reference_t
<
I
>>&&
;
// idem
{
ima
.
new_
pixel
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>&&
;
// For concrete image pixel may propagate constness
{
ima
.
new_
pixel_at
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>&&
;
// idem
{
ima
.
pixel
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>&&
;
// For concrete image pixel may propagate constness
{
ima
.
pixel_at
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>&&
;
// idem
#else
{
ima
(
p
)
}
->
::
concepts
::
same_as
<
image_reference_t
<
I
>>
;
// For concrete image it returns a const_reference
{
ima
.
at
(
p
)
}
->
::
concepts
::
same_as
<
image_reference_t
<
I
>>
;
// idem
{
ima
.
new_
pixel
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>
;
// For concrete image pixel may propagate constness
{
ima
.
new_
pixel_at
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>
;
// idem
{
ima
.
pixel
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>
;
// For concrete image pixel may propagate constness
{
ima
.
pixel_at
(
p
)
}
->
::
concepts
::
same_as
<
image_pixel_t
<
I
>>
;
// idem
#endif
};
...
...
pylene/include/mln/core/image/private/ndbuffer_image.hpp
View file @
7d850b1e
...
...
@@ -51,14 +51,14 @@ namespace mln
using
reference
=
T
&
;
using
const_reference
=
const
T
&
;
using
index_type
=
int
;
using
new_
pixel_type
=
details
::
ndpix
<
T
,
N
>
;
using
pixel_type
=
details
::
ndpix
<
T
,
N
>
;
using
new_const_pixel_type
=
details
::
ndpix
<
const
T
,
N
>
;
using
domain_type
=
ndbox
<
N
>
;
using
extension_type
=
internal
::
ndimage_extension
<
T
,
N
>
;
using
new_value_range
=
ranges
::
mdspan
<
T
,
N
>
;
using
new_const_value_range
=
ranges
::
mdspan
<
const
T
,
N
>
;
using
new_
pixel_range
=
details
::
ndpix_range
<
T
,
N
>
;
using
pixel_range
=
details
::
ndpix_range
<
T
,
N
>
;
using
new_const_pixel_range
=
details
::
ndpix_range
<
const
T
,
N
>
;
...
...
@@ -159,15 +159,15 @@ namespace mln
const_reference
operator
[](
index_type
i
)
const
noexcept
;
reference
operator
[](
index_type
i
)
noexcept
;
new_
pixel_type
new_
pixel
(
fast_point_type
p
)
noexcept
;
new_const_pixel_type
new_
pixel
(
fast_point_type
p
)
const
noexcept
;
new_
pixel_type
new_
pixel_at
(
fast_point_type
p
)
noexcept
;
new_const_pixel_type
new_
pixel_at
(
fast_point_type
p
)
const
noexcept
;
pixel_type
pixel
(
fast_point_type
p
)
noexcept
;
new_const_pixel_type
pixel
(
fast_point_type
p
)
const
noexcept
;
pixel_type
pixel_at
(
fast_point_type
p
)
noexcept
;
new_const_pixel_type
pixel_at
(
fast_point_type
p
)
const
noexcept
;
new_value_range
values
()
noexcept
;
new_const_value_range
values
()
const
noexcept
;
new_
pixel_range
pixels
()
noexcept
;
pixel_range
pixels
()
noexcept
;
new_const_pixel_range
pixels
()
const
noexcept
;
/// \}
...
...
@@ -192,7 +192,7 @@ namespace mln
std
::
ptrdiff_t
__index_of_point
(
const
int
coords
[])
const
noexcept
;
new_
pixel_type
__pixel_at
(
fast_point_type
p
)
noexcept
;
pixel_type
__pixel_at
(
fast_point_type
p
)
noexcept
;
new_const_pixel_type
__pixel_at
(
fast_point_type
p
)
const
noexcept
;
// Get a data reference at the given coords
...
...
@@ -500,37 +500,37 @@ namespace mln
}
template
<
class
T
,
int
N
>
inline
auto
__ndbuffer_image
<
T
,
N
>::
__pixel_at
(
fast_point_type
p
)
noexcept
->
new_
pixel_type
inline
auto
__ndbuffer_image
<
T
,
N
>::
__pixel_at
(
fast_point_type
p
)
noexcept
->
pixel_type
{
fast_point_type
lcoords
=
p
;
lcoords
[
0
]
=
0
;
T
*
lineptr
=
Impl
::
get_pointer
(
this
->
__info
(),
lcoords
.
data
());
return
new_
pixel_type
{{},
this
->
__info
(),
lineptr
,
p
};
return
pixel_type
{{},
this
->
__info
(),
lineptr
,
p
};
}
template
<
class
T
,
int
N
>
inline
auto
__ndbuffer_image
<
T
,
N
>::
new_
pixel
(
fast_point_type
p
)
const
noexcept
->
new_const_pixel_type
inline
auto
__ndbuffer_image
<
T
,
N
>::
pixel
(
fast_point_type
p
)
const
noexcept
->
new_const_pixel_type
{
assert
(
Impl
::
is_point_in_domain
(
this
->
__info
(),
p
.
data
()));
return
this
->
__pixel_at
(
p
);
}
template
<
class
T
,
int
N
>
inline
auto
__ndbuffer_image
<
T
,
N
>::
new_
pixel
(
fast_point_type
p
)
noexcept
->
new_
pixel_type
inline
auto
__ndbuffer_image
<
T
,
N
>::
pixel
(
fast_point_type
p
)
noexcept
->
pixel_type
{
assert
(
Impl
::
is_point_in_domain
(
this
->
__info
(),
p
.
data
()));
return
this
->
__pixel_at
(
p
);
}
template
<
class
T
,
int
N
>
inline
auto
__ndbuffer_image
<
T
,
N
>::
new_
pixel_at
(
fast_point_type
p
)
const
noexcept
->
new_const_pixel_type
inline
auto
__ndbuffer_image
<
T
,
N
>::
pixel_at
(
fast_point_type
p
)
const
noexcept
->
new_const_pixel_type
{
assert
(
Impl
::
is_point_valid
(
this
->
__info
(),
p
.
data
()));
return
this
->
__pixel_at
(
p
);
}
template
<
class
T
,
int
N
>
inline
auto
__ndbuffer_image
<
T
,
N
>::
new_
pixel_at
(
fast_point_type
p
)
noexcept
->
new_
pixel_type
inline
auto
__ndbuffer_image
<
T
,
N
>::
pixel_at
(
fast_point_type
p
)
noexcept
->
pixel_type
{
assert
(
Impl
::
is_point_valid
(
this
->
__info
(),
p
.
data
()));
return
this
->
__pixel_at
(
p
);
...
...
pylene/include/mln/core/image/view/adaptor.hpp
View file @
7d850b1e
...
...
@@ -107,9 +107,9 @@ namespace mln
using
domain_type
=
image_domain_t
<
I
>
;
/// \}
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
new_
pixel_type
::
pixel_adaptor
::
pixel_adaptor
;
using
pixel_type
::
pixel_adaptor
::
pixel_adaptor
;
};
/// Traits & Image Properties
...
...
@@ -177,16 +177,16 @@ namespace mln
return
m_ima
.
at
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel
(
point_type
p
)
{
return
m_ima
.
new_
pixel
(
p
);
return
m_ima
.
pixel
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel_at
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel_at
(
point_type
p
)
{
return
m_ima
.
new_
pixel_at
(
p
);
return
m_ima
.
pixel_at
(
p
);
}
/// \}
...
...
pylene/include/mln/core/image/view/clip.hpp
View file @
7d850b1e
...
...
@@ -26,7 +26,7 @@ namespace mln
public:
/// Type definitions
/// \{
using
typename
clip_view
::
image_adaptor
::
new_
pixel_type
;
using
typename
clip_view
::
image_adaptor
::
pixel_type
;
using
typename
clip_view
::
image_adaptor
::
point_type
;
using
typename
clip_view
::
image_adaptor
::
reference
;
using
typename
clip_view
::
image_adaptor
::
value_type
;
...
...
@@ -83,7 +83,7 @@ namespace mln
auto
pixels
()
{
auto
g
=
[
this
](
point_type
p
)
->
new_
pixel_type
{
return
this
->
base
().
new_
pixel_at
(
p
);
};
auto
g
=
[
this
](
point_type
p
)
->
pixel_type
{
return
this
->
base
().
pixel_at
(
p
);
};
return
mln
::
ranges
::
view
::
transform
(
m_subdomain
,
g
);
}
...
...
@@ -112,17 +112,17 @@ namespace mln
{
return
this
->
base
().
at
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel
(
point_type
p
)
{
mln_precondition
(
domain
().
has
(
p
));
mln_precondition
(
this
->
base
().
domain
().
has
(
p
));
return
this
->
base
().
new_
pixel
(
p
);
return
this
->
base
().
pixel
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel_at
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel_at
(
point_type
p
)
{
return
this
->
base
().
new_
pixel_at
(
p
);
return
this
->
base
().
pixel_at
(
p
);
}
/// \}
...
...
pylene/include/mln/core/image/view/extend_by_projection.hpp
View file @
7d850b1e
...
...
@@ -30,7 +30,7 @@ namespace mln
using
point_type
=
image_point_t
<
I
>
;
using
typename
image_adaptor
<
I
>::
domain_type
;
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
reference
=
extend_by_projection_view_base
<
I
,
Proj
>::
reference
;
...
...
@@ -40,8 +40,8 @@ namespace mln
return
(
*
m_view
)(
q
);
}
new_
pixel_type
(
image_pixel_t
<
I
>
px
,
extend_by_projection_view_base
<
I
,
Proj
>*
ima
)
:
new_
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
pixel_type
(
image_pixel_t
<
I
>
px
,
extend_by_projection_view_base
<
I
,
Proj
>*
ima
)
:
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
,
m_view
{
ima
}
{
}
...
...
@@ -75,22 +75,22 @@ namespace mln
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel
(
point_type
p
)
{
assert
(
this
->
base
().
domain
().
has
(
p
));
return
this
->
new_
pixel_at
(
p
);
return
this
->
pixel_at
(
p
);
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel_at
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel_at
(
point_type
p
)
{
return
{
this
->
base
().
new_
pixel_at
(
p
),
this
};
return
{
this
->
base
().
pixel_at
(
p
),
this
};
}
/// \}
auto
pixels
()
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
new_
pixel_type
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
pixel_type
{
return
{
std
::
move
(
px
),
this
};
});
}
...
...
pylene/include/mln/core/image/view/extended.hpp
View file @
7d850b1e
...
...
@@ -187,14 +187,14 @@ namespace mln
const
adapted_image_t
*
m_adapted_image_ptr
;
// mutable
};
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
reference
=
extended_view
::
reference
;
reference
val
()
const
{
return
(
*
m_ima_ptr
)(
this
->
base
().
point
());
}
new_
pixel_type
(
image_pixel_t
<
I
>
px
,
extended_view
<
I
>*
ima_ptr
)
:
new_
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
pixel_type
(
image_pixel_t
<
I
>
px
,
extended_view
<
I
>*
ima_ptr
)
:
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
,
m_ima_ptr
{
ima_ptr
}
{
}
...
...
@@ -230,21 +230,21 @@ namespace mln
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel
(
point_type
p
)
{
return
{
this
->
base
().
new_
pixel
(
p
),
this
};
return
{
this
->
base
().
pixel
(
p
),
this
};
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel_at
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel_at
(
point_type
p
)
{
return
{
this
->
base
().
new_
pixel
(
p
),
this
};
return
{
this
->
base
().
pixel
(
p
),
this
};
}
/// \}
auto
pixels
()
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
new_
pixel_type
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
pixel_type
{
return
{
std
::
move
(
px
),
this
};
});
}
...
...
pylene/include/mln/core/image/view/filter.hpp
View file @
7d850b1e
...
...
@@ -27,7 +27,7 @@ namespace mln
public:
/// Type definitions
/// \{
using
new_
pixel_type
=
image_pixel_t
<
I
>
;
using
pixel_type
=
image_pixel_t
<
I
>
;
using
typename
filter_view
::
image_adaptor
::
point_type
;
using
typename
filter_view
::
image_adaptor
::
reference
;
using
typename
filter_view
::
image_adaptor
::
value_type
;
...
...
@@ -115,17 +115,17 @@ namespace mln
{
return
this
->
base
().
at
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel
(
point_type
p
)
{
mln_precondition
(
domain
().
has
(
p
));
mln_precondition
(
std
::
invoke
(
f
,
this
->
base
().
at
(
p
)));
return
this
->
base
().
new_
pixel
(
p
);
return
this
->
base
().
pixel
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel_at
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel_at
(
point_type
p
)
{
return
this
->
base
().
new_
pixel_at
(
p
);
return
this
->
base
().
pixel_at
(
p
);
}
/// \}
...
...
pylene/include/mln/core/image/view/image_extended.hpp
View file @
7d850b1e
...
...
@@ -39,14 +39,14 @@ namespace mln
using
typename
image_adaptor
<
I
>::
value_type
;
using
extension_type
=
extension
::
by_image
<
value_type
,
point_type
>
;
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
reference
=
image_extended_view
::
reference
;
reference
val
()
const
{
return
(
*
m_ima
)(
this
->
base
().
point
());
}
new_
pixel_type
(
image_pixel_t
<
I
>
px
,
image_extended_view
<
I
>*
ima
)
:
new_
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
pixel_type
(
image_pixel_t
<
I
>
px
,
image_extended_view
<
I
>*
ima
)
:
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
,
m_ima
{
ima
}
{
}
...
...
@@ -83,21 +83,21 @@ namespace mln
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel
(
point_type
p
)
{
return
this
->
new_
pixel_at
(
p
);
return
this
->
pixel_at
(
p
);
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel_at
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel_at
(
point_type
p
)
{
return
{
this
->
base
().
new_
pixel_at
(
p
),
this
};
return
{
this
->
base
().
pixel_at
(
p
),
this
};
}
/// \}
auto
pixels
()
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
new_
pixel_type
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
pixel_type
{
return
{
std
::
move
(
px
),
this
};
});
}
...
...
pylene/include/mln/core/image/view/mask.hpp
View file @
7d850b1e
...
...
@@ -37,7 +37,7 @@ namespace mln
public:
/// Type definitions
/// \{
using
new_
pixel_type
=
image_pixel_t
<
I
>
;
using
pixel_type
=
image_pixel_t
<
I
>
;
using
typename
mask_view
::
image_adaptor
::
point_type
;
using
typename
mask_view
::
image_adaptor
::
reference
;
using
typename
mask_view
::
image_adaptor
::
value_type
;
...
...
@@ -106,18 +106,18 @@ namespace mln
return
this
->
base
()(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel
(
point_type
p
)
{
mln_precondition
(
m_mask
.
domain
().
has
(
p
));
mln_precondition
(
this
->
base
().
domain
().
has
(
p
));
return
this
->
base
().
new_
pixel
(
p
);
return
this
->
base
().
pixel
(
p
);
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel_at
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel_at
(
point_type
p
)
{
return
this
->
base
().
new_
pixel_at
(
p
);
return
this
->
base
().
pixel_at
(
p
);
}
/// \}
...
...
pylene/include/mln/core/image/view/none_extended.hpp
View file @
7d850b1e
...
...
@@ -39,14 +39,14 @@ namespace mln
using
typename
image_adaptor
<
I
>::
value_type
;
using
extension_type
=
extension
::
none
;
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
reference
=
none_extended_view
::
reference
;
reference
val
()
const
{
return
(
*
m_ima
)(
this
->
base
().
point
());
}
new_
pixel_type
(
image_pixel_t
<
I
>
px
,
none_extended_view
<
I
>*
ima
)
:
new_
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
pixel_type
(
image_pixel_t
<
I
>
px
,
none_extended_view
<
I
>*
ima
)
:
pixel_type
::
pixel_adaptor
{
std
::
move
(
px
)}
,
m_ima
{
ima
}
{
}
...
...
@@ -80,21 +80,21 @@ namespace mln
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel
(
point_type
p
)
{
return
this
->
new_
pixel_at
(
p
);
return
this
->
pixel_at
(
p
);
}
template
<
class
J
=
I
>
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
new_
pixel_type
>
new_
pixel_at
(
point_type
p
)
std
::
enable_if_t
<
image_accessible_v
<
J
>
,
pixel_type
>
pixel_at
(
point_type
p
)
{
return
{
this
->
base
().
new_
pixel_at
(
p
),
this
};
return
{
this
->
base
().
pixel_at
(
p
),
this
};
}
/// \}
auto
pixels
()
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
new_
pixel_type
{
return
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
[
this
](
image_pixel_t
<
I
>
px
)
->
pixel_type
{
return
{
std
::
move
(
px
),
this
};
});
}
...
...
pylene/include/mln/core/image/view/transform.hpp
View file @
7d850b1e
...
...
@@ -52,26 +52,26 @@ namespace mln
public:
/// Pixel type definitions
/// \{
struct
new_
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
new_
pixel_type
>
struct
pixel_type
:
pixel_adaptor
<
image_pixel_t
<
I
>>
,
mln
::
details
::
Pixel
<
pixel_type
>
{
using
point_type
=
transform_view
::
point_type
;
using
site_type
[[
deprecated
]]
=
transform_view
::
point_type
;
using
reference
=
transform_view
::
reference
;
using
value_type
=
transform_view
::
value_type
;
new_
pixel_type
(
fun_t
fun
,
image_pixel_t
<
I
>
px
)
:
new_
pixel_type
::
pixel_adaptor
{
px
}
pixel_type
(
fun_t
fun
,
image_pixel_t
<
I
>
px
)
:
pixel_type
::
pixel_adaptor
{
px
}
,
fun_
{
fun
}
{
}
new_
pixel_type
(
const
new_
pixel_type
&
other
)
:
new_
pixel_type
::
pixel_adaptor
{
other
}
pixel_type
(
const
pixel_type
&
other
)
:
pixel_type
::
pixel_adaptor
{
other
}
,
fun_
(
other
.
fun_
)
{
}
new_
pixel_type
(
new_
pixel_type
&&
other
)
:
new_
pixel_type
::
pixel_adaptor
{
std
::
move
(
other
)}
pixel_type
(
pixel_type
&&
other
)
:
pixel_type
::
pixel_adaptor
{
std
::
move
(
other
)}
,
fun_
(
std
::
move
(
other
.
fun_
))
{
}
...
...
@@ -109,7 +109,7 @@ namespace mln
auto
pixels
()
{
auto
pxwrapper
=
[
fun
=
this
->
fun_
](
image_pixel_t
<
I
>
px
)
{
return
new_
pixel_type
{
fun
,
std
::
move
(
px
)};
};
auto
pxwrapper
=
[
fun
=
this
->
fun_
](
image_pixel_t
<
I
>
px
)
{
return
pixel_type
{
fun
,
std
::
move
(
px
)};
};
return
mln
::
ranges
::
view
::
transform
(
this
->
base
().
pixels
(),
pxwrapper
);
}
...
...
@@ -147,17 +147,17 @@ namespace mln
return
std
::
invoke
(
fun_
,
this
->
base
().
at
(
p
));
}
template
<
typename
Ret
=
new_
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
new_
pixel
(
point_type
p
)
template
<
typename
Ret
=
pixel_type
>
std
::
enable_if_t
<
accessible
::
value
,
Ret
>
pixel
(
point_type
p
)
{