RGB (View)
Include <mln/core/image/view/rgb.hpp>
-
auto blue(Image ima)
Makes a view that project the red channel of an rgb colored image.
Makes a view that project the green channel of an rgb colored image.
Makes a view that project the blue channel of an rgb colored image.
- Parameters:
ima – Input range
mln::image2d<mln::rgb8> ima = ...; auto ima_r = mln::view::red(ima); auto ima_g = mln::view::green(ima); auto ima_b = mln::view::blue(ima);
-
auto blue(Image ima)
ima |
red(ima), green(ima), blue(ima) |
||
---|---|---|---|
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_r = mln::view::red(ima);
mln::fill(ima_r, 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)