QQR.BitMatrix (QQR v0.2.0)

Copy Markdown View Source

2D binary matrix representing QR code modules.

Summary

Types

t()

@type t() :: %QQR.BitMatrix{
  data: tuple(),
  height: non_neg_integer(),
  width: non_neg_integer()
}

Functions

from_list(width, height, list)

@spec from_list(non_neg_integer(), non_neg_integer(), [0 | 1]) :: t()

get(bit_matrix, x, y)

@spec get(t(), integer(), integer()) :: boolean()

new(width, height)

@spec new(non_neg_integer(), non_neg_integer()) :: t()

set(m, x, y, value)

@spec set(t(), non_neg_integer(), non_neg_integer(), boolean()) :: t()

set_region(matrix, left, top, width, height, value)

@spec set_region(
  t(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer(),
  boolean()
) :: t()

to_svg(matrix, opts \\ [])

@spec to_svg(
  t(),
  keyword()
) :: String.t()

Render the matrix as an SVG string. See QQR.SVG for options.

to_svg_iodata(matrix, opts \\ [])

@spec to_svg_iodata(
  t(),
  keyword()
) :: iodata()

Render the matrix as SVG iodata. See QQR.SVG for options.