Mask (View)
Include <mln/core/image/view/mask.hpp>
ima |
mask(ima, mask) |
||
---|---|---|---|
Category |
Forward |
X |
X |
Bidirectional |
X |
X |
|
Raw |
X |
||
Properties |
Writable |
X |
X |
Accessible |
X |
X |
|
Indexable |
X |
X |
Examples
Set all odd values to 42:
mln::image2d<int> ima = { {0, 1, 2}, {3, 4, 5} };
mln::image2d<bool> m = ima % 2 == 1;
auto g = mln::view::mask(ima, m);
mln::fill(g, 42);
mln::io::imprint(ima);
Outputs:
0 42 2
42 4 42