|Maintainer||Andy Gill <firstname.lastname@example.org>|
This module coverts 2D arrays into
Boards, and back, and supplies basic dithering algorithms.
- boardToArray :: Average a => (Int, Int) -> Int -> Board a -> Array (Int, Int) a
- arrayToBoard :: (Lerp a, Scale a) => Array (Int, Int) a -> Board (Maybe a)
- threshold :: Floating a => (a -> a) -> Array (Int, Int) a -> Array (Int, Int) a
- floydSteinberg :: Floating a => (a -> a) -> Array (Int, Int) a -> Array (Int, Int) a
- widthHeight :: Array (Int, Int) a -> (Int, Int)
|:: Average a|
|=> (Int, Int)|
the x,y size of the image to be captured. We assume the bottom left hand size is 0,0.
the square root of the amount of super-sampling to be done. I recommend 3, which is 9 points.
|-> Board a|
the board to sample.
|-> Array (Int, Int) a|
the result array.
boardToArray turns a Board into a 2D Array (pixelization).
arrayToBoard turns a 2D Array into a Board, using bi-linear inteprelation.
threshold quantized based on a simple, pointwise function.
floydSteinberg quantized using the Floyd Steinberg algorithm.