Ring locator: contrast ranking, all-round ink check; bench baseline switch
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
// synthetic camera frames of a projected ring code: a washed-out screen in a room, seen by a phone sensor
|
||||
import { render, DISC } from "/static/js/ringcode.js";
|
||||
import { render as renderV1 } from "/static/ringlab/ringcode_v1.js";
|
||||
|
||||
// v1: draw the code as it was before the far-reading work, for baselines
|
||||
export const design = { v1: false };
|
||||
|
||||
export function lcg(seed) {
|
||||
let s = (seed >>> 0) || 1;
|
||||
@@ -51,7 +55,7 @@ function page(pw, ph, d, t, rnd) {
|
||||
const ctx = c.getContext("2d", { willReadFrequently: true });
|
||||
ctx.fillStyle = "#f5f6fa"; ctx.fillRect(0, 0, pw, ph);
|
||||
const cx = pw * 0.36, cy = ph * 0.54, unit = (d / 2 / DISC);
|
||||
if (!t.nocode) render(ctx, cx, cy, unit, t.theta, t.bits, t.anim, t.fade || null);
|
||||
if (!t.nocode) (design.v1 ? renderV1 : render)(ctx, cx, cy, unit, t.theta, t.bits, t.anim, t.fade || null);
|
||||
ctx.fillStyle = "#1c2036";
|
||||
ctx.font = `700 ${d * 0.11}px system-ui`; ctx.fillText("Inscription", pw * 0.66, ph * 0.2);
|
||||
ctx.font = `${d * 0.05}px system-ui`;
|
||||
|
||||
Reference in New Issue
Block a user