Bitmap/Read an image through a pipe: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Add perl 6 example)
m (→‎{{header|Perl 6}}: slightly more idiomatic)
Line 188: Line 188:


$b.data = $proc.out.slurp.ords.rotor(3).map:
$b.data = $proc.out.slurp.ords.rotor(3).map:
{ Pixel.new(R => $_[0], G => $_[1], B => $_[2]) };
{ Pixel.new(R => .[0], G => .[1], B => .[2]) };


'./camelia.ppm'.IO.open(:bin, :w).write: $b.P6;</lang>
'./camelia.ppm'.IO.open(:bin, :w).write: $b.P6;</lang>


See [https://github.com/thundergnat/rc/blob/master/img/camelia.png camelia image here].
See [https://github.com/thundergnat/rc/blob/master/img/camelia.png camelia image here].



=={{header|PicoLisp}}==
=={{header|PicoLisp}}==