Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++
3.5 KB
Raw Blame
# G1.4: qml/Veyra/IconData.js from the prototype's icons.js (Lucide, ISC).
# Every SVG element (path, line, polyline, polygon, rect, circle) becomes path data so
# one QML PathSvg per icon can draw it; the coordinates stay in the 24x24 viewBox.
import pathlib, re, sys

root = pathlib.Path(__file__).resolve().parents[2]
src = (root / "prototypes/ui-redesign-2026-09-25/icons.js").read_text(encoding="utf-8")


def num(v):
    return f"{float(v):g}"


def rect(a):
    x, y = float(a.get("x", 0)), float(a.get("y", 0))
    w, h = float(a["width"]), float(a["height"])
    r = min(float(a.get("rx", a.get("ry", 0))), w / 2, h / 2)
    if r <= 0:
        return f"M{num(x)} {num(y)}h{num(w)}v{num(h)}h{num(-w)}z"
    return (f"M{num(x + r)} {num(y)}h{num(w - 2 * r)}a{num(r)} {num(r)} 0 0 1 {num(r)} {num(r)}"
            f"v{num(h - 2 * r)}a{num(r)} {num(r)} 0 0 1 {num(-r)} {num(r)}h{num(-(w - 2 * r))}"
            f"a{num(r)} {num(r)} 0 0 1 {num(-r)} {num(-r)}v{num(-(h - 2 * r))}"
            f"a{num(r)} {num(r)} 0 0 1 {num(r)} {num(-r)}z")


def circle(a):
    cx, cy, r = float(a["cx"]), float(a["cy"]), float(a["r"])
    return (f"M{num(cx - r)} {num(cy)}a{num(r)} {num(r)} 0 1 0 {num(2 * r)} 0"
            f"a{num(r)} {num(r)} 0 1 0 {num(-2 * r)} 0z")


def points(a, close):
    p = re.findall(r"-?[\d.]+", a["points"])
    pairs = [f"{p[i]} {p[i + 1]}" for i in range(0, len(p), 2)]
    return "M" + "L".join(pairs) + ("z" if close else "")


def element(tag, attrs):
    a = dict(re.findall(r'([\w-]+)="([^"]*)"', attrs))
    if tag == "path":
        # A leading relative m is absolute inside its own element, but relative to the
        # previous element's end once they are joined; anchor it at the origin.
        d = a["d"].strip()
        return "M0 0" + d if d.startswith("m") else d
    if tag == "line":
        return f"M{a['x1']} {a['y1']}L{a['x2']} {a['y2']}"
    if tag == "polyline":
        return points(a, False)
    if tag == "polygon":
        return points(a, True)
    if tag == "rect":
        return rect(a)
    if tag == "circle":
        return circle(a)
    sys.exit(f"unsupported element {tag}")


body = src[src.index("const P = {"):src.index("};")]
icons = {}
for name, svg in re.findall(r"^\s*(\w+):\s*'([^']*)'", body, re.M):
    icons[name] = "".join(element(t, at) for t, at in re.findall(r"<(\w+)([^>]*)/>", svg))

# Inline SVGs the prototype writes into pages-a.js instead of icons.js: the 10-second
# skip buttons and the filled play/pause glyphs of the .play button (drawn with fill).
EXTRA = {
    "rotatecw": '<path d="M20 7v5h-5M20 12a8 8 0 1 0-2.34 5.66"/>',
    "back10": '<path d="M11 17l-5-5 5-5"/><path d="M18 17l-5-5 5-5"/>',
    "fwd10": '<path d="M13 17l5-5-5-5"/><path d="M6 17l5-5-5-5"/>',
    "playfill": '<polygon points="7 4 20 12 7 20"/>',
    "pausefill": '<rect x="6" y="4" width="4.5" height="16" rx="1.2"/><rect x="13.5" y="4" width="4.5" height="16" rx="1.2"/>',
}
for name, svg in EXTRA.items():
    icons[name] = "".join(element(t, at) for t, at in re.findall(r"<(\w+)([^>]*)/>", svg))

out = ["// Generated by tools/qt_probe/make-icons.py from prototypes/ui-redesign-2026-09-25/icons.js.",
       "// Lucide icons (ISC license, lucide.dev); see THIRD_PARTY_NOTICES.md. Do not edit by hand.",
       "// back10/fwd10/playfill/pausefill are the prototype's own inline SVGs (pages-a.js).",
       ".pragma library", "", "var paths = {"]
out += [f'    "{k}": "{v}",' for k, v in icons.items()]
out[-1] = out[-1].rstrip(",")
out.append("}")
(root / "qml/Veyra/IconData.js").write_text("\n".join(out) + "\n", encoding="utf-8")
print(len(icons), "icons")