Safe Haskell | Safe-Inferred |
---|
- class DisplayFormat df where
- class RealFrac (GrayVal px) => GrayPixel px where
- class RealFrac (ColorVal px) => RGBPixel px where
- writeImage :: DisplayFormat df => FilePath -> df -> IO ()
- toPGM :: (Image img, GrayPixel (Pixel img)) => img -> [Char]
- toPPM :: (Image img, RGBPixel (Pixel img)) => img -> [Char]
Documentation
class DisplayFormat df whereSource
A DisplayFormat for writing to a file
class RealFrac (GrayVal px) => GrayPixel px whereSource
GrayPixels will be converted using this class
writeImage :: DisplayFormat df => FilePath -> df -> IO ()Source
Given a file name and a formatable image, writes the image to that file with the format.
>>>
frog <- readImage "images/frog.pgm"
>>>
writeImage "transposeFrog.pgm" (transpose frog)
https://raw.github.com/jcollard/unm-hip/master/examples/frog.jpg
https://raw.github.com/jcollard/unm-hip/master/examples/transposefrog.jpg
>>>
cactii <- readColorImage "images/cactii.ppm"
>>>
writeImage "inverseCactii.ppm" (imageMap (*(-1)) cactii)
https://raw.github.com/jcollard/unm-hip/master/examples/cactii.jpg
https://raw.github.com/jcollard/unm-hip/master/examples/inversecactii.jpg