EQRCode v0.1.0 EQRCode.Matrix View Source

EQRCode matrix functions.

Here’s the axis for the matrix.

(0,0)    (0,7)        (0,20)
   +---------------------> y
   |
   |
(7,0)|     (7,7)
   |
   |
   |
   |
   v
   x
(20,0)                (20,20)

Link to this section Summary

Functions

Draw the alignment patterns

Draw the dark module

Draw the data bits with mask

Draw the data bits with mask 0

Draw the finder patterns, three at a time

Fill the reserved format information areas

Draw the quite zone

Draw the reserved format information areas

Draw the reserved version information areas

Draw the seperators

Draw the timing patterns

Fill the reserved version information areas

Initialize the matrix

Given the starting point {x, y} and {width, height} returns the coordinates of the shape

Link to this section Types

Link to this type coordinate() View Source
coordinate() :: {integer(), integer()}
Link to this type t() View Source
t() :: %EQRCode.Matrix{
  mask: term(),
  matrix: matrix(),
  modules: integer(),
  version: integer()
}

Link to this section Functions

Link to this function draw_alignment_patterns(m) View Source
draw_alignment_patterns(t()) :: t()

Draw the alignment patterns.

Link to this function draw_dark_module(m) View Source
draw_dark_module(t()) :: t()

Draw the dark module.

Link to this function draw_data_with_mask(m, data) View Source
draw_data_with_mask(t(), binary()) :: t()

Draw the data bits with mask.

Link to this function draw_data_with_mask0(m, data) View Source
draw_data_with_mask0(t(), binary()) :: t()

Draw the data bits with mask 0.

Link to this function draw_finder_patterns(m) View Source
draw_finder_patterns(t()) :: t()

Draw the finder patterns, three at a time.

Link to this function draw_format_areas(m) View Source
draw_format_areas(t()) :: t()

Fill the reserved format information areas.

Link to this function draw_quite_zone(m) View Source
draw_quite_zone(t()) :: t()

Draw the quite zone.

Link to this function draw_reserved_format_areas(m) View Source
draw_reserved_format_areas(t()) :: t()

Draw the reserved format information areas.

Link to this function draw_reserved_version_areas(m) View Source
draw_reserved_version_areas(t()) :: t()

Draw the reserved version information areas.

Link to this function draw_seperators(m) View Source
draw_seperators(t()) :: t()

Draw the seperators.

Link to this function draw_timing_patterns(m) View Source
draw_timing_patterns(t()) :: t()

Draw the timing patterns.

Link to this function draw_version_areas(m) View Source
draw_version_areas(t()) :: t()

Fill the reserved version information areas.

Initialize the matrix.

Given the starting point {x, y} and {width, height} returns the coordinates of the shape.

Example:

iex> EQRCode.Matrix.shape({0, 0}, {3, 3})
[{0, 0}, {0, 1}, {0, 2},
 {1, 0}, {1, 1}, {1, 2},
 {2, 0}, {2, 1}, {2, 2}]