[Haskell-cafe] Writing a pnm file
ck_kashyap at yahoo.com
Sun Aug 2 11:00:56 EDT 2009
Now that I've understood how to generate raster points of a line in Haskell - the next thing I want to do is generate a pnm file with it. I've done it in perl as of now. In perl, I can have a scalar variable $x contain a string of 256*256*3 bytes (for 24-bit 256x256 image) and set pixels using substr on LHS. I was wondering how I could do something similar in Haskell?
my$offset=$WIDTH*$y*3 + $x*3;
substr($image,$offset,3) = $pixel;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe