Skip to content

[06] Port the Mercosul licence-plate JPEG renderer #9

Description

@jvwaldrich0

Task 06 of 16 — these are sequential, do them in order.

Previous: #8 · Next: #10

Port target: cloudpark-toolkit (Go) → this repo (Rust). Reference paths below are relative to that repo.

Goal

Port the Mercosul licence-plate image renderer — the OCR emulator (task 08) sends it as the detection snapshot.

Scope

  • Render a Brazilian Mercosul plate (ABC1D23) as a JPEG, 720 px wide, matching the Go layout: blue header band, white body, black bold monospace glyphs.
  • Embed the font in the binary (include_bytes! a mono bold TTF); no runtime font lookup.
  • Public API: plate::render(text: &str) -> Result<Vec<u8>> (JPEG bytes).
  • Crates: image + ab_glyph/rusttype.

Reference

cloudpark-toolkit/internal/plate/render.go (89 lines)

Done when

  • Unit test: render("ABC1D23") returns bytes that decode as a valid 720 px JPEG.
  • Lowercase/short input is normalised rather than panicking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions