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
Robert Sachunsky
olena
Commits
5717b0cf
Commit
5717b0cf
authored
Feb 17, 2011
by
Guillaume Lazzara
Browse files
Add an optional base index for debug::iota.
* mln/debug/iota.hh, * mln/debug/iota.spe.hh: Here.
parent
6e51a343
Changes
3
Hide whitespace changes
Inline
Side-by-side
milena/ChangeLog
View file @
5717b0cf
2011-02-17 Guillaume Lazzara <z@lrde.epita.fr>
Add an optional base index for debug::iota.
* mln/debug/iota.hh,
* mln/debug/iota.spe.hh: Here.
2011-01-27 Guillaume Lazzara <z@lrde.epita.fr>
* tests/convert/to_qimage_nocopy.cc: Fix a warning.
milena/mln/debug/iota.hh
View file @
5717b0cf
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
...
...
@@ -49,7 +50,7 @@ namespace mln
* assigned.
*/
template
<
typename
I
>
void
iota
(
Image
<
I
>&
input
);
void
iota
(
Image
<
I
>&
input
,
unsigned
base_index
);
# ifndef MLN_INCLUDE_ONLY
...
...
@@ -60,9 +61,9 @@ namespace mln
template
<
typename
I
>
inline
void
iota
(
trait
::
image
::
speed
::
any
,
I
&
input
)
iota
(
trait
::
image
::
speed
::
any
,
I
&
input
,
unsigned
base_index
)
{
unsigned
i
=
0
;
unsigned
i
=
base_index
;
mln_piter
(
I
)
p
(
input
.
domain
());
for_all
(
p
)
input
(
p
)
=
++
i
%
mln_max
(
mln_value
(
I
));
...
...
@@ -71,17 +72,28 @@ namespace mln
}
// end of namespace mln::debug::impl
template
<
typename
I
>
inline
void
iota
(
Image
<
I
>&
input
)
{
iota
(
input
,
0
);
}
template
<
typename
I
>
inline
void
iota
(
Image
<
I
>&
input
,
unsigned
base_index
)
{
trace
::
entering
(
"debug::iota"
);
mln_precondition
(
exact
(
input
).
is_valid
());
impl
::
iota
(
mln_trait_image_speed
(
I
)(),
exact
(
input
));
impl
::
iota
(
mln_trait_image_speed
(
I
)(),
exact
(
input
)
,
base_index
);
trace
::
exiting
(
"debug::iota"
);
}
# endif // ! MLN_INCLUDE_ONLY
}
// end of namespace mln::debug
...
...
milena/mln/debug/iota.spe.hh
View file @
5717b0cf
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
...
...
@@ -48,16 +49,16 @@ namespace mln
{
template
<
typename
I
>
void
iota
(
trait
::
image
::
speed
::
fastest
,
I
&
input
);
void
iota
(
trait
::
image
::
speed
::
fastest
,
I
&
input
,
unsigned
base_index
);
# ifndef MLN_INCLUDE_ONLY
template
<
typename
I
>
inline
void
iota
(
trait
::
image
::
speed
::
fastest
,
I
&
input
)
iota
(
trait
::
image
::
speed
::
fastest
,
I
&
input
,
unsigned
base_index
)
{
unsigned
i
=
0
;
unsigned
i
=
base_index
;
mln_pixter
(
I
)
p
(
input
);
for_all
(
p
)
p
.
val
()
=
static_cast
<
mln_value
(
I
)
>
(
++
i
%
mln_max
(
mln_value
(
I
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment