比较提交

..
作者 SHA1 备注 提交日期
mac 5252296b7b Record verified Dayu Color 1.13.2 integrity delivery 2026-11-05 23:16:30 +08:00
mac db6b2b05b3 Reject modified Dayu Color bundles at registration, service startup and update 2026-11-05 23:06:15 +08:00
mac a7508203d1 Record Dayu Color re-signing protection assessment 2026-11-05 22:55:59 +08:00
mac 38afc087d5 Verify and record published 1.13.1 pixel clone installer 2026-11-05 22:34:12 +08:00
mac 46153a26ed Record signed pixel clone build and Final Cut Pro validation 2026-11-05 22:31:22 +08:00
mac 1659f3d385 Clone original pixels by translation and keep the tracked footprint stable 2026-11-05 22:21:25 +08:00
mac dff9134be7 Keep the clone identity through the host test document replacement 2026-11-05 22:12:43 +08:00
mac 1f1b7917e7 Make the clone source crosshair draggable without changing target tracks 2026-11-05 22:09:33 +08:00
mac 4fb008e100 Verify and record published 1.13.0 installer 2026-11-05 22:08:05 +08:00
mac 07601e50bf Record signed clone stamp release and Final Cut Pro acceptance 2026-11-05 22:04:20 +08:00
mac 9977b5c41b Draw a portable clone stamp glyph for the formal host 2026-11-05 21:53:44 +08:00
mac ca8a5433d3 Cover clone creation and tracking through real canvas callbacks 2026-11-05 21:47:25 +08:00
mac 213d01dbd8 Verify the stamp toolbar and skip unrelated film state work 2026-11-05 21:44:30 +08:00
mac 0782b5e654 Add tracked clone stamps and reduce canvas redraw work 2026-11-05 21:42:16 +08:00
mac 504e08e425 Add project handoff and require updates after every task 2026-11-05 19:14:44 +08:00
mac bbb258e495 Record published 1.12.1 installer and verify remote recovery 2026-11-05 18:31:22 +08:00
mac 9f0adbeb3b Record signed 1.12.1 host acceptance and notarized installer 2026-11-05 18:15:19 +08:00
mac 43320c7ccd Keep the attached inspector header visible and refresh its curve histogram from output 2026-11-05 18:00:53 +08:00
mac 54ca7150f8 Record Final Cut Pro library-save triage and local diagnostic signals 2026-11-05 17:42:33 +08:00
mac 65e4c02bd0 Read built-in white balance directly from host parameters 2026-11-05 17:09:43 +08:00
mac fb21dabc08 Link white-balance solver declarations into native acceptance checks 2026-11-05 17:06:50 +08:00
mac e241f2a3e5 Encode canvas pick timing with macOS CoreMedia dictionaries 2026-11-05 17:05:10 +08:00
mac c9bd52fff5 Use typed CMTime values for canvas white-balance events 2026-11-05 17:02:00 +08:00
mac 585c83c8a1 Implement adaptive inspector and responsive canvas controls for 1.12.1 2026-11-05 17:01:00 +08:00
mac 91b66eb2d8 Record verified 1.12.0 article and beta update publication 2026-11-05 16:10:06 +08:00
mac ee14dd9185 Prepare article and beta update feed for Dayu Color 1.12.0 build 79 2026-11-05 15:58:29 +08:00
mac b77226b7e6 release: finalize 1.12.0 download verification, recovery and generated-copy cleanup 2026-11-05 12:47:39 +08:00
mac b72e6b3172 release: preserve signed notarized 1.12.0 build 79 package and recovery instructions 2026-11-05 12:40:09 +08:00
mac 4ba65f1bde docs: accept notarized build 79 and prepare unified workspace release notes 2026-11-05 12:38:11 +08:00
mac beccf2fc01 feat: add recent LUT shortcuts and move canvas controls to the lower corners 2026-11-05 12:25:26 +08:00
mac 16b20af39a test: record real host acceptance and exact CF trajectory comparison for build 78 2026-11-05 12:12:54 +08:00
mac 8bbd386abb chore: preserve notarized build 78 installation and 831 native checks 2026-11-05 12:01:44 +08:00
mac df6bf52f32 test: resolve authored pen masks by identity and prepare boundary-fix build 78 2026-11-05 11:16:49 +08:00
mac 8ac7ca43da fix: preserve last-frame canvas curve and pen edits across the host out-point boundary 2026-11-05 11:12:25 +08:00
mac dad77aff77 fix: align paused scope requests at the exclusive clip end to the final visible frame 2026-11-05 11:07:17 +08:00
mac b60ae3e45b wip: adapt workspace groups and LUT grid, add skin-tone guide and host write diagnostics 2026-11-05 10:54:59 +08:00
mac 331e3ff315 docs: preserve build 76 delivery and native verification before host feedback fixes 2026-11-05 10:45:44 +08:00
mac b8a003970a fix: replay cached final-output scopes when opening a paused workspace 2026-11-05 10:22:40 +08:00
mac 411900b928 fix: fit mask tracking controls and restore editable numeric fields in workspace 2026-11-05 10:13:09 +08:00
mac 0ef847f6bb fix: bound vector-scope coordinates before rounding extreme samples 2026-11-05 09:57:59 +08:00
mac ded1f22be8 fix: stabilize inspector refresh and finalize compact workspace candidate 75 2026-11-05 09:56:52 +08:00
mac 1396d5b7bf wip: replace workspace tabs with horizontal layer-driven editing and persistent four-up scopes 2026-11-05 09:48:46 +08:00
mac 57059390d1 wip: restore canvas icon buttons, retain closing pen path and add vector sampling 2026-11-05 09:30:31 +08:00
mac 38e11aa103 plan: adopt user-reviewed horizontal workspace with persistent four scopes 2026-11-05 09:26:52 +08:00
mac bf25c6c9c1 delivery: prepare package inputs while user performs formal host acceptance 2026-11-05 09:19:50 +08:00
mac bc974bc394 handoff: preserve pending host acceptance after repeated Mac lock-screen blocker 2026-11-05 04:26:47 +08:00
mac a6910ebff4 fix: preserve scene identifier while decoding native preset versions 2026-11-05 04:25:33 +08:00
mac 606544820f research: verify native preset stream and prepare bounded trajectory reader 2026-11-05 04:24:51 +08:00
mac 2d162a8fc5 checkpoint: notarized 1.12.0 candidate, host verification awaiting Mac unlock 2026-11-05 04:15:01 +08:00
mac 226b7e1e93 fix: own split resizing and verify unclipped native layer controls 2026-11-05 04:10:50 +08:00
mac a9cf2eda29 fix: start workspace as a narrow strip and keep native row controls visible 2026-11-05 04:01:21 +08:00
mac a0a97dfd88 fix: align tracker preprocessing and shared object lifecycle with native evidence 2026-11-05 03:49:21 +08:00
mac 9ba6eeb00a fix: keep remote workspace geometry owned by FCP 2026-11-05 03:30:47 +08:00
mac 385fb47f14 feat: finalize compact canvas shared-mask drawing and workspace synchronization 2026-11-05 03:28:48 +08:00
mac ca352248c1 feat: WIP unified workspace shared mask objects and OpenCV tracker core 2026-11-05 03:16:17 +08:00
mac 78e53b3889 docs: establish unified workspace baseline and shared mask contract 2026-11-05 03:05:02 +08:00
mac b33b9634e2 docs: refresh canvas control handoff for accepted 1.11.0 2026-11-05 02:33:13 +08:00
mac 1144a89214 release: verify published 1.11.0 downloads recovery and cleanup 2026-11-05 02:23:49 +08:00
共修改 140 个文件,包含 26021 行新增和 698 行删除

没有与搜索条件相匹配的文件

+15
查看文件
@@ -0,0 +1,15 @@
# 大鱼调色项目规则
本文件适用于当前 Git 仓库及其子目录。沿用本机全局开发、正式交付和 Git 备份约定。
## 接手
- 新对话先读 [开发交接.md](开发交接.md) 的当前基线和待跟进事项。核对实际工作区、分支、远端、正式安装版本和交付锁,再依据用户本轮要求继续。
- 按范围查阅专项交接、`verification/` 和 [RECOVERY.md](RECOVERY.md)。旧版本文档用于查找历史,当前状态以实际结果和对应版本的验证记录为准。
## 每次任务结束都要更新交接
- 无论本轮是开发、排查、发布、纯文档工作,还是暂时受阻,结束前都在 [开发交接.md](开发交接.md) 记录本轮工作。更新受影响的当前基线和待跟进事项,保留前序任务记录。
- 写清任务日期与目标、实际完成的改动和关键路径、验证结果及覆盖范围、交付状态,以及仍待处理的事项和接手第一步。涉及发行时分别标明实际编译提交、版本标签、本机安装、Git Release、站点文章和主 APP 更新通道,注明对应版本和核验依据。
- 区分本机实测、用户确认、自动检查与尚待复现的反馈。保留有助于继续排查的限制、假设和阻塞,引用已有报告。凭据、用户素材和未脱敏日志留在各自受控位置。
- 在本轮结束前按 Git 约定提交交接文档,推送并回读远端。最后回复附上交接入口;远端核验受阻时注明本地提交与具体原因。
+11
查看文件
@@ -0,0 +1,11 @@
# 大鱼调色 1.12.0(79)
统一工作区采用横排图标工具、左侧图层、中间所选模块和右侧常驻四宫格示波器。分栏与窗口尺寸可调整,模块新增、删除、启停、参数和共享蒙版与主检视器同步。HSL色块上排、三轴同宽;蜘蛛盘左盘面、右参数和混合量。矢量图新增肤色参考线。
LUT浏览器保留现有文件夹、真实帧预览、缩略图和异步载入,恢复随宽度换行的多行网格。风格LUT调整参数下增加最近使用缩略图快捷入口,点击应用到当前图层,成功后记录前移。选择LUT图层直接浏览,点击图层蒙版符号进入编辑/跟踪。
画布图标按钮移到左下横排,保留矩形、椭圆、钢笔、曲线、畸变、肤色范围和LUT入口;控制面板按钮在右下。畸变通过画面控件调整,从工作区排除。修复片尾界面时间与显示帧时间差导致的示波器等待和画布写入被拒,钢笔闭合与曲线保存已由用户实际确认正常。
同一蒙版对象可同时关联HSL、蜘蛛盘及其它模块,支持先画再分配,或从模块画后继续添加关联;轨迹和形状共同更新,旧独立蒙版及v7预设兼容。跟踪按本机ColorFinale2.16.2证据重建,使用锁定官方源码构建的OpenCV4.5.1,许可证随APP提供。真实同素材、同矩形共同99帧最大位置差约0.008源像素、角度差约0.015°;原版导出缺最后一帧,完整100帧报告保留缺失。当前对照覆盖合成平移,不宣称任意素材/分组/键间插值完全等价。
正式安装通过834项原生检查,并完成FCP中的布局、快捷LUT应用、检视器重开和四路示波器检查。需要macOS14.6或更高、Apple Silicon、Final Cut Pro或Motion。工作区由宿主托管为可调整浮动窗口,公开FxPlug接口未提供原生停靠到FCP检视器。空间蒙版/畸变可用完整预设保存,静态Cube无法保存空间处理。
+4 -1
查看文件
@@ -38,7 +38,10 @@ def main():
assert (skill / "package_fxplug.py").is_file(), "请指定含 pkg-forge 技能的 PKG 工坊 checkout"
delivery = json.loads((ROOT / "verification/Delivery.json").read_text())
info = plistlib.loads((APP / "Contents/Info.plist").read_bytes())
assert delivery["status"] == "verified" and delivery["path"] == str(APP)
assert delivery["path"] == str(APP)
# Preparation only stages and validates inputs. Creating a distributable
# package still requires completed host acceptance of the formal install.
assert args.prepare_only or delivery["status"] == "verified", "正式安装尚未完成宿主验收"
assert info["CFBundleIdentifier"] == "com.dayu.color"
assert (info["CFBundleShortVersionString"], info["CFBundleVersion"]) == (delivery["version"], delivery["build"])
args.output_dir.mkdir(parents=True, exist_ok=True)
+20
查看文件
@@ -0,0 +1,20 @@
{
"status": "publish",
"title": "大鱼调色 1.12.0 公测版|统一调色工作区与共享蒙版",
"content": "<!-- wp:paragraph -->\n<p>大鱼调色 1.12.0 公测版适用于 Final Cut Pro 与 Motion。这个版本把图层、调色参数、LUT 浏览和示波器放到同一个可调整大小的控制面板里。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">1.12.0 公测更新</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p><strong>统一调色工作区</strong>。从画布右下角或检视器点击“控制面板”。左侧管理图层,中间调节选中的模块,右侧同时显示亮度波形、RGB 分列、直方图和带肤色参考线的矢量图。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>画布工具与共享蒙版</strong>。左下角可直接绘制矩形、椭圆和钢笔蒙版,也能打开曲线、畸变、肤色范围或 LUT。一个蒙版可同时作用于 HSL、蜘蛛盘等多个图层。点击图层上的蒙版图标即可编辑形状或运行跟踪。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>最近使用 LUT</strong>。风格 LUT 参数下方显示最近使用的缩略图,点击即可应用到当前图层。浏览库按窗口宽度自动换行,保留文件夹和画面预览。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>编辑与加载</strong>。改善切换片段、重新打开检视器及停在片尾时的加载,修正钢笔闭合和画布曲线调整的保存问题。已在本机 Final Cut Pro 验证。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">在时间线里完成调色</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p><strong>色彩管理与基础调整</strong>:支持 CST 输入、工作空间和输出转换,并提供曝光、白平衡、曲线、HSL、色轮及蜘蛛盘等调节工具。首次使用时,请在一级调色中选择与素材相符的输入曲线和色域。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>LUT 与风格管理</strong>:通过缩略图浏览、收藏和预览管理常用 LUT,支持自选 LUT 文件与文件夹。完整预设用于保存组合调节;适合静态颜色变换的处理可导出 Cube LUT,颗粒、晕光、蒙版等时间或空间效果不属于静态 LUT 的保存范围。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>胶片模拟与印片外观</strong>:包含减色、颗粒、晕光、辉光、暗角及通道混合器,提供 Kodak 2383、Fuji 3513 等八种印片外观,可独立调整强度。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>局部蒙版与工具叠层</strong>:可针对单独工具添加蒙版、建立相邻叠层,并使用关键帧与跟踪处理局部区域,方便细调画面的不同部分。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">历史更新</h2>\n<!-- /wp:heading -->\n\n<!-- wp:heading {\"level\":3} -->\n<h3 class=\"wp-block-heading\">1.10.0 画布工具与独立工作区</h3>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p>下方为 1.10.0 的深色与浅色界面记录。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:image {\"id\":15840,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https://dayu.media/wp-content/uploads/2026/11/1793804584-5bc2fbe021e0e8f.png\" alt=\"大鱼调色 1.10.0 深色模式:画布左侧纵向工具条、检查器与画布外示波器工作区\" class=\"wp-image-15840\" width=\"1628\" height=\"1258\" /><figcaption class=\"wp-element-caption\">大鱼调色 1.10.0 深色模式:纵向画布工具与独立示波器工作区</figcaption></figure>\n<!-- /wp:image -->\n\n<!-- wp:image {\"id\":15841,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https://dayu.media/wp-content/uploads/2026/11/1793804588-7ea8d6f6f860d66.png\" alt=\"大鱼调色 1.10.0 浅色模式:浅色纵向工具条、调色检查器与画布外直方图工作区\" class=\"wp-image-15841\" width=\"1664\" height=\"1068\" /><figcaption class=\"wp-element-caption\">大鱼调色 1.10.0 浅色模式:纵向画布工具与独立示波器工作区</figcaption></figure>\n<!-- /wp:image -->\n\n\n<!-- wp:heading {\"level\":3} -->\n<h3 class=\"wp-block-heading\">1.7.4:删除模块与图层</h3>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p>每个模块和新增图层的标题增加减号按钮,可删除不需要的层并让它从界面消失。删除时一并还原该模块的参数、清除关键帧及所属 LUT、蒙版等设置,避免隐藏后仍影响画面;其他模块保持原设置。误删可通过 Final Cut Pro 的一次撤销恢复。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>顶部“添加模块”菜单可重新添加任意模块,新层从初始参数开始,不继承已删除层的设置。原有“再加一层”继续保留,删除状态随工程和完整预设保存。Line truncated
"excerpt": "统一调色工作区、共享蒙版、最近使用 LUT 与四宫格示波器。大鱼调色 1.12.0 公测版完整安装包已签名公证,站内有效会员免费。",
"seo": {
"title": {
"enabled": true,
"value": "大鱼调色 1.12.0 公测版|统一调色工作区与共享蒙版"
},
"description": {
"enabled": true,
"value": "大鱼调色 1.12.0 是适用于 Final Cut Pro 与 Motion 的原生调色插件。新版控制面板集中管理图层、共享蒙版、最近使用 LUT 和四宫格示波器,画布工具移至左下角。适用于 Apple Silicon 和 macOS 14.6 及以上,完整安装包已签名公证。"
},
"keywords": {
"enabled": true,
"value": "大鱼调色,Final Cut Pro,调色插件,FxPlug4,统一工作区,共享蒙版,LUT,示波器"
}
}
}
+12
查看文件
@@ -0,0 +1,12 @@
{
"article_id": 15792,
"article_url": "https://dayu.media/15792/",
"request_id": "dayu-color-1120-build79-article-20261105",
"cover_source": "template/large.png",
"cover_sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"update_baseline_sha256": "30c92debf91de7ab8215b35dc64a4ddb764e53450c327ae53fb41a4c2f7a26c0",
"compiled_source": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
"release_tag": "v1.12.0-unified-workspace-20261105",
"package_bytes": 45329742,
"package_sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe"
}
+13
查看文件
@@ -0,0 +1,13 @@
{
"bundle_id": "com.dayu.color",
"channel": "beta",
"version": "1.12.0",
"build": 79,
"package_type": "pkg",
"install_mode": "pkg_installer",
"size": 45329742,
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe",
"download_url": "https://dayu.media/wp-content/uploads/dayu-color-beta/updates/dayu-color-1-12-0-79.pkg",
"minimum_system_version": "14.6",
"notes": "1.12.0 公测版加入统一调色工作区、共享蒙版、最近使用 LUT 和四宫格示波器。画布工具移至左下角,改善检视器重开与片尾示波器加载。请保存项目并退出 Final Cut Pro 和 Motion 后安装。"
}
+9
查看文件
@@ -0,0 +1,9 @@
## 大鱼调色 1.13.0(83)
- 画布右下角新增仿制图章。点击画面选取样中心,再拖出带羽化的椭圆覆盖区域。可以叠加多个图章。
- 选中图章后,可在画布上向前、向后或双向跟踪。覆盖区域随轨迹移动、缩放和旋转,取样中心固定。工作区可调整强度、羽化、位置和大小,或清除轨迹、停用和删除图章。
- 缩小空闲画布浮层的位图范围,减少工具状态刷新中的重复编解码。
本公测版本适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。安装前保存剪辑并正常退出 Final Cut Pro 或 Motion。
安装包 SHA-256 `7999233dd4a3b797a879cc0f37a20f0c35f925c5f6823720b40e684464a452e8`,45,350,463 字节。
+9
查看文件
@@ -0,0 +1,9 @@
## 大鱼调色 1.13.1(85)
选中仿制图章后,可拖动青色取样十字来调整取样位置。松手后重新取样并保存为一次撤销,按 Esc 可取消拖动。覆盖区域及已有位置轨迹随项目保留。
图章按 1:1 像素平移复制。改变椭圆宽高只改变覆盖范围,跟踪只移动目标中心。原画面的像素尺寸和方向保持一致。
本公测版本适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。
安装包 SHA-256 `8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965`,45,352,349 字节。
+9
查看文件
@@ -0,0 +1,9 @@
## 大鱼调色 1.13.2(86)
新增安装完整性检查。主 APP 验证外层 APP 和插件服务的官方签名后再提交注册。发现签名失效或安装内容被改动时,主 APP 停止自动更新,撤销当前副本的插件登记。FxPlug 服务在 Final Cut Pro 或 Motion 请求启动时也会独立验签。
原始 PKG 可以原样转发。安装和调色均无需机器码或登录。正常安装的自动更新继续可用,下载的安装包仍经签名、公证和完整性校验。
适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。
安装包为 45,359,239 字节,SHA-256 `6c18bc081cd9d5099ae821df5d5da43585f9db292345c18db4a4e12cce1f133f`。
+13 -3
查看文件
@@ -1,6 +1,16 @@
# 大鱼调色
## 1.11.0 画布图形与空间工具
## 1.12.0 统一工作区与共享蒙版
画布左侧保留常驻蒙版、透明曲线与直方图、畸变、肤色范围及LUT入口,底部“控制面板”打开统一工作区。横排工具添加真实图层,左侧选层,右侧编辑;普通检查器与工作区共用宿主状态。LUT保留原缩略图和异步浏览逻辑,示波器收在同一窗口。
矩形、椭圆或钢笔可先画后指定多个模块,也可先选模块再画、随后继续关联其它模块。同一蒙版的形状、关键帧和跟踪由HSL、蜘蛛盘等模块共同引用;解除一个关联不会删除对象。
工作区默认窄条,可扩大、缩回及调整左右分栏。FxPlug的远程窗口由FCP托管,当前公开接口不提供原生停靠到检视器。跟踪已按本机ColorFinale2.16.2证据接入官方OpenCV4.5.1及相应预处理;生成运动参考通过,原版相同视频的完整轨迹等价仍待验证。详见[证据报告](research/ColorFinaleWorkspaceEvidence-20261105.md)和[当前交接](自定控件开发交接.md)。
当前处于1.12.0(74)正式候选验收。签名、公证、宿主、安装包及Release结果分别以verification中的本轮报告为准;不将1.11.0记录当作新版通过证明。
## 1.11.0 历史画布图形与空间工具
工具条可打开曲线、HSL 和蜘蛛盘的半透明编辑面板,拖动标题可移动,点击标题折叠,同一工具再次点击关闭。主检查器初始仅显示一级、蜘蛛、基础、HSL 四张折叠卡;其它工具通过“+ 添加模块”或画布入口进入,已有有效调色自动显示。
@@ -12,11 +22,11 @@
图形修改支持基础层与独立 UUID 层,一次拖动归入一次撤销。主题、面板位置和开合不改变调色。系统“降低透明度”开启时使用实色面板。完整预设保存空间参数与网格;Cube 无法保存空间选区和几何变换。
正式 1.11.0(73)已签名、公证、安装并通过 724 项原生检查;FCP 12.4 中画布三工具及一次撤销、人脸肤色区域、畸变调整已由用户实鼠确认正常。PKG 已通过签名、公证与 20 项展开验包,保存在上级发行包目录。Release 发布状态见 verification/Release.json。
正式 1.11.0(73)已签名、公证、安装并通过 724 项原生检查;FCP 12.4 中画布三工具及一次撤销、人脸肤色区域、畸变调整已由用户实鼠确认正常。PKG 已通过签名、公证与 20 项展开验包,保存在上级发行包目录。[1.11.0 安装包 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.11.0-canvas-spatial-20261105)已发布,发布前后完整下载的大小及 SHA-256 均一致;源码标签已从远端独立恢复核验。详见 verification/Release.json。
继续完善画布自定控件请先读[自定控件开发交接](/Volumes/备份/大鱼调色/大鱼调色/自定控件开发交接.md),其中列出当前能力、源码入口、交互约定、建议顺序和验证方法。
原生 FxPlug 4 调色器。当前正式签名、公证并安装 **1.11.0(73)**,固定位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;FCP 中从“效果 → 大鱼调色”添加。
原生 FxPlug 4 调色器,固定位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;FCP 中从“效果 → 大鱼调色”添加。1.11.0为上一已验收版本。
1.10.0 基线采用纵向工具条和多个可移动浮动面板,曲线可直接拖点,分级可直接调色轮;画布外工作区提供 sRGB 显示参考示波器和风格1 LUT 预览。该历史版本的695项正式安装原生检查与用户实鼠的曲线拖点/一次撤销、LUT预览、示波器更新均通过。
+68 -1
查看文件
@@ -1,4 +1,46 @@
# 2026-11-04 画布工具与辅助工作区:1.10.0(72)验收完成
# 2026-11-05 安装完整性加固 1.13.2(86)
从 `https://dayu.media/git/dayu/dayu-color.git` 检出实际编译提交 `db6b2b05b3ee2ad40a6aeab70017a2b121caa67d`。独立远端检出核对 618 个文件和 Git 完整性,无子模块。沿用 Xcode 27.1、FxPlug SDK 4.3.5、Apple Silicon、macOS 14.6+、Release 和已有锁定依赖。正式 APP 固定在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,签名团队为 `B3W25FX5H5`。签名、公证登录和证书私钥单独恢复。
验签覆盖主 APP 登记、内嵌 FxPlug 服务启动和自动更新入口。保持现有效果 UUID、原始安装包的转发与离线使用。验签失败会停止当前副本更新并尝试撤销它的登记。系统可自行发现磁盘上的插件,FxPlug 启动检查独立执行。后端更新通道沿用现有策略。验证见 [完整性测试](verification/Integrity1.13.2.json) 和 [宿主验收](verification/HostIntegrity1.13.2.json)。
使用 `tools/deliver.py` 从正式路径安装验收,再通过 `Packaging/build_pkg.py` 打包。正式 PKG 为 `../发行包/大鱼调色-1.13.2.pkg`,45,359,239 字节,SHA-256 `6c18bc081cd9d5099ae821df5d5da43585f9db292345c18db4a4e12cce1f133f`。APP 与 PKG 均签名、公证 Accepted、票据验证通过,安装包通过 20 项展开核验。版本标签为 `v1.13.2-integrity-20261105`。[APP 交付](verification/Delivery.json) · [PKG 验包](verification/Package.json)
# 2026-11-05 检视器与画布控件 1.12.1(81)
正式 APP 位于 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 ID `com.dayu.color`,服务 ID `com.dayu.color.XPC`。实际编译源码为 `43320c7ccdfc6738ba3c380888bb7f3ea75ebb87`,已推送至 `https://dayu.media/git/dayu/dayu-color.git` 的 main。恢复编译时检出该提交,沿用下节的 Xcode 27.1、FxPlug SDK 4.3.5、Release 和锁定依赖流程。正式签名及公证凭据独立恢复。
APP 公证 `8a070adc-a38c-44df-a8b6-ee36198a0cbc` Accepted,签名、票据、唯一 PluginKit 路径及 844 项正式原生检查通过。FCP 12.4 冷重开后检视器顶部完整显示,曲线读取 57,600 个输出样本,已有色温及调色状态可读。80 版的检视器裁切在 81 版修正,画布曲线与直方图的实鼠反馈见验收记录。白平衡吸管复用基础调整的求解和宿主写入,系统取样交互的实机覆盖范围见 [宿主记录](verification/HostCanvasInspector1.12.1.json)。
保存弹窗在内置 APFS 验收库未复现。故障排查以素材库卷、库数据库和特定插件写入三个方向分别核对,见 [保存告警排查](research/FinalCutSaveFailure-20261105.md)。
正式 PKG `../发行包/大鱼调色-1.12.1.pkg` 为 45,337,206 字节,SHA-256 `ae65ac0dcaf7cead701b8ac543ee60ae62e55fd9e19646877d5ef9d9d7351b6f`。Installer 签名、公证 `ffefbde6-10f2-40e3-a8c4-ef4123053c74` Accepted、票据及 20 项展开验包通过。发行标签为 `v1.12.1-canvas-inspector-20261105`,安装包与发布附件的核验分别见 [Package.json](verification/Package.json) 和 [Release.json](verification/Release.json)。
Git Release 390 的附件 34 已公开为公测版,草稿与正式链接均完成全量下载校验。发行标签完整提交为 `9f0adbeb3b1b902b66ac4be7169b919f82675f21`。独立远程检出核对了 607 个跟踪文件及交付记录,标签的编译输入与实际编译提交一致。已清理本轮 79 和 80 的恢复 APP、公证 ZIP、草稿下载及临时检出。[Git Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.12.1-canvas-inspector-20261105) · [恢复核验](verification/CanvasInspectorRecovery1.12.1.json)
# 2026-11-05 统一工作区与共享蒙版:1.12.0(79)
当前唯一正式安装为1.12.0(79),实际编译源码 `beccf2fc01f8dc06c5d3d505f88289885d209bc8`,APP公证 `f66d9934-b015-49d1-bada-717d7399e673` Accepted,票据、Gatekeeper、唯一PluginKit路径、834项正式原生检查和FCP反馈验收通过。实际记录为verification/Delivery.json、HostFeedback78.json和HostFeedback79.json。
正式PKG `../发行包/大鱼调色-1.12.0.pkg`,45,329,742字节,SHA-256 `d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe`。Installer签名、公证 `e57b2649-ca38-46df-afed-c50442bf6227` Accepted、票据、Gatekeeper和20项展开验包通过。本轮未重复执行系统PKG安装,APP已有独立正式安装验收。
源码远程https://dayu.media/git/dayu/dayu-color.git,main;发行标签 `v1.12.0-unified-workspace-20261105` 指向含正式Package.json的 `b72e6b31724def5c174b692ef0a46b76992e780b`。恢复精确编译输入可克隆后 `git switch --detach beccf2fc01f8dc06c5d3d505f88289885d209bc8`;发行标签保留验包及发布说明,后续main保留最终Release下载与清理记录。唯一正式位置`/Library/Plug-Ins/FxPlug/大鱼调色.app`。构建要求:Xcode27.1、FxPlug SDK4.3.5、Apple Silicon、Release,Team B3W25FX5H5。签名私钥/公证登录需独立恢复,Git不含密钥。
新增OpenCV4.5.1官方源码锁在ThirdParty/OpenCV/source-lock.json,构建脚本tools/build_tracking_opencv.py会校验下载并静态编译必要模块,缓存和link.rsp在固定产品缓存tracking-opencv;完整许可随APP资源复制。恢复不需要安装ColorFinale或商业跟踪库,研究缓存和原版二进制不是构建依赖。已有色彩管理依赖锁和源包仍保留,Uniform1344字节、预设v7和旧工具schema2兼容。
共享工具文档schema3是编辑权威源,渲染展开副本不得写回。新宿主验收辅助资料由tools/create_workspace_host_fixture.py重建。最近LUT快捷区、左下画布栏、HSL/蜘蛛盘排版、肤色线及片尾时间修复见research/WorkspaceFeedback-20261105.md。真实CF与大鱼共同99帧最大位置差约0.008源像素、角度差约0.015度;原版导出缺最后一帧,完整100帧报告保留缺失,不宣称任意素材或分组/插值完全等价,详见HostTracking78两份报告及ColorFinaleTrackSemantics78.json。FCP项目和媒体留在本机,没有上传为软件源码备份。工作区仍为宿主托管浮窗,公开FxPlug接口没有原生FCP停靠入口。独立远程检出596个编译节点跟踪文件逐字节一致,未宣称全部依赖冷构建。恢复后仍按Release签名、公证、票据、唯一正式安装、真实宿主验收和Release附件完整下载交付。
Release389/附件33已发布,保留原有公开仓库和公测标记;草稿浏览器真实下载及发布后API再次完整下载均为45,329,742字节,SHA-256与正式PKG一致。发布页:https://dayu.media/git/dayu/dayu-color/releases/tag/v1.12.0-unified-workspace-20261105 。本轮5个已确认生成的旧APP恢复副本、临时下载和独立恢复检出已清理;唯一正式APP与当前发行包保留,历史用户发行包不清理。详见Release.json、UnifiedWorkspaceFinalRecovery79.json与UnifiedWorkspaceCleanup79.json。
2026-11-05 已更新原站点文章 15792 的 1.12.0 说明、特色封面和主下载包。原有售价、会员免费设置及历史界面图均已回读。文章资源和公测更新通道的完整下载均为 45,329,742 字节,SHA-256 与正式 PKG 一致。正文和清单的可复用输入见 `Publishing/1.12.0/`,前台和资源核验见 [Article1.12.0.json](verification/Article1.12.0.json)。
主 APP 公测通道已从 1.7.0(45)更新到 1.12.0(79)。旧版本可收到提示,79 及以上不重复提示。现有更新器已实测从线上检查、下载、校验到可安装状态。NAS 同步了更新目录中的 `dayu-color-1-12-0-79.pkg` 与 `beta.json`,旧包及同目录的 `beta-202611051601.jsonbak` 保留,备份与旧清单逐字节一致。详细部署路径、摘要和线上回读见 [BetaPublication1.12.0.json](verification/BetaPublication1.12.0.json)。
以下为历史恢复记录,以本节及当前验证报告为准。
---
# 2026-11-04 历史画布工具与辅助工作区:1.10.0(72)验收完成
当前正式安装 **1.10.0(72)**,固定位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 Bundle ID `com.dayu.color`,XPC `com.dayu.color.XPC`。实际编译源码 `80dec904bedf5f704b29d16325fa95d639f3a250`;Developer ID 团队 B3W25FX5H5,APP 公证 `c0209032-38d2-4434-8e37-7f911414c3c6` Accepted。票据、Gatekeeper、唯一 PluginKit 正式路径、正式安装的 **695 项原生检查**与用户实鼠验收通过。
@@ -95,6 +137,27 @@ Release384/附件28已发布,草稿浏览器完整下载和发布后再次完
# 大鱼调色恢复说明
## 1.13.1(85)等像素仿制图章
实际编译提交 `1659f3d3853e2574f06a45687141fb444b5d02ca`。正式 APP 固定路径、Bundle ID 与签名团队沿用 1.13.0。Apple 公证 `e1d669d2-821b-46a8-99bc-05c847c91a15` Accepted,票据、Gatekeeper、PluginKit 唯一正式位置、864 项原生检查和 FCP 12.4 读入旧图章通过。84 版验证了取样点拖动后被 85 版替代,未单独打包。83 和 84 的临时 APP 回退副本已清理。
独立远端克隆核对 613 个编译节点文件,Git full/strict、逐文件 SHA-256 通过,无 LFS 或子模块。继续沿用 Xcode 27.1、Metal 工具链、FxPlug SDK 4.3.5 与 macOS 14.6+ Apple Silicon。构建使用 `tools/deliver.py`,打包使用 `Packaging/build_pkg.py`。[宿主验收](verification/HostCloneSource1.13.1.json) · [独立源码恢复](verification/CloneSourceRecovery1.13.1.json)
正式安装包 `../发行包/大鱼调色-1.13.1.pkg`,45,352,349 字节,SHA-256 `8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965`,公证 `b85219d9-d465-4827-bdb6-3023eb161159` Accepted。Developer ID Installer 签名、票据、Gatekeeper 和 20 项实际展开检查通过。版本标签为 `v1.13.1-pixel-clone-20261105`。本机使用独立 APP 安装验收。
[公测 Release 392](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.13.1-pixel-clone-20261105) 的附件 36 已通过草稿下载和正式附件二次下载校验。标签提交 `46153a26edfbf44c5f22fbad5953ec74c0d33883` 的 616 个文件、编译提交关系和安装包记录通过独立远程恢复。[发布证据](verification/Release.json)
## 1.13.0(83)画布响应与仿制图章
实际编译提交为 `9977b5c41b07e0b08e6408c492498ba6e396c981`。正式 APP 固定在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,外层 `com.dayu.color`,XPC `com.dayu.color.XPC`。团队 B3W25FX5H5,Apple 公证 `a9134875-aea9-4150-9e61-3051d23cd809` 为 Accepted,票据、Gatekeeper 和 PluginKit 通过。82 版实窗发现系统符号未渲染,由绘制自有图标的 83 版替代。81 和 82 的本轮临时回退副本在验收后清理,历史发行包保留。
从大鱼远程独立克隆并恢复编译提交,610 个文件逐字节摘要匹配,Git full/strict 检查通过,无 LFS 和子模块。依赖沿用 Xcode 27.1、Metal 工具链、FxPlug SDK 4.3.5、Apple Silicon 与 macOS 14.6+。构建入口 `tools/deliver.py`,打包入口 `Packaging/build_pkg.py`。签名凭据单独恢复。宿主证据和源码恢复证据分别见 [HostCloneStamp1.13.0.json](verification/HostCloneStamp1.13.0.json) 和 [CloneStampRecovery1.13.0.json](verification/CloneStampRecovery1.13.0.json)。
正式安装包 `../发行包/大鱼调色-1.13.0.pkg`,45,350,463 字节,SHA-256 `7999233dd4a3b797a879cc0f37a20f0c35f925c5f6823720b40e684464a452e8`。Developer ID Installer 签名、公证 `13d6f418-4d36-4ef8-a92d-591610cb7682` Accepted、票据、Gatekeeper 和 20 项实际展开检查通过。版本标签为 `v1.13.0-clone-stamp-20261105`。本机已通过独立 APP 安装验收。
[公测 Release 391](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.13.0-clone-stamp-20261105) 的附件 35 已通过草稿下载和正式附件二次下载校验。标签完整提交 `07601e50bf604e7721bccf8be10e403a2bd030d1`,独立恢复版本标签和安装包记录通过。[发布证据](verification/Release.json)
## 当前1.8.0(55):版本化 ACES 色彩管理
远程 `https://dayu.media/git/dayu/dayu-color.git`,main;发行标签 `v1.8.0-cms-20261103`。实际编译源码 `11a88518280f0665f3cd0f388d1d66e5446ece14`,可先以该完整 SHA 恢复程序,标签与安装包的最终远程核验见 `verification/Release.json`。无 LFS 或子模块。固定 OCIO 2.5.2 / ACES 1.3 配置与全部必要依赖源码包、SHA-256 和许可证已放入 `ColorManagement/`,不依赖兄弟应用或其工作副本。
@@ -482,3 +545,7 @@ python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录 --
重建模板:`python3 tools/build_template.py --refresh-model --overwrite`;构建交付:`python3 tools/deliver.py`(先退出FCP/Motion);新宿主项目:`python3 tools/create_canvas_host_fixture.py`,随后通过FCP的文件→导入→XML打开生成的文件,不能直接编辑fcpbundle。仅签名公证或模拟宿主回归通过不足以完成实鼠验收。
1.11.0 PKG已完成Developer ID Installer签名、Apple公证Accepted(ffbdb4fb-f573-411e-99fc-166c4a829121)、票据/Gatekeeper和20项展开验包。43,128,845字节,SHA-256 `2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e`,正式包位于 `/Volumes/备份/大鱼调色/发行包/大鱼调色-1.11.0.pkg`。未执行PKG安装脚本;APP由交付流程独立正式安装验证。Release和完整下载核验以verification/Release.json为准。
最终标签 `v1.11.0-canvas-spatial-20261105` → `5f8fb13fceb0c4d4ead447b8b5694ce269e95749` 已推送核验。独立远端clone检出该标签,555个跟踪文件与标签逐字节一致;程序、Xcode工程、shader和模板与实际编译49d35cb一致,full/strict fsck通过。详见verification/CanvasFinalRecovery1.11.0.json。恢复时克隆 `https://dayu.media/git/dayu/dayu-color.git` 并执行 `git switch --detach 5f8fb13fceb0c4d4ead447b8b5694ce269e95749`;签名钥匙需独立恢复,不能从Git获取。
[Release 388](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.11.0-canvas-spatial-20261105)与附件32已发布,保留原仓库公开性与原有公测标志。下载地址为该版本Release中的“大鱼调色-1.11.0.pkg”。草稿时经登录浏览器完整下载校验后发布,发布后通过认证HTTP再次完整下载;字节数与SHA-256均与上述正式包一致。下载地址、附件ID、标签、提交与校验值完整保存在verification/Release.json。临时下载与恢复clone已清理;正式APP唯一登记,旧版恢复APP已清理,范围见verification/CanvasCleanup1.11.0.json。
+11
查看文件
@@ -0,0 +1,11 @@
Copyright (C) 2000-2020, Intel Corporation, all rights reserved.
Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved.
Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
Copyright (C) 2015-2020, OpenCV Foundation, all rights reserved.
Copyright (C) 2008-2016, Itseez Inc., all rights reserved.
Copyright (C) 2019-2020, Xperience AI, all rights reserved.
Copyright (C) 2019-2020, Shenzhen Institute of Artificial Intelligence and
Robotics for Society, all rights reserved.
Third party copyrights are property of their respective owners.
+202
查看文件
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+11
查看文件
@@ -0,0 +1,11 @@
# OpenCV 区域跟踪运行库
大鱼调色使用官方 OpenCV **4.5.1** 的 `core`、`imgproc`、`video`、`calib3d`(以及自动依赖`features2d`、`flann`)构建独立 arm64 静态库。版本选择依据是本机被研究产品的公开框架版本信息;不复制或链接该产品的框架、代码或资源。OpenCV 来源、完整提交、tag object、88,266,905 字节源码归档及 SHA-256 均在 [source-lock.json](source-lock.json)。Apache2许可原文保留在[LICENSE](LICENSE),旧源文件BSD等通知保留在[COPYRIGHT](COPYRIGHT)及[SOURCE-NOTICES.txt](SOURCE-NOTICES.txt),三份均应随APP分发。
运行 `python3 tools/build_tracking_opencv.py`;产物只在 `/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/`。脚本核对下载字节数和完整SHA-256,构建Release arm64/min macOS14.6,禁用共享库、额外应用、Python/Java、媒体编解码和不需要模块。无需Homebrew OpenCV、Color Finale或用户素材。脚本持有独立构建锁,可在Xcode前置阶段重复调用;编译日志、源码恢复档、构建身份及库摘要在该缓存。
`include/`与`libs/`指向本产品缓存中的安装结果;`link.rsp`包括自建`libDayuOpenCVTracker.a`及所需官方静态库。插件只需包含`MaskCore/DYOpenCVTracker.hpp`,使用`dy::OpenCVTracker`的`setMask/reset/track/result/active/stop`接口,并链接`@<固定缓存>/link.rsp`;该类不使用自研Metal光流backend。官方源码不作为巨型Git对象提交,灾难恢复时从锁定的公开完整提交下载并验证,下载失败应明确停止构建,不能静默切回不同算法。
桥接实现为本产品独立代码`tools/tracking/DYOpenCVTracker.cpp`。跟踪配置及与参考产品的保护差异见`research/ColorFinaleWorkspaceEvidence-20261105.md`;同API、版本和参数不代表同真实视频的逐帧等价。形状/时间/共享蒙版/作者Undo由产品宿主层负责。运行库保留纯CPU可重入对象,不设置全局OpenCV线程或RNG状态,以免干扰同宿主其他插件。
恢复核验:构建后检查`build-report.json`中的源码hash和静态库hash,编译运行`tools/tracking/verify_opencv_tracker.cpp`的已知运动测试。正式交付还须执行本产品已公证安装版本的实际FxAnalyzer测试;独立算法测试不替代宿主验收。
+3889
查看文件
文件差异过大,未显示。 加载差异
+13
查看文件
@@ -0,0 +1,13 @@
{
"repository": "https://github.com/opencv/opencv.git",
"version": "4.5.1",
"tag": "4.5.1",
"tagObject": "3e80752d72a4b78820a732087217668e67701981",
"commit": "1363496c1106606684d40447f5d1149b2c66a9f8",
"archiveURL": "https://codeload.github.com/opencv/opencv/tar.gz/1363496c1106606684d40447f5d1149b2c66a9f8",
"archiveBytes": 88266905,
"archiveSHA256": "4356b76721786bff66536ecd1a36ac2e397b13a4ee1dec41f362fa2459e903db",
"license": "Apache-2.0",
"modules": ["core", "imgproc", "video", "calib3d"],
"automaticModuleDependencies": ["features2d", "flann"]
}
+8 -2
查看文件
@@ -15,7 +15,7 @@
交付必须完成 Release、Developer ID、Apple Accepted、票据、唯一安装及正式路径自检、宿主功能验收、PKG 与 Release 下载校验、远端独立恢复。额度重置由用户手动操作。
状态:研究与实现中,尚未交付新版。
最终状态:1.11.0(73)已正式交付,724项原生检查、20项验包、用户三项实鼠验收、Release发布前后完整下载校验及远端独立恢复均通过。下文保留各阶段研究记录。
## 实现检查点
@@ -37,8 +37,14 @@ AddressSanitizer 发现旧 renderLegacy 的 C++ 引用捕获向异步通知泄
曲线直方图由成功渲染的分析更新发布到同时间快照,播放头不匹配时不展示旧帧。人脸只缓存完全相同的标准化像素;无脸或输入失败时为空,不延续上一镜头。新增空间处理的Cube导出会明确拒绝,完整预设继续保存。
## 候选 1.11.0(73)
## 候选验证记录 1.11.0(73)
724项原生回归通过;真实人脸中心归一化坐标约(0.437,0.244),双人检测2张脸。上下原点输出最大误差0;同色背景差异0,人脸保护生效。独立层、零强度用户蒙版和无脸清空均通过。新的完整724项AddressSanitizer运行未报告内存错误;唯一失败为启用插桩后的旧主队列响应阈值(约226ms),无插桩Release该项通过,未放宽阈值。
最终交付脚本显式关闭ASAN并清理专用构建后重编译,正式安装自检自动提供版本化真人fixture。FCP已通过正常退出保存现有验收库;不修改库数据库。准备正式构建和宿主验收,尚未交付新版。
## 最终交付
用户实鼠回复“三项均正常”:画布曲线含直方图、HSL及蜘蛛盘的拖动与一次撤销;人脸肤色保护区域;镜头畸变网格响应。正式安装1.11.0(73)的APP公证Accepted、票据、Gatekeeper及唯一PluginKit路径通过,原生724项通过。此验收来自真实FCP用户操作,自动化输入限制保留在宿主记录中。
正式编译SHA `49d35cb49ab93f5ab6ca3411eaea80f7219be346`;最终版本标签 `v1.11.0-canvas-spatial-20261105` → `5f8fb13fceb0c4d4ead447b8b5694ce269e95749`。程序与模板未在编译后改动。Release388/附件32完成草稿下载校验后发布,发布后再次完整下载校验,43,128,845字节、SHA-256 `2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e`。远端独立恢复555跟踪文件一致,fsck通过,临时生成副本已清理。详见verification/Delivery.json、HostCanvasTools1.11.0.json、Package.json、Release.json、CanvasFinalRecovery1.11.0.json及CanvasCleanup1.11.0.json。
+132
查看文件
@@ -0,0 +1,132 @@
{
"target": {
"path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/Frameworks/GradeKit.framework/Versions/A/GradeKit",
"sha256": "e868a8c6df64bf03b7c24af5657c5ac7a2259a1943dfe06e01dbb7881df018a3",
"architecture": "arm64",
"provider": "Ghidra12.1.4"
},
"parameterSemantics": {
"parameterType0": "absolute = static baseline + stored relative key (componentwise)",
"parameterType1": "absolute = static baseline * stored relative key (componentwise)",
"authorWrite": "setValue:atTime:type: converts incoming absolute value to relative by subtract/divide before persisting FTKeyFrame",
"keyFrameTypeWarning": "FTKeyFrame.type is a separate enum namespace; do not treat key type0/1 as parameter blend modes.",
"exactKeyAndNoKey": "valueAtTime returns static baseline without keys; exact key is converted with absoluteValueForValue.",
"betweenKeys": "Time interpolation has custom/region logic. No approximate interpolation was used in the normalized output; only exact authored key times."
},
"coordinates": {
"native": "CF mask author coordinates are normalized in its Core Image mask space: X right and Y up.",
"positionPixels": "(x*frameExtent.width, y*frameExtent.height), no Y negation in convertObjectPoint",
"rotation": "Raw evaluated angle is passed directly to CGAffineTransformRotate: radians, positive counterclockwise in Y-up CI space.",
"hostOrientation": "generateMaskImageForScene/ForNode applies an additional final vertical reflection only when outputFrameTile.orientation is nonzero; this is host texture orientation adaptation, not stored-parameter sign.",
"canonicalTopLeft": "xTop=xCF; yTop=1-yCF; thetaTop=-thetaCF for the same unrotated image extent. Avoid a second flip for the host texture correction.",
"extentOrigin": "Evidence covers normalized object scaling and the unrotated zero-origin QA frame. Nonzero extents/rotated or mirrored source metadata require separately applying the frame transform."
},
"rectangleSize": {
"storedSize": "FTTrackerRect.size is full width/height in normalized whole-image proportions, not half extent or min-dimension units.",
"bounds": "bounds is centered at object zero with the stored size; boundingPointsForExtent multiplies X by extent.width and Y by extent.height.",
"rendering": "Renderer context scale is exactly (frameExtent.width,frameExtent.height); convertObjectSize is componentwise scale.",
"formula": "widthPixels=size.width*frameWidth*evaluatedScaleX; heightPixels=size.height*frameHeight*evaluatedScaleY; rotation is then applied about the anchor.",
"qa1080pNeutral": "size(.1,.1),scale(1,1),1920x1080 => full rectangle192x108 pixels.",
"aspectRatio": "No additional aspect-ratio factor appears in these size/extent conversions."
},
"evidence": [
{
"function": "FTAnimatedParameter::absoluteValueForValue:",
"address": "0x2ff68",
"id": "ev_383a4536aa400589706c5b1bf807637b23897b821df704d0d3daa0403c16e422"
},
{
"function": "type0 absolute operation",
"address": "0x30010",
"id": "ev_0bd67b79a003a14ea596584768b0211596f4ef5f8647dda57fe9b9b903ffb2ac",
"instruction": "fadd d0,d0,d1"
},
{
"function": "type1 absolute operation",
"address": "0x30018",
"id": "ev_76b2c7cba7c710771b8d2ff696edc6819f13981c2f9d777764c15e137c28d873",
"instruction": "fmul d0,d0,d1"
},
{
"function": "relativeValueForValue:",
"address": "0x30020",
"id": "ev_1fc5c0518cb43974cbf7936365fe13bfe1f765b75849e25fc84d343aec3b8c51"
},
{
"function": "type0 relative operation",
"address": "0x300c8",
"id": "ev_0f6cb98e5fe2133e22af864ad0407f32c14c36a55d9f062211e7afabb895a9c4",
"instruction": "fsub d0,d0,d1"
},
{
"function": "type1 relative operation",
"address": "0x300d0",
"id": "ev_bbb6d00512fdefd319798954d0b2d446e187636a36292998c9e9a99fdb69a2ee",
"instruction": "fdiv d0,d0,d1"
},
{
"function": "setValue:atTime:type:",
"address": "0x311a4",
"id": "ev_bbc511c6588265d874417152739b427e9bcc9117f4bcaa6eaa59a388179c27a0"
},
{
"function": "valueAtTime:",
"address": "0x300d8",
"id": "ev_ec0c46afb1b556d5ec1d9c2f479a601dc9aac68b64fe3bcd045eb5a1e89d3400"
},
{
"function": "interpolatedValueAtTime:from:to:",
"address": "0x307b4",
"id": "ev_1164fa75ff76633f227928914b59426792ae124d19307531828acb5212c4808f"
},
{
"function": "FTTrackerMaskRendererContext::initWithVersion:outputFrameTile:frameTileProvider:",
"address": "0x21f48",
"id": "ev_ba3670b107c6dada655a532b48c37361b2ae991213371d52da07726adf4690f2"
},
{
"function": "convertObjectPoint:",
"address": "0x2210c",
"id": "ev_9e2477f9968ff8ab78266d282ce8896beef8e367cfde8a38af477086be490051"
},
{
"function": "FTTrackerMaskRenderer::renderMaskForShape:context:",
"address": "0x24174",
"id": "ev_867260f7f663b026d9afd50ec3a8647dde8c65da92deb2b8afc3b68d611e3597",
"assemblyID": "ev_d7eca7d639622ce1ffb8a1538d79d6a81e6d1046006d17ab0b9802a81783a976"
},
{
"function": "generateMaskImageForScene:nodeVersion:outputFrameTile:frameTileProvider:",
"address": "0x222c4",
"id": "ev_4b8e97801dff973b1600553e98e6bfec6387abac9c1af311c8d45b7ac4aa53bd"
},
{
"function": "generateMaskImageForNode:nodeVersion:outputFrameTile:frameTileProvider:opacity:",
"address": "0x225cc",
"id": "ev_06724fe96e5921b1673be1d8b4a905532e803bc1a0c111ad09a6190f264879fb"
},
{
"function": "FTTrackerRect::bounds",
"address": "0x74d7c",
"id": "ev_2f4d290ec9808ca72540183816a91b9c8bcdc45588cc7dc5bf169f3cf91462d6"
},
{
"function": "FTTrackerRect::boundingPointsForExtent:",
"address": "0x74de0",
"id": "ev_a4a49f91fe80c8a6061b8992a987bdf72648818408a67249590176feca80eec4"
},
{
"source": "Installed Apple SDK CGAffineTransform.h:99-103",
"fact": "Rotate angle is radians; matrix [cos(angle) sin(angle) -sin(angle) cos(angle) 0 0]."
}
],
"notUsed": "No fitting of the observed trajectory was used to infer signs, units, size or add/multiply semantics.",
"unknowns": [
"Grouped masks may add group transforms; this QA rectangle is ungrouped.",
"No new runtime probe for mirrored/rotated metadata, non-square pixels or nonzero frame origins.",
"No claim that arbitrary between-key interpolation is simple linear; comparison output uses exact keyed times."
],
"originalAppLaunched": false,
"projectFilesChanged": false,
"preferencesOrDatabaseChanged": false
}
@@ -0,0 +1,123 @@
# Color Finale 工作区与区域跟踪证据(2026-11-05)
## 身份、边界和证据保留
本机 `/Applications/ColorFinale.app` 为2.16.2(625),主插件 `Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale` 完整SHA-256为 `49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f`。2026-11-05重新核验,原文件只读。Ghidra12.1.4/arm64的分析profile为 `c991deeff48f794414bcbf9d15409d809db80062959eb2c963195db4cd97614a`,复用11月1日snapshot并补充本轮查询。静态调用链是发行产物观察,不是原版运行时逐项验收;用户提供的截图仅支持其中可见结构。
完整证据与反编译中间产物仅存本机 `/Users/mac/Library/Caches/CodexBuilds/ColorResearch/workspace-20261105/`;仓库仅保留事实、接口、实施合同和证据ID,不复制商用二进制、图标、nib或反编译实现。
## 工作区逻辑链
1. 顶栏工具动作 `addLayerWithType:`(`0x1000769cc`,`ev_9e1abf39aeee8571405645352af5b24cc00d4c08a4920a7b638266fee983960b`)创建对应工具节点,统一进入 `insertLayer:`。
2. `insertLayer:`(`0x100076bac`,`ev_7e4a2dd8c5ccc4fe7cfd6a5c7f3589c1f68a2f2f54e6e06ef1a8e750058a018c`)读取第一项选择:无选择则根索引0;普通层则当前索引;组选中则组内0。在一个命名Undo组中插入。
3. 插入block(`0x100076dd4`,`ev_aa0e9a9146fcb8527d086b91a39c51bf8fbe7a5c180686d5bcd2cdda16c69f17`)执行beginUpdates、必要展开组、insertLayer、选择新层、endUpdates、storeAdjustments,再更新右区和键盘焦点。
4. `setActiveViewControllerForLayer:`(`0x100077758`,`ev_a0d38bcebc4979e7a77baa47c173fcaa6aae4640992709a18bbd8ea7db048613`)先检查当前层蒙版是否selected且enabled:满足则切蒙版控制器并updateScene;否则按工具类型切曲线、色轮、HSL、LUT等控制器,再setNode到当前真实对象。
5. `setActiveViewController:`(`0x100077a98`,`ev_eacade9dcaa7e283df2af98aa0dc6ab2ec69cb48b6cad8c6fd84a4d35bc065df`)卸载旧控制器并清空其node,再把新控制器view放入同一viewHost。不是叠加多份浮动参数窗。
6. `storeAdjustments`(`0x1000760f0`,`ev_2a855e029cca778e55e861367fffd6cb9adf4d7e52914841ffc3beb51285fae7`)从layersViewModel.rootNode取得实际文档,经apiManager.performActions提交。检查器、工作区和渲染不应各建一份作者数据。
官方[图层工作区文档](https://docs.colorfinale.com/docs/layers/)同时确认:可调大小浮窗、横排工具、点击新增独立图层、左列选层、右区编辑、图层眼睛和右键菜单、底部强度/混合/蒙版/删除。原版文档所称默认新层在顶部与上面的无选择/当前选择/组内插入分支相容。文档描述不是本机运行验证。
## 蒙版编辑与共享对象
`addLayerMask:`(`0x1000f0c30`,`ev_cada231cd5850104fb9806190f532f919e4d82e2c2026a771d5cdf010b81594a`)对选择层中无蒙版者建立FTFxNodeMask,已有者保留;统一作者更新。`maskSelectionDidChange:`及block(`0x100078480/0x100078514`,`ev_a42abc5cdccfdba24fa750e3b2ceb178d949b89445c985c314cb1e7b382a31e1`、`ev_c4bbaccfaa18337b20e24cf38373237af45fc5817c199f0b6507ff3c9d8f6237`)经宿主action保存并切右区。
`FTMaskDetailViewController::updateControls`(`0x100015a98`,`ev_030904608107bf6f0220345798ac4adfbf2fa726ae0387dfc6ca1851fde04c0f`)按真实蒙版类型选择形状、图像、HSL、人物、FCP子控制器,解绑非当前节点。仅可动画形状展示跟踪区;自动跟踪时关闭冲突属性与关键帧操作。属性编辑包含羽化、强度、位置、缩放、旋转,另有反转与组合模式。
官方[蒙版文档](https://docs.colorfinale.com/docs/masks/masks/)确认在工作区右区替换调色控件,画布叠加小工具栏;面板加号与画布直接绘制为两个入口;同层可有多个形状,支持Add/Subtract/Intersect。官方[跟踪文档](https://docs.colorfinale.com/docs/masks/tracking/)确认前后区域跟踪与关键帧操作;[显示模式](https://docs.colorfinale.com/docs/masks/fourmaskdisplaymode/)描述结果、输入、输入叠蒙版与黑白合成;[形状编组](https://docs.colorfinale.com/docs/masks/grouping-mask-shapes/)描述多选组变换。
本轮用户进一步要求“画布左侧常驻蒙版工具”“先画/先选模块”“同一蒙版关联多个模块并共享形状和轨迹”。这是大鱼的新需求;当前证据不能直接声称Color Finale提供完全相同的跨任意模块共享引用操作。实施合同应是文档scene中唯一maskID对象+模块maskRef,而非复制mask字典;一次修改应影响全部引用,删除某模块仅移除引用,孤立对象清理需保留可独立选择的已画蒙版。形状、轨迹和手工关键帧都属于该共享对象;当前模块选择、右区页签、布局和画布显示属于界面状态。
## 窗口边界
`FTRemoteColorCorrectionWindowController::initWithMinSize:maxSize:containerViewController:`(`0x10010aa0c`,`ev_df055fd889e786ea4e4cdca060207f8ffbe73be5445d5e1f198b9ba6fa9e447e`)建立不透明white约0.122的FxRemoteWindow及contentViewController。`showPanelForPlugin:`(`0x10010af60`,`ev_df9a209ebfdd992dcab10802f1535537ab2992b57ac83a960e49e1977045a6f1`)绑定当前plugin,必要时关闭重开以更新尺寸,否则激活已有窗。`updateWindowSize` block(`0x10010a7b0`,`ev_1afe52ae28a67dc775a4f5f5164aeb351790ae4eded25783b840335240072b44`)读取三档layersPanelSize并设min/max约1/1.25/1.5倍率。
现有证据支持自由调整的独立浮窗。没有证据证明第三方FxPlug可以嵌入FCP检视器内部;“检视器下方窄条、不挡画面”应作为本产品默认摆放/尺寸目标,通过公开FxRemoteWindow API与实际宿主验证实现,不能声称已原生停靠FCP。
## 可复现的开放算法配置
本机原版opencv2.framework Info.plist为4.5.1。该框架只读核对版本,不复制、不链接;大鱼可由官方OpenCV4.5.1源码独立构建。官方tag peeled commit:`1363496c1106606684d40447f5d1149b2c66a9f8`(tag object `3e80752d72a4b78820a732087217668e67701981`)。
核心观察来自 `FTAreaTracker::track:trackerState:`(`0x100035e40`,`ev_dcd7aa770925f63c8c14c968ae6b417fda78685c7be7fa739a78209957d40e2d`),逐帧来自`trackFrame:inScene:`(`0x100036cbc`,`ev_e798c4e6e032e085812f81831ecc16196bd3c2278bf634961379669ee1308f7e`),分析入口`effectAnalysis:analyzeFrame:session:error:`(`0x10005b47c`,`ev_1dd68409d431d9e81875b6032a81dd89f7f237ea5501d3db1d7ca92ba32e6323`)。
| 阶段 | 可独立重建的调用合同 |
| --- | --- |
| 完整帧 | 宿主tiles收齐完整帧;IOSurface转换,分析最大3840×2160;转8bit灰度。原版调用cvtColor代码11,按OpenCV颜色枚举对应RGBA2GRAY;需匹配实际源通道序,不能对BGRA盲用 |
| 形状区域 | 形状像素顶点转int,convexHull(clockwise=false,returnPoints=true),fillPoly(mask8UC1,255,LINE_AA,shift0) |
| 特征重选 | 全局分析计数<2或偶数帧;goodFeaturesToTrack(max300,q.03,minDistance10,blockSize3,Harris=false,k.04) |
| 亚像素 | cornerSubPix(winSize10×10,zeroZone(-1,-1),COUNT|EPS,20,.03) |
| 光流 | 相邻灰度帧前后calcOpticalFlowPyrLK,21×21,maxLevel3,COUNT|EPS30/.01,flags0,minEigThreshold1e-4 |
| 筛点 | 成功status并FB欧氏距离严格<1像素;有效点不足4失败;位移≥max(w,h)×.01的点若严格超过当前有效点半数,使用该子集 |
| 仿射 | 前后点先减当前形状中心;estimateAffine2D(RANSAC=8,reprojection3,maxIters2000,confidence.99,refine10) |
| 作者输出 | sx=hypot(a,c),theta=atan2(c,a),sy=det/sx;每步围绕旧中心更新形状,center加拟合平移,theta累加,sx/sy逐步相乘;输出position按分析w/h归一化、rotation、scaleXY,并用effectTime持久化 |
公开API参考:[特征与亚像素](https://docs.opencv.org/4.5.1/dd/d1a/group__imgproc__feature.html)、[金字塔LK](https://docs.opencv.org/4.5.1/dc/d6b/group__video__track.html)、[仿射RANSAC](https://docs.opencv.org/4.5.1/d9/d0c/group__calib3d.html)。本表是参数/行为合同,不包含原版实现源码。
原报告“空仿射矩阵必失败”需修正:当前反编译中empty分支只跳过变换,而后仍可返回1,未独立汇编/运行复核,不能把该静默成功视为正确行为。大鱼应明确在空fit、非法数值、反射、离画及置信不足时停止并保留可信段;该保护差异必须记录。
## 迁移与验证缺口
需要从旧自研特征/LK/RANSAC切到独立编译的OpenCV管线,不能只把阈值改成相同数字;300点与21窗口本身不建立算法等价。必须补齐灰度系数/8位量化、分析分辨率、凸包区域、周期重选、运动主体筛选、中心化拟合与逐步QR作者输出。既有宿主冻结目标、精确CMTime、一次撤销、手工键保留、取消可信段、旧实例隔离继续沿用。
同视频同路径同范围的原版/大鱼完整轨迹尚未运行对照;图像通道/色彩空间、OpenCV编译优化、分块帧调度与数值细节可能影响结果。静态重建、合成运动检查及正式宿主测试应各自报告,不得宣称逐帧或逐像素完全等价。
## 本轮独立实现结果
`dy::OpenCVTracker`现使用独立编译的官方4.5.1库,12项已知运动检查通过(`verification/TrackingOpenCV-20261105.json`):300点、旋转及双轴缩放、框外路径12帧亚像素、周期重选静止、换景、平坦区、运动多数子集、实例隔离、坏帧几何保留、非有限输入及完整4K。中心误差约0.0033px(旋转/缩放)、0.0148px(12帧路径)、0.00011px(4K平移);这些是生成素材结果,不是实拍或原版轨迹对照。只依赖系统zlib/Accelerate/libc++/System,插件运行不需要研究目标或另一APP。宿主接入、共享mask作者同步、正式版本实际跟踪仍由主任务验收。
## 宿主分析预处理补查
2026-11-05追加只读复核,原版三个目标文件SHA保持不变;新增证据均在前述研究缓存的`preprocessing-*-evidence.json`和相应snapshot。GradeKit完整SHA为`e868a8c6df64bf03b7c24af5657c5ac7a2259a1943dfe06e01dbb7881df018a3`,RenderingEngine为`32dca93459347e5ad363cb145d0ccf84b933b2045eee2c9535676a01744b84e3`。
原版`ColorFinalePlugIn::properties:error:`(`0x1000becfc`,`ev_1fdabe00a34ba3c60c1cd544b314a75511f21bfb7e450d3980c7d6a0980e88ee`)返回常量字典。直接读取键和值表,`DesiredProcessingColorInfo`对应NSNumber的整数**2**(`ev_13298ab75f991c7f21dc02b00a61b6b2f7b62c6a5e8c7ffd47a02569c49f2dc1`、`ev_4f886e67dd650bc33b4132e6a46e22baecabcd931e35bb2283ac2f186dd02590`、`ev_46bdde28003eb68ebdb1bfbd992d6eec44a8b5bc3ade2b993aad26ed5401e422`)。本机FxTypes.h545–546核对:0是RGB_LINEAR,2是RGB_GAMMA_VIDEO,SDK注明视频gamma2.2。该请求是否被宿主实际满足仍须核对输入元数据与样本,不能把“请求”描述成所有宿主的无条件事实。
分析入口将`session.colorSpace`和`effectTime`传给`FTFrameTile::frameTileWithImageTile:colorSpace:time:`(GradeKit `0xf890`,`ev_3faba8c4ae9d636bf447ed8eddb17124b49426d25fec7f262c82c93c0c1ab95f`)。它从原宿主IOSurface建立MTLtexture,另建带colorspace标签的CIImage,并保留原texture。跟踪请求`createIOSurfaceWithPixelFormat:maxSize:`(GradeKit `0x12020`,`ev_f9b1157f3f16bec67e2570a8b1e9e8ca367a26fd831c8e924a7dbcb3d434ca08`)优先使用该texture,而非CIImage。
RenderingEngine的`createIOSurfaceFromTexture:pixelFormat:maxSize:`(`0x2a420`,`ev_f37cd808dbf1b11c30f25ae22f67d022dbde5e072e3326b1bc8abcf138c2add5`)按纹理width/height同比缩小,目标RGBA8Unorm(70)。同尺寸同格式可直接返回IOSurface;否则block(`0x2a5b0`,`ev_7466d368af6a009a4f28814ba01d601931d3b3cccb6a295e5bd55ca22ea6d1ee`)只执行**MPSImageLanczosScale**并同步目标纹理,没有显式gamma、ICC、除alpha或pixelAspect拉伸。CI fallback的`colorSpaceForImage:`(`0x29a78`,`ev_39b020d8dd4f7dfa909daf0d20302ddf15269d4573f922acf2626ef7368e0487`)明确返回nil,不能据此把fallback当成自动sRGB转换。
最后核对`+[MTLTextureDescriptor(FTAdditions) ftDescriptorWithIOSurface:usage:]`(RenderingEngine `0x327c4`,`ev_e16998f018851a67426e6422c9e1d12ad5c069274886e710916e639d900be02d`):BGRA→80/BGRA8Unorm,RGBA→70/RGBA8Unorm,RGhA→115/RGBA16Float,RGfA→125/RGBA32Float,均非`_sRGB`格式;没有隐藏在纹理格式中的sRGB采样解码。该事实与宿主请求gamma2.2一起解释其直接缩放和量化行为。
因此不能仅看“原版复制texture不加gamma”就移除大鱼的编码:两产品当前宿主颜色请求不同。最接近已观察合同的分析专用流程是:大鱼linear源→匹配视频gamma2.2的浮点编码纹理→Lanczos缩至最大3840×2160并写RGBA8Unorm→OpenCV整数灰度;普通sRGB分段编码与gamma2.2不等同。先灰度再量化、先量化linear再加gamma、盒式低通缩小都会产生可测差异。对于预乘alpha,原版MPS处理原通道并且gray不再除alpha;若大鱼输入为linear预乘,要模拟宿主gamma请求需先按透明度语义编码并重新预乘,再缩小和量化。真实宿主的颜色请求满足情况、alpha和非方形像素仍应分别验证,不把该生产接入建议作为已完成原版像素对照。
## 原版轨迹的只读导出与比较
保存预设动作明确把`adjustments`及`trackerScene`交给预设管理器(`0x10007870c`,`ev_4568bc43f27bc4fb953e837112e86117d24b300422b0e447920baa582e3e9c1c`)。旧式“导出预设”将每个版本的scene安全归档、zlib压缩为`versions[].masks`,并保存解压归档的base64 SHA-256为`masks_hash`(`0x10000a954`,`ev_1380fa47e7316a68abb78d03436a18b03ea01497592c5c648fc9ee163383e9f6`)。保存面板限定property-list,默认`<identifier>.plist`(`0x1000401a8`,`ev_ab4b0981c4f5bcda698c320d99e85e2ea6d3a10611f0f7217803c6d19bdbb8bb`)。
可操作步骤:在独立QA工程按同一素材、同一时间范围、同一形状进行CF分析;完成后在工作区保存一个新的测试预设(底部菜单的保存预设入口);顶栏打开LUT/预设浏览器,进入Presets并选择该新预设;右键菜单若显示“导出预设 / Export Preset”,填写名称和唯一identifier后保存`.plist`。不要选“导出LUT”,Cube不含空间轨迹。
**本机版本的UI限制必须保留:**`menuNeedsUpdate:`(`0x1000406d8`,`ev_f60df616ccf1a15265170f8aa8c032e41921aae990a67e3805ebb87a24a957c3`)仅在`NSUserDefaults`布尔项`FTPresetsViewControllerEEDK`开启时添加该旧式plist导出菜单。公开“Export as Look (.cflook)… ”只把activeVersion.fxAdjustments传入FTLook,未把trackerScene传入(`0x10003dbb4`,`ev_92e9387d55a56a0ae47fd15746d213dcf1fe2c52707f4d63747afa27b397dfc4`),不能当作已证明的轨迹出口。不要声称普通右键始终能看到plist导出。若需要临时启用该原生菜单,先核对实际进程defaults域、记录原值,并在导出后恢复;这次只读研究没有更改该偏好或原版数据。
本机原生数据存在`~/Library/Application Support/ColorFinale/DataStorage.db`,只读SQLite schema可见`ft_objects`及`ft_objectversions.content`等;当前该库未取到可验证的内容记录。旧`PresetStore.xcdata`是另一代CoreData schema,不能擅自当成本版最新轨迹库。若走数据库对照,应只读连接并backup到一致快照、明确选择本轮唯一测试预设、保留WAL一致性;尚未验证blob封装,不给出猜测解码或直接编辑生产库的方案。
`tools/tracking/read_colorfinale_preset.py`使用Python标准库`plistlib/zlib/struct`解析导出的plist或raw masks archive,绝不加载或实例化CF类。输出按真实标识和有理时间排列的position/rotation/scale轨迹,验证`masks_hash`;坐标原点保持原作者值,不擅自翻转。原生编码字段已观察:
| 对象 | coding keys / 数据 |
| --- | --- |
| FTTrackerScene | identifier、nodes、aspectRatio、duration |
| FTTrackerNode | identifier、name、enabled、inverted、blendMode |
| FTTrackerShape | position、rotation、scale,以及opacity、feather、borderColor |
| FTAnimatedParameter | type、value、keyFrames |
| FTKeyFrame新版 | data,72字节;0:uint32版本1,8:uint64类型,16:int64时间值,24:int32 timescale,32:int64 epoch,40:uint64向量维数,48/56/64:double X/Y/Z |
字段证据:`ev_b91139dc6d6123d6b949555f5e25059f26a2b9b3deac92f49010b6d819219eef`(形状)、`ev_e3a6b0c53238e5a4ea8cdc1b3df70d3fd48c0ff7fbfbc0448ccdabb9cbf50b70`(scene)、`ev_f61f19c55bb089aa86668ace5ed0be32fb9ab34fb98e55d4d6d31bcf4b5208d9`(动画属性)、`ev_1b938e7df2989293beab1198e28439946d3e50178fc61447682ced4367c09862`及`ev_3ceed133be177301388c33727d65297a5e9ec0e0f403e2ff839acb87025eb1f3`(72字节写入和读取)。CIVector的CICount/CI_0/CI_1字段另以系统CoreImage自行归档作oracle,未执行原程序。
示例:`python3 tools/tracking/read_colorfinale_preset.py <本轮导出.plist> --output <缓存目录>/colorfinale-tracks.json`。`--self-test`的有理时间、CIVector及压缩UID图形样本通过;尚无真实CF导出fixture,不能把合成解析检查说成原版真实轨迹提取完成。旧式FTKeyFrame的未知time编码会明确拒绝,不伪造时间;真实fixture到位后再扩展解析。对照应逐CMTime比较中心/角度/双轴尺寸、报告首次失跟和最大/均方误差,并检查实际视频覆盖,不能只看“有效帧数量”就宣布一致。
### 锁屏期间补充核对:原生预设存储流
再次只读核对插件`FTPresetManager::addPresetWithName:inCollection:adjustments:trackerScene:colorSpace:`(`0x1000d2974`,`ev_cf5f63f77213366661f7770b48031a2a408a23d27fed7bc0c26a3dec7e52370f`)确认创建版本后分别保存调整、trackerScene、激活状态和色彩空间。`FTPresetVersion::setTrackerScene:`(`0x100009470`,`ev_8c52ad58d9eee30f4040ba5bd04f66e9784a0e07887a63d0e1efb5170baac191`)先用安全NSKeyedArchiver生成原始NSData,再交给ColorFinaleUtils的SetVersionMasks;getter经GetVersionMasks取回原字节并按FTTrackerScene安全解档(`0x100009260`,`ev_e4de0293c00479ef634f5a15e491b1d0cff8c6d2ba086d16f3da5ce1a11a2cdd`)。没有在这一层丢弃关键帧。
本机`ColorFinaleUtils.framework/Versions/A/ColorFinaleUtils` SHA-256为`424d75515f5c40ffbc37591b04b1bcfc7dda018fb32ea1c431ce87219c481c0d`。原版存储流事实如下,均为该framework地址,不能与插件0x100…地址混用:
| 格式 | 写入/读取证据 |
| --- | --- |
| 可变长无符号整数 | `0x6fd5c`/`0x6fcb8`,`ev_ef345a0d17afe0f011b22401b28c06ed90a89b779ded3103253364e598c4ddfb`/`ev_75db010e3a62d6f2e71cc1c8f39486879243638dab3f4cd7c8b6a769c3311bab`;首字节非零时尾随零位数决定额外字节,整体小端右移位数+1;首字节0时接完整uint64 |
| 字符串/字节串 | `0x70004`,`ev_c92aff8f30908dc8daf6589ea4252b0cc5e69ed4f08ac979c404b7beeeb42d0c`;可变长度后跟原字节 |
| 集合format1 | `0x3ed1c`,`ev_35d1fb01a635f397c3c7f1415a7fbdf88112a36b47a3041e03761f05f8c4629a`;名称、标识、1字节flags、预设数量及各预设 |
| 预设format2 | `0x3eab4`,`ev_a1703c322bc7fc22bf1e524eebdcb021a5468b464f957821337718d02c9fad7b`;名称、标识、字符串标签集合、版本数量及各版本 |
| 版本format5 | `0x3e82c`,`ev_a4aee0bb1e4e7268d97386ff0f6d1dd9e7371f38dee66bf0cd6d3db09cbd23d0`;名称、标识、色彩空间、激活状态、stack和masks两段StorageData |
| StorageData | `0x3e1ec`/`0x3e23c`/`0x3dec0`,`ev_d853760a9d885bbd27a559d561bbeff3470dca869e9a7839d3b9b8a323be0627`/`ev_fed75926e2fb9aa146dd66df51dab312cd7a12ba2a61574388cb8eadc60dac14`/`ev_f01a583cdd8390e399adfa8810232fc3a42a642ee0d4af1fa8ef007a2a3973a3`;不存在,或present+inline后接长度/原字节,或present+非inline后接32字节SHA引用 |
| 保存请求 | SetVersionMasks`0x43c08`、CreateSaveRequest`0x3f3b8`,`ev_ed43bd1eb59fdcf5d5f98e5f506edb70edd98490a50753ee75495cd06dc66653`/`ev_58c5e0a390fa33519bbfaa4daffb508f3650e6a33d661498cfdb6a56f47ca6f3`;对集合/预设/版本标识定位,更新masks后创建含内联数据的版本保存流 |
`tools/tracking/read_colorfinale_collection.py`据此解析**明确提取的原生集合payload**,接入已有只按数据解档的轨迹解析器;支持内联masks,拒绝未知版本、截断、尾随字节、外部masks哈希引用及过量展开。9个固定整数边界向量及生成的1/2/5样本、错误输入检查通过。它不扫描猜测文件头,不调用CF类,不读写原版数据库;UI最终导出文件的外层封装尚未取得真实样本,不能直接宣称某扩展名文件已支持。数据库仍观察到0个object/version,必须在解锁后实际生成QA轨迹及预设才能验证整条原版导出链路。
新增原始Evidence只保留在本机研究缓存`preset-storage-plugin-continued-evidence.json`和`preset-storage-utils-continued-evidence.json`;仓库仅记录格式事实与证据索引。本次没有修改原版偏好、数据库或执行原版二进制,也没有把生成样本算作原版真实数据。
+15
查看文件
@@ -0,0 +1,15 @@
# Final Cut Pro 保存告警排查
用户截图显示 Final Cut Pro 检测到阻止更改保存的错误。当前线索包括弹窗文字。触发操作、软件版本、素材库卷和宿主日志待反馈。
| 排查方向 | 可用于区分的证据 |
| --- | --- |
| 素材库所在卷无法写入 | 记录实际素材库位置、剩余空间、磁盘格式、写权限和当时的断连情况。宿主日志中的空间不足、只读、权限或 I/O 错误可缩小范围。外置卷使用 APFS 是 Apple 的建议。 |
| 单个素材库或工程异常 | 保留原素材库与自动备份,在内置 APFS 的新测试库里复制或重建同一小段,比较同一操作是否只在原库触发。若原库连普通剪辑也无法保存,优先检查素材库与其备份。 |
| 插件参数写入触发 | 在本机测试库对同一段片分别做普通剪辑、大鱼调色参数修改、撤销、关闭和重开。若只有特定插件操作触发,记录操作、时间与版本,核对 FxPlug 的参数写入拒绝或序列化错误。 |
大鱼调色通过 FxPlug 的自定义参数接口保存图层、蒙版和跟踪数据,素材库由 Final Cut Pro 写入。共享蒙版和跟踪的文档写入会先校验结构、数值和大小。此次在独立图层提交处增加本机日志 `dayu_tool_save_rejected`,只记录被拒绝的参数类别,并确保宿主动作能收尾。该日志与 Final Cut Pro 的素材库保存结果分别核对。
本机独立验收库位于内置 APFS。初查本机 30 分钟日志未发现匹配的素材库保存错误。第三方反馈的具体根因仍待复现或日志确认。
如反馈者已经遇到提示,先按提示正常退出,保留原素材库和自动备份,再用独立测试库复现。Final Cut Pro 的自动备份主要保存数据库,恢复时还需要原媒体。[Apple 的项目保存与备份说明](https://support.apple.com/en-nz/guide/final-cut-pro/ver79aa3d71/mac) · [外置存储格式说明](https://support.apple.com/en-us/102116)
+74
查看文件
@@ -0,0 +1,74 @@
# 统一调色工作区开发记录
日期:2026-11-05(Asia/Shanghai)。基线 main `b33b963`,工作区干净,已核对远端 main;正式基线 1.11.0(73)。
## 用户实测后的新版交互合同(2026-11-05)
1. 画布左栏恢复有轮廓/按压反馈的图标按钮,复用现有工具符号,不再用纯文字工具名。保留小按钮尺寸和透明编辑图形,避免大面积遮挡。
2. 钢笔闭合后的画布必须保留真实闭合曲线,不能短暂或持续退回新建蒙版的默认矩形;覆盖共享对象、写回前即时预览、写回后与一次撤销。
3. 取消工作区调整/蒙版/LUT/示波器独立标签。左侧选模块,中央直接编辑;选LUT直接显示旧缩略图浏览器;点击图层蒙版符号进入该图层的蒙版编辑/跟踪及共享关联。
4. 右侧永久显示亮度波形、RGB分列、直方图、矢量图四宫格,切模块/LUT/蒙版时保持采样和显示。仍为效果最终输出的显示参考,不扩大为精确HDR测量。
5. 窄条内容优先横向,消除上下滚动条;蜘蛛盘用左侧盘面、右侧紧凑控制。大量标量控件按可用高度分列,空间不足用横向延展,保持操作可达。曲线随实际高度适配,不在底部裁切。
6. 视觉以用户提供的ColorFinale色轮截图为依据:中性深灰平面、单行紧凑工具条、薄分隔线、明确蓝色选中态、图形与参数横排。工作区去掉大标题、过大圆角按钮和发光边框;保留原检查器的既有主题语义。
结构比较:继续四标签不满足常驻示波器和图层入口;把示波器移到独立窗会分离审核视线;选择单窗三列“图层/当前编辑/四宫格示波器”,分隔线和窗口尺寸可调整。所有调色与共享蒙版继续只有宿主文档一个权威源,新增显示状态不制造参数撤销。原生窗口坐标仍交给宿主,不恢复本机代理frame定位。
当前1.12.0(74)的787项和早前四页设计属于前一候选证据,不能当作以上改动已完成。新候选需重新执行Release、公证、正式安装、视觉/交互验收和发行包交付。
## 体验合同
采用 standard 原生生产工具界面,保留 AppKit / Objective-C++ / FxPlug。目标是审片时尽量露出画面,横向工具栏添加模块,左侧真实图层列表,右侧只显示选中模块的调整或蒙版/跟踪;LUT 继续复用现有缩略图、文件夹和异步载入逻辑。
比较三种结构:继续画布浮卡会遮挡审片;把全部参数放入检查器受窄宽限制;采用宿主远程外窗和可拖动左右分隔线,默认横向窄条是本轮选择。FxRemoteWindow v2/v3 允许内容最小/最大尺寸,但未提供将远程窗强制嵌入 FCP 检视器下方或设置其屏幕坐标的公开方法;实际摆放能力需宿主实测,不能将可调整大小宣称为已获得宿主停靠能力。
状态所有权:宿主 float / DYToolDocument 是调色、图层和蒙版唯一数据源;工作区选择、页面与分隔线为界面状态,不写调色撤销。基础工具沿旧处理链兼容;新增层真实 UUID,不能以列表索引写回。编辑必须复用已有 action / undo / 回读和异步冲突校验。
画布左栏只保留曲线、镜头畸变、肤色范围、LUT,并常驻蒙版入口;底部为“控制面板”。曲线只保留曲线与直方图及必要通道选择,畸变直接操作图形;LUT 进入工作区浏览。
用户追加:蒙版是可复用对象,可先画后勾选一个或多个模块,也可选模块后画,再把其它模块加入对象。形状和跟踪属于同一对象,不能以复制多份蒙版伪装同步。入口在画布左侧。
有限状态:工具调整 / 蒙版编辑 / LUT 浏览 / 示波器;选中图层消失时安全退回存活选择;切页、关窗及目标变更取消过期异步任务。已有降透明度/主题/键盘和可访问标签保持;无需添加装饰动画。
## 研究与验证边界
逆向研究保持原版只读,只保存接口合同、参数事实和证据索引;原版反编译源码、二进制和图标不纳入产品仓库。现有独立跟踪实现与原版配置差异需逐项验证,未建立相同输入对照前不宣称完整等价。
验证覆盖工作区真实 UUID、添加/删除/选层、双向检查器同步、共享蒙版关联与取消关联、同一跟踪轨迹、LUT 旧浏览逻辑及过期回调、窄条/缩放/分隔线、OSC 命中/捕获/undo、正式 FCP 宿主。用户可见验收只运行正式公证安装版。
## 正式候选 1.12.0(74)
已实现横排15种工具、真实UUID层表与右侧单工具编辑、四通道曲线并排、四页工作区、LUT目标切换与取消过期载入、共享蒙版schema3和6种蒙版编辑;左画布矩形/椭圆/钢笔常驻,透明曲线/畸变/肤色/LUT入口及底部控制面板;矩形和椭圆直接拖框,旧右侧蒙版按钮栏已移除。共享对象可先画后关联,或关联选中模块后再加其它模块,独立解除关联不会删除对象。
OpenCV4.5.1由官方锁定源码静态构建并随包保留全部许可,宿主工具蒙版跟踪已接入。原版请求Gamma2.2、大鱼请求linear;分析专用路径按linear→Gamma2.2→MPS Lanczos→RGBA8→OpenCV整数Gray8执行,上限3840×2160且保持原像素网格。普通调色渲染不执行全帧跟踪读回,分析结束释放4K GPU工作纹理。已有12项生成运动参考和784项集成检查通过,尚无原版同视频完整轨迹对照,alpha/非方形像素/宿主颜色请求满足情况分别保留验收边界。
共享蒙版在画布、工作区、主检查器与跟踪内部统一为全局对象身份;切换同一对象的模块入口或删除某一关联模块,不丢弃进行中的轨迹。LUT目标重绑关闭旧浏览器时抑制“返回调整”回调,保持新目标浏览页。分栏初始化不会写入用户偏好;图标工具条、普通文字标题与约21%默认图层栏已完成原生离屏视觉检查。
中间候选9ba6eeb的公证8fa0d3d6-a7a9-4a6c-84f2-3b0490ef1eaf已Accepted,但未安装、未发布;最终候选在此之后修正视觉布局和分析预处理,必须重新构建、公证,不能复用该票据。
复核1.7.2/1.7.3远程窗口记录后,不在FCP远程窗口调用本机frame恢复/自动定位,避免ViewBridge坐标归属错误。分栏比例保存于产品偏好,实际摆放由宿主与用户拖移管理。此处不是原生嵌入FCP检视器。
正式公证候选a0a97df安装后,在FCP12.4实际打开控制面板,已观察到横排添加“曲线2”、右侧四通道/直方图、矩形对象依次勾选曲线2/蜘蛛盘/HSL,三个模块下出现同一蒙版引用,关闭工作区后普通检查器也显示新增曲线和各自蒙版数量。尚未把这些操作扩写为画布实鼠或跟踪通过。
该宿主检查同时发现初始窗口过大和旁路图标被左栏边缘裁切。修正后默认向宿主请求720×300至1440×360窄条,可明确切换扩大(最大2400×1200,受宿主80%限制)或收为窄条,不修改代理窗口frame。原生最低宽度回归确认旧滚动容器实际可视宽度151而单元格174,且圆角按钮对齐矩形超出行边界;改用自有分栏缩放委托、实际clip view宽度、overlay滚动条、无额外insets及按真实cell布局的无边按钮,保留几何断言防止复发。787项原生检查通过。
最终编译源码226b7e1e93dfd5fa2ee2f002fdc828077a2f7f46已完成Release、逐层正式签名、公证b666b44e-83d3-4edd-88e7-f0c5cf83f8ce Accepted、票据、Gatekeeper、唯一正式安装、PluginKit及正式安装787项检查。再次进入FCP实测时系统报告Mac锁屏,不能自动解锁;已请求用户手动解锁,未绕过锁屏。最终候选宿主验收、PKG和Release尚未完成;旧恢复APP保留。详情在verification/HostUnifiedWorkspace1.12.0.json。
远端独立恢复已验证577个编译节点文件逐字节相同、full/strict fsck、8个色彩依赖源包及官方OpenCV源包锁。后续发行标签仍需单独核验。新增同素材ColorFinale参考项目的XML只引用本机原生效果路径,不复制商业模板或代码;严格DTD/媒体验证通过,尚未导入宿主。
### 2026-11-05 主检视器空白的现场记录
用户实测截图显示 FCP 自定义视图空白。系统日志在 09:43:55 记录 `Unable to create custom view`,FxPlugErrorDomain=16;本机 SDK FxTypes.h 将 16 定义为 `kFxError_PluginNotFound`。现场未发现本次 1.12.0 正式服务的对应崩溃报告,不能把既有 1.10.0 的诊断崩溃当成本次证据。后台完整 APP 编译会执行 `RegisterWithLaunchServices`,临时构建副本进入 PluginKit,可能干扰宿主插件重连;已移除构建副本登记。用户测试期间只编译 XPC 目标并核验不会执行 LaunchServices 登记,最终完整构建必须宿主正常退出后进行。参数回调改为每个待处理主队列批次只发一次模型更新,避免一个事务数百次视图刷新;需要正式版重复切换与重开验证,暂不宣称空白故障根因已完全解决。
四宫格第四项采用显示参考 RGB 的 BT.709 色差坐标,计算来源为 [ITU-R BT.709-6 第 3.3 节](https://www.itu.int/dms_pubrec/itu-r/rec/bt/r-rec-bt.709-6-201506-i%21%21pdf-e.pdf)。保持现有显示参考采样边界,不把它标为精密 HDR/IRE 测量。
用户已确认空白出现在切换片段或重新打开检视器后,已正常退出FCP。XPC单目标构建和812项原生离屏检查已通过,PluginKit维持唯一正式路径。正式75候选将包含后台远程回调与会话过期检查,再执行签名后完整原生自检与宿主重复切换;保留SDK reply返回前同步接入子视图的已验证尺寸合同,不以无现场证据的异步替换破坏旧几何修复。
### 正式75宿主实测与76修正
75(编译0ef847f、公证6a271e18-727a-45b6-972d-fcf2d2155d36)正式安装813项检查通过。FCP冷启动后主检视器成功加载;实测添加曲线2、方形四通道曲线与直方图、左盘右参数的蜘蛛盘、真实四宫格采样;同一矩形关联曲线2/蜘蛛盘/HSL,主检视器同步显示各自蒙版数量;添加风格LUT2直接显示现有58项库,真实缩略图与tlfs载入成功,四宫格持续显示。
实窗发现默认蒙版编辑区内跟踪按钮右半部分需要横滚,且蒙版数字框替换cell后未显式启用editable,AX表现为静态文字。76把标量列收窄到184点、缩减模块关联栏、移除多余文档空宽,使默认1440×360下矩形编辑与跟踪全部可见;数字框明确可输入并拒绝非数字。示波器图像增加可访问元素及标题,工作区数字框/滑条使用平面中性色,LUT扫描结束恢复“返回调整”按钮。75保留为可恢复候选,76仍需重新签名公证与正式宿主验收。画布钢笔真实鼠标闭合和重复切换仍未确认,不把尝试点击写成通过。
### 暂停帧打开时示波器等待
用户在75冷重开后看到四宫格持续等待。75只有面板开启后的新render才采样,打开面板清空数据,宿主沿用已有画面时不会产生scope输入;本轮实测修改蜘蛛盘混合后可立即获得四图,是同一故障路径的证据。76改为每个实例只保留最近一次成功render的320×180浮点最终输出副本(不足1MiB);关闭时不执行ICC、统计或绘图,打开时仅重放同一实例/精确宿主CMTime的真实样本。隐藏态不读回4K、不伪造输入直方图为最终输出;序号防止并发旧回调覆盖较新样本,开关代次阻止过期发布,异时缓存不展示。需正式宿主验证冷开暂停帧、重新打开、播放更新及切片隔离。
+56
查看文件
@@ -0,0 +1,56 @@
# 用户现场反馈修订(78 已验收,后续需求继续)
## 设计约定
以用户 2026-11-05 最新三张工作区截图及 HSL 截图为准。参数编辑器使用横向窄条;相关图形、选项和混合量必须同组排布。普通参数列按实际宽度分配,不能沿用固定 250pt。HSL 色组横排在轴参数上方,不另占一列。蜘蛛盘混合量并入盘面右侧控件。
LUT 属于有数量的浏览内容,恢复按视口宽度换行的多行网格与纵向滚动。此前把“不出现上下滚动条”泛化到 LUT 浏览库,造成用户明确拒绝的横向长条,本轮撤销这一布局;缩略图、文件夹、缓存、异步加载、应用逻辑保持。
畸变从统一工作区工具条和图层列表排除,仅通过画布控件调整;已有镜头数据与渲染保留。画布 LUT 入口若尚无可见 LUT 图层,则新增真实 LUT 图层并选中,不能在镜头高亮时给隐藏 base:look 打开浏览器。
## 矢量图肤色线
矢量图在当前 Cb/Cr 等比例坐标中增加从中性点向暖色方向的细虚线与“肤色”标签,作为参考而非肤色检测。采用传统正 I 方向 123°(由 +Cb 逆时针,+Cr 朝上),不增加图像处理参数。
依据:[Apple 的矢量图显示选项](https://support.apple.com/en-by/guide/final-cut-pro/ver761c9f95/mac)描述红黄目标之间的肤色线;[Blender 官方修正记录 #133316](https://projects.blender.org/blender/blender/pulls/133316)给出 90°+33° 和等比例坐标前提。
## 尚待现场诊断
用户确认画布曲线仍会回弹、钢笔闭合仍成矩形,不能把此前仅修复提交前一瞬默认轮廓的改动当作完成。增加仅本地系统日志,记录画布事件时刻、宿主动作时刻、节点数及保存/冲突结果,下一轮必须以真实宿主参数保存为结论。
76 首次暂停打开示波器成功,播放到片尾再关闭/打开则复现等待。当前唯一末帧缓存不足还是时间域不一致尚未证实;77 增加打开请求/缓存时刻日志,不以旧帧充当当前画面。
正式交付状态仍为待宿主验收,不能发布完成声明。
## 77 正式宿主观察
- 正式位置 build77,源 b60ae3e45b6cad5d458a9bb09fba7d1001d2bf3a,Apple Accepted 4e388d95-12c5-461a-bbb8-e116772b0d29,安装后823项原生检查通过。
- 11:00–11:02 FCP PID 对应服务7411,独立验收库的76切换与蒙版项目。HSL 2 色板上排、三轴同宽排列,矢量图细虚线及肤色标签实际可见,四路采样57600;畸变不在工具条/层表。
- 11:04 播放第二片段到片尾,重新开工作区仍等待。日志明确 `requested=4.000000000 cached=3.960000000`,对应25fps排他末端与末帧。78候选只在宿主给出的精确输入末端减一个合法帧长,内点、越界、无帧长不偏移。暂不引入多帧缓存。
- 自动坐标点击未见OSC hit/event,不能算已实际绘制。已请用户在77重试钢笔及曲线,以本地实际保存日志定位;此前 native mock 验证不代替此项。
## 78 片尾编辑保护
同一 raw currentTime 精确比较也出现在 ViewerParameterBridge(开始、每次写、有效性和蜘蛛盘批次)与蒙版提交、界面完成命令。复用同一个宿主显示帧时间归一化,仅对合法输入范围的排他末端生效;OSC 提供的事件时刻仍为写入时刻,真实播放头变化、改层和外部值冲突保护保留。
增加 fake host 的明确 4.00 秒界面 / 3.96 秒 OSC 复现:成对曲线参数持久化、实际播放头移到3.92后拒写、钢笔三节点闭合一次保存。真实用户77诊断仍待回报,这属于有代码和片尾宿主时差证据支持的修复候选,不把 native 用例当作真实宿主绘制完成。
回归首轮的钢笔断言读取了 baseMasks.hsl 的最后一个原始条目,实际上它是已存在的共享引用(没有 nodes),因此得到假阴性;宿主模拟日志记录提交成功。已改为按实际 maskID 解析作者对象,继续检查节点、单次撤销和绘制结束状态,不放宽保存断言。
## 78 实际验收结果
正式安装78(源码df6bf52),Apple Accepted 19fc54d7-8022-4e49-a801-4c15f54098fb,831项原生检查通过。实际FCP服务9393来自唯一正式路径。片尾冷打开、播放中暂停再打开均显示四路57600取样;HSL同宽三轴、蜘蛛盘盘面与右侧混合、LUT四列多行网格、畸变移出工作区和矢量图肤色线均已实际观察。HSL数值12切模块保留,随后复位0。
用户对原77问题的迟到回复为“两项都正常”;回复时实际已安装78。12:08真实钢笔提交3节点、result=1 valid=1;12:10真实曲线成对写回count=2持续成功,手动验收后截图保留弯曲曲线。自动三次检视器循环在用户操作期间超时,因此不记录为三次通过;仅记录实际观察的片段切换和重新加载。
真实原版CF与大鱼同视频、同初始矩形跟踪已完成。共同99帧最大中心差0.007732源像素、角度差0.014775度、宽差0.010168像素、高差0.015993像素。原版缺第99帧,完整100帧报告保留失败,绝不补造。详见HostTracking78两份报告及ColorFinaleTrackSemantics78.json。
## 新增需求
用户要求风格LUT调整页下方增加最近使用快捷入口,并把画布图标栏移到左下。78验收结果作为回归基线;新增改动后重新正式构建、公证、安装并验收。
## 79 最近LUT与左下画布栏
新增`DYLUTBrowser.embedRecentInView`,复用既有最近使用记录、真实帧缩略图、异步解码/准备/宿主确认应用。快捷区隐藏完整浏览器的文件夹、搜索、导入与布局控件,不改完整浏览器保存的文件夹、缩略图大小或布局;双击不会关闭整个快捷区。工作区风格编辑器将其放在路径与强度下面,仍按当前模块UUID写入look0;外部值刷新同步选择标记。
画布七个图标改左下横排,控制面板位于右下。缩放同时考虑两组宽度,小画面与Retina下互不重叠;曲线和畸变编辑器逻辑不变。正式79,源码beccf2f,Apple Accepted f66d9934-b015-49d1-bada-717d7399e673,834项正式原生检查通过。真实FCP服务13021路径唯一,已观察左下图标、最近3个实际缩略图;点击后仅当前风格LUT2显示所选路径和选中状态,记录前移。随后移除测试LUT恢复原状态;重开检视器一次及重开工作区,3个快捷入口与四路57600取样仍正常。记录HostFeedback79.json。
@@ -0,0 +1,72 @@
# 统一工作区、共享蒙版和现有跟踪链路审计
2026-11-05,Asia/Shanghai。审计基线 `b33b963`;以下源码观察来自本产品,不是 Color Finale 运行证据。本文件记录本次负责的 `DYToolState.h/.mm`、`DYMaskPanel.inc.h` 和 `DYSharedMaskDiagnostics.inc.h`,正式构建与宿主结果由主交付记录另行补齐。
## 已有链路与复用接口
- 原始固定工具身份为 `base:<type>`,独立层是 UUID;`DYInsertTool(document,type,afterID)` 使用 `after` 稳定锚点,不能以列表序号寻址。`DYToolManager` 代理独立 UUID 参数,不支持把 `base:type` 伪造成 UUID。固定工具需直接使用 root host manager。
- `DYToolDisplayOrder` 是界面目录与锚点树顺序。旧基础渲染的实际执行顺序保留在 `DYToolRender.inc.h` 的 `anchors`:一级、三原色、曲线、色阶、平衡、HSL、颜色分级、基础、黑白、LUT、肤色,随后蜘蛛盘和尾部工具。目录顺序与旧基础运算顺序不同;本次界面调整不能默默改写旧颜色链。
- `DYModelChanged` 通知对象是 root host。原主检查器主动调用 `synchronizeTools` 刷新子检查器。工作区直接嵌入的 `DYInspector` 必须由工作区监听 root host 再主动 `refresh`,因为原 embedded 检查器自身监听的是其 `DYToolManager`。
- `DYToolCanvasSelection`:对象 root host;userInfo `node`、`mask`、可选 `document`、`draw`、`hidden`。用于选择蒙版、切换钢笔绘制与隐藏轮廓。
- `DYToolCanvasCommand`:对象 root host;`node`、`mask`、`command=finish/cancel` 与精确 `timeValue/timeScale/timeEpoch`。
- `DYToolTrack`:对象 root host;`node`、`mask`、`direction=-2/-1/0/1/2/9`,分别反向单帧、反向、双向、正向、正向单帧、取消。
- 基线 `DYToolTrackingStatus` 回传 `node/message`,共享库应同时带mask以免两个共享对象切换后旧状态覆盖新项;面板已兼容按可选mask过滤。`DYToolCanvasState` 回传 `node/mask/drawing`。选择身份、开合和排版属于显示状态,不应额外写一次调色撤销。
## 当前跟踪实现的真实范围
`DYToolHostMethods.inc.h` 的 `toolTrackRequested:` 在主队列宿主 action 冻结当前 UUID、完整蒙版、参考 CMTime 和方向;通过 `FxAnalysisAPI` 启动 GPU 分析。`desiredAnalysisTimeRange:` 和 `setupAnalysisForTimeRange:` 使用宿主精确帧长;`analyzeFrame:` 对连续时间逐帧复核,不以移动播放头或 320×180 LUT 预览代替实际源帧。
`toolGrayFrame:error:` 要求完整宿主 image bounds,支持源图原点、像素长宽比,限制显示比例分析图到 1280×720,不放大小图。`dyToolCapture` 在降采样前对源覆盖范围低通;颜色输入解除预乘,经显示编码形成 luma。这是分析图,调色输出保持原分辨率。
算法源码为本产品 `MaskCore/DYTracker.hpp` 与 `DYTracking.metal`:最多 300 个 Shi–Tomasi 类角点,最小间隔 10px、相对阈值 3%、亚像素细化;最多 4 层金字塔,21×21 patch,每层最多 30 次 LK 类迭代;正反光流误差 ≤1.1px;确定性 400 次三点仿射 RANSAC,3px 细化容差,至少 8 内点、52% 一致性,拒绝近线状分布。置信度综合保留比例与中值残差,低于0.3停止;另检查单步缩放、旋转、累计尺度和中心是否出画。
输出是中心、旋转、独立 X/Y 缩放;内部累计仿射包含更多自由度,但最终蒙版参数不保存完整剪切/透视,也不是非刚性逐钢笔节点描边。不能把这一实现称为 Color Finale 算法完全等价,需由独立逆向证据和对照实验另行证明。
收尾通过 `_trackingFinishing.exchange(true)` 与 generation 防重入;双向共用同一参考起点,最终只提交一次。`DYMergeTracking` 保留手工键和范围外旧轨迹。写回时检查当前完整蒙版等于冻结蒙版,避免覆盖外部编辑;正常取消、丢失与单帧结束使用 SDK `kFxError_UserCancelled` 明确结束宿主任务。单帧后先把源时间转换成时间线时间,再请求播放头移动。上述旧问题的修复不应被新 UI 绕开。
## 本次共享对象模型
作者文档继续兼容 schema1/2;schema3 增加 `sharedMasks`,最多64个唯一蒙版对象。原 `baseMasks[type]`、`node.masks` 可混合旧完整蒙版与单字段引用 `{sharedID: UUID}`,维持组合顺序。同一共享对象可以被多个模块引用,单模块禁止重复引用;悬空引用、引用夹带字段、重复真实 UUID 均拒绝。每模块16项、单蒙版16384键、全作者65536键与24MiB上限保留;全作者键数对共享对象只计一次。
`DYMasksForTool(document,nodeID)` 返回解引用对象本身。可变文档中,两个模块返回的是同一个可变共享字典;画布草稿提交、数字编辑、跟踪写回修改这一个对象,因此所有关联模块同步。特殊 `nodeID=@"shared"` 直接选择共享库,支持先画蒙版再指定模块。
新增函数:
| 接口 | 行为 |
| --- | --- |
| `DYSharedMasks` / `DYSharedMaskWithID` | 读取全局库及唯一对象 |
| `DYAddSharedMask` | 新建未关联共享对象,返回实际库中字典 |
| `DYSetSharedMaskAssigned` | 给 `base:type` 或 UUID 增删引用,解除单层不删除对象 |
| `DYToolIDsForSharedMask` | 列出所有关联工具身份 |
| `DYRemoveSharedMask` | 删除对象及所有引用,保留工具层 |
| `DYShareToolMask` | 将旧独立蒙版提升成唯一共享对象,保留原UUID与全部数据 |
| `DYResolvedToolDocument` | 一次性展开为临时schema2渲染文档,单引用确定性UUID;不供编辑 |
| `DYToolRenderSnapshot` | 先展开、再按指定CMTime求值;所有渲染副本删除轨迹作者键 |
渲染副本的 `sourceSharedID` 保留源身份。确定性临时UUID由共享ID与工具ID派生,以满足旧schema2全局UUID唯一校验,并使快照及缓存稳定;它不是另一个作者蒙版。没有时间参数的 `DYResolvedToolDocument` 清空展开共享副本的keys,与既有直接渲染读取基础参数的行为一致;有时间的宿主渲染必须经过 `DYToolRenderSnapshot`。
## 外部必须适配的位置
以下为基线文件/方法位置,后续行号随编辑变化;检索键可用 `rg 'baseMasks|\[@"masks"\]' '大鱼调色/Plugin'`:
| 文件与基线行 | 原读取 | 必要适配 |
| --- | --- | --- |
| `DYToolHostMethods.inc.h:11` `adoptToolCanvasDocument:` | 直接遍历baseMasks/node.masks寻找启用对象 | 使用 `DYMasksForTool`,并包括全局共享库;已有所选共享节点应保持 |
| 同文件`:24` `toolMask:node:document:` | 已使用DYMasksForTool | 无需改为复制对象;此处必须返回可变文档真实对象 |
| 同文件`:28` `toolCanvasSelection:` | 所选node改变即取消并丢弃跟踪 | 从关联层切到shared库是相同蒙版但node变化;可保守取消,若要求跨入口不中断,比较唯一共享ID而非仅node |
| `DYToolCanvasEditing.inc.h` 画布添加种类 | 直接DYNewMask并加入层列表 | 新全局入口用DYAddSharedMask;可选模块用DYSetSharedMaskAssigned关联 |
| `DYInspector.mm:858` `refresh` | 直接baseMasks数量判断可见 | 引用数组本身仍有数量,但详情/显示蒙版名称必须解引用 |
| `DYToolRender.inc.h:44` `renderToolsSource:...` | baseMasks及node.masks传Metal | 先验证作者文档,再DYResolvedToolDocument;正常pluginState已为展开快照 |
| 同文件`:101` `exportLUT:...tools:` | 引用数组count用于拒绝空间导出 | 只拒绝实际关联蒙版;未分配的全局库不影响画面、不必阻止Cube |
| `DYPrimaryRender.inc.h`、`DYManagedRender.inc.h` 主render方法 | 固定一级/film及附加层直接取masks | 入门先验证作者,再展开引用;不要把refs传给maskBuffer读取parameters |
| `DYPlugIn.mm:33` `pluginState` | DYToolRenderSnapshot | 已由本次共享模型统一解决,无需另外复制作者对象 |
## 紧凑蒙版编辑器
`DYToolMaskPanel` 实现 `DYWorkspaceMaskEditing`,公开 `workspaceMode`、`contentHeight`、`selectedMaskID`、`refreshWithDocument:time:`、`addMenu:` 和 `selectMaskID:`。workspaceMode在≥560pt宽时把参数网格与跟踪操作分为两列,860pt以上单行头部;600–1200pt宽适应,低高度交由外层滚动容器。窄检查器保留原有竖排尺寸;小于560pt时contentHeight也返回完整竖排高度,实际377pt编辑列不会因误用多列高度截掉跟踪区域。`contentHeight` 按当前宽度动态返回,外层应先设宽、再读取高度、再设置文档视图高度。
选中同一个、已经活跃的蒙版不会重发canvas选择,不会在每次刷新时取消钢笔草稿;首次选中默认首项仍激活画布。空库清空旧maskID,避免保留已删除对象。shared模式的删除提示包含全部关联,操作仍走既有单次Undo宿主写入。此面板不单独复制跟踪算法或作者状态。
## 验证范围
新增 `DYSharedMaskDiagnostics.inc.h`:先画后关联、两模块同一对象、编辑与轨迹同步、安全归档、确定性独立渲染绑定、悬空/重复/伪复制拒绝、单层解除和全局删除、旧蒙版提升、64库/16引用独立上限、共享键预算只计一次,以及六种蒙版在377/600/860/1200pt布局内的可见控件边界与交叠。`DYToolState.mm`、包含新面板的 `DYInspector.mm`、包含新诊断的 `DYDiagnostics.mm` 已通过本机clang语法检查,只有既存弃用和动态probe警告。运行结果待主交付的正式安装自检记录;本文件不预写运行“通过”。
+2 -2
查看文件
@@ -3720,8 +3720,8 @@
"大鱼调色/Plugin/DYModel.h": "a28652bd53aa9e1d085af1108c344b5d673c5e1b3731531e1bb2982efeb8708c",
"大鱼调色/Plugin/DYModel.mm": "e5bdf3177e164c0b97e535be7e6d14ea56d49f3f74c3622078374e7a9597d2c1",
"大鱼调色/Plugin/DYSpiderState.h": "0c80747e41e8fc97762e301b011bd08c18865a825eaafde086ed79ace37b22f9",
"大鱼调色/Plugin/DYToolState.h": "0a83109d2c02626d6b9e7340b74be6e6a74f366f31f9d7622b4a88000d5ad7b9",
"大鱼调色/Plugin/DYToolState.mm": "49ccde836056123cc4912eaf43da11af1713db19add5e833d0287586554acd09",
"大鱼调色/Plugin/DYToolState.h": "bf22a9c1b29afaa6d411fae48ffd7de919947af1c626cc5d491218dd8065b293",
"大鱼调色/Plugin/DYToolState.mm": "ed99f24cceef8bbad66c562f027acd7a22b7d20f4386e04370fde2bb01f43f8c",
"大鱼调色/Plugin/DYUniforms.h": "4901446fa6b2a6987a6a137baa458df70f5e25a1e64fdb5c502f765b20edc0c0",
"大鱼调色/Plugin/MaskCore/DYMask.h": "5b9aa44390d4a1fca1baf5e34cb9eefc8483c939a65cc2a0412b7b41fc85bc16",
"大鱼调色/Plugin/MaskCore/DYMaskOperator.h": "43fa701ad574f38ce0ab4f4d3900bb034edaaa1adc09821d2f4443ee2b687ba2",
+4 -4
查看文件
@@ -1,6 +1,6 @@
{
"passed": true,
"sha256": "3f4f642146ae60710b865bd131c0d0be458e6430de54b50bd49dc9637643c891",
"sha256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"version": "5.11",
"displayversion": "5.4.5",
"nativeReference": {
@@ -18,11 +18,11 @@
},
"staticContract": {
"passed": true,
"sha256": "3f4f642146ae60710b865bd131c0d0be458e6430de54b50bd49dc9637643c891",
"sha256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"version": "5.11",
"displayversion": "5.4.5",
"filterCount": 1,
"nativeFloatParameters": 278,
"nativeFloatParameters": 285,
"customParameters": 3,
"publications": [
{
@@ -55,7 +55,7 @@
},
"savedSelection": {
"passed": true,
"sha256": "3f4f642146ae60710b865bd131c0d0be458e6430de54b50bd49dc9637643c891",
"sha256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"version": "5.11",
"selectionMask": "0x10000001",
"projectID": "10000",
+1 -1
查看文件
@@ -1,6 +1,6 @@
{
"passed": true,
"sha256": "3f4f642146ae60710b865bd131c0d0be458e6430de54b50bd49dc9637643c891",
"sha256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"version": "5.11",
"selectionMask": "0x10000001",
"projectID": "10000",
+106
查看文件
@@ -0,0 +1,106 @@
#!/usr/bin/env python3
"""Build the pinned public OpenCV tracking runtime outside the source checkout."""
from pathlib import Path
import argparse, contextlib, fcntl, hashlib, json, os, shutil, subprocess, tarfile, urllib.request
ROOT = Path(__file__).resolve().parent.parent
CACHE = Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv')
LOCK = json.loads((ROOT/'ThirdParty/OpenCV/source-lock.json').read_text())
def sha(path):
h=hashlib.sha256()
with path.open('rb') as f:
while chunk:=f.read(1024*1024):h.update(chunk)
return h.hexdigest()
def run(args, log):
with log.open('a') as out:
subprocess.run([str(x) for x in args],check=True,stdout=out,stderr=subprocess.STDOUT)
def main():
ap=argparse.ArgumentParser();ap.add_argument('--resources',type=Path);ap.add_argument('--jobs',type=int,default=min(4,os.cpu_count() or 2));args=ap.parse_args()
CACHE.mkdir(parents=True,exist_ok=True)
with (CACHE/'build.lock').open('w') as exclusive:
fcntl.flock(exclusive,fcntl.LOCK_EX)
download=CACHE/'opencv-4.5.1.tar.gz'
if not download.exists():
prior=CACHE.parent/'opencv-tracking/opencv-4.5.1.tar.gz'
if prior.exists() and sha(prior)==LOCK['archiveSHA256']:shutil.move(str(prior),download)
else:
partial=download.with_suffix('.download')
with urllib.request.urlopen(LOCK['archiveURL'],timeout=90) as response, partial.open('wb') as out:
shutil.copyfileobj(response,out)
if partial.stat().st_size!=LOCK['archiveBytes'] or sha(partial)!=LOCK['archiveSHA256']:
raise RuntimeError('OpenCV download identity mismatch; unverified file retained')
partial.replace(download)
if download.stat().st_size!=LOCK['archiveBytes'] or sha(download)!=LOCK['archiveSHA256']:
raise RuntimeError('OpenCV cached source identity mismatch')
source=CACHE/('opencv-'+LOCK['commit'])
if not source.exists():
with tarfile.open(download,'r:gz') as archive:
for member in archive.getmembers():
target=(CACHE/member.name).resolve()
if not target.is_relative_to(CACHE.resolve()) or member.issym() or member.islnk():
raise RuntimeError('Unexpected source archive path/link')
archive.extractall(CACHE)
build=CACHE/'build';prefix=CACHE/'install';log=CACHE/'build.log'
sdk=Path(subprocess.check_output(['xcrun','--show-sdk-path'],text=True).strip())
config=[
'-DCMAKE_POLICY_VERSION_MINIMUM=3.5','-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_OSX_ARCHITECTURES=arm64','-DCMAKE_OSX_DEPLOYMENT_TARGET=14.6',
'-DBUILD_LIST='+','.join(LOCK['modules']),'-DBUILD_SHARED_LIBS=OFF',
'-DBUILD_TESTS=OFF','-DBUILD_PERF_TESTS=OFF','-DBUILD_EXAMPLES=OFF',
'-DBUILD_opencv_apps=OFF','-DBUILD_DOCS=OFF','-DBUILD_JAVA=OFF',
'-DBUILD_opencv_python2=OFF','-DBUILD_opencv_python3=OFF',
'-DBUILD_opencv_js=OFF','-DBUILD_opencv_gapi=OFF','-DBUILD_opencv_dnn=OFF',
'-DWITH_IPP=OFF','-DWITH_ITT=OFF','-DWITH_OPENCL=OFF','-DWITH_TBB=OFF','-DWITH_CAROTENE=OFF',
'-DWITH_OPENMP=OFF','-DWITH_LAPACK=OFF','-DWITH_EIGEN=OFF',
'-DWITH_VTK=OFF','-DWITH_ADE=OFF','-DWITH_FFMPEG=OFF','-DWITH_GSTREAMER=OFF',
'-DWITH_AVFOUNDATION=OFF','-DWITH_QUIRC=OFF','-DWITH_PROTOBUF=OFF',
'-DWITH_JPEG=OFF','-DWITH_PNG=OFF','-DWITH_TIFF=OFF','-DWITH_WEBP=OFF',
'-DWITH_OPENEXR=OFF','-DWITH_JASPER=OFF','-DWITH_OPENJPEG=OFF',
'-DBUILD_ZLIB=OFF','-DZLIB_INCLUDE_DIR='+str(sdk/'usr/include'),
'-DZLIB_LIBRARY='+str(sdk/'usr/lib/libz.tbd'),
'-DZLIB_LIBRARY_RELEASE='+str(sdk/'usr/lib/libz.tbd'),
'-DOPENCV_FORCE_3RDPARTY_BUILD=OFF','-DOPENCV_GENERATE_PKGCONFIG=OFF',
'-DCMAKE_CXX_STANDARD=17','-DCMAKE_CXX_VISIBILITY_PRESET=hidden',
'-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON','-DCMAKE_INSTALL_PREFIX='+str(prefix)]
configuration=hashlib.sha256(json.dumps(config).encode()).hexdigest()
marker=CACHE/'opencv-build.json'
if not marker.exists() or json.loads(marker.read_text()).get('configuration')!=configuration:
run(['cmake','-S',source,'-B',build,*config],log)
run(['cmake','--build',build,'--parallel',args.jobs],log)
run(['cmake','--install',build],log)
marker.write_text(json.dumps({'configuration':configuration,'commit':LOCK['commit'],'archiveSHA256':LOCK['archiveSHA256']},indent=2)+'\n')
include=CACHE/'include';libs=CACHE/'libs';libs.mkdir(exist_ok=True)
if include.is_symlink():include.unlink()
if not include.exists():include.symlink_to(prefix/'include/opencv4',target_is_directory=True)
libraryNames=['calib3d','features2d','flann','video','imgproc','core']
for name in libraryNames:
src=prefix/'lib'/('libopencv_'+name+'.a');dest=libs/src.name
if not src.exists():raise RuntimeError('Required OpenCV library absent: '+str(src))
if dest.is_symlink():dest.unlink()
if not dest.exists():dest.symlink_to(src)
bridge=ROOT/'tools/tracking/DYOpenCVTracker.cpp';obj=libs/'DYOpenCVTracker.o';runtime=libs/'libDayuOpenCVTracker.a'
identity=hashlib.sha256(bridge.read_bytes()+(ROOT/'大鱼调色/Plugin/MaskCore/DYOpenCVTracker.hpp').read_bytes()+marker.read_bytes()).hexdigest()
bridgeMarker=CACHE/'bridge-build.json'
if not runtime.exists() or not bridgeMarker.exists() or json.loads(bridgeMarker.read_text()).get('identity')!=identity:
run(['xcrun','clang++','-std=c++17','-arch','arm64','-mmacosx-version-min=14.6','-O3','-fvisibility=hidden',
'-I'+str(include),'-c',bridge,'-o',obj],log)
run(['xcrun','libtool','-static','-o',runtime,obj],log)
bridgeMarker.write_text(json.dumps({'identity':identity,'runtimeSHA256':sha(runtime)},indent=2)+'\n')
# Absolute arguments contain no spaces in the fixed build-cache path.
response=[str(runtime),*[str(libs/('libopencv_'+name+'.a')) for name in libraryNames],'-lz','-framework','Accelerate']
(CACHE/'link.rsp').write_text('\n'.join(response)+'\n')
report={'version':LOCK['version'],'commit':LOCK['commit'],'archiveSHA256':LOCK['archiveSHA256'],
'header':str(include),'linkResponse':str(CACHE/'link.rsp'),'libraries':[
{'path':x,'bytes':Path(x).stat().st_size,'sha256':sha(Path(x))} for x in response if x.endswith('.a')],
'sourceApplicationDependency':False}
(CACHE/'build-report.json').write_text(json.dumps(report,indent=2)+'\n')
if args.resources:
args.resources.mkdir(parents=True,exist_ok=True)
for name in ['LICENSE','COPYRIGHT','SOURCE-NOTICES.txt','source-lock.json']:
shutil.copy2(ROOT/'ThirdParty/OpenCV'/name,args.resources/name)
print('OpenCV '+LOCK['version']+' public source runtime ready: '+str(CACHE/'link.rsp'))
if __name__=='__main__':main()
+54
查看文件
@@ -0,0 +1,54 @@
#!/usr/bin/env python3
"""Create isolated workspace/shared-mask acceptance projects using known fixtures."""
from pathlib import Path
import base64,copy,json,plistlib,struct,subprocess,uuid
import xml.etree.ElementTree as E
ROOT=Path(__file__).resolve().parent.parent
OUT=Path.home()/'Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/workspace-1.12.0'
OUT.mkdir(parents=True,exist_ok=True)
portrait=ROOT/'tools/fixtures/astronaut.png'
motion=OUT.parent/'大鱼调色_蒙版合成运动.mov'
if not motion.exists():
subprocess.run(['/opt/homebrew/bin/ffmpeg','-v','error','-f','lavfi','-i',"nullsrc=s=1080x640:r=25:d=4,geq=lum='128+70*sin(X/11)*cos(Y/9)+35*sin((X+Y)/4)':cb='128+35*sin(X/17)':cr='128+35*cos(Y/21)',crop=960:540:'40+10*t':'40+5*t'",'-c:v','prores_ks','-profile:v','2','-pix_fmt','yuv422p10le','-color_primaries','bt709','-color_trc','bt709','-colorspace','bt709',str(motion)],check=True)
model=json.loads((ROOT/'template/sources/RegisteredParameters.json').read_text())
values={p['key']:p['default'] for p in model['parameters']}
values.update(primaryMasterEnabled=0,inputEnabled=0,skinEnabled=0,skinFaceOnly=0,lookEnabled=0,hslEnabled=1,hsl0_0=25)
maskid=str(uuid.uuid5(uuid.NAMESPACE_URL,'dayu/workspace-1.12.0/shared-rectangle')).upper()
parameters=struct.pack('<4I28f',1,1,0,0,.5,.5,.55,.55,0,.1,1,.3,16/9,0,0,1/12,1/24,.002,.02,0,1,0,0,0,1,0,0,0,1,1,0,1)
tools=dict(schema=3,layers=[],baseMasks={'hsl':[{'sharedID':maskid}],'spider':[{'sharedID':maskid}]},sharedMasks=[dict(id=maskid,enabled=True,combine=0,parameters=parameters,nodes=b'',keys=[])])
preset=dict(format='com.dayu.color.preset',version=7,colorManagement={},values=values,paths={},spider=json.loads((ROOT/'research/cms-correction-20261104/neutral-spider.json').read_text()),tools=base64.b64encode(plistlib.dumps(tools,fmt=plistlib.FMT_BINARY)).decode())
(OUT/'共享矩形_HSL_蜘蛛盘.json').write_text(json.dumps(preset,ensure_ascii=False,indent=2)+'\n')
doc=E.Element('fcpxml',version='1.12');res=E.SubElement(doc,'resources')
E.SubElement(res,'format',id='timeline',width='1920',height='1080',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
for ID,path,size,duration in [('face',portrait,(512,512),'0s'),('motion',motion,(960,540),'4s')]:
fmt=ID+'Format';attrs=dict(id=fmt,width=str(size[0]),height=str(size[1]))
if ID=='motion':attrs.update(frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
E.SubElement(res,'format',**attrs)
asset=E.SubElement(res,'asset',id=ID,name=path.stem,start='0s',duration=duration,hasVideo='1',videoSources='1',format=fmt)
E.SubElement(asset,'media-rep',kind='original-media',src=path.resolve().as_uri())
template=Path.home()/'Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef'
E.SubElement(res,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri())
event=E.SubElement(E.SubElement(doc,'library'),'event',name='大鱼调色_1.12.0_74_统一工作区与共享蒙版')
for name,ID,duration in [('1.12.0_控制面板与共享蒙版','face','6s'),('1.12.0_OpenCV真实帧跟踪','motion','4s')]:
project=E.SubElement(event,'project',name=name);seq=E.SubElement(project,'sequence',format='timeline',duration=duration,tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k');spine=E.SubElement(seq,'spine')
clip=E.SubElement(spine,'video' if ID=='face' else 'asset-clip',ref=ID,name=name,offset='0s',start='0s',duration=duration)
E.SubElement(clip,'filter-video',ref='fx',name='大鱼调色',enabled='1')
reference=Path.home()/'Movies/Motion Templates.localized/Effects.localized/Color Finale/ColorFinalePro/ColorFinalePro.moef'
if reference.is_file():
# Reference only the installed native effect; do not copy vendor templates,
# binaries, assets or source into this repository or the generated XML.
E.SubElement(res,'effect',id='cf',name='ColorFinalePro',uid='~/Effects.localized/Color Finale/ColorFinalePro/ColorFinalePro.moef',src=reference.as_uri())
project=E.SubElement(event,'project',name='1.12.0_ColorFinale同素材参考')
seq=E.SubElement(project,'sequence',format='timeline',duration='4s',tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k')
clip=E.SubElement(E.SubElement(seq,'spine'),'asset-clip',ref='motion',name='ColorFinale同素材跟踪参考',offset='0s',start='0s',duration='4s')
E.SubElement(clip,'filter-video',ref='cf',name='ColorFinalePro',enabled='1')
E.indent(doc);output=OUT/'大鱼调色_1.12.0_74_验收.fcpxml'
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'+E.tostring(doc,encoding='unicode')+'\n')
print(output)
if reference.is_file():
refdoc=copy.deepcopy(doc);refevent=refdoc.find('./library/event');refevent.set('name','大鱼调色_1.12.0_原版同素材参考')
for item in list(refevent):
if item.get('name')!='1.12.0_ColorFinale同素材参考':refevent.remove(item)
E.indent(refdoc);refoutput=OUT/'ColorFinale_同素材参考.fcpxml'
refoutput.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'+E.tostring(refdoc,encoding='unicode')+'\n');print(refoutput)
+16
查看文件
@@ -0,0 +1,16 @@
# 实际轨迹对照
`read_colorfinale_fcpxml.py`只读解析FCP导出的参数55,按确定的BlindDataObject读取内部归档,不实例化原版类、不跟随外部媒体、不把模板默认值当轨迹。`compare_tracks.py`读取该输出或`read_colorfinale_preset.py`输出,并对照大鱼v7作者蒙版。只比较精确CMTime键,缺键直接报告;必须明确单位、坐标方向、基准尺寸、时间偏移、视频SHA及预先选定阈值。
CF参数type0为静态值加轨迹键,type1为静态值乘轨迹键;FTKeyFrame.type是另一个枚举。其坐标为Y向上、弧度正向逆时针。依据见`research/ColorFinaleTrackSemantics78.json`。代码中不含原版可执行代码或模板。
`fixtures/host78`是本软件合成QA视频上实际宿主输出的几何数据,原始CF99帧、大鱼100帧。Dayu保留原tools字节,只移除无关预设字段;CF保留原始静态值和相对键,不拟合或预先转符号。FCP项目、时间线和媒体留在本机,未加入远程仓库;视频生成条件见`tools/create_workspace_host_fixture.py`,精确视频SHA记录在校准文件中。重新编码后的容器SHA可能不同,不能擅自修改校准绕过检查。
```sh
python3 tools/tracking/compare_tracks.py --self-test /tmp/dayu-track-comparator
python3 tools/tracking/compare_tracks.py --cf tools/tracking/fixtures/host78/cf-geometry.json --dayu tools/tracking/fixtures/host78/dayu-geometry-v7.json --calibration tools/tracking/fixtures/host78/real-calibration-overlap99.json --video '/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_蒙版合成运动.mov' --cf-mask-id b842b22d-b5c3-4d4d-826c-c8b90a57a4b4 --dayu-mask-id 47D9F164-E13E-4FCB-9765-AC41826799C8 --output /tmp/dayu-real-track-report.json
```
共同99帧报告通过。使用`real-calibration-100.json`会退出2并报告原版缺失最后一帧;这是预期诚实结果,不是允许忽略的错误。完整报告`verification/HostTracking78-99.json`及`HostTracking78-100.json`保留原始输入SHA和所有样本。误差以960×540源像素计,宿主实际分析1920×1080,禁止混称。
当前证据只覆盖默认未分组矩形和单段合成平移,不能证明任意旋转缩放、遮挡、分组、镜像metadata、非方形像素、非零extent或键间插值完全一致。
+137
查看文件
@@ -0,0 +1,137 @@
// Independent reconstruction using the public OpenCV API. No commercial source.
#include "../../大鱼调色/Plugin/MaskCore/DYOpenCVTracker.hpp"
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/video/tracking.hpp>
#include <opencv2/calib3d.hpp>
namespace dy {
struct OpenCVTracker::Impl {
cv::Mat previous;
std::vector<cv::Point2f> points, polygon;
std::vector<FlowPoint> mask;
TrackerROI seed{};
TrackResult value{};
cv::Point2f center{};
int frameIndex=0, width=0, height=0;
bool running=false;
static cv::Mat gray8(const GrayFrame& f) {
if(!f.valid())return {};
cv::Mat out(f.height,f.width,CV_8UC1);
for(size_t i=0;i<f.pixels.size();++i) {
float x=f.pixels[i];
if(!std::isfinite(x))return {};
out.data[i]=cv::saturate_cast<uchar>(x*255.f);
}
return out;
}
void detect() {
std::vector<cv::Point> vertices,hull;
for(auto p:polygon)vertices.emplace_back(int(p.x),int(p.y));
points.clear();
if(vertices.size()<3)return;
cv::convexHull(vertices,hull,false,true);
cv::Mat area=cv::Mat::zeros(height,width,CV_8UC1);
cv::fillPoly(area,std::vector<std::vector<cv::Point>>{hull},cv::Scalar(255),cv::LINE_AA);
cv::goodFeaturesToTrack(previous,points,300,.03,10.,area,3,false,.04);
if(!points.empty())cv::cornerSubPix(previous,points,{10,10},{-1,-1},
{cv::TermCriteria::COUNT|cv::TermCriteria::EPS,20,.03});
}
TrackResult fail(TrackFailure why) {
running=false;value.valid=false;value.confidence=0;value.failure=why;return value;
}
};
OpenCVTracker::OpenCVTracker():impl_(std::make_shared<Impl>()){}
OpenCVTracker::~OpenCVTracker()=default;
void OpenCVTracker::setMask(std::vector<FlowPoint> p){impl_->mask=std::move(p);}
const char* OpenCVTracker::version(){return CV_VERSION;}
TrackResult OpenCVTracker::result()const{return impl_->value;}
bool OpenCVTracker::active()const{return impl_->running;}
void OpenCVTracker::stop(){impl_->running=false;impl_->value.valid=false;}
bool OpenCVTracker::reset(const GrayFrame& f,TrackerROI roi) {
auto& t=*impl_;t.running=false;t.frameIndex=1;t.points.clear();t.polygon.clear();
t.value={roi.cx,roi.cy,1,0,0,0,0,false};
if(!f.valid()||!std::isfinite(roi.cx)||!std::isfinite(roi.cy)||
!std::isfinite(roi.width)||!std::isfinite(roi.height)||!std::isfinite(roi.angle)||
roi.cx<0||roi.cx>1||roi.cy<0||roi.cy>1||roi.width<=0||roi.height<=0||roi.width>8||roi.height>8) {
t.fail(TrackFailure::InvalidFrame);return false;
}
try {
t.width=f.width;t.height=f.height;t.seed=roi;t.center={roi.cx*f.width,roi.cy*f.height};
t.previous=Impl::gray8(f);if(t.previous.empty()){t.fail(TrackFailure::InvalidFrame);return false;}
auto outline=t.mask;
if(outline.empty())outline={{-.5f,-.5f},{.5f,-.5f},{.5f,.5f},{-.5f,.5f}};
float c=std::cos(roi.angle),s=std::sin(roi.angle);
for(auto p:outline){float x=p.x*roi.width*f.width,y=p.y*roi.height*f.height;
if(!std::isfinite(x)||!std::isfinite(y)){t.fail(TrackFailure::InvalidFrame);return false;}
t.polygon.emplace_back(t.center.x+c*x-s*y,t.center.y+s*x+c*y);}
t.detect();t.value.features=int(t.points.size());t.value.inliers=t.value.features;
if(t.points.size()<4){t.fail(TrackFailure::InsufficientTexture);return false;}
t.running=true;t.value.valid=true;t.value.confidence=1;return true;
} catch(const cv::Exception&){t.fail(TrackFailure::Backend);return false;}
}
TrackResult OpenCVTracker::track(const GrayFrame& f) {
auto& t=*impl_;
if(!t.running||!f.valid()||f.width!=t.width||f.height!=t.height)return t.fail(TrackFailure::InvalidFrame);
try {
auto next=Impl::gray8(f);if(next.empty())return t.fail(TrackFailure::InvalidFrame);
// The reset detected the seed (index zero). Advancing frames redetect
// on indices 1,2,4… in the corresponding previous image.
if(t.frameIndex<2||t.frameIndex%2==0)t.detect();
t.value.features=int(t.points.size());t.value.matches=0;t.value.inliers=0;t.value.medianError=0;
if(t.points.size()<4)return t.fail(TrackFailure::InsufficientTexture);
std::vector<cv::Point2f> forward,backward;
std::vector<uchar> fs,bs;std::vector<float> fe,be;
cv::TermCriteria termination(cv::TermCriteria::COUNT|cv::TermCriteria::EPS,30,.01);
cv::calcOpticalFlowPyrLK(t.previous,next,t.points,forward,fs,fe,{21,21},3,termination,0,1e-4);
cv::calcOpticalFlowPyrLK(next,t.previous,forward,backward,bs,be,{21,21},3,termination,0,1e-4);
std::vector<cv::Point2f> src,dst,movingSrc,movingDst;
const float motionThreshold=std::max(t.width,t.height)*.01f;
for(size_t i=0;i<t.points.size();++i) {
// Checking both statuses also rejects a failed backward solve.
if(!fs[i]||!bs[i]||cv::norm(backward[i]-t.points[i])>=1.)continue;
src.push_back(t.points[i]);dst.push_back(forward[i]);
if(cv::norm(forward[i]-t.points[i])>=motionThreshold){movingSrc.push_back(t.points[i]);movingDst.push_back(forward[i]);}
}
if(movingSrc.size()>src.size()/2){src.swap(movingSrc);dst.swap(movingDst);}
t.value.matches=int(src.size());
if(src.size()<4)return t.fail(TrackFailure::InsufficientMatches);
for(size_t i=0;i<src.size();++i){src[i]-=t.center;dst[i]-=t.center;}
cv::Mat inliers;
cv::Mat affine=cv::estimateAffine2D(src,dst,inliers,cv::RANSAC,3.,2000,.99,10);
if(affine.empty())return t.fail(TrackFailure::IncoherentMotion);
double a=affine.at<double>(0,0),b=affine.at<double>(0,1),tx=affine.at<double>(0,2);
double c=affine.at<double>(1,0),d=affine.at<double>(1,1),ty=affine.at<double>(1,2);
double det=a*d-b*c,sx=std::hypot(a,c),sy=det/sx,angle=std::atan2(c,a);
if(!cv::checkRange(affine)||!(det>0)||!(sx>0)||!(sy>0))return t.fail(TrackFailure::InvalidTransform);
std::vector<float> errors;int accepted=0;
for(size_t i=0;i<src.size();++i)if(inliers.at<uchar>(int(i))){
++accepted;cv::Point2f q(float(a*src[i].x+b*src[i].y+tx),float(c*src[i].x+d*src[i].y+ty));
errors.push_back(float(cv::norm(q-dst[i])));}
t.value.inliers=accepted;
if(accepted<4)return t.fail(TrackFailure::IncoherentMotion);
std::nth_element(errors.begin(),errors.begin()+errors.size()/2,errors.end());
t.value.medianError=errors[errors.size()/2];
float confidence=std::clamp(float(accepted)/float(src.size())*std::exp(-t.value.medianError/3.f),0.f,1.f);
// Product guards are deliberate: no silent successful empty/degenerate fit.
double totalX=t.value.scaleX*sx,totalY=t.value.scaleY*sy;
auto center=t.center+cv::Point2f(float(tx),float(ty));
if(!std::isfinite(totalX)||!std::isfinite(totalY)||totalX<.1||totalX>10||totalY<.1||totalY>10||
sx<.5||sx>2||sy<.5||sy>2||std::abs(angle)>.6)return t.fail(TrackFailure::InvalidTransform);
if(confidence<.3f)return t.fail(TrackFailure::LowConfidence);
if(center.x<0||center.x>=t.width||center.y<0||center.y>=t.height)return t.fail(TrackFailure::OutsideFrame);
float cosA=float(std::cos(angle)),sinA=float(std::sin(angle));
for(auto& p:t.polygon){auto q=p-t.center;p={center.x+float(sx)*q.x*cosA-float(sy)*q.y*sinA,
center.y+float(sx)*q.x*sinA+float(sy)*q.y*cosA};}
t.center=center;t.value.cx=center.x/t.width;t.value.cy=center.y/t.height;
t.value.scaleX=float(totalX);t.value.scaleY=float(totalY);t.value.scale=std::sqrt(t.value.scaleX*t.value.scaleY);
t.value.rotation+=float(angle);t.value.confidence=confidence;t.value.valid=true;t.value.failure=TrackFailure::None;
t.points.clear();for(size_t i=0;i<dst.size();++i)t.points.push_back(dst[i]+(center-cv::Point2f(float(tx),float(ty))));
t.previous=next;++t.frameIndex;return t.value;
}catch(const cv::Exception&){return t.fail(TrackFailure::Backend);}
}
}
+368
查看文件
@@ -0,0 +1,368 @@
#!/usr/bin/env python3
"""Compare explicit CF-reader JSON and Dayu v7 preset tracks, without class loading.
Only exact authored keys are compared. Missing keys are reported, never filled
by interpolation/extrapolation or nearest-frame matching. Calibration is explicit.
"""
import argparse
import base64
import csv
from fractions import Fraction
import hashlib
import json
import math
from pathlib import Path
import plistlib
import struct
import sys
MAX_JSON = 128 * 1024 * 1024
MAX_TOOLS = 24 * 1024 * 1024
def sha256(path):
digest = hashlib.sha256()
with Path(path).open('rb') as stream:
for block in iter(lambda: stream.read(1024 * 1024), b''):
digest.update(block)
return digest.hexdigest()
def read_json(path):
if Path(path).stat().st_size > MAX_JSON:
raise ValueError('JSON input exceeds limit')
return json.loads(Path(path).read_text(), parse_constant=lambda s: (_ for _ in ()).throw(ValueError(s)))
def rational(value):
if not isinstance(value, str):
raise ValueError('Times and offsets must be explicit rational strings, e.g. 1001/24000')
return Fraction(value)
def authored_time(value, scale, epoch):
if not all(isinstance(x, int) and not isinstance(x, bool) for x in (value, scale, epoch)) or scale <= 0:
raise ValueError('Invalid integer CMTime fields')
return epoch, Fraction(value, scale)
def decode_parameters(data):
if not isinstance(data, bytes) or len(data) != 128:
raise ValueError('Dayu mask parameters must match the verified 128-byte ABI')
version, kind, source, flags, *floats = struct.unpack('<4I28f', data)
if version not in (1, 2) or kind not in (0, 1, 2) or not all(math.isfinite(x) for x in floats):
raise ValueError('Unsupported/nonfinite tracked Dayu geometry')
if floats[2] <= 0 or floats[3] <= 0:
raise ValueError('Nonpositive Dayu mask size')
return dict(center=floats[:2], size=floats[2:4], radians=floats[4], kind=kind,
imageAspect=floats[8], version=version, sourceStage=source, flags=flags)
def read_dayu(path, mask_id):
preset = read_json(path)
if preset.get('format') != 'com.dayu.color.preset' or preset.get('version') != 7:
raise ValueError('An explicit full Dayu v7 JSON preset is required')
encoded = preset.get('tools')
if not isinstance(encoded, str) or len(encoded) > (MAX_TOOLS * 4 // 3 + 8):
raise ValueError('Invalid/oversized Dayu author document')
data = base64.b64decode(encoded, validate=True)
if len(data) > MAX_TOOLS:
raise ValueError('Dayu author document exceeds limit')
document = plistlib.loads(data)
if document.get('schema') not in (1, 2, 3):
raise ValueError('Unsupported Dayu author schema')
objects = list(document.get('sharedMasks', []))
bindings = []
for kind, masks in document.get('baseMasks', {}).items():
for mask in masks:
if mask.get('sharedID') == mask_id or mask.get('id') == mask_id:
bindings.append('base:' + kind)
if 'sharedID' not in mask:
objects.append(mask)
for node in document.get('layers', []):
for mask in node.get('masks', []):
if mask.get('sharedID') == mask_id or mask.get('id') == mask_id:
bindings.append(node['id'])
if 'sharedID' not in mask:
objects.append(mask)
selected = [mask for mask in objects if mask.get('id') == mask_id]
if len(selected) != 1:
raise ValueError('Dayu mask ID must select one unique author object')
mask = selected[0]
static = decode_parameters(mask['parameters'])
keys = {}
previous = None
for key in mask.get('keys', []):
time = authored_time(key['value'], key['scale'], key['epoch'])
if time in keys or (previous and (time[0] != previous[0] or time[1] <= previous[1])):
raise ValueError('Dayu keys must have one epoch, strict time order, and no duplicates')
geometry = decode_parameters(key['parameters'])
if geometry['kind'] != static['kind']:
raise ValueError('Dayu keyed mask kind changed')
geometry.update(manual=bool(key['manual']), confidence=float(key['confidence']))
if not math.isfinite(geometry['confidence']) or not 0 <= geometry['confidence'] <= 1:
raise ValueError('Invalid Dayu confidence')
keys[time] = geometry
previous = time
return dict(maskID=mask_id, bindings=bindings, static=static, keys=keys,
shared=any(m.get('id') == mask_id for m in document.get('sharedMasks', [])),
status=mask.get('status'), documentSchema=document['schema'])
def vector(value, count):
if not isinstance(value, list) or len(value) != count or not all(isinstance(v, (int, float)) and math.isfinite(v) for v in value):
raise ValueError('Unexpected CF vector dimension/nonfinite value')
return list(map(float, value))
def read_cf(path, version_index, mask_id):
source = read_json(path)
versions = ([v for v in source['versions'] if v.get('index') == version_index] if 'versions' in source
else [v for i, v in enumerate(source.get('candidates', [])) if i == version_index])
if len(versions) != 1:
raise ValueError('CF version index must select one reader output version')
version = versions[0]
masks = [m for m in version.get('masks', []) if m.get('id') == mask_id]
if len(masks) != 1:
raise ValueError('CF mask ID must select exactly one reader output shape')
channels = {}
for name, count in [('position', 2), ('rotation', 1), ('scale', 2)]:
parameter = masks[0][name]
static = vector(parameter['staticValue'], count)
keys = {}
for key in parameter['keys']:
t = key['time']
time = authored_time(t['value'], t['timescale'], t['epoch'])
if time in keys:
raise ValueError('Duplicate CF property key time')
keys[time] = vector(key['value'], count)
channels[name] = dict(static=static, keys=keys, parameterType=parameter.get('type'))
return dict(maskID=mask_id, channels=channels, sceneID=version.get('sceneID'),
aspectRatio=version.get('aspectRatio'), archiveSHA256=version.get('archiveSHA256'),
readerInputSHA256=source.get('inputSHA256'), readerScope=source.get('scope'))
def verify_calibration(config, video):
if config.get('calibration_confirmed') is not True:
raise ValueError('Calibration is unconfirmed: observe units/origin/time/seed before comparison')
if config.get('evidence_scope') not in ('generated', 'real_exports'):
raise ValueError('Declare whether inputs are generated samples or real exports')
required = ('same_video_and_range_evidence', 'same_seed_shape_evidence', 'time_mapping_evidence',
'position_unit_origin_evidence', 'rotation_unit_direction_evidence', 'size_mapping_evidence')
for name in required:
if not isinstance(config.get(name), str) or not config[name].strip():
raise ValueError('Missing observed calibration evidence: ' + name)
composition = config.get('cf_key_composition')
if composition not in ('absolute', 'animated_parameter'):
raise ValueError('Explicit CF key composition is required')
if config['evidence_scope'] == 'real_exports' and composition != 'animated_parameter':
raise ValueError('Raw real CF exports require verified animated-parameter composition')
metadata = config['video']
if sha256(video) != metadata['sha256']:
raise ValueError('Comparison video SHA-256 does not match the declared shared source')
if metadata.get('pixel_aspect') != '1/1':
raise ValueError('This comparator requires observed square pixels; non-square mapping is not established')
for dimension in ('width', 'height'):
if not isinstance(metadata[dimension], int) or metadata[dimension] <= 0:
raise ValueError('Invalid comparison video dimensions')
if config['cf_position']['units'] not in ('normalized', 'pixels') or config['cf_position']['origin'] not in ('top_left', 'bottom_left'):
raise ValueError('Explicit supported CF position units/origin are required')
if config['cf_rotation']['units'] not in ('radians', 'degrees') or config['cf_rotation']['positive_direction'] not in ('clockwise', 'counterclockwise'):
raise ValueError('Explicit supported CF rotation units/direction are required')
if config['cf_size']['mode'] not in ('normalized_dimensions', 'pixel_dimensions', 'reference_relative_scale'):
raise ValueError('Explicit CF local-axis size mapping is required')
frame = config['grid']
if not isinstance(frame['count'], int) or not 1 <= frame['count'] <= 100000 or rational(frame['step']) <= 0:
raise ValueError('Invalid expected frame grid')
for threshold in ('center_px', 'rotation_degrees', 'width_px', 'height_px'):
value = config['thresholds'][threshold]
if not isinstance(value, (int, float)) or not math.isfinite(value) or value < 0:
raise ValueError('Explicit finite comparison thresholds are required')
def cf_value(channel, time, composition):
if not channel['keys']:
return channel['static']
value = channel['keys'].get(time)
if value is None or composition == 'absolute':
return value
mode = channel['parameterType']
if mode not in (0, 1):
raise ValueError('Unverified CF animated-parameter type')
return [a+b if mode == 0 else a*b for a,b in zip(channel['static'], value)]
def summarize(values):
return None if not values else dict(count=len(values), maximum=max(values),
rms=math.sqrt(sum(x*x for x in values)/len(values)))
def compare(cf, dayu, config):
width, height = config['video']['width'], config['video']['height']
grid = config['grid'];start, step = rational(grid['start']), rational(grid['step'])
offset = rational(config['time']['cf_to_dayu_offset'])
cf_epoch, dayu_epoch = config['time']['cf_epoch'], config['time']['dayu_epoch']
samples = []
composition = config['cf_key_composition']
size = config['cf_size']
reference_scale = None
if size['mode'] == 'reference_relative_scale':
reference_time = rational(size['reference_time_dayu'])
reference_scale = cf_value(cf['channels']['scale'], (cf_epoch, reference_time-offset), composition)
if reference_scale is None or min(reference_scale) <= 0:
raise ValueError('CF scale has no exact valid reference-time sample')
if min(size['reference_local_width_normalized'], size['reference_local_height_normalized']) <= 0:
raise ValueError('Observed unrotated reference local-axis dimensions must be positive')
for frame in range(grid['count']):
t = start + frame*step
source_time = (cf_epoch, t-offset)
raw = {name: cf_value(channel, source_time, composition) for name, channel in cf['channels'].items()}
current = dayu['keys'].get((dayu_epoch, t))
missing = ['cf.' + name for name, value in raw.items() if value is None]
if current is None:
missing.append('dayu.authored_key')
sample = dict(frame=frame, time=f'{t.numerator}/{t.denominator}', epoch=dayu_epoch,
cfTime=f'{(t-offset).numerator}/{(t-offset).denominator}', missing=missing)
if not missing:
center = list(raw['position'])
if config['cf_position']['units'] == 'pixels':
center = [center[0]/width, center[1]/height]
if config['cf_position']['origin'] == 'bottom_left':
center[1] = 1-center[1]
angle = raw['rotation'][0]
if config['cf_rotation']['units'] == 'degrees':
angle = math.radians(angle)
if config['cf_rotation']['positive_direction'] == 'counterclockwise':
angle = -angle
dimensions = list(raw['scale'])
if min(dimensions) <= 0:
raise ValueError('Negative/reflected CF scale requires a verified shape transform mapping')
if size['mode'] == 'pixel_dimensions':
dimensions = [dimensions[0]/width, dimensions[1]/height]
elif reference_scale:
dimensions = [size['reference_local_width_normalized']*dimensions[0]/reference_scale[0],
size['reference_local_height_normalized']*dimensions[1]/reference_scale[1]]
delta = current['radians']-angle
errors = dict(center_px=math.hypot((current['center'][0]-center[0])*width,
(current['center'][1]-center[1])*height),
rotation_degrees=abs(math.degrees(math.atan2(math.sin(delta), math.cos(delta)))),
rotation_unwrapped_degrees=abs(math.degrees(delta)),
width_px=abs(current['size'][0]-dimensions[0])*width,
height_px=abs(current['size'][1]-dimensions[1])*height)
sample.update(cfRaw=raw, cfCanonical=dict(center=center, size=dimensions, radians=angle),
dayu=current, errors=errors,
exceeds=[name for name, threshold in config['thresholds'].items() if errors[name] > threshold])
samples.append(sample)
matched = [s for s in samples if not s['missing']]
manual = [s['frame'] for s in matched if s['dayu']['manual'] and rational(s['time']) != start]
failed = [s for s in matched if s['exceeds']]
missing = [s for s in samples if s['missing']]
all_names = ('center_px', 'rotation_degrees', 'rotation_unwrapped_degrees', 'width_px', 'height_px')
passed = not missing and not failed and not manual
return dict(status='pass' if passed else 'fail', evidenceScope=config.get('evidence_scope'),
originalRuntimeEquivalenceEstablished=False,
selectedTrajectoryNumericAgreementWithinThreshold=passed,
realExportsCompared=config.get('evidence_scope') == 'real_exports',
expectedFrames=len(samples), matchedFrames=len(matched), missingFrames=len(missing),
firstMissing=missing[0] if missing else None,
firstThresholdFailure=failed[0] if failed else None,
interiorManualKeyFrames=manual,
metrics={name:summarize([s['errors'][name] for s in matched]) for name in all_names},
thresholds=config['thresholds'],
note='Exact authored keys only. Missing keys may be loss or export omission; inspect runtime to distinguish. '
'A matching numeric report does not establish matching render pixels or arbitrary-footage equivalence.',
cf={k:v for k,v in cf.items() if k != 'channels'},
dayu={k:v for k,v in dayu.items() if k not in ('keys', 'static')},
calibration=config, samples=samples)
def self_test(directory):
directory.mkdir(parents=True, exist_ok=True)
video = directory/'generated-source.bin';video.write_bytes(b'GENERATED TEST DATA, NOT ACTUAL QA VIDEO\n')
mask_id = 'f072709b-9cca-4ad3-b5a1-e930862ea322'
cf_id = 'c1014285-bd83-4c12-b099-d1bd28c45f70'
def packed(x, y, w, h, angle):
values = [x,y,w,h,angle,0,1,.3,16/9,0,0,1/12,1/24,.002,.02,0,1,0,0,0,1,0,0,0,1,1,0,1]
return struct.pack('<4I28f', 1,1,0,0,*values)
times = [Fraction(i*1001,24000) for i in range(4)]
cf_channels = {name:dict(staticValue=value,keys=[]) for name,value in
[('position',[.2,.7]),('rotation',[0]),('scale',[2,3])]}
keys=[]
for i,t in enumerate(times):
x,y,w,h,angle=.2+i*.03,.3+i*.02,.4*(1+i*.1),.5*(1+i*.05),i*.04
keys.append(dict(value=t.numerator,scale=t.denominator,epoch=0,parameters=packed(x,y,w,h,angle),manual=i==0,confidence=.95))
for name,value in [('position',[x,1-y]),('rotation',[-math.degrees(angle)]),('scale',[2*(1+i*.1),3*(1+i*.05)])]:
# Same rational time encoded at a different CMTime timescale; CF has a +2s source origin.
ct=t+2
cf_channels[name]['keys'].append(dict(time=dict(value=ct.numerator*2,timescale=ct.denominator*2,epoch=0),value=value))
mask=dict(id=mask_id,enabled=True,combine=0,parameters=packed(.2,.3,.4,.5,0),nodes=b'',keys=keys)
doc=dict(schema=3,layers=[],baseMasks=dict(hsl=[dict(sharedID=mask_id)],spider=[dict(sharedID=mask_id)]),sharedMasks=[mask])
preset=dict(format='com.dayu.color.preset',version=7,tools=base64.b64encode(plistlib.dumps(doc,fmt=plistlib.FMT_BINARY)).decode())
cf_json=dict(versions=[dict(index=0,sceneID='generated-scene',aspectRatio=16/9,masks=[dict(id=cf_id,**cf_channels)])])
config=dict(calibration_confirmed=True,evidence_scope='generated',cf_key_composition='absolute',video=dict(sha256=sha256(video),width=1920,height=1080,pixel_aspect='1/1'),
time=dict(cf_to_dayu_offset='-2/1',cf_epoch=0,dayu_epoch=0),grid=dict(start='0/1',step='1001/24000',count=4),
cf_position=dict(units='normalized',origin='bottom_left'),cf_rotation=dict(units='degrees',positive_direction='counterclockwise'),
cf_size=dict(mode='reference_relative_scale',reference_time_dayu='0/1',reference_local_width_normalized=.4,reference_local_height_normalized=.5),
thresholds=dict(center_px=.001,rotation_degrees=.001,width_px=.001,height_px=.001))
for name in ('same_video_and_range_evidence','same_seed_shape_evidence','time_mapping_evidence','position_unit_origin_evidence','rotation_unit_direction_evidence','size_mapping_evidence'):
config[name]='Generated fixture construction only; no vendor runtime was observed.'
cf_path=directory/'generated-cf-reader-output.json';cf_path.write_text(json.dumps(cf_json,indent=2))
dy_path=directory/'generated-dayu-v7-preset.json';dy_path.write_text(json.dumps(preset,indent=2))
cfg_path=directory/'generated-confirmed-calibration.json';cfg_path.write_text(json.dumps(config,indent=2))
verify_calibration(config,video);cf=read_cf(cf_path,0,cf_id);dy=read_dayu(dy_path,mask_id);report=compare(cf,dy,config)
assert report['status']=='pass' and report['matchedFrames']==4 and not report['originalRuntimeEquivalenceEstablished']
assert dy['shared'] and len(dy['bindings'])==2
(directory/'generated-pass-report.json').write_text(json.dumps(report,indent=2))
del cf['channels']['position']['keys'][(0,times[2]+2)]
missing=compare(cf,dy,config);assert missing['status']=='fail' and missing['missingFrames']==1 and missing['firstMissing']['frame']==2
(directory/'generated-missing-frame-report.json').write_text(json.dumps(missing,indent=2))
cf=read_cf(cf_path,0,cf_id);dy['keys'][(0,times[1])]['center'][0]+=.01
mismatch=compare(cf,dy,config);assert mismatch['status']=='fail' and mismatch['firstThresholdFailure']['frame']==1 and mismatch['metrics']['center_px']['maximum']>19
(directory/'generated-mismatch-report.json').write_text(json.dumps(mismatch,indent=2))
rejected=0
unconfirmed=dict(config,calibration_confirmed=False)
try:verify_calibration(unconfirmed,video)
except ValueError:rejected+=1
bad=dict(preset,tools=base64.b64encode(plistlib.dumps(dict(schema=3,layers=[],baseMasks={},sharedMasks=[dict(mask,parameters=b'bad')]),fmt=plistlib.FMT_BINARY)).decode())
bad_path=directory/'generated-invalid-dayu.json';bad_path.write_text(json.dumps(bad))
try:read_dayu(bad_path,mask_id)
except ValueError:rejected+=1
assert rejected==2
assert cf_value(dict(static=[.5,.5],keys={(0,Fraction(0)):[.1,-.2]},parameterType=0),(0,Fraction(0)),'animated_parameter') == [.6,.3]
assert cf_value(dict(static=[2,3],keys={(0,Fraction(0)):[.5,2]},parameterType=1),(0,Fraction(0)),'animated_parameter') == [1,6]
result=dict(pass_=True,scope='Generated samples only; no CF export, real video tracking, FCP or preferences accessed.',
checks=['128-byte-Dayu-ABI-and-unique-shared-bindings','exact-NTSC-CMTime-with-different-timescales-and-source-offset',
'explicit-bottom-origin-and-degree-direction-conversion','relative-two-axis-size-calibration',
'no-interpolation-on-missing-authored-frame','numeric-mismatch-detection','unconfirmed-calibration-rejected','malformed-ABI-rejected','type0-additive-key-composition','type1-multiplicative-key-composition'])
(directory/'self-test.json').write_text(json.dumps(result,indent=2));print(json.dumps(result))
def main():
parser=argparse.ArgumentParser(description=__doc__)
for name in ('cf','dayu','calibration','video','output','csv'):
parser.add_argument('--'+name,type=Path)
parser.add_argument('--cf-version-index',type=int,default=0);parser.add_argument('--cf-mask-id');parser.add_argument('--dayu-mask-id')
parser.add_argument('--self-test',type=Path,metavar='GENERATED_FIXTURE_DIRECTORY')
args=parser.parse_args()
if args.self_test:self_test(args.self_test);return
if not all((args.cf,args.dayu,args.calibration,args.video,args.output,args.cf_mask_id,args.dayu_mask_id)):
parser.error('explicit CF JSON, Dayu preset, calibration, video, selected mask IDs and output are required')
config=read_json(args.calibration);verify_calibration(config,args.video)
report=compare(read_cf(args.cf,args.cf_version_index,args.cf_mask_id),read_dayu(args.dayu,args.dayu_mask_id),config)
report['inputs']={name:dict(path=str(path.resolve()),sha256=sha256(path)) for name,path in
[('cfReaderJSON',args.cf),('dayuPreset',args.dayu),('calibration',args.calibration),('video',args.video)]}
args.output.write_text(json.dumps(report,ensure_ascii=False,indent=2,allow_nan=False)+'\n')
if args.csv:
fields=['frame','time','epoch','cfTime','missing','exceeds','center_px','rotation_degrees','rotation_unwrapped_degrees','width_px','height_px']
with args.csv.open('w',newline='') as stream:
writer=csv.DictWriter(stream,fields);writer.writeheader()
for sample in report['samples']:
row={name:sample.get(name,'') for name in fields};row.update(sample.get('errors',{}));row['missing']=';'.join(sample['missing']);row['exceeds']=';'.join(sample.get('exceeds',[]));writer.writerow(row)
print(json.dumps({k:report[k] for k in ('status','evidenceScope','expectedFrames','matchedFrames','missingFrames','metrics')}))
if report['status']!='pass':sys.exit(2)
if __name__=='__main__':
try:main()
except (ValueError,KeyError,TypeError,IndexError,OSError,plistlib.InvalidFileException) as error:
print('Comparison refused: '+str(error),file=sys.stderr);sys.exit(1)
文件差异过大,未显示。 加载差异
@@ -0,0 +1,6 @@
{
"format": "com.dayu.color.preset",
"version": 7,
"tools": "YnBsaXN0MDDUAAEAAgADAAQABQALAAwBzlliYXNlTWFza3NWc2NoZW1hW3NoYXJlZE1hc2tzVmxheWVyc9EABgAHU2hzbKEACNEACQAKWHNoYXJlZElEXxAkNDdEOUYxNjQtRTEzRS00RkNCLTk3NjUtQUM0MTgyNjc5OUM4EAOhAA3XAA4ADwAQABEAEgATABQAFQAWAcoBywAeAcwBzVZzdGF0dXNUa2V5c1dlbmFibGVkUmlkV2NvbWJpbmVVbm9kZXNacGFyYW1ldGVyc28QEWtjVBGN344qW4xiEAAgALcAIAAxADAAMAAgTiqPaI/5lS6vEGQAFwAiACYAKgAtADIANgA6AD4AQwBIAEwAUABUAFgAXQBhAGUAaQBuAHMAdwB7AH8AgwCIAIsAjwCTAJgAnQChAKUAqQCtALIAtgC6AL4AwwDIAMwA0ADUANgA3QDhAOUA6QDuAPMA9wD7AP8BAwEIAQwBEAEUARkBHgEiASYBKgEuATMBNwE7AT8BRAFJAU0BUQFVAVkBXgFiAWYBagFvAXQBeAF8AYABhAGJAY0BkQGVAZoBnwGjAacBqwGvAbQBuAG8AcABxdYAFAAYABkAGgAbABwAHQAeAB8AIAAeACFVdmFsdWVWbWFudWFsWmNvbmZpZGVuY2VVZXBvY2hVc2NhbGVPEIABAAAAAQAAAAAAAAAAAAAAAAAAPwAAAD/NzMw9zczMPQAAAAAAAAAAAACAP5qZmT4AAIA/AAAAAAAAAACrqqo9q6oqPW8SAzsK16M8AAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAgD8AAAAAAACAPxAACCI/gAAAEBnWABQAGAAZABoAGwAcACMAJAAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAAAAAD8AAAA/zczMPc3MzD0AAAAAAAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QAQjWABQAGAAZABoAGwAcACcAKAAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAAAAAD8AAAA/zczMPc3MzD0AAAAAAAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QAgjWABQAGAAZABoAGwAcACsACwAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAAAAAD8AAAA/zczMPc3MzD0AAAAAAAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8I1gAUABgAGQAaABsAHAAuAC8AHwAxAB4AIU8QgAEAAAABAAAAAAAAAAAAAACc7v4+UgAAPwTKzD0f2Mw90hDDNwAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EAQIIj993PXWABQAGAAZABoAGwAcADMANAAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAJzu/j5SAAA/BMrMPR/YzD3SEMM3AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QBQjWABQAGAAZABoAGwAcADcAOAAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAJzu/j5SAAA/BMrMPR/YzD3SEMM3AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QBgjWABQAGAAZABoAGwAcADsAPAAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAJzu/j5SAAA/BMrMPR/YzD3SEMM3AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QBwjWABQAGAAZABoAGwAcAD8AQAAfAEIAHgAhTxCAAQAAAAEAAAAAAAAAAAAAAMnu/j7FGv4+8MnMPbfWzD1a/q23AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QCAgiP34VNNYAFAAYABkAGgAbABwARABFAB8ARwAeACFPEIABAAAAAQAAAAAAAAAAAAAAvt39Proa/j4Tzcw9eM/MPVa1rbgAAAAAAACAP5qZmT4AAIA/AAAAAAAAAACrqqo9q6oqPW8SAzsK16M8AAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAgD8AAAAAAACAPxAJCCI/fjm21gAUABgAGQAaABsAHABJAEoAHwAgAB4AIU8QgAEAAAABAAAAAAAAAAAAAAC+3f0+uhr+PhPNzD14z8w9VrWtuAAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EAoI1gAUABgAGQAaABsAHABNAE4AHwAgAB4AIU8QgAEAAAABAAAAAAAAAAAAAAC+3f0+uhr+PhPNzD14z8w9VrWtuAAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EAsI1gAUABgAGQAaABsAHABRAFIAHwAgAB4AIU8QgAEAAAABAAAAAAAAAAAAAAC+3f0+uhr+PhPNzD14z8w9VrWtuAAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EAwI1gAUABgAGQAaABsAHABVAFYAHwAgAB4AIU8QgAEAAAABAAAAAAAAAAAAAAC+3f0+uhr+PhPNzD14z8w9VrWtuAAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EA0I1gAUABgAGQAaABsAHABZAFoAHwBcAB4AIU8QgAEAAAABAAAAAAAAAAAAAAAUzfw+khr+PknMzD3I0cw9exGPuAAAAAAAAIA/mpmZPgAAgD8AAAAAAAAAAKuqqj2rqio9bxIDOwrXozwAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AACAPwAAAAAAAIA/EA4IIj99swTWABQAGAAZABoAGwAcAF4AXwAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAABTN/D6SGv4+SczMPcjRzD17EY+4AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QDwjWABQAGAAZABoAGwAcAGIAYwAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAABTN/D6SGv4+SczMPcjRzD17EY+4AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QEAjWABQAGAAZABoAGwAcAGYAZwAfACAAHgAhTxCAAQAAAAEAAAAAAAAAAAAAABTN/D6SGv4+SczMPcjRzD17EY+4AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QEQjWABQAGAAZABoAGwAcAGoAawAfAG0AHgAhTxCAAQAAAAEAAAAAAAAAAAAAAE3N/D6tNPw+8szMPQHMzD3MiLO4AAAAAAAAgD+amZk+AACAPwAAAAAAAAAAq6qqPauqKj1vEgM7CtejPAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAAAAAgD8QEggiP31w/dYAFAAYABkAGgAbABwAbwBwAB8AcgAeACFPEIABAAAAAQAAAAAAAAAAAAAA5rv7Ptw0/D7Wx8w9EszMPWr7nbgAAAAAAACAP5qZmT4AAIA/AAAAAAAAAACrqqo9q6oqPW8SAzsK16M8AAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAgD8AAAAAAACAPxATCCI/ffxP1gAUABgAGQAaABsAHAB0AHUAHwAgAB4AIU8QgAEAAAABAAAAAAAAAAALine truncated
"sourcePresetSHA256": "6d5ca8469f487ec73103c436ed0c0514940ca7837807e617355fdd41587fed5a"
}
@@ -0,0 +1,49 @@
{
"calibration_confirmed": true,
"evidence_scope": "real_exports",
"video": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_蒙版合成运动.mov",
"sha256": "2cf7368ade39eb064593afc098661d348e83dd0cd3f8ab5d9b9826aa7870b6e7",
"width": 960,
"height": 540,
"pixel_aspect": "1/1"
},
"grid": {
"start": "0/1",
"step": "1/25",
"count": 100
},
"time": {
"cf_to_dayu_offset": "0/1",
"cf_epoch": 0,
"dayu_epoch": 0
},
"cf_position": {
"units": "normalized",
"origin": "bottom_left"
},
"cf_rotation": {
"units": "radians",
"positive_direction": "counterclockwise"
},
"cf_size": {
"mode": "reference_relative_scale",
"reference_time_dayu": "0/1",
"reference_local_width_normalized": 0.1,
"reference_local_height_normalized": 0.1
},
"thresholds": {
"center_px": 1,
"rotation_degrees": 0.1,
"width_px": 1,
"height_px": 1
},
"same_video_and_range_evidence": "FCP QA projects reference identical 960x540,25fps,100-frame MOV SHA256 listed here, 4s clips from source zero. Dayu actual analyzer logs 1920x1080; errors below use original source pixels.",
"same_seed_shape_evidence": "Both native host UIs created ungrouped rectangle center(.5,.5), full width .1,height .1,scale(1,1),rotation0 at source0. Dayu authored floats differ only by float32 quantization. Mask IDs are explicit CLI arguments.",
"time_mapping_evidence": "Both actual exports carry epoch0 source time keys beginning0, step1/25, clipoffset0. CF ends98/25; Dayu ends99/25. No interpolation, retiming, nearest-key or fitted offset.",
"position_unit_origin_evidence": "GradeKit arm64 SHA e868a8c6df64bf03b7c24af5657c5ac7a2259a1943dfe06e01dbb7881df018a3: init0x21f48,convertObjectPoint0x2210c,renderMaskForShape0x24174 establish normalized Y-up; parameter type0 uses static+raw at0x2ff68/0x30010. Canonical y=1-yCF.",
"rotation_unit_direction_evidence": "GradeKit renderMaskForShape0x24174 passes evaluated scalar directly to CGAffineTransformRotate; installed SDK contract radians positive CCW. Canonical Dayu top-left angle negates CF angle. No trajectory sign fitting.",
"size_mapping_evidence": "GradeKit FTTrackerRect.bounds0x74d7c,boundingPointsForExtent0x74de0: size(.1,.1) full frame fractions. Parameter type1 static*raw at0x30018. Reference scale(1,1), so dimensions .1*evaluatedScale. Zero-origin square-pixel ungrouped footage only.",
"note": "Thresholds set before first real comparison: center1sourcepixel,size1sourcepixel,rotation0.1degree. Full100-frame comparison intentionally reports original missing frame99; separate common99 comparison does not claim full-range or arbitrary-footage equivalence.",
"cf_key_composition": "animated_parameter"
}
@@ -0,0 +1,49 @@
{
"calibration_confirmed": true,
"evidence_scope": "real_exports",
"video": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_蒙版合成运动.mov",
"sha256": "2cf7368ade39eb064593afc098661d348e83dd0cd3f8ab5d9b9826aa7870b6e7",
"width": 960,
"height": 540,
"pixel_aspect": "1/1"
},
"grid": {
"start": "0/1",
"step": "1/25",
"count": 99
},
"time": {
"cf_to_dayu_offset": "0/1",
"cf_epoch": 0,
"dayu_epoch": 0
},
"cf_position": {
"units": "normalized",
"origin": "bottom_left"
},
"cf_rotation": {
"units": "radians",
"positive_direction": "counterclockwise"
},
"cf_size": {
"mode": "reference_relative_scale",
"reference_time_dayu": "0/1",
"reference_local_width_normalized": 0.1,
"reference_local_height_normalized": 0.1
},
"thresholds": {
"center_px": 1,
"rotation_degrees": 0.1,
"width_px": 1,
"height_px": 1
},
"same_video_and_range_evidence": "FCP QA projects reference identical 960x540,25fps,100-frame MOV SHA256 listed here, 4s clips from source zero. Dayu actual analyzer logs 1920x1080; errors below use original source pixels.",
"same_seed_shape_evidence": "Both native host UIs created ungrouped rectangle center(.5,.5), full width .1,height .1,scale(1,1),rotation0 at source0. Dayu authored floats differ only by float32 quantization. Mask IDs are explicit CLI arguments.",
"time_mapping_evidence": "Both actual exports carry epoch0 source time keys beginning0, step1/25, clipoffset0. CF ends98/25; Dayu ends99/25. No interpolation, retiming, nearest-key or fitted offset.",
"position_unit_origin_evidence": "GradeKit arm64 SHA e868a8c6df64bf03b7c24af5657c5ac7a2259a1943dfe06e01dbb7881df018a3: init0x21f48,convertObjectPoint0x2210c,renderMaskForShape0x24174 establish normalized Y-up; parameter type0 uses static+raw at0x2ff68/0x30010. Canonical y=1-yCF.",
"rotation_unit_direction_evidence": "GradeKit renderMaskForShape0x24174 passes evaluated scalar directly to CGAffineTransformRotate; installed SDK contract radians positive CCW. Canonical Dayu top-left angle negates CF angle. No trajectory sign fitting.",
"size_mapping_evidence": "GradeKit FTTrackerRect.bounds0x74d7c,boundingPointsForExtent0x74de0: size(.1,.1) full frame fractions. Parameter type1 static*raw at0x30018. Reference scale(1,1), so dimensions .1*evaluatedScale. Zero-origin square-pixel ungrouped footage only.",
"note": "Thresholds set before first real comparison: center1sourcepixel,size1sourcepixel,rotation0.1degree. Full100-frame comparison intentionally reports original missing frame99; separate common99 comparison does not claim full-range or arbitrary-footage equivalence.",
"cf_key_composition": "animated_parameter"
}
@@ -0,0 +1,210 @@
#!/usr/bin/env python3
"""Read a native CF collection stream as data, without loading vendor classes.
Accepts the version 1/2/5 collection/preset/version payload established from the
installed ColorFinaleUtils framework. The surrounding UI export file envelope
is not yet established by a real fixture. Supply an extracted raw payload only;
this reader never scans for headers or guesses offsets inside other files.
"""
import argparse
import hashlib
import json
from pathlib import Path
import plistlib
import sys
from read_colorfinale_preset import MAX_BYTES, decode_archive, geometry, identifier, inflate
class Stream:
def __init__(self, data):
if len(data) > MAX_BYTES:
raise ValueError('Native payload exceeds input limit')
self.data, self.offset = data, 0
def take(self, count):
if count < 0 or count > len(self.data) - self.offset:
raise ValueError('Truncated native stream at byte ' + str(self.offset))
value = self.data[self.offset:self.offset + count]
self.offset += count
return value
def integer(self):
first = self.take(1)[0]
if first == 0:
return int.from_bytes(self.take(8), 'little')
extra = (first & -first).bit_length() - 1
encoded = bytes([first]) + self.take(extra)
return int.from_bytes(encoded, 'little') >> (extra + 1)
def count(self, maximum):
value = self.integer()
if value > maximum:
raise ValueError('Native count exceeds limit')
return value
def binary(self, maximum=64 * 1024 * 1024):
return self.take(self.count(maximum))
def text(self):
return self.binary(1024 * 1024).decode('utf-8', errors='strict')
def flag(self):
value = self.integer()
if value not in (0, 1):
raise ValueError('Unsupported native flag')
return bool(value)
def storage_data(self):
if not self.flag():
return None, None
if not self.flag():
return None, self.take(32).hex()
return self.binary(), None
def read_collection(data):
stream = Stream(data)
if stream.integer() != 1:
raise ValueError('Expected native collection version 1')
collection = {'name': stream.text(), 'id': stream.text(),
'flags': stream.take(1)[0]}
versions = []
total_versions = 0
archive_bytes = 0
for _ in range(stream.count(1000)):
if stream.integer() != 2:
raise ValueError('Expected native preset version 2')
preset = {'name': stream.text(), 'id': stream.text()}
tags = [stream.text() for _ in range(stream.count(10000))]
for _ in range(stream.count(1000)):
total_versions += 1
if total_versions > 10000:
raise ValueError('Too many native versions')
if stream.integer() != 5:
raise ValueError('Expected native preset-version format 5')
name, version_id, color = stream.text(), stream.text(), stream.text()
active = stream.flag()
stack, stack_reference = stream.storage_data()
masks, masks_reference = stream.storage_data()
if masks_reference is not None:
raise ValueError('Masks are an external SHA-256 reference; '
'an inline-data payload is required')
if not masks:
continue
archive = inflate(masks)
archive_bytes += len(archive)
if archive_bytes > MAX_BYTES:
raise ValueError('Combined native archive expansion exceeds limit')
scene = decode_archive(archive)
if not isinstance(scene, dict):
raise ValueError('Expected native tracker-scene dictionary')
versions.append({'index': len(versions), 'name': name, 'id': version_id,
'preset': preset, 'tags': tags, 'active': active,
'colorSpace': color,
'stackInline': stack is not None,
'stackReference': stack_reference,
'archiveSHA256': hashlib.sha256(archive).hexdigest(),
'sceneID': identifier(scene.get('identifier')),
'aspectRatio': scene.get('aspectRatio'),
'masks': geometry(scene)})
if stream.offset != len(data):
raise ValueError('Trailing bytes after native collection payload')
if not versions:
raise ValueError('Native collection contains no inline masks archive')
return {'collection': collection, 'versions': versions,
'maskCount': sum(len(v['masks']) for v in versions),
'keyCount': sum(len(m[p]['keys']) for v in versions for m in v['masks']
for p in ('position', 'rotation', 'scale')),
'reader': 'bounded native stream + plistlib; no vendor class loading',
'coordinateNote': 'Raw authored coordinates and radians; no implicit flip.',
'scope': 'Raw collection payload only. UI file envelope and real exported '
'fixture remain unverified.'}
def self_test():
# Fixed prefix examples derived from the observed byte format, including
# both encoding branches; these are not outputs of the fixture writer.
examples = [(b'\x01', 0), (b'\x03', 1), (b'\xff', 127),
(b'\x02\x02', 128), (b'\xfe\xff', 16383),
(b'\x04\x00\x02', 16384),
(b'\x80' + b'\xff' * 7, (1 << 56) - 1),
(b'\x00' + (1 << 56).to_bytes(8, 'little'), 1 << 56),
(b'\x00' + b'\xff' * 8, (1 << 64) - 1)]
for encoded, expected in examples:
s = Stream(encoded)
assert s.integer() == expected and s.offset == len(encoded)
def integer(value):
if value >= 1 << 56:
return b'\0' + value.to_bytes(8, 'little')
size = max(1, (value.bit_length() + 6) // 7)
return ((value << size) | (1 << (size - 1))).to_bytes(size, 'little')
def binary(value):
return integer(len(value)) + value
def text(value):
return binary(value.encode())
archive = plistlib.dumps({'$archiver': 'NSKeyedArchiver', '$version': 100000,
'$objects': ['$null', {'identifier': 'scene-id', 'aspectRatio': 16 / 9, 'nodes': [
{'position': {'value': [.25, .75], 'keyFrames': []},
'rotation': {'value': 0, 'keyFrames': []},
'scale': {'value': [1, 1], 'keyFrames': []}}]}],
'$top': {'root': plistlib.UID(1)}}, fmt=plistlib.FMT_BINARY)
prefix = (integer(1) + text('QA') + text('collection-id') + b'\0' + integer(1)
+ integer(2) + text('Known motion') + text('preset-id') + integer(0)
+ integer(1) + integer(5) + text('Version 1') + text('version-id')
+ text('Rec709') + integer(1) + integer(0))
payload = prefix + integer(1) + integer(1) + binary(archive)
result = read_collection(payload)
assert result['maskCount'] == 1 and result['keyCount'] == 0
assert result['versions'][0]['sceneID'] == 'scene-id'
assert result['versions'][0]['aspectRatio'] == 16 / 9
assert result['versions'][0]['masks'][0]['position']['staticValue'] == [.25, .75]
invalid = [payload[:-1], payload + b'x', b'\x05' + payload[1:],
prefix + integer(1) + integer(0) + bytes(32)]
for data in invalid:
try:
read_collection(data)
except ValueError:
pass
else:
raise AssertionError('Invalid native payload was accepted')
print(json.dumps({'pass': True, 'checks': ['nine-fixed-variable-prefix-values',
'native-1-2-5-inline-mask-generated-fixture',
'reject-truncation-trailing-version-and-external-reference'],
'scope': 'Generated data only; no original exported fixture used.'}))
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('input', type=Path, nargs='?')
parser.add_argument('--output', type=Path)
parser.add_argument('--self-test', action='store_true')
args = parser.parse_args()
if args.self_test:
self_test()
return
if not args.input:
parser.error('an explicitly extracted raw native collection payload is required')
if args.input.stat().st_size > MAX_BYTES:
raise ValueError('Native payload exceeds input limit')
data = args.input.read_bytes()
result = read_collection(data)
result.update(input=str(args.input.resolve()), inputSHA256=hashlib.sha256(data).hexdigest())
output = json.dumps(result, ensure_ascii=False, indent=2, allow_nan=False) + '\n'
if args.output:
args.output.write_text(output)
else:
sys.stdout.write(output)
if __name__ == '__main__':
try:
main()
except (ValueError, TypeError, KeyError, IndexError, OSError,
plistlib.InvalidFileException) as error:
print('Cannot extract verified native tracks: ' + str(error), file=sys.stderr)
sys.exit(1)
+129
查看文件
@@ -0,0 +1,129 @@
#!/usr/bin/env python3
"""Extract CF parameter 55 from FCP-exported XML without loading vendor code.
Template defaults are reported as nil, never as tracking evidence. Only explicit
Motion custom-data carriers are decoded; external resources are not followed.
"""
from pathlib import Path
import argparse, base64, hashlib, json, plistlib, sys, urllib.parse
import xml.etree.ElementTree as ET
from read_colorfinale_preset import decode_archive, geometry, identifier
NATIVE='*-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
STANDARD='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
MAX_BYTES=128*1024*1024
def native_carrier(text):
text=''.join(text.split())
if not text or len(text)>MAX_BYTES*2 or any(c not in NATIVE for c in text):
raise ValueError('Unsupported Motion native-data text')
normal=text.translate(str.maketrans(NATIVE,STANDARD))
raw=base64.b64decode(normal+'='*((-len(normal))%4),validate=True)
if len(raw)<10:raise ValueError('Truncated Motion custom-data carrier')
count=int.from_bytes(raw[:8],'big')
if count>MAX_BYTES or raw[8]!=42 or len(raw)<9+count:
raise ValueError('Invalid Motion custom-data length/tag')
padding=raw[9+count:]
if len(padding)>3 or any(padding):raise ValueError('Unsupported Motion data trailer')
archive=raw[9:9+count]
if not archive.startswith((b'bplist',b'<?xml')):raise ValueError('Expected native keyed plist archive')
return archive,{'bytes':len(raw),'archiveBytes':count,'zeroTrailerBytes':len(padding)}
def root_object(archive):
obj=plistlib.loads(archive)
if not isinstance(obj,dict) or obj.get('$archiver')!='NSKeyedArchiver':
raise ValueError('Expected NSKeyedArchiver data')
table=obj.get('$objects',[]);top=obj.get('$top',{})
if not isinstance(table,list) or len(table)>200000:raise ValueError('Invalid keyed object table')
blind=top.get('BlindDataObject')
if blind is not None:
if not isinstance(blind,plistlib.UID) or blind.data>=len(table):raise ValueError('Invalid BlindDataObject UID')
data=table[blind.data]
legacy=top.get('DataIsLegacy');legacy=table[legacy.data] if isinstance(legacy,plistlib.UID) and legacy.data<len(table) else legacy
if data=='$null':return None,None,{'wrapper':'BlindDataObject','legacy':legacy}
if not isinstance(data,bytes):raise ValueError('BlindDataObject is not NSData bytes')
# No recursive scanning: the established blind-data field must itself
# contain the complete inner keyed archive.
if not data.startswith((b'bplist',b'<?xml')):
raise ValueError('BlindDataObject uses an unverified legacy/external format')
value=decode_archive(data)
return value,data,{'wrapper':'BlindDataObject','legacy':legacy}
ref=top.get('root',top.get('$0'))
if ref is None:raise ValueError('Unknown keyed archive root field')
if isinstance(ref,plistlib.UID) and ref.data==0:return None,None,{'wrapper':'direct-nil'}
return decode_archive(archive),archive,{'wrapper':'direct-object'}
def carrier_report(param,context,extract_dir=None,index=0):
if param.findtext('numberOfKeypoints','0').strip()!='0':raise ValueError('Animated custom carrier needs a real verified fixture')
value=param.findtext('dataValue')
if value is None:raise ValueError('No current dataValue; defaults are not substituted for actual state')
outer,metadata=native_carrier(value);scene,raw,wrapper=root_object(outer)
result=dict(context,parameterID=55,carrier=metadata,outerArchiveSHA256=hashlib.sha256(outer).hexdigest(),**wrapper)
if scene is None:return dict(result,status='nil',masks=[],keyCount=0)
if not isinstance(scene,dict) or scene.get('$class')!='FTTrackerScene':
raise ValueError('Parameter 55 did not decode to FTTrackerScene; got '+repr(scene.get('$class') if isinstance(scene,dict) else type(scene).__name__))
masks=geometry(scene);count=sum(len(m[p]['keys']) for m in masks for p in ('position','rotation','scale'))
result.update(status='scene',sceneID=identifier(scene.get('identifier')),aspectRatio=scene.get('aspectRatio'),
archiveSHA256=hashlib.sha256(raw).hexdigest(),masks=masks,keyCount=count)
if extract_dir:
extract_dir.mkdir(parents=True,exist_ok=True);dest=extract_dir/('cf-scene-'+str(index)+'.bplist')
if dest.exists() and dest.read_bytes()!=raw:raise ValueError('Refusing to replace a different extracted archive: '+str(dest))
if not dest.exists():dest.write_bytes(raw)
result['archivePath']=str(dest.resolve())
return result
def is_cf(effect):
text=' '.join(str(x) for x in effect.values())
text=urllib.parse.unquote(text).casefold();return 'colorfinale' in text or 'color finale' in text
def inspect(path,extract_dir=None):
if path.is_dir():path=path/'Info.fcpxml'
if path.stat().st_size>MAX_BYTES:raise ValueError('Input XML exceeds limit')
data=path.read_bytes();root=ET.fromstring(data)
output={'input':str(path.resolve()),'inputSHA256':hashlib.sha256(data).hexdigest(),
'sourceKind':root.tag,'scope':'Data-only extraction. Template defaults do not establish actual tracked host state.',
'candidates':[]}
if root.tag=='ozml':
# Installed templates store the parameter directly below their filter.
for f in root.iter('filter'):
for p in f.findall('parameter'):
if p.get('id')=='55':output['candidates'].append(carrier_report(p,{'templateFilter':f.attrib},extract_dir,len(output['candidates'])))
elif root.tag=='fcpxml':
effects={e.get('id'):e.attrib for e in root.findall('./resources/effect')}
parents={child:parent for parent in root.iter() for child in parent}
for f in root.iter('filter-video'):
effect=effects.get(f.get('ref'),{})
if not is_cf(effect):continue
context={};ancestor=parents.get(f)
while ancestor is not None:
if ancestor.tag in ('event','project'):context[ancestor.tag]=ancestor.attrib
elif ancestor.tag in ('asset-clip','clip','video') and 'clip' not in context:
context['clip']={'tag':ancestor.tag,**ancestor.attrib}
ancestor=parents.get(ancestor)
for p in f.findall('param'):
if p.get('key','').split('/')[-1]!='55':continue
text=p.get('value','');normal=''.join(text.split())
decoded=base64.b64decode(normal+'='*((-len(normal))%4),validate=True)
inner=ET.fromstring(decoded)
candidates=[x for x in inner.iter('parameter') if x.get('id')=='55']
if len(candidates)!=1:raise ValueError('Expected one ID55 parameter in FCP custom XML carrier')
output['candidates'].append(carrier_report(candidates[0],{
**context,'filter':f.attrib,'effect':effect,'fcpxmlParameter':p.attrib|{'value':'<opaque-value-omitted>'}},
extract_dir,len(output['candidates'])))
else:raise ValueError('Unsupported XML root; expected FCPXML or Motion ozml')
output['candidateCount']=len(output['candidates']);output['maskCount']=sum(len(x['masks']) for x in output['candidates'])
output['keyCount']=sum(x['keyCount'] for x in output['candidates'])
output['status']='extracted' if any(x['status']=='scene' for x in output['candidates']) else ('nil' if output['candidates'] else 'not-found')
return output
def main():
p=argparse.ArgumentParser(description=__doc__);p.add_argument('input',type=Path);p.add_argument('--output',type=Path);p.add_argument('--extract-dir',type=Path);a=p.parse_args()
result=inspect(a.input,a.extract_dir);text=json.dumps(result,ensure_ascii=False,indent=2,allow_nan=False)+'\n'
if a.output:a.output.write_text(text)
else:sys.stdout.write(text)
if __name__=='__main__':
try:main()
except (ValueError,TypeError,KeyError,IndexError,plistlib.InvalidFileException,ET.ParseError,OSError) as error:
print('Cannot extract verified CF XML scene: '+str(error),file=sys.stderr);sys.exit(1)
+171
查看文件
@@ -0,0 +1,171 @@
#!/usr/bin/env python3
"""Read a user-exported CF plist/NSKeyedArchive as data; never instantiate classes."""
from pathlib import Path
from fractions import Fraction
import argparse, base64, hashlib, json, math, plistlib, struct, sys, uuid, zlib
MAX_BYTES=128*1024*1024
MAX_ARCHIVE=64*1024*1024
def inflate(data):
if data.startswith((b'bplist',b'<?xml')):return data
for window in (15,-15,31):
try:
d=zlib.decompressobj(window);out=d.decompress(data,MAX_ARCHIVE+1)
if len(out)>MAX_ARCHIVE or d.unconsumed_tail:raise ValueError('Decoded archive exceeds size limit')
out+=d.flush()
if len(out)>MAX_ARCHIVE:raise ValueError('Decoded archive exceeds size limit')
if d.eof and out.startswith((b'bplist',b'<?xml')):return out
except zlib.error:pass
raise ValueError('masks is neither a plist nor a supported zlib-compressed plist')
def decode_archive(data):
root=plistlib.loads(data)
if not isinstance(root,dict) or root.get('$archiver')!='NSKeyedArchiver':
raise ValueError('Expected an NSKeyedArchiver data container')
objects=root.get('$objects',[])
if not isinstance(objects,list) or len(objects)>200000:raise ValueError('Invalid object table')
expansions=0
def resolve(x,seen=frozenset(),depth=0):
nonlocal expansions
expansions+=1
if expansions>1000000:raise ValueError('Archive reference expansion exceeds limit')
if depth>100:raise ValueError('Archive nesting exceeds limit')
if isinstance(x,plistlib.UID):
i=x.data
if i==0:return None
if i<0 or i>=len(objects):raise ValueError('Archive UID out of range')
if i in seen:return {'$cycleUID':i}
return resolve(objects[i],seen|{i},depth+1)
if isinstance(x,list):return [resolve(y,seen,depth+1) for y in x]
if not isinstance(x,dict):return x
cls=x.get('$class');name=None
if isinstance(cls,plistlib.UID) and cls.data<len(objects):
descriptor=objects[cls.data]
if isinstance(descriptor,dict):name=descriptor.get('$classname')
values={k:resolve(v,seen,depth+1) for k,v in x.items() if k!='$class'}
if 'NS.keys' in values and 'NS.objects' in values:
return {str(k):v for k,v in zip(values['NS.keys'],values['NS.objects'])}
if name in ('NSArray','NSMutableArray','NSSet','NSMutableSet'):
return values.get('NS.objects',[])
if name in ('NSData','NSMutableData'):return values.get('NS.data',b'')
if name in ('NSString','NSMutableString'):return values.get('NS.string','')
if name:values['$class']=name
return values
top=root.get('$top',{});entry=top.get('root',next(iter(top.values()),None))
return resolve(entry)
def vector(value):
if isinstance(value,(int,float)):return [value]
if isinstance(value,(list,tuple)) and all(isinstance(v,(int,float)) for v in value):return list(value)
if isinstance(value,dict) and 'CICount' in value:
n=int(value['CICount'])
if 0<=n<=4:return [value.get('CI_'+str(i),0) for i in range(n)]
return None
def identifier(value):
if isinstance(value,dict) and isinstance(value.get('NS.uuidbytes'),bytes):
raw=value['NS.uuidbytes']
if len(raw)==16:return str(uuid.UUID(bytes=raw))
return str(value or '')
def keyframe(key):
if not isinstance(key,dict):raise ValueError('Unexpected keyframe representation')
data=key.get('data')
if isinstance(data,bytes):
if len(data)!=72 or struct.unpack_from('<I',data)[0]!=1:
raise ValueError('Unsupported FTKeyFrame binary version/size')
kind=struct.unpack_from('<Q',data,8)[0]
value,scale=struct.unpack_from('<qi',data,16)
epoch,count=struct.unpack_from('<qQ',data,32)
if scale<=0 or count>3:raise ValueError('Invalid keyframe time/vector count')
numbers=list(struct.unpack_from('<3d',data,48)[:count])
if any(not math.isfinite(x) for x in numbers):raise ValueError('Nonfinite keyframe value')
return {'time':{'value':value,'timescale':scale,'epoch':epoch,'seconds':value/scale},
'type':kind,'value':numbers}
time=key.get('time')
if isinstance(time,dict):
value=time.get('value',time.get('timeValue'));scale=time.get('timescale',time.get('timeScale'))
if value is not None and scale:
return {'time':{'value':int(value),'timescale':int(scale),'epoch':int(time.get('epoch',0)),
'seconds':int(value)/int(scale)},'type':key.get('type'),'value':vector(key.get('value'))}
raise ValueError('Legacy FTKeyFrame time encoding needs a verified fixture; preserved source required')
def parameter(value):
if not isinstance(value,dict):return {'staticValue':vector(value),'keys':[]}
keys=[keyframe(x) for x in value.get('keyFrames',[])]
keys.sort(key=lambda x:(x['time']['epoch'],Fraction(x['time']['value'],x['time']['timescale'])))
return {'type':value.get('type'),'staticValue':vector(value.get('value')),'keys':keys}
def geometry(scene):
result=[]
def walk(x):
if isinstance(x,list):
for v in x:walk(v)
elif isinstance(x,dict):
if all(k in x for k in ('position','rotation','scale')):
result.append({'id':identifier(x.get('identifier')),'name':x.get('name'),
'class':x.get('$class'),'enabled':x.get('enabled'),'inverted':x.get('inverted'),
'position':parameter(x['position']),'rotation':parameter(x['rotation']),'scale':parameter(x['scale'])})
for v in x.values():walk(v)
walk(scene);return result
def read_preset(path):
if path.stat().st_size>MAX_BYTES:raise ValueError('Input file exceeds size limit')
data=path.read_bytes()
outer=plistlib.loads(data if data.startswith((b'bplist',b'<?xml')) else inflate(data))
output={'input':str(path.resolve()),'inputSHA256':hashlib.sha256(data).hexdigest(),
'reader':'plistlib+zlib+struct; no Objective-C class loading',
'coordinateNote':'Raw authored position and radians; origin is not implicitly flipped or inferred.',
'versions':[]}
if isinstance(outer,dict) and outer.get('$archiver')=='NSKeyedArchiver':
items=[{'masks':data}]
elif isinstance(outer,dict):items=outer.get('versions',[outer])
else:raise ValueError('Expected an exported preset dictionary')
for index,item in enumerate(items):
if not isinstance(item,dict) or not item.get('masks'):continue
encoded=item['masks']
if isinstance(encoded,str):encoded=base64.b64decode(encoded,validate=True)
if not isinstance(encoded,bytes):raise ValueError('Expected masks data bytes')
archive=inflate(encoded);digest=hashlib.sha256(archive).digest();expected=item.get('masks_hash')
if isinstance(expected,str) and base64.b64encode(digest).decode()!=expected:
raise ValueError('masks_hash does not match the decompressed archive')
scene=decode_archive(archive)
if not isinstance(scene,dict):raise ValueError('Expected a tracker-scene dictionary')
output['versions'].append({'index':index,'name':item.get('name'),'active':item.get('active'),
'archiveSHA256':digest.hex(),'sceneID':identifier(scene.get('identifier')),
'aspectRatio':scene.get('aspectRatio'),'masks':geometry(scene)})
if not output['versions']:raise ValueError('No masks archive found; .cflook exports may omit trackerScene')
output['maskCount']=sum(len(x['masks']) for x in output['versions'])
output['keyCount']=sum(len(m[p]['keys']) for x in output['versions'] for m in x['masks'] for p in ('position','rotation','scale'))
return output
def self_test():
payload=bytearray(72);struct.pack_into('<I',payload,0,1);struct.pack_into('<Q',payload,8,2)
struct.pack_into('<qi',payload,16,1001,30000);struct.pack_into('<qQ',payload,32,0,2)
struct.pack_into('<3d',payload,48,.25,.75,0)
k=keyframe({'data':bytes(payload)})
assert k['time']['value']==1001 and k['time']['timescale']==30000 and k['value']==[.25,.75]
assert vector({'CICount':2,'CI_0':.25,'CI_1':.75})==[.25,.75]
data=plistlib.dumps({'$archiver':'NSKeyedArchiver','$version':100000,'$objects':['$null',
{'identifier':'fixture','nodes':plistlib.UID(2)}, {'NS.objects':[plistlib.UID(3)],'$class':plistlib.UID(4)},
{'position':{'value':{'CICount':2,'CI_0':.25,'CI_1':.75},'keyFrames':[{'data':bytes(payload)}]},
'rotation':{'value':0,'keyFrames':[]},'scale':{'value':[1,1],'keyFrames':[]}},
{'$classname':'NSArray','$classes':['NSArray','NSObject']}], '$top':{'root':plistlib.UID(1)}},fmt=plistlib.FMT_BINARY)
masks=geometry(decode_archive(inflate(zlib.compress(data))))
assert len(masks)==1 and masks[0]['position']['keys'][0]['value']==[.25,.75]
print(json.dumps({'pass':True,'checks':['72-byte-exact-rational-time','system-CIVector-field-layout',
'zlib-keyed-plist-UID-array-geometry'],'scope':'Generated data only; no original exported preset used.'}))
def main():
p=argparse.ArgumentParser(description=__doc__);p.add_argument('input',type=Path,nargs='?');p.add_argument('--output',type=Path);p.add_argument('--self-test',action='store_true');args=p.parse_args()
if args.self_test:self_test();return
if not args.input:p.error('a user-exported .plist or raw masks archive is required')
result=read_preset(args.input);text=json.dumps(result,ensure_ascii=False,indent=2,allow_nan=False)+'\n'
if args.output:args.output.write_text(text)
else:sys.stdout.write(text)
if __name__=='__main__':
try:main()
except (ValueError,TypeError,KeyError,IndexError,plistlib.InvalidFileException,OSError) as error:
print('Cannot extract verified tracks: '+str(error),file=sys.stderr);sys.exit(1)
+79
查看文件
@@ -0,0 +1,79 @@
#include "../../大鱼调色/Plugin/MaskCore/DYOpenCVTracker.hpp"
#include <iostream>
#include <string>
#include <chrono>
// Known analytic motion is the oracle. No target app or runtime is used.
static float noise(int x,int y,uint32_t seed=0) {
uint32_t n=uint32_t(x)*73856093u^uint32_t(y)*19349663u^seed;
n^=n>>13;n*=1274126177u;n^=n>>16;return .1f+.8f*float(n&65535)/65535.f;
}
static float texture(float x,float y,uint32_t seed=0) {
float gx=x/3.f,gy=y/3.f;int ix=int(std::floor(gx)),iy=int(std::floor(gy));
float dx=gx-ix,dy=gy-iy;
return (1-dy)*((1-dx)*noise(ix,iy,seed)+dx*noise(ix+1,iy,seed))+
dy*((1-dx)*noise(ix,iy+1,seed)+dx*noise(ix+1,iy+1,seed));
}
static dy::GrayFrame frame(int w,int h,double tx=0,double ty=0,double angle=0,double sx=1,double sy=1,uint32_t seed=0) {
dy::GrayFrame f{w,h,std::vector<float>(size_t(w)*h)};
double cx=w*.5,cy=h*.5,c=std::cos(angle),s=std::sin(angle);
for(int y=0;y<h;y++)for(int x=0;x<w;x++){
double dx=x-cx-tx,dy=y-cy-ty;
f.pixels[y*w+x]=texture(float((c*dx+s*dy)/sx+cx),float((-s*dx+c*dy)/sy+cy),seed);
}return f;
}
int main() {
int failed=0,count=0;std::cout<<"{\"version\":\""<<dy::OpenCVTracker::version()<<"\",\"checks\":[";
auto check=[&](const char*name,bool ok,double error=0){if(count++)std::cout<<",";failed+=!ok;
std::cout<<"{\"name\":\""<<name<<"\",\"pass\":"<<(ok?"true":"false")<<",\"error\":"<<error<<"}";};
check("pinned-public-opencv-version",std::string(dy::OpenCVTracker::version())=="4.5.1");
{
dy::OpenCVTracker t;auto f=frame(640,480);bool started=t.reset(f,{.5,.5,.85,.85,0});
check("300-feature-capacity",started&&t.result().features==300,t.result().features);
auto r=t.track(frame(640,480,2.25,-1.5,.025,1.025,.98));
double error=std::hypot((r.cx-.5)*640-2.25,(r.cy-.5)*480+1.5);
check("translation-rotation-independent-xy-scale",started&&r.valid&&error<.5&&std::abs(r.rotation-.025)<.004&&
std::abs(r.scaleX-1.025)<.005&&std::abs(r.scaleY-.98)<.005,error);
}
{
dy::OpenCVTracker t;auto f=frame(512,384);t.setMask({{.8f,-.5f},{1.8f,-.5f},{1.8f,.5f},{.8f,.5f}});
bool ok=t.reset(f,{.35,.5,.2,.45,0});dy::TrackResult r=t.result();
for(int i=1;i<=12&&ok;++i){r=t.track(frame(512,384,1.25*i,.5*i));ok=r.valid;}
double error=std::hypot((r.cx-.35)*512-15,(r.cy-.5)*384-6);
check("free-path-outside-creation-box-12-frame-subpixel",ok&&error<.7,error);
}
{
dy::OpenCVTracker t;auto f=frame(640,480);bool ok=t.reset(f,{.5,.5,.65,.65,0});
for(int i=0;i<8&&ok;++i)ok=t.track(f).valid;
auto r=t.result();double error=std::hypot((r.cx-.5)*640,(r.cy-.5)*480);
check("periodic-redetection-keeps-static-position",ok&&error<.05,error);
r=t.track(frame(640,480,0,0,0,1,1,0x3344));
check("unrelated-cut-stops-with-last-trusted-position",!r.valid&&!t.active()&&std::abs(r.cx-.5)*640<.05);
dy::GrayFrame flat{640,480,std::vector<float>(640*480,.5f)};
check("flat-mask-rejected",!t.reset(flat,{.5,.5,.7,.7,0}));
}
{
dy::OpenCVTracker t;auto f=frame(640,480);bool ok=t.reset(f,{.5,.5,.9,.9,0});
auto moving=f;
for(int y=0;y<480;++y)for(int x=0;x<640;++x)
moving.pixels[y*640+x]=texture(float(x-(x<460?8:0)),float(y));
auto r=t.track(moving);double error=std::abs((r.cx-.5)*640-8);
check("moving-majority-prefers-subject-over-static-background",ok&&r.valid&&error<.5&&r.matches<r.features*.85,error);
}
{
dy::OpenCVTracker a,b;auto f=frame(640,480);bool ok=a.reset(f,{.3,.4,.3,.3,0})&&b.reset(f,{.7,.6,.3,.3,0});
auto x=a.track(frame(640,480,5,2));auto y=b.track(frame(640,480,-3,-4));
check("independent-tracker-objects-do-not-share-motion",ok&&x.valid&&y.valid&&std::abs((x.cx-.3)*640-5)<.5&&std::abs((y.cx-.7)*640+3)<.5);
auto old=a.result();x=a.track({});check("invalid-frame-preserves-authored-geometry",!x.valid&&x.cx==old.cx&&x.cy==old.cy&&x.rotation==old.rotation);
f.pixels[10]=std::numeric_limits<float>::quiet_NaN();
check("nonfinite-source-rejected",!a.reset(f,{.5,.5,.4,.4,0}));
}
{
auto begin=std::chrono::steady_clock::now();dy::OpenCVTracker t;bool ok=t.reset(frame(3840,2160),{.5,.5,.5,.5,0});
auto r=t.track(frame(3840,2160,8,4));double error=std::hypot((r.cx-.5)*3840-8,(r.cy-.5)*2160-4);
check("4k-complete-source-frame",ok&&r.valid&&error<.5,error);
auto ms=std::chrono::duration<double,std::milli>(std::chrono::steady_clock::now()-begin).count();
std::cerr<<"4K generated images plus tracking: "<<ms<<"ms\n";
}
std::cout<<"],\"pass\":"<<(failed?"false":"true")<<",\"count\":"<<count<<",\"runtimeTargetAppUsed\":false}\n";return failed?1:0;
}
+4 -1
查看文件
@@ -9,7 +9,10 @@ int main(int argc,char **argv){@autoreleasepool{
updater.changed=^(NSDictionary *state){NSString *phase=state[@"phase"];[phases addObject:phase];
if([phase isEqual:@"available"]){if(started){done=YES;fprintf(stderr,"%s\n",[state description].UTF8String);}else{started=YES;dispatch_async(dispatch_get_main_queue(),^{[updater download];});}}
if([phase isEqual:@"ready"]){done=YES;passed=YES;}
if([phase isEqual:@"failed"]||[phase isEqual:@"latest"]){done=YES;fprintf(stderr,"%s\n",[state description].UTF8String);}
if([@[@"failed",@"latest",@"integrity_rejected"] containsObject:phase]){
done=YES;fprintf(stderr,"%s\n",[state description].UTF8String);
if([phase isEqual:@"integrity_rejected"])fprintf(stderr,"Run the live update check in the officially installed app.\n");
}
};
[updater check];NSDate *deadline=[NSDate dateWithTimeIntervalSinceNow:360];
while(!done&&deadline.timeIntervalSinceNow>0)[NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:.1]];
+78
查看文件
@@ -0,0 +1,78 @@
{
"passResult": true,
"articleID": 15792,
"url": "https://dayu.media/15792/",
"status": "publish",
"title": "大鱼调色 1.12.0 公测版|统一调色工作区与共享蒙版",
"requestID": "dayu-color-1120-build79-article-20261105",
"changedResourceFields": [
"cao_downurl",
"cao_original_filename"
],
"commercialAndVideoFieldsPreserved": true,
"authorCategoriesTagsPreserved": true,
"fcpxSettingsPreserved": true,
"seo": {
"title": {
"enabled": true,
"value": "大鱼调色 1.12.0 公测版|统一调色工作区与共享蒙版"
},
"description": {
"enabled": true,
"value": "大鱼调色 1.12.0 是适用于 Final Cut Pro 与 Motion 的原生调色插件。新版控制面板集中管理图层、共享蒙版、最近使用 LUT 和四宫格示波器,画布工具移至左下角。适用于 Apple Silicon 和 macOS 14.6 及以上,完整安装包已签名公证。"
},
"keywords": {
"enabled": true,
"value": "大鱼调色,Final Cut Pro,调色插件,FxPlug4,统一工作区,共享蒙版,LUT,示波器"
}
},
"frontendChecks": [
{
"url": "https://dayu.media/15792/",
"titleAndSEOExact": true,
"updateNotesPresent": true,
"historicalScreenshotsInOrder": true,
"priceYuan": 50,
"memberPriceYuan": 0,
"featuredCoverVerified": true,
"paidPackageURLAbsentFromHTML": true
},
{
"url": "https://dayu.media/15792/?release-check=1.12.0-79",
"titleAndSEOExact": true,
"updateNotesPresent": true,
"historicalScreenshotsInOrder": true,
"priceYuan": 50,
"memberPriceYuan": 0,
"featuredCoverVerified": true,
"paidPackageURLAbsentFromHTML": true
}
],
"featuredMedia": {
"id": 15854,
"url": "https://dayu.media/wp-content/uploads/2026/11/1793865756-f106faae77b9559.png",
"source": "template/large.png",
"http": 200,
"bytes": 261628,
"sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a"
},
"historicalBodyImages": [
{
"id": 15840,
"url": "https://dayu.media/wp-content/uploads/2026/11/1793804584-5bc2fbe021e0e8f.png"
},
{
"id": 15841,
"url": "https://dayu.media/wp-content/uploads/2026/11/1793804588-7ea8d6f6f860d66.png"
}
],
"package": {
"version": "1.12.0",
"build": 79,
"downloadVerified": true,
"http": 200,
"bytes": 45329742,
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe"
},
"rawPrivateResponses": "Local build cache only"
}
+78
查看文件
@@ -0,0 +1,78 @@
{
"version": "1.12.0",
"build": 79,
"date": "2026-11-05T16:01:49.958647+08:00",
"localProject": "/Users/mac/Downloads/dayumedia/dayu-color-beta",
"nasRoot": "/Volumes/dayumedia (存储空间1)/wwwroot/dayu_media",
"paths": [
"wp-content/uploads/dayu-color-beta/updates/dayu-color-1-12-0-79.pkg",
"wp-content/uploads/dayu-color-beta/updates/beta.json"
],
"package": {
"path": "/Volumes/dayumedia (存储空间1)/wwwroot/dayu_media/wp-content/uploads/dayu-color-beta/updates/dayu-color-1-12-0-79.pkg",
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe",
"backup": null,
"size": 45329742
},
"manifest": {
"path": "/Volumes/dayumedia (存储空间1)/wwwroot/dayu_media/wp-content/uploads/dayu-color-beta/updates/beta.json",
"sha256": "82b65c0f73cb03eec6be645d7a8be548eed050170e7883375c2f46db9673f323",
"backup": "/Volumes/dayumedia (存储空间1)/wwwroot/dayu_media/wp-content/uploads/dayu-color-beta/updates/beta-202611051601.jsonbak",
"size": 656
},
"baseline_sha256": "30c92debf91de7ab8215b35dc64a4ddb764e53450c327ae53fb41a4c2f7a26c0",
"production_manifest_mode": "0o700",
"pre_activation_download": {
"http": 200,
"bytes": 45329742,
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe",
"url": "https://dayu.media/wp-content/uploads/dayu-color-beta/updates/dayu-color-1-12-0-79.pkg"
},
"previousVersion": "1.7.0",
"previousBuild": 45,
"previousPackageRetainedAndVerified": true,
"manifestMatchesRepositoryAndLocalMirror": true,
"backupByteIdenticalToBaseline": true,
"backendCodeUnchanged": true,
"liveAPI": [
{
"currentBuild": 45,
"offered": true,
"feedBuild": 79
},
{
"currentBuild": 73,
"offered": true,
"feedBuild": 79
},
{
"currentBuild": 78,
"offered": true,
"feedBuild": 79
},
{
"currentBuild": 79,
"offered": false,
"feedBuild": 79
},
{
"currentBuild": 80,
"offered": false,
"feedBuild": 79
}
],
"nativeUpdater": {
"passed": true,
"source": "production HTTPS beta endpoint and download",
"phases": [
"checking",
"available",
"downloading",
"validating",
"ready"
],
"installation_performed": false
},
"installedAppBuild": 79,
"temporaryVerificationCopiesCleaned": true
}
+10 -9
查看文件
@@ -1,11 +1,12 @@
{
"status": "draft-download-required",
"releaseID": 387,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.10.0-canvas-workspace-20261104",
"tag": "v1.10.0-canvas-workspace-20261104",
"commit": "c0e6f3be0afc310125d2d045a96655db7524f24b",
"assetID": 31,
"downloadURL": "https://dayu.media/git/attachments/cb9b5516-0953-4993-99a1-360c1d92cb6d",
"bytes": 43090565,
"sha256": "ee70461c9b2d2e0ddd78cbcb3371c3b1b36b7f0e5fc69bfccc7ac0f1a3e468d8"
"status": "published-after-verified-draft-download",
"releaseID": 392,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.13.1-pixel-clone-20261105",
"tag": "v1.13.1-pixel-clone-20261105",
"commit": "46153a26edfbf44c5f22fbad5953ec74c0d33883",
"assetID": 36,
"downloadURL": "https://dayu.media/git/attachments/ee0a09fc-58b0-4883-9923-d5eb8aced007",
"bytes": 45352349,
"sha256": "8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965",
"finalDownloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.13.1-pixel-clone-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.13.1.pkg"
}
+30
查看文件
@@ -0,0 +1,30 @@
{
"pass": true,
"version": "1.11.0",
"build": "73",
"requirements": {
"translucentCurveWithHistogram": "passed-native-and-user-mouse",
"translucentHSL": "passed-native-and-user-mouse",
"translucentSpider": "passed-native-and-user-mouse",
"fourCollapsedDefaultModulesAndAddRoutes": "passed-native-and-observed-host",
"faceLimitedSkinProtectionAndRegionPreview": "passed-real-face-native-and-user-mouse",
"lensDistortionRepair": "passed-GPU-CPU-oracle-and-user-mouse",
"singleGestureUndoAndLayerIsolation": "passed-native-and-user-mouse",
"releaseSigningNotarizationStaplingAndUniqueInstallation": "passed",
"signedNotarizedPackage20Checks": "passed",
"releaseDraftAndPublishedFullDownload": "passed",
"remoteSourceTagAndIndependentRecovery": "passed",
"taskGeneratedCopyCleanup": "passed"
},
"hostVerification": "verification/HostCanvasTools1.11.0.json",
"nativeVerification": "verification/InstalledSelfTest.json",
"packageVerification": "verification/Package.json",
"releaseVerification": "verification/Release.json",
"sourceRecovery": "verification/CanvasFinalRecovery1.11.0.json",
"cleanup": "verification/CanvasCleanup1.11.0.json",
"limitations": [
"Independent inverse-radial lens implementation; no target GPU pixel-equivalence claim.",
"Face selection and geometric transforms are spatial; use complete presets instead of static Cube for these settings."
],
"completedAt": "2026-11-04T18:23:39.628248+00:00"
}
+28
查看文件
@@ -0,0 +1,28 @@
{
"pass": true,
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.11.0",
"build": "73",
"scannedRoots": [
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Volumes/备份/大鱼调色",
"/Users/mac/Downloads",
"/Users/mac/Desktop",
"/Applications",
"/Library/Plug-Ins/FxPlug",
"/Users/mac/Library/Plug-Ins/FxPlug"
],
"matchingOuterApps": [
"/Library/Plug-Ins/FxPlug/大鱼调色.app"
],
"scope": "Bounded scan by actual outer Bundle ID com.dayu.color; no claim to all volumes. Historical user installer archives retained.",
"oldRecoveryAppRemoved": true,
"removedTaskArtifacts": [
"/Volumes/备份/大鱼调色-1.11.0.pkg",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/canvas-remote-recovery",
"/tmp/dayucanvas.fcpxml",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-candidate"
],
"releaseDownloadProofRetainedIn": "verification/Release.json",
"checkedAt": "2026-11-04T18:23:12.115751+00:00"
}
@@ -0,0 +1,15 @@
{
"pass": true,
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"tag": "v1.11.0-canvas-spatial-20261105",
"releaseCommit": "5f8fb13fceb0c4d4ead447b8b5694ce269e95749",
"compiledSourceCommit": "49d35cb49ab93f5ab6ca3411eaea80f7219be346",
"trackedFilesCompared": 555,
"mismatches": [],
"compiledProgramAndTemplateIdentical": true,
"fullStrictFsck": "passed",
"lfs": false,
"submodules": false,
"restore": "Independent remote clone fetched release tag and detached checkout; every tracked file compared to the release tag; compiled program and template paths unchanged.",
"verifiedAt": "2026-11-04T18:21:55.231104+00:00"
}
@@ -0,0 +1,19 @@
{
"tag": "v1.12.1-canvas-inspector-20261105",
"commit": "9f0adbeb3b1b902b66ac4be7169b919f82675f21",
"trackedFileCount": 607,
"gitFsck": true,
"compiledSource": "43320c7ccdfc6738ba3c380888bb7f3ea75ebb87",
"verifiedRecordsAndSources": true,
"temporaryCloneCleaned": true,
"compiledInputsIdenticalInTag": true,
"releaseID": 390,
"assetID": 34,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.12.1-canvas-inspector-20261105",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.12.1-canvas-inspector-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.12.1.pkg",
"bytes": 45337206,
"sha256": "ae65ac0dcaf7cead701b8ac543ee60ae62e55fd9e19646877d5ef9d9d7351b6f",
"verifiedDownloadCopyRemoved": true,
"generatedAppBackupsCleaned": true,
"formalPluginKitPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app"
}
+2 -1
查看文件
@@ -54,5 +54,6 @@
"hostAcceptance": "passed-user-actual-mouse",
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"installScope": "Package expanded and verified; installation scripts were not run.",
"releaseStatus": "ready-for-release"
"releaseStatus": "published-download-verified",
"releaseVerification": "verification/Release.json"
}
@@ -0,0 +1,17 @@
{
"status": "verified",
"repository": "https://dayu.media/git/dayu/dayu-color.git",
"compiledSource": "1659f3d3853e2574f06a45687141fb444b5d02ca",
"trackedFiles": 613,
"fsck": "full strict",
"content": "All tracked files matched by SHA-256",
"lfs": false,
"submodules": false,
"independentBuild": false,
"versionTag": {
"tag": "v1.13.1-pixel-clone-20261105",
"commit": "46153a26edfbf44c5f22fbad5953ec74c0d33883",
"trackedFiles": 616,
"content": "All tracked files and verified PKG record match."
}
}
@@ -0,0 +1,17 @@
{
"status": "verified",
"repository": "https://dayu.media/git/dayu/dayu-color.git",
"compiledSource": "9977b5c41b07e0b08e6408c492498ba6e396c981",
"trackedFiles": 610,
"fsck": "full strict",
"content": "all tracked files match the compiled commit by SHA-256",
"lfs": false,
"submodules": false,
"independentBuild": false,
"versionTag": {
"tag": "v1.13.0-clone-stamp-20261105",
"commit": "07601e50bf604e7721bccf8be10e403a2bd030d1",
"trackedFiles": 613,
"content": "All tracked files and verified PKG record match."
}
}
@@ -0,0 +1,40 @@
{
"date": "2026-11-04T20:25:28.994812+00:00",
"passResult": true,
"readers": [
{
"tool": "read_colorfinale_preset.py",
"pass": true,
"checks": [
"72-byte-exact-rational-time",
"system-CIVector-field-layout",
"zlib-keyed-plist-UID-array-geometry"
],
"scope": "Generated data only; no original exported preset used."
},
{
"tool": "read_colorfinale_collection.py",
"pass": true,
"checks": [
"nine-fixed-variable-prefix-values",
"native-1-2-5-inline-mask-generated-fixture",
"reject-truncation-trailing-version-and-external-reference"
],
"scope": "Generated data only; no original exported fixture used."
}
],
"originalFixtureUsed": false,
"nativeExportEnvelopeVerified": false,
"scope": "Static binary format evidence and generated parser fixtures only; no original same-video trajectory comparison.",
"pluginSHA256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f",
"utilsSHA256": "424d75515f5c40ffbc37591b04b1bcfc7dda018fb32ea1c431ce87219c481c0d",
"databaseObservedCounts": {
"ft_objects": 0,
"ft_objectversions": 0
},
"blocker": "Mac remains locked; native host verification and generation of original QA tracks require manual unlock.",
"readerFilesSHA256": {
"read_colorfinale_preset.py": "41c6d0b4b75fc018bb48fe47856e153f2957d030f30edf7769ac304c243a0559",
"read_colorfinale_collection.py": "b8529ba75371b5f4ff9381d5f6045591ac3d2cb71051bb286d21776cdb1ab1d3"
}
}
@@ -0,0 +1,10 @@
{
"pass_": true,
"sourceCommit": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"trackedFiles": 596,
"byteMismatches": [],
"fsck": "strict passed",
"scope": "Independent remote checkout verified exact compiled source and tracked fixtures; no full cold rebuild claimed.",
"temporaryClone": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/workspace-recovery-1.12.0-nv52vsyz"
}
+7 -2
查看文件
@@ -2,10 +2,15 @@
#include <cassert>
#include <limits>
int main(){
using namespace dyscope;RGBA pixels[]={{1,0,0,1},{0,1,0,1},{0,0,1,1},{1.3f,-.2f,.5f,.5f},{2,2,2,0},{NAN,0,0,1}};
using namespace dyscope;assert(SkinToneCb<0&&SkinToneCr>0);assert(std::abs(std::hypot(SkinToneCb,SkinToneCr)-1)<1e-12);assert(std::abs(std::atan2(SkinToneCr,SkinToneCb)-SkinToneAngle)<1e-12);RGBA pixels[]={{1,0,0,1},{0,1,0,1},{0,0,1,1},{1.3f,-.2f,.5f,.5f},{2,2,2,0},{NAN,0,0,1}};
auto r=measure(pixels,3,2);assert(r.valid==4&&r.transparent==1&&r.nonfinite==1);assert(r.above==1&&r.below==1);assert(r.minimum==-.2f&&r.maximum==1.3f);
assert(r.histogram[bin(.2126f)]==1);assert(r.histogram[bin(.7152f)]==1);assert(r.histogram[bin(.0722f)]==1);assert(r.wave[(Bins-1-bin(.2126f))*Width]==1);
assert(bin(-100)==0&&bin(100)==Bins-1);assert(bin(std::numeric_limits<float>::max())==Bins-1&&bin(-std::numeric_limits<float>::max())==0);auto im=densityImage(r.wave,false);assert(im.size()==size_t(Width)*Bins*4);assert(im[((Bins-1-bin(.2126f))*Width)*4]>0);
auto rgb=densityImage(r.parade,true);assert(rgb.size()==size_t(3)*Width*Bins*4);assert(rgb[(Bins-1-bin(1.f))*3*Width*4]>0);
assert(measure(pixels,0,0).valid==0);return 0;
assert(measure(pixels,0,0).valid==0);
RGBA colors[]={{.5f,.5f,.5f,1},{1,0,0,1},{1,0,1,1},{0,0,1,1},{0,1,1,1},{0,1,0,1},{1,1,0,1},{2,2,2,0},{INFINITY,0,0,1}};
auto v=measure(colors,9,1);uint64_t total=0;for(auto n:v.vectors)total+=n;assert(total==7&&v.transparent==1&&v.nonfinite==1);assert(v.vectors[(Bins-1-chromaBin(0))*Bins+chromaBin(0)]==1);
for(unsigned i=1;i<7;i++){auto p=colors[i];float y=.2126f*p.r+.7152f*p.g+.0722f*p.b;unsigned x=chromaBin((p.b-y)/1.8556f),row=Bins-1-chromaBin((p.r-y)/1.5748f);assert(v.vectors[row*Bins+x]==1);}
assert(chromaBin(INFINITY)==Bins-1&&chromaBin(-INFINITY)==0&&chromaBin(std::numeric_limits<float>::max())==Bins-1&&chromaBin(-std::numeric_limits<float>::max())==0);
auto vector=vectorImage(v.vectors);assert(vector.size()==Bins*Bins*4);assert(vectorImage({}).empty());for(size_t i=0;i<vector.size()/4;i++)assert(vector[4*i+3]==255);return 0;
}
+6 -7
查看文件
@@ -2,16 +2,15 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.11.0",
"build": "73",
"version": "1.13.2",
"build": "86",
"team": "B3W25FX5H5",
"notaryID": "348c6e9b-f5d9-4661-bc7f-f192fa770ecf",
"notaryID": "2ecd9145-1168-4880-9072-a8037fcc60d7",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "49d35cb49ab93f5ab6ca3411eaea80f7219be346",
"sourceCommit": "db6b2b05b3ee2ad40a6aeab70017a2b121caa67d",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"shaderSHA256": "462afbfdfc8d79aefd17d0928151f4c981d4145e2ad6bc3486a27aa73177b128",
"hostVerification": "verification/HostCanvasTools1.11.0.json",
"hostAcceptance": "User actual mouse: 三项均正常"
"shaderSHA256": "70340ce29720745e568ce1152ca4d73974062dfd12434bd4c308c7cf4ae3a694",
"hostVerification": "verification/HostIntegrity1.13.2.json"
}
@@ -0,0 +1,20 @@
{
"status": "passed",
"version": "1.12.1",
"build": "81",
"compiledSource": "43320c7ccdfc6738ba3c380888bb7f3ea75ebb87",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": "Final Cut Pro 12.4, isolated APFS QA library",
"hostPID": 21214,
"actualServicePID": 21237,
"nativeChecks": 844,
"observations": {
"build80UserFeedback": "User confirmed canvas curve interaction and real-time canvas histogram. Reported inspector histogram stalling and clipped top.",
"build81Inspector": "Cold reopened after normal quit. Full title, theme controls, preset actions and add-module control were visible at top with base and curve cards expanded. Only the parameter list occupied the internal scroll area.",
"build81Histogram": "Real inspector reported 57600 output samples after reopen. The same-time output change and the actual view refresh passed native tests with real Metal readback.",
"saveRoundTrip": "Existing edited test project reopened with the expanded groups, colour grade and visible temperature value 26. No library-save alert during the test.",
"whiteBalance": "Native canvas-button dispatch, time-change protection, solver result, host parameter writes and single undo group verified. System eyedropper selection was not independently confirmed in live host.",
"cleanup": "Both generated older app backups were cleaned after build 81 host verification. Historic release packages were retained."
},
"saveReport": "research/FinalCutSaveFailure-20261105.md"
}
+61
查看文件
@@ -0,0 +1,61 @@
{
"status": "passed",
"version": "1.13.1",
"build": "85",
"compiledSource": "1659f3d3853e2574f06a45687141fb444b5d02ca",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": "Final Cut Pro 12.4",
"hostPID": 29418,
"servicePID": 29424,
"qaProject": "1.12.0_76_OpenCV真实帧跟踪 2, independent QA copy",
"nativeChecks": 864,
"nativeCloneChecks": [
{
"keys": 2,
"name": "native-osc-drag-moves-only-the-stamp-source-and-keeps-tracking-keys",
"part": 7,
"pass": true,
"source": [
0.35,
0.35,
0.20000000298023224,
0.20000000298023224
],
"undoGroups": 1
},
{
"name": "native-osc-escape-cancels-the-stamp-source-drag-without-another-undo",
"pass": true
},
{
"name": "native-osc-stamp-resizes-coverage-without-rotation-handle-or-track-changes",
"pass": true
},
{
"name": "clone-stamp-ignores-legacy-tracking-scale-and-rotation",
"pass": true
},
{
"error": "未提供错误信息",
"name": "clone-stamp-resized-production-render",
"pass": true
},
{
"name": "clone-stamp-resize-extends-coverage-with-pixel-exact-translation",
"pass": true
}
],
"live": {
"inspectorVersion": "1.13.1",
"loadedAndRenderedBuild83Preset": true,
"trackingKeys": 99,
"roundTripIdentical": true,
"axes": "Source marker, center and four extent handles visible. No rotation handle or parameter row.",
"sourceDrag": "Live synthesized drag did not produce an OSC write. Source drag and undo verified by installed production callback tests.",
"helpText": "Workspace picture-edit button retains generic mask help text that mentions rotation."
},
"cleanup": {
"build83TemporaryBackupRemoved": true,
"historicPackagesRetained": true
}
}
+66
查看文件
@@ -0,0 +1,66 @@
{
"status": "passed",
"version": "1.13.0",
"build": "83",
"compiledSource": "9977b5c41b07e0b08e6408c492498ba6e396c981",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": "Final Cut Pro 12.4",
"hostPID": 26760,
"actualServicePID": 26777,
"nativeChecks": 858,
"qaProject": "1.12.0_76_OpenCV真实帧跟踪 1 (copy in the isolated APFS QA library)",
"live": {
"installedInspector": "1.13.0",
"stampGlyph": "Custom glyph visible in the lower-right rail",
"render": "Feathered sampled pixels visible in the target ellipse, with a separate source crosshair and three tracking actions",
"forwardTracker": "Started from the workspace, using FCP supplied frames",
"coldReopenedAndExported": true,
"trackKeys": 99,
"storedStatus": "正向跟踪完成 · 99 个轨迹键",
"sourcePatch": [
0.23,
0.28,
0.18,
0.21
],
"targetStart": [
0.5,
0.5,
0.18000000715255737,
0.20999999344348907,
0.0
],
"targetEnd": [
0.4583296775817871,
0.46296340227127075,
0.1800152063369751,
0.2099945992231369,
-5.047291051596403e-05
]
},
"limits": [
"GUI mouse automation did not enter live OSC mouse handlers. Actual OSC creation, single undo, and forward track-button dispatch passed the native FxPlug callback probe. The host rendering and tracking test imported a synthetic stamp preset and used the native workspace tracking control.",
"Original lag report did not include a reproduction sequence. No end-to-end latency measurement in the reporter’s project.",
"Motion, older macOS, and Intel were not verified."
],
"performance": {
"idle4KOverlay": [
1000,
134
],
"fullCanvas": [
3840,
2160
],
"sourcePixelFraction": 0.016155478395061727,
"syntheticTrackedMasks": 4,
"keysPerMask": 2400,
"copyIterations": 40,
"legacyMeanMs": 18.018,
"updatedMeanMs": 10.949
},
"cleanup": {
"build81TemporaryBackupRemoved": true,
"historicPackagesRetained": true
}
}
+159
查看文件
@@ -0,0 +1,159 @@
{
"version": "1.12.0",
"build": "78",
"compiledSource": "df6bf52f32283b18f595f371a76851705c42b35d",
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"actualServicePID": 9393,
"actualServicePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service",
"status": "focused-feedback-accepted",
"nativeChecks": 831,
"checks": [
{
"name": "HSL layout",
"result": "Observed palette above three full-width controls, with four scopes fixed right; numeric12 survives switching to spider and back, then reset0."
},
{
"name": "Spider layout",
"result": "Observed disc left, all options and mix right; no separate far-away mix column."
},
{
"name": "LUT grid",
"result": "Observed adaptive four columns and two visible rows with real portrait previews, vertical scroll only; selected actual UUID LUT layer."
},
{
"name": "Distortion placement",
"result": "Absent from workspace add toolbar/layer list; canvas control retained."
},
{
"name": "Skin tone line",
"result": "Observed warm dashed line and label in actual vectorscope."
},
{
"name": "Scope cold paused end",
"result": "Actual requested4.00 normalized precisely to cached3.96; all four plots57600 samples on cold FCP open."
},
{
"name": "Scope mid-playback",
"result": "Paused2:20 and reopened: requested2.8 matches cached2.8, four plots57600."
},
{
"name": "Canvas pen and curve",
"result": "User reported both normal. Actual installed service9393 logs three-node pen commit result1 valid1, curve writes count2 saved at0. Screenshot after handoff shows edited curve."
},
{
"name": "Clip/inspector lifecycle",
"result": "Project/clip switch reload observed populated inspector. A three-cycle automation run timed out during manual interaction, so no three-cycle completion claim."
}
],
"userAcceptance": {
"questionVersionLabel": "77",
"installedBuildAtResponse": "78",
"response": "两项都正常",
"note": "User answered earlier question after build78 was installed; actual service path and build checked. No claim all arbitrary projects are covered."
},
"localLogs": [
"2026-11-05 11:23:32.113 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_end_boundary requested=4.000000000 display=3.960000000",
"2026-11-05 11:23:32.113 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_open requested=3.960000000 cached=3.960000000",
"2026-11-05 11:25:05.349 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_open requested=2.800000000 cached=2.800000000",
"2026-11-05 11:45:34.127 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_open requested=0.000000000 cached=0.000000000",
"2026-11-05 11:47:11.427 Df 大鱼调色 XPC Service[9393:5556e0] dayu_tool_track_start direction=1 reference=0.000000 cached=0",
"2026-11-05 11:47:11.617 Df 大鱼调色 XPC Service[9393:55c3e2] dayu_tool_track_seed width=1920 height=1080 flip=0 time=0.000000",
"2026-11-05 12:05:22.908 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_open requested=0.000000000 cached=0.000000000",
"2026-11-05 12:08:31.344 Df 大鱼调色 XPC Service[9393:5556e0] dayu_scope_open requested=0.000000000 cached=0.000000000",
"2026-11-05 12:08:35.123 Df 大鱼调色 XPC Service[9393:5556e0] dayu_pen_commit event=0.000000000 action=0.000000000 nodes=3",
"2026-11-05 12:08:35.123 Df 大鱼调色 XPC Service[9393:5556e0] dayu_pen_commit result=1 valid=1",
"2026-11-05 12:10:06.190 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_begin accepted=1 event=0.000000000 action=0.000000000 count=2",
"2026-11-05 12:10:06.197 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:06.451 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:06.651 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:06.734 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:06.814 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:06.906 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.100 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.179 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.263 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.466 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.545 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.624 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.718 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.796 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:07.994 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.075 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.158 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.236 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.315 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.413 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.492 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.573 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.650 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.831 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.909 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:08.993 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:09.073 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:09.161 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:12.811 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_begin accepted=1 event=0.000000000 action=0.000000000 count=2",
"2026-11-05 12:10:13.348 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:13.552 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:13.681 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:13.843 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:13.922 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.039 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.131 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.212 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.303 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.467 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.586 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.672 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.752 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.832 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.908 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:14.988 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.068 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.148 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.298 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.411 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.494 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.648 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.727 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.822 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:15.905 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.081 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.184 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.265 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.344 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.425 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.508 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.684 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.813 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:16.979 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.077 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.209 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.294 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.389 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.552 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.632 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.711 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.841 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:17.921 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.004 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.086 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.302 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.380 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.460 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.539 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.618 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.700 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.780 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:18.859 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000",
"2026-11-05 12:10:19.361 Df 大鱼调色 XPC Service[9393:5556e0] dayu_viewer_write saved count=2 time=0.000000000"
],
"trackingReports": [
"verification/HostTracking78-99.json",
"verification/HostTracking78-100.json"
],
"limitations": [
"Original CF export has no frame99 key; common99 comparison passes, full100 comparison reports missing rather than interpolating.",
"Tracking comparison covers default ungrouped rectangle and pure translation footage, not arbitrary rotations, scales, groups or source metadata.",
"Public FxPlug workspace remains host-managed floating resizable window, not a native FCP dock."
]
}
+37
查看文件
@@ -0,0 +1,37 @@
{
"version": "1.12.0",
"build": "79",
"compiledSource": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"actualServicePID": 13021,
"actualServicePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service",
"status": "passed",
"nativeChecks": 834,
"host": "Final Cut Pro, isolated QA library",
"checks": [
{
"name": "Canvas toolbar placement",
"result": "Screenshot shows seven icon buttons in horizontal lower-left row inside portrait image; control-panel button lower-right, no overlap."
},
{
"name": "Recent LUT shortcuts",
"result": "Parameter page below LUT path/strength shows three real-frame thumbnails, names and recent-use order; no separate search/import/sidebar chrome visible."
},
{
"name": "Apply to selected layer",
"result": "Clicked recent 复古清新干净1; selected layer remains 风格 LUT 2, path button changes from 无 to its name, thumbnail becomes 已选择, entry moves first."
},
{
"name": "Remove and reopen",
"result": "Removed applied LUT to restore prior neutral state; history remains three entries. Inspector hidden then shown once, full custom inspector reloads. Workspace reopened, recent thumbnails and four scopes57600 persist."
},
{
"name": "Previous feedback regression",
"result": "Build78 real user accepted pen closure and canvas curve persistence, plus actual save logs; same bridge/pen implementation retained in79 and all native cases pass. Actual79 fresh inspector and scopes populated."
}
],
"limits": [
"No claim of a completed three-cycle GUI stress loop; earlier loop was interrupted by manual interaction.",
"CF trajectory result is the exact common99-frame comparison recorded separately, not arbitrary-footage equivalence."
]
}
+16
查看文件
@@ -0,0 +1,16 @@
{
"status": "passed",
"version": "1.13.2",
"build": "86",
"compiledSource": "db6b2b05b3ee2ad40a6aeab70017a2b121caa67d",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": "Final Cut Pro 12.4",
"hostPID": 36280,
"servicePID": 36306,
"nativeChecks": 864,
"qaProject": "1.12.0_76_OpenCV真实帧跟踪 2, independent QA copy",
"inspectorVersion": "1.13.2",
"effectOutputHistogramSamples": 57600,
"registrationIntegrity": "verified",
"scope": "Cold Final Cut Pro launch, existing QA project, inspector and live effect output."
}
文件差异过大,未显示。 加载差异
文件差异过大,未显示。 加载差异
@@ -0,0 +1,74 @@
{
"status": "superseded-after-user-feedback",
"date": "2026-11-04T20:14:41.392289+00:00",
"version": "1.12.0",
"build": "74",
"host": "Final Cut Pro 12.4",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"compiledSource": "226b7e1e93dfd5fa2ee2f002fdc828077a2f7f46",
"appNotaryID": "b666b44e-83d3-4edd-88e7-f0c5cf83f8ce",
"appNotaryStatus": "Accepted",
"installedSelfTest": {
"passed": true,
"checks": 787
},
"finalCandidateHostExecuted": true,
"blocker": "User explicitly chose to test FCP manually; computer-use actions stopped pending results.",
"priorCandidate": {
"compiledSource": "a0a97dfd8854f01dcec54b7aebc3fdc1fed8568d",
"observed": [
"Formal 1.12.0 loaded in FCP; left rectangle/ellipse/pen and curve/lens/skin/LUT rail, bottom control-panel entry visible.",
"Native inspector control-panel button opened workspace.",
"Horizontal curve tool added a true layer labelled curve 2; four channel curves and histograms visible.",
"Rectangle object assigned to curve 2, spider and HSL; all three rows referenced the mask and assignment states stayed checked.",
"Closing workspace showed added curve and each associated mask count in the regular inspector."
],
"issuesFound": [
"Initial remote window too large.",
"Layer bypass icons clipped at left-column boundary."
],
"issuesFixedInFinalSource": true
},
"pending": [
"Final narrow/expanded remote-window and full row-icon visual acceptance.",
"Final native layer/parameter/LUT/scopes interactions and saved/reopened state.",
"Actual canvas drag creation, curve/lens interactions and one-step undo.",
"Actual FxAnalyzer frame tracking from FCP.",
"Original ColorFinale same-video complete trajectory comparison, including verified trajectory export."
],
"limits": [
"FxPlug exposes a resizable host remote window, not a public native FCP docking API.",
"Generated known-motion tests do not prove original same-video trajectory equivalence.",
"Alpha, non-square pixels and actual host processing-color compliance need separate parity evidence."
],
"packaging": "Not built or published for 1.12.0 yet; Packaging/build_pkg.py requires verified host delivery.",
"rollbackBackups": [
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-80dd0728de5d4b8ea651d4de529c4583.app",
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-94ced90dbe78482dac41fc8eedc6e972.app"
],
"lastLockScreenCheck": "2026-11-04T20:26:41.891197+00:00",
"consecutiveGoalTurnsWithSameLockScreenBlocker": 3,
"deliveryWaitingProcess": "Exited normally with leave; pending status and rollback backups retained.",
"deliveryLockReleased": true,
"resumeInstructions": "After manual unlock, verify the existing notarized formal installation against Delivery.json and finish the pending FCP checks. Do not rebuild or renotarize solely because the waiting process ended. Acquire the product delivery lock before final acceptance, pending-record finalization and cleanup of both recorded recovery APPs. Then package, notarize, publish and fully download-verify the Release.",
"priorLockScreenBlocker": "CUA returned: The Mac is locked and automatic unlock could not unlock it. User asked to unlock manually; no lock-screen bypass attempted.",
"lockScreenBlockerResolved": true,
"manualHandoffAt": "2026-11-05T01:18:41.280516+00:00",
"observedFinalCandidate": [
"FCP loaded the formal installed com.dayu.color.XPC executable; actual process path confirmed.",
"Native narrow workspace displayed at 2880x768 image pixels, with complete left-column bypass icons.",
"Four curve channels and histograms were visible in the selected adjustment view.",
"Shared rectangle references remained visible under curve, spider and HSL after FCP reopened."
],
"automationLimitation": "Some CUA actions reported external user changes. User confirmed manual testing; attempted clicks are not treated as proof of size-toggle or drawing success.",
"currentFormalServicePID": 859,
"currentFCPPID": 824,
"userReportedIssues": [
"Canvas rail needs icon button affordance.",
"Closed pen path displayed as rectangle.",
"Narrow workspace needs horizontal layout and persistent right four-up scopes.",
"LUT and mask must open from the layer, without separate tabs.",
"Main custom inspector intermittently blank; host log showed FxPlugErrorDomain 16 PluginNotFound."
],
"newCandidate": "1.12.0(75), source changes under verification; not installed yet"
}
文件差异过大,未显示。 加载差异
+34
查看文件
@@ -0,0 +1,34 @@
{
"version": "1.13.2",
"build": "86",
"compiledSource": "db6b2b05b3ee2ad40a6aeab70017a2b121caa67d",
"staticVerification": {
"installedOfficialBundle": "passed",
"unchangedRedistributedBundle": "passed",
"adHocWrapper": "rejected, OSStatus -67050",
"unsignedService": "rejected, OSStatus -67062",
"adHocService": "rejected, OSStatus -67021",
"modifiedMetalResource": "rejected, OSStatus -67054"
},
"serviceStartup": {
"officialFinalCut": "passed, see HostIntegrity1.13.2.json",
"adHocWrapperWithOriginalService": "explicit refusal, exit 78",
"detachedOriginalService": "explicit refusal, exit 78",
"modifiedMetalResource": "one direct launch stopped before producing application output with signal 9; the static verifier independently refused the file",
"adHocService": "static refusal confirmed; direct launch did not return a diagnostic within the test window"
},
"registration": {
"officialApp": "registered from the formal path; only one com.dayu.color.XPC result",
"rejectionTests": "Ran the production removal method with isolated mocked PlugInKit responses. It removes and rechecks the exact path, preserves a different path, reports unsuccessful read-back, and skips symbolic links."
},
"update": {
"officialApp": "production HTTPS check completed and reported current version up to date",
"untrustedNativeProcess": "entered integrity_rejected and created no URLSession task; download, install, cancel and another check did not re-enable it",
"updaterContract": "66 checks passed with the signed, notarized 1.12.0 update package, including corrupt checksum refusal",
"serverPolicy": "Existing automatic update endpoint and distribution policy preserved. Integrity enforcement runs locally."
},
"recovery": {
"independentCheckout": "618 files, clean checkout, exact Git tree, strict fsck passed",
"scope": "Verified independently retrieved build inputs. No second full build."
}
}
+22 -16
查看文件
@@ -1,7 +1,7 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.11.0.pkg",
"sha256": "2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e",
"bytes": 43128845,
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.13.2.pkg",
"sha256": "6c18bc081cd9d5099ae821df5d5da43585f9db292345c18db4a4e12cce1f133f",
"bytes": 45359239,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
@@ -31,28 +31,34 @@
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.11.0",
"build": "73"
"version": "1.13.2",
"build": "86"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.eb9ab973-a3e5-42c3-862f-658f5151d090/3257180A-BAC3-4EB9-A02B-91B15B093A2E/大鱼调色"
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.99b40b74-826f-41c2-b095-db2ea957bcf5/2FBED823-59C6-4278-9624-5930A37FEA8A/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.11.0.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-04 18:10:52 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.11.0.pkg: accepted\nsource=Notarized Developer ID",
"signature": "Package \"大鱼调色-1.13.2.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-05 15:13:04 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.13.2.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"id": "ffbdb4fb-f573-411e-99fc-166c4a829121",
"name": "大鱼调色-1.13.2.pkg",
"createdDate": "2026-11-05T15:13:07.260Z",
"id": "33ff7ce2-66bb-4ab9-9648-a4b9f9d8196c",
"status": "Accepted",
"name": "大鱼调色-1.11.0.pkg",
"createdDate": "2026-11-04T18:10:53.762Z"
"message": "Successfully received submission info"
},
"appCompiledSource": "49d35cb49ab93f5ab6ca3411eaea80f7219be346",
"appBuild": "73",
"hostAcceptance": "passed-user-actual-mouse",
"appCompiledSource": "db6b2b05b3ee2ad40a6aeab70017a2b121caa67d",
"appBuild": "86",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"installScope": "Package expanded and verified; installation scripts were not run.",
"releaseStatus": "ready-for-release"
"templateSHA256": {
"大鱼调色.moef": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostIntegrity1.13.2.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
@@ -0,0 +1,14 @@
{
"date": "2026-11-05T01:19:39.543125+00:00",
"passResult": true,
"version": "1.12.0",
"build": "74",
"compiledAppSource": "226b7e1e93dfd5fa2ee2f002fdc828077a2f7f46",
"manifest": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/dayu-color-package-manifest.json",
"manifestSHA256": "4ed57e4610802887942860c04c7b59fb53cb5e1c8ededdd7796063bb0d3f04a6",
"prepareOnly": "Strict FxPlug resource preflight passed; no PKG created.",
"unverifiedHostBuildGate": "Full packaging rejected before build because formal host acceptance is pending.",
"packageCreated": false,
"published": false,
"host": "User is testing manually; no computer-use actions during handoff."
}
+22 -32
查看文件
@@ -1,36 +1,26 @@
{
"passResult": false,
"status": "draft-download-verification-blocked",
"published": false,
"passResult": true,
"repository": "dayu/dayu-color",
"private": false,
"prerelease": true,
"tag": "v1.10.0-canvas-workspace-20261104",
"releaseCommit": "c0e6f3be0afc310125d2d045a96655db7524f24b",
"releaseID": 387,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.10.0-canvas-workspace-20261104",
"assetID": 31,
"downloadURL": "https://dayu.media/git/attachments/cb9b5516-0953-4993-99a1-360c1d92cb6d",
"bytes": 43090565,
"sha256": "ee70461c9b2d2e0ddd78cbcb3371c3b1b36b7f0e5fc69bfccc7ac0f1a3e468d8",
"draft": true,
"sourceAndTagRemotelyVerified": true,
"attachmentMetadataVerified": true,
"downloadVerified": false,
"reason": "Draft attachment HTTP download requires an authenticated browser session. CUA ended the browser session because the current browser URL is not allowed; no bypass or publication performed.",
"article": {
"id": 15792,
"url": "https://dayu.media/15792/",
"verified": true
},
"previousPublishedRelease": {
"tag": "v1.8.5-light-dark-20261104",
"releaseID": 386,
"releaseCommit": "def8c2f6386a3d34453912b9e8f96e37e192796c",
"history": "The full previous report remains in tag v1.10.0-canvas-workspace-20261104:verification/Release.json and earlier Git history."
},
"finalReadbackConfirmed": true,
"assetName": "大鱼调色-1.10.0.pkg",
"repositoryID": 52,
"repositoryVisibilityPreserved": true
"private": false,
"tag": "v1.13.1-pixel-clone-20261105",
"releaseCommit": "46153a26edfbf44c5f22fbad5953ec74c0d33883",
"releaseID": 392,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.13.1-pixel-clone-20261105",
"prerelease": true,
"assetID": 36,
"assetName": "大鱼调色-1.13.1.pkg",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.13.1-pixel-clone-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.13.1.pkg",
"bytes": 45352349,
"sha256": "8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965",
"existingAssetReused": true,
"verification": "Full draft download checked before publication; published attachment downloaded and checked again; release, tag and asset read-back verified.",
"credentialSource": "macOS Keychain: dayu-git-api",
"draftBrowserDownload": {
"path": "/Volumes/备份/大鱼调色-1.13.1.pkg",
"sha256": "8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965",
"bytes": 45352349,
"sourceURL": "https://dayu.media/git/attachments/ee0a09fc-58b0-4883-9923-d5eb8aced007",
"localCopyRemoved": true
}
}
+128
查看文件
@@ -0,0 +1,128 @@
{
"version": "4.5.1",
"checks": [
{
"name": "pinned-public-opencv-version",
"pass": true,
"error": 0
},
{
"name": "300-feature-capacity",
"pass": true,
"error": 300
},
{
"name": "translation-rotation-independent-xy-scale",
"pass": true,
"error": 0.00329193
},
{
"name": "free-path-outside-creation-box-12-frame-subpixel",
"pass": true,
"error": 0.014753
},
{
"name": "periodic-redetection-keeps-static-position",
"pass": true,
"error": 0
},
{
"name": "unrelated-cut-stops-with-last-trusted-position",
"pass": true,
"error": 0
},
{
"name": "flat-mask-rejected",
"pass": true,
"error": 0
},
{
"name": "moving-majority-prefers-subject-over-static-background",
"pass": true,
"error": 0.00237274
},
{
"name": "independent-tracker-objects-do-not-share-motion",
"pass": true,
"error": 0
},
{
"name": "invalid-frame-preserves-authored-geometry",
"pass": true,
"error": 0
},
{
"name": "nonfinite-source-rejected",
"pass": true,
"error": 0
},
{
"name": "4k-complete-source-frame",
"pass": true,
"error": 0.000107325
}
],
"pass": true,
"count": 12,
"runtimeTargetAppUsed": false,
"scope": "Known analytic generated images, public-source OpenCV 4.5.1. No FCP, target application, or user video runtime exercised.",
"measuredTimingNote": "4K generated images plus tracking: 195.212ms",
"checkedAt": "2026-11-04T19:14:24.907484+00:00",
"build": {
"version": "4.5.1",
"commit": "1363496c1106606684d40447f5d1149b2c66a9f8",
"archiveSHA256": "4356b76721786bff66536ecd1a36ac2e397b13a4ee1dec41f362fa2459e903db",
"header": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/include",
"linkResponse": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/link.rsp",
"libraries": [
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libDayuOpenCVTracker.a",
"bytes": 28520,
"sha256": "2990cbe91559c7c9550d7b92accd50661273f0487d594b16ddf81dd6a946905b"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_calib3d.a",
"bytes": 2529512,
"sha256": "af39b65e6a15e552432c43a63ee9e151d12137e1f7566434e40a146093cb3b31"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_features2d.a",
"bytes": 1007936,
"sha256": "342a344f149c577dde10ea94b98b6823aafc4ba2971e19da31c07baed396a22f"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_flann.a",
"bytes": 703176,
"sha256": "f2b46997cf2dd0e6dfe66426331f9c04f73257118ce24849c33bd81937e21a37"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_video.a",
"bytes": 594296,
"sha256": "acb2e2b8f1e82679ed1e95eae8757439a1f980fa02aef11fed28d318617fb50c"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_imgproc.a",
"bytes": 4144320,
"sha256": "6986f20cfb856a09c1809d0a7f0879127172fc7c9e917d66935503e5e8e55338"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/libs/libopencv_core.a",
"bytes": 3866200,
"sha256": "537b5dcdc596924d6fcc5299e9e463dc490ff7102c51f078a2da999d5e73e680"
}
],
"sourceApplicationDependency": false
},
"sourceSHA256": {
"tools/tracking/DYOpenCVTracker.cpp": "050450ed2ee5516e804c96fc9bd21a73a4deb288f0333442c1114d35023e2fb8",
"tools/tracking/verify_opencv_tracker.cpp": "8e42b42fefd8fd25551b462f9cdb036ce617d3f1b4dabcd1e0acee2e0d050b5a",
"大鱼调色/Plugin/MaskCore/DYOpenCVTracker.hpp": "f490aa33442bb49217b1cca55b0ffce724e8ffaf8e17d7afc53f6e468c86ec76",
"ThirdParty/OpenCV/source-lock.json": "b60ac93510cd2380980722ecc6c1379d3f13446cda1608560b93b7db8fc21309"
},
"systemRuntimeDependencies": [
"\t/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)",
"\t/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)",
"\t/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2200.27.0)",
"\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1359.0.0)"
]
}
@@ -0,0 +1,54 @@
{
"pass_": true,
"version": "1.12.0",
"build": "79",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"retainedPackage": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.12.0.pkg",
"removed": [
{
"path": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-4717c30742ce4299b4796e06a9097579.app",
"build": "76",
"creationHistory": "8bbd386abb8fe5429715bdac0eeebf6792d87dba"
},
{
"path": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-80dd0728de5d4b8ea651d4de529c4583.app",
"build": "74",
"creationHistory": "411900b928b362f54fa55281af58ecd70a7c0df7"
},
{
"path": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-94ced90dbe78482dac41fc8eedc6e972.app",
"build": "73",
"creationHistory": "2d162a8fc5872d501044b09073b4bcb461af813c"
},
{
"path": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-8147ad025755463e97ed0b794bdf80da.app",
"build": "75",
"creationHistory": "dad77aff77e58c554bd40740ef971e2f41719464"
},
{
"path": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-6b3a3828ed464ca5835d97e6593f61e5.app",
"build": "74",
"creationHistory": "331e3ff3158c68a41411feb0b934ce2c5b5b59d1"
},
{
"path": "/Users/mac/Downloads/大鱼调色-1.12.0.pkg",
"kind": "actual browser verification download",
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe"
},
{
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/workspace-recovery-1.12.0-nv52vsyz",
"kind": "verified temporary remote recovery checkout"
}
],
"registry": " com.dayu.color.XPC(1.1)\t393ABE88-5D81-45AE-B3DE-EECDDF53DA21\t2026-11-05 04:31:09 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)\n",
"scanRoots": [
"/Volumes/备份/大鱼调色",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Users/mac/Desktop",
"/Users/mac/Downloads",
"/Applications",
"/Library/Plug-Ins/FxPlug",
"/Users/mac/Library/Plug-Ins/FxPlug"
],
"scope": "Only this product identified by bundleID, signing team and recorded creation history; no whole-disk uniqueness claim. Historical user distribution packages preserved."
}
@@ -0,0 +1,23 @@
{
"pass_": true,
"releaseTag": "v1.12.0-unified-workspace-20261105",
"releaseCommit": "b72e6b31724def5c174b692ef0a46b76992e780b",
"compiledSource": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
"trackedFiles": 598,
"fsck": "strict passed",
"byteMismatches": 0,
"compiledProductInputsUnchanged": true,
"documentationAndVerificationChanges": [
"Packaging/Release-1.12.0.md",
"research/WorkspaceFeedback-20261105.md",
"verification/CompiledSourceRecovery79.json",
"verification/Delivery.json",
"verification/HostFeedback79.json",
"verification/InstalledSelfTest.json",
"verification/Package.json",
"verification/WorkspaceUIRevision1.12.0.json",
"\"\\350\\207\\252\\345\\256\\232\\346\\216\\247\\344\\273\\266\\345\\274\\200\\345\\217\\221\\344\\272\\244\\346\\216\\245.md\""
],
"scope": "Independent remote tag checkout and exact tracked bytes verified. Dependencies were not rebuilt from a cold cache.",
"temporaryClone": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/workspace-recovery-1.12.0-nv52vsyz"
}
@@ -0,0 +1,61 @@
{
"passResult": true,
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"compiledSource": "226b7e1e93dfd5fa2ee2f002fdc828077a2f7f46",
"restoredCommit": "226b7e1e93dfd5fa2ee2f002fdc828077a2f7f46",
"trackedFilesByteIdentical": 577,
"fsck": "git fsck --full --strict passed",
"submodules": false,
"lfs": false,
"clonePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/workspace-recovery-1.12.0-nv52vsyz",
"dependencyNotes": "Existing color dependency archives remain versioned; OpenCV source is fetched from the official URL and verified against ThirdParty/OpenCV/source-lock.json. Full cold dependency compilation was not repeated.",
"cleanupPending": true,
"colorSourceArchivesVerified": [
{
"name": "OpenColorIO",
"bytes": 14182890,
"sha256": "722601e01b78b7a12da4829cb450674935f404b0e508f3f20046fa77570e3272"
},
{
"name": "expat",
"bytes": 8439887,
"sha256": "d09e2dd23398805cec1bac2860304714c96dc2fde629a7a1a77d0880ab7cd242"
},
{
"name": "yaml-cpp",
"bytes": 1017151,
"sha256": "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16"
},
{
"name": "Imath",
"bytes": 689041,
"sha256": "b2c8a44c3e4695b74e9644c76f5f5480767355c6f98cde58ba0e82b4ad8c63ce"
},
{
"name": "pystring",
"bytes": 19184,
"sha256": "49da0fe2a049340d3c45cce530df63a2278af936003642330287b68cefd788fb"
},
{
"name": "minizip-ng",
"bytes": 773269,
"sha256": "c362e35ee973fa7be58cc5e38a4a6c23cc8f7e652555daf4f115a9eb2d3a6be7"
},
{
"name": "zlib",
"bytes": 1572744,
"sha256": "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c"
},
{
"name": "sse2neon",
"bytes": 136342,
"sha256": "3427a495743bb6fd1b5f9f806b80f57d67b1ac7ccf39a5f44aedd487fd7e6da1"
}
],
"openCVOfficialArchiveVerified": {
"commit": "1363496c1106606684d40447f5d1149b2c66a9f8",
"url": "https://codeload.github.com/opencv/opencv/tar.gz/1363496c1106606684d40447f5d1149b2c66a9f8",
"bytes": 88266905,
"sha256": "4356b76721786bff66536ecd1a36ac2e397b13a4ee1dec41f362fa2459e903db"
}
}
@@ -0,0 +1,32 @@
{
"date": "2026-11-05T02:22:40.436257+00:00",
"status": "formal-delivery-complete",
"version": "1.12.0",
"build": "79",
"checks": 834,
"passed": true,
"reportSHA256": "5eda5058ab3f3f372ff7b872214ca6e9060e00c20501e06f8803e1931280a253",
"scope": [
"Offscreen AppKit fixtures, no test window presented.",
"Horizontal module and six mask layouts at minimum strip height.",
"Permanent four plots and real scope worker rasters.",
"Layer-driven LUT/mask navigation, UUID isolation and shared assignments.",
"Shared three-node pen path before and after authoritative write.",
"Deferred coalesced model refresh and repeated inspector/remote recreation.",
"Only one 320x180 real final-output sample retained while hidden; no ICC/statistics processing.",
"Paused-frame open replays exact-time cache; mismatched time and another instance rejected.",
"Default wide mask strip shows entire tracking area and numeric fields are editable.",
"All four scope images expose accessible titles."
],
"remaining": [],
"buildIsolation": "XPC-only scheme does not execute RegisterWithLaunchServices; PluginKit retains one formal installed path.",
"uiAudit": "SwiftUI audit not applicable: existing native interface is AppKit, no Swift source.",
"compiledSource": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
"actualHostReports": [
"verification/HostFeedback78.json",
"verification/HostFeedback79.json"
],
"packageVerification": "verification/Package.json",
"releaseVerification": "verification/Release.json",
"cleanupVerification": "verification/UnifiedWorkspaceCleanup79.json"
}
+9
查看文件
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
34A97A301E774BF3A13BC6A1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34A97A301E774BF3A13BC6A3 /* Security.framework */; };
34A97A301E774BF3A13BC6A2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34A97A301E774BF3A13BC6A3 /* Security.framework */; };
04962E563095058F009952AA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04962E553095058F009952AA /* Cocoa.framework */; };
04962E5E3095058F009952AA /* 大鱼调色 XPC Service.pluginkit in Embed PlugIns */ = {isa = PBXBuildFile; fileRef = 04962E5D3095058F009952AA /* 大鱼调色 XPC Service.pluginkit */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
04962E623095058F009952AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04962E613095058F009952AA /* Foundation.framework */; };
@@ -39,6 +41,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
34A97A301E774BF3A13BC6A3 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
04962E523095058F009952AA /* 大鱼调色.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "大鱼调色.app"; sourceTree = BUILT_PRODUCTS_DIR; };
04962E553095058F009952AA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
04962E5D3095058F009952AA /* 大鱼调色 XPC Service.pluginkit */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "大鱼调色 XPC Service.pluginkit"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -153,6 +156,7 @@
isa = PBXFrameworksBuildPhase;
files = (
04962E563095058F009952AA /* Cocoa.framework in Frameworks */,
34A97A301E774BF3A13BC6A1 /* Security.framework in Frameworks */,
);
};
04962E583095058F009952AA /* Frameworks */ = {
@@ -163,6 +167,7 @@
04962E623095058F009952AA /* Foundation.framework in Frameworks */,
04962E643095058F009952AA /* AppKit.framework in Frameworks */,
04962E6A3095058F009952AA /* FxPlug.framework in Frameworks */,
34A97A301E774BF3A13BC6A2 /* Security.framework in Frameworks */,
);
};
/* End PBXFrameworksBuildPhase section */
@@ -195,6 +200,7 @@
04962E653095058F009952AA /* Accelerate.framework */,
04962E673095058F009952AA /* PluginManager.framework */,
04962E693095058F009952AA /* FxPlug.framework */,
34A97A301E774BF3A13BC6A3 /* Security.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -327,6 +333,7 @@
shellPath = /bin/sh;
shellScript = (
"set -eu",
"/usr/bin/python3 \"$SRCROOT/tools/build_tracking_opencv.py\" --resources \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/ThirdParty/OpenCV\"",
"/usr/bin/python3 \"$SRCROOT/ColorManagement/build_runtime.py\" \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\"",
"/usr/bin/python3 \"$SRCROOT/tools/build_kernels.py\" --output \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/default.metallib\" --intermediates \"$DERIVED_FILE_DIR/DayuKernels\"",
"/usr/bin/python3 - \"$SRCROOT/大鱼调色/Plugin/Resources\" \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\" <<'PYBUILD'",
@@ -381,6 +388,7 @@
MACOSX_DEPLOYMENT_TARGET = 14.6;
OTHER_LDFLAGS = (
"@/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/cms-runtime/bridge-link.rsp",
"@/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/link.rsp",
"$(inherited)",
"-framework",
Metal,
@@ -417,6 +425,7 @@
MACOSX_DEPLOYMENT_TARGET = 14.6;
OTHER_LDFLAGS = (
"@/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/cms-runtime/bridge-link.rsp",
"@/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/tracking-opencv/link.rsp",
"$(inherited)",
"-framework",
Metal,
@@ -5,7 +5,7 @@
id<DYViewerParameterProbe>bridge=(id)[[NSClassFromString(@"DYViewerParameterBridge")alloc]initWithAPIManager:host];
id<DYViewerControlsProbe>panel=(id)[NSClassFromString(@"DYViewerParameterPanel")new];panel.bridge=bridge;
auto drain=[](){double until=NSProcessInfo.processInfo.systemUptime+.06;while(NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.002]];};
auto publish=[&](){DYUniforms u;DYReadUniforms(host,host->_time,&u);[bridge publishUniforms:&u document:DYReadTools(host,host->_time).document atTime:host->_time];[bridge publishAssets:DYReadAssets(host,host->_time)histogram:nil atTime:host->_time];[panel prepareWithSize:NSMakeSize(1280,720)scale:1 atTime:host->_time];};
auto publish=[&](){DYUniforms u;DYReadUniforms(host,host->_time,&u);[bridge publishUniforms:&u document:DYReadTools(host,host->_time).document atTime:host->_time];[bridge publishAssets:DYReadAssets(host,host->_time)atTime:host->_time];[panel prepareWithSize:NSMakeSize(1280,720)scale:1 atTime:host->_time];};
auto area=[&](NSString *kind)->NSDictionary*{for(NSDictionary*a in [(id)panel valueForKey:@"areas"])if([a[@"kind"]isEqual:kind])return [[a copy]autorelease];return nil;};
auto drag=[&](NSPoint a,NSPoint b){[panel event:NSEventTypeLeftMouseDown point:a atTime:host->_time];[panel event:NSEventTypeLeftMouseDragged point:b atTime:host->_time];drain();[panel event:NSEventTypeLeftMouseUp point:b atTime:host->_time];drain();publish();};
[(id)panel setValue:@"hsl" forKey:@"toolType"];publish();NSRect plot=[area(@"hslPlot")[@"rect"]rectValue];int undo=base->_undoStarts;
@@ -19,7 +19,6 @@
run.record(@"canvas-spider-uuid-persists-mesh-without-touching-base",[saved isEqual:DYReadAssets(host,kCMTimeZero).spiderMesh]&&[DYToolWithID(DYReadTools(host,kCMTimeZero).document,spiderID)[@"spider"]length]>0);
NSData *current=DYToolWithID(DYReadTools(host,kCMTimeZero).document,spiderID)[@"spider"];[bridge beginSpider:current node:spiderID enabled:1 atTime:kCMTimeZero];drain();doc=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);auto external=dy::neutralMesh(12,12);NSData *externalData=[NSData dataWithBytes:&external length:sizeof(external)];((NSMutableDictionary*)DYToolWithID(doc,spiderID))[@"spider"]=externalData;DYWriteTools(host,doc,kCMTimeZero);[bridge changeSpider:current];[bridge endGesture];drain();
run.record(@"canvas-spider-external-topology-change-wins",[DYToolWithID(DYReadTools(host,kCMTimeZero).document,spiderID)[@"spider"]isEqual:externalData]);
DYHistogram hist{};hist.samples=1;hist.bins[1][100]=1;NSData *histData=[NSData dataWithBytes:&hist length:sizeof(hist)];[bridge publishHistogram:histData atTime:kCMTimeZero];run.record(@"canvas-histogram-is-frozen-to-matching-frame",[[bridge snapshotAtTime:kCMTimeZero][@"histogram"]isEqual:histData]&&![bridge snapshotAtTime:CMTimeMake(1,24)]);
[panel finishCapture];panel.bridge=nil;[bridge invalidate];drain();[(id)panel release];[(id)bridge release];
}
{
@@ -59,3 +58,51 @@ if(faceFixture.length){
DYDiagnosticTile *twoSource=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:1024 height:512]autorelease],*twoDest=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:1024 height:512]autorelease];Pixels two(1024*512*4);for(NSUInteger y=0;y<512;y++)for(NSUInteger x=0;x<1024;x++)memcpy(two.data()+(y*1024+x)*4,portrait.data()+(y*512+x%512)*4,8);[[twoSource metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,1024,512)mipmapLevel:0 withBytes:two.data()bytesPerRow:1024*8];u.skinProtection.x=1;BOOL twoOK=[face renderSource:twoSource destination:twoDest uniforms:u paths:@{}error:&maskError];NSData *twoEntries=[face valueForKey:@"faceEntries"];const DYToolMaskEntry *twoMasks=(const DYToolMaskEntry*)twoEntries.bytes;NSInteger faceCount=0;for(NSUInteger i=0;i<twoEntries.length/sizeof(*twoMasks);i++)faceCount+=twoMasks[i].section==-100;run.record(@"face-multiple-people-build-independent-support-regions",twoOK&&faceCount==2,@{@"faces":@(faceCount)});
Pixels noFace(w*h*4);for(NSUInteger i=0;i<w*h;i++){noFace[i*4]=.35;noFace[i*4+1]=.18;noFace[i*4+2]=.1;noFace[i*4+3]=1;}upload(noFace);u.skinVisualize=0;Pixels noFaceProtected=render(run,face,src,dst,gpu,u,@{},@"face-none-protected-render");u.skinProtection.x=0;Pixels noFacePlain=render(run,face,src,dst,gpu,u,@{},@"face-none-unprotected-reference");run.record(@"face-no-detection-clears-prior-frame-and-fails-closed",difference(noFaceProtected,noFacePlain).maximum<.002);
}
// Verify the real Metal input stage with a moving target and a fixed source.
{
const NSUInteger w=64,h=48;
DYDiagnosticTile *src=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:w height:h]autorelease];
DYDiagnosticTile *dst=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:w height:h]autorelease];
Pixels input(w*h*4);
for(NSUInteger y=0;y<h;y++)for(NSUInteger x=0;x<w;x++){
NSUInteger i=(y*w+x)*4;
input[i]=x/128.f;input[i+1]=y/96.f;input[i+2]=.15f;input[i+3]=1;
}
[[src metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,w,h) mipmapLevel:0 withBytes:input.data() bytesPerRow:w*8];
DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];
DYUniforms u=DYToolUniforms(@{@"type":@"lens"});
Pixels baseline=render(run,renderer,src,dst,gpu,u,@{},@"clone-stamp-reference-render");
NSMutableDictionary *doc=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);
NSMutableDictionary *stamp=(id)DYAddSharedMask(doc,DYMaskEllipse);
DYMaskParameters p=DYMaskAtTime(stamp,kCMTimeZero);
p.centerX=48.5f/w;p.centerY=24.5f/h;p.width=.25f;p.height=.25f;
stamp[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];
stamp[@"stampSource"]=@[@(16.5f/w),@(12.5f/h),@.25,@.25];
CMTime next=CMTimeMake(1,25);DYMaskParameters moved=p;moved.centerY=34.5f/h;moved.width=.5f;moved.height=.12f;moved.angle=.65f;
run.record(@"clone-stamp-preserves-source-through-tracking-merge",DYMergeTracking(stamp,@[DYMaskKey(kCMTimeZero,p,NO,1),DYMaskKey(next,moved,NO,1)])&&[stamp[@"stampSource"] count]==4);
auto frame=[&](CMTime t,NSString *label){
NSError *failure=nil;
BOOL ok=[renderer renderSource:src destination:dst uniforms:u paths:@{} spider:nil tools:DYToolRenderSnapshot(doc,t) colorManagement:nil hostPrimaries:kFxColorPrimaries_Rec709 error:&failure];
run.need(label,ok,@{@"error":reason(failure)});return read(dst,gpu);
};
auto pixel=[&](const Pixels &a,NSUInteger x,NSUInteger y,const Pixels &b,NSUInteger u,NSUInteger v){
double delta=0;for(int c=0;c<4;c++)delta=MAX(delta,fabs((float)a[(y*w+x)*4+c]-(float)b[(v*w+u)*4+c]));return delta;
};
Pixels first=frame(kCMTimeZero,@"clone-stamp-production-render");
run.record(@"clone-stamp-copies-pixels-and-leaves-exterior-intact",pixel(first,48,24,baseline,16,12)<.002&&pixel(first,0,0,baseline,0,0)==0&&pixel(first,16,12,baseline,16,12)==0);
Pixels second=frame(next,@"clone-stamp-tracked-production-render");
run.record(@"clone-stamp-tracked-target-moves-while-sampling-the-same-source",pixel(second,48,34,baseline,16,12)<.002&&pixel(second,48,24,baseline,48,24)==0);
DYMaskParameters translated=DYMaskAtTime(stamp,next);
run.record(@"clone-stamp-ignores-legacy-tracking-scale-and-rotation",translated.angle==0&&translated.width==p.width&&translated.height==p.height&&translated.centerY==moved.centerY&&pixel(second,51,35,baseline,19,13)==0);
p.width=.5f;p.height=.35f;p.angle=.55f; // A legacy authored rotation must not rotate copied pixels.
stamp[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];
Pixels expanded=frame(kCMTimeZero,@"clone-stamp-resized-production-render");
run.record(@"clone-stamp-resize-extends-coverage-with-pixel-exact-translation",pixel(expanded,51,25,baseline,19,13)==0&&pixel(expanded,58,24,baseline,26,12)==0&&pixel(first,58,24,baseline,58,24)==0);
stamp[@"enabled"]=@NO;Pixels disabled=frame(next,@"clone-stamp-disabled-render");
run.record(@"clone-stamp-disabled-is-identical",difference(disabled,baseline).maximum==0);
stamp[@"enabled"]=@YES;NSError *failure=nil;
NSURL *cube=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"unsupported-clone.cube"]];
run.record(@"clone-stamp-spatial-state-refuses-static-cube-export",![renderer exportLUT:cube uniforms:u paths:@{} spider:nil tools:doc error:&failure]&&failure);
}
+1
查看文件
@@ -7,6 +7,7 @@
@interface DYColorWorkspace : NSObject
- (instancetype)initWithManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer library:(DYLUTLibrary *)library title:(NSString *)title;
- (void)showRelativeToView:(NSView *)anchor;
- (void)showPage:(NSString *)page maskKind:(NSNumber *)kind;
- (void)close;
@property(nonatomic,readonly) BOOL visible;
@property(nonatomic,readonly) NSString *lastError;
+114 -72
查看文件
@@ -4,9 +4,36 @@
#import "DYLUTLibrary.h"
#import "DYTheme.h"
#import "DYToolState.h"
#import "DYInspector.h"
#import "DYManagedColor.h"
#include "DYScopeMath.hpp"
#include "DYScopeDisplayTime.h"
#import <os/log.h>
#include <cmath>
static NSButton *DYWorkspaceButton(NSString *title,id target,SEL action){NSButton *b=[NSButton buttonWithTitle:title target:target action:action];b.bezelStyle=NSBezelStyleRounded;b.bordered=NO;b.font=[NSFont systemFontOfSize:11];b.accessibilityLabel=title;return b;}
static NSString *DYWorkspaceSymbol(NSString *type){return @{@"primary":@"slider.horizontal.3",@"spider":@"circle.hexagongrid",@"base":@"sun.max",@"skin":@"person.crop.circle",@"look":@"square.stack.3d.up",@"hsl":@"paintpalette",@"curve":@"point.topleft.down.to.point.bottomright.curvepath",@"grading":@"circle.lefthalf.filled",@"primaries":@"circle.grid.2x2",@"levels":@"chart.bar",@"blackwhite":@"circle.righthalf.filled",@"balance":@"dial.low",@"mixer":@"slider.vertical.3",@"film":@"film",@"lens":@"camera.aperture"}[type]?:@"square";}
static NSDictionary *DYWorkspacePalette(void){NSMutableDictionary *palette=[[DYThemePalette()mutableCopy]autorelease];BOOL light=DYThemeIsLight();palette[@"background"]=[NSColor colorWithWhite:light?.88:.145 alpha:1];palette[@"card"]=[NSColor colorWithWhite:light?.84:.17 alpha:1];palette[@"field"]=[NSColor colorWithWhite:light?.78:.23 alpha:1];palette[@"border"]=[NSColor colorWithWhite:light?.6:.31 alpha:1];return palette;}
static NSDictionary *DYWorkspaceSection(NSString *type){NSMutableDictionary *section=[[DYToolSection(type)mutableCopy]autorelease];if([type isEqual:@"base"])section[@"extraEnabled"]=DYToolSection(@"color")[@"enabled"];if([type isEqual:@"primary"]){for(NSDictionary*d in DYDescriptors())if([d[@"key"]isEqual:@"primaryMasterEnabled"])section[@"enabled"]=d[@"pid"];section[@"enableParameters"]=@[DYToolSection(@"input")[@"enabled"],DYToolSection(@"primary")[@"enabled"],DYToolSection(@"output")[@"enabled"]];}return section;}
static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"base"])return u.baseSectionEnabled>.5||u.colorSectionEnabled>.5;if([type isEqual:@"primary"])return u.primarySectionEnabled>.5;for(NSDictionary*d in DYDescriptors())if([d[@"pid"]isEqual:DYToolSection(type)[@"enabled"]]&&[d[@"offset"]integerValue]>=0)return *(float*)((uint8_t*)&u+[d[@"offset"]unsignedIntegerValue])>.5;return YES;}
@interface DYWorkspaceList:NSView @end
@implementation DYWorkspaceList
- (BOOL)isFlipped{return YES;}
@end
@interface DYWorkspaceCell:NSTableCellView
@property(nonatomic,assign) NSButton *bypass;
@property(nonatomic,assign) NSButton *maskButton;
@property(nonatomic,assign) NSImageView *glyph;
@end
@implementation DYWorkspaceCell
- (void)resizeSubviewsWithOldSize:(NSSize)old{[super resizeSubviewsWithOldSize:old];CGFloat w=self.bounds.size.width;self.textField.frame=NSMakeRect(31,4,MAX(1,w-(_maskButton?91:65)),20);_glyph.frame=NSMakeRect(9,7,15,15);_maskButton.frame=NSMakeRect(MAX(0,w-55),2,24,24);_bypass.frame=NSMakeRect(MAX(0,w-29),2,24,24);}
@end
@interface DYWorkspaceRow:NSTableRowView @end
@implementation DYWorkspaceRow
- (void)drawSelectionInRect:(NSRect)dirty{[[NSColor colorWithRed:.23 green:.28 blue:.49 alpha:1]setFill];NSRectFill(self.bounds);}
- (void)drawSeparatorInRect:(NSRect)dirty{[[NSColor colorWithWhite:.23 alpha:1]setFill];NSRectFill(NSMakeRect(0,NSMaxY(self.bounds)-.5,self.bounds.size.width,.5));}
@end
@class DYWorkspaceRoot;
@interface DYColorWorkspace (Internal)
- (void)layoutWorkspace;
@@ -23,87 +50,91 @@
- (instancetype)initWithFrame:(NSRect)frame{if((self=[super initWithFrame:frame]))self.clipsToBounds=YES;return self;}
- (BOOL)isFlipped{return YES;}
- (BOOL)isOpaque{return YES;}
- (void)drawRect:(NSRect)dirty{[DYThemeColor(@"background")setFill];NSRectFill(NSIntersectionRect(dirty,self.bounds));}
- (void)drawRect:(NSRect)dirty{[[NSColor colorWithWhite:DYThemeIsLight()?.88:.145 alpha:1]setFill];NSRectFill(NSIntersectionRect(dirty,self.bounds));}
- (void)resizeSubviewsWithOldSize:(NSSize)old{[super resizeSubviewsWithOldSize:old];[_owner layoutWorkspace];}
@end
@interface DYScopePlot:NSView
@property(nonatomic,copy) NSDictionary *metadata;
@property(nonatomic) NSInteger mode;
@end
@implementation DYScopePlot {
NSImage *_wave,*_parade;
}
@implementation DYScopePlot {NSImage *_raster;}
- (BOOL)isFlipped{return YES;}
- (BOOL)isOpaque{return YES;}
- (void)dealloc{[_metadata release];[_wave release];[_parade release];[super dealloc];}
- (NSImage *)imageForData:(NSData *)data width:(NSUInteger)width{
if(data.length!=width*dyscope::Bins*4)return nil;
NSBitmapImageRep *rep=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:nil pixelsWide:width pixelsHigh:dyscope::Bins bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:width*4 bitsPerPixel:32]autorelease];
if(!rep)return nil;memcpy(rep.bitmapData,data.bytes,data.length);NSImage *image=[[[NSImage alloc]initWithSize:NSMakeSize(width,dyscope::Bins)]autorelease];[image addRepresentation:rep];return image;
- (void)dealloc{[_metadata release];[_raster release];[super dealloc];}
- (BOOL)isAccessibilityElement{return YES;}
- (NSString*)scopeTitle{return @[@"亮度波形",@"RGB 分列",@"直方图",@"矢量图"][_mode];}
- (void)setMetadata:(NSDictionary*)data{
if(_metadata==data&&self.accessibilityLabel.length)return;[_metadata release];_metadata=[data copy];[_raster release];_raster=nil;
NSString *key=_mode==0?@"waveform":_mode==1?@"parade":@"vectorscope";NSUInteger width=_mode==0?dyscope::Width:_mode==1?3*dyscope::Width:dyscope::Bins;NSData *bytes=_mode==2?nil:data[key];
if(bytes.length==width*dyscope::Bins*4){NSBitmapImageRep *rep=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:nil pixelsWide:width pixelsHigh:dyscope::Bins bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:width*4 bitsPerPixel:32]autorelease];memcpy(rep.bitmapData,bytes.bytes,bytes.length);_raster=[[NSImage alloc]initWithSize:NSMakeSize(width,dyscope::Bins)];[_raster addRepresentation:rep];}
self.accessibilityLabel=[NSString stringWithFormat:@"%@ · %@ · 有效取样 %@",(_mode==3?[self.scopeTitle stringByAppendingString:@"(含肤色指示线)"]:self.scopeTitle),data[@"domain"]?:@"等待画面",data[@"valid"]?:@0];[self setNeedsDisplay:YES];
}
- (void)setMetadata:(NSDictionary *)metadata{
if(_metadata==metadata)return;[_metadata release];_metadata=[metadata copy];[_wave release];_wave=[[self imageForData:metadata[@"waveform"] width:dyscope::Width]retain];[_parade release];_parade=[[self imageForData:metadata[@"parade"] width:3*dyscope::Width]retain];
self.accessibilityLabel=[NSString stringWithFormat:@"%@,有效取样 %@,低于显示范围 %@,高于显示范围 %@",metadata[@"domain"]?:@"等待最终输出",metadata[@"valid"]?:@0,metadata[@"below"]?:@0,metadata[@"above"]?:@0];[self setNeedsDisplay:YES];
}
- (void)setMode:(NSInteger)mode{_mode=mode;[self setNeedsDisplay:YES];}
- (void)drawRect:(NSRect)dirty{
[[NSColor colorWithCalibratedWhite:.025 alpha:1]setFill];NSRectFill(self.bounds);
NSRect plot=NSMakeRect(48,24,MAX(1,self.bounds.size.width-66),MAX(1,self.bounds.size.height-52));
NSDictionary *text=@{NSFontAttributeName:[NSFont monospacedDigitSystemFontOfSize:10 weight:NSFontWeightRegular],NSForegroundColorAttributeName:[NSColor colorWithWhite:.64 alpha:1]};
if(_mode<2){NSImage *image=_mode==1?_parade:_wave;[NSGraphicsContext saveGraphicsState];NSGraphicsContext.currentContext.imageInterpolation=NSImageInterpolationNone;[image drawInRect:plot fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];[NSGraphicsContext restoreGraphicsState];
for(int percent : {-10,0,25,50,75,100,110}){CGFloat y=NSMaxY(plot)-(percent+10)/120.0*plot.size.height;[[NSColor colorWithWhite:(percent==0||percent==100)?.48:.3 alpha:.55]setStroke];NSBezierPath *line=[NSBezierPath bezierPath];[line moveToPoint:NSMakePoint(plot.origin.x,y)];[line lineToPoint:NSMakePoint(NSMaxX(plot),y)];[line stroke];[[NSString stringWithFormat:@"%d%%",percent]drawAtPoint:NSMakePoint(5,y-6) withAttributes:text];}
if(_mode==1){for(int i=0;i<3;i++){CGFloat x=plot.origin.x+i*plot.size.width/3;[[@[@"R",@"G",@"B"]objectAtIndex:i]drawAtPoint:NSMakePoint(x+8,NSMaxY(plot)+7) withAttributes:text];if(i){[[NSColor colorWithWhite:.4 alpha:.6]setStroke];NSBezierPath *p=[NSBezierPath bezierPath];[p moveToPoint:NSMakePoint(x,plot.origin.y)];[p lineToPoint:NSMakePoint(x,NSMaxY(plot))];[p stroke];}}}
else [@"画面横向位置" drawAtPoint:NSMakePoint(plot.origin.x,NSMaxY(plot)+7) withAttributes:text];
}else{
NSData *hist=_metadata[@"histogram"];if(hist.length==4*dyscope::Bins*sizeof(uint32_t)){
const auto *bins=(const uint32_t*)hist.bytes;uint32_t maximum=1;for(unsigned i=0;i<4*dyscope::Bins;i++)maximum=std::max(maximum,bins[i]);
NSArray *colors=@[[NSColor colorWithWhite:.82 alpha:.8],NSColor.systemRedColor,NSColor.systemGreenColor,NSColor.systemBlueColor];
for(unsigned c=0;c<4;c++){[colors[c]setStroke];NSBezierPath *line=[NSBezierPath bezierPath];for(unsigned b=0;b<dyscope::Bins;b++){NSPoint pt=NSMakePoint(plot.origin.x+b*plot.size.width/(dyscope::Bins-1),NSMaxY(plot)-std::log1p(double(bins[c*dyscope::Bins+b]))/std::log1p(double(maximum))*plot.size.height);if(!b)[line moveToPoint:pt];else[line lineToPoint:pt];}[line stroke];}
}[@"−10% R′G′B′ / Y′ · 对数计数 110%" drawAtPoint:NSMakePoint(plot.origin.x,NSMaxY(plot)+7) withAttributes:text];
}
if(!_metadata){NSString *s=@"等待最终输出帧\n请播放、移动时间线或调整颜色";NSMutableParagraphStyle *style=[[[NSMutableParagraphStyle alloc]init]autorelease];style.alignment=NSTextAlignmentCenter;[s drawInRect:NSInsetRect(plot,20,MAX(20,(plot.size.height-50)/2)) withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:13],NSForegroundColorAttributeName:NSColor.secondaryLabelColor,NSParagraphStyleAttributeName:style}];}
[[NSColor colorWithWhite:.085 alpha:1]setFill];NSRectFill(self.bounds);[[NSColor colorWithWhite:.25 alpha:1]setStroke];NSFrameRectWithWidth(NSInsetRect(self.bounds,.5,.5),.5);
NSDictionary *text=@{NSFontAttributeName:[NSFont monospacedDigitSystemFontOfSize:8 weight:NSFontWeightRegular],NSForegroundColorAttributeName:[NSColor colorWithWhite:.68 alpha:1]};
[self.scopeTitle drawAtPoint:NSMakePoint(7,4)withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:10 weight:NSFontWeightMedium],NSForegroundColorAttributeName:[NSColor colorWithWhite:.83 alpha:1]}];
NSRect plot=NSMakeRect(_mode<2?23:8,22,MAX(1,self.bounds.size.width-(_mode<2?31:16)),MAX(1,self.bounds.size.height-34));
if(_mode==3){CGFloat side=MIN(plot.size.width,plot.size.height);plot=NSMakeRect(NSMidX(plot)-side/2,NSMidY(plot)-side/2,side,side);}
if(_mode!=2&&_raster){[NSGraphicsContext saveGraphicsState];NSGraphicsContext.currentContext.imageInterpolation=NSImageInterpolationNone;[_raster drawInRect:plot fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];[NSGraphicsContext restoreGraphicsState];}
[[NSColor colorWithWhite:.32 alpha:.7]setStroke];
if(_mode<2){for(int percent:{0,50,100}){CGFloat y=NSMaxY(plot)-(percent+10)/120.0*plot.size.height;NSBezierPath *line=[NSBezierPath bezierPath];[line moveToPoint:NSMakePoint(NSMinX(plot),y)];[line lineToPoint:NSMakePoint(NSMaxX(plot),y)];[line stroke];[[NSString stringWithFormat:@"%d",percent]drawAtPoint:NSMakePoint(2,y-5)withAttributes:text];}if(_mode==1)for(int c=0;c<3;c++){CGFloat x=plot.origin.x+c*plot.size.width/3;[@[@"R",@"G",@"B"][c]drawAtPoint:NSMakePoint(x+3,NSMaxY(plot)+1)withAttributes:text];}}
else if(_mode==2){NSData *hist=_metadata[@"histogram"];if(hist.length==4*dyscope::Bins*sizeof(uint32_t)){auto *bins=(const uint32_t*)hist.bytes;uint32_t maximum=1;for(unsigned i=0;i<4*dyscope::Bins;i++)maximum=std::max(maximum,bins[i]);NSArray *colors=@[[NSColor colorWithWhite:.8 alpha:.8],NSColor.systemRedColor,NSColor.systemGreenColor,NSColor.systemBlueColor];for(unsigned c=0;c<4;c++){[colors[c]setStroke];NSBezierPath *line=[NSBezierPath bezierPath];for(unsigned x=0;x<dyscope::Bins;x++){NSPoint q=NSMakePoint(plot.origin.x+x*plot.size.width/255,NSMaxY(plot)-std::log1p(double(bins[c*dyscope::Bins+x]))/std::log1p(double(maximum))*plot.size.height);if(x)[line lineToPoint:q];else[line moveToPoint:q];}[line stroke];}}}
else{[[NSBezierPath bezierPathWithOvalInRect:plot]stroke];NSBezierPath *axes=[NSBezierPath bezierPath];[axes moveToPoint:NSMakePoint(NSMidX(plot),NSMinY(plot))];[axes lineToPoint:NSMakePoint(NSMidX(plot),NSMaxY(plot))];[axes moveToPoint:NSMakePoint(NSMinX(plot),NSMidY(plot))];[axes lineToPoint:NSMakePoint(NSMaxX(plot),NSMidY(plot))];[axes stroke];
// A quiet dashed reference stays legible over the trace without obscuring it.
NSPoint skin=NSMakePoint(NSMidX(plot)+dyscope::SkinToneCb*plot.size.width*.49,NSMidY(plot)-dyscope::SkinToneCr*plot.size.height*.49);
NSBezierPath *skinLine=[NSBezierPath bezierPath];CGFloat dash[]={3,3};[skinLine setLineDash:dash count:2 phase:0];skinLine.lineWidth=.8;[[NSColor colorWithRed:.92 green:.75 blue:.56 alpha:.85]setStroke];[skinLine moveToPoint:NSMakePoint(NSMidX(plot),NSMidY(plot))];[skinLine lineToPoint:skin];[skinLine stroke];
[@"肤色" drawAtPoint:NSMakePoint(skin.x-19,skin.y-10)withAttributes:text];float rgb[6][3]={{1,0,0},{1,0,1},{0,0,1},{0,1,1},{0,1,0},{1,1,0}};NSArray *names=@[@"R",@"Mg",@"B",@"Cy",@"G",@"Y"];for(int i=0;i<6;i++){float y=.2126f*rgb[i][0]+.7152f*rgb[i][1]+.0722f*rgb[i][2],cb=(rgb[i][2]-y)/1.8556f,cr=(rgb[i][0]-y)/1.5748f;NSPoint q=NSMakePoint(NSMidX(plot)+cb/1.2f*plot.size.width,NSMidY(plot)-cr/1.2f*plot.size.height);[[NSColor colorWithRed:rgb[i][0]*.65+.3 green:rgb[i][1]*.65+.3 blue:rgb[i][2]*.65+.3 alpha:1]setStroke];[[NSBezierPath bezierPathWithRect:NSMakeRect(q.x-2,q.y-2,4,4)]stroke];[names[i]drawAtPoint:NSMakePoint(q.x+3,q.y-5)withAttributes:text];}}
if(!_metadata){NSString *message=@"等待画面";[message drawAtPoint:NSMakePoint(NSMidX(plot)-20,NSMidY(plot)-6)withAttributes:text];}
}
@end
@interface DYColorWorkspace (){
@interface DYColorWorkspace () <NSTableViewDataSource,NSTableViewDelegate,NSSplitViewDelegate>{
id<PROAPIAccessing> _manager;
DYRenderer *_renderer;DYLUTLibrary *_library;DYLUTBrowser *_browser;
DYWorkspaceRoot *_root;NSView *_scopePane,*_lutPane;
DYScopePlot *_plot;
DYScopePlot *_plot;NSArray *_scopePlots;NSInteger _editorMode;
NSTextField *_heading,*_description,*_status,*_lutExplanation;
NSSegmentedControl *_pages;NSPopUpButton *_scopeMode;NSButton *_close,*_hostScopes;
NSButton *_close,*_hostScopes,*_sizeMode;
DYWorkspaceLifetime *_lifetime;
NSProgress *_selectionTask;
NSView *_remoteParent;NSWindow *_presentationWindow;
NSString *_title,*_lastError;
BOOL _visible,_opening,_closed,_closing;
BOOL _visible,_opening,_closed,_closing,_expanded;
NSUInteger _session,_selectionID;
NSView *_toolPane,*_editorHost,*_toolbar,*_maskPane;NSScrollView *_toolbarScroll,*_layerScroll,*_maskScroll,*_assignmentScroll;
NSSplitView *_split;NSTableView *_layerTable;DYInspector *_toolEditor;NSView<DYWorkspaceMaskEditing> *_maskEditor;
NSTextField *_selectionTitle;NSButton *_addMask,*_deleteLayer;
NSArray *_layerRows;NSDictionary *_toolDocument;NSString *_selectedNode,*_selectedMask,*_maskNode,*_editorNode;
id<PROAPIAccessing> _lutTarget;CMTime _toolTime;BOOL _refreshingStack,_sizingSplit,_hasUserSelection;CGFloat _splitFraction,_scopeFraction;
}
@end
@implementation DYColorWorkspace
#include "DYWorkspaceTools.inc.h"
- (instancetype)initWithManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer library:(DYLUTLibrary *)library title:(NSString *)title{
if((self=[super init])){
_manager=[manager retain];_renderer=[renderer retain];_library=[library retain];_title=[(title.length?title:@"大鱼调色")copy];_lifetime=[DYWorkspaceLifetime new];_lifetime.owner=self;
_root=[[DYWorkspaceRoot alloc]initWithFrame:NSMakeRect(0,0,1000,650)];_root.identifier=@"DYColorWorkspace";_root.owner=self;_root.accessibilityLabel=@"大鱼调色辅助工作区";
_heading=[[DYThemeLabel alloc]init];_heading.stringValue=[NSString stringWithFormat:@"%@ · 辅助工作区",_title];_heading.font=[NSFont systemFontOfSize:14 weight:NSFontWeightSemibold];[_root addSubview:_heading];
_pages=[[NSSegmentedControl alloc]init];_pages.segmentCount=2;[_pages setLabel:@"示波器" forSegment:0];[_pages setLabel:@"风格1 LUT" forSegment:1];_pages.selectedSegment=0;_pages.target=self;_pages.action=@selector(pageChanged:);_pages.accessibilityLabel=@"辅助工作区页面";[_root addSubview:_pages];
_close=[[DYThemeButton alloc]init];_close.title=@"关闭";_close.target=self;_close.action=@selector(closePressed:);_close.bezelStyle=NSBezelStyleRounded;[_root addSubview:_close];
_root=[[DYWorkspaceRoot alloc]initWithFrame:NSMakeRect(0,0,1120,360)];_root.identifier=@"DYColorWorkspace";_root.owner=self;_root.accessibilityLabel=@"大鱼调色控制面板";
_heading=[[DYThemeLabel labelWithString:@""]retain];_heading.stringValue=[NSString stringWithFormat:@"%@ · 辅助工作区",_title];_heading.font=[NSFont systemFontOfSize:14 weight:NSFontWeightSemibold];[_root addSubview:_heading];
_heading.hidden=YES;
_close=[DYWorkspaceButton(@"关闭",self,@selector(closePressed:))retain];_close.title=@"";_close.image=[NSImage imageWithSystemSymbolName:@"xmark" accessibilityDescription:@"关闭控制面板"];_close.imagePosition=NSImageOnly;[_root addSubview:_close];
_sizeMode=[DYWorkspaceButton(@"",self,@selector(toggleWorkspaceSize:))retain];_sizeMode.imagePosition=NSImageOnly;[_root addSubview:_sizeMode];
_scopePane=[[DYWorkspaceRoot alloc]init];_scopePane.clipsToBounds=YES;[_root addSubview:_scopePane];_lutPane=[[NSView alloc]init];[_root addSubview:_lutPane];_lutPane.hidden=YES;
_scopeMode=[[DYThemePopUpButton alloc]init];[_scopeMode addItemsWithTitles:@[@"亮度波形",@"RGB 分列",@"直方图"]];_scopeMode.target=self;_scopeMode.action=@selector(scopeModeChanged:);_scopeMode.accessibilityLabel=@"示波器类型";[_scopePane addSubview:_scopeMode];
_hostScopes=[[DYThemeButton alloc]init];_hostScopes.title=@"FCP 示波器";_hostScopes.bezelStyle=NSBezelStyleRounded;_hostScopes.target=self;_hostScopes.action=@selector(toggleHostScopes:);_hostScopes.toolTip=@"打开或关闭 Final Cut Pro 自带的视频示波器;下方是大鱼的显示参考示波器";[_scopePane addSubview:_hostScopes];
_description=[[DYThemeLabel alloc]init];_description.font=[NSFont systemFontOfSize:11];[_scopePane addSubview:_description];
_plot=[[DYScopePlot alloc]init];_plot.accessibilityRole=NSAccessibilityImageRole;[_scopePane addSubview:_plot];
_status=[[DYThemeLabel alloc]init];_status.font=[NSFont systemFontOfSize:11];_status.maximumNumberOfLines=3;_status.lineBreakMode=NSLineBreakByWordWrapping;[_scopePane addSubview:_status];
_lutExplanation=[[DYThemeLabel alloc]init];_lutExplanation.font=[NSFont systemFontOfSize:11];_lutExplanation.stringValue=[NSString stringWithFormat:@"应用位置:%@ · 风格1。缩略图以输入画面预览;示波器查看最终调色结果。",_title];[_root addSubview:_lutExplanation];_lutExplanation.hidden=YES;
_hostScopes=[DYWorkspaceButton(@"FCP",self,@selector(toggleHostScopes:))retain];_hostScopes.toolTip=@"切换宿主示波器";[_scopePane addSubview:_hostScopes];
_description=[[DYThemeLabel labelWithString:@"示波器 · 显示参考"]retain];_description.font=[NSFont systemFontOfSize:10];[_scopePane addSubview:_description];
NSMutableArray *plots=[NSMutableArray array];for(NSInteger i=0;i<4;i++){DYScopePlot *plot=[[[DYScopePlot alloc]init]autorelease];plot.mode=i;plot.accessibilityRole=NSAccessibilityImageRole;[_scopePane addSubview:plot];[plots addObject:plot];}_scopePlots=[plots copy];_plot=[_scopePlots[0]retain];
_status=[[DYThemeLabel labelWithString:@""]retain];_status.font=[NSFont systemFontOfSize:11];_status.maximumNumberOfLines=3;_status.lineBreakMode=NSLineBreakByWordWrapping;[_scopePane addSubview:_status];
_lutExplanation=[[DYThemeLabel labelWithString:@""]retain];_lutExplanation.font=[NSFont systemFontOfSize:11];_lutExplanation.stringValue=[NSString stringWithFormat:@"应用位置:%@ · 风格1。缩略图以输入画面预览;示波器查看最终调色结果。",_title];[_root addSubview:_lutExplanation];_lutExplanation.hidden=YES;
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(scopeChanged:) name:@"DYScopeDidChange" object:_renderer];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(previewChanged:) name:@"DYPreviewDidChange" object:_renderer];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:DYThemeDidChange object:nil];
[self buildToolWorkspace];
[self updatePalette];[self scopeChanged:nil];[self layoutWorkspace];
}return self;
}
- (void)dealloc{
[self close];_lifetime.owner=nil;[NSNotificationCenter.defaultCenter removeObserver:self];_root.owner=nil;
[_manager release];[_renderer release];[_library release];[_browser release];[_root release];[_scopePane release];[_lutPane release];[_plot release];[_heading release];[_description release];[_status release];[_lutExplanation release];[_pages release];[_scopeMode release];[_close release];[_hostScopes release];[_title release];[_lastError release];[_lifetime release];[super dealloc];
[_manager release];[_renderer release];[_library release];[_browser release];[_root release];[_scopePane release];[_lutPane release];[_plot release];[_scopePlots release];[_heading release];[_description release];[_status release];[_lutExplanation release];[_close release];[_hostScopes release];[_sizeMode release];[_title release];[_lastError release];[_lifetime release];
[_toolPane release];[_editorHost release];[_toolbar release];[_maskPane release];[_toolbarScroll release];[_layerScroll release];[_maskScroll release];[_assignmentScroll release];[_split release];[_layerTable release];[_toolEditor release];[_maskEditor release];[_selectionTitle release];[_addMask release];[_deleteLayer release];[_layerRows release];[_toolDocument release];[_selectedNode release];[_selectedMask release];[_maskNode release];[_editorNode release];[(id)_lutTarget release];[super dealloc];
}
- (BOOL)visible{return _visible||_opening;}
- (NSString *)lastError{return _lastError;}
@@ -122,9 +153,11 @@
id<FxRemoteWindowAPI_v3> v3=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];id<FxRemoteWindowAPI_v2> sizable=v3?:[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v2)];id<FxRemoteWindowAPI> remote=sizable?:[_manager apiForProtocol:@protocol(FxRemoteWindowAPI)];
void(^reply)(FxXPView *,NSError *)=^(FxXPView *parent,NSError *error){void(^attach)(void)=^{DYColorWorkspace *owner=token.owner;if(!owner||owner->_closed||owner->_session!=session)return;owner->_opening=NO;
if(!parent){[owner reportError:error.localizedDescription?:@"宿主未能创建辅助窗口"];return;}[owner attachToParent:parent];
};if(NSThread.isMainThread)attach();else dispatch_sync(dispatch_get_main_queue(),attach);};
if(sizable)[sizable remoteWindowWithMinimumSize:NSMakeSize(760,520) maximumSize:NSMakeSize(1800,1200) reply:reply];
else if(remote)[remote remoteWindowOfSize:NSMakeSize(1000,650) reply:reply];
};/* FxPlug reads the first child size immediately after reply returns; retain the verified synchronous attach contract (BrowserMoreSpace1.7.3). */if(NSThread.isMainThread)attach();else dispatch_sync(dispatch_get_main_queue(),attach);};
// FCP initially uses the requested maximum. Keep the default a narrow strip;
// larger LUT/mask layouts are an explicit choice, without moving host windows.
if(sizable)[sizable remoteWindowWithMinimumSize:NSMakeSize(840,300) maximumSize:_expanded?NSMakeSize(2400,1200):NSMakeSize(1440,360) reply:reply];
else if(remote)[remote remoteWindowOfSize:NSMakeSize(1120,360) reply:reply];
else{_opening=NO;[self reportError:@"当前宿主未提供外部工具窗口接口"];}
}@finally{[action endAction:self];}
}
@@ -132,7 +165,7 @@
if(_remoteParent!=parent){if(_remoteParent)for(NSNotificationName name in @[NSViewFrameDidChangeNotification,NSViewBoundsDidChangeNotification])[NSNotificationCenter.defaultCenter removeObserver:self name:name object:_remoteParent];_remoteParent=parent;
parent.postsFrameChangedNotifications=YES;parent.postsBoundsChangedNotifications=YES;for(NSNotificationName name in @[NSViewFrameDidChangeNotification,NSViewBoundsDidChangeNotification])[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(parentChanged:) name:name object:parent];
}
[_root removeFromSuperview];_root.frame=parent.bounds;_root.autoresizingMask=NSViewWidthSizable|NSViewHeightSizable;[parent addSubview:_root];_visible=YES;_root.hidden=NO;[_renderer setScopeEnabled:_pages.selectedSegment==0];[self scopeChanged:nil];[self parentChanged:nil];
[_root removeFromSuperview];_root.frame=parent.bounds;_root.autoresizingMask=NSViewWidthSizable|NSViewHeightSizable;[parent addSubview:_root];_visible=YES;_root.hidden=NO;[self refreshToolWorkspace:nil];[self pageChanged:nil];[self parentChanged:nil];
DYWorkspaceLifetime *token=_lifetime;NSUInteger session=_session;dispatch_async(dispatch_get_main_queue(),^{DYColorWorkspace *owner=token.owner;if(!owner||owner->_closed||owner->_session!=session)return;NSWindow *window=owner->_root.window;
if(window!=owner->_presentationWindow){if(owner->_presentationWindow)[NSNotificationCenter.defaultCenter removeObserver:owner name:NSWindowWillCloseNotification object:owner->_presentationWindow];[owner->_presentationWindow release];owner->_presentationWindow=[window retain];if(window)[NSNotificationCenter.defaultCenter addObserver:owner selector:@selector(remoteClosed:) name:NSWindowWillCloseNotification object:window];}
[owner parentChanged:nil];
@@ -145,47 +178,54 @@
}
- (void)layoutWorkspace{
CGFloat w=_root.bounds.size.width,h=_root.bounds.size.height;
_heading.frame=NSMakeRect(18,14,MAX(100,w-360),23);_pages.frame=NSMakeRect(MAX(150,w-320),12,228,27);_close.frame=NSMakeRect(MAX(0,w-80),12,64,27);
_scopePane.frame=NSMakeRect(0,52,w,MAX(1,h-52));_lutPane.frame=NSMakeRect(0,80,w,MAX(1,h-80));_lutExplanation.frame=NSMakeRect(18,52,MAX(1,w-36),24);
CGFloat ph=_scopePane.bounds.size.height;_scopeMode.frame=NSMakeRect(18,0,160,27);_hostScopes.frame=NSMakeRect(184,0,122,27);_description.frame=NSMakeRect(320,4,MAX(1,w-338),22);_plot.frame=NSMakeRect(18,39,MAX(1,w-36),MAX(1,ph-114));_status.frame=NSMakeRect(18,MAX(40,ph-64),MAX(1,w-36),58);
_heading.hidden=YES;_toolbarScroll.frame=NSMakeRect(6,3,MAX(1,w-78),30);_sizeMode.frame=NSMakeRect(MAX(0,w-68),3,26,27);_close.frame=NSMakeRect(MAX(0,w-34),3,26,27);
_sizeMode.image=[NSImage imageWithSystemSymbolName:_expanded?@"arrow.down.right.and.arrow.up.left":@"arrow.up.left.and.arrow.down.right" accessibilityDescription:_expanded?@"收为窄条":@"扩大工作区"];_sizeMode.accessibilityLabel=_expanded?@"收为窄条":@"扩大工作区";_sizeMode.toolTip=_sizeMode.accessibilityLabel;_sizeMode.contentTintColor=DYThemeColor(@"text");
_sizingSplit=YES;_split.frame=NSMakeRect(0,36,w,MAX(1,h-36));_sizingSplit=NO;[self layoutToolWorkspace];
_lutPane.frame=_editorHost.bounds;_lutExplanation.hidden=YES;
CGFloat sw=_scopePane.bounds.size.width,sh=_scopePane.bounds.size.height;_description.frame=NSMakeRect(8,3,MAX(1,sw-50),19);_hostScopes.frame=NSMakeRect(sw-40,1,34,21);_status.hidden=YES;
CGFloat gap=4,pw=MAX(1,(sw-12-gap)/2),ph=MAX(1,(sh-30-gap)/2);for(NSUInteger i=0;i<_scopePlots.count;i++)[_scopePlots[i]setFrame:NSMakeRect(6+(i%2)*(pw+gap),26+(i/2)*(ph+gap),pw,ph)];
}
- (void)pageChanged:(id)sender{
BOOL lut=_pages.selectedSegment==1;_scopePane.hidden=lut;_lutPane.hidden=!lut;_lutExplanation.hidden=!lut;[_renderer setScopeEnabled:_visible&&!lut];if(lut)[self ensureBrowser];else[self scopeChanged:nil];
if(_editorMode==2)[self bindLUTTarget];_scopePane.hidden=NO;_lutPane.hidden=_editorMode!=2;_lutExplanation.hidden=YES;_toolEditor.hidden=_editorMode!=0;_maskPane.hidden=_editorMode!=1;_selectionTitle.hidden=_editorMode==2;
CMTime displayTime=_toolTime;id<FxCustomParameterActionAPI_v4>action=[self actionAPI];if(_visible&&!_renderer.scopeEnabled&&action){[action startAction:self];@try{
displayTime=DYHostDisplayedFrameTime([self rootHost],_toolTime);if(CMTimeCompare(displayTime,_toolTime)!=0)os_log(OS_LOG_DEFAULT,"dayu_scope_end_boundary requested=%{public}.9f display=%{public}.9f",CMTimeGetSeconds(_toolTime),CMTimeGetSeconds(displayTime));
}@finally{[action endAction:self];}}
[_renderer setScopeEnabled:_visible atTime:displayTime];if(_editorMode==2)[self ensureBrowser];[self scopeChanged:nil];[self layoutWorkspace];
}
- (void)toggleHostScopes:(id)sender{
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];NSError *error=nil;BOOL done=NO;if(action){[action startAction:self];@try{id<FxCommandAPI> commands=[_manager apiForProtocol:@protocol(FxCommandAPI)];done=[commands performCommand:kFxCommand_ToggleWaveforms error:&error];}@finally{[action endAction:self];}}
if(!done)[self reportError:error.localizedDescription?:@"当前宿主无法切换 FCP 示波器"];
}
- (void)scopeModeChanged:(id)sender{_plot.mode=_scopeMode.indexOfSelectedItem;}
- (void)scopeChanged:(NSNotification *)notification{
if(notification&&!_visible)return;NSDictionary *data=[_renderer scopeMetadata];_plot.metadata=data;
if(notification&&!_visible)return;NSDictionary *data=[_renderer scopeMetadata];for(DYScopePlot *plot in _scopePlots)plot.metadata=data;
_description.toolTip=data?[NSString stringWithFormat:@"宿主输出配置:%@\n%@",data[@"source"],data[@"note"]]:nil;
_description.stringValue=data?[NSString stringWithFormat:@"%@ · %@ · 320 × 180",data[@"domain"],data[@"region"]]:@"最终输出 · 等待宿主渲染";
_description.stringValue=data?data[@"domain"]:@"示波器 · 显示参考";for(DYScopePlot *plot in _scopePlots)plot.toolTip=data[@"note"]?:@"当前效果最终输出 · 显示参考";
if(data){double t=[data[@"time"]doubleValue];NSString *frame=std::isfinite(t)?[NSString stringWithFormat:@"%.3f 秒",t]:@"静帧";
_status.stringValue=[NSString stringWithFormat:@"%@\n%@ · 有效 %@ · 透明 %@ · 非有限 %@ · 超出 −10%%/110%% %@/%@",([data[@"converted"]boolValue]?@"最终画面 · sRGB 显示参考;非 HDR / IRE 精密测量":@"空间未知:显示宿主 RGB 数值参考;不用于 HDR / IRE 测量"),frame,data[@"valid"],data[@"transparent"],data[@"nonfinite"],data[@"below"],data[@"above"]];
}else _status.stringValue=@"示波器采集当前效果的最终输出。播放、移动时间线或调整颜色后更新;透明像素不计入。";
}
- (void)previewChanged:(NSNotification *)notification{if(_visible&&_pages.selectedSegment==1)[_browser updatePreview:[_renderer lookLUTPreview]];}
- (void)previewChanged:(NSNotification *)notification{if(_visible&&_editorMode==2)[_browser updatePreview:[_renderer lookLUTPreview]];}
- (void)themeChanged:(NSNotification *)notification{[self updatePalette];}
- (void)updatePalette{
[_root setNeedsDisplay:YES];for(NSTextField *label in @[_heading,_description,_status,_lutExplanation])label.textColor=DYThemeColor(label==_heading?@"text":@"secondary");[_browser updatePalette:DYThemePalette()];
[_root setNeedsDisplay:YES];for(NSTextField *label in @[_heading,_description,_status,_lutExplanation])label.textColor=DYThemeColor(label==_heading?@"text":@"secondary");[_browser updatePalette:DYWorkspacePalette()];
}
- (void)ensureBrowser{
if(_browser.visible)return;[_browser release];_browser=nil;id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action){[self reportError:@"宿主暂时无法读取风格1"];return;}
NSString *selected=nil;[action startAction:self];@try{selected=[DYReadAssets(_manager,action.currentTime).paths[@"look0"]copy];}@finally{[action endAction:self];}
if(_browser.visible)return;[_browser release];_browser=nil;id<FxCustomParameterActionAPI_v4> action=[[self lutManager] apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!action){[self reportError:@"宿主暂时无法读取风格1"];return;}
NSString *selected=nil;[action startAction:self];@try{selected=[DYReadAssets([self lutManager],action.currentTime).paths[@"look0"]copy];}@finally{[action endAction:self];}
DYWorkspaceLifetime *token=_lifetime;
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYThemePalette() selection:^NSProgress *(NSString *path,void(^completion)(NSError *)){DYColorWorkspace *owner=token.owner;if(owner&&!owner->_closed)return [owner selectLUT:path completion:completion];if(completion)completion([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]);return nil;}];[selected release];
[_browser embedInView:_lutPane close:^{DYColorWorkspace *owner=token.owner;if(owner&&!owner->_closing&&!owner->_closed){owner->_pages.selectedSegment=0;[owner pageChanged:nil];}}];
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYWorkspacePalette() selection:^NSProgress *(NSString *path,void(^completion)(NSError *)){DYColorWorkspace *owner=token.owner;if(owner&&!owner->_closed)return [owner selectLUT:path completion:completion];if(completion)completion([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]);return nil;}];[selected release];
[_browser embedInView:_lutPane close:^{DYColorWorkspace *owner=token.owner;if(owner&&!owner->_closing&&!owner->_closed){owner->_editorMode=0;[owner pageChanged:nil];}}];
}
- (NSDictionary *)selectionContextAtTime:(CMTime)time{
id<PROAPIAccessing> host=[_manager isKindOfClass:DYToolManager.class]?[(DYToolManager*)_manager host]:_manager;
DYAssetState *local=DYReadAssets(_manager,time),*global=DYReadAssets(host,time);DYUniforms uniforms;DYReadUniforms(host,time,&uniforms);
id<PROAPIAccessing> host=[[self lutManager] isKindOfClass:DYToolManager.class]?[(DYToolManager*)[self lutManager] host]:[self lutManager];
DYAssetState *local=DYReadAssets([self lutManager],time),*global=DYReadAssets(host,time);DYUniforms uniforms;DYReadUniforms(host,time,&uniforms);
NSMutableDictionary *cm=[NSMutableDictionary dictionary];for(NSDictionary *descriptor in DYDescriptors()){NSString *key=descriptor[@"key"];NSInteger offset=[descriptor[@"offset"]integerValue];if(offset>=0&&([key hasPrefix:@"cm"]||[key isEqual:@"inputProfile"]||[key isEqual:@"inputSectionEnabled"]))cm[key]=@(*(float*)((uint8_t*)&uniforms+offset));}
NSDictionary *state=@{@"look":local.paths[@"look0"]?:NSNull.null,@"colorManagement":global.colorManagement?:NSNull.null,@"inputPath":global.paths[@"input"]?:NSNull.null,@"colorParameters":cm};
return @{@"time":[NSData dataWithBytes:&time length:sizeof(time)],@"state":state};
}
- (NSDictionary *)selectionContext{
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return nil;NSDictionary *context=nil;[action startAction:self];@try{context=[[self selectionContextAtTime:action.currentTime]copy];}@finally{[action endAction:self];}return [context autorelease];
id<FxCustomParameterActionAPI_v4> action=[[self lutManager] apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!action)return nil;NSDictionary *context=nil;[action startAction:self];@try{context=[[self selectionContextAtTime:action.currentTime]copy];}@finally{[action endAction:self];}return [context autorelease];
}
- (NSProgress *)selectLUT:(NSString *)path completion:(void(^)(NSError *))completion{
[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;NSUInteger selection=++_selectionID,session=_session;DYWorkspaceLifetime *token=_lifetime;NSDictionary *expected=[self selectionContext];
@@ -200,31 +240,33 @@
if(path.length&&(!path.isAbsolutePath||![[path.pathExtension lowercaseString]isEqual:@"cube"])){
if(error)*error=[NSError errorWithDomain:@"com.dayu.color.workspace" code:1 userInfo:@{NSLocalizedDescriptionKey:@"LUT 必须是完整路径的 .cube 文件,原来的选择已保留"}];return NO;
}
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];BOOL written=NO;NSString *failure=nil;if(!action)failure=@"宿主暂时无法应用 LUT,请重新选择当前效果后重试";
else{id<FxCustomParameterActionAPI_v4> outer=[_manager isKindOfClass:DYToolManager.class]?[[(DYToolManager*)_manager host]apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]:nil;
id<FxCustomParameterActionAPI_v4> action=[[self lutManager] apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];BOOL written=NO;NSString *failure=nil;if(!action)failure=@"宿主暂时无法应用 LUT,请重新选择当前效果后重试";
else{id<FxCustomParameterActionAPI_v4> outer=[[self lutManager] isKindOfClass:DYToolManager.class]?[[(DYToolManager*)[self lutManager] host]apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]:nil;
if(outer)[outer startAction:self];[action startAction:self];id<FxUndoAPI> undo=nil;BOOL grouped=NO;NSDictionary *wantedPaths=nil;CMTime commitTime=kCMTimeInvalid;@try{
CMTime time=action.currentTime,original=kCMTimeInvalid;NSData *encodedTime=expected[@"time"];if(encodedTime.length==sizeof(original))memcpy(&original,encodedTime.bytes,sizeof(original));
if(!CMTIME_IS_NUMERIC(time)||!CMTIME_IS_NUMERIC(original)||CMTimeCompare(time,original)!=0)failure=@"播放头已改变,未将先前的 LUT 选择写到新画面;请重新选择";
else if(![[self selectionContextAtTime:time][@"state"]isEqual:expected[@"state"]])failure=@"载入期间风格1或色彩管理已改变,已保留最新设置;请重新选择 LUT";
if(!failure&&[_manager isKindOfClass:DYToolManager.class]){DYToolManager *node=(DYToolManager*)_manager;if(![node.type isEqual:@"look"]||!DYToolWithID(DYReadTools(node.host,time).document,node.nodeID)){failure=@"此风格图层已删除或不再可编辑,未修改其它图层";}}
if(!failure&&![_manager isKindOfClass:DYToolManager.class]&&DYBaseToolRemoved(DYReadTools(_manager,time).document,@"look"))failure=@"基础风格工具已移除,请先恢复风格工具;未修改其它图层";
if(!failure){DYAssetState *assets=[[DYReadAssets(_manager,time)copy]autorelease];if(!assets)assets=[[[DYAssetState alloc]init]autorelease];NSMutableDictionary *paths=[[assets.paths mutableCopy]autorelease]?:[NSMutableDictionary dictionary];if(path.length)paths[@"look0"]=path;else[paths removeObjectForKey:@"look0"];assets.paths=paths;
wantedPaths=assets.paths;commitTime=time;undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];grouped=[undo startUndoGroup:@"选择风格1 LUT"];written=DYWriteAssets(_manager,assets,time);if(!written)failure=@"宿主未接受此 LUT,原来的选择已保留";
if(!failure&&[[self lutManager] isKindOfClass:DYToolManager.class]){DYToolManager *node=(DYToolManager*)[self lutManager];if(![node.type isEqual:@"look"]||!DYToolWithID(DYReadTools(node.host,time).document,node.nodeID)){failure=@"此风格图层已删除或不再可编辑,未修改其它图层";}}
if(!failure&&![[self lutManager] isKindOfClass:DYToolManager.class]&&DYBaseToolRemoved(DYReadTools([self lutManager],time).document,@"look"))failure=@"基础风格工具已移除,请先恢复风格工具;未修改其它图层";
if(!failure){DYAssetState *assets=[[DYReadAssets([self lutManager],time)copy]autorelease];if(!assets)assets=[[[DYAssetState alloc]init]autorelease];NSMutableDictionary *paths=[[assets.paths mutableCopy]autorelease]?:[NSMutableDictionary dictionary];if(path.length)paths[@"look0"]=path;else[paths removeObjectForKey:@"look0"];assets.paths=paths;
wantedPaths=assets.paths;commitTime=time;undo=[[self lutManager] apiForProtocol:@protocol(FxUndoAPI)];grouped=[undo startUndoGroup:@"选择风格1 LUT"];written=DYWriteAssets([self lutManager],assets,time);if(!written)failure=@"宿主未接受此 LUT,原来的选择已保留";
}
}@finally{if(outer){[action endAction:self];
// DYToolManager stages custom assets and commits its host document in
// endAction. Its earlier setter BOOL does not report that final write.
// Read the actual target while the outer host action still grants access.
if(written){DYToolManager *node=(DYToolManager*)_manager;NSDictionary *stored=DYToolWithID(DYReadTools(node.host,commitTime).document,node.nodeID);if(!stored||![stored[@"paths"]isEqual:wantedPaths]){written=NO;failure=@"宿主未保存此风格图层的 LUT,原来的选择已保留;请重试";}}
if(written){DYToolManager *node=(DYToolManager*)[self lutManager];NSDictionary *stored=DYToolWithID(DYReadTools(node.host,commitTime).document,node.nodeID);if(!stored||![stored[@"paths"]isEqual:wantedPaths]){written=NO;failure=@"宿主未保存此风格图层的 LUT,原来的选择已保留;请重试";}}
if(grouped)[undo endUndoGroup];[outer endAction:self];}else{if(grouped)[undo endUndoGroup];[action endAction:self];}}}
if(written){if(path.length)[_library recordUsedPath:path];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:[_manager isKindOfClass:DYToolManager.class]?[(DYToolManager*)_manager host]:_manager];}
if(written){if(path.length)[_library recordUsedPath:path];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:[[self lutManager] isKindOfClass:DYToolManager.class]?[(DYToolManager*)[self lutManager] host]:[self lutManager]];}
else if(error)*error=[NSError errorWithDomain:@"com.dayu.color.workspace" code:1 userInfo:@{NSLocalizedDescriptionKey:failure?:@"LUT 操作未完成"}];return written;
}
- (void)closePressed:(id)sender{[self close];}
- (void)toggleWorkspaceSize:(id)sender{BOOL expanded=!_expanded;[self close];_expanded=expanded;[self showRelativeToView:nil];}
- (void)remoteClosed:(NSNotification *)notification{_closing=YES;[self close];_closing=NO;}
- (void)close{
if(_closed)return;BOOL hadPresentation=_visible||_opening||_remoteParent;_closed=YES;_visible=NO;_opening=NO;_session++;_selectionID++;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;[_renderer setScopeEnabled:NO];
BOOL wasClosing=_closing;_closing=YES;[_browser close];[_browser release];_browser=nil;
[_toolEditor removeFromSuperview];[_toolEditor release];_toolEditor=nil;[_editorNode release];_editorNode=nil;_maskScroll.documentView=nil;[_maskEditor release];_maskEditor=nil;[_maskNode release];_maskNode=nil;
if(_remoteParent)for(NSNotificationName name in @[NSViewFrameDidChangeNotification,NSViewBoundsDidChangeNotification])[NSNotificationCenter.defaultCenter removeObserver:self name:name object:_remoteParent];_remoteParent=nil;
if(_presentationWindow)[NSNotificationCenter.defaultCenter removeObserver:self name:NSWindowWillCloseNotification object:_presentationWindow];[_presentationWindow release];_presentationWindow=nil;[_root removeFromSuperview];
if(hadPresentation&&!wasClosing){id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(action){[action startAction:self];@try{id<FxRemoteWindowAPI_v3> api=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];[api closeRemoteWindow];}@finally{[action endAction:self];}}}_closing=wasClosing;
@@ -4,8 +4,18 @@
DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host]autorelease];[view refresh];[view setFrameSize:NSMakeSize(400,780)];[view layoutSubtreeIfNeeded];
NSButton *settings=[view valueForKey:@"colorSettings"];NSView *panel=[view valueForKey:@"managedPanel"];NSArray *cards=[view valueForKey:@"cards"];NSView *first=cards.firstObject[@"view"];
run.record(@"compact-color-settings-hidden-without-gap",panel.hidden&&first.frame.origin.y==8&&[settings.accessibilityLabel isEqual:@"颜色设置"]);
CGFloat foldedHeight=view.intrinsicContentSize.height;
NSView *hostSlot=[[[NSView alloc]initWithFrame:NSMakeRect(0,0,400,406)]autorelease];
view.frame=hostSlot.bounds;[hostSlot addSubview:view];
NSDictionary *values=[[host->_values copy]autorelease],*custom=[[host->_custom copy]autorelease];int starts=host->_undoStarts,ends=host->_undoEnds;
[settings performClick:nil];[view layoutSubtreeIfNeeded];run.record(@"compact-color-settings-button-expands-panel",!panel.hidden&&first.frame.origin.y>=NSMaxY(panel.frame)+12&&settings.state==NSControlStateValueOn);
run.record(@"inspector-preferred-height-follows-content-with-a-scroll-cap",foldedHeight<780&&view.intrinsicContentSize.height>foldedHeight&&view.intrinsicContentSize.height<=780);
double layoutDeadline=NSProcessInfo.processInfo.systemUptime+.02;
while(NSProcessInfo.processInfo.systemUptime<layoutDeadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.002]];
NSView *brandLabel=[view valueForKey:@"brand"];NSScrollView *cardsScroll=[view valueForKey:@"scroll"];
run.record(@"inspector-hosted-slot-keeps-header-visible-and-scrolls-only-overflow",NSEqualRects(view.frame,hostSlot.bounds)&&NSContainsRect(view.bounds,brandLabel.frame)&&cardsScroll.documentView.frame.size.height>cardsScroll.contentSize.height);
for(int i=0;i<9;i++){[settings performClick:nil];[view layoutSubtreeIfNeeded];}
run.record(@"compact-color-settings-repeated-toggle-does-not-edit-grade",panel.hidden&&first.frame.origin.y==8&&[values isEqual:host->_values]&&[custom isEqual:host->_custom]&&starts==host->_undoStarts&&ends==host->_undoEnds);
for(NSDictionary *state in @[@{},DYManagedColorDefaults(),DYPrimaryColorDefaults()]){
@@ -58,11 +68,14 @@
BOOL totals=YES;for(int c=0;c<4;c++){uint32_t total=0;for(int b=0;b<256;b++)total+=h->bins[c][b];totals&=total==6;}
run.record(@"histogram-each-channel-conserves-valid-samples",totals);
run.record(@"histogram-malformed-and-empty-safe",!DYHistogramFromRGBA([NSData dataWithBytes:pixels length:3])&&((const DYHistogram*)DYHistogramFromRGBA([NSData data]).bytes)->samples==0);
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];[renderer setValue:data forKey:@"histogram"];
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];
DYScopeSample *sample=[[[DYScopeSample alloc]init]autorelease];sample.pixels=input;[renderer setValue:sample forKey:@"scopeLatest"];
DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host renderer:renderer]autorelease];[view refresh];NSDictionary *before=[view presetSnapshot];
for(NSMutableDictionary *card in [view valueForKey:@"cards"])if([card[@"section"][@"key"]isEqual:@"curve"]){card[@"removed"]=@NO;card[@"collapsed"]=@NO;}
[view setNeedsLayout:YES];[view layoutSubtreeIfNeeded];
NSView *graph=nil;for(NSView *v in [view valueForKey:@"graphics"])if([v.identifier isEqual:@"curveGraph"])graph=v;
NSButton *toggle=[graph valueForKey:@"histogramToggle"];NSSegmentedControl *channels=[graph valueForKey:@"channels"];
run.record(@"histogram-new-inspector-uses-renderer-cached-snapshot",[[graph valueForKey:@"histogram"]isEqual:data]&&toggle.state==NSControlStateValueOn);
run.record(@"histogram-open-inspector-uses-cached-effect-output",[[graph valueForKey:@"histogram"]isEqual:data]&&toggle.state==NSControlStateValueOn);
NSMutableSet *images=[NSMutableSet set];
for(NSInteger c=0;c<4;c++){
channels.selectedSegment=c;[graph performSelector:@selector(channelChanged:) withObject:channels];[graph setFrameSize:NSMakeSize(320,240)];[graph layoutSubtreeIfNeeded];
@@ -72,8 +85,16 @@
[toggle performClick:nil];[toggle performClick:nil];
run.record(@"histogram-four-channel-drawings-distinct",images.count==4);
run.record(@"histogram-channel-and-overlay-presentation-does-not-edit-grade",[before isEqual:[view presetSnapshot]]&&host->_undoStarts==0&&host->_undoEnds==0);
[renderer invalidatePreview];[view performSelector:@selector(previewChanged:) withObject:nil];
run.record(@"histogram-invalidation-clears-view-and-renderer",![renderer histogram]&&![graph valueForKey:@"histogram"]);
[renderer invalidatePreview];
run.record(@"histogram-keeps-final-output-while-a-new-render-is-pending",[[graph valueForKey:@"histogram"]isEqual:data]);
DYDiagnosticTile *updated=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:2 height:2]autorelease];
const __fp16 colors[16]={.25f,.4f,.6f,1,.25f,.4f,.6f,1,.25f,.4f,.6f,1,.25f,.4f,.6f,1};
[[updated metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,2,2)mipmapLevel:0 withBytes:colors bytesPerRow:16];
[renderer captureScopeTile:updated atTime:kCMTimeZero];
double until=NSProcessInfo.processInfo.systemUptime+1;
while([[graph valueForKey:@"histogram"]isEqual:data]&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];
NSData *latest=[graph valueForKey:@"histogram"];
run.record(@"histogram-open-inspector-refreshes-after-a-new-output-at-the-same-time",latest.length==sizeof(DYHistogram)&&![latest isEqual:data]&&[latest isEqual:[renderer canvasHistogramAtTime:kCMTimeZero]]);
NSInteger previous=DYThemeIndex();DYSetThemeIndex(8);
run.record(@"relief-only-two-choices-and-no-text-glow",DYThemeNames().count==2&&DYThemeTextShadow()==nil&&![DYThemePalette()[@"background"]isEqual:DYThemePalette()[@"backgroundEnd"]]);
DYSetThemeIndex(previous);
+16
查看文件
@@ -1,3 +1,5 @@
#import "DYScopeSample.h"
#include "DYScopeDisplayTime.h"
#import "DYHistogram.h"
#include "DYFilmMath.h"
#include "DYFilmTime.h"
@@ -7,6 +9,7 @@
#import "DYManagedColor.h"
#import "../../ColorManagement/Sources/DYColorProfile.h"
#import "DYAutoGrade.h"
#import "DYColorTables.h"
#import "DYLUTLibrary.h"
#import "DYLUTBrowser.h"
#import "DYInspector.h"
@@ -42,6 +45,8 @@
- (void)removeTool:(NSButton *)sender;
- (void)addModule:(NSMenuItem *)sender;
- (NSDictionary *)presetSnapshot;
- (void)graphicGesture:(BOOL)begin title:(NSString *)title;
- (void)writeGraphicValues:(NSDictionary *)values;
@end
@protocol DYSpiderProbe
@property(nonatomic,copy) NSData *meshData;
@@ -247,6 +252,16 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[serviceContent setFrameOrigin:NSMakePoint(123,77)];
run.record(@"browser-remote-later-content-origin-is-repaired",NSEqualRects([serviceRoot convertRect:serviceRoot.bounds toView:nil],serviceViewport));
run.record(@"browser-remote-origin-repair-keeps-host-frame-and-hidden-fixture",NSEqualRects(serviceGeometry.frame,serviceFrame)&&!serviceGeometry.visible);[serviceBrowser close];
NSString *recentA=[geometryLibrary.rootURL.path stringByAppendingPathComponent:@"first.cube"],*recentB=[geometryLibrary.rootURL.path stringByAppendingPathComponent:@"second.cube"];
[geometryLibrary recordUsedPath:recentA];[geometryLibrary recordUsedPath:recentB];
NSString *fullFolderKey=[@"com.dayu.color.lookLUTPreview.selectedFolder|" stringByAppendingString:geometryLibrary.rootURL.path];
[NSUserDefaults.standardUserDefaults setObject:@"*" forKey:fullFolderKey];id originalFolder=[NSUserDefaults.standardUserDefaults objectForKey:fullFolderKey];
NSView *recentParent=[[[NSView alloc]initWithFrame:NSMakeRect(0,0,424,150)]autorelease];
DYLUTBrowser *recentBrowser=[[[DYLUTBrowser alloc]initWithLibrary:geometryLibrary preview:nil selectedPath:recentA palette:@{} selection:nil]autorelease];[recentBrowser embedRecentInView:recentParent];
NSView *recentRoot=[recentBrowser valueForKey:@"root"];NSScrollView *recentGrid=[recentBrowser valueForKey:@"gridScroll"];
run.record(@"recent-lut-shortcuts-reuse-adaptive-grid-without-browser-chrome",recentBrowser.visible&&recentGrid.superview==recentRoot&&NSContainsRect(recentRoot.bounds,recentGrid.frame)&&!recentGrid.hasHorizontalScroller&&[(NSView*)[recentBrowser valueForKey:@"splitView"]isHidden]&&[(NSView*)[recentBrowser valueForKey:@"search"]isHidden]);
[geometryLibrary recordUsedPath:recentA];[recentBrowser refreshRecentSelection:recentA];NSArray *recentEntries=[recentBrowser valueForKey:@"visibleEntries"];
run.record(@"recent-lut-refresh-follows-acknowledged-history-and-preserves-browser-preference",recentEntries.count==2&&[recentEntries[0][@"path"]isEqual:recentA]&&(!originalFolder?[NSUserDefaults.standardUserDefaults objectForKey:fullFolderKey]==nil:[originalFolder isEqual:[NSUserDefaults.standardUserDefaults objectForKey:fullFolderKey]]));[recentBrowser close];
for(NSString *key in NSUserDefaults.standardUserDefaults.dictionaryRepresentation.allKeys)if([key containsString:geometryLibrary.rootURL.path])[NSUserDefaults.standardUserDefaults removeObjectForKey:key];
DYDiagnosticManager *uiHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(uiHost,nil);
DYInspector *inspector=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[inspector refresh];
@@ -501,6 +516,7 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
run.record(@"user-folder-all-luts-prepared-and-rendered",userCount>0&&allUserFrames,@{@"files":@(userCount),@"sourceFolder":userFolder,@"sourceFilesModified":@NO});
}
#include "DYToolDiagnostics.inc.h"
#include "DYSharedMaskDiagnostics.inc.h"
#include "DYWorkspaceDiagnostics.inc.h"
#include "DYToolInsertionDiagnostics.inc.h"
#include "DYToolDeletionDiagnostics.inc.h"
+30
查看文件
@@ -346,3 +346,33 @@ kernel void dyLensRepair(texture2d<float> source [[texture(0)]],texture2d<float,
if(p.x>=output.get_width()||p.y>=output.get_height())return;float2 uv=(float2(p)+.5f)/float2(output.get_width(),output.get_height()),center=float2(u.lensCenterX,u.lensCenterY);float2 q=(uv-center)/max(1.f,u.lensScale),metric=q*float2(aspect,1);float2 corner=max(center,1-center)*float2(aspect,1);float radius=dot(metric,metric)/max(1e-6f,dot(corner,corner));float2 sample=center+q*(1+clamp(u.lensStrength,-100.f,100.f)*.0025f*radius);
constexpr sampler f(coord::normalized,address::clamp_to_zero,filter::linear);output.write(source.sample(f,sample),p);
}
kernel void dyCloneStamps(texture2d<float,access::read> input [[texture(0)]],
texture2d<float,access::write> output [[texture(1)]],
constant DYCloneStamp *stamps [[buffer(0)]],
constant uint &count [[buffer(1)]],
constant uint &flip [[buffer(2)]],
uint2 gid [[thread_position_in_grid]]) {
uint2 size(output.get_width(),output.get_height());
if(any(gid>=size))return;
float2 uv=(float2(gid)+.5f)/float2(size);
if(flip)uv.y=1-uv.y;
float4 color=input.read(gid);
for(uint i=0;i<count;i++){
constant DYCloneStamp &stamp=stamps[i];
float2 center=float2(stamp.centerX,stamp.centerY);
float2 local=(uv-center)*float2(stamp.inverseRadiusX,stamp.inverseRadiusY);
float radiusSquared=dot(local,local);
if(radiusSquared>1)continue;
// A single integer-pixel offset preserves scale, orientation and sample values.
float2 offset=(float2(stamp.sourceX,stamp.sourceY)-center)*float2(size);
if(flip)offset.y=-offset.y;
int2 source=int2(gid)+int2(round(offset));
if(any(source<0)||any(source>=int2(size)))continue;
float coverage=stamp.feather>0?1-smoothstep(1-stamp.feather,1.f,sqrt(radiusSquared)):1;
coverage=saturate((coverage-stamp.inputBlack)/(stamp.inputWhite-stamp.inputBlack));
if(stamp.inputGamma!=1)coverage=pow(coverage,1/stamp.inputGamma);
color=mix(color,input.read(uint2(source)),coverage*stamp.strength);
}
output.write(color,gid);
}
+7 -6
查看文件
@@ -3,21 +3,22 @@
#include <cmath>
#include <cstdint>
// Immutable renderer-owned snapshot. Channel 0 is Rec.709 luma of the existing
// display-encoded analysis samples, not scene-linear luminance or an HDR scope.
// Immutable renderer-owned snapshot. Channel 0 uses Rec.709 weights in the
// supplied RGB domain.
struct DYHistogram {
uint32_t bins[4][256]{};
uint32_t samples=0;
};
static inline NSData *DYHistogramFromRGBA(NSData *rgba) {
static inline NSData *DYHistogramFromRGBA(NSData *rgba, bool premultiplied=false) {
DYHistogram h;
if(rgba.length%sizeof(float[4]))return nil;
const float *p=(const float *)rgba.bytes;
auto bin=[](double v){return (int)std::lround(std::fmax(0.,std::fmin(1.,v))*255.);};
for(NSUInteger i=0;i<rgba.length/sizeof(float[4]);i++,p+=4){
if(!std::isfinite(p[0])||!std::isfinite(p[1])||!std::isfinite(p[2])||!std::isfinite(p[3])||p[3]<=0)continue;
h.bins[0][bin(.2126*p[0]+.7152*p[1]+.0722*p[2])]++;
for(int c=0;c<3;c++)h.bins[c+1][bin(p[c])]++;
if(!std::isfinite(p[0])||!std::isfinite(p[1])||!std::isfinite(p[2])||!std::isfinite(p[3])||p[3]<=(premultiplied?1e-6f:0))continue;
double alpha=premultiplied?p[3]:1.;
h.bins[0][bin((.2126*p[0]+.7152*p[1]+.0722*p[2])/alpha)]++;
for(int c=0;c<3;c++)h.bins[c+1][bin(p[c]/alpha)]++;
h.samples++;
}
return [NSData dataWithBytes:&h length:sizeof(h)];
+13
查看文件
@@ -2,9 +2,22 @@
#import <FxPlug/FxPlugSDK.h>
@class DYRenderer;
@protocol DYWorkspaceMaskEditing <NSObject>
@property(nonatomic) BOOL workspaceMode;
@property(nonatomic,readonly) CGFloat contentHeight;
@property(nonatomic,readonly) CGFloat contentWidth;
@property(nonatomic,readonly) NSString *selectedMaskID;
- (void)refreshWithDocument:(NSDictionary *)document time:(CMTime)time;
- (void)addMenu:(NSView *)anchor;
- (void)selectMaskID:(NSString *)maskID;
@end
NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing> manager,NSString *nodeID);
/// Per-instance custom inspector. All host reads and edits are bracketed actions.
@interface DYInspector : NSView
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager;
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer;
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer workspaceType:(NSString *)type;
- (void)refresh;
- (void)removeWorkspaceTool;
@end
+158 -47
查看文件
@@ -85,6 +85,7 @@ static NSString *DYNumber(double value,NSDictionary *d) {
}
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped {
NSRect track=NSMakeRect(rect.origin.x,NSMidY(rect)-2.5,rect.size.width,5);
if(DYThemeWorkspaceContext(self.controlView)&&![self trackColors]){NSBezierPath *bar=[NSBezierPath bezierPathWithRoundedRect:track xRadius:2.5 yRadius:2.5];[[NSColor colorWithWhite:DYThemeIsLight()?.64:.29 alpha:1]setFill];[bar fill];double fraction=(self.doubleValue-self.minValue)/fmax(.000001,self.maxValue-self.minValue);NSRect active=track;active.size.width*=fmax(0,fmin(1,fraction));[[NSColor colorWithWhite:DYThemeIsLight()?.36:.69 alpha:1]setFill];[[NSBezierPath bezierPathWithRoundedRect:active xRadius:2.5 yRadius:2.5]fill];return;}
if(DYThemeUsesRelief())DYDrawSoftControl(NSInsetRect(track,-.5,-1),3.5,YES,NO,NO);
NSArray *colors=[self trackColors];if(colors){NSGradient *g=[[[NSGradient alloc]initWithColors:colors]autorelease];[g drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:track xRadius:2.5 yRadius:2.5] angle:0];return;}
NSBezierPath *bar=[NSBezierPath bezierPathWithRoundedRect:track xRadius:2.5 yRadius:2.5];NSGradient *base=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"slot8"] endingColor:DYThemePalette()[@"slot9"]]autorelease];[base drawInBezierPath:bar angle:90];[[(DYThemeIsLight()?DYAccent():NSColor.blackColor) colorWithAlphaComponent:DYThemeIsLight()?.20:.28]setStroke];bar.lineWidth=.6;[bar stroke];
@@ -93,6 +94,7 @@ static NSString *DYNumber(double value,NSDictionary *d) {
}
- (void)drawKnob:(NSRect)knobRect {
NSRect circle=NSInsetRect(knobRect,1,1);
if(DYThemeWorkspaceContext(self.controlView)){[[NSColor colorWithWhite:DYThemeIsLight()?.94:.87 alpha:1]setFill];[[NSBezierPath bezierPathWithOvalInRect:circle]fill];return;}
if(DYThemeIsLight()){DYDrawSoftControl(circle,MIN(circle.size.width,circle.size.height)/2,NO,NO,self.highlighted);return;}
[DYThemeColor(@"knob") setFill];[[NSBezierPath bezierPathWithOvalInRect:circle] fill];
[DYAccent() setStroke];NSBezierPath *ring=[NSBezierPath bezierPathWithOvalInRect:circle];ring.lineWidth=.7;[ring stroke];
@@ -103,7 +105,8 @@ static NSString *DYNumber(double value,NSDictionary *d) {
@implementation DYNumberFieldCell
- (void)drawWithFrame:(NSRect)frame inView:(NSView *)view {
NSRect rect=NSInsetRect(frame,.5,.5);NSBezierPath *p=[NSBezierPath bezierPathWithRoundedRect:rect xRadius:2.5 yRadius:2.5];
if(DYThemeUsesRelief())DYDrawSoftControl(NSInsetRect(frame,1,2),5,YES,NO,NO);
if(DYThemeWorkspaceContext(view)){[[NSColor colorWithWhite:DYThemeIsLight()?.82:.19 alpha:1]setFill];[p fill];[[NSColor colorWithWhite:DYThemeIsLight()?.55:.34 alpha:1]setStroke];p.lineWidth=.5;[p stroke];}
else if(DYThemeUsesRelief())DYDrawSoftControl(NSInsetRect(frame,1,2),5,YES,NO,NO);
else{NSGradient *gradient=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"slot5"] endingColor:DYThemePalette()[@"slot4"]]autorelease];[gradient drawInBezierPath:p angle:90];[[DYThemePalette()[@"accent"]colorWithAlphaComponent:.65]setStroke];p.lineWidth=.9;[p stroke];}
[NSGraphicsContext saveGraphicsState];[DYThemeTextShadow()set];[self drawInteriorWithFrame:NSInsetRect(frame,4,3) inView:view];[NSGraphicsContext restoreGraphicsState];
}
@@ -130,7 +133,7 @@ static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
return self;
}
- (BOOL)isFlipped { return YES; }
- (void)drawRect:(NSRect)rect {if([self.identifier isEqual:@"inspectorBackground"])DYDrawThemeSurface([NSBezierPath bezierPathWithRect:self.bounds],NO);}
- (void)drawRect:(NSRect)rect {if([self.identifier isEqual:@"inspectorBackground"]){if(DYThemeWorkspaceContext(self)){[[NSColor colorWithWhite:DYThemeIsLight()?.88:.145 alpha:1]setFill];NSRectFill(self.bounds);}else DYDrawThemeSurface([NSBezierPath bezierPathWithRect:self.bounds],NO);}}
- (BOOL)isAccessibilityElement { return YES; }
- (NSAccessibilityRole)accessibilityRole { return NSAccessibilityGroupRole; }
- (NSArray *)accessibilityChildren { return DYAccessibleSubviews(self,NO); }
@@ -159,12 +162,18 @@ static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
- (NSArray *)accessibilityVisibleChildren { return self.accessibilityChildren; }
- (NSArray *)accessibilityChildrenInNavigationOrder { return self.accessibilityChildren; }
- (id)accessibilityVerticalScrollBar { return self.hasVerticalScroller?self.verticalScroller:nil; }
- (void)scrollWheel:(NSEvent*)event{if(!self.hasVerticalScroller){[self.nextResponder scrollWheel:event];return;}[super scrollWheel:event];}
- (void)scrollWheel:(NSEvent*)event{
if(!self.hasVerticalScroller&&self.hasHorizontalScroller&&self.documentView.bounds.size.width>self.contentSize.width){NSPoint p=self.contentView.bounds.origin;CGFloat delta=fabs(event.scrollingDeltaX)>fabs(event.scrollingDeltaY)?event.scrollingDeltaX:event.scrollingDeltaY;p.x=MAX(0,MIN(self.documentView.bounds.size.width-self.contentSize.width,p.x-delta));p.y=0;[self.contentView scrollToPoint:p];[self reflectScrolledClipView:self.contentView];return;}
if(!self.hasVerticalScroller&&!self.hasHorizontalScroller){[self.nextResponder scrollWheel:event];return;}[super scrollWheel:event];
}
@end
@interface DYCard : DYFlippedView @end
@interface DYCard : DYFlippedView
@property(nonatomic) BOOL workspaceMode;
@end
@implementation DYCard
- (void)drawRect:(NSRect)rect {
if(_workspaceMode)return;
NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds,.5,.5) xRadius:11 yRadius:11];
if(DYThemeUsesRelief())DYDrawSoftControl(NSInsetRect(self.bounds,3,3),12,NO,NO,NO);
else{DYDrawThemeSurface(path,YES);[DYThemeColor(@"border")setStroke];path.lineWidth=1;[path stroke];}
@@ -234,11 +243,13 @@ static NSArray *DYPresentationSections(void) {
NSData *_histogram;
NSButton *_histogramToggle;
NSInteger _channel;
BOOL _fixedWorkspaceChannel;
NSString *_dragXKey,*_dragYKey;
}
@property(nonatomic,assign) id<DYGraphicDelegate> delegate;
- (void)setValues:(NSDictionary *)values;
- (void)setHistogram:(NSData *)histogram;
- (void)setFixedWorkspaceChannel:(NSInteger)channel;
@end
@implementation DYCurvePanel
@@ -247,7 +258,7 @@ static NSArray *DYPresentationSections(void) {
_values=[@{} copy];
_channels=[[NSSegmentedControl segmentedControlWithLabels:@[@"RGB",@"红",@"绿",@"蓝"] trackingMode:NSSegmentSwitchTrackingSelectOne target:self action:@selector(channelChanged:)] retain];
_channels.selectedSegment=0; _channels.controlSize=NSControlSizeSmall; [self addSubview:_channels];
_histogramToggle=[[NSButton checkboxWithTitle:@"直方图" target:self action:@selector(histogramToggled:)]retain];_histogramToggle.state=NSControlStateValueOn;_histogramToggle.font=[NSFont systemFontOfSize:10];_histogramToggle.accessibilityLabel=@"显示曲线直方图叠层";_histogramToggle.toolTip=@"亮度与 RGB,256 档、320×180 采样;高度按共同峰值平方根缩放。源为分析画面:原流程在一级 CST/输入 LUT 后,新 CMS 在显示输出转换后、SDR 修饰前;不是最终输出示波器,也不是每个曲线层的即时输入。播放或移动播放头时刷新(最多每秒2次)。";[self addSubview:_histogramToggle];
_histogramToggle=[[NSButton checkboxWithTitle:@"直方图" target:self action:@selector(histogramToggled:)]retain];_histogramToggle.state=NSControlStateValueOn;_histogramToggle.font=[NSFont systemFontOfSize:10];_histogramToggle.accessibilityLabel=@"显示曲线直方图叠层";_histogramToggle.toolTip=@"亮度与 RGB,256 档、320×180 采样。来自当前效果的输出,曲线调整后随画面刷新。";[self addSubview:_histogramToggle];
self.accessibilityLabel=@"曲线点编辑器";self.toolTip=@"点击添加点;拖动调整;双击、右键或按住 Option 点击已有点可删除";
}
return self;
@@ -256,10 +267,11 @@ static NSArray *DYPresentationSections(void) {
- (BOOL)acceptsFirstResponder { return YES; }
- (void)setValues:(NSDictionary *)values { [_values release];_values=[values copy];[self setNeedsDisplay:YES]; }
- (void)layout { [super layout];_channels.frame=NSMakeRect(12,4,MAX(100,self.bounds.size.width-112),24);_histogramToggle.frame=NSMakeRect(self.bounds.size.width-88,5,80,22); }
- (void)setHistogram:(NSData *)histogram {if(_histogram==histogram)return;[_histogram release];_histogram=[histogram copy];const DYHistogram *h=_histogram.length==sizeof(DYHistogram)?(const DYHistogram*)_histogram.bytes:nullptr;_histogramToggle.accessibilityValueDescription=h&&h->samples?[NSString stringWithFormat:@"分析画面,%u 个有效采样",h->samples]:@"等待画面;请移动播放头";[self setNeedsDisplay:YES];}
- (void)setFixedWorkspaceChannel:(NSInteger)channel {_fixedWorkspaceChannel=YES;_channel=channel;_channels.hidden=YES;_histogramToggle.hidden=YES;}
- (void)setHistogram:(NSData *)histogram {if(_histogram==histogram)return;[_histogram release];_histogram=[histogram copy];const DYHistogram *h=_histogram.length==sizeof(DYHistogram)?(const DYHistogram*)_histogram.bytes:nullptr;_histogramToggle.accessibilityValueDescription=h&&h->samples?[NSString stringWithFormat:@"效果输出,%u 个有效采样",h->samples]:@"等待画面;请移动播放头";[self setNeedsDisplay:YES];}
- (void)histogramToggled:(id)sender {[self setNeedsDisplay:YES];}
- (void)channelChanged:(NSSegmentedControl *)sender { _channel=sender.selectedSegment;[self setNeedsDisplay:YES]; }
- (NSRect)plotRect { return NSMakeRect(16,37,MAX(50,self.bounds.size.width-32),MAX(50,self.bounds.size.height-76)); }
- (NSRect)plotRect {if(_fixedWorkspaceChannel){CGFloat side=MAX(50,MIN(self.bounds.size.width-16,self.bounds.size.height-42));return NSMakeRect((self.bounds.size.width-side)/2,MAX(8,(self.bounds.size.height-side-34)/2),side,side);}return NSMakeRect(16,37,MAX(50,self.bounds.size.width-32),MAX(50,self.bounds.size.height-76));}
- (NSArray *)slots {
NSMutableArray *result=[NSMutableArray array];
NSInteger n=_channel==0?4:2;
@@ -292,7 +304,7 @@ static NSArray *DYPresentationSections(void) {
}
- (void)drawRect:(NSRect)dirtyRect {
NSRect r=[self plotRect];
DYDrawSoftControl(r,5,YES,NO,NO);
if(_fixedWorkspaceChannel){[[NSColor colorWithWhite:DYThemeIsLight()?.81:.17 alpha:1]setFill];NSRectFill(r);[[NSColor colorWithWhite:DYThemeIsLight()?.54:.36 alpha:1]setStroke];NSFrameRectWithWidth(r,.5);}else DYDrawSoftControl(r,5,YES,NO,NO);
if(_histogramToggle.state==NSControlStateValueOn){
const DYHistogram *h=_histogram.length==sizeof(DYHistogram)?(const DYHistogram*)_histogram.bytes:nullptr;
if(h&&h->samples){
@@ -329,11 +341,11 @@ static NSArray *DYPresentationSections(void) {
NSPoint q=NSMakePoint(r.origin.x+x*r.size.width,r.origin.y+(1-fmax(0,fmin(1,y)))*r.size.height);
if(sample==0)[curve moveToPoint:q];else[curve lineToPoint:q];
}
NSColor *color=_channel==0?(DYThemeIsLight()?DYInk():DYAccent()):_channel==1?[NSColor systemRedColor]:_channel==2?[NSColor systemGreenColor]:[NSColor systemBlueColor];[color setStroke];[curve stroke];
NSColor *color=_channel==0?(DYThemeIsLight()?DYInk():_fixedWorkspaceChannel?[NSColor colorWithWhite:.9 alpha:1]:DYAccent()):_channel==1?[NSColor systemRedColor]:_channel==2?[NSColor systemGreenColor]:[NSColor systemBlueColor];[color setStroke];[curve stroke];
for(NSDictionary *point in points) {NSPoint q=[self positionOfPoint:point];[color setFill];[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(q.x-4,q.y-4,8,8)] fill];[DYInk() setStroke];[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(q.x-4,q.y-4,8,8)] stroke];}
NSDictionary *axis=@{NSFontAttributeName:[NSFont monospacedDigitSystemFontOfSize:8 weight:NSFontWeightRegular],NSForegroundColorAttributeName:DYThemeColor(@"secondary")};
[@"0" drawAtPoint:NSMakePoint(NSMinX(r),NSMaxY(r)+2) withAttributes:axis];[@"128" drawAtPoint:NSMakePoint(NSMidX(r)-7,NSMaxY(r)+2) withAttributes:axis];[@"255" drawAtPoint:NSMakePoint(NSMaxX(r)-14,NSMaxY(r)+2) withAttributes:axis];
[@"点击添加 · 拖动调整 · 双击删除" drawAtPoint:NSMakePoint(16,self.bounds.size.height-16) withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:9],NSForegroundColorAttributeName:DYThemeColor(@"secondary")}];
[(_fixedWorkspaceChannel?@[@"主控",@"红色",@"绿色",@"蓝色"][_channel]:@"点击添加 · 拖动调整 · 双击删除") drawAtPoint:NSMakePoint(_fixedWorkspaceChannel?NSMidX(r)-12:16,_fixedWorkspaceChannel?NSMaxY(r)+18:self.bounds.size.height-16) withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:10],NSForegroundColorAttributeName:DYThemeColor(@"secondary")}];
}
- (void)sendValues:(NSDictionary *)values {
NSMutableDictionary *merged=[[_values mutableCopy] autorelease];[merged addEntriesFromDictionary:values];[self setValues:merged];
@@ -343,10 +355,11 @@ static NSArray *DYPresentationSections(void) {
- (void)mouseDown:(NSEvent *)event {
NSPoint p=[self convertPoint:event.locationInWindow fromView:nil];if(!NSPointInRect(p,[self plotRect]))return;
[self.window makeFirstResponder:self];NSDictionary *point=[self pointNear:p];
if(point&&(event.clickCount==2||(event.modifierFlags&NSEventModifierFlagOption))) {[self removePoint:point];return;}
if(point&&(event.clickCount==2||(event.modifierFlags&NSEventModifierFlagOption))) {[self.delegate graphicGesture:YES title:@"删除曲线点"];[self removePoint:point];[self.delegate graphicGesture:NO title:nil];return;}
[self.delegate graphicGesture:YES title:@"调整曲线"];
if(!point) {
NSDictionary *freeSlot=nil;for(NSDictionary *slot in [self slots]) {NSNumber *v=_values[slot[@"xKey"]];if(!v||v.doubleValue<0){freeSlot=slot;break;}}
if(!freeSlot){NSBeep();return;}
if(!freeSlot){[self.delegate graphicGesture:NO title:nil];NSBeep();return;}
[_dragXKey release];_dragXKey=[freeSlot[@"xKey"] copy];[_dragYKey release];_dragYKey=[freeSlot[@"yKey"] copy];
[self updateDragAt:p];return;
}
@@ -358,11 +371,16 @@ static NSArray *DYPresentationSections(void) {
x=fmax(.001,fmin(.999,x));[self sendValues:@{_dragXKey:@(x),_dragYKey:@((y-x)*100)}];
}
- (void)mouseDragged:(NSEvent *)event { [self updateDragAt:[self convertPoint:event.locationInWindow fromView:nil]]; }
- (void)mouseUp:(NSEvent *)event { if(_dragXKey)[self updateDragAt:[self convertPoint:event.locationInWindow fromView:nil]];[_dragXKey release];_dragXKey=nil;[_dragYKey release];_dragYKey=nil; }
- (void)rightMouseDown:(NSEvent *)event { [self removePoint:[self pointNear:[self convertPoint:event.locationInWindow fromView:nil]]]; }
- (void)mouseUp:(NSEvent *)event { if(_dragXKey)[self updateDragAt:[self convertPoint:event.locationInWindow fromView:nil]];[_dragXKey release];_dragXKey=nil;[_dragYKey release];_dragYKey=nil;[self.delegate graphicGesture:NO title:nil]; }
- (void)rightMouseDown:(NSEvent *)event {NSDictionary *point=[self pointNear:[self convertPoint:event.locationInWindow fromView:nil]];if(point){[self.delegate graphicGesture:YES title:@"删除曲线点"];[self removePoint:point];[self.delegate graphicGesture:NO title:nil];}}
- (void)keyDown:(NSEvent *)event { if(event.keyCode==51&&_dragXKey)[self sendValues:@{_dragXKey:@(-1),_dragYKey:@0}];else[super keyDown:event]; }
@end
@interface DYWorkspaceCurveStrip : DYFlippedView @end
@implementation DYWorkspaceCurveStrip
- (void)layout {[super layout];CGFloat width=self.bounds.size.width/4;NSInteger i=0;for(NSView *v in self.subviews)v.frame=NSMakeRect(i++*width,0,width,self.bounds.size.height);}
@end
static NSImage *DYWheelImage(void) {
static NSImage *image;static dispatch_once_t once;
dispatch_once(&once,^{
@@ -427,17 +445,22 @@ static NSImage *DYWheelImage(void) {
}
@property(nonatomic,assign) id<DYGraphicDelegate> delegate;
- (void)setValues:(NSDictionary *)values;
@property(nonatomic) BOOL horizontalLayout;
@end
@implementation DYWheelPanel
- (instancetype)initWithFrame:(NSRect)frame {if((self=[super initWithFrame:frame])){NSMutableArray *w=[NSMutableArray array];for(NSInteger i=0;i<4;i++){DYColorWheel *wheel=[[[DYColorWheel alloc]initWithIndex:i]autorelease];[self addSubview:wheel];[w addObject:wheel];}_wheels=[w copy];}return self;}
- (void)dealloc {[_wheels release];[super dealloc];}
- (void)setDelegate:(id<DYGraphicDelegate>)delegate {_delegate=delegate;for(DYColorWheel *wheel in _wheels)wheel.delegate=delegate;}
- (void)setValues:(NSDictionary *)values {for(NSInteger i=0;i<4;i++)[_wheels[i] setHue:[values[[NSString stringWithFormat:@"grade%ld_0",(long)i]] doubleValue] saturation:[values[[NSString stringWithFormat:@"grade%ld_1",(long)i]] doubleValue]];}
- (void)layout {[super layout];CGFloat w=self.bounds.size.width/2,h=self.bounds.size.height/2;for(NSInteger i=0;i<4;i++)[_wheels[i] setFrame:NSMakeRect((i%2)*w,(i/2)*h,w,h)];}
- (void)layout {[super layout];CGFloat w=self.bounds.size.width/(_horizontalLayout?4:2),h=self.bounds.size.height/(_horizontalLayout?1:2);for(NSInteger i=0;i<4;i++)[_wheels[i] setFrame:NSMakeRect((_horizontalLayout?i:i%2)*w,(_horizontalLayout?0:i/2)*h,w,h)];}
@end
#include "DYNewPanels.inc.h"
#include "DYMaskPanel.inc.h"
NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing> manager,NSString *nodeID) {
DYToolMaskPanel *panel=[[[DYToolMaskPanel alloc]initWithManager:manager nodeID:nodeID]autorelease];
panel.workspaceMode=YES;return (NSView<DYWorkspaceMaskEditing> *)panel;
}
@interface DYInspector () <DYGraphicDelegate> {
id<PROAPIAccessing> _manager;
@@ -457,13 +480,14 @@ static NSImage *DYWheelImage(void) {
DYRenderer *_renderer;
DYLUTLibrary *_library;
DYLUTBrowser *_browser;
DYColorWorkspace *_workspace;NSButton *_workspaceButton;
DYLUTBrowser *_recentBrowser;DYFlippedView *_recentHost;
DYColorWorkspace *_workspace;NSButton *_workspaceButton;NSString *_workspaceSelectedNode;
NSArray *_themeButtons;
NSMutableDictionary *_tabs;
NSInteger _visibleLooks;
NSButton *_colorSettings;BOOL _colorSettingsExpanded;
BOOL _refreshing,_graphicUndoOpen;
BOOL _embedded;NSMutableDictionary *_stackViews;NSArray *_stackOrder;NSDictionary *_stackRoots;CGFloat _stackHeight;
BOOL _refreshing,_graphicUndoOpen,_graphicCancelled;CMTime _graphicTime;NSMutableDictionary *_graphicExpected;
BOOL _embedded,_workspaceEditor;NSMutableDictionary *_stackViews;NSArray *_stackOrder;NSDictionary *_stackRoots;CGFloat _stackHeight,_preferredHeight;
DYSpiderPanel *_spiderPanel;
NSMutableDictionary *_assetLoads,*_assetLoadIDs;
NSUInteger _nextAssetLoadID;
@@ -476,15 +500,20 @@ static NSImage *DYWheelImage(void) {
@implementation DYInspector
#include "DYToolInspector.inc.h"
- (void)removeWorkspaceTool {if(!_workspaceEditor||!_cards.count)return;NSButton *source=[[[NSButton alloc]init]autorelease];source.tag=0;[self removeTool:source];}
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager {
return [self initWithAPIManager:manager renderer:nil];
}
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer {
return [self initWithAPIManager:manager renderer:renderer workspaceType:nil];
}
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer workspaceType:(NSString *)workspaceType {
uint64_t beta=DYBetaSpanBegin(@"inspector_create",nil);
if((self=[super initWithFrame:NSMakeRect(0,0,360,780)])) {
if((self=[super initWithFrame:NSMakeRect(0,0,360,406)])) {
_assetLoads=[NSMutableDictionary new];_assetLoadIDs=[NSMutableDictionary new];_manager=manager; _renderer=[renderer retain];_library=[DYLUTLibrary new];_tabs=[NSMutableDictionary new];_visibleLooks=1;
_embedded=[manager isKindOfClass:DYToolManager.class];if(_embedded)[(id)_manager retain];
NSArray *presentation=DYPresentationSections();if(_embedded){NSMutableArray *filtered=[NSMutableArray array];for(NSDictionary *s in presentation)if([s[@"key"]isEqual:[(DYToolManager*)manager type]])[filtered addObject:s];presentation=filtered;}
_workspaceEditor=workspaceType.length>0;_embedded=[manager isKindOfClass:DYToolManager.class];if(_embedded)[(id)_manager retain];
_preferredHeight=(_embedded||_workspaceEditor)?780:406;
NSArray *presentation=DYPresentationSections();if(_embedded||_workspaceEditor){NSMutableArray *filtered=[NSMutableArray array];for(NSDictionary *s in presentation)if([s[@"key"]isEqual:_workspaceEditor?workspaceType:[(DYToolManager*)manager type]])[filtered addObject:s];presentation=filtered;}
_sections=[presentation copy];_stackViews=[NSMutableDictionary new];_stackOrder=[@[]copy];
_cards=[[NSMutableArray alloc] init]; _controls=[[NSMutableDictionary alloc] init];
_assetButtons=[[NSMutableDictionary alloc] init]; _graphics=[[NSMutableArray alloc] init];
@@ -504,16 +533,16 @@ static NSImage *DYWheelImage(void) {
_export=[DYButton(@"导出 LUT",self,@selector(exportLUT:)) retain];
_colorSettings=[DYButton(@"颜色设置",self,@selector(toggleColorSettings:))retain];[_colorSettings setButtonType:NSButtonTypePushOnPushOff];_colorSettings.toolTip=@"展开或收起高级颜色设置;默认使用原有流程";_colorSettings.accessibilityLabel=@"颜色设置";_colorSettings.accessibilityValue=@"已收起";
_save.identifier=@"primaryAction";
_workspaceButton=[DYButton(@"◫ 工作区 · 示波器 / LUT",self,@selector(openWorkspace:))retain];_workspaceButton.accessibilityLabel=@"打开示波器与 LUT 工作区";
_workspaceButton=[DYButton(@"控制面板",self,@selector(openWorkspace:))retain];_workspaceButton.accessibilityLabel=@"打开调色控制面板";
_addModule=[[DYThemePopUpButton alloc]initWithFrame:NSZeroRect pullsDown:YES];_addModule.font=[NSFont systemFontOfSize:11];_addModule.accessibilityLabel=@"添加模块";[_addModule addItemWithTitle:@"+ 添加模块"];
for(NSDictionary *section in DYPresentationSections()){NSMenuItem *item=[[[NSMenuItem alloc]initWithTitle:section[@"title"] action:@selector(addModule:) keyEquivalent:@""]autorelease];item.target=self;item.representedObject=section[@"key"];[_addModule.menu addItem:item];}
for(NSView *v in @[_brand,_subtitle,_websiteLink,_resetAll,_save,_load,_export,_colorSettings,_addModule,_workspaceButton]){[self addSubview:v];v.hidden=_embedded;}
for(NSView *v in @[_brand,_subtitle,_websiteLink,_resetAll,_save,_load,_export,_colorSettings,_addModule,_workspaceButton]){[self addSubview:v];v.hidden=_embedded||_workspaceEditor;}
NSMutableArray *themes=[NSMutableArray array];for(NSInteger i=0;i<DYThemeNames().count;i++){
NSButton *b=DYButton(DYThemeNames()[i],self,@selector(selectTheme:));[b setButtonType:NSButtonTypePushOnPushOff];b.tag=i+7;b.identifier=@"appearanceToggle";
b.toolTip=[DYThemeNames()[i] stringByAppendingString:@"主题"];b.accessibilityLabel=b.toolTip;[self addSubview:b];b.hidden=_embedded;[themes addObject:b];
b.toolTip=[DYThemeNames()[i] stringByAppendingString:@"主题"];b.accessibilityLabel=b.toolTip;[self addSubview:b];b.hidden=_embedded||_workspaceEditor;[themes addObject:b];
}_themeButtons=[themes copy];
_scroll=[[DYInspectorScrollView alloc] initWithFrame:NSZeroRect];
_scroll.hasVerticalScroller=!_embedded; _scroll.hasHorizontalScroller=NO; _scroll.drawsBackground=NO;
_scroll.hasVerticalScroller=!_embedded&&!_workspaceEditor; _scroll.hasHorizontalScroller=_workspaceEditor;_scroll.scrollerStyle=NSScrollerStyleOverlay;_scroll.automaticallyAdjustsContentInsets=NO;_scroll.contentInsets=NSEdgeInsetsZero; _scroll.drawsBackground=NO;
_scroll.autohidesScrollers=YES; _scroll.borderType=NSNoBorder;
_scroll.clipsToBounds=YES;_scroll.wantsLayer=YES;_scroll.layer.masksToBounds=YES;
_scroll.contentView.clipsToBounds=YES;
@@ -522,14 +551,18 @@ static NSImage *DYWheelImage(void) {
_document=[[DYFlippedView alloc] initWithFrame:NSMakeRect(0,0,360,1000)];
_document.accessibilityLabel=@"调色参数";_document.identifier=@"inspectorBackground";
_scroll.documentView=_document; [self addSubview:_scroll];
if(!_embedded){_managedPanel=[[DYManagedColorPanel alloc]initWithManager:_manager renderer:_renderer assetTarget:self];_managedPanel.hidden=YES;[_document addSubview:_managedPanel];}
if(!_embedded&&!_workspaceEditor){_managedPanel=[[DYManagedColorPanel alloc]initWithManager:_manager renderer:_renderer assetTarget:self];_managedPanel.hidden=YES;[_document addSubview:_managedPanel];}
[self buildCards];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modelChanged:) name:@"DYModelChanged" object:_manager];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(themeChanged:) name:DYThemeDidChange object:nil];
[NSWorkspace.sharedWorkspace.notificationCenter addObserver:self selector:@selector(themeChanged:) name:NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification object:nil];
if(!_embedded)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(revealViewerTool:) name:@"DYViewerToolRequested" object:_manager];
if(!_embedded)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(openWorkspace:) name:@"DYColorWorkspaceRequested" object:_manager];
if(_renderer)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(previewChanged:) name:@"DYPreviewDidChange" object:_renderer];
if(!_embedded&&!_workspaceEditor)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(revealViewerTool:) name:@"DYViewerToolRequested" object:_manager];
if(!_embedded&&!_workspaceEditor)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(openWorkspace:) name:@"DYColorWorkspaceRequested" object:_manager];
if(!_embedded&&!_workspaceEditor)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rememberWorkspaceSelection:) name:@"DYWorkspaceToolSelection" object:_manager];
if(_renderer){
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(previewChanged:) name:@"DYPreviewDidChange" object:_renderer];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(curveOutputChanged:) name:@"DYOutputHistogramDidChange" object:_renderer];
}
[self themeChanged:nil];
[self setAccessibilityLabel:@"大鱼调色检查器"];
[self setNeedsLayout:YES];
@@ -537,25 +570,26 @@ static NSImage *DYWheelImage(void) {
DYBetaSpanEnd(beta,nil);return self;
}
- (void)dealloc {
[self graphicGesture:NO title:nil];_spiderPanel.delegate=nil;[_workspace close];[_workspace release];[_workspaceButton release];
[self graphicGesture:NO title:nil];_spiderPanel.delegate=nil;[_workspace close];[_workspace release];[_workspaceButton release];[_workspaceSelectedNode release];
for(id graphic in _graphics)if([graphic isKindOfClass:DYPrimaryBalanceWheel.class])[(DYPrimaryBalanceWheel*)graphic setDelegate:nil];
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads release];[_assetLoadIDs release];[_menuScan cancel];[_menuScan release];[_pendingAssetMenuCommand release];
[[NSNotificationCenter defaultCenter] removeObserver:self];[NSWorkspace.sharedWorkspace.notificationCenter removeObserver:self];
if(_embedded)[(id)_manager release];[_stackViews release];[_stackOrder release];[_stackRoots release];
[_brand release]; [_subtitle release]; [_websiteLink release]; [_resetAll release]; [_save release]; [_load release]; [_export release];[_colorSettings release];[_addModule release];
[_managedPanel release];[_scroll release]; [_document release]; [_sections release]; [_cards release]; [_controls release]; [_assetButtons release]; [_graphics release]; [_sampler release];
[_browser close];[_browser release];[_renderer release];[_library release];[_themeButtons release];[_tabs release];
[_recentBrowser close];[_recentBrowser release];[_recentHost release];
[_browser close];[_browser release];[_renderer release];[_library release];[_themeButtons release];[_tabs release];[_graphicExpected release];
[super dealloc];
}
- (BOOL)isFlipped { return YES; }
- (void)drawRect:(NSRect)rect {DYDrawThemeSurface([NSBezierPath bezierPathWithRect:self.bounds],NO);}
- (void)drawRect:(NSRect)rect {if(_workspaceEditor){[[NSColor colorWithWhite:DYThemeIsLight()?.88:.145 alpha:1]setFill];NSRectFill(self.bounds);}else DYDrawThemeSurface([NSBezierPath bezierPathWithRect:self.bounds],NO);}
- (BOOL)isAccessibilityElement { return YES; }
- (NSAccessibilityRole)accessibilityRole { return NSAccessibilityGroupRole; }
- (NSArray *)accessibilityChildren { return DYAccessibleSubviews(self,NO); }
- (NSArray *)accessibilityVisibleChildren { return DYAccessibleSubviews(self,YES); }
- (NSArray *)accessibilityChildrenInNavigationOrder { return self.accessibilityChildren; }
- (NSSize)intrinsicContentSize { return NSMakeSize(360,780); }
- (NSSize)intrinsicContentSize { return NSMakeSize(360,_preferredHeight); }
- (void)viewDidMoveToWindow {
[super viewDidMoveToWindow];
if(!self.window){[self graphicGesture:NO title:nil];[self cancelAssetLoads];[_workspace close];}
@@ -575,11 +609,14 @@ static NSImage *DYWheelImage(void) {
[_document scrollPoint:NSZeroPoint];NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
}
- (void)openWorkspace:(id)sender {
if(_embedded||!self.window||!_renderer)return;
if(_embedded||_workspaceEditor||!self.window||!_renderer)return;
[_browser close];
if(!_workspace)_workspace=[[DYColorWorkspace alloc]initWithManager:_manager renderer:_renderer library:_library title:@"大鱼调色 · 当前片段"];
if(_workspaceSelectedNode.length)[NSNotificationCenter.defaultCenter postNotificationName:@"DYWorkspaceToolSelection" object:_manager userInfo:@{@"node":_workspaceSelectedNode,@"source":@"inspector"}];
[_workspace showRelativeToView:self];
if([sender isKindOfClass:NSNotification.class])[_workspace showPage:[sender userInfo][@"page"]?:@"tools" maskKind:[sender userInfo][@"maskKind"]];
}
- (void)rememberWorkspaceSelection:(NSNotification*)note {NSString*node=note.userInfo[@"node"];if(!node.length)return;NSString*saved=[node copy];[_workspaceSelectedNode release];_workspaceSelectedNode=saved;}
- (void)openWebsite:(id)sender {[[NSWorkspace sharedWorkspace]openURL:[NSURL URLWithString:@"https://dayu.media"]];}
- (void)redrawTree:(NSView *)view { [view setNeedsDisplay:YES];for(NSView *child in view.subviews)[self redrawTree:child]; }
- (void)themeChanged:(NSNotification *)notification {
@@ -589,7 +626,7 @@ static NSImage *DYWheelImage(void) {
for(NSButton *b in _themeButtons)b.state=b.tag==DYThemeIndex()?NSControlStateValueOn:NSControlStateValueOff;
_websiteLink.attributedTitle=[[[NSAttributedString alloc]initWithString:_websiteLink.title attributes:DYThemeTextAttributes(_websiteLink.font,DYAccent())]autorelease];
for(NSDictionary *r in _controls.allValues)[r[@"field"] setBackgroundColor:DYThemeColor(@"field")];
[_browser updatePalette:DYThemePalette()];[_workspace updatePalette];[self redrawTree:self];
[_browser updatePalette:DYThemePalette()];[_recentBrowser updatePalette:DYThemePalette()];[_workspace updatePalette];[self redrawTree:self];
}
- (void)tabChanged:(NSControl *)sender {
if([sender isKindOfClass:NSSegmentedControl.class])_tabs[sender.identifier]=@([(NSSegmentedControl *)sender selectedSegment]);
@@ -597,11 +634,19 @@ static NSImage *DYWheelImage(void) {
[self setNeedsLayout:YES];NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
}
- (void)addLook:(id)sender {_visibleLooks=MIN(5,_visibleLooks+1);[self setNeedsLayout:YES];}
- (void)previewChanged:(NSNotification *)note {for(id graphic in _graphics)if([graphic isKindOfClass:DYCurvePanel.class])[graphic setHistogram:[_renderer histogram]];[_managedPanel refreshContext];if(_browser.visible)[_browser updatePreview:[_renderer lookLUTPreview]];}
- (void)curveOutputChanged:(NSNotification *)note {
NSData *histogram=nil;BOOL loaded=NO;
for(NSView *graphic in _graphics)if([graphic isKindOfClass:DYCurvePanel.class]&&!graphic.hiddenOrHasHiddenAncestor){
if(!loaded){histogram=[_renderer outputHistogram];loaded=YES;}
[(DYCurvePanel *)graphic setHistogram:histogram];
}
}
- (void)previewChanged:(NSNotification *)note {[_managedPanel refreshContext];if(_browser.visible)[_browser updatePreview:[_renderer lookLUTPreview]];if(_recentBrowser.visible)[_recentBrowser updatePreview:[_renderer lookLUTPreview]];}
- (void)buildCards {
NSInteger index=0;
for(NSDictionary *section in _sections) {
DYCard *card=[[[DYCard alloc] initWithFrame:NSZeroRect] autorelease];
card.workspaceMode=_workspaceEditor;
card.accessibilityLabel=section[@"title"];card.identifier=section[@"key"];
[_document addSubview:card];
DYHeader *header=[[[DYHeader alloc] initWithFrame:NSZeroRect] autorelease];
@@ -651,12 +696,13 @@ static NSImage *DYWheelImage(void) {
NSSegmentedControl *tabs=[NSSegmentedControl segmentedControlWithLabels:[key isEqual:@"mixer"]?@[@"红输出",@"绿输出",@"蓝输出"]:@[@"减色",@"晕光",@"辉光",@"颗粒",@"暗角",@"印片"] trackingMode:NSSegmentSwitchTrackingSelectOne target:self action:@selector(tabChanged:)];tabs.identifier=key;tabs.selectedSegment=0;tabs.controlSize=NSControlSizeSmall;tabs.accessibilityLabel=[section[@"title"]stringByAppendingString:@"分组"];[card addSubview:tabs];[body addObject:tabs];
}
if([key isEqual:@"curve"]) {
DYCurvePanel *graph=[[[DYCurvePanel alloc]initWithFrame:NSZeroRect]autorelease];graph.delegate=self;[graph setHistogram:[_renderer histogram]];graph.identifier=@"curveGraph";[card addSubview:graph];[body addObject:graph];[_graphics addObject:graph];
if(_workspaceEditor){DYWorkspaceCurveStrip *strip=[[[DYWorkspaceCurveStrip alloc]init]autorelease];strip.identifier=@"curveGraph";for(NSInteger channel=0;channel<4;channel++){DYCurvePanel *graph=[[[DYCurvePanel alloc]init]autorelease];graph.delegate=self;[graph setFixedWorkspaceChannel:channel];[strip addSubview:graph];[_graphics addObject:graph];}[card addSubview:strip];[body addObject:strip];}
else {DYCurvePanel *graph=[[[DYCurvePanel alloc]initWithFrame:NSZeroRect]autorelease];graph.delegate=self;graph.identifier=@"curveGraph";[card addSubview:graph];[body addObject:graph];[_graphics addObject:graph];}
}
if([key isEqual:@"grading"]) {
DYWheelPanel *wheels=[[[DYWheelPanel alloc]initWithFrame:NSZeroRect]autorelease];wheels.delegate=self;wheels.identifier=@"gradingWheels";[card addSubview:wheels];[body addObject:wheels];[_graphics addObject:wheels];
}
if([key isEqual:@"spider"]){_spiderPanel=[[[DYSpiderPanel alloc]initWithFrame:NSZeroRect]autorelease];_spiderPanel.delegate=self;_spiderPanel.identifier=@"spiderGraph";[card addSubview:_spiderPanel];[body addObject:_spiderPanel];}
if([key isEqual:@"spider"]){_spiderPanel=[[[DYSpiderPanel alloc]initWithFrame:NSZeroRect]autorelease];_spiderPanel.delegate=self;_spiderPanel.horizontalLayout=_workspaceEditor;_spiderPanel.identifier=@"spiderGraph";[card addSubview:_spiderPanel];[body addObject:_spiderPanel];}
for(NSDictionary *d in section[@"rows"]) {
DYFlippedView *row=[[[DYFlippedView alloc] initWithFrame:NSZeroRect] autorelease];
row.identifier=d[@"key"];
@@ -708,6 +754,12 @@ static NSImage *DYWheelImage(void) {
for(NSView *row in body)if([row.identifier isEqual:strength])[ordered addObject:row];
}
for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered;
if(_workspaceEditor){
_recentHost=[[DYFlippedView alloc]initWithFrame:NSMakeRect(12,80,600,160)];_recentHost.identifier=@"recentLUTs";[card addSubview:_recentHost];
__block DYInspector *owner=self;
_recentBrowser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:nil palette:DYThemePalette() selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){return [owner setAssetPath:path forKey:@"look0" completion:completion];}];
[_recentBrowser embedRecentInView:_recentHost];
}
}
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@YES}];
if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;}
@@ -737,6 +789,7 @@ static NSImage *DYWheelImage(void) {
return row;
}
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
if(_workspaceEditor&&[row.identifier isEqual:@"toolMasks"])return NO;
if([row.identifier isEqual:@"toolMasks"])return [(DYToolMaskPanel*)row contentHeight]>0;
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
if(!_embedded&&[section isEqual:@"base"]&&[key isEqual:@"skinEnabled"])for(NSDictionary *card in _cards)if([card[@"section"][@"key"]isEqual:@"skin"])return ![card[@"removed"]boolValue];
@@ -758,14 +811,14 @@ static NSImage *DYWheelImage(void) {
- (void)layout {
[super layout];
CGFloat w=MAX(280,self.bounds.size.width),h=self.bounds.size.height;
_brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,40,13);_subtitle.hidden=_embedded||w<380;
_brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,40,13);_subtitle.hidden=_embedded||_workspaceEditor||w<380;
for(NSInteger i=0;i<_themeButtons.count;i++)[_themeButtons[i]setFrame:NSMakeRect(w-130+i*47,16,44,25)];
_resetAll.frame=NSMakeRect(w-33,16,23,24);
_websiteLink.frame=NSMakeRect(16,41,w-32,20);
CGFloat gap=7;BOOL compact=w<320;CGFloat bw=(w-32-gap*(compact?1:3))/(compact?2:4);
NSArray *actions=@[_save,_load,_export,_colorSettings];for(NSUInteger i=0;i<actions.count;i++)[actions[i]setFrame:NSMakeRect(16+(bw+gap)*(compact?i%2:i),74+(compact?i/2*34:0),bw,27)];
CGFloat top=(compact?178:144)+34;_workspaceButton.frame=NSMakeRect(16,top-70,w-32,27);_addModule.frame=NSMakeRect(16,top-36,w-32,27);
_scroll.frame=_embedded?NSMakeRect(0,0,w,h):NSMakeRect(0,top,w,MAX(80,h-top));
_scroll.frame=(_embedded||_workspaceEditor)?NSMakeRect(0,0,w,h):NSMakeRect(0,top,w,MAX(0,h-top));
CGFloat cw=MAX(244,_scroll.contentSize.width-32),y=8;
if(_managedPanel&&!_managedPanel.hidden){_managedPanel.frame=NSMakeRect(28,y,cw-24,_managedPanel.contentHeight);y+=_managedPanel.contentHeight+12;}
for(NSMutableDictionary *c in _cards) {
@@ -776,7 +829,8 @@ static NSImage *DYWheelImage(void) {
[c[@"enabled"]setFrame:NSMakeRect(12,12,20,20)];
BOOL narrow=cw<300;CGFloat titleWidth=MIN(cw-(narrow?60:171),MAX(94,[[(NSButton *)c[@"header"]title]sizeWithAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:12]}].width+36));
[c[@"header"]setFrame:NSMakeRect(42,8,titleWidth,28)];
CGFloat headerHeight=narrow?69:43,buttonY=narrow?38:10;
CGFloat headerHeight=_workspaceEditor?0:narrow?69:43,buttonY=narrow?38:10;
if(_workspaceEditor)for(NSString *name in @[@"header",@"enabled",@"reset",@"repeatButton",@"removeButton",@"maskButton",@"maskBadge"])[c[name]setHidden:YES];
card.frame=NSMakeRect(16,y,cw,headerHeight+(contentHeight>0?contentHeight+8:0));y+=card.frame.size.height+12;
[c[@"reset"]setFrame:NSMakeRect(cw-34,buttonY,24,24)];
[c[@"repeatButton"]setFrame:NSMakeRect(cw-62,buttonY,24,24)];[c[@"removeButton"]setFrame:NSMakeRect(cw-90,buttonY,24,24)];[c[@"maskButton"]setFrame:NSMakeRect(cw-118,buttonY,24,24)];[c[@"maskBadge"]setFrame:NSMakeRect(cw-111,buttonY-7,18,16)];
@@ -793,6 +847,43 @@ static NSImage *DYWheelImage(void) {
}
if([row.identifier isEqual:@"hslTabs"]){CGFloat width=row.bounds.size.width/9;NSInteger i=0;for(NSView *button in row.subviews)[button setFrame:NSMakeRect(i++*width,1,width-1,27)];}
}
if(_workspaceEditor){
// Keep module controls together, then distribute ordinary parameter
// columns across the actual viewport instead of a fixed 250pt strip.
CGFloat height=MAX(160,_scroll.contentSize.height-12),available=MAX(280,_scroll.contentSize.width-24),x=12;
NSMutableArray *rows=[NSMutableArray array],*graphics=[NSMutableArray array];NSView *tabs=nil;
for(NSView *row in body)if(!row.hidden){NSString *identifier=row.identifier?:@"";if([identifier isEqual:@"hslTabs"])tabs=row;
else if([identifier hasSuffix:@"Graph"]||[identifier isEqual:@"gradingWheels"]||[identifier isEqual:@"primaryBalance"])[graphics addObject:row];else [rows addObject:row];}
if([key isEqual:@"spider"]){
CGFloat groupWidth=MAX(490,available);_spiderPanel.frame=NSMakeRect(x,0,groupWidth,height);
for(NSView *row in rows)if([row.identifier isEqual:@"spiderMix"]){[_spiderPanel addSubview:row];_spiderPanel.accessoryRow=row;}
[_spiderPanel setNeedsLayout:YES];[_spiderPanel layoutSubtreeIfNeeded];x+=groupWidth;
}else if([key isEqual:@"look"]&&_recentHost){
NSInteger perColumn=MAX(2,NSInteger(floor(MAX(68,height-140)/34))),columns=MAX(1,NSInteger(ceil(double(rows.count)/perColumn)));
CGFloat rw=MAX(280,(available-16*(columns-1))/columns);NSInteger index=0;
for(NSView *row in rows){row.frame=NSMakeRect(x+(index/perColumn)*(rw+16),(index%perColumn)*34,rw,33);index++;}
CGFloat width=columns*rw+16*(columns-1),top=MIN(perColumn,NSInteger(rows.count))*34+12;
_recentHost.frame=NSMakeRect(x,top,width,MAX(70,height-top));x+=width;
}else{
CGFloat top=0;
if(tabs){tabs.frame=NSMakeRect(x,4,available,30);NSInteger index=0;CGFloat sw=available/9;for(NSView *button in tabs.subviews)button.frame=NSMakeRect(index++*sw,1,sw-5,27);top=46;}
for(NSView *graphic in graphics){NSString *identifier=graphic.identifier;CGFloat gw=[identifier isEqual:@"curveGraph"]?MAX(520,available):[identifier isEqual:@"gradingWheels"]?MAX(640,available-(rows.count?300:0)):MIN(height,260);
graphic.frame=NSMakeRect(x,top,gw,height-top);if([graphic isKindOfClass:DYWheelPanel.class])[(DYWheelPanel*)graphic setHorizontalLayout:YES];if([identifier isEqual:@"primaryBalance"])for(NSView *view in graphic.subviews)view.frame=graphic.bounds;x+=gw+16;}
CGFloat parameterWidth=MAX(280,available-(x-12)),rowHeight=34,usable=MAX(100,height-top);
NSInteger perColumn=MAX(1,NSInteger(floor(usable/rowHeight))),columns=MAX(1,NSInteger(ceil(double(rows.count)/perColumn)));
CGFloat columnWidth=MAX(280,(parameterWidth-(columns-1)*16)/columns);
// The chosen HSL colour and its three axes form one continuous
// full-width editor below the colour strip, including custom HSL.
if(tabs){columnWidth=MAX(280,(available-(columns-1)*16)/columns);}
NSInteger index=0;for(NSView *row in rows){NSInteger col=index/perColumn,line=index%perColumn;CGFloat rw=columnWidth;
row.frame=NSMakeRect(x+col*(columnWidth+16),top+line*rowHeight,rw,rowHeight-1);index++;
if([row.identifier hasPrefix:@"heading:"])for(NSView *view in row.subviews)view.frame=NSMakeRect(2,5,rw-4,18);
if([row.identifier hasSuffix:@"Controls"]){CGFloat bw=(rw-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger i=0;for(NSView *view in row.subviews)view.frame=NSMakeRect((bw+4)*i++,3,bw,25);}
}
if(rows.count)x+=columns*columnWidth+(columns-1)*16;else if(tabs)x+=available;else if(graphics.count)x-=16;
}
card.frame=NSMakeRect(0,6,MAX(_scroll.contentSize.width,x+12),height);y=_scroll.contentSize.height;
}
y=[self layoutRepeatedToolsAfter:[@"base:" stringByAppendingString:key] y:y width:w];
}
for(NSDictionary *record in _controls.allValues) {
@@ -809,7 +900,22 @@ static NSImage *DYWheelImage(void) {
[r[@"choose"]setFrame:NSMakeRect(97,3,MAX(65,rw-152),26)];[r[@"folder"]setFrame:NSMakeRect(rw-51,4,24,24)];[r[@"remove"]setFrame:NSMakeRect(rw-23,4,22,24)];
}
y=[self layoutRepeatedToolsAfter:@"tail" y:y width:w];
_stackHeight=y;[_document setFrameSize:NSMakeSize(_scroll.contentSize.width,MAX(y,_scroll.contentSize.height))];
_stackHeight=y;CGFloat documentWidth=_scroll.contentSize.width;if(_workspaceEditor)for(NSDictionary *card in _cards)documentWidth=MAX(documentWidth,[card[@"view"]frame].size.width);[_document setFrameSize:NSMakeSize(documentWidth,_workspaceEditor?_scroll.contentSize.height:MAX(y,_scroll.contentSize.height))];
if(!_embedded&&!_workspaceEditor){
CGFloat preferred=MIN(780,ceil(top+MAX(12,y)));
if(preferred!=_preferredHeight){
_preferredHeight=preferred;
// FCP owns the attached custom parameter's slot. Resizing the
// remote child there bottom-aligns it and clips the fixed header.
dispatch_async(dispatch_get_main_queue(),^{
if(preferred!=self->_preferredHeight)return;
[self invalidateIntrinsicContentSize];
if(!self.superview&&!self.window&&self.frame.size.height!=preferred)
[self setFrameSize:NSMakeSize(self.frame.size.width,preferred)];
});
}
}
[self curveOutputChanged:nil];
}
- (id<FxCustomParameterActionAPI_v4>)actionAPI { return [_manager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]; }
- (void)refresh {
@@ -817,7 +923,7 @@ static NSImage *DYWheelImage(void) {
id<FxCustomParameterActionAPI_v4> action=[self actionAPI]; if(!action)return;
_refreshing=YES;
uint64_t beta=DYBetaSpanBegin(@"inspector_refresh",nil);
BOOL groupingChanged=NO;
BOOL groupingChanged=NO;NSString *recentPath=nil;
[action startAction:self];
@try {
CMTime t=action.currentTime;
@@ -843,7 +949,7 @@ static NSImage *DYWheelImage(void) {
BOOL enabled=v>=.5||extraValue>=.5;
DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
NSNumber *saved=[token isKindOfClass:DYInspectorToken.class]?token.folds[c[@"section"][@"key"]]:nil;
BOOL collapsed=saved?saved.boolValue:[c[@"collapsed"]boolValue];groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
BOOL collapsed=_workspaceEditor?NO:saved?saved.boolValue:[c[@"collapsed"]boolValue];groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
[c[@"header"]setState:collapsed?NSControlStateValueOff:NSControlStateValueOn];
[c[@"header"]setToolTip:collapsed?@"展开界面,不改变启用状态;双击还原本组":@"折叠界面,保持当前效果;双击还原本组"];
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];[c[@"header"]setNeedsDisplay:YES];
@@ -857,7 +963,7 @@ static NSImage *DYWheelImage(void) {
if(!_embedded){DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];visible=[@[@"primary",@"base",@"spider",@"hsl"]containsObject:type]||[token.folds[[@"visible:" stringByAppendingString:type]]boolValue];
if(!visible){for(NSDictionary*d in DYBaseToolDescriptors(type)){double value=[d[@"default"]doubleValue];[get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue]atTime:t];if(std::isfinite(value)&&fabs(value-[d[@"default"]doubleValue])>1e-6){visible=YES;break;}}if([tools[@"baseMasks"][type]count])visible=YES;if([type isEqual:@"look"])for(NSString *assetKey in DYReadAssets(_manager,t).paths)if([assetKey hasPrefix:@"look"])visible=YES;}
}
BOOL removed=!_embedded&&(DYBaseToolRemoved(tools,type)||!visible);groupingChanged|=[card[@"removed"]boolValue]!=removed;((NSMutableDictionary *)card)[@"removed"]=@(removed);
BOOL removed=!_embedded&&(DYBaseToolRemoved(tools,type)||(!_workspaceEditor&&!visible));groupingChanged|=[card[@"removed"]boolValue]!=removed;((NSMutableDictionary *)card)[@"removed"]=@(removed);
[card[@"maskPanel"]refreshWithDocument:tools time:t];
NSString *nodeID=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:card[@"section"][@"key"]];NSUInteger count=[DYMasksForTool(tools,nodeID) count];
[(DYMaskCountBadge*)card[@"maskBadge"]setCount:count];NSString *hint=count?[NSString stringWithFormat:@"已有 %lu 个蒙版;点击添加独立蒙版",(unsigned long)count]:@"添加本工具的独立蒙版";
@@ -877,12 +983,14 @@ static NSImage *DYWheelImage(void) {
[_assetButtons[key][@"remove"] setEnabled:path.length>0];
NSButton *eye=_assetButtons[key][@"eye"];if(eye){NSInteger slot=[[key substringFromIndex:4]integerValue];double enabled=1;[get getFloatValue:&enabled fromParameter:2040+(UInt32)slot-1 atTime:t];eye.state=enabled>=.5?NSControlStateValueOn:NSControlStateValueOff;eye.image=[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"];}
}
if(_recentBrowser)recentPath=[assets.paths[@"look0"]copy];
for(NSInteger i=1;i<5;i++)if([assets.paths[[NSString stringWithFormat:@"look%ld",(long)i]]length])_visibleLooks=MAX(_visibleLooks,i+1);
[self setNeedsLayout:YES];
} @finally { [action endAction:self]; _refreshing=NO; }
[_recentBrowser refreshRecentSelection:recentPath];[recentPath release];
// Remote layout/accessibility can re-enter the host. Let the parameter
// action and current callback unwind before notifying the remote view.
if(!_embedded)[self synchronizeTools];
if(!_embedded&&!_workspaceEditor)[self synchronizeTools];
DYBetaSpanEnd(beta,nil);
if(groupingChanged)dispatch_async(dispatch_get_main_queue(),^{NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);});
}
@@ -936,7 +1044,9 @@ static NSImage *DYWheelImage(void) {
[action startAction:self];
@try {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
if(_graphicUndoOpen){if(_graphicCancelled||CMTimeCompare(t,_graphicTime)!=0){_graphicCancelled=YES;return;}id<FxParameterRetrievalAPI_v6>get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSString*key in values){NSDictionary*d=byKey[key];double actual=NAN;if(d&&_graphicExpected[key]&&(![get getFloatValue:&actual fromParameter:[d[@"pid"]unsignedIntValue]atTime:t]||!std::isfinite(actual)||fabs(actual-[_graphicExpected[key]doubleValue])>1e-6*MAX(1.,fabs(actual)))){_graphicCancelled=YES;return;}}}
BOOL primaryEdit=NO;for(NSString *key in values) {NSDictionary *d=byKey[key];primaryEdit|=[key hasPrefix:@"cm"];double v=[values[key] doubleValue];if(!d||!std::isfinite(v))continue;v=fmax([d[@"min"]doubleValue],fmin([d[@"max"]doubleValue],v));[set setFloatValue:v toParameter:[d[@"pid"]unsignedIntValue] atTime:t];}
if(_graphicUndoOpen)for(NSString*key in values)_graphicExpected[key]=values[key];
if(primaryEdit){[set setFloatValue:1 toParameter:2236 atTime:t];[self clearPrimaryBypasses:set time:t];}
} @finally {[action endAction:self];}
[self postChanged];
@@ -944,7 +1054,7 @@ static NSImage *DYWheelImage(void) {
- (void)clearPrimaryBypasses:(id<FxParameterSettingAPI_v6>)set time:(CMTime)t{for(NSDictionary *d in DYDescriptors())if([d[@"key"]hasPrefix:@"cmbypass"])[set setFloatValue:0 toParameter:[d[@"pid"]unsignedIntValue] atTime:t];}
- (void)graphicGesture:(BOOL)begin title:(NSString *)title{
if(begin==_graphicUndoOpen)return;id<FxCustomParameterActionAPI_v4>a=[self actionAPI];if(!a)return;[a startAction:self];
@try{id<FxUndoAPI>undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];if(begin)_graphicUndoOpen=[undo startUndoGroup:title?:@"调整颜色"];else{[undo endUndoGroup];_graphicUndoOpen=NO;}}@finally{[a endAction:self];}
@try{id<FxUndoAPI>undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];if(begin){_graphicTime=a.currentTime;_graphicCancelled=NO;[_graphicExpected release];_graphicExpected=[NSMutableDictionary new];id<FxParameterRetrievalAPI_v6>get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in _controls.allValues){NSDictionary*d=r[@"descriptor"];double value=NAN;if([get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue]atTime:_graphicTime]&&std::isfinite(value))_graphicExpected[d[@"key"]]=@(value);}_graphicUndoOpen=[undo startUndoGroup:title?:@"调整颜色"];}else{[undo endUndoGroup];_graphicUndoOpen=NO;_graphicCancelled=NO;[_graphicExpected removeAllObjects];}}@finally{[a endAction:self];}
}
- (void)writeSpiderMesh:(NSData *)mesh linked:(BOOL)linked{
if(mesh.length&&!DYSpiderMeshIsValid(mesh))return;id<FxCustomParameterActionAPI_v4>a=[self actionAPI];if(!a)return;[a startAction:self];
@@ -969,6 +1079,7 @@ static NSImage *DYWheelImage(void) {
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
- (void)toggleSection:(NSButton *)sender {
if(sender.tag<0||sender.tag>=_cards.count)return;
if(!_workspaceEditor){id host=_embedded?[(DYToolManager*)_manager host]:_manager;NSString *node=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:_cards[sender.tag][@"section"][@"key"]];[NSNotificationCenter.defaultCenter postNotificationName:@"DYWorkspaceToolSelection" object:host userInfo:@{@"node":node,@"source":@"inspector"}];}
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;[action startAction:self];
@try {
id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
+4
查看文件
@@ -22,6 +22,10 @@ typedef NSProgress * (^DYLUTSelectionHandler)(NSString *path,void (^completion)(
/// Embedded content inside another remote tool workspace. It follows only the
/// supplied container and does not take ownership of the enclosing window.
- (void)embedInView:(NSView *)parent close:(void (^)(void))closeAction;
/// Lightweight recent shortcuts using the same thumbnail and selection pipeline.
/// Does not change the full browser's saved folder, grid size or layout.
- (void)embedRecentInView:(NSView *)parent;
- (void)refreshRecentSelection:(NSString *)path;
- (void)updatePalette:(NSDictionary *)palette;
/// Replace the source frame after the renderer captures a new playhead image.
/// Passing identical bytes keeps the current thumbnail jobs and cache intact.
+45 -9
查看文件
@@ -82,6 +82,7 @@ static void DYBrowserGeometrySample(NSView *root,NSString *phase){
@property BOOL chosen;
@property BOOL doubleClicked;
@property BOOL listLayout;
@property BOOL shortcut;
@end
@implementation DYBrowserTile
- (BOOL)isFlipped{return YES;}
@@ -92,7 +93,7 @@ static void DYBrowserGeometrySample(NSView *root,NSString *phase){
- (void)dealloc{[_thumbnail release];[_displayName release];[_failure release];[_palette release];[super dealloc];}
- (NSString *)accessibilityLabel{return _displayName?:@"LUT";}
- (id)accessibilityValue{return _chosen?@"已选择":_failure.length?@"LUT 无效":_thumbnail?@"可应用":@"正在生成缩略图";}
- (NSString *)accessibilityHelp{return _failure?:@"单击应用此 LUT,双击应用并关闭浏览器";}
- (NSString *)accessibilityHelp{return _failure?:_shortcut?@"点击将此 LUT 应用到当前风格图层":@"单击应用此 LUT,双击应用并关闭浏览器";}
- (void)drawRect:(NSRect)dirty{
NSRect bounds=NSInsetRect(self.bounds,1,1);
NSBezierPath *outline=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:7 yRadius:7];
@@ -163,7 +164,8 @@ static void DYBrowserGeometrySample(NSView *root,NSString *phase){
NSCache *_thumbnailCache;
dispatch_queue_t _previewQueue;
DYBrowserWork *_work;
BOOL _closed,_sizing,_visible,_remoteMode,_importing,_layingOut,_detached,_embedded;
BOOL _closed,_sizing,_visible,_remoteMode,_importing,_layingOut,_detached,_embedded,_compactRecent;
NSArray *_recentSnapshot;
NSProgress *_libraryTask,*_selectionTask;
NSTimer *_progressTimer;
NSUInteger _libraryGeneration,_selectionGeneration;
@@ -233,6 +235,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
return self;
}
- (void)dealloc{
[_recentSnapshot release];
[NSObject cancelPreviousPerformRequestsWithTarget:self];[[NSNotificationCenter defaultCenter]removeObserver:self];
[_libraryTask cancel];[_libraryTask release];[_selectionTask cancel];[_selectionTask release];[_progressTimer invalidate];[_progressTimer release];
_work.cancelled=YES;_work.owner=nil;[_work release];self.window.delegate=nil;
@@ -272,7 +275,24 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
NSAccessibilityPostNotification(parent,NSAccessibilityLayoutChangedNotification);
}
- (void)embedInView:(NSView *)parent close:(void (^)(void))closeAction{
_embedded=YES;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回示波器";
_embedded=YES;_folderScroll.hasVerticalScroller=YES;_gridScroll.hasVerticalScroller=YES;_gridScroll.hasHorizontalScroller=NO;_gridScroll.scrollerStyle=NSScrollerStyleOverlay;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回调整";
}
- (void)embedRecentInView:(NSView *)parent{
_compactRecent=YES;_embedded=YES;
[_folder release];_folder=[DYBrowserRecentFolder copy];
_root.accessibilityLabel=@"最近使用 LUT 快捷入口";
_titleLabel.stringValue=@"最近使用";_titleLabel.font=[NSFont systemFontOfSize:11 weight:NSFontWeightSemibold];
[_layoutMenu selectItemAtIndex:0];_sizeSlider.doubleValue=120;
for(NSView *view in @[_search,_importFiles,_importFolder,_reveal,_refresh,_none,_done,_sizeLabel,_sizeSlider,_layoutMenu,_splitView])view.hidden=YES;
[_root addSubview:_gridScroll];_gridScroll.hasHorizontalScroller=NO;_gridScroll.scrollerStyle=NSScrollerStyleOverlay;
[self showInRemoteParent:parent close:nil];[self refreshRecentSelection:_selectedPath];
}
- (void)refreshRecentSelection:(NSString *)path{
if(!_compactRecent||_closed)return;
if(![_selectedPath isEqualToString:path]){NSString *next=[path copy];[_selectedPath release];_selectedPath=next;}
NSArray *paths=_library.recentPaths;
if(![_recentSnapshot isEqual:paths]){[_recentSnapshot release];_recentSnapshot=[paths copy];[self rebuildGrid];}
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=[tile.identifier isEqualToString:_selectedPath];[tile setNeedsDisplay:YES];}
}
- (void)fitRemoteParent{
NSView *parent=_root.superview;if(_closed||!_remoteMode||!parent)return;
@@ -358,6 +378,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
- (void)layoutBrowser{
if(_layingOut)return;_layingOut=YES;
CGFloat w=_root.bounds.size.width,h=_root.bounds.size.height;
if(!_compactRecent){
_titleLabel.frame=NSMakeRect(14,12,160,20);_countLabel.frame=NSMakeRect(180,14,120,18);
_search.frame=NSMakeRect(14,46,MAX(125,w-350),24);
_importFiles.frame=NSMakeRect(w-322,44,100,28);_importFolder.frame=NSMakeRect(w-218,44,113,28);_refresh.frame=NSMakeRect(w-101,44,82,28);
@@ -367,9 +388,24 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
_sizeLabel.frame=NSMakeRect(211,h-39,74,18);_sizeSlider.frame=NSMakeRect(288,h-41,MIN(150,MAX(80,w-550)),20);
_done.frame=NSMakeRect(w-98,h-44,78,27);
CGFloat statusX=NSMaxX(_sizeSlider.frame)+14;_statusLabel.frame=NSMakeRect(statusX,h-39,MAX(0,w-statusX-112),18);
CGFloat fw=MAX(100,_folderScroll.contentSize.width);
if(_embedded&&!_compactRecent){
_search.frame=NSMakeRect(12,36,MAX(125,w-310),24);
_importFiles.frame=NSMakeRect(w-284,34,88,28);_importFolder.frame=NSMakeRect(w-192,34,100,28);_refresh.frame=NSMakeRect(w-88,34,76,28);
_splitView.frame=NSMakeRect(8,68,MAX(1,w-16),MAX(1,h-108));[_splitView adjustSubviews];
_reveal.hidden=w<620;_titleLabel.frame=NSMakeRect(12,8,152,20);_countLabel.frame=NSMakeRect(166,10,100,18);
_none.frame=NSMakeRect(10,h-34,70,27);_layoutMenu.frame=NSMakeRect(86,h-34,80,27);_done.frame=NSMakeRect(w-88,h-34,78,27);
BOOL small=w<650;_sizeLabel.hidden=small;_sizeSlider.hidden=small;_statusLabel.hidden=small;
if(!small){_sizeLabel.frame=NSMakeRect(174,h-29,68,18);_sizeSlider.frame=NSMakeRect(246,h-31,100,20);_statusLabel.frame=NSMakeRect(354,h-29,MAX(0,w-454),18);}
}
}
if(_compactRecent){
_titleLabel.frame=NSMakeRect(0,2,92,18);_countLabel.frame=NSMakeRect(94,2,100,18);
_statusLabel.hidden=NO;_statusLabel.frame=NSMakeRect(0,MAX(24,h-19),MAX(0,w),18);
_gridScroll.frame=NSMakeRect(0,26,MAX(1,w),MAX(1,h-49));
}
if(!_compactRecent){CGFloat fw=MAX(100,_folderScroll.contentSize.width);
_folderDocument.frame=NSMakeRect(0,0,fw,MAX(_folderPaths.count*35+4,_folderScroll.contentSize.height));
[self updateVisibleFolders];
[self updateVisibleFolders];}
CGFloat available=MAX(80,_gridScroll.contentSize.width),tileWidth=_sizeSlider.doubleValue,gap=10;
BOOL list=_layoutMenu.indexOfSelectedItem==1;NSInteger columns=list?1:MAX(1,(NSInteger)floor((available+gap)/(tileWidth+gap)));tileWidth=list?MAX(110,available-14):MIN(tileWidth,(available-gap*(columns-1)-14)/columns);tileWidth=MAX(70,tileWidth);
_columns=columns;_tileWidth=tileWidth;_tileHeight=list?70:ceil(tileWidth*9/16)+24;
@@ -380,7 +416,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
- (CGFloat)splitView:(NSSplitView *)split constrainMinCoordinate:(CGFloat)proposed ofSubviewAt:(NSInteger)index{return 128;}
- (CGFloat)splitView:(NSSplitView *)split constrainMaxCoordinate:(CGFloat)proposed ofSubviewAt:(NSInteger)index{return MIN(360,split.bounds.size.width*.45);}
- (void)splitViewDidResizeSubviews:(NSNotification *)notification{
if(_closed||_layingOut)return;_sidebarWidth=_folderScroll.frame.size.width;[NSUserDefaults.standardUserDefaults setDouble:_sidebarWidth forKey:DYBrowserPreference(DYBrowserSidebarPreference,_library)];[self layoutBrowser];
if(_closed||_layingOut||_compactRecent)return;_sidebarWidth=_folderScroll.frame.size.width;[NSUserDefaults.standardUserDefaults setDouble:_sidebarWidth forKey:DYBrowserPreference(DYBrowserSidebarPreference,_library)];[self layoutBrowser];
}
- (void)layoutChanged:(id)sender{[NSUserDefaults.standardUserDefaults setInteger:_layoutMenu.indexOfSelectedItem forKey:DYBrowserPreference(DYBrowserLayoutPreference,_library)];[self layoutBrowser];}
- (void)resetThumbnailWork {
@@ -395,7 +431,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
for(NSUInteger i=first;i<end;i++){
NSDictionary *entry=_visibleEntries[i];NSString *path=entry[@"path"];[wanted addObject:path];DYBrowserTile *tile=_tiles[path];
if(!tile){tile=[[[DYBrowserTile alloc]initWithFrame:NSZeroRect]autorelease];tile.identifier=path;tile.displayName=entry[@"name"];tile.toolTip=entry[@"relativePath"]?:path;tile.palette=_palette;tile.chosen=[path isEqualToString:_selectedPath];tile.target=self;tile.action=@selector(thumbnailClicked:);tile.enabled=YES;[_gridDocument addSubview:tile];_tiles[path]=tile;changed=YES;}
tile.listLayout=_layoutMenu.indexOfSelectedItem==1;tile.frame=NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
tile.shortcut=_compactRecent;tile.listLayout=_layoutMenu.indexOfSelectedItem==1;tile.frame=NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
}
for(NSString *path in _tiles.allKeys)if(![wanted containsObject:path]){[_tiles[path]removeFromSuperview];[_tiles removeObjectForKey:path];changed=YES;}
if(changed||!_work)[self resetThumbnailWork];
@@ -456,7 +492,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
}
- (void)endLibraryTask {
[_libraryTask release];_libraryTask=nil;[_progressTimer invalidate];[_progressTimer release];_progressTimer=nil;
_importFiles.enabled=YES;_importFolder.enabled=YES;_refresh.title=@"刷新";_done.title=@"完成";_done.toolTip=nil;
_importFiles.enabled=YES;_importFolder.enabled=YES;_refresh.title=@"刷新";_done.title=_embedded?@"返回调整":@"完成";_done.toolTip=nil;
}
- (void)reloadLibrary:(id)sender{
if(_libraryTask){[_libraryTask cancel];[self setStatus:@"正在取消…"];return;}
@@ -533,7 +569,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
- (void)thumbnailClicked:(DYBrowserTile *)sender{
if(!sender.enabled||sender.failure.length)return;
[_selectionTask cancel];[_selectionTask release];NSUInteger generation=++_selectionGeneration;
NSString *path=sender.identifier,*name=sender.displayName;BOOL closeAfter=sender.doubleClicked;[self setStatus:[@"正在载入 " stringByAppendingString:name]];
NSString *path=sender.identifier,*name=sender.displayName;BOOL closeAfter=sender.doubleClicked&&!_compactRecent;[self setStatus:[@"正在载入 " stringByAppendingString:name]];
void (^applied)(NSError *)=^(NSError *error){
if(_closed||generation!=_selectionGeneration)return;[_selectionTask release];_selectionTask=nil;
if(error){[self setStatus:error.localizedDescription];return;}
+47 -1
查看文件
@@ -3,7 +3,7 @@
id<MTLComputePipelineState>p=[self managedKernel:@"dyManagedPreview" entry:entry error:nil];if(!p)return;
id<MTLBuffer>b=[entry[@"device"]newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];if(!b)return;
id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:p];[ce setTexture:texture atIndex:0];[ce setBuffer:b offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];
if(cb.status==MTLCommandBufferStatusCompleted){@synchronized(_previewLock){[_preview release];_preview=[[NSData alloc]initWithBytes:b.contents length:b.length];[_histogram release];_histogram=[DYHistogramFromRGBA(_preview) retain];[_lookLUTPreview release];if(origin==kFxImageOrigin_BOTTOM_LEFT){NSMutableData *flipped=[NSMutableData dataWithLength:b.length];for(NSUInteger y=0;y<180;y++)memcpy((uint8_t*)flipped.mutableBytes+y*320*16,(uint8_t*)b.contents+(179-y)*320*16,320*16);_lookLUTPreview=[flipped copy];}else _lookLUTPreview=[_preview retain];_lastPreview=CACurrentMediaTime();}dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}[b release];
if(cb.status==MTLCommandBufferStatusCompleted){@synchronized(_previewLock){[_preview release];_preview=[[NSData alloc]initWithBytes:b.contents length:b.length];[_lookLUTPreview release];if(origin==kFxImageOrigin_BOTTOM_LEFT){NSMutableData *flipped=[NSMutableData dataWithLength:b.length];for(NSUInteger y=0;y<180;y++)memcpy((uint8_t*)flipped.mutableBytes+y*320*16,(uint8_t*)b.contents+(179-y)*320*16,320*16);_lookLUTPreview=[flipped copy];}else _lookLUTPreview=[_preview retain];_lastPreview=CACurrentMediaTime();}dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}[b release];
}
// Included in DYRenderer. V1 callers and their ABI remain on renderSource:...tools:error:.
- (NSDictionary*)colorContext {@synchronized(_previewLock){return [[_colorContext copy]autorelease];}}
@@ -24,11 +24,57 @@
- (BOOL)managedProfile:(DYColorProfile*)profile input:(id<MTLTexture>)input output:(id<MTLTexture>)output entry:(NSMutableDictionary*)entry error:(NSError**)error {
if(!profile)return NO;NSMutableDictionary*cache=entry[@"managedProfiles"];if(!cache){cache=[NSMutableDictionary dictionary];entry[@"managedProfiles"]=cache;}DYColorProfileGPU*p=cache[profile.key];if(!p){p=[[[DYColorProfileGPU alloc]initWithDevice:entry[@"device"] profile:profile error:error]autorelease];if(!p)return NO;if(cache.count>=16)[cache removeAllObjects];cache[profile.key]=p;}return [p renderInput:input output:output alpha:dycm::Alpha::Premultiplied workspaceBudget:2ull*1024*1024*1024 cancelled:nullptr error:error];
}
// Each stamp reads the same original frame. A later stamp may cover an
// earlier one, but overlapping source and destination never feed back.
- (FxImageTile*)sourceByApplyingStamps:(NSArray*)masks source:(FxImageTile*)source registry:(uint64_t)registry error:(NSError**)error{
std::vector<DYCloneStamp> stamps;
FxRect image=source.imagePixelBounds,bounds=source.tilePixelBounds;
if(image.right<=image.left||image.top<=image.bottom)return source;
for(NSDictionary *mask in masks){
NSArray *patch=mask[@"stampSource"];
if(!patch||![mask[@"enabled"]boolValue])continue;
DYMaskParameters p=DYMaskAtTime(mask,kCMTimeInvalid);
if(p.strength<=0)continue;
stamps.push_back({p.centerX,p.centerY,[patch[0]floatValue],[patch[1]floatValue],
2/p.width,2/p.height,p.feather,p.strength,p.inputBlack,p.inputWhite,p.inputGamma});
}
if(stamps.empty())return source;
if(image.left!=bounds.left||image.right!=bounds.right||image.top!=bounds.top||image.bottom!=bounds.bottom){
fail(error,@"仿制图章需要宿主提供完整的源画面。");return nil;
}
NSDictionary *entry=[self device:registry error:error];if(!entry)return nil;
id<MTLDevice>device=entry[@"device"];
id<MTLTexture>input=[source metalTextureForDevice:device];
if(!input||input.framebufferOnly){fail(error,@"仿制图章无法读取源画面。");return nil;}
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA32Float width:input.width height:input.height mipmapped:NO];
desc.storageMode=MTLStorageModePrivate;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
id<MTLTexture>output=[[device newTextureWithDescriptor:desc]autorelease];
id<MTLCommandBuffer>commands=[entry[@"queue"]commandBuffer];
id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];
if(!output||!encoder){fail(error,@"无法分配仿制图章缓冲区。");return nil;}
uint32_t count=(uint32_t)stamps.size(),flip=source.imageOrigin==kFxImageOrigin_BOTTOM_LEFT;
[encoder setComputePipelineState:entry[@"dyCloneStamps"]];
[encoder setTexture:input atIndex:0];[encoder setTexture:output atIndex:1];
[encoder setBytes:stamps.data() length:count*sizeof(DYCloneStamp) atIndex:0];
[encoder setBytes:&count length:sizeof(count) atIndex:1];[encoder setBytes:&flip length:sizeof(flip) atIndex:2];
[encoder dispatchThreads:MTLSizeMake(output.width,output.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];
[encoder endEncoding];[commands commit];[commands waitUntilCompleted];
if(commands.status!=MTLCommandBufferStatusCompleted){fail(error,commands.error.localizedDescription);return nil;}
DYExportTile *tile=[[[DYExportTile alloc]initWithTexture:output registry:registry]autorelease];
[tile setBounds:bounds origin:source.imageOrigin];[tile setPixelAspect:source.pixelAspect];[tile inheritColorSpace:source.colorSpace];
return tile;
}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state hostPrimaries:(NSInteger)primaries error:(NSError**)error {@synchronized(self){return DYRenderWithPool(error,[&]()->BOOL{
if(state&&![state isKindOfClass:NSDictionary.class])return fail(error,@"色彩管理状态无效。");
NSDictionary*context=DYHostColorContext(src,dst,primaries);@synchronized(_previewLock){[_colorContext release];_colorContext=[context copy];}
if(tools[@"sharedMasks"]){
if(!DYValidToolDocument(tools))return fail(error,@"调色层或蒙版数据无效。");
FxImageTile *stamped=[self sourceByApplyingStamps:DYSharedMasks(tools) source:src registry:dst.deviceRegistryID error:error];if(!stamped)return NO;
return [self renderSource:stamped destination:dst uniforms:u paths:paths spider:spider tools:DYResolvedToolDocument(tools) colorManagement:state hostPrimaries:primaries error:error];
}
if(!state.count)return [self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools error:error];
if(!DYManagedColorValid(state,error))return NO;if(!tools)tools=@{@"schema":@2,@"layers":@[],@"baseMasks":@{}};if(!DYValidToolDocument(tools))return fail(error,@"调色层或蒙版数据无效。");
if(tools[@"sharedMasks"])tools=DYResolvedToolDocument(tools);
if(DYPrimaryColorState(state))return [self renderPrimarySource:src destination:dst uniforms:u paths:paths spider:spider tools:tools hostPrimaries:primaries error:error];
NSMutableDictionary*entry=[self device:dst.deviceRegistryID error:error];if(!entry)return NO;id<MTLDevice>d=entry[@"device"];id<MTLTexture>source=[src metalTextureForDevice:d];if(!source)return fail(error,@"色彩管理输入纹理不可用。");
uint64_t pixels=uint64_t(source.width)*source.height;if(!pixels||pixels>64ull*1024*1024||pixels*16*8>MAX(768ull*1024*1024,MIN(2ull*1024*1024*1024,d.recommendedMaxWorkingSetSize/2)))return fail(error,@"当前画面超过色彩管理内存预算。");
+45 -15
查看文件
@@ -1,15 +1,29 @@
// Native per-tool mask editor, shared by original and repeated tool cards.
@interface DYToolMaskPanel : DYFlippedView
@interface DYToolMaskPanel : DYFlippedView<DYWorkspaceMaskEditing>
@property(nonatomic,readonly) CGFloat contentHeight;
@property(nonatomic,readonly) CGFloat contentWidth;
@property(nonatomic) BOOL workspaceMode;
@property(nonatomic,readonly) NSString *selectedMaskID;
- (instancetype)initWithManager:(id<PROAPIAccessing>)manager nodeID:(NSString*)nodeID;
- (void)refreshWithDocument:(NSDictionary*)document time:(CMTime)time;
- (void)addMenu:(NSView*)anchor;
- (void)selectMaskID:(NSString*)maskID;
@end
@implementation DYToolMaskPanel {
id<PROAPIAccessing> _host;NSString *_nodeID,*_maskID;NSDictionary *_document;CMTime _time;
NSPopUpButton *_list,*_combine;NSButton *_eye,*_add,*_remove,*_invert,*_canvas,*_clear,*_penRedraw,*_penFinish,*_penCancel;NSMutableArray *_rows,*_tracking;NSTextField *_trackingTitle,*_status;BOOL _refreshing,_drawing,_canvasActive;CGFloat _contentHeight;
NSPopUpButton *_list,*_combine;NSButton *_eye,*_add,*_remove,*_invert,*_canvas,*_clear,*_penRedraw,*_penFinish,*_penCancel;NSMutableArray *_rows,*_tracking;NSTextField *_trackingTitle,*_status;BOOL _refreshing,_drawing,_canvasActive,_workspaceMode;CGFloat _contentHeight;
}
@synthesize workspaceMode=_workspaceMode;
- (NSString*)selectedMaskID{return _maskID;}
- (void)setWorkspaceMode:(BOOL)workspaceMode{if(_workspaceMode==workspaceMode)return;_workspaceMode=workspaceMode;[self setNeedsLayout:YES];}
- (CGFloat)contentHeight{return _workspaceMode?self.bounds.size.height:_contentHeight;}
- (CGFloat)contentWidth{
if(!_workspaceMode)return self.bounds.size.width;NSUInteger count=0;for(NSDictionary *row in _rows)if(![row[@"label"]isHidden])count++;NSInteger perColumn=MAX(1,NSInteger((self.bounds.size.height-48)/44));BOOL pen=!_penRedraw.hidden,shape=_tracking.count&&![_tracking[0]isHidden];CGFloat actions=216;if(pen&&shape&&self.bounds.size.height<242)actions+=216;return MAX(536,16+ceil(double(count)/perColumn)*184+actions);
}
- (void)selectMaskID:(NSString*)maskID{
if([_maskID isEqual:maskID]){if(!_canvasActive)[self canvas:nil];return;}BOOL found=NO;for(NSDictionary *mask in DYMasksForTool(_document,_nodeID))if([mask[@"id"]isEqual:maskID]){found=YES;break;}if(!found)return;
[_maskID release];_maskID=[maskID copy];_drawing=_canvasActive=NO;[self refreshWithDocument:_document time:_time];[self canvas:nil];
}
@synthesize contentHeight=_contentHeight;
- (instancetype)initWithManager:(id<PROAPIAccessing>)manager nodeID:(NSString*)nodeID{
if((self=[super initWithFrame:NSZeroRect])){_host=manager;_nodeID=[nodeID copy];_rows=[NSMutableArray new];_tracking=[NSMutableArray new];self.identifier=@"toolMasks";
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(trackingStatus:) name:@"DYToolTrackingStatus" object:_host];
@@ -30,7 +44,7 @@
_penCancel=[DYButton(@"取消绘制",self,@selector(penCommand:))retain];_penCancel.toolTip=@"取消当前绘制,保留原蒙版路径";_penCancel.accessibilityLabel=@"取消钢笔绘制";[self addSubview:_penCancel];
_clear=[DYButton(@"清除轨迹",self,@selector(clear:))retain];[self addSubview:_clear];
NSArray *names=@[@"强度",@"羽化",@"中心 X",@"中心 Y",@"宽度",@"高度",@"旋转",@"渐变宽度",@"色相中心",@"色相范围",@"色相柔边",@"饱和度下限",@"饱和度上限",@"亮度下限",@"亮度上限",@"输入黑",@"输入白",@"输入伽马"];
for(NSInteger i=0;i<names.count;i++){NSTextField *label=[DYLabel(names[i],13)retain];label.font=[NSFont systemFontOfSize:13 weight:NSFontWeightMedium];NSSlider *slider=[[NSSlider alloc]initWithFrame:NSZeroRect];slider.tag=i;slider.target=self;slider.action=@selector(valueChanged:);slider.continuous=NO;slider.controlSize=NSControlSizeRegular;slider.accessibilityLabel=[names[i]stringByAppendingString:@"蒙版"];NSTextField *field=[[NSTextField alloc]initWithFrame:NSZeroRect];field.cell=[[[DYNumberFieldCell alloc]initTextCell:@"0"]autorelease];field.font=[NSFont monospacedDigitSystemFontOfSize:13 weight:NSFontWeightMedium];field.textColor=DYInk();field.backgroundColor=DYThemeColor(@"field");field.bezeled=NO;field.bordered=NO;field.drawsBackground=NO;field.tag=i;field.target=self;field.action=@selector(valueChanged:);field.accessibilityLabel=[names[i]stringByAppendingString:@"蒙版数值"];field.alignment=NSTextAlignmentCenter;[self addSubview:label];[self addSubview:slider];[self addSubview:field];[_rows addObject:@{@"label":label,@"slider":slider,@"field":field}];[label release];[slider release];[field release];}
for(NSInteger i=0;i<names.count;i++){NSTextField *label=[DYLabel(names[i],13)retain];label.font=[NSFont systemFontOfSize:13 weight:NSFontWeightMedium];NSSlider *slider=[[NSSlider alloc]initWithFrame:NSZeroRect];slider.tag=i;slider.target=self;slider.action=@selector(valueChanged:);slider.continuous=NO;slider.controlSize=NSControlSizeRegular;slider.accessibilityLabel=[names[i]stringByAppendingString:@"蒙版"];NSTextField *field=[[NSTextField alloc]initWithFrame:NSZeroRect];field.cell=[[[DYNumberFieldCell alloc]initTextCell:@"0"]autorelease];field.font=[NSFont monospacedDigitSystemFontOfSize:13 weight:NSFontWeightMedium];field.textColor=DYInk();field.backgroundColor=DYThemeColor(@"field");field.bezeled=NO;field.bordered=NO;field.drawsBackground=NO;field.editable=YES;field.selectable=YES;field.tag=i;field.target=self;field.action=@selector(valueChanged:);field.accessibilityLabel=[names[i]stringByAppendingString:@"蒙版数值"];field.alignment=NSTextAlignmentCenter;[self addSubview:label];[self addSubview:slider];[self addSubview:field];[_rows addObject:@{@"label":label,@"slider":slider,@"field":field}];[label release];[slider release];[field release];}
NSArray *titles=@[@"反向单帧",@"反向跟踪",@"双向跟踪",@"正向跟踪",@"正向单帧",@"取消跟踪"];
for(int i=0;i<6;i++){NSButton *b=DYButton(titles[i],self,@selector(track:));b.tag=((int[]){-2,-1,0,1,2,9})[i];b.font=[NSFont systemFontOfSize:13 weight:NSFontWeightMedium];b.controlSize=NSControlSizeRegular;b.accessibilityLabel=@[@"反向跟踪一帧",@"反向蒙版跟踪",@"双向蒙版跟踪",@"正向蒙版跟踪",@"正向跟踪一帧",@"取消蒙版跟踪"][i];[self addSubview:b];[_tracking addObject:b];}
for(NSButton *b in @[_eye,_add,_remove,_canvas,_clear,_penRedraw,_penFinish,_penCancel]){b.controlSize=NSControlSizeRegular;b.font=[NSFont systemFontOfSize:(b==_add||b==_remove)?18:13 weight:NSFontWeightMedium];}
@@ -41,21 +55,35 @@
- (NSDictionary*)mask{for(NSDictionary *m in DYMasksForTool(_document,_nodeID))if([m[@"id"]isEqual:_maskID])return m;return nil;}
- (void)refreshWithDocument:(NSDictionary*)doc time:(CMTime)time{
_refreshing=YES;NSDictionary *saved=[doc copy];[_document release];_document=saved;_time=time;NSArray *masks=DYMasksForTool(doc,_nodeID);if(masks.count)[self buildControls];[_list removeAllItems];NSInteger selected=0,index=0;
for(NSDictionary *m in masks){DYMaskParameters p=DYMaskAtTime(m,time);[_list addItemWithTitle:[NSString stringWithFormat:@"%@ %ld",@[@"椭圆",@"矩形",@"钢笔",@"线性渐变",@"HSL 选区",@"亮度选区"][p.kind],(long)index+1]];if([m[@"id"]isEqual:_maskID])selected=index;index++;}
if(!masks.count){_contentHeight=0;_drawing=_canvasActive=NO;_refreshing=NO;return;}[_list selectItemAtIndex:selected];if(![_maskID isEqual:masks[selected][@"id"]])_drawing=_canvasActive=NO;[_maskID release];_maskID=[masks[selected][@"id"]copy];NSDictionary *m=[self mask];DYMaskParameters p=DYMaskAtTime(m,time);if(p.kind!=DYMaskBezier)_drawing=NO;
for(NSDictionary *m in masks){DYMaskParameters p=DYMaskAtTime(m,time);[_list addItemWithTitle:[NSString stringWithFormat:@"%@ %ld",m[@"stampSource"]?@"仿制图章":@[@"椭圆",@"矩形",@"钢笔",@"线性渐变",@"HSL 选区",@"亮度选区"][p.kind],(long)index+1]];if([m[@"id"]isEqual:_maskID])selected=index;index++;}
if(!masks.count){_contentHeight=0;_drawing=_canvasActive=NO;[_maskID release];_maskID=nil;_refreshing=NO;return;}[_list selectItemAtIndex:selected];if(![_maskID isEqual:masks[selected][@"id"]])_drawing=_canvasActive=NO;[_maskID release];_maskID=[masks[selected][@"id"]copy];NSDictionary *m=[self mask];DYMaskParameters p=DYMaskAtTime(m,time);if(p.kind!=DYMaskBezier)_drawing=NO;
BOOL stamp=m[@"stampSource"]!=nil;_combine.hidden=_invert.hidden=stamp;
_eye.state=[m[@"enabled"]boolValue]?NSControlStateValueOn:NSControlStateValueOff;_eye.image=[NSImage imageWithSystemSymbolName:[m[@"enabled"]boolValue]?@"eye":@"eye.slash" accessibilityDescription:@"启用蒙版"];[_combine selectItemAtIndex:[m[@"combine"]integerValue]];_invert.state=(p.flags&DYMaskInvert)?NSControlStateValueOn:NSControlStateValueOff;
float values[]={p.strength,p.feather,p.centerX,p.centerY,p.width,p.height,float(p.angle*180.f/M_PI),p.gradientWidth,p.hueCenterTurns*360.f,p.hueCoreHalfWidth*360.f,p.hueSoftWidth*360.f,p.saturationRange.low,p.saturationRange.high,p.lightnessRange.low,p.lightnessRange.high,p.inputBlack,p.inputWhite,p.inputGamma};
NSInteger visible=0;for(NSInteger i=0;i<_rows.count;i++){BOOL show=i==0||(i==1&&p.kind<3)||(i>=2&&i<=6&&p.kind<4)||(i==7&&p.kind==3)||(i>=8&&i<=14&&p.kind==4)||(i>=15&&p.kind>=4);NSDictionary *row=_rows[i];for(NSView *v in row.allValues)v.hidden=!show;if(!show)continue;visible++;double lo=0,hi=1;if(i==2||i==3)lo=-1,hi=2;if(i==4||i==5||i==7)lo=.001,hi=2;if(i==6)lo=-180,hi=180;if(i==8)hi=360;if(i==9||i==10)hi=180;if(i==15)hi=.99;if(i==16)lo=.01,hi=2;if(i==17)lo=.01,hi=4;NSSlider *slider=row[@"slider"];slider.minValue=lo;slider.maxValue=hi;slider.doubleValue=values[i];[row[@"field"]setStringValue:[NSString stringWithFormat:@"%.3f",values[i]]];}
NSInteger visible=0;for(NSInteger i=0;i<_rows.count;i++){BOOL show=i==0||(i==1&&p.kind<3)||(i>=2&&i<=6&&p.kind<4&&(!stamp||i!=6))||(i==7&&p.kind==3)||(i>=8&&i<=14&&p.kind==4)||(i>=15&&p.kind>=4);NSDictionary *row=_rows[i];for(NSView *v in row.allValues)v.hidden=!show;if(!show)continue;visible++;double lo=0,hi=1;if(i==2||i==3)lo=-1,hi=2;if(i==4||i==5||i==7)lo=.001,hi=2;if(i==6)lo=-180,hi=180;if(i==8)hi=360;if(i==9||i==10)hi=180;if(i==15)hi=.99;if(i==16)lo=.01,hi=2;if(i==17)lo=.01,hi=4;NSSlider *slider=row[@"slider"];slider.minValue=lo;slider.maxValue=hi;slider.doubleValue=values[i];[row[@"field"]setStringValue:[NSString stringWithFormat:@"%.3f",values[i]]];}
BOOL shape=p.kind<3;for(NSButton *b in _tracking)b.hidden=!shape;_trackingTitle.hidden=!shape;_clear.hidden=!shape;_clear.enabled=[m[@"keys"]count]>0;
BOOL pen=p.kind==DYMaskBezier;_penRedraw.hidden=!pen;_penFinish.hidden=!pen;_penCancel.hidden=!pen;
[self updateDrawingControls];
_status.stringValue=m[@"status"]?:([m[@"keys"]count]?[NSString stringWithFormat:@"%lu 个轨迹键 · 修改几何会在当前帧建立手工键",(unsigned long)[m[@"keys"]count]]:pen?@"重画钢笔后,点击起点或“完成绘制”闭合;取消或 Esc 保留原路径。":@"各蒙版只影响当前工具层");
if([_nodeID isEqual:@"shared"]){_list.accessibilityLabel=@"共享蒙版";_add.toolTip=@"添加共享蒙版";_remove.toolTip=@"删除此共享蒙版及其模块关联,可撤销";if(!m[@"status"]&&!pen&&![m[@"keys"]count])_status.stringValue=[NSString stringWithFormat:@"共享给 %lu 个模块 · 编辑与跟踪同步更新所有关联模块",(unsigned long)DYToolIDsForSharedMask(doc,_maskID).count];}
if(stamp){_remove.toolTip=@"删除仿制图章,可撤销";if(!m[@"status"]&&![m[@"keys"]count])_status.stringValue=@"取样中心固定,跟踪覆盖区域。";}
// Keep every scalar readable at the narrowest native inspector width. A
// label/value line and a separate full-width slider avoid compressed controls.
_contentHeight=136+(pen?84:0)+visible*58+(shape?184:0)+58;[self setNeedsLayout:YES];_refreshing=NO;
}
- (void)layout{
[super layout];CGFloat w=self.bounds.size.width;
if(_workspaceMode){
CGFloat h=self.bounds.size.height;_eye.frame=NSMakeRect(8,4,26,28);_list.frame=NSMakeRect(38,4,132,28);_add.frame=NSMakeRect(174,4,26,28);_remove.frame=NSMakeRect(204,4,26,28);_combine.frame=NSMakeRect(242,4,92,28);_invert.frame=NSMakeRect(344,6,68,24);_canvas.frame=NSMakeRect(422,4,100,28);
NSInteger perColumn=MAX(1,NSInteger((h-48)/44));NSUInteger index=0;
for(NSDictionary *row in _rows){NSTextField *label=row[@"label"];if(label.hidden)continue;CGFloat x=8+(index/perColumn)*184,y=42+(index%perColumn)*44;label.font=[NSFont systemFontOfSize:11];label.frame=NSMakeRect(x,y+3,100,18);[row[@"field"]setFont:[NSFont monospacedDigitSystemFontOfSize:11 weight:NSFontWeightRegular]];[row[@"field"]setFrame:NSMakeRect(x+108,y,66,22)];[row[@"slider"]setFrame:NSMakeRect(x,y+23,174,18)];index++;}
CGFloat x=16+ceil(double(index)/perColumn)*184,y=42,aw=200;BOOL shape=_tracking.count&&![_tracking[0]isHidden],pen=_penRedraw&&!_penRedraw.hidden;
if(pen){_penRedraw.frame=NSMakeRect(x,y,aw,25);y+=29;_penFinish.frame=NSMakeRect(x,y,97,25);_penCancel.frame=NSMakeRect(x+103,y,97,25);y+=33;}
if(shape){if(y+135>h-4){x+=216;y=42;}_trackingTitle.frame=NSMakeRect(x,y,aw,18);y+=20;const int order[]={0,4,1,3,2,5};for(int i=0;i<6;i++)[_tracking[order[i]]setFrame:NSMakeRect(x+(i%2)*103,y+(i/2)*28,97,25)];y+=87;_clear.frame=NSMakeRect(x,y,aw,25);y+=28;}
// Pen and tracking actions get adjacent columns when the short strip cannot
// hold both; no vertical clipping and no hidden controls below the viewport.
if(y+32>h){x+=216;y=42;}_status.font=[NSFont systemFontOfSize:10];_status.frame=NSMakeRect(x,y,aw,MIN(54,MAX(26,h-y-4)));return;
}
_eye.frame=NSMakeRect(0,4,32,34);_list.frame=NSMakeRect(38,4,MAX(60,w-114),34);_add.frame=NSMakeRect(w-70,4,32,34);_remove.frame=NSMakeRect(w-32,4,32,34);
CGFloat combineWidth=MIN(112,MAX(90,w*.45));_combine.frame=NSMakeRect(0,46,combineWidth,34);_invert.frame=NSMakeRect(combineWidth+12,49,MAX(70,w-combineWidth-12),28);_canvas.frame=NSMakeRect(0,88,w,36);
CGFloat y=136;if(_penRedraw&&!_penRedraw.hidden){CGFloat bw=(w-8)/2;_penRedraw.frame=NSMakeRect(0,y,bw,34);_penFinish.frame=NSMakeRect(bw+8,y,bw,34);_penCancel.frame=NSMakeRect(0,y+40,w,34);y+=84;}for(NSDictionary *r in _rows){NSTextField *label=r[@"label"];if(label.hidden)continue;label.frame=NSMakeRect(2,y+6,MAX(60,w-100),22);[r[@"field"]setFrame:NSMakeRect(w-90,y,88,32)];[r[@"slider"]setFrame:NSMakeRect(0,y+32,w,24)];y+=58;}
@@ -67,21 +95,23 @@
- (void)add:(id)sender{[self addMenu:_add];}
- (void)addMenu:(NSView*)anchor{NSMenu *menu=[[[NSMenu alloc]initWithTitle:@"添加蒙版"]autorelease];for(int i=0;i<6;i++){NSMenuItem *item=[menu addItemWithTitle:@[@"椭圆",@"矩形",@"钢笔",@"线性渐变",@"HSL 选区",@"亮度选区"][i] action:@selector(addKind:) keyEquivalent:@""];item.target=self;item.tag=i;}[menu popUpMenuPositioningItem:nil atLocation:NSMakePoint(0,anchor.bounds.size.height) inView:anchor];}
- (void)addKind:(NSMenuItem*)sender{
id<FxCustomParameterActionAPI_v4>a=[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(_host,a.currentTime).document);NSMutableArray *masks=[[DYMasksForTool(doc,_nodeID)mutableCopy]autorelease];if(masks.count>=DYToolMaskLimit){NSBeep();return;}NSDictionary *mask=DYNewMask(sender.tag);[masks addObject:mask];if(!DYSetToolMasks(doc,_nodeID,masks))return;[_maskID release];_maskID=[mask[@"id"]copy];NSDictionary *staged=[doc copy];[_document release];_document=staged;[self sendCanvasDrawing:sender.tag==DYMaskBezier];id<FxUndoAPI>undo=[_host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"添加工具蒙版"];DYWriteTools(_host,doc,a.currentTime);[undo endUndoGroup];[_maskID release];_maskID=[mask[@"id"]copy];}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_host];[self sendCanvasDrawing:sender.tag==DYMaskBezier];}
id<FxCustomParameterActionAPI_v4>a=[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(_host,a.currentTime).document);BOOL shared=[_nodeID isEqual:@"shared"];NSMutableArray *masks=[[DYMasksForTool(doc,_nodeID)mutableCopy]autorelease];if(masks.count>=(shared?DYSharedMaskLimit:DYToolMaskLimit)){NSBeep();return;}NSDictionary *mask=shared?DYAddSharedMask(doc,sender.tag):DYNewMask(sender.tag);if(!mask)return;if(!shared){[masks addObject:mask];if(!DYSetToolMasks(doc,_nodeID,masks))return;}[_maskID release];_maskID=[mask[@"id"]copy];NSDictionary *staged=[doc copy];[_document release];_document=staged;[self sendCanvasDrawing:sender.tag==DYMaskBezier];id<FxUndoAPI>undo=[_host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:shared?@"添加共享蒙版":@"添加工具蒙版"];DYWriteTools(_host,doc,a.currentTime);[undo endUndoGroup];[_maskID release];_maskID=[mask[@"id"]copy];}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_host];[self sendCanvasDrawing:sender.tag==DYMaskBezier];}
- (void)selection:(id)sender{NSArray *m=DYMasksForTool(_document,_nodeID);if(_list.indexOfSelectedItem<0||_list.indexOfSelectedItem>=m.count)return;[_maskID release];_maskID=[m[_list.indexOfSelectedItem][@"id"]copy];[self refreshWithDocument:_document time:_time];[self canvas:nil];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_host];}
- (void)remove:(id)sender{[self edit:@"删除工具蒙版" block:^(NSMutableDictionary *doc,NSMutableDictionary *mask){NSMutableArray *masks=[[DYMasksForTool(doc,self->_nodeID)mutableCopy]autorelease];[masks removeObject:mask];DYSetToolMasks(doc,self->_nodeID,masks);}];[self canvas:nil];}
- (void)enabled:(NSButton*)sender{[self edit:@"启停蒙版" block:^(NSMutableDictionary *d,NSMutableDictionary *m){m[@"enabled"]=@(sender.state==NSControlStateValueOn);}];}
- (void)combine:(id)sender{[self edit:@"蒙版组合" block:^(NSMutableDictionary *d,NSMutableDictionary *m){m[@"combine"]=@(self->_combine.indexOfSelectedItem);}];}
- (void)inverted:(NSButton*)sender{[self edit:@"反转蒙版" block:^(NSMutableDictionary *d,NSMutableDictionary *m){DYMaskParameters p;[m[@"parameters"]getBytes:&p length:sizeof(p)];if(sender.state)p.flags|=DYMaskInvert;else p.flags&=~DYMaskInvert;m[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];}];}
- (void)valueChanged:(NSControl*)sender{if(_refreshing)return;double value=sender.doubleValue;if(!std::isfinite(value)){NSBeep();return;}NSInteger i=sender.tag;[self edit:@"调整工具蒙版" block:^(NSMutableDictionary *d,NSMutableDictionary *m){DYMaskParameters p=DYMaskAtTime(m,self->_time);float *fields[]={&p.strength,&p.feather,&p.centerX,&p.centerY,&p.width,&p.height,&p.angle,&p.gradientWidth,&p.hueCenterTurns,&p.hueCoreHalfWidth,&p.hueSoftWidth,&p.saturationRange.low,&p.saturationRange.high,&p.lightnessRange.low,&p.lightnessRange.high,&p.inputBlack,&p.inputWhite,&p.inputGamma};*fields[i]=(i==6?value*M_PI/180:i>=8&&i<=10?value/360:value);if(p.kind==DYMaskHSLKey)p.flags|=DYMaskHueEnabled|DYMaskSaturationEnabled|DYMaskLightnessEnabled;if(!dyValidMaskParameters(p))return;if([m[@"keys"]count]&&i<8){NSMutableArray *keys=[[m[@"keys"]mutableCopy]autorelease];[keys filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSDictionary *key,NSDictionary *bindings){CMTime t=CMTimeMakeWithEpoch([key[@"value"]longLongValue],[key[@"scale"]intValue],[key[@"epoch"]longLongValue]);return CMTimeCompare(t,self->_time)!=0;}]];[keys addObject:DYMaskKey(self->_time,p,YES,1)];[keys sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){CMTime x=CMTimeMakeWithEpoch([a[@"value"]longLongValue],[a[@"scale"]intValue],[a[@"epoch"]longLongValue]),y=CMTimeMakeWithEpoch([b[@"value"]longLongValue],[b[@"scale"]intValue],[b[@"epoch"]longLongValue]);return (NSComparisonResult)CMTimeCompare(x,y);}];m[@"keys"]=keys;}else m[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];}];}
- (void)valueChanged:(NSControl*)sender{if(_refreshing)return;double value=sender.doubleValue;if([sender isKindOfClass:NSTextField.class]){NSString *text=[sender.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];NSScanner *scanner=[NSScanner scannerWithString:text];if(![scanner scanDouble:&value]||!scanner.isAtEnd){NSBeep();[self refreshWithDocument:_document time:_time];return;}}if(!std::isfinite(value)){NSBeep();return;}NSInteger i=sender.tag;[self edit:@"调整工具蒙版" block:^(NSMutableDictionary *d,NSMutableDictionary *m){BOOL stamp=m[@"stampSource"]!=nil,position=i==2||i==3;DYMaskParameters p=DYMaskAtTime(m,stamp&&!position?kCMTimeInvalid:self->_time);float *fields[]={&p.strength,&p.feather,&p.centerX,&p.centerY,&p.width,&p.height,&p.angle,&p.gradientWidth,&p.hueCenterTurns,&p.hueCoreHalfWidth,&p.hueSoftWidth,&p.saturationRange.low,&p.saturationRange.high,&p.lightnessRange.low,&p.lightnessRange.high,&p.inputBlack,&p.inputWhite,&p.inputGamma};*fields[i]=(i==6?value*M_PI/180:i>=8&&i<=10?value/360:value);if(p.kind==DYMaskHSLKey)p.flags|=DYMaskHueEnabled|DYMaskSaturationEnabled|DYMaskLightnessEnabled;if(!dyValidMaskParameters(p))return;if([m[@"keys"]count]&&(stamp?position:i<8)){NSMutableArray *keys=[[m[@"keys"]mutableCopy]autorelease];[keys filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSDictionary *key,NSDictionary *bindings){CMTime t=CMTimeMakeWithEpoch([key[@"value"]longLongValue],[key[@"scale"]intValue],[key[@"epoch"]longLongValue]);return CMTimeCompare(t,self->_time)!=0;}]];[keys addObject:DYMaskKey(self->_time,p,YES,1)];[keys sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){CMTime x=CMTimeMakeWithEpoch([a[@"value"]longLongValue],[a[@"scale"]intValue],[a[@"epoch"]longLongValue]),y=CMTimeMakeWithEpoch([b[@"value"]longLongValue],[b[@"scale"]intValue],[b[@"epoch"]longLongValue]);return (NSComparisonResult)CMTimeCompare(x,y);}];m[@"keys"]=keys;}else m[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];}];}
- (void)updateDrawingControls{for(NSButton *button in _tracking)button.enabled=!_drawing;_clear.enabled=!_drawing&&[[self mask][@"keys"]count]>0;_penFinish.enabled=_drawing;_penCancel.enabled=_drawing;}
- (void)canvasSelected:(NSNotification*)n{_canvasActive=[n.userInfo[@"node"]isEqual:_nodeID]&&[n.userInfo[@"mask"]length];if(_canvasActive){NSString *ID=[n.userInfo[@"mask"]copy];[_maskID release];_maskID=ID;_drawing=[n.userInfo[@"draw"]boolValue];}else _drawing=NO;[self updateDrawingControls];}
- (void)canvasState:(NSNotification*)n{if(!_canvasActive||![n.userInfo[@"node"]isEqual:_nodeID]||![n.userInfo[@"mask"]isEqual:_maskID])return;_drawing=[n.userInfo[@"drawing"]boolValue];[self updateDrawingControls];}
- (void)sendCanvasDrawing:(BOOL)drawing{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:_host userInfo:@{@"node":_nodeID,@"mask":_maskID?:@"",@"document":_document?:@{},@"draw":@(drawing)}];}
- (NSString*)canvasNodeID{return DYSharedMaskWithID(_document,_maskID)?@"shared":_nodeID;}
- (BOOL)representsCanvasMask:(NSDictionary*)info{NSString *maskID=info[@"mask"];if(!maskID.length)return NO;if([info[@"node"]isEqual:_nodeID])return YES;if(!DYSharedMaskWithID(_document,maskID))return NO;for(NSDictionary *mask in DYMasksForTool(_document,_nodeID))if([mask[@"id"]isEqual:maskID])return YES;return NO;}
- (void)canvasSelected:(NSNotification*)n{_canvasActive=[self representsCanvasMask:n.userInfo];if(_canvasActive){NSString *ID=[n.userInfo[@"mask"]copy];[_maskID release];_maskID=ID;_drawing=[n.userInfo[@"draw"]boolValue];}else _drawing=NO;[self updateDrawingControls];}
- (void)canvasState:(NSNotification*)n{if(!_canvasActive||![self representsCanvasMask:n.userInfo]||![n.userInfo[@"mask"]isEqual:_maskID])return;_drawing=[n.userInfo[@"drawing"]boolValue];[self updateDrawingControls];}
- (void)sendCanvasDrawing:(BOOL)drawing{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:_host userInfo:@{@"node":[self canvasNodeID],@"mask":_maskID?:@"",@"document":_document?:@{},@"draw":@(drawing)}];}
- (void)canvas:(id)sender{[self sendCanvasDrawing:NO];}
- (void)redrawPen:(id)sender{[self sendCanvasDrawing:YES];}
- (void)penCommand:(NSButton*)sender{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasCommand" object:_host userInfo:@{@"node":_nodeID,@"mask":_maskID?:@"",@"command":sender==_penFinish?@"finish":@"cancel",@"timeValue":@(_time.value),@"timeScale":@(_time.timescale),@"timeEpoch":@(_time.epoch)}];}
- (void)penCommand:(NSButton*)sender{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasCommand" object:_host userInfo:@{@"node":[self canvasNodeID],@"mask":_maskID?:@"",@"command":sender==_penFinish?@"finish":@"cancel",@"timeValue":@(_time.value),@"timeScale":@(_time.timescale),@"timeEpoch":@(_time.epoch)}];}
- (void)clear:(id)sender{if(_drawing)return;[self edit:@"清除蒙版轨迹" block:^(NSMutableDictionary *d,NSMutableDictionary *m){DYMaskParameters p=DYMaskAtTime(m,self->_time);m[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];m[@"keys"]=@[];[m removeObjectForKey:@"status"];}];}
- (void)track:(NSButton*)sender{if(_drawing)return;[self canvas:nil];[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrack" object:_host userInfo:@{@"node":_nodeID,@"mask":_maskID?:@"",@"direction":@(sender.tag)}];}
- (void)trackingStatus:(NSNotification*)n{if([n.userInfo[@"node"]isEqual:_nodeID])_status.stringValue=n.userInfo[@"message"]?:@"";}
- (void)track:(NSButton*)sender{if(_drawing)return;[self canvas:nil];[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrack" object:_host userInfo:@{@"node":[self canvasNodeID],@"mask":_maskID?:@"",@"direction":@(sender.tag)}];}
- (void)trackingStatus:(NSNotification*)n{BOOL target=n.userInfo[@"mask"]?[self representsCanvasMask:n.userInfo]:[n.userInfo[@"node"]isEqual:_nodeID];if(target&&(!n.userInfo[@"mask"]||[n.userInfo[@"mask"]isEqual:_maskID]))_status.stringValue=n.userInfo[@"message"]?:@"";}
@end
+5 -1
查看文件
@@ -2,6 +2,8 @@
// the recorded sibling source repositories; the adapter writes this host model.
#include "DYSpiderDisc.inc.h"
@interface DYSpiderPanel : DYFlippedView
@property(nonatomic) BOOL horizontalLayout;
@property(nonatomic,assign) NSView *accessoryRow;
@property(nonatomic,assign) id<DYGraphicDelegate> delegate;
- (void)setMesh:(NSData *)mesh linked:(BOOL)linked;
@end
@@ -30,7 +32,9 @@
}
- (void)dealloc{_disc.changed=nil;_disc.gesture=nil;_disc.selectionChanged=nil;[_disc release];[_hues release];[_saturation release];[_link release];[_status release];[super dealloc];}
- (void)setMesh:(NSData *)data linked:(BOOL)linked{auto m=DYSpiderMesh(data);_disc.meshData=[NSData dataWithBytes:&m length:sizeof(m)];_linked=linked;[_hues selectItemWithTag:m.hues];[_saturation selectItemWithTag:m.rings+1];_link.state=linked?NSControlStateValueOn:NSControlStateValueOff;}
- (void)layout{[super layout];CGFloat w=self.bounds.size.width;_disc.frame=NSMakeRect(0,0,w,300);
- (void)layout{[super layout];CGFloat w=self.bounds.size.width;
if(_horizontalLayout){CGFloat d=MIN(self.bounds.size.height,MAX(170,w*.48)),x=d+20,cw=MAX(200,w-x-10);_disc.frame=NSMakeRect(0,0,d,d);[[self viewWithTag:101]setFrame:NSMakeRect(x,7,48,18)];_hues.frame=NSMakeRect(x+58,2,cw-58,26);[[self viewWithTag:102]setFrame:NSMakeRect(x,37,48,18)];_saturation.frame=NSMakeRect(x+58,32,cw-58,26);_link.frame=NSMakeRect(x,64,cw,22);_accessoryRow.frame=NSMakeRect(x,89,cw,33);CGFloat bw=(cw-6)/2;for(int i=0;i<5;i++)[[self viewWithTag:201+i]setFrame:NSMakeRect(x+(i%2)*(bw+6),126+(i/2)*30,bw,26)];_status.frame=NSMakeRect(x,218,cw,MAX(18,self.bounds.size.height-218));_status.hidden=self.bounds.size.height<238;return;}
_disc.frame=NSMakeRect(0,0,w,300);
[[self viewWithTag:101]setFrame:NSMakeRect(0,307,32,20)];_hues.frame=NSMakeRect(33,301,60,27);
[[self viewWithTag:102]setFrame:NSMakeRect(99,307,43,20)];_saturation.frame=NSMakeRect(142,301,60,27);_link.frame=NSMakeRect(MAX(205,w-61),304,61,23);
_status.frame=NSMakeRect(2,334,w-4,36);CGFloat gap=5,bw=(w-gap)/2;
+64 -7
查看文件
@@ -9,33 +9,39 @@
#import "DYToolState.h"
#include "DYFilmTime.h"
#import <CoreImage/CoreImage.h>
#import <MetalPerformanceShaders/MetalPerformanceShaders.h>
#import <os/log.h>
#include "MaskCore/DYTracker.hpp"
#include "MaskCore/DYOpenCVTracker.hpp"
#include <atomic>
#include "DYViewerParameterBridge.inc.h"
#include "DYToolHostDeclarations.inc.h"
#include "DYToolFlow.inc.h"
@implementation DYPlugIn {
DYRenderer *_renderer;
NSColorSampler *_canvasSampler;
BOOL _copyAnalyzed;
std::atomic_bool _betaFirstRenderStarted;
std::atomic_bool _betaFirstRenderStarted,_modelRefreshPending;
#include "DYToolHostIvars.inc.h"
}
#include "DYToolHostMethods.inc.h"
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager{uint64_t beta=DYBetaSpanBegin(@"plugin_init",nil);if((self=[super init])){_betaFirstRenderStarted.store(false);_apiManager=manager;_renderer=[DYRenderer new];[self initializeToolHost];NSNotificationCenter*n=NSNotificationCenter.defaultCenter;[n addObserver:self selector:@selector(exportRequested:) name:@"DYExportLUT" object:manager];[n addObserver:self selector:@selector(autoRequested:) name:@"DYAutoGrade" object:manager];[n addObserver:self selector:@selector(autoRequested:) name:@"DYAutoWhiteBalance" object:manager];[n addObserver:self selector:@selector(whiteBalanceRequested:) name:@"DYWhiteBalanceColor" object:manager];}DYBetaSpanEnd(beta,nil);return self;}
- (void)dealloc{[self tearDownToolHost];[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[super dealloc];}
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager{uint64_t beta=DYBetaSpanBegin(@"plugin_init",nil);if((self=[super init])){_betaFirstRenderStarted.store(false);_modelRefreshPending.store(false);_apiManager=manager;_renderer=[DYRenderer new];[self initializeToolHost];NSNotificationCenter*n=NSNotificationCenter.defaultCenter;[n addObserver:self selector:@selector(exportRequested:) name:@"DYExportLUT" object:manager];[n addObserver:self selector:@selector(autoRequested:) name:@"DYAutoGrade" object:manager];[n addObserver:self selector:@selector(autoRequested:) name:@"DYAutoWhiteBalance" object:manager];[n addObserver:self selector:@selector(whiteBalanceRequested:) name:@"DYWhiteBalanceColor" object:manager];[n addObserver:self selector:@selector(canvasWhiteBalanceRequested:) name:@"DYViewerWhiteBalanceRequested" object:manager];}DYBetaSpanEnd(beta,nil);return self;}
- (void)dealloc{[self tearDownToolHost];[NSNotificationCenter.defaultCenter removeObserver:self];[_canvasSampler release];[_renderer release];[super dealloc];}
- (BOOL)properties:(NSDictionary**)p error:(NSError**)e{*p=@{kFxPropertyKey_MayRemapTime:@NO,kFxPropertyKey_PixelTransformSupport:@(kFxPixelTransform_ScaleTranslate),kFxPropertyKey_VariesWhenParamsAreStatic:@YES,kFxPropertyKey_DesiredProcessingColorInfo:@(kFxImageColorInfo_RGB_LINEAR),kFxPropertyKey_NeedsFullBuffer:@YES};return YES;}
- (BOOL)addParametersWithError:(NSError**)e{return DYCreateParameters(_apiManager,e);}
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYToolsParameterID?[NSSet setWithObjects:DYToolDocument.class,NSDictionary.class,NSArray.class,NSString.class,NSNumber.class,NSData.class,nil]:pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,NSData.class,nil]:[NSSet setWithObjects:DYInspectorToken.class,NSDictionary.class,NSString.class,NSNumber.class,nil];}
- (NSView*)createViewForParameterID:(UInt32)pid{[self scheduleToolCanvasRegistration];return pid==DYInspectorParameterID?[[DYInspector alloc]initWithAPIManager:_apiManager renderer:_renderer]:[[NSView alloc]initWithFrame:NSZeroRect];}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==DYToolsParameterID)[self adoptToolCanvasDocument:DYReadTools(_apiManager,t).document];if(pid==DYToolsParameterID||pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==DYToolsParameterID)[self adoptToolCanvasDocument:DYReadTools(_apiManager,t).document];if(pid==DYToolsParameterID||pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];// Many parameter callbacks arrive in one host transaction. Refresh the native
// inspector once after the transaction unwinds, rather than queueing a full
// remote parameter read and view rebuild for every scalar in the burst.
if(!_modelRefreshPending.exchange(true)){id host=_apiManager;dispatch_async(dispatch_get_main_queue(),^{self->_modelRefreshPending.store(false);[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host];});}return YES;}
- (BOOL)pluginState:(NSData**)state atTime:(CMTime)t quality:(FxQuality)q error:(NSError**)e{
DYUniforms u;DYReadUniforms(_apiManager,t,&u);CMTime frameDuration=kCMTimeInvalid,origin=kCMTimeZero;id<FxTimingAPI_v4>timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];if([timing respondsToSelector:@selector(frameDuration:)])[timing frameDuration:&frameDuration];if([timing respondsToSelector:@selector(startTimeForEffect:)])[timing startTimeForEffect:&origin];int64_t frame=DYFilmFrameIndex(t,frameDuration,origin);u.filmFrameKey=DYFilmFrameKey(frame,u.film.grainHold,u.film.grainSeed);DYAssetState*a=DYReadAssets(_apiManager,t);DYToolDocument *tools=DYReadTools(_apiManager,t);[self adoptToolCanvasDocument:tools.document];[_viewerParameterBridge publishUniforms:&u document:tools.document atTime:t];[_viewerParameterBridge publishAssets:a histogram:nil atTime:t];double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];NSMutableDictionary *snapshot=DYMutablePlist(DYToolRenderSnapshot(tools.document,t));for(NSMutableDictionary *node in snapshot[@"layers"]){DYUniforms layer=DYToolUniforms(node);if([node[@"type"]isEqual:@"film"])node[@"filmFrameKey"]=@(DYFilmFrameKey(frame,layer.film.grainHold,layer.film.grainSeed));}NSInteger primaries=-1;id<FxColorGamutAPI_v2>gamut=[_apiManager apiForProtocol:@protocol(FxColorGamutAPI_v2)];if([gamut respondsToSelector:@selector(colorPrimaries)])primaries=gamut.colorPrimaries;NSDictionary*s=@{@"colorManagement":a.colorManagement?:@{},@"hostPrimaries":@(primaries),@"schema":@2,@"tools":snapshot,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{},@"spider":a.spiderMesh?:[NSData data]};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
DYUniforms u;DYReadUniforms(_apiManager,t,&u);CMTime frameDuration=kCMTimeInvalid,origin=kCMTimeZero;id<FxTimingAPI_v4>timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];if([timing respondsToSelector:@selector(frameDuration:)])[timing frameDuration:&frameDuration];if([timing respondsToSelector:@selector(startTimeForEffect:)])[timing startTimeForEffect:&origin];int64_t frame=DYFilmFrameIndex(t,frameDuration,origin);u.filmFrameKey=DYFilmFrameKey(frame,u.film.grainHold,u.film.grainSeed);DYAssetState*a=DYReadAssets(_apiManager,t);DYToolDocument *tools=DYReadTools(_apiManager,t);[self adoptToolCanvasDocument:tools.document];[_viewerParameterBridge publishUniforms:&u document:tools.document atTime:t];[_viewerParameterBridge publishAssets:a atTime:t];double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];NSDictionary *snapshot=DYToolRenderSnapshot(tools.document,t);for(NSMutableDictionary *node in snapshot[@"layers"])if([node[@"type"]isEqual:@"film"]){DYUniforms layer=DYToolUniforms(node);node[@"filmFrameKey"]=@(DYFilmFrameKey(frame,layer.film.grainHold,layer.film.grainSeed));}NSInteger primaries=-1;id<FxColorGamutAPI_v2>gamut=[_apiManager apiForProtocol:@protocol(FxColorGamutAPI_v2)];if([gamut respondsToSelector:@selector(colorPrimaries)])primaries=gamut.colorPrimaries;NSDictionary*s=@{@"colorManagement":a.colorManagement?:@{},@"hostPrimaries":@(primaries),@"schema":@2,@"tools":snapshot,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{},@"spider":a.spiderMesh?:[NSData data]};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
}
- (BOOL)destinationImageRect:(FxRect*)rect sourceImages:(NSArray<FxImageTile*>*)src destinationImage:(FxImageTile*)dst pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{if(!src.count)return NO;*rect=src[0].imagePixelBounds;return YES;}
- (BOOL)sourceTileRect:(FxRect*)rect sourceImageIndex:(NSUInteger)i sourceImages:(NSArray<FxImageTile*>*)src destinationTileRect:(FxRect)dstRect destinationImage:(FxImageTile*)dst pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{if(i>=src.count)return NO;*rect=src[i].imagePixelBounds;return YES;}
- (BOOL)renderDestinationImage:(FxImageTile*)dst sourceImages:(NSArray<FxImageTile*>*)src pluginState:(NSData*)s atTime:(CMTime)t error:(NSError**)e{
if(!src.count||!src[0].ioSurface||!dst.ioSurface||!s.length)return NO;NSDictionary*p=[NSPropertyListSerialization propertyListWithData:s options:NSPropertyListImmutable format:NULL error:e];if(![p isKindOfClass:NSDictionary.class])return NO;NSData*b=p[@"uniforms"];if(![@[@1,@2]containsObject:p[@"schema"]]||![b isKindOfClass:NSData.class]||b.length!=sizeof(DYUniforms)||![p[@"paths"]isKindOfClass:NSDictionary.class])return NO;DYUniforms u;[b getBytes:&u length:sizeof(u)];uint64_t beta=!_betaFirstRenderStarted.exchange(true)?DYBetaSpanBegin(@"first_render",nil):0;NSData *previousHistogram=[_renderer histogram];BOOL ok=[_renderer renderSource:src[0] destination:dst uniforms:u paths:p[@"paths"] spider:p[@"spider"] tools:p[@"tools"] colorManagement:p[@"colorManagement"] hostPrimaries:p[@"hostPrimaries"]?[p[@"hostPrimaries"]integerValue]:-1 error:e];DYBetaSpanEnd(beta,@{@"status":ok?@"passed":@"failed"});if(!ok)DYBetaEvent(@"render_error",@{@"error_domain":(e&&*e)?(*e).domain:@"unknown",@"error_code":@((e&&*e)?(*e).code:0)});if(ok){NSData *histogram=[_renderer histogram];if(histogram&&histogram!=previousHistogram)[_viewerParameterBridge publishHistogram:histogram atTime:t];[_renderer captureScopeTile:dst atTime:t];if(_toolCaptureEnabled&&!_trackingActive.load()){dy::GrayFrame frame=[self toolGrayFrame:src[0] error:nil];if(frame.valid()){@synchronized(self){_toolSourceFrame=std::move(frame);_toolSourceTime=t;}}}BOOL analyze=NO;@synchronized(self){if(![p[@"copyAuto"]boolValue])_copyAnalyzed=NO;else if(!_copyAnalyzed){_copyAnalyzed=YES;analyze=YES;}}if(analyze){NSDictionary*values=DYAutoGrade([_renderer preview]);if(values)dispatch_async(dispatch_get_main_queue(),^{[self applyValues:values];});}}return ok;
if(!src.count||!src[0].ioSurface||!dst.ioSurface||!s.length)return NO;NSDictionary*p=[NSPropertyListSerialization propertyListWithData:s options:NSPropertyListImmutable format:NULL error:e];if(![p isKindOfClass:NSDictionary.class])return NO;NSData*b=p[@"uniforms"];if(![@[@1,@2]containsObject:p[@"schema"]]||![b isKindOfClass:NSData.class]||b.length!=sizeof(DYUniforms)||![p[@"paths"]isKindOfClass:NSDictionary.class])return NO;DYUniforms u;[b getBytes:&u length:sizeof(u)];uint64_t beta=!_betaFirstRenderStarted.exchange(true)?DYBetaSpanBegin(@"first_render",nil):0;BOOL ok=[_renderer renderSource:src[0] destination:dst uniforms:u paths:p[@"paths"] spider:p[@"spider"] tools:p[@"tools"] colorManagement:p[@"colorManagement"] hostPrimaries:p[@"hostPrimaries"]?[p[@"hostPrimaries"]integerValue]:-1 error:e];DYBetaSpanEnd(beta,@{@"status":ok?@"passed":@"failed"});if(!ok)DYBetaEvent(@"render_error",@{@"error_domain":(e&&*e)?(*e).domain:@"unknown",@"error_code":@((e&&*e)?(*e).code:0)});if(ok){[_renderer captureScopeTile:dst atTime:t];if(_toolCaptureEnabled&&!_trackingActive.load()){@synchronized(self){FxRect image=[src[0]imagePixelBounds];double aspect=[src[0]pixelAspect],height=image.top-image.bottom;_toolSourceAspect=height>0&&std::isfinite(aspect)&&aspect>0?(image.right-image.left)*aspect/height:1;_toolSourceFrame={};_toolSourceTime=t;}}BOOL analyze=NO;@synchronized(self){if(![p[@"copyAuto"]boolValue])_copyAnalyzed=NO;else if(!_copyAnalyzed){_copyAnalyzed=YES;analyze=YES;}}if(analyze){NSDictionary*values=DYAutoGrade([_renderer preview]);if(values)dispatch_async(dispatch_get_main_queue(),^{[self applyValues:values];});}}return ok;
}
- (void)alert:(NSString*)message{dispatch_async(dispatch_get_main_queue(),^{NSAlert*a=[NSAlert new];a.messageText=@"大鱼调色";a.informativeText=message?:@"操作未完成";[a runModal];[a release];});}
- (void)exportRequested:(NSNotification*)n{
@@ -43,7 +49,58 @@
}
- (void)applyValues:(NSDictionary*)values{if(!values){[self alert:@"尚未拿到当前片段画面,请移动播放头后重试。"];return;}id<FxCustomParameterActionAPI_v4>a=[_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];[a startAction:self];@try{id<FxParameterSettingAPI_v6>s=[_apiManager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];for(NSDictionary*r in DYDescriptors()){NSNumber*v=values[r[@"key"]];if(v)[s setFloatValue:v.doubleValue toParameter:[r[@"pid"]unsignedIntValue] atTime:a.currentTime];}}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_apiManager];}
- (void)autoRequested:(NSNotification*)n{NSData*frame=[_renderer preview];[self applyValues:[n.name isEqual:@"DYAutoGrade"]?DYAutoGrade(frame):DYAutoWhiteBalance(frame)];}
- (void)whiteBalanceRequested:(NSNotification*)n{NSColor*c=[n.userInfo[@"color"]colorUsingColorSpace:NSColorSpace.sRGBColorSpace];if(!c)return;float temp=0,tint=0;if([DYColorTables neutralizeColor:(vector_float3){(float)c.redComponent,(float)c.greenComponent,(float)c.blueComponent} temperature:&temp tint:&tint])[self applyValues:@{@"temperature":@(temp),@"tint":@(tint)}];else [self alert:@"所选颜色过暗,请选择白色或中性灰区域。"];}
- (void)canvasWhiteBalanceRequested:(NSNotification*)note {
CMTime time=CMTimeMakeFromDictionary((CFDictionaryRef)note.userInfo[@"time"]);
if(_canvasSampler||!CMTIME_IS_NUMERIC(time))return;
_canvasSampler=[NSColorSampler new];
[_canvasSampler showSamplerWithSelectionHandler:^(NSColor *color){
[self->_canvasSampler release];self->_canvasSampler=nil;
if(color)[NSNotificationCenter.defaultCenter postNotificationName:@"DYWhiteBalanceColor" object:self->_apiManager userInfo:@{@"color":color,@"time":[(NSDictionary*)CMTimeCopyAsDictionary(time,kCFAllocatorDefault) autorelease]}];
}];
}
- (void)applyCanvasWhiteBalance:(NSDictionary*)values atTime:(CMTime)time {
id<FxCustomParameterActionAPI_v4> action=[_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];
if(!action)return;
NSMutableArray *descriptors=[NSMutableArray array];
for(NSDictionary *d in DYDescriptors())if(values[d[@"key"]])[descriptors addObject:d];
NSString *node=nil;
NSMutableDictionary *original=[NSMutableDictionary dictionary];
[action startAction:self];@try{
if(CMTimeCompare(DYHostDisplayedFrameTime(_apiManager,action.currentTime),time)!=0)return;
NSDictionary *document=DYReadTools(_apiManager,time).document;
NSString *selected=[_viewerParameterBridge snapshotAtTime:time][@"selectedNode"];
NSDictionary *layer=DYToolWithID(document,selected);
if([layer[@"type"]isEqual:@"base"])node=selected;
else if(!DYBaseToolRemoved(document,@"base"))node=@"base:base";
else for(NSString *ID in DYToolDisplayOrder(document))if([DYToolWithID(document,ID)[@"type"]isEqual:@"base"]){node=ID;break;}
if(node){
BOOL base=[node isEqual:@"base:base"];
DYUniforms uniforms{};
if(!base)uniforms=DYToolUniforms(DYToolWithID(document,node));
id<FxParameterRetrievalAPI_v6> get=[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
for(NSDictionary *d in descriptors){
double value=[d[@"default"]doubleValue];
if(base){if(![get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue] atTime:time])return;}
else value=*(float*)((uint8_t*)&uniforms+[d[@"offset"]unsignedIntegerValue]);
original[d[@"key"]]=@(value);
}
}
}@finally{[action endAction:self];}
if(!node){[self alert:@"请先添加基础调整模块,再吸取白点。"];return;}
[_viewerParameterBridge beginParameters:descriptors node:node values:original atTime:time];
[_viewerParameterBridge changeValues:values];[_viewerParameterBridge endGesture];
}
- (void)whiteBalanceRequested:(NSNotification*)n {
NSColor *color=[n.userInfo[@"color"] colorUsingColorSpace:NSColorSpace.sRGBColorSpace];
if(!color)return;
float temperature=0,tint=0;
if(![DYColorTables neutralizeColor:(vector_float3){(float)color.redComponent,(float)color.greenComponent,(float)color.blueComponent} temperature:&temperature tint:&tint]){
[self alert:@"所选颜色过暗,请选择白色或中性灰区域。"];return;
}
NSDictionary *values=@{@"temperature":@(temperature),@"tint":@(tint)};
if(n.userInfo[@"time"])[self applyCanvasWhiteBalance:values atTime:CMTimeMakeFromDictionary((CFDictionaryRef)n.userInfo[@"time"])];
else [self applyValues:values];
}
@end
#include "DYViewerControls.inc.h"
#include "DYToolOSC.inc.h"
@@ -1,5 +1,6 @@
// Opt-in V3. The root primary owns input/working/output; V1/V2 stay frozen.
- (BOOL)renderPrimarySource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools hostPrimaries:(NSInteger)primaries error:(NSError**)error {
if(tools[@"sharedMasks"])tools=DYResolvedToolDocument(tools);
// The main eye bypasses the whole primary/CST module. Other tools retain
// their established unmanaged host workflow rather than inheriting a Log tag.
if(u.primarySectionEnabled<.5||DYBaseToolRemoved(tools,@"primary"))return [self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools error:error];
+8 -3
查看文件
@@ -14,14 +14,19 @@
- (BOOL)renderSource:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools error:(NSError**)error;
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools error:(NSError**)error;
- (NSData*)preview;
/// 256-bin luma/R/G/B of the existing 320×180 analysis preview.
- (NSData*)histogram;
/// Latest final-output bins for the inspector's visible curve controls.
- (NSData*)outputHistogram;
/// Bins from this instance's most recent final output at the requested time.
- (NSData*)canvasHistogramAtTime:(CMTime)time;
/// Display-encoded float RGBA, 320×180, with the visually top row first.
/// Analysis preview retains the host texture's original row order separately.
- (NSData*)lookLUTPreview;
- (void)invalidatePreview;
/// Final-output scopes run only while the auxiliary workspace is visible.
/// Conversion/statistics run while visible; retain one small final-output
/// sample per instance so opening a paused workspace needs no parameter edit.
- (BOOL)scopeEnabled;
- (void)setScopeEnabled:(BOOL)enabled;
- (void)setScopeEnabled:(BOOL)enabled atTime:(CMTime)time;
/// Call after the final destination render succeeds, while the tile is valid.
/// Only the small GPU readback waits here; conversion/statistics are coalesced
/// on a worker. No main-queue wait or host API is performed by this method.
+13 -12
查看文件
@@ -1,4 +1,4 @@
#import "DYHistogram.h"
#import <os/log.h>
#import "DYManagedColor.h"
#import "../../ColorManagement/Sources/DYColorManagementGPU.h"
#import "../../ColorManagement/Sources/DYColorProfile.h"
@@ -33,17 +33,19 @@ template<class F> static BOOL DYRenderWithPool(NSError **error,F body){
static NSArray *inputFiles(){return @[@"",@"apple_log_to_rec709",@"arri_logc3_to_rec709",@"arri_logc4_to_rec709",@"blackmagic_film_gen5_to_rec709",@"canon_clog_bt709_to_rec709",@"canon_clog2_cinema_gamut_to_rec709",@"canon_clog3_cinema_gamut_to_rec709",@"dji_dlog_to_rec709",@"dji_dlog_m_to_rec709",@"fujifilm_flog_to_rec709",@"fujifilm_flog2_to_rec709",@"nikon_nlog_to_rec709",@"panasonic_vlog_vgamut_to_rec709",@"red_log3g10_rwg_to_rec709",@"sony_slog2_sgamut_to_rec709",@"sony_slog3_sgamut3cine_to_rec709",@"sony_hlg_bt2020_to_rec709"];}
static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){MTLTextureDescriptor*t=[MTLTextureDescriptor new];t.textureType=MTLTextureType3D;t.pixelFormat=MTLPixelFormatRGBA32Float;t.width=n;t.height=n;t.depth=n;t.storageMode=MTLStorageModeShared;t.usage=MTLTextureUsageShaderRead;id<MTLTexture>x=[d newTextureWithDescriptor:t];[t release];if(x)[x replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:values bytesPerRow:n*16 bytesPerImage:n*n*16];return [x autorelease];}
// A synthetic texture lattice uses exactly the production render path for Cube export.
@interface DYExportTile : FxImageTile { id<MTLTexture> _tex; uint64_t _registry; FxRect _bounds;FxImageOrigin _origin; double _pixelAspect; }
@interface DYExportTile : FxImageTile { id<MTLTexture> _tex; uint64_t _registry; FxRect _bounds;FxImageOrigin _origin; double _pixelAspect; CGColorSpaceRef _tileSpace; BOOL _hasTileSpace; }
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry;
- (void)setBounds:(FxRect)bounds origin:(FxImageOrigin)origin;
- (void)setPixelAspect:(double)aspect;
- (void)inheritColorSpace:(CGColorSpaceRef)space;
@end
@implementation DYExportTile
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry{if((self=[super init])){_tex=[texture retain];_registry=registry;_bounds=(FxRect){0,0,(SInt32)texture.width,(SInt32)texture.height};_origin=kFxImageOrigin_TOP_LEFT;_pixelAspect=1;}return self;}
- (void)dealloc{[_tex release];[super dealloc];}
- (void)dealloc{[_tex release];if(_tileSpace)CGColorSpaceRelease(_tileSpace);[super dealloc];}
- (void)inheritColorSpace:(CGColorSpaceRef)space{if(space)CGColorSpaceRetain(space);if(_tileSpace)CGColorSpaceRelease(_tileSpace);_tileSpace=space;_hasTileSpace=YES;}
- (id<MTLTexture>)metalTextureForDevice:(id<MTLDevice>)d{return d.registryID==_registry?_tex:nil;}
- (void)setBounds:(FxRect)bounds origin:(FxImageOrigin)origin{_bounds=bounds;_origin=origin;}
- (CGColorSpaceRef)colorSpace{static CGColorSpaceRef s;static dispatch_once_t once;dispatch_once(&once,^{s=CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB);});return s;}
- (CGColorSpaceRef)colorSpace{if(_hasTileSpace)return _tileSpace;static CGColorSpaceRef s;static dispatch_once_t once;dispatch_once(&once,^{s=CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB);});return s;}
- (FxRect)tilePixelBounds{return _bounds;}
- (FxRect)imagePixelBounds{return self.tilePixelBounds;}
- (uint64_t)deviceRegistryID{return _registry;}
@@ -111,15 +113,16 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
dispatch_queue_t _lutPreparationQueue;
DYColorTables *_tables;
NSObject *_previewLock;
NSData *_preview,*_lookLUTPreview,*_histogram;
NSData *_preview,*_lookLUTPreview;
CFTimeInterval _lastPreview;
BOOL _exporting;
NSDictionary *_toolDocument,*_colorContext,*_exportManagedState;
BOOL _managedFinishing;NSData *_faceEntries,*_faceInput,*_faceCachedEntries;CIContext *_faceContext;
dispatch_queue_t _scopeQueue;
BOOL _scopeEnabled,_scopeWorkerRunning;
BOOL _scopeEnabled,_scopeWorkerRunning,_outputHistogramObserved,_outputHistogramNotificationPending;
NSUInteger _scopeGeneration;
DYScopeSample *_scopePending;
DYScopeSample *_scopePending,*_scopeLatest;
uint64_t _scopeCaptureSerial,_scopeLatestSerial;CMTime _scopeRequestedTime;
NSData *_scopePreview;
NSDictionary *_scopeMetadata;
DYColorProfile *_scopeProfile;
@@ -133,7 +136,7 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
#include "DYFaceRender.inc.h"
#include "DYToolRender.inc.h"
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_scopeQueue=dispatch_queue_create("com.dayu.color.final-output-scopes",DISPATCH_QUEUE_SERIAL);_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_preparedLUTs=[NSMutableDictionary new];_activeLUTPaths=[NSSet new];_lutPreparationQueue=dispatch_queue_create("com.dayu.color.lut-upload",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_lutPreparationQueue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_faceEntries release];[_faceInput release];[_faceCachedEntries release];[_faceContext release];[_scopePending release];[_scopePreview release];[_scopeMetadata release];[_scopeProfile release];dispatch_release(_scopeQueue);[_devices release];[_luts release];[_preparedLUTs release];[_activeLUTPaths release];dispatch_release(_lutPreparationQueue);[_tables release];[_preview release];[_lookLUTPreview release];[_histogram release];[_colorContext release];[_previewLock release];[super dealloc];}
- (void)dealloc{[_faceEntries release];[_faceInput release];[_faceCachedEntries release];[_faceContext release];[_scopePending release];[_scopeLatest release];[_scopePreview release];[_scopeMetadata release];[_scopeProfile release];dispatch_release(_scopeQueue);[_devices release];[_luts release];[_preparedLUTs release];[_activeLUTPaths release];dispatch_release(_lutPreparationQueue);[_tables release];[_preview release];[_lookLUTPreview release];[_colorContext release];[_previewLock release];[super dealloc];}
- (void)trimPreparedLUTsKeeping:(NSString *)path {
if(_preparedLUTs.count<=12)return;
for(NSString *key in _preparedLUTs.allKeys)if(![_activeLUTPaths containsObject:key]&&![key isEqualToString:path])[_preparedLUTs removeObjectForKey:key];
@@ -157,8 +160,7 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
}});return progress;
}
- (void)notifyPreviewChanged{dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}
- (void)invalidatePreview{@synchronized(_previewLock){[_preview release];_preview=nil;[_lookLUTPreview release];_lookLUTPreview=nil;[_histogram release];_histogram=nil;_lastPreview=0;}dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}
- (NSData*)histogram{@synchronized(_previewLock){return [[_histogram retain]autorelease];}}
- (void)invalidatePreview{@synchronized(_previewLock){[_preview release];_preview=nil;[_lookLUTPreview release];_lookLUTPreview=nil;_lastPreview=0;}dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYPreviewDidChange" object:self];});}
- (NSData*)preview{@synchronized(_previewLock){return [[_preview retain]autorelease];}}
- (NSData*)lookLUTPreview{@synchronized(_previewLock){return [[_lookLUTPreview retain]autorelease];}}
- (NSMutableDictionary*)device:(uint64_t)registry error:(NSError**)err{
@@ -168,7 +170,7 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
for(NSString*fn in @[@"dyLensRepair",@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyScopeSample",@"dyColorManagement",@"dyToolBlend",@"dyToolSkin",@"dyFilmPoint",@"dyFilmNoise",@"dyFilmSparseBlur",@"dyFilmBloomEdges",@"dyFilmMix",@"dyFilmPrint"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}uint64_t pipelineSpan=DYBetaSpanBegin(@"gpu_pipeline",@{@"pipeline":fn,@"gpu":d.name?:@"unknown"});id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];DYBetaSpanEnd(pipelineSpan,@{@"status":p?@"passed":@"failed"});[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
for(NSString*fn in @[@"dyLensRepair",@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyScopeSample",@"dyCloneStamps",@"dyColorManagement",@"dyToolBlend",@"dyToolSkin",@"dyFilmPoint",@"dyFilmNoise",@"dyFilmSparseBlur",@"dyFilmBloomEdges",@"dyFilmMix",@"dyFilmPrint"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}uint64_t pipelineSpan=DYBetaSpanBegin(@"gpu_pipeline",@{@"pipeline":fn,@"gpu":d.name?:@"unknown"});id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];DYBetaSpanEnd(pipelineSpan,@{@"status":p?@"passed":@"failed"});[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
// Preparing before the first frame may use registry 0. Reuse those pipelines
// when the host subsequently supplies that device's actual registry ID.
@@ -246,7 +248,6 @@ static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];if(spiderBuffer)[re setFragmentBuffer:spiderBuffer offset:0 atIndex:4];else{float empty[2]={0,0};[re setFragmentBytes:empty length:sizeof(empty) atIndex:4];}[re setFragmentBytes:&spiderSize length:sizeof(spiderSize) atIndex:5];if(hasMasks||segmented){[re setFragmentBuffer:maskBuffer offset:0 atIndex:6];[re setFragmentBytes:&maskHeader length:sizeof(maskHeader) atIndex:7];}if(segmented){DYToolStageRange range={(int)stageFirst,(int)stageLast,(int)suppressBlackWhite};[re setFragmentBytes:&range length:sizeof(range) atIndex:8];[re setFragmentTexture:skinReference?[skinReference metalTextureForDevice:d]:input atIndex:10];[re setFragmentTexture:nativeSource atIndex:11];}[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
if(ok&&pb){@synchronized(_previewLock){
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
[_histogram release];_histogram=[DYHistogramFromRGBA(_preview) retain];
// The analysis kernel reads physical texture rows. Its result remains intact
// for auto grade; only the browser copy is normalized to top-first bitmap rows.
[_lookLUTPreview release];
+47 -7
查看文件
@@ -1,12 +1,44 @@
// Included in DYRenderer's implementation; final destination sampling is kept
// separate from the earlier input-analysis thumbnail used by auto-grade/LUTs.
- (void)setScopeEnabled:(BOOL)enabled{
@synchronized(_previewLock){if(_scopeEnabled==enabled)return;_scopeEnabled=enabled;_scopeGeneration++;[_scopePending release];_scopePending=nil;if(enabled){[_scopePreview release];_scopePreview=nil;[_scopeMetadata release];_scopeMetadata=nil;}}
- (BOOL)scopeEnabled{@synchronized(_previewLock){return _scopeEnabled;}}
- (void)setScopeEnabled:(BOOL)enabled{[self setScopeEnabled:enabled atTime:kCMTimeInvalid];}
- (void)setScopeEnabled:(BOOL)enabled atTime:(CMTime)time{
BOOL start=NO;@synchronized(_previewLock){if(_scopeEnabled==enabled)return;_scopeEnabled=enabled;_scopeGeneration++;[_scopePending release];_scopePending=nil;
if(enabled){_scopeRequestedTime=time;[_scopePreview release];_scopePreview=nil;[_scopeMetadata release];_scopeMetadata=nil;
CMTime cached=_scopeLatest?CMTimeMakeWithEpoch([_scopeLatest.metadata[@"timeValue"]longLongValue],[_scopeLatest.metadata[@"timeScale"]intValue],[_scopeLatest.metadata[@"timeEpoch"]longLongValue]):kCMTimeInvalid;
os_log(OS_LOG_DEFAULT,"dayu_scope_open requested=%{public}.9f cached=%{public}.9f",CMTimeGetSeconds(time),CMTimeGetSeconds(cached));
// Replay only this instance's actual final output at the requested host time.
// A panel opening must not require a parameter mutation or a fresh render.
if(_scopeLatest&&(!CMTIME_IS_NUMERIC(time)||(CMTIME_IS_NUMERIC(cached)&&CMTimeCompare(cached,time)==0))){DYScopeSample *sample=[DYScopeSample new];sample.pixels=_scopeLatest.pixels;sample.space=_scopeLatest.space;sample.metadata=_scopeLatest.metadata;sample.generation=_scopeGeneration;_scopePending=sample;if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}}
}
}
if(start)dispatch_async(_scopeQueue,^{[self processPendingScopeSamples];});
}
- (NSData *)scopePreview{@synchronized(_previewLock){return [[_scopePreview retain]autorelease];}}
- (NSDictionary *)scopeMetadata{@synchronized(_previewLock){return [[_scopeMetadata retain]autorelease];}}
- (NSData*)outputHistogram{
DYScopeSample *sample=nil;
@synchronized(_previewLock){_outputHistogramObserved=YES;sample=[[_scopeLatest retain]autorelease];}
return sample.canvasHistogram;
}
- (void)queueOutputHistogramNotification{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,NSEC_PER_SEC/30),dispatch_get_main_queue(),^{
@synchronized(_previewLock){_outputHistogramNotificationPending=NO;}
[NSNotificationCenter.defaultCenter postNotificationName:@"DYOutputHistogramDidChange" object:self];
});
}
- (NSData *)canvasHistogramAtTime:(CMTime)time{
if(!CMTIME_IS_NUMERIC(time))return nil;
DYScopeSample *sample=nil;
@synchronized(_previewLock){sample=[_scopeLatest retain];}
NSDictionary *metadata=sample.metadata;
CMTime captured=CMTimeMakeWithEpoch([metadata[@"timeValue"]longLongValue],[metadata[@"timeScale"]intValue],[metadata[@"timeEpoch"]longLongValue]);
NSData *histogram=metadata&&CMTimeCompare(time,captured)==0?sample.canvasHistogram:nil;
[sample release];
return histogram;
}
- (void)captureScopeTile:(FxImageTile *)tile atTime:(CMTime)time{
NSUInteger generation;@synchronized(_previewLock){if(!_scopeEnabled||_exporting||!tile)return;generation=_scopeGeneration;}
NSUInteger generation;uint64_t serial;@synchronized(_previewLock){if(_exporting||!tile)return;generation=_scopeGeneration;serial=++_scopeCaptureSerial;}
@autoreleasepool{@try{
NSDictionary *entry=nil,*context=nil;@synchronized(self){entry=[[self device:tile.deviceRegistryID error:nil]retain];context=[_colorContext copy];}
id<MTLDevice>device=entry[@"device"];id<MTLTexture>texture=[tile metalTextureForDevice:device];
@@ -24,15 +56,23 @@
DYScopeSample *sample=[DYScopeSample new];sample.pixels=[NSData dataWithBytes:buffer.contents length:buffer.length];sample.generation=generation;
CGColorSpaceRef sourceSpace=DYManagedTileSpace(tile,[context[@"primaries"]integerValue]);sample.space=sourceSpace;if(sourceSpace)CGColorSpaceRelease(sourceSpace);
FxRect bounds=tile.tilePixelBounds,image=tile.imagePixelBounds;BOOL whole=bounds.left==image.left&&bounds.right==image.right&&bounds.top==image.top&&bounds.bottom==image.bottom;
sample.metadata=@{@"time":@(CMTimeGetSeconds(time)),@"timeValue":@(time.value),@"timeScale":@(time.timescale),@"source":context[@"destination"]?:@"宿主 RGB",@"wholeImage":@(whole),@"region":whole?@"整帧取样":@"仅当前宿主输出分块",@"width":@(dyscope::Width),@"height":@(dyscope::Height)};
sample.metadata=@{@"time":@(CMTimeGetSeconds(time)),@"timeValue":@(time.value),@"timeScale":@(time.timescale),@"timeEpoch":@(time.epoch),@"source":context[@"destination"]?:@"宿主 RGB",@"wholeImage":@(whole),@"region":whole?@"整帧取样":@"仅当前宿主输出分块",@"width":@(dyscope::Width),@"height":@(dyscope::Height)};
[buffer release];[entry release];[context release];
BOOL start=NO;@synchronized(_previewLock){if(_scopeEnabled&&generation==_scopeGeneration){[_scopePending release];_scopePending=[sample retain];if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}}}[sample release];
BOOL start=NO,notifyHistogram=NO;@synchronized(_previewLock){
if(serial>=_scopeLatestSerial){
[_scopeLatest release];_scopeLatest=[sample retain];_scopeLatestSerial=serial;
if(_outputHistogramObserved&&!_outputHistogramNotificationPending){_outputHistogramNotificationPending=YES;notifyHistogram=YES;}
}
if(_scopeEnabled&&serial==_scopeLatestSerial&&(generation==_scopeGeneration||!CMTIME_IS_NUMERIC(_scopeRequestedTime)||CMTimeCompare(time,_scopeRequestedTime)==0)){sample.generation=_scopeGeneration;[_scopePending release];_scopePending=[sample retain];if(!_scopeWorkerRunning){_scopeWorkerRunning=YES;start=YES;}}
}[sample release];
if(notifyHistogram)[self queueOutputHistogramNotification];
if(start)dispatch_async(_scopeQueue,^{[self processPendingScopeSamples];});
}@catch(NSException *exception){/* Scope diagnostics must never fail rendering. */}}
}
- (void)processPendingScopeSamples{
for(;;){@autoreleasepool{
DYScopeSample *sample=nil;@synchronized(_previewLock){sample=_scopePending;_scopePending=nil;if(!sample){_scopeWorkerRunning=NO;return;}}
@synchronized(_previewLock){if(!_scopeEnabled||sample.generation!=_scopeGeneration){[sample release];continue;}}
const auto *raw=(const dyscope::RGBA*)sample.pixels.bytes;size_t count=sample.pixels.length/sizeof(dyscope::RGBA);std::vector<DYCompositeRGBA> pixels(count);uint64_t invalid=0;
for(size_t i=0;i<count;i++){
const auto&p=raw[i];BOOL finite=std::isfinite(p.r)&&std::isfinite(p.g)&&std::isfinite(p.b)&&std::isfinite(p.a);
@@ -48,12 +88,12 @@
}if(target)CGColorSpaceRelease(target);
std::vector<dyscope::RGBA> reference;reference.reserve(pixels.size());for(const auto&p:pixels)reference.push_back({p.r,p.g,p.b,p.a});
auto measurements=dyscope::measure(reference);measurements.nonfinite+=invalid;
auto wave=dyscope::densityImage(measurements.wave,false),parade=dyscope::densityImage(measurements.parade,true);
auto wave=dyscope::densityImage(measurements.wave,false),parade=dyscope::densityImage(measurements.parade,true),vectors=dyscope::vectorImage(measurements.vectors);
NSMutableDictionary *metadata=[[sample.metadata mutableCopy]autorelease];
metadata[@"domain"]=converted?@"sRGB 显示参考":@"宿主 RGB(未换算)";
metadata[@"note"]=converted?@"最终输出 · ICC 转扩展 sRGB · R′G′B′ 百分比;非 HDR / IRE 精密测量":(error?[NSString stringWithFormat:@"RGB 原值参考 · %@;波形按 709 权重参考,非 IRE",error.localizedDescription]:@"最终输出 · 空间未知;RGB 原值 / 709 权重波形参考,非显示 / HDR / IRE 测量");
metadata[@"converted"]=@(converted);metadata[@"minimum"]=@(measurements.minimum);metadata[@"maximum"]=@(measurements.maximum);metadata[@"valid"]=@(measurements.valid);metadata[@"transparent"]=@(measurements.transparent>=invalid?measurements.transparent-invalid:0);metadata[@"nonfinite"]=@(measurements.nonfinite);metadata[@"below"]=@(measurements.below);metadata[@"above"]=@(measurements.above);
metadata[@"waveform"]=[NSData dataWithBytes:wave.data() length:wave.size()];metadata[@"parade"]=[NSData dataWithBytes:parade.data() length:parade.size()];metadata[@"histogram"]=[NSData dataWithBytes:measurements.histogram.data() length:sizeof(measurements.histogram)];
metadata[@"waveform"]=[NSData dataWithBytes:wave.data() length:wave.size()];metadata[@"parade"]=[NSData dataWithBytes:parade.data() length:parade.size()];metadata[@"histogram"]=[NSData dataWithBytes:measurements.histogram.data() length:sizeof(measurements.histogram)];metadata[@"vectorscope"]=[NSData dataWithBytes:vectors.data() length:vectors.size()];
BOOL publish=NO;@synchronized(_previewLock){if(_scopeEnabled&&sample.generation==_scopeGeneration){[_scopePreview release];_scopePreview=[[NSData alloc]initWithBytes:pixels.data() length:pixels.size()*sizeof(DYCompositeRGBA)];[_scopeMetadata release];_scopeMetadata=[metadata copy];publish=YES;}}
NSUInteger generation=sample.generation;[sample release];
if(publish)dispatch_async(dispatch_get_main_queue(),^{BOOL active=NO;@synchronized(_previewLock){active=_scopeEnabled&&generation==_scopeGeneration;}if(active)[NSNotificationCenter.defaultCenter postNotificationName:@"DYScopeDidChange" object:self];});
+18
查看文件
@@ -0,0 +1,18 @@
#pragma once
#import <CoreMedia/CoreMedia.h>
// FCP can expose the exclusive input out point to custom views while its viewer
// holds the last visible frame. Only that exact boundary has a previous frame.
static inline CMTime DYScopeDisplayTime(CMTime requested,CMTime start,CMTime duration,CMTime frame){
if(!CMTIME_IS_NUMERIC(requested)||!CMTIME_IS_NUMERIC(start)||!CMTIME_IS_NUMERIC(duration)||!CMTIME_IS_NUMERIC(frame)||duration.value<=0||frame.value<=0||duration.epoch||frame.epoch)return requested;
CMTime end=CMTimeAdd(start,duration);if(!CMTIME_IS_NUMERIC(end)||CMTimeCompare(requested,end)!=0)return requested;
CMTime last=CMTimeSubtract(end,frame);return CMTimeCompare(last,start)<0?start:last;
}
#import <FxPlug/FxPlugSDK.h>
// Caller must already hold a custom parameter action. OSC events keep their
// provided time; this only normalizes the custom-view clock used to guard them.
static inline CMTime DYHostDisplayedFrameTime(id<PROAPIAccessing> host,CMTime current){
id<FxTimingAPI_v4>timing=[host apiForProtocol:@protocol(FxTimingAPI_v4)];CMTime start=kCMTimeInvalid,duration=kCMTimeInvalid,frame=kCMTimeInvalid;
if([timing respondsToSelector:@selector(startTimeOfInputToFilter:)]&&[timing respondsToSelector:@selector(durationTimeOfInputToFilter:)]&&[timing respondsToSelector:@selector(frameDuration:)]){[timing startTimeOfInputToFilter:&start];[timing durationTimeOfInputToFilter:&duration];[timing frameDuration:&frame];}
return DYScopeDisplayTime(current,start,duration,frame);
}
+12 -1
查看文件
@@ -11,14 +11,20 @@
namespace dyscope {
inline constexpr unsigned Width=320,Height=180,Bins=256;
inline constexpr float Low=-.1f,High=1.1f;
// Conventional positive-I flesh-tone reference: 33 degrees left of +Cr.
inline constexpr double SkinToneAngle=123.0*3.14159265358979323846/180.0;
inline constexpr double SkinToneCb=-0.5446390350150271,SkinToneCr=0.8386705679454240;
struct RGBA { float r,g,b,a; };
struct Result {
std::vector<uint32_t> wave=std::vector<uint32_t>(Width*Bins),parade=std::vector<uint32_t>(3*Width*Bins);
std::vector<uint32_t> wave=std::vector<uint32_t>(Width*Bins),parade=std::vector<uint32_t>(3*Width*Bins),vectors=std::vector<uint32_t>(Bins*Bins);
std::array<uint32_t,4*Bins> histogram{};
uint64_t valid=0,transparent=0,nonfinite=0,below=0,above=0;
float minimum=0,maximum=0;
};
inline unsigned bin(float v){if(!(v>Low))return 0;if(v>=High)return Bins-1;return unsigned(std::clamp(std::lround((v-Low)/(High-Low)*(Bins-1)),0l,long(Bins-1)));}
// BT.709 colour-difference coordinates on the same encoded display-reference
// RGB used by the existing scopes (ITU-R BT.709-6 section 3.3). Not an IRE meter.
inline unsigned chromaBin(float v){if(!(v>-.6f))return 0;if(v>=.6f)return Bins-1;return unsigned(std::clamp(std::lround((v+.6f)/1.2f*(Bins-1)),0l,long(Bins-1)));}
inline Result measure(std::span<const RGBA> pixels,unsigned width=Width,unsigned height=Height){
Result r;if(!width||!height||pixels.size()!=size_t(width)*height)return r;bool first=true;
for(unsigned y=0;y<height;y++)for(unsigned x=0;x<width;x++){
@@ -26,6 +32,7 @@ inline Result measure(std::span<const RGBA> pixels,unsigned width=Width,unsigned
if(!(std::isfinite(p.r)&&std::isfinite(p.g)&&std::isfinite(p.b)&&std::isfinite(p.a))){r.nonfinite++;continue;}
if(p.a<=1e-6f){r.transparent++;continue;}
float values[4]={.2126f*p.r+.7152f*p.g+.0722f*p.b,p.r,p.g,p.b};unsigned column=std::min(Width-1,unsigned(uint64_t(x)*Width/width));
float cb=(p.b-values[0])/1.8556f,cr=(p.r-values[0])/1.5748f;r.vectors[(Bins-1-chromaBin(cr))*Bins+chromaBin(cb)]++;
for(unsigned c=0;c<4;c++){
float v=values[c];unsigned b=bin(v);r.histogram[c*Bins+b]++;
if(!c)r.wave[(Bins-1-b)*Width+column]++;
@@ -46,4 +53,8 @@ inline std::vector<uint8_t> densityImage(std::span<const uint32_t> counts,bool p
}
return out;
}
inline std::vector<uint8_t> vectorImage(std::span<const uint32_t> counts){
if(counts.size()!=Bins*Bins)return {};std::vector<uint8_t> out(counts.size()*4);uint32_t maximum=0;for(uint32_t n:counts)maximum=std::max(maximum,n);float divisor=std::log1p(float(maximum));
for(size_t i=0;i<counts.size();i++){float cb=float(i%Bins)/(Bins-1)*1.2f-.6f,cr=.6f-float(i/Bins)/(Bins-1)*1.2f;float intensity=counts[i]&&divisor>0?std::pow(std::log1p(float(counts[i]))/divisor,.65f):0;float colors[]={.5f+1.5748f*cr,.5f-.187324f*cb-.468124f*cr,.5f+1.8556f*cb};float peak=std::max({colors[0],colors[1],colors[2],.001f});for(int c=0;c<3;c++)out[i*4+c]=uint8_t(std::lround(std::clamp(colors[c]/peak,0.f,1.f)*intensity*255));out[i*4+3]=255;}return out;
}
}
+2
查看文件
@@ -6,4 +6,6 @@
@property(nonatomic,copy) NSDictionary *metadata;
@property(nonatomic) NSUInteger generation;
@property(nonatomic) CGColorSpaceRef space;
/// Final-output bins in the host RGB domain, calculated only if requested.
@property(nonatomic,readonly) NSData *canvasHistogram;
@end
+11 -2
查看文件
@@ -1,5 +1,14 @@
#import "DYScopeSample.h"
@implementation DYScopeSample
#import "DYHistogram.h"
@implementation DYScopeSample {
NSData *_canvasHistogram;
}
- (NSData *)canvasHistogram{
@synchronized(self){
if(!_canvasHistogram)_canvasHistogram=[DYHistogramFromRGBA(_pixels,true) retain];
return [[_canvasHistogram retain]autorelease];
}
}
- (void)setSpace:(CGColorSpaceRef)space{if(_space==space)return;if(_space)CGColorSpaceRelease(_space);_space=space?CGColorSpaceRetain(space):nil;}
- (void)dealloc{[_pixels release];[_metadata release];if(_space)CGColorSpaceRelease(_space);[super dealloc];}
- (void)dealloc{[_pixels release];[_metadata release];[_canvasHistogram release];if(_space)CGColorSpaceRelease(_space);[super dealloc];}
@end
@@ -0,0 +1,65 @@
// Shared author identity and disposable render bindings must stay separate.
{
NSMutableDictionary *doc=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);
NSMutableDictionary *shared=(id)DYAddSharedMask(doc,DYMaskRectangle);NSString *maskID=shared[@"id"];
run.need(@"shared-mask-can-be-authored-before-any-module-assignment",shared&&DYValidToolDocument(doc)&&DYSharedMasks(doc).count==1&&DYMasksForTool(doc,@"shared").firstObject==shared&&DYMasksForTool(doc,@"base:hsl").count==0);
NSDictionary *layer=DYInsertTool(doc,@"curve",@"base:curve");NSString *layerID=layer[@"id"];
BOOL assigned=DYSetSharedMaskAssigned(doc,maskID,@"base:hsl",YES)&&DYSetSharedMaskAssigned(doc,maskID,layerID,YES);
run.record(@"shared-mask-two-module-bindings-retain-one-author-object",assigned&&DYValidToolDocument(doc)&&DYSharedMasks(doc).count==1&&DYMasksForTool(doc,@"base:hsl").firstObject==DYMasksForTool(doc,layerID).firstObject&&DYToolIDsForSharedMask(doc,maskID).count==2&&[doc[@"baseMasks"][@"hsl"][0][@"sharedID"]isEqual:maskID]&&[doc[@"schema"]isEqual:@3]);
DYMaskParameters p=DYMaskAtTime(shared,kCMTimeZero);p.centerX=.31;shared[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];DYMaskParameters q=DYMaskAtTime(DYMasksForTool(doc,layerID).firstObject,kCMTimeZero);
run.record(@"editing-one-shared-mask-updates-all-linked-modules",fabs(q.centerX-.31)<1e-6&&DYSharedMasks(doc).count==1);
DYMaskParameters moved=p;moved.centerX=.71;DYMergeTracking(shared,@[DYMaskKey(kCMTimeZero,p,YES,1),DYMaskKey(CMTimeMake(2,24),moved,NO,.9)]);
q=DYMaskAtTime(DYMasksForTool(doc,layerID).firstObject,CMTimeMake(1,24));
run.record(@"shared-tracking-is-single-timeline-for-every-module",fabs(q.centerX-.51)<1e-6&&[DYMasksForTool(doc,@"base:hsl").firstObject[@"keys"]count]==2);
DYToolDocument *author=[[[DYToolDocument alloc]init]autorelease];author.document=doc;NSData *encoded=[NSKeyedArchiver archivedDataWithRootObject:author requiringSecureCoding:YES error:&error];DYToolDocument *decoded=[NSKeyedUnarchiver unarchivedObjectOfClass:DYToolDocument.class fromData:encoded error:&error];
run.record(@"shared-mask-archive-roundtrip-keeps-unique-object-and-links",[decoded isEqual:author]&&DYSharedMasks(decoded.document).count==1&&DYToolIDsForSharedMask(decoded.document,maskID).count==2);
NSDictionary *snapshot=DYToolRenderSnapshot(doc,CMTimeMake(1,24)),*again=DYToolRenderSnapshot(doc,CMTimeMake(1,24));NSDictionary *base=DYMasksForTool(snapshot,@"base:hsl").firstObject,*extra=DYMasksForTool(snapshot,layerID).firstObject;
run.record(@"shared-render-snapshot-freezes-all-bindings-with-stable-private-identities",DYValidToolDocument(snapshot)&&[snapshot isEqual:again]&&![base[@"id"]isEqual:extra[@"id"]]&&[base[@"sourceSharedID"]isEqual:maskID]&&[extra[@"sourceSharedID"]isEqual:maskID]&&[base[@"keys"]count]==0&&[extra[@"keys"]count]==0&&fabs(DYMaskAtTime(base,kCMTimeZero).centerX-.51)<1e-6&&[shared[@"keys"]count]==2);
NSMutableDictionary *bad=DYMutablePlist(doc);bad[@"baseMasks"][@"hsl"]=[NSMutableArray arrayWithObjects:@{@"sharedID":maskID},@{@"sharedID":maskID},nil];run.record(@"shared-mask-rejects-duplicate-binding-in-one-module",!DYValidToolDocument(bad));
bad=DYMutablePlist(doc);bad[@"baseMasks"][@"hsl"]=[NSMutableArray arrayWithObject:@{@"sharedID":NSUUID.UUID.UUIDString}];run.record(@"shared-mask-rejects-dangling-reference",!DYValidToolDocument(bad));
bad=DYMutablePlist(doc);bad[@"baseMasks"][@"hsl"]=[NSMutableArray arrayWithObject:DYMutablePlist(shared)];run.record(@"shared-mask-rejects-copied-author-object-with-same-identity",!DYValidToolDocument(bad));
bad=DYMutablePlist(doc);bad[@"schema"]=@2;run.record(@"legacy-document-cannot-silently-contain-shared-references",!DYValidToolDocument(bad));
BOOL detached=DYSetSharedMaskAssigned(doc,maskID,@"base:hsl",NO);run.record(@"unlinking-one-module-keeps-shared-mask-and-other-module",detached&&DYMasksForTool(doc,@"base:hsl").count==0&&DYMasksForTool(doc,layerID).count==1&&DYSharedMasks(doc).count==1&&DYValidToolDocument(doc));
BOOL removed=DYRemoveSharedMask(doc,maskID);run.record(@"deleting-shared-mask-removes-all-references-without-deleting-modules",removed&&DYSharedMasks(doc).count==0&&DYMasksForTool(doc,layerID).count==0&&DYToolWithID(doc,layerID)&&DYValidToolDocument(doc));
NSMutableDictionary *legacy=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);NSDictionary *old=DYNewMask(DYMaskEllipse);legacy[@"baseMasks"][@"curve"]=[NSMutableArray arrayWithObject:old];NSDictionary *promoted=DYShareToolMask(legacy,@"base:curve",old[@"id"]);
run.record(@"sharing-legacy-mask-moves-one-object-without-changing-geometry-or-identity",promoted&&[promoted isEqual:old]&&DYSharedMasks(legacy).count==1&&DYMasksForTool(legacy,@"base:curve").firstObject==promoted&&DYValidToolDocument(legacy));
BOOL removedBase=DYSetBaseToolRemoved(legacy,@"curve",YES);run.record(@"removing-base-module-detaches-reference-and-preserves-shared-object",removedBase&&DYValidToolDocument(legacy)&&DYSharedMasks(legacy).count==1&&DYToolIDsForSharedMask(legacy,old[@"id"]).count==0);
NSMutableDictionary *limits=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);BOOL sixteen=YES;for(int i=0;i<DYSharedMaskLimit;i++){NSDictionary *item=DYAddSharedMask(limits,DYMaskEllipse);if(i<DYToolMaskLimit)sixteen&=DYSetSharedMaskAssigned(limits,item[@"id"],@"base:hsl",YES);}NSDictionary *seventeenth=DYSharedMasks(limits)[DYToolMaskLimit];
run.record(@"shared-library-and-per-module-reference-limits-remain-independent",sixteen&&DYSharedMasks(limits).count==DYSharedMaskLimit&&DYMasksForTool(limits,@"base:hsl").count==DYToolMaskLimit&&!DYAddSharedMask(limits,DYMaskRectangle)&&!DYSetSharedMaskAssigned(limits,seventeenth[@"id"],@"base:hsl",YES)&&DYValidToolDocument(limits));
// More than 65,536 referenced keys, but only 7,000 uniquely authored keys.
NSMutableDictionary *many=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);NSMutableDictionary *timeline=(id)DYAddSharedMask(many,DYMaskRectangle);NSMutableArray *keys=[NSMutableArray arrayWithCapacity:7000];for(int i=0;i<7000;i++)[keys addObject:DYMaskKey(CMTimeMake(i,24),p,NO,.9)];timeline[@"keys"]=keys;BOOL allBindings=YES;for(NSString *type in [DYToolTypes()subarrayWithRange:NSMakeRange(0,10)])allBindings&=DYSetSharedMaskAssigned(many,timeline[@"id"],[@"base:" stringByAppendingString:type],YES);
run.record(@"shared-key-budget-counts-author-object-once-regardless-of-bindings",allBindings&&DYValidToolDocument(many)&&DYValidToolDocument(DYToolRenderSnapshot(many,CMTimeMake(50,24)))&&DYValidToolDocument(DYResolvedToolDocument(many)));
BOOL compactFits=YES,compactRows=YES;
for(int kind=0;kind<6;kind++){
NSMutableDictionary *state=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);NSDictionary *mask=DYAddSharedMask(state,kind);NSView<DYWorkspaceMaskEditing> *editor=DYCreateWorkspaceMaskEditor(manager,@"shared");[editor refreshWithDocument:state time:kCMTimeZero];[editor selectMaskID:mask[@"id"]];
for(NSNumber *width in @[@377,@600,@860,@1200]){[editor setFrameSize:NSMakeSize(width.doubleValue,235)];[editor setFrameSize:NSMakeSize(MAX(width.doubleValue,editor.contentWidth),editor.contentHeight)];[editor layoutSubtreeIfNeeded];for(NSView *view in editor.subviews)if(!view.hidden)compactFits&=NSContainsRect(editor.bounds,view.frame)&&view.frame.size.width>0&&view.frame.size.height>0;for(NSDictionary *row in [editor valueForKey:@"_rows"]){NSView *label=row[@"label"],*field=row[@"field"],*slider=row[@"slider"];if(label.hidden)continue;compactRows&=!NSIntersectsRect(label.frame,field.frame)&&!NSIntersectsRect(label.frame,slider.frame)&&!NSIntersectsRect(field.frame,slider.frame)&&field.frame.size.width>=64&&slider.frame.size.width>=140;}}
}
run.record(@"workspace-six-mask-editors-flow-horizontally-at-235-point-height",compactFits&&compactRows);
}
// Exercise the actual IOSurface/Metal path against independently owned masks.
// This reference never uses the shared-reference expander to construct masks.
{
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYUniforms active=defaults;active.skinProtection.x=0;active.hslSectionEnabled=1;active.spiderSectionEnabled=1;active.spiderMix=1;
active.hslHueA=active.hslHueB=(DYFloat4){24,24,24,24};active.hslSatA=active.hslSatB=(DYFloat4){25,25,25,25};
auto mesh=dy::neutralMesh(6,6);std::bitset<dy::SpiderMeshCapacity>selected;for(int i=0;i<dy::meshCount(mesh);i++)if(!dy::meshBoundary(mesh,i))selected[i]=true;mesh=dy::moveMesh(mesh,selected,-.045f,.035f);NSData *meshData=[NSData dataWithBytes:&mesh length:sizeof(mesh)];
NSMutableDictionary *sharedDocument=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document),*sharedMask=(id)DYAddSharedMask(sharedDocument,DYMaskRectangle);NSString *sharedID=sharedMask[@"id"];
DYMaskParameters geometry=DYMaskAtTime(sharedMask,kCMTimeZero);geometry.centerX=.28;geometry.centerY=.5;geometry.width=.35;geometry.height=.7;geometry.feather=0;sharedMask[@"parameters"]=[NSData dataWithBytes:&geometry length:sizeof(geometry)];
run.need(@"gpu-shared-hsl-spider-use-one-rectangle-author",DYSetSharedMaskAssigned(sharedDocument,sharedID,@"base:hsl",YES)&&DYSetSharedMaskAssigned(sharedDocument,sharedID,@"base:spider",YES)&&DYValidToolDocument(sharedDocument));
auto independentDocument=[&](){NSMutableDictionary *reference=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);for(NSString *type in @[@"hsl",@"spider"]){NSMutableDictionary *copy=DYMutablePlist(sharedMask);copy[@"id"]=NSUUID.UUID.UUIDString;reference[@"baseMasks"][type]=[NSMutableArray arrayWithObject:copy];}return reference;};
auto renderAt=[&](NSDictionary *document,CMTime time,DYUniforms uniforms,NSString *name){NSError *failure=nil;NSDictionary *snapshot=DYToolRenderSnapshot(document,time);BOOL valid=DYValidToolDocument(snapshot);BOOL rendered=valid&&[renderer renderSource:source destination:destination uniforms:uniforms paths:@{} spider:meshData tools:snapshot error:&failure];run.need(name,rendered,@{@"error":reason(failure),@"validSnapshot":@(valid)});return read(destination,gpu);};
auto alphaPreserved=[&](const Pixels& pixels){if(pixels.size()!=input.size())return false;for(NSUInteger i=3;i<input.size();i+=4)if(pixels[i]!=input[i])return false;return true;};
Pixels first=renderAt(sharedDocument,kCMTimeZero,active,@"gpu-shared-hsl-spider-initial-render"),reference=renderAt(independentDocument(),kCMTimeZero,active,@"gpu-independent-hsl-spider-initial-reference");Difference initialError=difference(first,reference);
run.record(@"gpu-shared-hsl-spider-equals-two-independent-masks-per-pixel",initialError.nonfinite==0&&initialError.maximum<.0001&&alphaPreserved(first)&&alphaPreserved(reference),measure(initialError));
DYUniforms hslOnly=active,spiderOnly=active;hslOnly.spiderSectionEnabled=0;spiderOnly.hslSectionEnabled=0;Pixels hslFrame=renderAt(sharedDocument,kCMTimeZero,hslOnly,@"gpu-shared-hsl-only-control"),spiderFrame=renderAt(sharedDocument,kCMTimeZero,spiderOnly,@"gpu-shared-spider-only-control");
run.record(@"gpu-shared-region-both-hsl-and-spider-affect-real-pixels",difference(first,hslFrame).different>10&&difference(first,spiderFrame).different>10);
geometry.centerX=.72;sharedMask[@"parameters"]=[NSData dataWithBytes:&geometry length:sizeof(geometry)];Pixels edited=renderAt(sharedDocument,kCMTimeZero,active,@"gpu-shared-edited-rectangle-render"),editedReference=renderAt(independentDocument(),kCMTimeZero,active,@"gpu-independent-edited-rectangle-reference");Difference editedError=difference(edited,editedReference),editedChange=difference(first,edited);
run.record(@"gpu-editing-unique-shared-geometry-updates-both-operations",editedError.nonfinite==0&&editedError.maximum<.0001&&editedChange.different>20&&alphaPreserved(edited),@{@"maximumReferenceError":@(editedError.maximum),@"changedComponents":@(editedChange.different),@"uniqueAuthorObjects":@(DYSharedMasks(sharedDocument).count)});
DYMaskParameters tracked=geometry;tracked.centerX=.28;BOOL merged=DYMergeTracking(sharedMask,@[DYMaskKey(kCMTimeZero,geometry,YES,1),DYMaskKey(CMTimeMake(2,24),tracked,NO,.93)]);CMTime middle=CMTimeMake(1,24);Pixels animated=renderAt(sharedDocument,middle,active,@"gpu-shared-tracking-middle-render"),animatedReference=renderAt(independentDocument(),middle,active,@"gpu-independent-tracking-middle-reference");Difference trackingError=difference(animated,animatedReference),trackingChange=difference(edited,animated);
run.record(@"gpu-one-shared-trajectory-drives-hsl-and-spider-per-frame",merged&&trackingError.nonfinite==0&&trackingError.maximum<.0001&&trackingChange.different>20&&alphaPreserved(animated)&&DYSharedMasks(sharedDocument).count==1&&[DYMasksForTool(sharedDocument,@"base:hsl").firstObject[@"keys"]count]==2&&DYMasksForTool(sharedDocument,@"base:hsl").firstObject==DYMasksForTool(sharedDocument,@"base:spider").firstObject,@{@"maximumReferenceError":@(trackingError.maximum),@"changedComponents":@(trackingChange.different),@"evaluatedCenterX":@(DYMaskAtTime(sharedMask,middle).centerX)});
// Use the real preset serializer, then the same JSON/base64-plist path that
// loadPreset validates, with a separate manager so other fixtures stay intact.
DYDiagnosticManager *presetHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(presetHost,&error);DYWriteTools(presetHost,sharedDocument,kCMTimeZero);DYAssetState *presetAssets=[[[DYAssetState alloc]init]autorelease];presetAssets.spiderMesh=meshData;presetAssets.spiderLinked=YES;DYWriteAssets(presetHost,presetAssets,kCMTimeZero);DYInspector *presetInspector=[[[DYInspector alloc]initWithAPIManager:presetHost renderer:renderer]autorelease];NSDictionary *preset=[presetInspector performSelector:@selector(presetSnapshot)];NSData *json=[NSJSONSerialization dataWithJSONObject:preset options:0 error:&error];NSDictionary *loaded=json?[NSJSONSerialization JSONObjectWithData:json options:0 error:&error]:nil;NSData *toolBytes=[loaded[@"tools"]isKindOfClass:NSString.class]?[[[NSData alloc]initWithBase64EncodedString:loaded[@"tools"] options:0]autorelease]:nil;NSDictionary *restored=toolBytes?[NSPropertyListSerialization propertyListWithData:toolBytes options:NSPropertyListImmutable format:NULL error:&error]:nil;
run.record(@"preset-v7-json-roundtrip-preserves-unique-shared-object-and-trajectory",[loaded[@"version"]isEqual:@7]&&[loaded[@"format"]isEqual:@"com.dayu.color.preset"]&&DYValidToolDocument(restored)&&[restored isEqual:sharedDocument]&&DYSharedMasks(restored).count==1&&DYToolIDsForSharedMask(restored,sharedID).count==2&&[DYSpiderFromJSON(loaded[@"spider"])isEqual:meshData]);
}
+1
查看文件
@@ -8,6 +8,7 @@ FOUNDATION_EXPORT NSDictionary<NSString *, NSColor *> *DYThemePalette(void);
FOUNDATION_EXPORT NSColor *DYThemeColor(NSString *role);
FOUNDATION_EXPORT BOOL DYThemeIsLight(void);
FOUNDATION_EXPORT BOOL DYThemeUsesRelief(void);
FOUNDATION_EXPORT BOOL DYThemeWorkspaceContext(NSView *view);
// Opaque relief with a directional reflective rim; native controls retain their actions.
FOUNDATION_EXPORT void DYDrawSoftControl(NSRect rect, CGFloat radius, BOOL recessed, BOOL emphasized, BOOL pressed);
+5 -2
查看文件
@@ -108,6 +108,8 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
NSBezierPath *inner=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect,1.5,1.5) xRadius:MAX(0,radius-1.5) yRadius:MAX(0,radius-1.5)];
[[rgb(.40,.60,.73)colorWithAlphaComponent:strong?.35:.12]setStroke];inner.lineWidth=.5;[inner stroke];
}
BOOL DYThemeWorkspaceContext(NSView *view){for(NSView *ancestor=view;ancestor;ancestor=ancestor.superview)if([ancestor.identifier isEqual:@"DYColorWorkspace"])return YES;return NO;}
static void drawWorkspaceControl(NSRect frame,BOOL pressed){NSBezierPath *shape=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(frame,1,2) xRadius:3 yRadius:3];[[NSColor colorWithWhite:DYThemeIsLight()?(pressed?.72:.81):(pressed?.19:.25) alpha:1]setFill];[shape fill];[[NSColor colorWithWhite:DYThemeIsLight()?.57:.34 alpha:1]setStroke];shape.lineWidth=NSWorkspace.sharedWorkspace.accessibilityDisplayShouldIncreaseContrast?1.5:.5;[shape stroke];}
@implementation DYThemeLabel
- (void)drawRect:(NSRect)rect {[super drawRect:rect];}
@end
@@ -121,6 +123,7 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
}
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)view {
if(!self.bordered){[super drawBezelWithFrame:frame inView:view];return;}
if(DYThemeWorkspaceContext(view)){drawWorkspaceControl(frame,self.highlighted);return;}
BOOL selected=[view.identifier isEqual:@"appearanceToggle"]&&self.state==NSControlStateValueOn;
DYDrawSoftControl(NSInsetRect(frame,2,3),7,selected,[view.identifier isEqual:@"primaryAction"],self.highlighted);
}
@@ -128,13 +131,13 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
@implementation DYThemeButton
+ (Class)cellClass {return DYThemeButtonCell.class;}
- (void)drawRect:(NSRect)rect {
if([self.identifier isEqual:@"layerAction"])DYDrawSoftControl(NSInsetRect(self.bounds,2,2),6,NO,NO,self.cell.highlighted);
if([self.identifier isEqual:@"layerAction"]&&!DYThemeWorkspaceContext(self))DYDrawSoftControl(NSInsetRect(self.bounds,2,2),6,NO,NO,self.cell.highlighted);
[super drawRect:rect];
}
@end
@implementation DYThemePopUpButton
- (void)drawRect:(NSRect)rect {
NSRect bounds=NSInsetRect(self.bounds,2,3);NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:6 yRadius:6];DYDrawSoftControl(bounds,6,NO,NO,self.cell.highlighted);
NSRect bounds=NSInsetRect(self.bounds,2,3);NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:6 yRadius:6];if(DYThemeWorkspaceContext(self))drawWorkspaceControl(self.bounds,self.cell.highlighted);else DYDrawSoftControl(bounds,6,NO,NO,self.cell.highlighted);
NSMutableDictionary *attributes=[NSMutableDictionary dictionaryWithDictionary:DYThemeTextAttributes(self.font?:[NSFont systemFontOfSize:11],[DYThemeColor(@"text")colorWithAlphaComponent:self.enabled?1:.45])];NSMutableParagraphStyle *paragraph=[[[NSMutableParagraphStyle alloc]init]autorelease];paragraph.lineBreakMode=NSLineBreakByTruncatingTail;attributes[NSParagraphStyleAttributeName]=paragraph;
CGFloat y=NSMidY(self.bounds)-(self.font?:[NSFont systemFontOfSize:11]).pointSize*.62;
[(self.pullsDown?[self itemAtIndex:0].title:(self.selectedItem.title?:@""))drawInRect:NSMakeRect(9,y,MAX(0,self.bounds.size.width-29),18) withAttributes:attributes];
已加载 100/140 个文件。由于本次变更涉及的文件过多,其余文件未显示。 显示更多