[Haskell] image writing library
Ketil Malde
ketil+haskell at ii.uib.no
Fri Aug 6 08:05:23 EDT 2004
Oops. Lest anybody should copy it blindly:
mkpgm :: Array (Int,Int) Int -> String
mkpgm cm = header ++ "\n" ++ image
where header = unwords ["P2",show width,show heigth,show maxval]
image = unlines $ map show $ elems cm
- (width,heigth) = snd $ bounds cm
+ (heigth,width) = snd $ bounds cm
maxval = maximum (elems cm)
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
More information about the Haskell
mailing list