inky v1.0.2 Inky.PixelUtil View Source

PixelUtil maps pixels to bitstrings to be sent to an Inky screen

Link to this section Summary

Functions

Only exposed for testing purposes. Do not use.

Only exposed for testing purposes. Do not use.

Link to this section Functions

Link to this function

normalised_rotation(degrees) View Source

Only exposed for testing purposes. Do not use.

iex> Enum.map(
...>     [-360, -270, -180, -90, 0, 90, 180, 270, 360, 450],
...>     &Inky.PixelUtil.normalised_rotation/1
...> )
[0, 1, 2, 3, 0, 1, 2, 3, 0, 1]
Link to this function

pixels_to_bits(pixels, width, height, rotation_degrees, color_map) View Source

Only exposed for testing purposes. Do not use.

iex> Enum.map([3, 1, 2, 0], &Inky.PixelUtil.rotation_opts/1)
[{:x, {{:x, -1}, {:y, 1}}},
 {:x, {{:x, 1}, {:y, -1}}},
 {:y, {{:y, -1}, {:x, -1}}},
 {:y, {{:y, 1}, {:x, 1}}}]