Hi,
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?

sub setPixel{
my($x,$y,$red,$green,$blue)=...@_;
my$pixel=pack "CCC",$red,$green,$blue;
my$offset=$WIDTH*$y*3 + $x*3;
substr($image,$offset,3) = $pixel;
}

Regards,
Kashyap



      
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to