ExIcaoVds.Carrier behaviour (ex_icao_vds v0.3.2)

Copy Markdown

Behaviour for visible carrier backends (Data Matrix, QR, Aztec, PDF417).

Each backend renders raw VDS bytes into a machine-readable symbol and optionally decodes a symbol back to bytes.

Summary

Callbacks

Return the maximum byte capacity for the given opts.

Decode a carrier image/binary back to raw VDS bytes.

Render raw_vds bytes as a carrier symbol. Returns {:ok, binary} image data.

Return the carrier format atom (e.g. :data_matrix, :qr).

Callbacks

capacity(opts)

@callback capacity(opts :: keyword()) :: non_neg_integer()

Return the maximum byte capacity for the given opts.

decode(input, opts)

@callback decode(input :: binary(), opts :: keyword()) ::
  {:ok, binary()} | {:error, ExIcaoVds.Error.t()}

Decode a carrier image/binary back to raw VDS bytes.

encode(raw_vds, opts)

@callback encode(raw_vds :: binary(), opts :: keyword()) ::
  {:ok, binary()} | {:error, ExIcaoVds.Error.t()}

Render raw_vds bytes as a carrier symbol. Returns {:ok, binary} image data.

format()

@callback format() :: atom()

Return the carrier format atom (e.g. :data_matrix, :qr).