Figler.Render.Oracle (figler v0.1.0-beta.1)

Copy Markdown View Source

Decodes reference PNGs and compares them with Figler RGBA renders.

Reference images may be produced by OpenPencil or another visual oracle. Keep large .fig fixtures and their reference images outside git, then compare identical page/root, scale, bounds, and background selections.

Summary

Functions

Compares a reference PNG with a tightly packed RGBA render.

Decodes a PNG into a tightly packed RGBA buffer.

Functions

compare_png(reference_png, actual, opts \\ [])

@spec compare_png(binary(), Figler.Render.PixelDiff.raw_image(), keyword()) ::
  {:ok, Figler.Render.PixelDiff.metrics()} | {:error, term()}

Compares a reference PNG with a tightly packed RGBA render.

decode_png(png)

@spec decode_png(binary()) ::
  {:ok, Figler.Render.PixelDiff.raw_image()} | {:error, term()}

Decodes a PNG into a tightly packed RGBA buffer.