Safe Haskell | None |
---|
This module is an applicative wrapper for images. It introduces Pixelwise type that can be converted from and to grayscale images and which has an applicative and functor instances.
- data Pixelwise x = MkP {}
- fromImage :: (Num (P b), GetPixel b, Sized b, Size b ~ Size (Pixelwise (P b))) => b -> Pixelwise (P b)
- fromFunction :: (Int, Int) -> ((Int, Int) -> x) -> Pixelwise x
- toImage :: (SetPixel (Image a b), CreateImage (Image a b)) => Pixelwise (SP (Image a b)) -> Image a b
- toImagePar :: (SetPixel (Image a b), CreateImage (Image a b)) => Int -> Pixelwise (SP (Image a b)) -> Image a b
- remap :: (((Int, Int) -> b) -> (Int, Int) -> x) -> Pixelwise b -> Pixelwise x
- remapImage :: (CreateImage (Image a b), SetPixel (Image a b), Num (P (Image a b)), GetPixel (Image a b)) => (((Int, Int) -> P (Image a b)) -> (Int, Int) -> SP (Image a b)) -> Image a b -> Image a b
- mapImage :: (CreateImage (Image c d), SetPixel (Image c d), Num (P (Image a b)), GetPixel (Image a b)) => (P (Image a b) -> SP (Image c d)) -> Image a b -> Image c d
- mapPixels :: (t -> x) -> Pixelwise t -> Pixelwise x
- imageFromFunction :: (SetPixel (Image a b), CreateImage (Image a b)) => (Int, Int) -> ((Int, Int) -> SP (Image a b)) -> Image a b
- imageToFunction :: (GetPixel (Image a b), Num (P (Image a b))) => Image a b -> (Int, Int) -> P (Image a b)
- (<$$>) :: (Num (P b1), Size b1 ~ (Int, Int), Sized b1, GetPixel b1) => (P b1 -> b) -> b1 -> Pixelwise b
- (<+>) :: (Num (P b1), Size b1 ~ (Int, Int), Sized b1, GetPixel b1) => Pixelwise (P b1 -> b) -> b1 -> Pixelwise b
Documentation
A wrapper for allowing functor and applicative instances for non-polymorphic image types.
fromImage :: (Num (P b), GetPixel b, Sized b, Size b ~ Size (Pixelwise (P b))) => b -> Pixelwise (P b)Source
fromFunction :: (Int, Int) -> ((Int, Int) -> x) -> Pixelwise xSource
Convert a function into construct into a Pixelwise construct
toImage :: (SetPixel (Image a b), CreateImage (Image a b)) => Pixelwise (SP (Image a b)) -> Image a bSource
Convert a pixelwise construct to image.
toImagePar :: (SetPixel (Image a b), CreateImage (Image a b)) => Int -> Pixelwise (SP (Image a b)) -> Image a bSource
Convert a pixelwise construct to image.
remap :: (((Int, Int) -> b) -> (Int, Int) -> x) -> Pixelwise b -> Pixelwise xSource
Re-arrange pixel positions and values
remapImage :: (CreateImage (Image a b), SetPixel (Image a b), Num (P (Image a b)), GetPixel (Image a b)) => (((Int, Int) -> P (Image a b)) -> (Int, Int) -> SP (Image a b)) -> Image a b -> Image a bSource
mapImage :: (CreateImage (Image c d), SetPixel (Image c d), Num (P (Image a b)), GetPixel (Image a b)) => (P (Image a b) -> SP (Image c d)) -> Image a b -> Image c dSource
imageFromFunction :: (SetPixel (Image a b), CreateImage (Image a b)) => (Int, Int) -> ((Int, Int) -> SP (Image a b)) -> Image a bSource
imageToFunction :: (GetPixel (Image a b), Num (P (Image a b))) => Image a b -> (Int, Int) -> P (Image a b)Source
Convert image to a function, which returns pixel values in the domain of the image and zero elsewhere