MartinSStewart/elm-bayer-matrix/1.0.0

BayerMatrix

matrix : Int -> Array2D Int

Get a Bayer matrix with a width and height of 2^size.

import Array2D


matrix 1
--> Array2D.fromList
--> [ [ 0, 2 ]
--> , [ 3, 1 ]
--> ]


matrix 2
--> Array2D.fromList
--> [ [ 0, 8, 2, 10 ]
--> , [ 12, 4, 14, 6 ]
--> , [ 3, 11, 1, 9 ]
--> , [ 15, 7, 13, 5 ]
--> ]
matrixNormalized : Int -> Array2D Float

Same as matrix but the values are normalized between 0 and 1.

import Array2D


matrixNormalized 1
--> Array2D.fromList
--> [ [ 0, 2 / 4 ]
--> , [ 3 / 4, 1 / 4 ]
--> ]


matrixNormalized 2
--> Array2D.fromList
--> [ [ 0, 8 / 16, 2 / 16, 10 / 16 ]
--> , [ 12 / 16, 4 / 16, 14 / 16, 6 / 16 ]
--> , [ 3 / 16, 11 / 16, 1 / 16, 9 / 16 ]
--> , [ 15 / 16, 7 / 16, 13 / 16, 5 / 16 ]
--> ]