Channel (View)
Include <mln/core/image/view/rgb.hpp>
ima |
channel(ima, k) |
||
---|---|---|---|
Category |
Forward |
X |
X |
Bidirectional |
X |
X |
|
Raw |
X |
||
Properties |
Writable |
X |
X |
Accessible |
X |
X |
|
Indexable |
X |
X |
Examples
Set the red channel to max:
mln::image2d<mln::rgb8> ima = {
{ {0, 0, 255}, {0, 0, 255}, {0, 0, 255} },
{ {0, 0, 255}, {0, 0, 255}, {0, 0, 255} },
{ {0, 0, 255}, {0, 0, 255}, {0, 0, 255} }
};
auto ima_red = mln::view::channel(ima, 0);
mln::fill(ima_red, 255);
mln::io::imprint(ima);
Outputs:
(255, 0, 255) (255, 0, 255) (255, 0, 255)
(255, 0, 255) (255, 0, 255) (255, 0, 255)
(255, 0, 255) (255, 0, 255) (255, 0, 255)