| Copyright | © 2016 Mark Karpov |
|---|---|
| License | BSD 3 clause |
| Maintainer | Mark Karpov <markkarpov@openmailbox.org> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Codec.Picture.Extra
Description
Utilities for image transformation with JuicyPixels.
- scaleBilinear :: Int -> Int -> Image PixelRGB8 -> Image PixelRGB8
- crop :: Pixel a => Int -> Int -> Int -> Int -> Image a -> Image a
- flipHorizontally :: Pixel a => Image a -> Image a
- flipVertically :: Pixel a => Image a -> Image a
- rotateLeft90 :: Pixel a => Image a -> Image a
- rotateRight90 :: Pixel a => Image a -> Image a
Scaling
Arguments
| :: Int | Desired width |
| -> Int | Desired height |
| -> Image PixelRGB8 | Original image |
| -> Image PixelRGB8 | Scaled image |
Scale image using bi-linear interpolation. This is specialized to
PixelRGB8 only for speed (polymorphic version is easily written, but
it's more than twice as slow).
Cropping
Arguments
| :: Pixel a | |
| => Int | Index (X axis) of first pixel to include |
| -> Int | Index (Y axis) of first pixel to include |
| -> Int | Width of resulting image |
| -> Int | Height of resulting image |
| -> Image a | Original image |
| -> Image a | Cropped image |
Crop given image. If supplied coordinates are greater than size of original image, image boundaries are used instead.
Rotation
flipHorizontally :: Pixel a => Image a -> Image a Source
Flip image horizontally.
flipVertically :: Pixel a => Image a -> Image a Source
Flip image vertically.
rotateLeft90 :: Pixel a => Image a -> Image a Source
Rotate image to the left by 90°.
rotateRight90 :: Pixel a => Image a -> Image a Source
Rotate image to the right by 90°.