Milena (Olena)
User documentation 2.0a Id
|
00001 #include <mln/core/image/image2d.hh> 00002 #include <mln/core/image/dmorph/image_if.hh> 00003 00004 #include <mln/value/rgb8.hh> 00005 #include <mln/io/ppm/load.hh> 00006 #include <mln/literal/colors.hh> 00007 00008 #include <tests/data.hh> 00009 #include <doc/tools/sample_utils.hh> 00010 00011 // \{ 00012 template <typename I> 00013 void fill(I& ima, mln_value(I) v) 00014 { 00015 mln_piter(I) p(ima.domain()); 00016 for_all(p) 00017 ima(p) = v; 00018 } 00019 // \} 00020 00021 int main() 00022 { 00023 using namespace mln; 00024 00025 image2d<value::rgb8> ima; 00026 io::ppm::load(ima, MLN_IMG_DIR "/small.ppm"); 00027 00028 // \{ 00029 box2d b(20,20); 00030 fill((ima | b).rw(), literal::green); 00031 // \} 00032 doc::ppmsave(ima, "fill"); 00033 00034 // \{ 00035 fill(ima, literal::green); 00036 // \} 00037 doc::ppmsave(ima, "fill"); 00038 }