SPB Git

Repository Public

door-frames.sh 3.6 KB 78 lines shellscript

1#!/usr/bin/env bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : Immo-Ka iOS8# File             : Scripts/door-frames.sh9# Description      : planche de la transition signature figée aux instants des10#                    planches de référence du système de marque11#                    (/tmp/immoka-v2/brand/transition/signature-mobile-*.png),12#                    pour comparaison image par image. usage : door-frames.sh13#                    [clair|sombre] [signature|standard] →14#                    build/shots/porte-planche-<mode>.jpg15# Module           : Scripts16# Repository       : https://git.spboucher.ai/immo-ka-ios-v317# Project Website  : https://www.immo-ka.com18# Created          : 2026-11-2519# Last Modified    : 2026-11-2820#21# Author           : Simon-Pierre Boucher22# Position         : Professor of Finance23# Institution      : Université du Québec en Outaouais (UQO)24# Organization     : SP Boucher25# Website          : https://spboucher.ai26# Git              : https://git.spboucher.ai27#28# Preferred Contact: support@spboucher.ai29# Technical Contact: dev@spboucher.ai30# Security/Admin   : admin@spboucher.ai31#32# Copyright (c) 202633# Simon-Pierre Boucher34# All rights reserved where applicable. This file is governed by the35# applicable project license, copyright notices and relevant law.36# Existing third-party rights and notices remain unaffected.37#38# License          : None specified (no license file in this repository)39#40# Do not embed credentials, private keys, access tokens,41# certificates or confidential personal information.42#43# =============================================================================44# END OF SP BOUCHER SOURCE HEADER45# =============================================================================4647set -uo pipefail48cd "$(dirname "$0")/.."49MODE="${1:-clair}"; LEVEL="${2:-signature}"50SIM="${IMMOKA_SIM:-ImmoKa-v3}"51U="$(xcrun simctl list devices | grep -F "$SIM (" | head -1 | sed -E 's/.*\(([0-9A-F-]{36})\).*/\1/')"52xcrun simctl boot "$U" 2>/dev/null; xcrun simctl bootstatus "$U" >/dev/null 2>&153APP="$([ "$MODE" = clair ] && echo light || echo dark)"54xcrun simctl ui "$U" appearance "$APP"55mkdir -p build/shots/porte56# mêmes instants que la planche de référence (ms après le toucher)57TIMES="${TIMES:-120 300 400 480 560 640 720 800 880 960 1000 1080 1160 1240 1320 1400}"58for MS in $TIMES; do59  T="$(python3 -c "print($MS/1000)")"60  IMMOKA_SIM="$SIM" Scripts/build.sh run -IKTab discover -IKDoorDemo "$T" -IKDoorLevel "$LEVEL" -IKInMemory YES -appearance "$APP" >/dev/null 2>&161  sleep "${WAIT:-11}"62  xcrun simctl io "$U" screenshot "build/shots/porte/$MODE-$LEVEL-$MS.png" >/dev/null 2>&163done64python3 - "$MODE" "$LEVEL" $TIMES <<'PY'65import sys66from PIL import Image, ImageDraw67mode, level, times = sys.argv[1], sys.argv[2], sys.argv[3:]68ims = [Image.open(f"build/shots/porte/{mode}-{level}-{t}.png").convert("RGB").resize((300, 652)) for t in times]69cols = 8; rows = (len(ims) + cols - 1) // cols70sheet = Image.new("RGB", (cols * 306 + 6, rows * 658 + 6), (150, 150, 150))71for k, im in enumerate(ims):72    x, y = 6 + (k % cols) * 306, 6 + (k // cols) * 65873    sheet.paste(im, (x, y))74    d = ImageDraw.Draw(sheet); d.rectangle([x, y, x + 62, y + 16], fill=(0, 0, 0)); d.text((x + 5, y + 3), f"{times[k]} ms", fill=(255, 255, 255))75out = f"build/shots/porte-planche-{mode}-{level}.jpg"76sheet.save(out, quality=86); print(out)77PY78
Files main
Menu

Theme