RqrrEx (rqrr_ex v0.1.0-rc.2) View Source

Call out to nif to detect barcodes using Rust rqrr crate.

Link to this section Summary

Functions

Detect a QR code in the image provided as a binary()

Link to this section Functions

Link to this function

detect_qr_codes(image_bytes)

View Source

Specs

detect_qr_codes(binary()) ::
  {:ok,
   [
     ok:
       {%RqrrEx.Metadata{
          bounds: term(),
          ecc_level: term(),
          mask: term(),
          version: term()
        }, String.t()},
     error: String.t()
   ]}
  | {:error, String.t()}

Detect a QR code in the image provided as a binary()

Returns [{:ok, {%RqrrEx.Metadata{}, String.t()}} | {:error, String.t()}].

Examples

iex> RqrrEx.detect_qr_codes(File.read!("./test.png"))
{:ok,
[
  ok: {%{
      __struct__: Rqrr.Metadata,
      bounds: [{474, 674}, {569, 674}, {569, 770}, {474, 770}],
      ecc_level: 1,
      mask: 2,
      version: 41
    },
    "The contents of the QR code!"}
]}