|
|
|
|
|
|
| Synopsis |
|
|
|
|
| Types
|
|
|
|
|
|
|
|
|
|
| Creating and copying images
|
|
|
| Create a new empty image.
|
|
|
| Make a copy of an image.
|
|
| Memory management
|
|
|
| :: | | | => IO Image | Image creation action.
| | -> Image -> IO b | Some operation on the image. The result should
not reference the Image.
| | -> IO b | | | Creates an image, performs an operation on the image, and
frees it.
This function allows block scoped management of Image objects.
If you are handling large images, the delay before the finalizer which frees
the image runs may cause significant temporary extra memory use.
Use this function to force the image to be freed as soons as you are done with it.
Note that it is unsafe to hold on to the Image after the
function is done.
|
|
|
| Loading images
|
|
| JPEG
|
|
|
| Load a JPEG image from a file.
|
|
|
| :: | | | => Int | Buffer size.
| | -> Ptr a | Buffer with image data.
| | -> IO Image | | | Load a JPEG image from a buffer.
|
|
|
| PNG
|
|
|
| Load a PNG image from a file.
|
|
|
| :: | | | => Int | Buffer size.
| | -> Ptr a | Buffer with image data.
| | -> IO Image | | | Load a PNG image from a buffer.
|
|
|
| GIF
|
|
|
| Load a GIF image from a file.
|
|
|
| :: | | | => Int | Buffer size.
| | -> Ptr a | Buffer with image data.
| | -> IO Image | | | Load a GIF image from a buffer.
|
|
|
| Saving images
|
|
| JPEG
|
|
|
| :: Int | quality: 0-95, or negative for default quality.
| | -> FilePath | | | -> Image | | | -> IO () | | | Save an image as a JPEG file.
|
|
|
| PNG
|
|
|
| Save an image as a PNG file.
|
|
| GIF
|
|
|
| Save an image as a GIF file.
|
|
| Getting image information
|
|
|
| :: Image | | | -> IO (Int, Int) | (width, height)
| | Get the size of an image.
|
|
|
| Manipulating images
|
|
|
| :: Int | width in pixels of output image
| | -> Int | height in pixels of output image
| | -> Image | | | -> IO Image | | | Resize an image to a give size.
|
|
|
|
| :: Int | 1 for 90 degrees counter-clockwise,
2 for 180 degrees, etc.
| | -> Image | | | -> IO Image | | | Rotate an image by a multiple of 90 degrees counter-clockwise.
|
|
|
| Drawing
|
|
|
| Fill the entire image with the given color.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Use anti-aliasing when performing the given drawing function.
This can cause a segault with some gd versions.
|
|
|
|
| Colors
|
|
|
|
|
|
| :: Int | Red (0-255)
| | -> Int | Green (0-255)
| | -> Int | Blue (0-255)
| | -> Int | Alpha (0-127), 0 is opaque, 127 is transparent
| | -> Color | |
|
|
| Produced by Haddock version 2.1.0 |