gd-2006.7.12ContentsIndex
Graphics.GD
Contents
Types
Loading images
JPEG
PNG
GIF
Saving images
JPEG
PNG
GIF
Getting image information
Manipulating images
Synopsis
type Image = ForeignPtr GDImage
loadJpegFile :: FilePath -> IO Image
loadJpegData :: Int -> Ptr a -> IO Image
loadPngFile :: FilePath -> IO Image
loadPngData :: Int -> Ptr a -> IO Image
loadGifFile :: FilePath -> IO Image
loadGifData :: Int -> Ptr a -> IO Image
saveJpegFile :: Int -> FilePath -> Image -> IO ()
savePngFile :: FilePath -> Image -> IO ()
saveGifFile :: FilePath -> Image -> IO ()
imageSize :: Image -> IO (Int, Int)
resizeImage :: Int -> Int -> Image -> IO Image
rotateImage :: Int -> Image -> IO Image
Types
type Image = ForeignPtr GDImage
Loading images
JPEG
loadJpegFile :: FilePath -> IO Image
Load a JPEG image from a file.
loadJpegData
:: IntBuffer size.
-> Ptr aBuffer with image data.
-> IO Image
Load a JPEG image from a buffer.
PNG
loadPngFile :: FilePath -> IO Image
Load a PNG image from a file.
loadPngData
:: IntBuffer size.
-> Ptr aBuffer with image data.
-> IO Image
Load a PNG image from a buffer.
GIF
loadGifFile :: FilePath -> IO Image
Load a GIF image from a file.
loadGifData
:: IntBuffer size.
-> Ptr aBuffer with image data.
-> IO Image
Load a GIF image from a buffer.
Saving images
JPEG
saveJpegFile
:: Intquality: 0-95, or negative for default quality.
-> FilePath
-> Image
-> IO ()
Save an image as a JPEG file.
PNG
savePngFile :: FilePath -> Image -> IO ()
Save an image as a PNG file.
GIF
saveGifFile :: FilePath -> Image -> IO ()
Save an image as a GIF file.
Getting image information
imageSize
:: Image
-> IO (Int, Int)(width, height)
Get the size of an image.
Manipulating images
resizeImage
:: Intwidth in pixels of output image
-> Intheight in pixels of output image
-> Image
-> IO Image
Resize an image to a give size.
rotateImage
:: Int1 for 90 degrees counter-clockwise, 2 for 180 degrees, etc.
-> Image
-> IO Image
Rotate an image by a multiple of 90 degrees counter-clockwise
Produced by Haddock version 0.7