比较提交
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
a7926f7e13 | ||
|
|
474bff9ea9 | ||
|
|
9f5f065977 | ||
|
|
14afd3382c | ||
|
|
48f48cb90c | ||
|
|
8b96e8b8c1 | ||
|
|
6515e0fa67 | ||
|
|
d2b6f8ef81 | ||
|
|
687a366e1c | ||
|
|
7b6a3106ca | ||
|
|
89eeaa9ba1 | ||
|
|
c86925d967 | ||
|
|
7e11c47126 | ||
|
|
810bbf4dfb | ||
|
|
52a7422004 | ||
|
|
78b4c5f962 | ||
|
|
7bf1f88fe9 | ||
|
|
b2601ac9b0 | ||
|
|
5032ce70ab | ||
|
|
df9b3c0253 | ||
|
|
44c4f5c470 | ||
|
|
84a0405628 | ||
|
|
5252296b7b | ||
|
|
db6b2b05b3 | ||
|
|
a7508203d1 | ||
|
|
38afc087d5 | ||
|
|
46153a26ed | ||
|
|
1659f3d385 | ||
|
|
dff9134be7 | ||
|
|
1f1b7917e7 | ||
|
|
4fb008e100 | ||
|
|
07601e50bf | ||
|
|
9977b5c41b | ||
|
|
ca8a5433d3 | ||
|
|
213d01dbd8 | ||
|
|
0782b5e654 | ||
|
|
504e08e425 | ||
|
|
bbb258e495 | ||
|
|
9f0adbeb3b | ||
|
|
43320c7ccd | ||
|
|
54ca7150f8 | ||
|
|
65e4c02bd0 | ||
|
|
fb21dabc08 | ||
|
|
e241f2a3e5 | ||
|
|
c9bd52fff5 | ||
|
|
585c83c8a1 | ||
|
|
91b66eb2d8 | ||
|
|
ee14dd9185 | ||
|
|
b77226b7e6 |
没有与搜索条件相匹配的文件
@@ -0,0 +1,15 @@
|
||||
# 大鱼调色项目规则
|
||||
|
||||
本文件适用于当前 Git 仓库及其子目录。沿用本机全局开发、正式交付和 Git 备份约定。
|
||||
|
||||
## 接手
|
||||
|
||||
- 新对话先读 [开发交接.md](开发交接.md) 的当前基线和待跟进事项。核对实际工作区、分支、远端、正式安装版本和交付锁,再依据用户本轮要求继续。
|
||||
- 按范围查阅专项交接、`verification/` 和 [RECOVERY.md](RECOVERY.md)。旧版本文档用于查找历史,当前状态以实际结果和对应版本的验证记录为准。
|
||||
|
||||
## 每次任务结束都要更新交接
|
||||
|
||||
- 无论本轮是开发、排查、发布、纯文档工作,还是暂时受阻,结束前都在 [开发交接.md](开发交接.md) 记录本轮工作。更新受影响的当前基线和待跟进事项,保留前序任务记录。
|
||||
- 写清任务日期与目标、实际完成的改动和关键路径、验证结果及覆盖范围、交付状态,以及仍待处理的事项和接手第一步。涉及发行时分别标明实际编译提交、版本标签、本机安装、Git Release、站点文章和主 APP 更新通道,注明对应版本和核验依据。
|
||||
- 区分本机实测、用户确认、自动检查与尚待复现的反馈。保留有助于继续排查的限制、假设和阻塞,引用已有报告。凭据、用户素材和未脱敏日志留在各自受控位置。
|
||||
- 在本轮结束前按 Git 约定提交交接文档,推送并回读远端。最后回复附上交接入口;远端核验受阻时注明本地提交与具体原因。
|
||||
@@ -8,7 +8,9 @@ import os
|
||||
from pathlib import Path
|
||||
import plistlib
|
||||
import shutil
|
||||
import stat
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
APP = Path("/Library/Plug-Ins/FxPlug/大鱼调色.app")
|
||||
@@ -25,6 +27,33 @@ def history(profile, keychain):
|
||||
"--keychain", keychain, "--output-format", "json"))["history"]
|
||||
|
||||
|
||||
def check_bundle_access(entries):
|
||||
for path, mode in entries:
|
||||
if stat.S_ISLNK(mode):
|
||||
continue
|
||||
required = 0o555 if stat.S_ISDIR(mode) or mode & stat.S_IXUSR else 0o444
|
||||
if mode & required != required:
|
||||
raise ValueError(f"普通用户无法读取或执行安装载荷:{path}({stat.S_IMODE(mode):04o})")
|
||||
|
||||
|
||||
def check_package_bundle_access(package):
|
||||
prefix = "." + str(APP)
|
||||
with tempfile.TemporaryDirectory(dir=CACHE) as scratch:
|
||||
expanded = Path(scratch) / "expanded"
|
||||
run("pkgutil", "--expand", str(package), str(expanded))
|
||||
entries = {}
|
||||
for bom in expanded.glob("*.pkg/Bom"):
|
||||
for line in run("lsbom", "-p", "fm", str(bom)).splitlines():
|
||||
path, mode = line.rsplit("\t", 1)
|
||||
if path == prefix or path.startswith(prefix + "/"):
|
||||
if not any(part.startswith("._") for part in Path(path).parts):
|
||||
entries[path] = int(mode, 8)
|
||||
if prefix not in entries:
|
||||
raise ValueError(f"安装载荷清单缺少正式 APP:{APP}")
|
||||
check_bundle_access(entries.items())
|
||||
return len(entries)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--pkg-forge-repo", type=Path,
|
||||
@@ -51,6 +80,7 @@ def main():
|
||||
(LOCK / "owner.json").write_text(json.dumps(dict(PID=os.getpid(), cwd=str(ROOT),
|
||||
product="大鱼调色", phase="PKG packaging", started=datetime.datetime.now(datetime.timezone.utc).isoformat())))
|
||||
try:
|
||||
check_bundle_access((path, path.lstat().st_mode) for path in [APP, *APP.rglob("*")])
|
||||
source = APP / "Contents/Resources/FCP Templates"
|
||||
staged = CACHE / "pkg-inputs/大鱼调色/大鱼调色"
|
||||
staged.mkdir(parents=True, exist_ok=True)
|
||||
@@ -93,6 +123,7 @@ def main():
|
||||
with log_path.open("w") as log:
|
||||
subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=True)
|
||||
package = args.output_dir / ("大鱼调色-" + version + ".pkg")
|
||||
verified_payload_entries = check_package_bundle_access(package)
|
||||
report_path = ROOT / "verification/Package.json"
|
||||
subprocess.run(["/usr/bin/python3", str(skill / "verify_fxplug_package.py"), "--manifest", str(manifest_path),
|
||||
"--package", str(package), "--report", str(report_path)], check=True)
|
||||
@@ -105,6 +136,7 @@ def main():
|
||||
report.update(notarization=job, appCompiledSource=delivery["sourceCommit"], appBuild=info["CFBundleVersion"],
|
||||
packageBuilderRemote="https://dayu.media/git/dayu/pkg-forge.git",
|
||||
packageBuilderCommit=run("git", "rev-parse", "HEAD", cwd=forge), templateSHA256=hashes,
|
||||
payloadBundleAccess=dict(entries=verified_payload_entries, scope="Read/traverse modes for installer-owned app entries, from the package BOM"),
|
||||
installedAppHostAcceptance=delivery.get("hostVerification", "verification/HostLUTLoading.json"),
|
||||
installScope="本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。")
|
||||
report_path.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
|
||||
|
||||
@@ -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,示波器"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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 后安装。"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
## 大鱼调色 1.13.0(83)
|
||||
|
||||
- 画布右下角新增仿制图章。点击画面选取样中心,再拖出带羽化的椭圆覆盖区域。可以叠加多个图章。
|
||||
- 选中图章后,可在画布上向前、向后或双向跟踪。覆盖区域随轨迹移动、缩放和旋转,取样中心固定。工作区可调整强度、羽化、位置和大小,或清除轨迹、停用和删除图章。
|
||||
- 缩小空闲画布浮层的位图范围,减少工具状态刷新中的重复编解码。
|
||||
|
||||
本公测版本适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。安装前保存剪辑并正常退出 Final Cut Pro 或 Motion。
|
||||
|
||||
安装包 SHA-256 `7999233dd4a3b797a879cc0f37a20f0c35f925c5f6823720b40e684464a452e8`,45,350,463 字节。
|
||||
@@ -0,0 +1,9 @@
|
||||
## 大鱼调色 1.13.1(85)
|
||||
|
||||
选中仿制图章后,可拖动青色取样十字来调整取样位置。松手后重新取样并保存为一次撤销,按 Esc 可取消拖动。覆盖区域及已有位置轨迹随项目保留。
|
||||
|
||||
图章按 1:1 像素平移复制。改变椭圆宽高只改变覆盖范围,跟踪只移动目标中心。原画面的像素尺寸和方向保持一致。
|
||||
|
||||
本公测版本适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。
|
||||
|
||||
安装包 SHA-256 `8a19afadda6317d186541f37a221c46261a22ddabcdddec90d02e1315b693965`,45,352,349 字节。
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"title": "大鱼调色 1.13.2 公测版|安装完整性校验与仿制图章",
|
||||
"content": "<!-- wp:paragraph -->\n<p>大鱼调色是适用于 Final Cut Pro 和 Motion 的原生 FxPlug 4 调色插件。1.13.2 公测版新增安装完整性校验,并包含近期加入的仿制图章。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">1.13.2 安装完整性校验</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p>主 App 注册插件前会检查官方签名和文件完整性。如果检测到掉签、重签或安装内容被修改,主 App 会停止自动更新,并尝试撤销当前副本的插件登记。Final Cut Pro 或 Motion 启动插件服务时,还会再做一次验签。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>官方原始 PKG 可以原样转发。</strong> 请保持安装包原样。禁止二次加密、另加一机一码后分发。大鱼调色安装和使用无需登录、激活码或机器码。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">仿制图章</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p>在画布右下角选择仿制图章,点选取样中心并拖出覆盖区。选中图章后,可以拖动青色十字重新取样,松手后可一次撤销,按 Esc 可取消拖动。图章按原像素平移复制,扩大覆盖区时,已有重合区域的复制像素保持一致。</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.12.0 统一调色工作区与共享蒙版</h3>\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:image {\"id\":15856,\"sizeSlug\":\"large\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-large\"><img src=\"https://dayu.media/wp-content/uploads/2026/11/1793866544-78805a221a988e7-1024x298.png\" alt=\"\" class=\"wp-image-15856\"/><figcaption class=\"wp-element-caption\">全新浮窗工作区面板</figcaption></figure>\n<!-- /wp:image -->\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 深色模式:画布左侧纵向工具条、检查Line truncated
|
||||
"excerpt": "大鱼调色 1.13.2 公测版加入安装完整性校验,并包含按原像素复制的仿制图章。原始安装包可以原样转发,安装与使用无需机器码。",
|
||||
"seo": {
|
||||
"title": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.13.2 公测版|安装完整性校验与仿制图章"
|
||||
},
|
||||
"description": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.13.2 是适用于 Final Cut Pro 与 Motion 的原生调色插件。新版增加安装完整性校验,并包含按原像素复制的仿制图章。官方原始安装包已签名公证,可以原样转发。适用于 Apple Silicon 和 macOS 14.6 或更新版本。"
|
||||
},
|
||||
"keywords": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色,Final Cut Pro,Motion,FxPlug4,调色插件,仿制图章,安装完整性校验"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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`。
|
||||
@@ -0,0 +1,9 @@
|
||||
## 大鱼调色 1.14.0(90)
|
||||
|
||||
仿制图章现在分别跟踪取样区和覆盖区的位置及缩放。覆盖圈会跟随覆盖区变化,复制内容按两边的相对缩放取样。原有图章可选中后重新执行双向跟踪。任一侧跟丢时,保留两边均可信的连续轨迹。
|
||||
|
||||
修复拖出图章后预览消失、拖动后回到原处,以及旧自动轨迹键可能让片尾跳回旧位置的问题。在 Final Cut Pro 12.4 的 4K 实拍素材中验证了 257 个连续双点键。
|
||||
|
||||
适用于 Apple Silicon Mac,要求 macOS 14.6 或更高版本。原始签名安装包可以原样转发。
|
||||
|
||||
安装包为 45,370,597 字节,SHA-256 `884342ab5ef0c42d873a6411b6c2bf0ae3cec2e07dedda90b308b057ff59f5e8`。
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"title": "大鱼调色 1.14.3 公测版|图章稳定跟踪与逐帧预览",
|
||||
"content": "<!-- wp:paragraph -->\n<p>大鱼调色是适用于 Final Cut Pro 和 Motion 的原生 FxPlug 4 调色插件。1.14.3 公测版改善仿制图章跟踪时的跳动与闪烁,并为图章和蒙版加入跟踪进度与逐帧预览。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>官方原始安装包不加密,不限制安装数量。</strong> 安装和使用无需登录、激活码或机器码。原始 PKG 可以原样转发,请保持安装包完整。禁止二次加密或加上一机一码后分发。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">1.14.3 界面展示</h2>\n<!-- /wp:heading -->\n\n<!-- wp:image {\"id\":15861,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https://dayu.media/wp-content/uploads/2026/11/1793904608-fab8ae3ea572b84.png\" alt=\"大鱼调色 1.14.3 实际界面,画布仿制图章、检视器、蜘蛛盘校色仪及示波器\" class=\"wp-image-15861\" width=\"2046\" height=\"1570\" /><figcaption class=\"wp-element-caption\">大鱼调色 1.14.3 实际界面</figcaption></figure>\n<!-- /wp:image -->\n\n<!-- wp:heading -->\n<h2 class=\"wp-block-heading\">1.14.3 跟踪更新</h2>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p><strong>仿制图章跟踪更稳。</strong> 取样区和覆盖区分别跟随画面移动与缩放。新版会平滑两边的轨迹,并在像素之间连续取样,减少画面跳动和边缘闪烁。已有图章可选中后重新执行一次“双向跟踪”。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>图章和蒙版都能查看跟踪进度。</strong> 开始跟踪后,控制面板右侧显示方向、已完成帧数和百分比。画面与轮廓同步更新,图章用青色标出取样区、黄色标出覆盖区。自动跟踪时播放头留在起始位置,跟踪结束后可以查看最后一帧。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>在画布右下角选择仿制图章,先点选取样中心,再拖出覆盖区。选中图章后可拖动青色十字更换取样位置。要跟踪已有图章或蒙版,可在控制面板左侧选中它,再选择正向、反向或双向跟踪。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>本机在 Final Cut Pro 12.4 的 4K 实拍副本上验证,仿制图章和矩形蒙版各完成了 190 帧双向跟踪。</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.13.2 安装完整性校验</h3>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph -->\n<p>主 App 注册插件前会检查官方签名和文件完整性。如果检测到掉签、重签或安装内容被修改,主 App 会停止自动更新,并尝试撤销当前副本的插件登记。Final Cut Pro 或 Motion 启动插件服务时,还会再做一次验签。</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:heading {\"level\":3} -->\n<h3 class=\"wp-block-heading\">1.12.0 统一调色工作区与共享蒙版</h3>\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、蜘蛛盘等多个Line truncated
|
||||
"excerpt": "大鱼调色 1.14.3 改善仿制图章跟踪时的跳动与闪烁。图章和蒙版都支持跟踪进度和逐帧预览。官方原始安装包不加密,不限制安装数量。",
|
||||
"status": "publish",
|
||||
"seo": {
|
||||
"title": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.14.3 公测版|图章稳定跟踪与逐帧预览"
|
||||
},
|
||||
"description": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.14.3 是适用于 Final Cut Pro 和 Motion 的原生调色插件。新版平滑仿制图章的取样与覆盖轨迹,为图章和蒙版加入跟踪进度及逐帧预览。官方 PKG 已签名公证,不加密,不限制安装数量。支持 Apple Silicon 和 macOS 14.6 或更新版本。"
|
||||
},
|
||||
"keywords": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色,Final Cut Pro,Motion,FxPlug4,调色插件,仿制图章,蒙版跟踪,逐帧预览"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# 大鱼调色 1.14.3(94)
|
||||
|
||||
仿制图章现在平滑取样点、覆盖区和两边的缩放轨迹,减少相邻帧跳动。跟踪中的复制画面随小于一个像素的移动连续变化,在相对缩放经过 1 倍或取样区域经过画面边缘时平滑过渡。
|
||||
|
||||
仿制图章与普通蒙版共用跟踪进度和同步预览。控制面板右侧显示分析方向、帧数、百分比和当前源帧。图章同时标出取样与覆盖区域,蒙版显示对应轮廓。跟踪结束后可查看最后一帧,再返回示波器。
|
||||
|
||||
已有图章可选中后重新执行双向跟踪,应用新的轨迹平滑。
|
||||
|
||||
支持 Apple Silicon 和 macOS 14.6 或更新版本。安装包已完成 Developer ID Installer 签名、公证及票据验证。
|
||||
|
||||
安装包共 45,381,192 字节。SHA-256 为 `6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4`。
|
||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.6 MiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 3.3 MiB |
@@ -0,0 +1,11 @@
|
||||
# 大鱼调色 1.14.4(95)
|
||||
|
||||
修复 1.14.3 安装包中四个资源文件的读取权限。用新版 PKG 安装后,普通用户可以读取这些资源,主 App 可完成插件注册。
|
||||
|
||||
启动时校验主 App 和 FxPlug 服务的官方签名、执行文件及版本一致性。下载更新包时继续执行完整的签名和资源检查。
|
||||
|
||||
安装前先退出 Final Cut Pro 和 Motion。运行原始 PKG,安装位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。安装完成后重新打开宿主。
|
||||
|
||||
支持 Apple Silicon 和 macOS 14.6 或更新版本。安装包已通过 Developer ID Installer 签名、公证、票据及载荷权限验证。
|
||||
|
||||
安装包大小为 45,381,319 字节,SHA-256 为 `d9184b1ee1f44723e4fe9fa87c76878884dc8a4fe5c421712650852b0b2ece59`。
|
||||
+91
-4
@@ -1,12 +1,78 @@
|
||||
# 2026-11-05 统一工作区与共享蒙版:1.12.0(74)
|
||||
# 2026-11-06 安装权限修复 1.14.4(95)
|
||||
|
||||
当前版本正在正式候选验收,不能按下方历史版本状态判断已完成交付。实际编译SHA、公证ID、正式路径和待清理恢复APP见verification/Delivery.json;宿主、PKG、Release、远程恢复分别记录本轮验证,未完成项需如实保留。
|
||||
在 `https://dayu.media/git/dayu/dayu-color.git` 的 main 检出实际编译节点 `9f5f0659774c8c05e2640db0d62fb61cb529734e`。权限修正和打包检查来自 `474bff9ea9713df28e587de712613e7748200627`。沿用 Xcode 27.1、FxPlug SDK 4.3.5、OpenCV 4.5.1、Release、Apple Silicon 和 macOS 14.6+。本版无 LFS、子模块或新增外部构建资源。签名和公证凭据独立恢复。
|
||||
|
||||
源码远程https://dayu.media/git/dayu/dayu-color.git,main;唯一正式位置`/Library/Plug-Ins/FxPlug/大鱼调色.app`。技术与构建要求沿用下文:Xcode27.1、FxPlug SDK4.3.5、Apple Silicon、Release,Team B3W25FX5H5。签名私钥/公证登录需独立恢复,Git不含密钥。
|
||||
使用 `tools/deliver.py` 从源恢复。正式路径 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 Bundle ID `com.dayu.color`,FxPlug `com.dayu.color.XPC`,签名团队 `B3W25FX5H5`。APP 公证 `59b626ba-f8b3-487f-84b6-cfca0bb66e6f` Accepted。893 项原生自检、主 App 注册和 FCP 12.4 正式路径宿主验收通过。[APP 交付](verification/Delivery.json) · [验签和权限核验](verification/Integrity1.14.4.json)
|
||||
|
||||
使用 `Packaging/build_pkg.py`,先检查正式 App 的权限,再验证最终安装包的 BOM。1.14.4 正式 PKG 为 `/Volumes/备份/大鱼调色/发行包/大鱼调色-1.14.4.pkg`,45,381,319 字节,SHA-256 `d9184b1ee1f44723e4fe9fa87c76878884dc8a4fe5c421712650852b0b2ece59`,公证 `3a7eda14-7386-45ec-88fc-5c7676eca2e8` Accepted。20 项展开验包和 134 条 App 载荷权限核对通过。正式 APP 经独立安装,安装器系统脚本未在本机重新执行。[安装包记录](verification/Package.json)
|
||||
|
||||
发行标签 `v1.14.4-install-permissions-20261106`。站内文章与主 App 自动更新通道分别保留原发布版本。
|
||||
|
||||
以下为 1.14.3 历史交付和更早记录。
|
||||
|
||||
---
|
||||
|
||||
# 2026-11-06 仿制图章稳定和逐帧预览 1.14.3(94)
|
||||
|
||||
从 `https://dayu.media/git/dayu/dayu-color.git` 的 main 检出实际编译提交 `6515e0fa67511a7c5ba2cc3320b7c5d9688c41a3`。独立远端检出 627 个跟踪文件,提交树与本地匹配,Git 完整性检查通过。沿用 Xcode 27.1、FxPlug SDK 4.3.5、锁定的 OpenCV 4.5.1、Release、Apple Silicon 和 macOS 14.6+。无 LFS 或子模块。正式位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 ID `com.dayu.color`,内嵌服务 ID `com.dayu.color.XPC`,签名团队 `B3W25FX5H5`。证书私钥和 Apple 公证凭据单独恢复。
|
||||
|
||||
使用 `tools/deliver.py` 交付,APP 公证 `2a47ad51-e07e-48df-960d-1f182635e03d` 为 Accepted,票据、Gatekeeper、唯一 PluginKit 路径和 893 项原生检查通过。FCP 12.4 实拍图章与矩形蒙版各完成 190 帧双向跟踪,画面与轮廓逐帧同步。[交付记录](verification/Delivery.json) · [宿主验收](verification/HostTrackingPreview1.14.3.json)
|
||||
|
||||
使用 `Packaging/build_pkg.py` 生成 `/Volumes/备份/大鱼调色/发行包/大鱼调色-1.14.3.pkg`。Developer ID Installer 签名、公证 `7b430f78-cb9c-42d2-95aa-ea5fbe440ea5` Accepted、票据、Gatekeeper 及 20 项展开核验通过。包大小 45,381,192 字节,SHA-256 `6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4`。[验包记录](verification/Package.json)
|
||||
|
||||
发行标签 `v1.14.3-tracking-preview-20261106` 指向 `8b96e8b8c1b0c9356ae9871a2bc042a83e7e97d6`。独立检出标签验证 629 个跟踪文件、Git 完整性与包记录。公测 Release 395 的附件 39 已发布,草稿和正式附件均完整下载核验。正式安装通过后已清理 91 至 93 版生成副本、构建 APP、公证 ZIP、远端恢复副本及草稿下载副本。[发行页](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.14.3-tracking-preview-20261106) · [下载安装包](https://dayu.media/git/dayu/dayu-color/releases/download/v1.14.3-tracking-preview-20261106/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.14.3.pkg) · [发布核验](verification/Release.json)
|
||||
|
||||
# 2026-11-06 仿制图章双点跟踪 1.14.0(90)
|
||||
|
||||
从 `https://dayu.media/git/dayu/dayu-color.git` 的 main 检出实际编译提交 `810bbf4dfb0a05bc2fa66da546ca75b9610985a3`。独立远端检出 624 个跟踪文件,与编译提交树一致,Git 完整性检查通过。构建沿用 Xcode 27.1、FxPlug SDK 4.3.5、OpenCV 4.5.1 锁定依赖、Release、Apple Silicon 和 macOS 14.6+。无 LFS 或子模块。正式路径为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 ID `com.dayu.color`,服务 ID `com.dayu.color.XPC`,签名团队 `B3W25FX5H5`。证书私钥和 Apple 公证凭据单独恢复。
|
||||
|
||||
使用 `tools/deliver.py` 构建、签名、公证和安装。APP 公证号 `1e7a48fe-dd0a-4643-b587-66eaa05ed46a` 为 Accepted。正式安装通过 881 项原生检查、票据和 Gatekeeper,PluginKit 只登记正式位置。FCP 12.4 实拍双向跟踪确认两个位置与横纵缩放随帧独立变化,257 个键按 25fps 连续保存。旧版可读数据、跟丢和片尾偏移的测试见 [宿主核验](verification/HostCloneTracking1.14.0.json)。
|
||||
|
||||
用 `Packaging/build_pkg.py` 从已验收的正式 APP 生成 `../发行包/大鱼调色-1.14.0.pkg`。Developer ID Installer 签名、Apple 公证 `bea7b45f-7d68-4b6d-9173-93ee5ad8b162` Accepted、票据与 20 项展开验包通过。大小 45,370,597 字节,SHA-256 `884342ab5ef0c42d873a6411b6c2bf0ae3cec2e07dedda90b308b057ff59f5e8`。[安装包报告](verification/Package.json)
|
||||
|
||||
版本标签 `v1.14.0-clone-tracking-20261106` 指向 `c86925d967d5d13a5ea1ffba31a8221608bc8345`。独立检出标签验证 626 个文件、正式包报告和 Git 完整性。公测 Release 394/附件 38 已发布,草稿和发布后附件分别完整下载,字节数及 SHA-256 一致。旧 APP、构建 APP、公证 ZIP、远端恢复副本和草稿下载副本已清理。[发布页](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.14.0-clone-tracking-20261106) · [下载](https://dayu.media/git/dayu/dayu-color/releases/download/v1.14.0-clone-tracking-20261106/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.14.0.pkg) · [发布核验](verification/Release.json)站点文章 15792 对应 1.13.2,主 APP 公测清单对应 1.12.0。
|
||||
|
||||
# 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)
|
||||
|
||||
公测 Release 393 的附件 37 已发布。发布前草稿和发布后附件分别完整下载,字节数和 SHA-256 均与正式 PKG 匹配。标签完整提交为 `5252296b7b628c8df7e68dfb48df0db38cd12a75`,独立远端检出通过 621 个文件、安装包记录和 Git 完整性核对。临时下载、恢复副本和 APP 生成副本已清理。[发布核验](verification/Release.json)
|
||||
|
||||
[站点原文章 15792](https://dayu.media/15792/) 已更新至 1.13.2。正文、SEO、原封面、普通用户 50 元和有效会员免费均已核对,主下载包完整下载与正式 PKG 一致。文章发布输入为 `Publishing/1.13.2/Article-Payload.json`,后台原始回读仅保存在本机缓存。主 APP 公测更新清单回读仍为 1.12.0(79)。[文章核验](verification/Article1.13.2.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重建。窗口和实际交互边界、代码入口、跟踪证据/缺口见自定控件开发交接.md和research/UnifiedWorkspace-20261105.md。恢复后仍按Release签名、公证、票据、唯一正式安装、真实宿主验收和Release附件完整下载交付。
|
||||
共享工具文档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)。
|
||||
|
||||
以下为历史恢复记录,以本节及当前验证报告为准。
|
||||
|
||||
@@ -109,6 +175,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/`,不依赖兄弟应用或其工作副本。
|
||||
|
||||
@@ -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)
|
||||
+5
-1
@@ -55,8 +55,12 @@ def main():
|
||||
print('Building final Release',flush=True)
|
||||
run('xcodebuild','-project','大鱼调色.xcodeproj','-scheme','Wrapper Application','-configuration','Release','-enableAddressSanitizer','NO','-derivedDataPath',str(CACHE/'DerivedData'),'clean','build',log=CACHE/'release-build.log')
|
||||
b=APP/'Contents/Resources/FCP Templates/大鱼调色.moef';b.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(ROOT/'template/大鱼调色.moef',b)
|
||||
b.chmod(0o644)
|
||||
for name in ['large.png','small.png']:
|
||||
if (ROOT/'template'/name).exists():shutil.copy2(ROOT/'template'/name,b.parent/name)
|
||||
if (ROOT/'template'/name).exists():
|
||||
target=b.parent/name;shutil.copy2(ROOT/'template'/name,target);target.chmod(0o644)
|
||||
# Sources on exFAT can be exposed as owner-only. Installer changes ownership to root.
|
||||
(APP/'Contents/Resources/Basis_balanceWheel.png').chmod(0o644)
|
||||
identity(APP,'com.dayu.color');plugin=APP/PLUGIN;identity(plugin,'com.dayu.color.XPC')
|
||||
# Xcode registers its build product with Launch Services. Keep the host from
|
||||
# discovering this generated copy while signing/notarization are pending.
|
||||
|
||||
+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]];
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"passResult": true,
|
||||
"articleID": 15792,
|
||||
"url": "https://dayu.media/15792/",
|
||||
"status": "publish",
|
||||
"title": "大鱼调色 1.13.2 公测版|安装完整性校验与仿制图章",
|
||||
"requestID": "dayu-color-1132-build86-article-20261105",
|
||||
"changedResourceFields": [
|
||||
"cao_downurl",
|
||||
"cao_original_filename"
|
||||
],
|
||||
"commercialAndVideoFieldsPreserved": true,
|
||||
"authorCategoriesTagsPreserved": true,
|
||||
"fcpxSettingsPreserved": true,
|
||||
"seo": {
|
||||
"title": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.13.2 公测版|安装完整性校验与仿制图章"
|
||||
},
|
||||
"description": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.13.2 是适用于 Final Cut Pro 与 Motion 的原生调色插件。新版增加安装完整性校验,并包含按原像素复制的仿制图章。官方原始安装包已签名公证,可以原样转发。适用于 Apple Silicon 和 macOS 14.6 或更新版本。"
|
||||
},
|
||||
"keywords": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色,Final Cut Pro,Motion,FxPlug4,调色插件,仿制图章,安装完整性校验"
|
||||
}
|
||||
},
|
||||
"frontendChecks": [
|
||||
{
|
||||
"url": "https://dayu.media/15792/",
|
||||
"http": 200,
|
||||
"titleAndSEOExact": true,
|
||||
"updateAndRecoveryNotes": true,
|
||||
"codeBlock": true,
|
||||
"historicalImagesRetained": true,
|
||||
"coverRetained": true,
|
||||
"priceYuan": 50,
|
||||
"memberPriceYuan": 0,
|
||||
"paidPackageURLAbsentFromHTML": true
|
||||
},
|
||||
{
|
||||
"url": "https://dayu.media/15792/?release-check=1.13.2-86",
|
||||
"http": 200,
|
||||
"titleAndSEOExact": true,
|
||||
"updateAndRecoveryNotes": true,
|
||||
"codeBlock": true,
|
||||
"historicalImagesRetained": true,
|
||||
"coverRetained": true,
|
||||
"priceYuan": 50,
|
||||
"memberPriceYuan": 0,
|
||||
"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"
|
||||
},
|
||||
"historicalBodyImageIDs": [
|
||||
15856,
|
||||
15840,
|
||||
15841
|
||||
],
|
||||
"package": {
|
||||
"version": "1.13.2",
|
||||
"build": 86,
|
||||
"downloadVerified": true,
|
||||
"http": 200,
|
||||
"bytes": 45359239,
|
||||
"sha256": "6c18bc081cd9d5099ae821df5d5da43585f9db292345c18db4a4e12cce1f133f",
|
||||
"appPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"effect": "效果 / 大鱼调色 / 大鱼调色"
|
||||
},
|
||||
"updateChannel": {
|
||||
"version": "1.12.0",
|
||||
"build": 79
|
||||
},
|
||||
"rawPrivateResponses": "Local build cache only",
|
||||
"purchaseFlow": "Anonymous purchase prompt checked; no transaction performed."
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"passResult": true,
|
||||
"articleID": 15792,
|
||||
"url": "https://dayu.media/15792/",
|
||||
"status": "publish",
|
||||
"title": "大鱼调色 1.14.3 公测版|图章稳定跟踪与逐帧预览",
|
||||
"requests": [
|
||||
{
|
||||
"id": "dayu-color-1143-build94-article-20261106",
|
||||
"payload": "Publishing/1.14.3/Article-Payload.json",
|
||||
"payloadSHA256": "11a549db1cf1d6c68b1b8a35df60d745a01a7ee9afe255f2fe922d0698ea7be8",
|
||||
"uploaded": [
|
||||
"package",
|
||||
"cover"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "dayu-color-1143-build94-package-name-20261106",
|
||||
"payload": {
|
||||
"resource": {
|
||||
"cao_original_filename": "大鱼调色-1.14.3.pkg"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"changedResourceFields": [
|
||||
"cao_downurl",
|
||||
"cao_original_filename"
|
||||
],
|
||||
"commercialAndVideoFieldsPreserved": true,
|
||||
"authorCategoriesTagsPreserved": true,
|
||||
"fcpxSettingsPreserved": true,
|
||||
"seo": {
|
||||
"title": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.14.3 公测版|图章稳定跟踪与逐帧预览"
|
||||
},
|
||||
"description": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色 1.14.3 是适用于 Final Cut Pro 和 Motion 的原生调色插件。新版平滑仿制图章的取样与覆盖轨迹,为图章和蒙版加入跟踪进度及逐帧预览。官方 PKG 已签名公证,不加密,不限制安装数量。支持 Apple Silicon 和 macOS 14.6 或更新版本。"
|
||||
},
|
||||
"keywords": {
|
||||
"enabled": true,
|
||||
"value": "大鱼调色,Final Cut Pro,Motion,FxPlug4,调色插件,仿制图章,蒙版跟踪,逐帧预览"
|
||||
}
|
||||
},
|
||||
"frontendChecks": [
|
||||
{
|
||||
"url": "https://dayu.media/15792/",
|
||||
"http": 200,
|
||||
"titleAndSEOExact": true,
|
||||
"originalInterfaceAndHistoricalImagesVisible": true,
|
||||
"coverOpenGraph": true,
|
||||
"priceYuan": 50,
|
||||
"memberPriceYuan": 0,
|
||||
"paidPackageURLAbsentFromHTML": true
|
||||
},
|
||||
{
|
||||
"url": "https://dayu.media/15792/?release-check=1.14.3-94-final",
|
||||
"http": 200,
|
||||
"titleAndSEOExact": true,
|
||||
"originalInterfaceAndHistoricalImagesVisible": true,
|
||||
"coverOpenGraph": true,
|
||||
"priceYuan": 50,
|
||||
"memberPriceYuan": 0,
|
||||
"paidPackageURLAbsentFromHTML": true
|
||||
}
|
||||
],
|
||||
"interface": {
|
||||
"id": 15861,
|
||||
"url": "https://dayu.media/wp-content/uploads/2026/11/1793904608-fab8ae3ea572b84.png",
|
||||
"width": 2046,
|
||||
"height": 1570,
|
||||
"source": "Publishing/1.14.3/dayu-color-1.14.3-interface.png",
|
||||
"http": 200,
|
||||
"bytes": 3462187,
|
||||
"sha256": "c902a7f72b72037b53634087e393b650d7fe255ec27acc903932850589aabbfe"
|
||||
},
|
||||
"featuredMedia": {
|
||||
"id": 15863,
|
||||
"url": "https://dayu.media/wp-content/uploads/2026/11/1793904689-28c17d54e116509.png",
|
||||
"width": 1672,
|
||||
"height": 941,
|
||||
"source": "Publishing/1.14.3/dayu-color-1.14.3-cover.png",
|
||||
"text": "不加密 · 不限制安装数量",
|
||||
"http": 200,
|
||||
"bytes": 1712867,
|
||||
"sha256": "544edae274817eb0648a774696dc5ba9a0c7f7028fbdcf485e54354855c44023"
|
||||
},
|
||||
"historicalBodyImageIDs": [
|
||||
15840,
|
||||
15841,
|
||||
15856
|
||||
],
|
||||
"package": {
|
||||
"id": 15862,
|
||||
"version": "1.14.3",
|
||||
"build": 94,
|
||||
"downloadName": "大鱼调色-1.14.3.pkg",
|
||||
"downloadVerified": true,
|
||||
"appPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"effect": "效果 / 大鱼调色 / 大鱼调色",
|
||||
"http": 200,
|
||||
"bytes": 45381192,
|
||||
"sha256": "6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4"
|
||||
},
|
||||
"purchaseFlow": "Anonymous storefront price checked; no purchase performed.",
|
||||
"rawPrivateResponses": "Local build cache only"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"status": "published-download-verified",
|
||||
"releaseID": 388,
|
||||
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.11.0-canvas-spatial-20261105",
|
||||
"tag": "v1.11.0-canvas-spatial-20261105",
|
||||
"commit": "5f8fb13fceb0c4d4ead447b8b5694ce269e95749",
|
||||
"assetID": 32,
|
||||
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.11.0-canvas-spatial-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.11.0.pkg",
|
||||
"bytes": 43128845,
|
||||
"sha256": "2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e",
|
||||
"releaseVerification": "verification/Release.json"
|
||||
"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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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."
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,15 @@
|
||||
"status": "verified",
|
||||
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"bundleID": "com.dayu.color",
|
||||
"version": "1.12.0",
|
||||
"build": "79",
|
||||
"version": "1.14.4",
|
||||
"build": "95",
|
||||
"team": "B3W25FX5H5",
|
||||
"notaryID": "f66d9934-b015-49d1-bada-717d7399e673",
|
||||
"notaryID": "59b626ba-f8b3-487f-84b6-cfca0bb66e6f",
|
||||
"notaryStatus": "Accepted",
|
||||
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
|
||||
"sourceCommit": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
|
||||
"sourceCommit": "9f5f0659774c8c05e2640db0d62fb61cb529734e",
|
||||
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
|
||||
"templateSHA256": "eaf60224f8d970f8841a03fe0325adc4af73d1c017375b020bcc0e256f0cd803",
|
||||
"shaderSHA256": "7d05797e5e68ec8c23886c74d37a32826843c541e13a3f35424c1903e28bff56",
|
||||
"hostVerification": "verification/HostFeedback79.json"
|
||||
"shaderSHA256": "dfb36a120cd4d3ba09c960ac5d5905f61b5dc6d2d5024444b49aebd3d3fd43f1",
|
||||
"hostVerification": "verification/Integrity1.14.4.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"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"status": "passed",
|
||||
"version": "1.13.4",
|
||||
"build": "88",
|
||||
"compiledSource": "7bf1f88fe9c2e9ea79a86791fcc0738550512973",
|
||||
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"host": "Final Cut Pro 12.4",
|
||||
"hostPID": 43656,
|
||||
"servicePID": 43675,
|
||||
"nativeChecks": 870,
|
||||
"sourceRecovery": {
|
||||
"trackedFiles": 623,
|
||||
"exactRemoteTree": true,
|
||||
"strictFsck": true
|
||||
},
|
||||
"priorObserved": {
|
||||
"build86": "User drag preview disappeared. Live OSC logs received the source and drag.",
|
||||
"build87": "Real-footage creation accepted. The target and copied pixels remained visible; subsequent canvas edits did not commit with differing event and action times.",
|
||||
"build87PublicPackage": false
|
||||
},
|
||||
"live": {
|
||||
"qaMaterial": "Same real footage in the existing local QA project",
|
||||
"coldReadback": "Recovered the previously created stamp after restarting Final Cut Pro.",
|
||||
"savedTargetCenterBefore": [
|
||||
0.7994009256362915,
|
||||
0.601437509059906
|
||||
],
|
||||
"dragCommitTimes": [
|
||||
{
|
||||
"eventSeconds": "9.240000000",
|
||||
"actionSeconds": "9.272333333"
|
||||
},
|
||||
{
|
||||
"eventSeconds": "9.240000000",
|
||||
"actionSeconds": "9.272333333"
|
||||
},
|
||||
{
|
||||
"eventSeconds": "9.240000000",
|
||||
"actionSeconds": "9.272333333"
|
||||
}
|
||||
],
|
||||
"successfulHostCommits": 3,
|
||||
"observation": "Target outline and effect stayed at a changed position after real mouse release. Source and destination were both visible.",
|
||||
"scope": "Production installed version with direct mouse operations on the same real footage. No separate Motion host run.",
|
||||
"userConfirmed": "The target can now be moved freely. User requested independent source and target tracking with scale detection."
|
||||
},
|
||||
"regression": [
|
||||
"native-osc-stamp-preview-survives-async-save-and-different-render-time",
|
||||
"native-osc-stamp-selects-saved-overlay-when-action-time-differs",
|
||||
"native-osc-drag-moves-only-the-stamp-source-and-keeps-tracking-keys",
|
||||
"native-osc-stamp-resizes-coverage-without-rotation-handle-or-track-changes",
|
||||
"native-osc-stamp-target-move-saves-the-canvas-key-with-a-different-action-time",
|
||||
"native-osc-stamp-forward-action-starts-the-existing-host-tracker",
|
||||
"native-osc-stamp-rejected-write-keeps-the-draft-and-existing-document",
|
||||
"native-osc-stamp-retries-with-the-same-source-and-saves-once",
|
||||
"native-osc-untracked-stamp-target-saves-in-place-with-a-different-action-time"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"status": "passed",
|
||||
"version": "1.14.0",
|
||||
"build": "90",
|
||||
"compiledSource": "810bbf4dfb0a05bc2fa66da546ca75b9610985a3",
|
||||
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"host": "Final Cut Pro 12.4",
|
||||
"hostPID": 46124,
|
||||
"servicePID": 46136,
|
||||
"nativeChecks": 881,
|
||||
"sourceRecovery": {
|
||||
"trackedFiles": 624,
|
||||
"exactRemoteTree": true,
|
||||
"strictFsck": true
|
||||
},
|
||||
"live": {
|
||||
"project": "Existing local QA copy, same real footage",
|
||||
"analysisSourceSize": [
|
||||
3840,
|
||||
2160
|
||||
],
|
||||
"referenceTime": 4.626,
|
||||
"interim": {
|
||||
"build": "89",
|
||||
"forwardPairedAfterColdReopen": 142,
|
||||
"bidirectionalPaired": 257,
|
||||
"legacyAutomaticTailTime": 10.272333333333334,
|
||||
"offsetAfterLastPairedFrame": 0.006333333333333333
|
||||
},
|
||||
"bidirectionalStatus": "双向跟踪完成 · 257 个轨迹键",
|
||||
"pairedKeys": 257,
|
||||
"legacyKeys": 0,
|
||||
"consecutiveFrameStep": "1/25",
|
||||
"first": {
|
||||
"time": 0.026,
|
||||
"targetCenter": [
|
||||
0.6588301062583923,
|
||||
0.2833344340324402
|
||||
],
|
||||
"sourceCenter": [
|
||||
0.6876533504527494,
|
||||
0.5160227972213454
|
||||
],
|
||||
"sourceScale": [
|
||||
0.5156978964805603,
|
||||
0.6987575888633728
|
||||
],
|
||||
"targetScale": [
|
||||
0.819161593914032,
|
||||
0.8457567691802979
|
||||
]
|
||||
},
|
||||
"reference": {
|
||||
"time": 4.626,
|
||||
"targetCenter": [
|
||||
0.6999750733375549,
|
||||
0.32428178191185
|
||||
],
|
||||
"sourceCenter": [
|
||||
0.7436891075175688,
|
||||
0.6246055322829909
|
||||
],
|
||||
"sourceScale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"targetScale": [
|
||||
1.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"last": {
|
||||
"time": 10.266,
|
||||
"targetCenter": [
|
||||
0.7663808465003967,
|
||||
0.341084748506546
|
||||
],
|
||||
"sourceCenter": [
|
||||
0.8345088835757658,
|
||||
0.7266275840942091
|
||||
],
|
||||
"sourceScale": [
|
||||
1.3865485191345215,
|
||||
1.6888312101364136
|
||||
],
|
||||
"targetScale": [
|
||||
1.1685776710510254,
|
||||
1.2025887966156006
|
||||
]
|
||||
}
|
||||
},
|
||||
"native": [
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"keys": 6,
|
||||
"name": "host-clone-stamp-follows-two-independent-centers-and-scales",
|
||||
"pass": true,
|
||||
"source": [
|
||||
0.2265399992465973,
|
||||
0.5261463522911072,
|
||||
0.32,
|
||||
0.54
|
||||
],
|
||||
"sourceScale": [
|
||||
0.8747966289520264,
|
||||
0.8752831220626831
|
||||
],
|
||||
"target": [
|
||||
0.7812566161155701,
|
||||
0.48039546608924866
|
||||
],
|
||||
"targetScale": [
|
||||
1.1745620965957642,
|
||||
1.1744060516357422
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "host-clone-stamp-restarts-from-current-paired-scale",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "host-clone-stamp-source-loss-stops-both-tracks-at-last-paired-frame",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-relative-scale-remaps-source-and-expands-target-coverage",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-fractional-zoom-interpolates-adjacent-source-pixels",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-equal-zoom-preserves-pixel-exact-copy",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-replaces-same-frame-automatic-keys-from-offset-host-clock",
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"scope": "Real FCP bidirectional analysis and saved preset readback, plus installed native callback and Metal pixel checks. Cold reopen persistence checked on build 89; build 90 reran the same authored stamp and verified the corrected boundary. No separate Motion host run."
|
||||
}
|
||||
@@ -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,99 @@
|
||||
{
|
||||
"version": "1.14.3",
|
||||
"build": "94",
|
||||
"compiledSource": "6515e0fa67511a7c5ba2cc3320b7c5d9688c41a3",
|
||||
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"host": "Final Cut Pro 12.4",
|
||||
"sourceRecovery": {
|
||||
"trackedFiles": 627,
|
||||
"exactRemoteTree": true,
|
||||
"strictFsck": true
|
||||
},
|
||||
"offlineReplay": {
|
||||
"reference": "verification/HostCloneTracking1.14.0.json",
|
||||
"frames": 257,
|
||||
"sourceSize": [
|
||||
3840,
|
||||
2160
|
||||
],
|
||||
"metric": "RMS second frame difference of the two coordinate axes, or of the two log relative zoom values",
|
||||
"targetCenterPixels": {
|
||||
"before": 2.4323,
|
||||
"after": 0.9187
|
||||
},
|
||||
"sourceCenterPixels": {
|
||||
"before": 2.7051,
|
||||
"after": 0.9482
|
||||
},
|
||||
"relativeZoomLogPercent": {
|
||||
"before": 0.6032,
|
||||
"after": 0.1976
|
||||
}
|
||||
},
|
||||
"liveBuild93": {
|
||||
"source": "Independent FCP project copy, 4K real footage, trimmed 25 fps timeline",
|
||||
"playheadBefore": "00:00:04:15",
|
||||
"playheadAfter": "00:00:04:15",
|
||||
"stamp": {
|
||||
"observedCompletedFrames": [
|
||||
1,
|
||||
76,
|
||||
136,
|
||||
190
|
||||
],
|
||||
"total": 190,
|
||||
"pairedKeys": 190,
|
||||
"outlinedRegions": [
|
||||
"source",
|
||||
"target"
|
||||
]
|
||||
},
|
||||
"rectangle": {
|
||||
"observedCompletedFrames": [
|
||||
4,
|
||||
92,
|
||||
190
|
||||
],
|
||||
"total": 190,
|
||||
"keys": 190,
|
||||
"outlinedRegions": [
|
||||
"mask"
|
||||
]
|
||||
},
|
||||
"savedPresetReadback": {
|
||||
"firstSourceTime": "68/25",
|
||||
"lastSourceTime": "257/25",
|
||||
"frameStep": "1/25",
|
||||
"continuous": true
|
||||
},
|
||||
"previewClippedToImageArea": true,
|
||||
"switchingMasksRestoredScopes": true,
|
||||
"remainingAtBuild93": "Native animated progress bar visibly lagged its frame count during analysis."
|
||||
},
|
||||
"status": "passed",
|
||||
"nativeChecks": 893,
|
||||
"hostPID": 50718,
|
||||
"servicePID": 50748,
|
||||
"liveBuild94": {
|
||||
"stamp": {
|
||||
"completed": 190,
|
||||
"total": 190,
|
||||
"finalSourceTime": 2.72,
|
||||
"visualSourceAndTarget": true
|
||||
},
|
||||
"rectangle": {
|
||||
"completed": 190,
|
||||
"total": 190,
|
||||
"sampleProgress": {
|
||||
"completed": 96,
|
||||
"sourceTime": 8.4,
|
||||
"percent": 51
|
||||
},
|
||||
"visualFillMatchesCount": true
|
||||
},
|
||||
"finalPreviewRetained": true,
|
||||
"coldReopenShowsBothObjects": true,
|
||||
"pluginKitPathVerified": true
|
||||
},
|
||||
"scope": "Final Cut Pro 12.4 on this Mac. Native checks include cancellation, forward/reverse single-step seeking, paired frame geometry, and the production Metal rendering path."
|
||||
}
|
||||
+298
-19
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
|
||||
"checks": 834,
|
||||
"checks": 893,
|
||||
"gpu": "Apple M4",
|
||||
"limitations": [
|
||||
"Finite states and a 64x48 frame; live FCP discovery, inspector interaction, timeline persistence and real host export require separate acceptance.",
|
||||
@@ -12,7 +12,7 @@
|
||||
"error": "未提供错误信息",
|
||||
"name": "runtime-directory",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62"
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA"
|
||||
},
|
||||
{
|
||||
"descriptors": 285,
|
||||
@@ -898,7 +898,7 @@
|
||||
"error": "未提供错误信息",
|
||||
"name": "renderer-export-33cube",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62/diagnostic-export.cube"
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA/diagnostic-export.cube"
|
||||
},
|
||||
{
|
||||
"bytes": 1186074,
|
||||
@@ -917,8 +917,8 @@
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"heartbeats": 0,
|
||||
"maximumGapMS": 62.29583334061317,
|
||||
"heartbeats": 1,
|
||||
"maximumGapMS": 76.31383335683495,
|
||||
"name": "external-activation-main-loop-responsive",
|
||||
"pass": true
|
||||
},
|
||||
@@ -1389,7 +1389,7 @@
|
||||
"closePixels": 128,
|
||||
"name": "workspace-offscreen-compact-icons-and-close-render-pixels",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62/workspace-topbar.png",
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA/workspace-topbar.png",
|
||||
"toolbarPixels": 3557
|
||||
},
|
||||
{
|
||||
@@ -1410,6 +1410,14 @@
|
||||
"pass": true,
|
||||
"toolbarPixels": 3557
|
||||
},
|
||||
{
|
||||
"name": "workspace-tracking-preview-replaces-scopes-with-readable-progress-and-image",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "workspace-preview-stop-routes-to-analysis-and-dismiss-restores-scopes",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "workspace-reopens-existing-host-remote-window",
|
||||
"pass": true
|
||||
@@ -1452,7 +1460,7 @@
|
||||
},
|
||||
{
|
||||
"name": "workspace-independent-style-fixture-inserted",
|
||||
"node": "DEDA868A-8DF1-478E-9C3D-B9F3BCEC7754",
|
||||
"node": "BFD04FE1-C236-492A-8405-DB48522E5E62",
|
||||
"pass": true,
|
||||
"validDocument": true
|
||||
},
|
||||
@@ -1461,10 +1469,10 @@
|
||||
"error": "none",
|
||||
"name": "workspace-independent-style1-writes-target-node-inside-undo",
|
||||
"nodePaths": {
|
||||
"look0": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62/node.cube"
|
||||
"look0": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA/node.cube"
|
||||
},
|
||||
"pass": true,
|
||||
"rootStyle1": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62/user-new.cube",
|
||||
"rootStyle1": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA/user-new.cube",
|
||||
"undoStartsAfter": 3,
|
||||
"undoStartsBefore": 2,
|
||||
"written": true
|
||||
@@ -2648,6 +2656,10 @@
|
||||
"name": "host-callback-opencv-tracking-six-exact-frames",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "mask-analysis-emits-matching-frame-geometry-and-completed-progress",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "tracking-results-use-one-undo-action",
|
||||
"pass": true
|
||||
@@ -2676,6 +2688,10 @@
|
||||
"name": "bidirectional-passes-share-reference-and-merge-once",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "bidirectional-progress-counts-reference-once-and-never-regresses",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "backward-single-step-includes-reference-and-one-neighbor",
|
||||
"pass": true
|
||||
@@ -2742,12 +2758,48 @@
|
||||
"name": "shared-mask-inspector-alias-activates-canvas-and-receives-canonical-status",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-analysis-preview-displays-both-regions-on-the-same-frame",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"keys": 6,
|
||||
"name": "host-clone-stamp-follows-two-independent-centers-and-scales",
|
||||
"pass": true,
|
||||
"source": [
|
||||
0.2265399992465973,
|
||||
0.5261463522911072,
|
||||
0.32,
|
||||
0.54
|
||||
],
|
||||
"sourceScale": [
|
||||
0.8747966289520264,
|
||||
0.8752831220626831
|
||||
],
|
||||
"target": [
|
||||
0.7812566161155701,
|
||||
0.48039546608924866
|
||||
],
|
||||
"targetScale": [
|
||||
1.1745620965957642,
|
||||
1.1744060516357422
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "host-clone-stamp-restarts-from-current-paired-scale",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "host-clone-stamp-source-loss-stops-both-tracks-at-last-paired-frame",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "canvas-cold-load-selects-saved-mask-from-immutable-snapshot",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"coveredPixels": 13216,
|
||||
"coveredPixels": 15135,
|
||||
"name": "native-osc-real-metal-overlay-transparent-around-controls",
|
||||
"pass": true
|
||||
},
|
||||
@@ -2781,6 +2833,14 @@
|
||||
"name": "native-osc-keeps-only-two-pen-actions-bounded-at-bottom",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "canvas-white-balance-cannot-write-after-the-playhead-moves",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "canvas-white-balance-uses-existing-solver-and-one-undo",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-new-shape-can-start-anywhere-and-hides-default-box",
|
||||
"pass": true
|
||||
@@ -2813,6 +2873,68 @@
|
||||
"name": "native-osc-ellipse-draws-reverse-direction-with-positive-shared-extents",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "canvas-curve-histogram-updates-from-final-output-at-the-same-playhead",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-renders-the-cropped-toolbar-on-a-transparent-texture",
|
||||
"opaquePixels": 11311,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-stamp-preview-survives-async-save-and-different-render-time",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-creates-one-stamp-and-one-undo-from-source-click-and-drag",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-stamp-selects-saved-overlay-when-action-time-differs",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"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": "native-osc-stamp-target-move-saves-the-canvas-key-with-a-different-action-time",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-stamp-forward-action-starts-the-existing-host-tracker",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-stamp-rejected-write-keeps-the-draft-and-existing-document",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-stamp-retries-with-the-same-source-and-saves-once",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "native-osc-untracked-stamp-target-saves-in-place-with-a-different-action-time",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "inspector-add-pen-enters-empty-drawing-mode",
|
||||
"pass": true
|
||||
@@ -3746,6 +3868,14 @@
|
||||
"name": "compact-color-settings-button-expands-panel",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "inspector-preferred-height-follows-content-with-a-scroll-cap",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "inspector-hosted-slot-keeps-header-visible-and-scrolls-only-overflow",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "compact-color-settings-repeated-toggle-does-not-edit-grade",
|
||||
"pass": true
|
||||
@@ -3838,7 +3968,7 @@
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "histogram-new-inspector-uses-renderer-cached-snapshot",
|
||||
"name": "histogram-open-inspector-uses-cached-effect-output",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
@@ -3850,7 +3980,11 @@
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "histogram-invalidation-clears-view-and-renderer",
|
||||
"name": "histogram-keeps-final-output-while-a-new-render-is-pending",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "histogram-open-inspector-refreshes-after-a-new-output-at-the-same-time",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
@@ -3994,7 +4128,18 @@
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-lower-left-rail-has-only-four-image-tools-and-three-persistent-mask-shapes",
|
||||
"name": "viewer-lower-right-rail-has-six-image-tools-and-three-persistent-mask-shapes",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-stamp-arms-and-disarms-without-changing-the-grade",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"canvasPixelFraction": 0.016155478395061727,
|
||||
"name": "viewer-idle-4k-toolbar-rasterizes-under-five-percent-of-the-canvas",
|
||||
"overlayHeight": 134,
|
||||
"overlayWidth": 1000,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
@@ -4013,6 +4158,14 @@
|
||||
"name": "viewer-persistent-mask-entries-route-shapes-to-shared-workspace",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-white-balance-icon-routes-a-single-time-bound-pick",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-distortion-entry-uses-pincushion-grid",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-skin-entry-toggles-actual-protection-preview-without-parameter-card",
|
||||
"pass": true
|
||||
@@ -4025,10 +4178,22 @@
|
||||
"name": "viewer-curve-is-graph-only-without-title-catalog-or-parameter-page",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-curve-opens-above-the-lower-right-controls",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-curve-grip-moves-both-axes-without-a-grade-or-undo",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-curve-point-is-live-xy-not-a-scalar-only-control",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-curve-release-never-exposes-the-stale-plot-before-or-after-write",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "viewer-curve-final-release-commits-both-axes-with-one-undo",
|
||||
"pass": true
|
||||
@@ -4096,7 +4261,7 @@
|
||||
{
|
||||
"name": "viewer-real-osc-draws-minimal-curve-on-clear-canvas",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62/viewer-workspace.png"
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA/viewer-workspace.png"
|
||||
},
|
||||
{
|
||||
"name": "canvas-hsl-plot-captures-outside-and-commits-one-undo",
|
||||
@@ -4118,10 +4283,6 @@
|
||||
"name": "canvas-spider-external-topology-change-wins",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "canvas-histogram-is-frozen-to-matching-frame",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "lens-neutral-production-render",
|
||||
@@ -4235,8 +4396,126 @@
|
||||
{
|
||||
"name": "face-no-detection-clears-prior-frame-and-fails-closed",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "clone-stamp-reference-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-preserves-source-through-tracking-merge",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-production-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-copies-pixels-and-leaves-exterior-intact",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-tracked-production-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-tracked-target-moves-while-sampling-the-same-source",
|
||||
"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
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-interpolates-both-centers-and-coverage-scale",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-paired-scale-production-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-relative-scale-remaps-source-and-expands-target-coverage",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-fractional-zoom-interpolates-adjacent-source-pixels",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-equal-scale-production-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-equal-zoom-preserves-pixel-exact-copy",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-fractional-translation-at-unit-zoom",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-fractional-translation-near-unit-zoom",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-fractional-translation-is-continuous-through-unit-zoom",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-fractional-source-crossing-image-edge",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-source-fades-continuously-at-image-edge",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-retracking-updates-paired-data-without-overwriting-manual-target",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-replaces-same-frame-automatic-keys-from-offset-host-clock",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-smooths-both-positions-and-log-scales-and-keeps-analysis-endpoints",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-smoothing-is-independent-of-analysis-direction",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "clone-stamp-disabled-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-disabled-is-identical",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clone-stamp-spatial-state-refuses-static-cube-export",
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/C5C4EE81-DAE8-446A-9235-F9655D0EDC62",
|
||||
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/703677DD-803E-4B63-B24C-934AFF6E41BA",
|
||||
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"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",
|
||||
"independentReleaseTagCheckout": "621 files, clean checkout, exact Git tree, strict fsck and installer record passed",
|
||||
"scope": "Verified independently retrieved build inputs. No second full build."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"status": "passed",
|
||||
"version": "1.14.4",
|
||||
"build": "95",
|
||||
"compiledSource": "9f5f0659774c8c05e2640db0d62fb61cb529734e",
|
||||
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"macOS": "27.0.1",
|
||||
"mainApp": {
|
||||
"registered": true,
|
||||
"integrity": "verified",
|
||||
"pid": 55667,
|
||||
"executable": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/MacOS/大鱼调色"
|
||||
},
|
||||
"host": {
|
||||
"version": "12.4",
|
||||
"hostPID": 55699,
|
||||
"servicePID": 55724,
|
||||
"serviceExecutable": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service",
|
||||
"qaProject": "1.12.0_76_OpenCV真实帧跟踪 2",
|
||||
"observed": "Existing enabled effect, native inspector, separate control panel and playback of the QA project.",
|
||||
"playbackFrom": "00:00:03:07",
|
||||
"playbackTo": "00:00:10:15"
|
||||
},
|
||||
"nativeChecks": 893,
|
||||
"scopeComparison": {
|
||||
"Original official bundle": {
|
||||
"launch": "0 -",
|
||||
"updatePackage": "0 -"
|
||||
},
|
||||
"Unsealed installer file": {
|
||||
"launch": "0 -",
|
||||
"updatePackage": "-67054 wrapper"
|
||||
},
|
||||
"Altered Metal resource": {
|
||||
"launch": "0 -",
|
||||
"updatePackage": "-67054 service"
|
||||
},
|
||||
"Modified wrapper executable": {
|
||||
"launch": "-67061 wrapper",
|
||||
"updatePackage": "-67061 wrapper"
|
||||
},
|
||||
"Modified service executable": {
|
||||
"launch": "-67061 service",
|
||||
"updatePackage": "-67061 service"
|
||||
},
|
||||
"Ad hoc wrapper": {
|
||||
"launch": "-67050 wrapper",
|
||||
"updatePackage": "-67050 wrapper"
|
||||
},
|
||||
"Ad hoc service": {
|
||||
"launch": "-67050 service",
|
||||
"updatePackage": "-67021 wrapper"
|
||||
},
|
||||
"Missing service": {
|
||||
"launch": "-67068 service",
|
||||
"updatePackage": "-67054 wrapper"
|
||||
},
|
||||
"Signed service from build 90": {
|
||||
"launch": "-67050 component-build",
|
||||
"updatePackage": "-67050 component-build"
|
||||
},
|
||||
"Modified wrapper Info.plist": {
|
||||
"launch": "-67030 wrapper",
|
||||
"updatePackage": "-67030 wrapper"
|
||||
}
|
||||
},
|
||||
"originalBuild94Package": {
|
||||
"sha256": "6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4",
|
||||
"unmodifiedPayloadPassedExistingStrictCheckLocally": true,
|
||||
"embeddedChains": "Wrapper and service each include Apple Root CA, Developer ID intermediate and Developer ID Application leaf. Both pass a separate code-signing certificate-chain trust evaluation using system roots with no user keychains or network.",
|
||||
"affectedUserFailureStage": "The user-provided repair record reports four unreadable resources and a separate copy under /Applications. The original signed PKG independently confirms four root:wheel 0700 resources. Simulated read denial reproduced strict validation failure. Exact on-device OSStatus unavailable.",
|
||||
"permissionFailure": {
|
||||
"affectedFiles": [
|
||||
{
|
||||
"path": "Contents/Resources/Basis_balanceWheel.png",
|
||||
"mode": "0700",
|
||||
"owner": "root",
|
||||
"group": "wheel"
|
||||
},
|
||||
{
|
||||
"path": "Contents/Resources/FCP Templates/large.png",
|
||||
"mode": "0700",
|
||||
"owner": "root",
|
||||
"group": "wheel"
|
||||
},
|
||||
{
|
||||
"path": "Contents/Resources/FCP Templates/small.png",
|
||||
"mode": "0700",
|
||||
"owner": "root",
|
||||
"group": "wheel"
|
||||
},
|
||||
{
|
||||
"path": "Contents/Resources/FCP Templates/大鱼调色.moef",
|
||||
"mode": "0700",
|
||||
"owner": "root",
|
||||
"group": "wheel"
|
||||
}
|
||||
],
|
||||
"unreadableResourceSimulation": 1,
|
||||
"unreadableDetail": "--prepared:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n--prepared:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/Frameworks/PluginManager.framework/Versions/Current/.\n--validated:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/Frameworks/PluginManager.framework/Versions/Current/.\n--prepared:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/Frameworks/FxPlug.framework/Versions/Current/.\n--validated:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/Frameworks/FxPlug.framework/Versions/Current/.\n--validated:<app>/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n<app>: Permission denied",
|
||||
"sameSignedBundleAfter0644": "strict codesign passed without re-signing"
|
||||
},
|
||||
"targetPath": "The PKG payload and postinstall use /Library/Plug-Ins/FxPlug/大鱼调色.app and disable bundle relocation. No payload entry places the app under /Applications."
|
||||
},
|
||||
"sourceRecovery": {
|
||||
"independentClone": true,
|
||||
"exactTree": "95ab6753ac6ecae8e3d0bf6927034ad8486740e2",
|
||||
"trackedFiles": 633,
|
||||
"strictFsck": true
|
||||
},
|
||||
"resourceModeFix": {
|
||||
"mode": "0644",
|
||||
"normalizationSource": "tools/deliver.py",
|
||||
"installedFormalBundle": "Four modes corrected in place without re-signing. Deep strict verification, stapled ticket and Gatekeeper all passed again.",
|
||||
"packageGate": "Packaging/build_pkg.py checks both the source APP modes and the exact package BOM."
|
||||
},
|
||||
"finalPackage": {
|
||||
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.14.4.pkg",
|
||||
"bytes": 45381319,
|
||||
"sha256": "d9184b1ee1f44723e4fe9fa87c76878884dc8a4fe5c421712650852b0b2ece59",
|
||||
"notarization": {
|
||||
"message": "Successfully received submission info",
|
||||
"status": "Accepted",
|
||||
"createdDate": "2026-11-06T02:43:36.819Z",
|
||||
"name": "大鱼调色-1.14.4.pkg",
|
||||
"id": "3a7eda14-7386-45ec-88fc-5c7676eca2e8"
|
||||
},
|
||||
"payloadBundleAccess": {
|
||||
"entries": 134,
|
||||
"scope": "Read/traverse modes for installer-owned app entries, from the package BOM"
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-15
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.12.0.pkg",
|
||||
"sha256": "d4b557fec283f5e06f605bc6b1d99a0c8649f9d65e405eba452f525e8454cdfe",
|
||||
"bytes": 45329742,
|
||||
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.14.4.pkg",
|
||||
"sha256": "d9184b1ee1f44723e4fe9fa87c76878884dc8a4fe5c421712650852b0b2ece59",
|
||||
"bytes": 45381319,
|
||||
"testUnsigned": false,
|
||||
"installationExecuted": false,
|
||||
"checks": [
|
||||
@@ -31,27 +31,27 @@
|
||||
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"bundleID": "com.dayu.color",
|
||||
"version": "1.12.0",
|
||||
"build": "79"
|
||||
"version": "1.14.4",
|
||||
"build": "95"
|
||||
},
|
||||
{
|
||||
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
|
||||
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.fce6a551-4990-4102-b290-e6511f4a7fa2/37C920B8-34AA-4766-A277-8285B88499A0/大鱼调色"
|
||||
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.d5750cbc-5b20-40cc-a61e-1c7693b24498/E257BACE-349E-4D67-A8D3-A01DCC7EC44A/大鱼调色"
|
||||
}
|
||||
],
|
||||
"signature": "Package \"大鱼调色-1.12.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-05 04:38:21 +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.12.0.pkg: accepted\nsource=Notarized Developer ID",
|
||||
"signature": "Package \"大鱼调色-1.14.4.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-06 02:43:35 +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.14.4.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": {
|
||||
"name": "大鱼调色-1.12.0.pkg",
|
||||
"message": "Successfully received submission info",
|
||||
"createdDate": "2026-11-05T04:38:23.194Z",
|
||||
"id": "e57b2649-ca38-46df-afed-c50442bf6227",
|
||||
"status": "Accepted"
|
||||
"status": "Accepted",
|
||||
"createdDate": "2026-11-06T02:43:36.819Z",
|
||||
"name": "大鱼调色-1.14.4.pkg",
|
||||
"id": "3a7eda14-7386-45ec-88fc-5c7676eca2e8"
|
||||
},
|
||||
"appCompiledSource": "beccf2fc01f8dc06c5d3d505f88289885d209bc8",
|
||||
"appBuild": "79",
|
||||
"appCompiledSource": "9f5f0659774c8c05e2640db0d62fb61cb529734e",
|
||||
"appBuild": "95",
|
||||
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
|
||||
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
|
||||
"templateSHA256": {
|
||||
@@ -59,6 +59,10 @@
|
||||
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
|
||||
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
|
||||
},
|
||||
"installedAppHostAcceptance": "verification/HostFeedback79.json",
|
||||
"payloadBundleAccess": {
|
||||
"entries": 134,
|
||||
"scope": "Read/traverse modes for installer-owned app entries, from the package BOM"
|
||||
},
|
||||
"installedAppHostAcceptance": "verification/Integrity1.14.4.json",
|
||||
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
|
||||
}
|
||||
+32
-14
@@ -3,24 +3,42 @@
|
||||
"repository": "dayu/dayu-color",
|
||||
"repositoryID": 52,
|
||||
"private": false,
|
||||
"tag": "v1.11.0-canvas-spatial-20261105",
|
||||
"releaseCommit": "5f8fb13fceb0c4d4ead447b8b5694ce269e95749",
|
||||
"releaseID": 388,
|
||||
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.11.0-canvas-spatial-20261105",
|
||||
"tag": "v1.14.3-tracking-preview-20261106",
|
||||
"releaseCommit": "8b96e8b8c1b0c9356ae9871a2bc042a83e7e97d6",
|
||||
"releaseID": 395,
|
||||
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.14.3-tracking-preview-20261106",
|
||||
"prerelease": true,
|
||||
"assetID": 32,
|
||||
"assetName": "大鱼调色-1.11.0.pkg",
|
||||
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.11.0-canvas-spatial-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.11.0.pkg",
|
||||
"bytes": 43128845,
|
||||
"sha256": "2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e",
|
||||
"assetID": 39,
|
||||
"assetName": "大鱼调色-1.14.3.pkg",
|
||||
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.14.3-tracking-preview-20261106/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.14.3.pkg",
|
||||
"bytes": 45381192,
|
||||
"sha256": "6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4",
|
||||
"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.11.0.pkg",
|
||||
"sha256": "2dd5166902ebdaae50dd897057459cbe7e5ea611dbdeb571bd688e843c59768e",
|
||||
"bytes": 43128845,
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.11.0-canvas-spatial-20261105/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.11.0.pkg",
|
||||
"removedAfterVerification": true
|
||||
"path": "/Volumes/备份/大鱼调色-1.14.3.pkg",
|
||||
"sha256": "6df64ae33f99bab95f8dc4e80d70a717fb210b35f90ce52cb38d47d814e709f4",
|
||||
"bytes": 45381192,
|
||||
"sourceURL": "https://dayu.media/git/attachments/d2c6a2b0-5c37-48e7-8b14-5ccdc63b3bb9",
|
||||
"temporaryDownloadRemoved": true
|
||||
},
|
||||
"recovery": {
|
||||
"compiledSourceFiles": 627,
|
||||
"releaseTagFiles": 629,
|
||||
"exactTrees": true,
|
||||
"strictFsck": true,
|
||||
"packageRecordMatches": true,
|
||||
"temporaryCheckoutsRemoved": true
|
||||
},
|
||||
"deliveryCleanup": {
|
||||
"oldBuildsRemoved": [
|
||||
91,
|
||||
92,
|
||||
93
|
||||
],
|
||||
"generatedBuildAppRemoved": true,
|
||||
"notarizationZIPRemoved": true,
|
||||
"formalInstallKept": true
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"date": "2026-11-05T02:22:40.436257+00:00",
|
||||
"status": "formal-install-and-focused-host-feedback-passed",
|
||||
"status": "formal-delivery-complete",
|
||||
"version": "1.12.0",
|
||||
"build": "79",
|
||||
"checks": 834,
|
||||
@@ -18,14 +18,15 @@
|
||||
"Default wide mask strip shows entire tracking area and numeric fields are editable.",
|
||||
"All four scope images expose accessible titles."
|
||||
],
|
||||
"remaining": [
|
||||
"PKG and Release completion recorded separately in Package.json/Release.json; do not infer from this UI report."
|
||||
],
|
||||
"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"
|
||||
}
|
||||
@@ -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>";
|
||||
|
||||
@@ -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,135 @@ 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);
|
||||
p.width=.25f;p.height=.25f;
|
||||
stamp[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];
|
||||
DYStampMotion startMotion;startMotion.active=true;
|
||||
DYStampMotion endMotion=startMotion;
|
||||
endMotion.sourceOffsetX=4.f/w;endMotion.sourceOffsetY=2.f/h;
|
||||
endMotion.targetScaleX=2.f;endMotion.targetScaleY=2.f;
|
||||
stamp[@"keys"]=@[DYStampKey(kCMTimeZero,p,NO,1,startMotion),DYStampKey(next,moved,NO,1,endMotion)];
|
||||
CMTime half=CMTimeMake(1,50);
|
||||
DYMaskParameters halfway=DYMaskAtTime(stamp,half);
|
||||
NSArray *halfSource=DYStampSourceAtTime(stamp,half);
|
||||
run.record(@"clone-stamp-interpolates-both-centers-and-coverage-scale",
|
||||
fabs(halfway.centerY-29.5f/h)<1e-6&&fabs(halfway.width-.375)<1e-6&&
|
||||
fabs([halfSource[0] doubleValue]-18.5f/w)<1e-6&&fabs([halfSource[1] doubleValue]-13.5f/h)<1e-6);
|
||||
Pixels zoomed=frame(next,@"clone-stamp-paired-scale-production-render");
|
||||
run.record(@"clone-stamp-relative-scale-remaps-source-and-expands-target-coverage",
|
||||
pixel(zoomed,48,34,baseline,20,14)<.001&&pixel(zoomed,52,38,baseline,22,16)<.001&&
|
||||
pixel(zoomed,60,34,baseline,26,14)<.001&&pixel(zoomed,0,0,baseline,0,0)==0);
|
||||
float halfPixel=(baseline[(14*w+22)*4]+baseline[(14*w+23)*4])*.5f;
|
||||
run.record(@"clone-stamp-fractional-zoom-interpolates-adjacent-source-pixels",
|
||||
fabs(zoomed[(34*w+53)*4]-halfPixel)<.001);
|
||||
endMotion.sourceScaleX=2.f;endMotion.sourceScaleY=2.f;
|
||||
stamp[@"keys"]=@[DYStampKey(next,moved,YES,1,endMotion)];
|
||||
Pixels equalZoom=frame(next,@"clone-stamp-equal-scale-production-render");
|
||||
run.record(@"clone-stamp-equal-zoom-preserves-pixel-exact-copy",pixel(equalZoom,52,38,baseline,24,18)==0);
|
||||
DYStampMotion subpixel=startMotion;
|
||||
subpixel.sourceOffsetX=.5f/w;
|
||||
stamp[@"keys"]=@[DYStampKey(next,p,NO,1,subpixel)];
|
||||
Pixels atUnit=frame(next,@"clone-stamp-fractional-translation-at-unit-zoom");
|
||||
subpixel.sourceScaleX=1.0002f;
|
||||
stamp[@"keys"]=@[DYStampKey(next,p,NO,1,subpixel)];
|
||||
Pixels nearUnit=frame(next,@"clone-stamp-fractional-translation-near-unit-zoom");
|
||||
float unitPixel=(baseline[(12*w+16)*4]+baseline[(12*w+17)*4])*.5f;
|
||||
run.record(@"clone-stamp-fractional-translation-is-continuous-through-unit-zoom",
|
||||
fabs(atUnit[(24*w+48)*4]-unitPixel)<.0004f&&pixel(atUnit,48,24,nearUnit,48,24)<.0004f);
|
||||
subpixel.sourceOffsetX=-16.5f/w;
|
||||
subpixel.sourceScaleX=1;
|
||||
stamp[@"keys"]=@[DYStampKey(next,p,NO,1,subpixel)];
|
||||
Pixels atEdge=frame(next,@"clone-stamp-fractional-source-crossing-image-edge");
|
||||
float edgePixel=(baseline[(12*w)*4]+baseline[(24*w+48)*4])*.5f;
|
||||
run.record(@"clone-stamp-source-fades-continuously-at-image-edge",
|
||||
fabs(atEdge[(24*w+48)*4]-edgePixel)<.0005f);
|
||||
stamp[@"keys"]=@[DYStampKey(next,moved,YES,1,endMotion)];
|
||||
DYMaskParameters differentTarget=moved;differentTarget.centerY=.45f;
|
||||
endMotion.sourceScaleX=1.25f;
|
||||
run.record(@"clone-stamp-retracking-updates-paired-data-without-overwriting-manual-target",
|
||||
DYMergeTracking(stamp,@[DYStampKey(CMTimeMake(2,50),differentTarget,NO,.9,endMotion)])&&
|
||||
[stamp[@"keys"] count]==1&&DYMaskAtTime(stamp,next).centerY==moved.centerY&&
|
||||
DYStampMotionAtTime(stamp,next).sourceScaleX==1.25f);
|
||||
CMTime frameDuration=CMTimeMake(1,25),nearStart=CMTimeMake(-1,150),nearEnd=CMTimeMake(7,150);
|
||||
CMTime previous=CMTimeMake(-1,25),following=CMTimeMake(2,25),authored=CMTimeMake(1,150);
|
||||
stamp[@"keys"]=@[DYMaskKey(previous,p,NO,1),DYMaskKey(nearStart,p,NO,1),
|
||||
DYMaskKey(authored,p,YES,1),DYMaskKey(nearEnd,p,NO,1),DYMaskKey(following,p,NO,1)];
|
||||
NSArray *pairKeys=@[DYStampKey(kCMTimeZero,p,NO,1,startMotion),DYStampKey(next,moved,NO,1,endMotion)];
|
||||
BOOL merged=DYMergeTracking(stamp,pairKeys,frameDuration);
|
||||
NSArray *mergedKeys=stamp[@"keys"];
|
||||
run.record(@"clone-stamp-replaces-same-frame-automatic-keys-from-offset-host-clock",
|
||||
merged&&mergedKeys.count==5&&[mergedKeys[0] isEqual:DYMaskKey(previous,p,NO,1)]&&
|
||||
[mergedKeys[1] isEqual:pairKeys[0]]&&[mergedKeys[2] isEqual:DYMaskKey(authored,p,YES,1)]&&
|
||||
[mergedKeys[3] isEqual:pairKeys[1]]&&[mergedKeys[4] isEqual:DYMaskKey(following,p,NO,1)]);
|
||||
NSMutableArray *jitter=[NSMutableArray array];
|
||||
for(int i=0;i<7;i++){
|
||||
DYMaskParameters shape=p;
|
||||
shape.centerX+=i*.01f+(i==3?.04f:0);
|
||||
DYStampMotion motion=startMotion;
|
||||
motion.sourceOffsetY=i*.01f+(i==3?.04f:0);
|
||||
motion.sourceScaleX=expf(i*.02f+(i==3?.08f:0));
|
||||
motion.targetScaleY=expf(i*-.02f+(i==3?-.08f:0));
|
||||
[jitter addObject:DYStampKey(CMTimeMake(i,25),shape,NO,.9f,motion)];
|
||||
}
|
||||
stamp[@"keys"]=@[];
|
||||
BOOL stable=DYMergeTracking(stamp,jitter,frameDuration);
|
||||
NSArray *smoothed=stamp[@"keys"];
|
||||
CMTime center=CMTimeMake(3,25);
|
||||
auto filtered=DYStampMotionAtTime(stamp,center);
|
||||
float expectedSpike=.04f*6/16;
|
||||
run.record(@"clone-stamp-smooths-both-positions-and-log-scales-and-keeps-analysis-endpoints",
|
||||
stable&&smoothed.count==7&&[smoothed.firstObject isEqual:jitter.firstObject]&&
|
||||
[smoothed.lastObject isEqual:jitter.lastObject]&&
|
||||
fabs(DYMaskAtTime(stamp,center).centerX-p.centerX-.03f-expectedSpike)<1e-6&&
|
||||
fabs(filtered.sourceOffsetY-.03f-expectedSpike)<1e-6&&
|
||||
fabs(logf(filtered.sourceScaleX)-.09f)<1e-6&&fabs(logf(filtered.targetScaleY)+.09f)<1e-6);
|
||||
stamp[@"keys"]=@[];
|
||||
stable=DYMergeTracking(stamp,jitter.reverseObjectEnumerator.allObjects,frameDuration);
|
||||
run.record(@"clone-stamp-smoothing-is-independent-of-analysis-direction",stable&&[stamp[@"keys"] isEqual:smoothed]);
|
||||
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);
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
#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;}
|
||||
#include "DYTrackingPreview.inc.h"
|
||||
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;}
|
||||
@@ -38,6 +39,7 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
@interface DYColorWorkspace (Internal)
|
||||
- (void)layoutWorkspace;
|
||||
- (void)scopeChanged:(NSNotification *)notification;
|
||||
- (void)setTrackingPreviewVisible:(BOOL)visible;
|
||||
@end
|
||||
@interface DYWorkspaceLifetime:NSObject
|
||||
@property(nonatomic,assign) DYColorWorkspace *owner;
|
||||
@@ -93,6 +95,7 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
DYRenderer *_renderer;DYLUTLibrary *_library;DYLUTBrowser *_browser;
|
||||
DYWorkspaceRoot *_root;NSView *_scopePane,*_lutPane;
|
||||
DYScopePlot *_plot;NSArray *_scopePlots;NSInteger _editorMode;
|
||||
DYTrackingPreview *_trackingPreview;
|
||||
NSTextField *_heading,*_description,*_status,*_lutExplanation;
|
||||
NSButton *_close,*_hostScopes,*_sizeMode;
|
||||
DYWorkspaceLifetime *_lifetime;
|
||||
@@ -122,6 +125,9 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
_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];
|
||||
_trackingPreview=[[DYTrackingPreview alloc]initWithTarget:self action:@selector(trackingPreviewAction:)];
|
||||
[_scopePane addSubview:_trackingPreview];
|
||||
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(trackingPreviewChanged:) name:@"DYToolTrackingStatus" object:[self rootHost]];
|
||||
_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];
|
||||
@@ -133,7 +139,7 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
}
|
||||
- (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];[_scopePlots release];[_heading release];[_description release];[_status release];[_lutExplanation release];[_close release];[_hostScopes release];[_sizeMode release];[_title release];[_lastError release];[_lifetime release];
|
||||
[_manager release];[_renderer release];[_library release];[_browser release];[_root release];[_scopePane release];[_lutPane release];[_plot release];[_scopePlots release];[_trackingPreview 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;}
|
||||
@@ -183,8 +189,27 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
_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;
|
||||
_trackingPreview.frame=_scopePane.bounds;
|
||||
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)setTrackingPreviewVisible:(BOOL)visible {
|
||||
_trackingPreview.hidden=!visible;_description.hidden=visible;_hostScopes.hidden=visible;
|
||||
for(DYScopePlot *plot in _scopePlots)plot.hidden=visible;
|
||||
}
|
||||
- (void)trackingPreviewChanged:(NSNotification *)note {
|
||||
NSDictionary *info=note.userInfo;
|
||||
if(!info[@"tracking"]||(!_visible&&!_opening))return;
|
||||
BOOL active=[info[@"tracking"] boolValue];
|
||||
if(active&&_trackingPreview.hidden)[self setTrackingPreviewVisible:YES];
|
||||
if(!_trackingPreview.hidden)[_trackingPreview applyUpdate:info];
|
||||
}
|
||||
- (void)trackingPreviewAction:(id)sender {
|
||||
if(_trackingPreview.running){
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrack" object:[self rootHost] userInfo:@{@"direction":@9}];
|
||||
}else{
|
||||
[_trackingPreview reset];[self setTrackingPreviewVisible:NO];
|
||||
}
|
||||
}
|
||||
- (void)pageChanged:(id)sender{
|
||||
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{
|
||||
@@ -265,6 +290,7 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
|
||||
- (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];
|
||||
[_trackingPreview reset];[self setTrackingPreviewVisible: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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -9,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"
|
||||
|
||||
@@ -346,3 +346,53 @@ 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;
|
||||
float2 sampleCenter(stamp.sourceX,stamp.sourceY);
|
||||
float2 sampleScale(stamp.samplingScaleX,stamp.samplingScaleY);
|
||||
float4 sampled;
|
||||
float sourceCoverage=1;
|
||||
float2 offset=(sampleCenter-center+(uv-center)*(sampleScale-1))*float2(size);
|
||||
if(flip)offset.y=-offset.y;
|
||||
if(!stamp.subpixel){
|
||||
// Preserve pixel values for stamps with translation alone.
|
||||
int2 source=int2(gid)+int2(round(offset));
|
||||
if(any(source<0)||any(source>=int2(size)))continue;
|
||||
sampled=input.read(uint2(source));
|
||||
}else{
|
||||
// Follow fractional motion through unit zoom and fade the sample
|
||||
// across the last pixel instead of dropping it at the image edge.
|
||||
float2 source=float2(gid)+offset;
|
||||
float2 edge=min(source+1,float2(size)-source);
|
||||
sourceCoverage=saturate(min(edge.x,edge.y));
|
||||
if(sourceCoverage<=0)continue;
|
||||
float2 pixel=clamp(source,0.f,float2(size-1));
|
||||
uint2 lo=uint2(floor(pixel)),hi=min(lo+1,size-1);
|
||||
float2 blend=fract(pixel);
|
||||
float4 top=mix(input.read(lo),input.read(uint2(hi.x,lo.y)),blend.x);
|
||||
float4 bottom=mix(input.read(uint2(lo.x,hi.y)),input.read(hi),blend.x);
|
||||
sampled=mix(top,bottom,blend.y);
|
||||
}
|
||||
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,sampled,coverage*stamp.strength*sourceCoverage);
|
||||
}
|
||||
output.write(color,gid);
|
||||
}
|
||||
@@ -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)];
|
||||
|
||||
+40
-12
@@ -258,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;
|
||||
@@ -268,7 +268,7 @@ static NSArray *DYPresentationSections(void) {
|
||||
- (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)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)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 {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));}
|
||||
@@ -487,7 +487,7 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
NSInteger _visibleLooks;
|
||||
NSButton *_colorSettings;BOOL _colorSettingsExpanded;
|
||||
BOOL _refreshing,_graphicUndoOpen,_graphicCancelled;CMTime _graphicTime;NSMutableDictionary *_graphicExpected;
|
||||
BOOL _embedded,_workspaceEditor;NSMutableDictionary *_stackViews;NSArray *_stackOrder;NSDictionary *_stackRoots;CGFloat _stackHeight;
|
||||
BOOL _embedded,_workspaceEditor;NSMutableDictionary *_stackViews;NSArray *_stackOrder;NSDictionary *_stackRoots;CGFloat _stackHeight,_preferredHeight;
|
||||
DYSpiderPanel *_spiderPanel;
|
||||
NSMutableDictionary *_assetLoads,*_assetLoadIDs;
|
||||
NSUInteger _nextAssetLoadID;
|
||||
@@ -509,9 +509,10 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
}
|
||||
- (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;
|
||||
_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];
|
||||
@@ -558,7 +559,10 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
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];
|
||||
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];
|
||||
@@ -585,7 +589,7 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
- (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];}
|
||||
@@ -606,11 +610,13 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
}
|
||||
- (void)openWorkspace:(id)sender {
|
||||
if(_embedded||_workspaceEditor||!self.window||!_renderer)return;
|
||||
BOOL tracking=[sender isKindOfClass:NSNotification.class]&&[[sender userInfo][@"page"]isEqual:@"tracking"];
|
||||
if(tracking&&_workspace.visible)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"}];
|
||||
if(!tracking&&_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"]];
|
||||
if(!tracking&&[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"]];}
|
||||
@@ -630,7 +636,14 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
[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]];if(_recentBrowser.visible)[_recentBrowser 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) {
|
||||
@@ -685,8 +698,8 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
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"]) {
|
||||
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];[graph setHistogram:[_renderer histogram]];[strip addSubview:graph];[_graphics addObject:graph];}[card addSubview:strip];[body addObject:strip];}
|
||||
else {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];
|
||||
@@ -807,7 +820,7 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
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||_workspaceEditor)?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) {
|
||||
@@ -890,6 +903,21 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
|
||||
}
|
||||
y=[self layoutRepeatedToolsAfter:@"tail" y:y width:w];
|
||||
_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 {
|
||||
|
||||
@@ -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,9 +24,56 @@
|
||||
- (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;
|
||||
NSArray *scale=mask[@"stampSamplingScale"];
|
||||
stamps.push_back({p.centerX,p.centerY,[patch[0]floatValue],[patch[1]floatValue],
|
||||
scale?[scale[0]floatValue]:1.f,scale?[scale[1]floatValue]:1.f,
|
||||
2/p.width,2/p.height,p.feather,p.strength,p.inputBlack,p.inputWhite,p.inputGamma,scale?1u:0u});
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -55,16 +55,18 @@
|
||||
- (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++;}
|
||||
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;
|
||||
@@ -99,7 +101,7 @@
|
||||
- (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([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){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(stamp&&(i==4||i==5)){DYStampMotion motion=DYStampMotionAtTime(m,self->_time);*fields[i]/=i==4?motion.targetScaleX:motion.targetScaleY;}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:DYStampKey(self->_time,p,YES,1,DYStampMotionAtTime(m,self->_time))];[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;}
|
||||
- (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;}
|
||||
@@ -109,7 +111,23 @@
|
||||
- (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":[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)clear:(id)sender{
|
||||
if(_drawing)return;
|
||||
[self edit:@"清除蒙版轨迹" block:^(NSMutableDictionary *d,NSMutableDictionary *m){
|
||||
DYMaskParameters p=DYMaskAtTime(m,self->_time);
|
||||
if(m[@"stampSource"]){
|
||||
NSArray *source=DYStampSourceAtTime(m,self->_time);
|
||||
DYStampMotion motion=DYStampMotionAtTime(m,self->_time);
|
||||
m[@"stampSource"]=@[source[0],source[1],
|
||||
@(std::clamp([source[2] doubleValue]*motion.sourceScaleX,.001,1.)),
|
||||
@(std::clamp([source[3] doubleValue]*motion.sourceScaleY,.001,1.))];
|
||||
m[@"stampSamplingScale"]=DYStampSamplingScaleAtTime(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":[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
|
||||
+57
-5
@@ -19,13 +19,14 @@
|
||||
#include "DYToolFlow.inc.h"
|
||||
@implementation DYPlugIn {
|
||||
DYRenderer *_renderer;
|
||||
NSColorSampler *_canvasSampler;
|
||||
BOOL _copyAnalyzed;
|
||||
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);_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];}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];}
|
||||
@@ -35,12 +36,12 @@
|
||||
// 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:©Auto 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:©Auto 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()){@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;
|
||||
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{
|
||||
@@ -48,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"
|
||||
+4
-2
@@ -14,8 +14,10 @@
|
||||
- (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;
|
||||
|
||||
+10
-11
@@ -1,5 +1,4 @@
|
||||
#import <os/log.h>
|
||||
#import "DYHistogram.h"
|
||||
#import "DYManagedColor.h"
|
||||
#import "../../ColorManagement/Sources/DYColorManagementGPU.h"
|
||||
#import "../../ColorManagement/Sources/DYColorProfile.h"
|
||||
@@ -34,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;}
|
||||
@@ -112,13 +113,13 @@ 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,*_scopeLatest;
|
||||
uint64_t _scopeCaptureSerial,_scopeLatestSerial;CMTime _scopeRequestedTime;
|
||||
@@ -135,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];[_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];[_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];
|
||||
@@ -159,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{
|
||||
@@ -170,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.
|
||||
@@ -248,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];
|
||||
|
||||
@@ -16,6 +16,27 @@
|
||||
}
|
||||
- (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;uint64_t serial;@synchronized(_previewLock){if(_exporting||!tile)return;generation=_scopeGeneration;serial=++_scopeCaptureSerial;}
|
||||
@autoreleasepool{@try{
|
||||
@@ -37,7 +58,14 @@
|
||||
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),@"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(serial>=_scopeLatestSerial){[_scopeLatest release];_scopeLatest=[sample retain];_scopeLatestSerial=serial;}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];
|
||||
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. */}}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -33,6 +33,13 @@
|
||||
[(id)osc setValue:[NSValue valueWithRect:view]forKey:@"imageRect"];[(id)osc setValue:@2 forKey:@"uiScale"];NSRect visible=NSIntersectionRect(view,NSMakeRect(0,0,640,400));
|
||||
for(NSInteger i=9;i<=10;i++)penActionsBounded&=NSContainsRect(visible,[(id)osc toolbarRectForItem:i]);}
|
||||
run.record(@"native-osc-keeps-only-two-pen-actions-bounded-at-bottom",penActionsBounded);
|
||||
NSColor *white=[NSColor colorWithSRGBRed:.82 green:.64 blue:.52 alpha:1];
|
||||
auto whiteBalance=[&](CMTime time){[NSNotificationCenter.defaultCenter postNotificationName:@"DYWhiteBalanceColor" object:host userInfo:@{@"time":[(NSDictionary*)CMTimeCopyAsDictionary(time,kCFAllocatorDefault) autorelease],@"color":white}];drain();};
|
||||
NSDictionary *beforeWhite=[[base->_values copy]autorelease];undo=base->_undoStarts;whiteBalance(CMTimeMake(1,24));
|
||||
run.record(@"canvas-white-balance-cannot-write-after-the-playhead-moves",[beforeWhite isEqual:base->_values]&&base->_undoStarts==undo);
|
||||
whiteBalance(kCMTimeZero);DYUniforms balanced;DYReadUniforms(host,kCMTimeZero,&balanced);
|
||||
float temp=0,tint=0;[DYColorTables neutralizeColor:(vector_float3){.82f,.64f,.52f} temperature:&temp tint:&tint];
|
||||
run.record(@"canvas-white-balance-uses-existing-solver-and-one-undo",fabs(balanced.temperature-temp)<1e-4&&fabs(balanced.tint-tint)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
{
|
||||
@@ -59,3 +66,144 @@
|
||||
[osc mouseDownAtPositionX:488 positionY:149.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:208 positionY:275.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();p=DYMaskAtTime(DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,maskID),kCMTimeZero);run.record(@"native-osc-ellipse-draws-reverse-direction-with-positive-shared-extents",p.kind==DYMaskEllipse&&fabs(p.centerX-.55)<1e-5&&fabs(p.centerY-.5)<1e-5&&fabs(p.width-.5)<1e-5&&fabs(p.height-.4)<1e-5&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
|
||||
{
|
||||
DYDiagnosticManager *base=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(base,nil);
|
||||
DYToolCanvasProbe *host=[[[DYToolCanvasProbe alloc]init]autorelease];host->_base=base;host->_time=kCMTimeZero;
|
||||
id<DYToolCanvasHostProbe> plugin=(id)[[NSClassFromString(@"DYPlugIn")alloc]initWithAPIManager:host];
|
||||
DYDiagnosticTile *src=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:16 height:16]autorelease],*dst=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:16 height:16]autorelease];
|
||||
Pixels pixels(16*16*4);for(size_t i=0;i<pixels.size();i++)pixels[i]=i%4==3?1:.18f;
|
||||
[[src metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,16,16)mipmapLevel:0 withBytes:pixels.data()bytesPerRow:16*8];
|
||||
id<DYViewerParameterProbe> bridge=[(id)plugin valueForKey:@"viewerParameterBridge"];
|
||||
auto histogram=[&]()->NSData*{NSData *state=nil;NSError *failure=nil;
|
||||
if(![plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&failure])return nil;
|
||||
if(![(id<FxTileableEffect>)plugin renderDestinationImage:dst sourceImages:@[src] pluginState:state atTime:kCMTimeZero error:&failure])return nil;
|
||||
return [bridge canvasHistogramAtTime:kCMTimeZero];
|
||||
};
|
||||
NSData *before=histogram();
|
||||
for(NSDictionary *d in DYDescriptors())if([@[@"masterX0",@"curveY0"]containsObject:d[@"key"]])
|
||||
[(id<FxParameterSettingAPI_v6>)base setFloatValue:[d[@"key"]isEqual:@"masterX0"]?.5:32 toParameter:[d[@"pid"]unsignedIntValue] atTime:kCMTimeZero];
|
||||
NSData *after=histogram();
|
||||
run.record(@"canvas-curve-histogram-updates-from-final-output-at-the-same-playhead",before.length==sizeof(DYHistogram)&&after.length==sizeof(DYHistogram)&&![before isEqual:after]&&![bridge canvasHistogramAtTime:CMTimeMake(1,24)]);
|
||||
[plugin release];
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
DYWorkspaceDiagnosticHost *base=[[[DYWorkspaceDiagnosticHost alloc]init]autorelease];DYCreateParameters(base,&error);
|
||||
DYToolCanvasProbe *host=[[[DYToolCanvasProbe alloc]init]autorelease];host->_base=base;host->_time=kCMTimeZero;
|
||||
id<DYToolCanvasHostProbe> plugin=(id)[[NSClassFromString(@"DYPlugIn")alloc]initWithAPIManager:host];
|
||||
[plugin scheduleToolCanvasRegistration];NSData *state=nil;[plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&error];
|
||||
auto drain=[](){double end=NSProcessInfo.processInfo.systemUptime+.1;while(NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];};drain();
|
||||
id<FxOnScreenControl_v4> osc=(id)[[NSClassFromString(@"DYToolOSC")alloc]initWithAPIManager:host];
|
||||
DYDiagnosticTile *overlay=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:640 height:400]autorelease];
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
id viewer=[(id)osc valueForKey:@"viewerControls"];NSRect button=NSZeroRect;
|
||||
for(NSDictionary *a in [viewer valueForKey:@"areas"])if([a[@"toolType"]isEqual:@"cloneStamp"])button=[a[@"rect"]rectValue];
|
||||
Pixels rendered=read(overlay,gpu);NSUInteger opaque=0;
|
||||
for(NSUInteger i=0;i<640*400;i++)opaque+=rendered[4*i+3]>.01;
|
||||
run.record(@"native-osc-renders-the-cropped-toolbar-on-a-transparent-texture",!NSIsEmptyRect(button)&&opaque>100&&opaque<640*400*.08&&rendered[(200*640+320)*4+3]==0,@{@"opaquePixels":@(opaque)});
|
||||
BOOL update=NO;
|
||||
auto down=[&](double x,double y){NSInteger part=0;[osc hitTestOSCAtMousePositionX:x mousePositionY:y activePart:&part atTime:kCMTimeZero];[osc mouseDownAtPositionX:x positionY:y activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];return part;};
|
||||
auto up=[&](double x,double y,NSInteger part){[osc mouseUpAtPositionX:x positionY:y activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];};
|
||||
auto click=[&](double x,double y){NSInteger part=down(x,y);up(x,y,part);};
|
||||
int undo=base->_undoStarts;
|
||||
click(NSMidX(button),400-NSMidY(button));
|
||||
click(180,291.25); // normalized source (0.25, 0.25)
|
||||
NSInteger part=down(348,244);
|
||||
[osc mouseDraggedAtPositionX:460 positionY:181 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
CMTime actionTime=CMTimeMake(39,25);
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:part destinationImage:overlay atTime:actionTime];
|
||||
host->_time=actionTime;
|
||||
up(460,181,part);
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:part destinationImage:overlay atTime:actionTime];
|
||||
run.record(@"native-osc-stamp-preview-survives-async-save-and-different-render-time",
|
||||
[[(id)osc valueForKey:@"stampSaving"]boolValue]&&[[viewer valueForKey:@"stampArmed"]boolValue]&&
|
||||
[[(id)osc valueForKey:@"stampHasSource"]boolValue]&&!DYSharedMasks(DYReadTools(base,kCMTimeZero).document).count);
|
||||
drain();
|
||||
NSDictionary *stamp=[DYSharedMasks(DYReadTools(host,kCMTimeZero).document) firstObject];
|
||||
NSArray *source=[[stamp[@"stampSource"]copy]autorelease];
|
||||
DYMaskParameters target=DYMaskAtTime(stamp,kCMTimeZero);
|
||||
run.record(@"native-osc-creates-one-stamp-and-one-undo-from-source-click-and-drag",source.count==4&&fabs([source[0]doubleValue]-.25)<1e-6&&fabs([source[1]doubleValue]-.25)<1e-6&&fabs(target.centerX-.65)<1e-6&&fabs(target.centerY-.5)<1e-6&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
run.record(@"native-osc-stamp-selects-saved-overlay-when-action-time-differs",
|
||||
stamp&&[[plugin toolCanvasMaskAtTime:actionTime][@"id"]isEqual:stamp[@"id"]]&&
|
||||
![[viewer valueForKey:@"stampArmed"]boolValue]&&![[(id)osc valueForKey:@"stampSaving"]boolValue]);
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
NSString *stampID=[[stamp[@"id"]copy]autorelease];
|
||||
NSMutableDictionary *tracked=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);
|
||||
NSMutableDictionary *trackedStamp=(id)DYSharedMaskWithID(tracked,stampID);
|
||||
DYMaskParameters moved=target;moved.centerX+=.05f;
|
||||
NSArray *keys=@[DYMaskKey(kCMTimeZero,target,NO,1),DYMaskKey(CMTimeMake(1,25),moved,NO,1)];
|
||||
trackedStamp[@"keys"]=keys;DYWriteTools(host,tracked,kCMTimeZero);
|
||||
[plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&error];
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
undo=base->_undoStarts;
|
||||
part=down(180,291.25);
|
||||
[osc mouseDraggedAtPositionX:236 positionY:259.75 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
NSArray *preview=[plugin toolCanvasMaskAtTime:kCMTimeZero][@"stampSource"];
|
||||
up(236,259.75,part);drain();
|
||||
NSDictionary *edited=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID);
|
||||
NSArray *relocated=edited[@"stampSource"];
|
||||
run.record(@"native-osc-drag-moves-only-the-stamp-source-and-keeps-tracking-keys",part==7&&fabs([relocated[0]doubleValue]-.35)<1e-6&&fabs([relocated[1]doubleValue]-.35)<1e-6&&[relocated isEqual:preview]&&[edited[@"parameters"]isEqual:trackedStamp[@"parameters"]]&&[edited[@"keys"]isEqual:keys]&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1,@{@"part":@(part),@"source":relocated?:@[],@"keys":@([edited[@"keys"]count]),@"undoGroups":@(base->_undoStarts-undo)});
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
part=down(236,259.75);
|
||||
[osc mouseDraggedAtPositionX:270 positionY:240 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
BOOL handled=NO;
|
||||
[osc keyDownAtPositionX:270 positionY:240 keyPressed:27 modifiers:0 forceUpdate:&update didHandle:&handled atTime:kCMTimeZero];
|
||||
drain();
|
||||
run.record(@"native-osc-escape-cancels-the-stamp-source-drag-without-another-undo",handled&&[DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID)[@"stampSource"]isEqual:relocated]&&base->_undoStarts==undo+1);
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
BOOL rotationHandle=NO;
|
||||
for(NSDictionary *handle in [(id)osc valueForKey:@"handles"])rotationHandle|=[handle[@"part"]integerValue]==6;
|
||||
part=down(348,244);
|
||||
[osc mouseDraggedAtPositionX:320 positionY:260 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
up(320,260,part);drain();
|
||||
NSDictionary *resized=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID);
|
||||
DYMaskParameters enlarged=DYMaskAtTime(resized,kCMTimeZero);
|
||||
run.record(@"native-osc-stamp-resizes-coverage-without-rotation-handle-or-track-changes",!rotationHandle&&part==2&&enlarged.width>target.width&&enlarged.height>target.height&&enlarged.centerX==target.centerX&&enlarged.centerY==target.centerY&&[resized[@"keys"]isEqual:keys]);
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
undo=base->_undoStarts;
|
||||
part=down(404,212.5);
|
||||
[osc mouseDraggedAtPositionX:460 positionY:196.75 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
up(460,196.75,part);drain();
|
||||
NSDictionary *repositioned=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,stampID);
|
||||
NSArray *editedKeys=repositioned[@"keys"];
|
||||
DYMaskParameters trackedCenter=DYMaskAtTime(repositioned,kCMTimeZero);
|
||||
run.record(@"native-osc-stamp-target-move-saves-the-canvas-key-with-a-different-action-time",
|
||||
part==1&&fabs(trackedCenter.centerX-.75)<1e-6&&fabs(trackedCenter.centerY-.55)<1e-6&&
|
||||
editedKeys.count==2&&[editedKeys[0][@"manual"]boolValue]&&[editedKeys[1]isEqual:keys[1]]&&
|
||||
base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
host->_time=kCMTimeZero;
|
||||
click(251,104);drain(); // top-down viewport y=30...345, forward button is x=212...290.
|
||||
run.record(@"native-osc-stamp-forward-action-starts-the-existing-host-tracker",host->_forwardStarts==1&&host->_backwardStarts==0);
|
||||
[plugin cleanupAnalysis:nil];drain();
|
||||
NSDictionary *beforeRejected=[[DYReadTools(base,kCMTimeZero).document copy]autorelease];
|
||||
base->_rejectToolsWrites=YES;
|
||||
click(NSMidX(button),400-NSMidY(button));
|
||||
click(180,291.25);
|
||||
part=down(348,244);up(460,181,part);drain();
|
||||
run.record(@"native-osc-stamp-rejected-write-keeps-the-draft-and-existing-document",
|
||||
[beforeRejected isEqual:DYReadTools(base,kCMTimeZero).document]&&
|
||||
[[viewer valueForKey:@"stampArmed"]boolValue]&&[[(id)osc valueForKey:@"stampHasSource"]boolValue]&&
|
||||
[(id)osc valueForKey:@"stampFailure"]!=nil);
|
||||
base->_rejectToolsWrites=NO;
|
||||
part=down(348,244);up(460,181,part);drain();
|
||||
NSArray *afterRetry=DYSharedMasks(DYReadTools(base,kCMTimeZero).document);
|
||||
run.record(@"native-osc-stamp-retries-with-the-same-source-and-saves-once",
|
||||
afterRetry.count==DYSharedMasks(beforeRejected).count+1&&
|
||||
[afterRetry.lastObject[@"stampSource"]isEqual:source]&&![[viewer valueForKey:@"stampArmed"]boolValue]);
|
||||
NSString *untrackedID=[[afterRetry.lastObject[@"id"]copy]autorelease];
|
||||
[osc drawOSCWithWidth:640 height:400 activePart:0 destinationImage:overlay atTime:kCMTimeZero];
|
||||
host->_time=actionTime;
|
||||
undo=base->_undoStarts;
|
||||
part=down(404,212.5);
|
||||
[osc mouseDraggedAtPositionX:460 positionY:196.75 activePart:part modifiers:0 forceUpdate:&update atTime:kCMTimeZero];
|
||||
up(460,196.75,part);drain();
|
||||
NSDictionary *untracked=DYSharedMaskWithID(DYReadTools(host,kCMTimeZero).document,untrackedID);
|
||||
DYMaskParameters untrackedCenter=DYMaskAtTime(untracked,kCMTimeZero);
|
||||
run.record(@"native-osc-untracked-stamp-target-saves-in-place-with-a-different-action-time",
|
||||
part==1&&fabs(untrackedCenter.centerX-.75)<1e-6&&fabs(untrackedCenter.centerY-.55)<1e-6&&
|
||||
![untracked[@"keys"]count]&&[untracked[@"stampSource"]isEqual:source]&&
|
||||
base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[(id)osc release];[(id)plugin release];
|
||||
}
|
||||
@@ -8,8 +8,8 @@
|
||||
@synchronized(self){[_toolCanvasDraft release];_toolCanvasDraft=nil;[_toolCanvasOriginal release];_toolCanvasOriginal=nil;_toolDrawingPen=_toolDrawingShape=NO;_toolCanvasHasHover=NO;_toolCanvasEditTime=kCMTimeInvalid;++_toolCanvasRevision;}[self postToolCanvasStatus:nil];
|
||||
}
|
||||
- (void)commitToolCanvasDraftAtTime:(CMTime)eventTime {
|
||||
NSDictionary *draft=nil,*original=nil;NSString *node=nil,*maskID=nil;CMTime time;uint64_t revision;
|
||||
@synchronized(self){if(!_toolCanvasDraft||!_toolCanvasOriginal)return;if(!CMTIME_IS_NUMERIC(eventTime)||CMTimeCompare(eventTime,_toolCanvasEditTime)!=0){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"播放头已移动,请重新绘制。"];return;}draft=[_toolCanvasDraft copy];original=[_toolCanvasOriginal copy];node=[_selectedToolNode copy];maskID=[_selectedToolMask copy];time=_toolCanvasEditTime;
|
||||
NSDictionary *draft=nil,*original=nil;NSString *node=nil,*maskID=nil;CMTime time;uint64_t revision;BOOL stampEdit,sourceEdit,resizeStamp;
|
||||
@synchronized(self){if(!_toolCanvasDraft||!_toolCanvasOriginal)return;if(!CMTIME_IS_NUMERIC(eventTime)||CMTimeCompare(eventTime,_toolCanvasEditTime)!=0){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"播放头已移动,请重新绘制。"];return;}draft=[_toolCanvasDraft copy];original=[_toolCanvasOriginal copy];node=[_selectedToolNode copy];maskID=[_selectedToolMask copy];time=_toolCanvasEditTime;stampEdit=draft[@"stampSource"]!=nil;sourceEdit=_toolDragPart==DYCloneSourcePart;resizeStamp=stampEdit&&_toolDragPart>=2&&_toolDragPart<=5;
|
||||
// Keep the completed path visible until the authoritative write returns.
|
||||
// Discarding it here exposed the new pen mask's default rectangular nodes
|
||||
// during the OSC redraw that immediately follows the closing click.
|
||||
@@ -18,16 +18,26 @@
|
||||
@synchronized(self){if(self->_trackingActive.load()||revision!=self->_toolCanvasRevision||![node isEqual:self->_selectedToolNode]||![maskID isEqual:self->_selectedToolMask])return;}
|
||||
id<FxCustomParameterActionAPI_v4>a=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;BOOL changed=NO;
|
||||
[a startAction:self];@try{
|
||||
os_log(OS_LOG_DEFAULT,"dayu_pen_commit event=%{public}.9f action=%{public}.9f nodes=%{public}lu",CMTimeGetSeconds(time),CMTimeGetSeconds(a.currentTime),(unsigned long)([draft[@"nodes"]length]/sizeof(DYBezierNode)));
|
||||
if(!CMTIME_IS_NUMERIC(a.currentTime)||CMTimeCompare(DYHostDisplayedFrameTime(self->_apiManager,a.currentTime),time)!=0){[self postToolCanvasStatus:@"播放头已移动,本次蒙版草稿未写入其它帧。"];return;}
|
||||
NSMutableDictionary *doc=DYMutablePlist(DYReadTools(self->_apiManager,time).document),*current=[self toolMask:maskID node:node document:doc];
|
||||
CMTime actionTime=DYHostDisplayedFrameTime(self->_apiManager,a.currentTime);
|
||||
os_log(OS_LOG_DEFAULT,"dayu_pen_commit stamp=%{public}d event=%{public}.9f action=%{public}.9f nodes=%{public}lu",stampEdit,CMTimeGetSeconds(time),CMTimeGetSeconds(actionTime),(unsigned long)([draft[@"nodes"]length]/sizeof(DYBezierNode)));
|
||||
if(!CMTIME_IS_NUMERIC(actionTime)||(!stampEdit&&CMTimeCompare(actionTime,time)!=0)){[self postToolCanvasStatus:@"播放头已移动,本次蒙版草稿未写入其它帧。"];return;}
|
||||
// The stamp document is non-animatable. Preserve the canvas time for the
|
||||
// geometry and tracking key, and access the document at the host action time.
|
||||
CMTime writeTime=stampEdit?actionTime:time;
|
||||
NSMutableDictionary *doc=DYMutablePlist(DYReadTools(self->_apiManager,writeTime).document),*current=[self toolMask:maskID node:node document:doc];
|
||||
if(!current||![current isEqual:original]){os_log(OS_LOG_DEFAULT,"dayu_pen_commit conflict current=%{public}d",current!=nil);[self postToolCanvasStatus:@"蒙版已在其它位置修改,本次画面草稿未覆盖它。"];return;}
|
||||
NSMutableDictionary *result=DYMutablePlist(draft);
|
||||
if([current[@"keys"]count]){DYMaskParameters p=DYMaskAtTime(result,time);NSMutableArray *keys=[[current[@"keys"]mutableCopy]autorelease];NSIndexSet *same=[keys indexesOfObjectsPassingTest:^BOOL(NSDictionary *key,NSUInteger i,BOOL *stop){return CMTimeCompare(CMTimeMakeWithEpoch([key[@"value"]longLongValue],[key[@"scale"]intValue],[key[@"epoch"]longLongValue]),time)==0;}];[keys removeObjectsAtIndexes:same];[keys addObject:DYMaskKey(time,p,YES,1)];result[@"keys"]=@[];if(!DYMergeTracking(result,keys))return;}
|
||||
if(DYValidToolMask(result)&&![current isEqual:result]){[current setDictionary:result];id<FxUndoAPI>undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"编辑工具蒙版"];changed=DYWriteTools(self->_apiManager,doc,time);[undo endUndoGroup];if(changed){DYToolDocument *saved=[[[DYToolDocument alloc]init]autorelease];saved.document=doc;[self adoptToolCanvasDocument:saved.document];}}
|
||||
NSMutableDictionary *result=sourceEdit?[[draft mutableCopy]autorelease]:DYMutablePlist(draft);
|
||||
if(resizeStamp){
|
||||
DYMaskParameters p=DYMaskAtTime(result,kCMTimeInvalid),authored=DYMaskAtTime(current,kCMTimeInvalid);
|
||||
DYStampMotion motion=DYStampMotionAtTime(current,time);
|
||||
authored.width=p.width/motion.targetScaleX;authored.height=p.height/motion.targetScaleY;
|
||||
result[@"parameters"]=[NSData dataWithBytes:&authored length:sizeof(authored)];
|
||||
result[@"keys"]=current[@"keys"];
|
||||
}else if(!sourceEdit&&[current[@"keys"]count]){DYMaskParameters p=DYMaskAtTime(result,time);if(current[@"stampSource"])result[@"parameters"]=current[@"parameters"];NSMutableArray *keys=[[current[@"keys"]mutableCopy]autorelease];NSIndexSet *same=[keys indexesOfObjectsPassingTest:^BOOL(NSDictionary *key,NSUInteger i,BOOL *stop){return CMTimeCompare(CMTimeMakeWithEpoch([key[@"value"]longLongValue],[key[@"scale"]intValue],[key[@"epoch"]longLongValue]),time)==0;}];[keys removeObjectsAtIndexes:same];[keys addObject:DYStampKey(time,p,YES,1,DYStampMotionAtTime(current,time))];result[@"keys"]=@[];if(!DYMergeTracking(result,keys))return;}
|
||||
if(DYValidToolMask(result)&&![current isEqual:result]){[current setDictionary:result];id<FxUndoAPI>undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:sourceEdit?@"移动图章取样点":stampEdit?@"编辑仿制图章":@"编辑工具蒙版"];changed=DYWriteTools(self->_apiManager,doc,writeTime);[undo endUndoGroup];if(changed){DYToolDocument *saved=[[[DYToolDocument alloc]init]autorelease];saved.document=doc;[self adoptToolCanvasDocument:saved.document];}else if(stampEdit)[self postToolCanvasStatus:@"宿主未保存图章修改,已保留上一次位置。"];}
|
||||
}@finally{[a endAction:self];}
|
||||
os_log(OS_LOG_DEFAULT,"dayu_pen_commit result=%{public}d valid=%{public}d",changed,DYValidToolMask(draft));
|
||||
if(changed)[self postToolCanvasStatus:@"蒙版已保存 · 可一次撤销"];
|
||||
if(changed)[self postToolCanvasStatus:sourceEdit?@"图章取样点已移动 · 可一次撤销":stampEdit?@"图章已保存 · 可一次撤销":@"蒙版已保存 · 可一次撤销"];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
|
||||
}@finally{@synchronized(self){if(revision==self->_toolCanvasRevision){[self->_toolCanvasDraft release];self->_toolCanvasDraft=nil;[self->_toolCanvasOriginal release];self->_toolCanvasOriginal=nil;self->_toolCanvasEditTime=kCMTimeInvalid;}self->_toolCanvasCommitPending=NO;}[self postToolCanvasStatus:nil];}});[draft release];[original release];[node release];[maskID release];
|
||||
}
|
||||
@@ -74,6 +84,14 @@
|
||||
if(type==NSEventTypeLeftMouseDown){
|
||||
_toolCanvasHasHover=NO;
|
||||
if(_toolDrawingPen&&part==1000&&[_toolCanvasDraft[@"nodes"]length]>=3*sizeof(DYBezierNode)){[self commitToolCanvasDraftAtTime:time];return;}
|
||||
if(part==DYCloneSourcePart){
|
||||
NSDictionary *stamp=[self toolMask:_selectedToolMask node:_selectedToolNode document:_toolCanvasDocument];
|
||||
if([stamp[@"stampSource"]count]!=4)return;
|
||||
[self discardToolCanvasDraft];
|
||||
_toolCanvasOriginal=[stamp mutableCopy];_toolCanvasDraft=[stamp mutableCopy];_toolCanvasEditTime=time;
|
||||
_toolDragStart=point;_toolDragPart=part;
|
||||
return;
|
||||
}
|
||||
if(!_toolCanvasDraft){NSDictionary *mask=[self toolMask:_selectedToolMask node:_selectedToolNode document:_toolCanvasDocument];if(!mask)return;++_toolCanvasRevision;_toolCanvasOriginal=[DYMutablePlist(mask)retain];_toolCanvasDraft=[DYMutablePlist(mask)retain];_toolCanvasEditTime=time;_toolDragParameters=DYMaskAtTime(mask,time);_toolDragParameters.imageAspect=_toolSourceAspect>0?_toolSourceAspect:1;_toolCanvasDraft[@"parameters"]=[NSData dataWithBytes:&_toolDragParameters length:sizeof(DYMaskParameters)];_toolCanvasDraft[@"keys"]=@[];if(_toolDrawingPen)_toolCanvasDraft[@"nodes"]=[NSData data];}
|
||||
if(CMTimeCompare(time,_toolCanvasEditTime)!=0){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"播放头已移动,请重新绘制。"];return;}
|
||||
_toolDragStart=point;_toolDragPart=part;_toolDragParameters=DYMaskAtTime(_toolCanvasDraft,time);
|
||||
@@ -83,6 +101,14 @@
|
||||
if(!_toolCanvasDraft)return;
|
||||
if(CMTimeCompare(time,_toolCanvasEditTime)!=0){[self discardToolCanvasDraft];return;}
|
||||
if(_toolDrawingShape&&(type==NSEventTypeLeftMouseDragged||type==NSEventTypeLeftMouseUp)){[self updateToolShapeDraftAtPoint:point];if(type==NSEventTypeLeftMouseUp){DYMaskParameters p=DYMaskAtTime(_toolCanvasDraft,time);if(p.width<=.001f||p.height<=.001f){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"未拖出有效区域,原蒙版已保留。"];return;}[self commitToolCanvasDraftAtTime:time];}return;}
|
||||
if(_toolDragPart==DYCloneSourcePart&&(type==NSEventTypeLeftMouseDragged||type==NSEventTypeLeftMouseUp)){
|
||||
NSArray *source=_toolCanvasOriginal[@"stampSource"];
|
||||
double x=fmax(0,fmin(1,[source[0]doubleValue]+(point.x-_toolDragStart.x)));
|
||||
double y=fmax(0,fmin(1,[source[1]doubleValue]+(point.y-_toolDragStart.y)));
|
||||
_toolCanvasDraft[@"stampSource"]=@[@(x),@(y),source[2],source[3]];
|
||||
if(type==NSEventTypeLeftMouseUp)[self commitToolCanvasDraftAtTime:time];
|
||||
return;
|
||||
}
|
||||
if(type==NSEventTypeLeftMouseDragged){_toolCanvasHasHover=NO;DYMaskParameters p=_toolDragParameters;float dx=point.x-_toolDragStart.x,dy=point.y-_toolDragStart.y;
|
||||
if(_toolDrawingPen||_toolDragPart>=1000){NSMutableData *data=[[_toolCanvasDraft[@"nodes"]mutableCopy]autorelease];NSUInteger count=data.length/sizeof(DYBezierNode);if(count){auto *nodes=(DYBezierNode*)data.mutableBytes;NSUInteger index=_toolDrawingPen?count-1:(_toolDragPart-1000)/3,handle=_toolDrawingPen?2:(_toolDragPart-1000)%3;float a=p.imageAspect,c=cos(p.angle),s=sin(p.angle),x=((point.x-p.centerX)*a*c+(point.y-p.centerY)*s)/(p.width*a),y=(-(point.x-p.centerX)*a*s+(point.y-p.centerY)*c)/p.height;if(index<count){if(handle==0){float mx=x-nodes[index].x,my=y-nodes[index].y;nodes[index].x=x;nodes[index].y=y;nodes[index].inX+=mx;nodes[index].inY+=my;nodes[index].outX+=mx;nodes[index].outY+=my;}else if(handle==1){nodes[index].inX=x;nodes[index].inY=y;}else{nodes[index].outX=x;nodes[index].outY=y;if(_toolDrawingPen){nodes[index].inX=2*nodes[index].x-x;nodes[index].inY=2*nodes[index].y-y;}}_toolCanvasDraft[@"nodes"]=data;}}}
|
||||
else if(_toolDragPart==6)p.angle=atan2((point.y-p.centerY),(point.x-p.centerX)*p.imageAspect)+M_PI/2;
|
||||
|
||||
@@ -3,3 +3,10 @@
|
||||
struct DYToolMaskEntry {DYResolvedMask mask;int section,combine;};
|
||||
struct DYToolMaskHeader {unsigned count;float offsetX,offsetY,scaleX,scaleY;int section,premultiplied,faceOnly,skinPreview;};
|
||||
struct DYToolStageRange {int first,last,suppressBlackWhite;};
|
||||
|
||||
// Destination coverage and the source sampling transform are independent.
|
||||
struct DYCloneStamp {
|
||||
float centerX,centerY,sourceX,sourceY,samplingScaleX,samplingScaleY;
|
||||
float inverseRadiusX,inverseRadiusY,feather,strength,inputBlack,inputWhite,inputGamma;
|
||||
unsigned subpixel;
|
||||
};
|
||||
@@ -2,13 +2,22 @@
|
||||
// CF asks the host for video gamma 2.2, then Lanczos-scales to RGBA8 before
|
||||
// OpenCV gray conversion. Adapt our linear host contract in a separate texture.
|
||||
- (dy::GrayFrame)toolGrayFrame:(FxImageTile*)tile error:(NSError**)error {
|
||||
return [self toolGrayFrame:tile preview:nil error:error];
|
||||
}
|
||||
- (dy::GrayFrame)toolGrayFrame:(FxImageTile*)tile preview:(NSDictionary**)preview error:(NSError**)error {
|
||||
@synchronized(_toolCaptureDevices){
|
||||
FxRect bounds=tile.tilePixelBounds,image=tile.imagePixelBounds;
|
||||
if(bounds.left!=image.left||bounds.right!=image.right||bounds.bottom!=image.bottom||bounds.top!=image.top)return {};
|
||||
NSNumber *key=@(tile.deviceRegistryID);NSMutableDictionary *entry=_toolCaptureDevices[key];
|
||||
if(!entry){NSArray *devices=MTLCopyAllDevices();id<MTLDevice>device=nil;for(id<MTLDevice>candidate in devices)if(candidate.registryID==tile.deviceRegistryID)device=candidate;
|
||||
if(device){id<MTLLibrary>library=[device newLibraryWithURL:[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"]error:error];id<MTLFunction>gray=[library newFunctionWithName:@"dyToolCapture"],gamma=[library newFunctionWithName:@"dyToolEncodeGamma22"];id<MTLComputePipelineState>grayPipeline=gray?[device newComputePipelineStateWithFunction:gray error:error]:nil,gammaPipeline=gamma?[device newComputePipelineStateWithFunction:gamma error:error]:nil;id<MTLCommandQueue>queue=[device newCommandQueue];MPSImageLanczosScale *scale=[[MPSImageLanczosScale alloc]initWithDevice:device];
|
||||
if(grayPipeline&&gammaPipeline&&queue&&scale){entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":device,@"gray":grayPipeline,@"gamma":gammaPipeline,@"queue":queue,@"scale":scale}];_toolCaptureDevices[key]=entry;}
|
||||
if(grayPipeline&&gammaPipeline&&queue&&scale){
|
||||
entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":device,@"gray":grayPipeline,@"gamma":gammaPipeline,@"queue":queue,@"scale":scale}];_toolCaptureDevices[key]=entry;
|
||||
id<MTLFunction>function=[library newFunctionWithName:@"dyToolTrackingPreview"];
|
||||
id<MTLComputePipelineState>pipeline=function?[device newComputePipelineStateWithFunction:function error:nil]:nil;
|
||||
entry[@"previewPipeline"]=pipeline;
|
||||
[pipeline release];[function release];
|
||||
}
|
||||
[scale release];[queue release];[grayPipeline release];[gammaPipeline release];[gray release];[gamma release];[library release];
|
||||
}[devices release];if(!entry)return {};
|
||||
}
|
||||
@@ -21,8 +30,34 @@
|
||||
id<MTLBuffer>buffer=entry[@"buffer"];if(!buffer||buffer.length!=width*height*sizeof(float)){buffer=[[device newBufferWithLength:width*height*sizeof(float) options:MTLResourceStorageModeShared]autorelease];if(!buffer)return {};entry[@"buffer"]=buffer;}
|
||||
id<MTLCommandBuffer>commands=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:entry[@"gamma"]];[encoder setTexture:source atIndex:0];[encoder setTexture:encoded atIndex:1];[encoder dispatchThreads:MTLSizeMake(source.width,source.height,1)threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];
|
||||
[entry[@"scale"]encodeToCommandBuffer:commands sourceTexture:encoded destinationTexture:bytes];
|
||||
vector_uint3 info={(unsigned)width,(unsigned)height,(unsigned)(tile.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)};encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:entry[@"gray"]];[encoder setTexture:bytes atIndex:0];[encoder setBuffer:buffer offset:0 atIndex:0];[encoder setBytes:&info length:sizeof(info)atIndex:1];[encoder dispatchThreads:MTLSizeMake(width,height,1)threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];[commands commit];[commands waitUntilCompleted];
|
||||
vector_uint3 info={(unsigned)width,(unsigned)height,(unsigned)(tile.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)};encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:entry[@"gray"]];[encoder setTexture:bytes atIndex:0];[encoder setBuffer:buffer offset:0 atIndex:0];[encoder setBytes:&info length:sizeof(info)atIndex:1];[encoder dispatchThreads:MTLSizeMake(width,height,1)threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];
|
||||
id<MTLBuffer>previewBuffer=nil;
|
||||
vector_uint3 previewInfo={0,0,info.z};
|
||||
if(preview&&entry[@"previewPipeline"]){
|
||||
double scale=std::min({1.,640./width,360./height});
|
||||
previewInfo.x=std::max(1u,(unsigned)(width*scale));previewInfo.y=std::max(1u,(unsigned)(height*scale));
|
||||
NSUInteger size=previewInfo.x*previewInfo.y*4;
|
||||
previewBuffer=entry[@"previewBuffer"];
|
||||
if(previewBuffer.length!=size){
|
||||
previewBuffer=[[device newBufferWithLength:size options:MTLResourceStorageModeShared]autorelease];
|
||||
entry[@"previewBuffer"]=previewBuffer;
|
||||
}
|
||||
if(previewBuffer){
|
||||
encoder=[commands computeCommandEncoder];
|
||||
[encoder setComputePipelineState:entry[@"previewPipeline"]];[encoder setTexture:bytes atIndex:0];
|
||||
[encoder setBuffer:previewBuffer offset:0 atIndex:0];[encoder setBytes:&previewInfo length:sizeof(previewInfo) atIndex:1];
|
||||
[encoder dispatchThreads:MTLSizeMake(previewInfo.x,previewInfo.y,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];
|
||||
[encoder endEncoding];
|
||||
}
|
||||
}
|
||||
[commands commit];[commands waitUntilCompleted];
|
||||
if(commands.status!=MTLCommandBufferStatusCompleted){if(error)*error=commands.error;return {};}
|
||||
if(previewBuffer){
|
||||
double pixelAspect=tile.pixelAspect;
|
||||
double aspect=double(width)/height*(std::isfinite(pixelAspect)&&pixelAspect>0?pixelAspect:1);
|
||||
*preview=@{@"rgba":[NSData dataWithBytes:previewBuffer.contents length:previewBuffer.length],
|
||||
@"width":@(previewInfo.x),@"height":@(previewInfo.y),@"aspect":@(aspect)};
|
||||
}
|
||||
dy::GrayFrame result{int(width),int(height),std::vector<float>(width*height)};memcpy(result.pixels.data(),buffer.contents,width*height*sizeof(float));return result;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
static const NSInteger DYCloneSourcePart=7;
|
||||
@class DYPlugIn;
|
||||
static NSMapTable *DYToolCanvasSessions(void){static NSMapTable *map;static dispatch_once_t once;dispatch_once(&once,^{map=[[NSMapTable strongToWeakObjectsMapTable]retain];});return map;}
|
||||
@interface DYPlugIn (ToolCanvas)
|
||||
@@ -5,4 +6,6 @@ static NSMapTable *DYToolCanvasSessions(void){static NSMapTable *map;static disp
|
||||
- (NSDictionary*)toolCanvasMaskAtTime:(CMTime)time;
|
||||
- (void)toolCanvasEvent:(NSEventType)type point:(NSPoint)point part:(NSInteger)part modifiers:(FxModifierKeys)modifiers key:(unichar)key time:(CMTime)time;
|
||||
- (BOOL)toolCanvasVisible;
|
||||
- (void)addCloneStampFrom:(NSPoint)source target:(NSRect)target atTime:(CMTime)time completion:(void (^)(NSString *failure))completion;
|
||||
- (void)trackCloneStamp:(NSString*)stampID direction:(NSInteger)direction;
|
||||
@end
|
||||
@@ -15,6 +15,12 @@
|
||||
NSString *_trackingNode,*_trackingMaskID,*_trackingMessage;
|
||||
NSDictionary *_trackingFrozenMask;NSMutableDictionary *_trackingCandidate;
|
||||
NSMutableArray *_trackingSamples;
|
||||
CMTimeRange _trackingPreviewInputRange;
|
||||
NSUInteger _trackingPreviewTotal,_trackingPreviewCompleted;
|
||||
NSDictionary *_trackingPreviewFrame;
|
||||
BOOL _trackingPreviewQueued;
|
||||
DYMaskParameters _trackingSeed;
|
||||
dy::OpenCVTracker _toolTracker;
|
||||
DYStampMotion _trackingStampMotion;
|
||||
dy::TrackerROI _trackingStampSourceSeed;
|
||||
dy::OpenCVTracker _toolTracker,_stampSourceTracker;
|
||||
NSMutableDictionary *_toolCaptureDevices;
|
||||
+205
-13
@@ -1,12 +1,12 @@
|
||||
- (void)initializeToolHost {
|
||||
_viewerParameterBridge=[[DYViewerParameterBridge alloc]initWithAPIManager:_apiManager];
|
||||
_viewerParameterBridge=[[DYViewerParameterBridge alloc]initWithAPIManager:_apiManager];_viewerParameterBridge.renderer=_renderer;
|
||||
_toolCaptureDevices=[NSMutableDictionary new];_toolCanvasDocument=[[[[DYToolDocument alloc]init]autorelease].document copy];_toolSourceTime=kCMTimeInvalid;_toolCanvasEditTime=kCMTimeInvalid;
|
||||
NSNotificationCenter *n=NSNotificationCenter.defaultCenter;[n addObserver:self selector:@selector(toolCanvasSelection:) name:@"DYToolCanvasSelection" object:_apiManager];[n addObserver:self selector:@selector(toolCanvasCommand:) name:@"DYToolCanvasCommand" object:_apiManager];[n addObserver:self selector:@selector(toolTrackRequested:) name:@"DYToolTrack" object:_apiManager];
|
||||
}
|
||||
- (void)tearDownToolHost {
|
||||
[_viewerParameterBridge invalidate];[_viewerParameterBridge release];_viewerParameterBridge=nil;
|
||||
[_toolAnalysisTimer invalidate];[_toolAnalysisTimer release];@synchronized(DYToolCanvasSessions()){if(_toolSession)[DYToolCanvasSessions()removeObjectForKey:_toolSession];}
|
||||
[_toolCanvasDocument release];[_toolSession release];[_selectedToolNode release];[_selectedToolMask release];[_toolCanvasDraft release];[_toolCanvasOriginal release];[_trackingNode release];[_trackingMaskID release];[_trackingFrozenMask release];[_trackingCandidate release];[_trackingSamples release];[_trackingMessage release];[_toolCaptureDevices release];
|
||||
[_toolCanvasDocument release];[_toolSession release];[_selectedToolNode release];[_selectedToolMask release];[_toolCanvasDraft release];[_toolCanvasOriginal release];[_trackingNode release];[_trackingMaskID release];[_trackingFrozenMask release];[_trackingCandidate release];[_trackingSamples release];[_trackingMessage release];[_trackingPreviewFrame release];[_toolCaptureDevices release];
|
||||
}
|
||||
- (void)adoptToolCanvasDocument:(NSDictionary*)document {
|
||||
if(!document)return;@synchronized(self){[_toolCanvasDocument release];_toolCanvasDocument=[document copy];if([self toolMask:_selectedToolMask node:_selectedToolNode document:document])return;NSString *node=nil,*maskID=nil;for(NSString *type in DYToolTypes())for(NSDictionary *mask in DYMasksForTool(document,[@"base:" stringByAppendingString:type]))if(!node&&[mask[@"enabled"]boolValue]){node=[@"base:" stringByAppendingString:type];maskID=mask[@"id"];}for(NSDictionary *layer in document[@"layers"])for(NSDictionary *mask in DYMasksForTool(document,layer[@"id"]))if(!node&&[mask[@"enabled"]boolValue]){node=layer[@"id"];maskID=mask[@"id"];}[_selectedToolNode release];_selectedToolNode=[node copy];[_selectedToolMask release];_selectedToolMask=[maskID copy];}
|
||||
@@ -19,14 +19,95 @@
|
||||
- (void)toolStatus:(NSString*)message {
|
||||
NSString *node=[[_trackingNode?:_selectedToolNode copy]autorelease],*mask=[[_trackingMaskID?:_selectedToolMask copy]autorelease];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrackingStatus" object:self->_apiManager userInfo:@{@"node":node?:@"",@"mask":mask?:@"",@"message":message?:@""}];});
|
||||
}
|
||||
- (void)postTrackingPreview:(NSDictionary*)frame active:(BOOL)active message:(NSString*)message {
|
||||
NSMutableDictionary *info=[NSMutableDictionary dictionaryWithDictionary:frame?:@{}];
|
||||
info[@"node"]=_trackingNode?:@"";info[@"mask"]=_trackingMaskID?:@"";
|
||||
info[@"tracking"]=@(active);info[@"message"]=message;
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrackingStatus" object:_apiManager userInfo:info];
|
||||
}
|
||||
- (void)publishTrackingPreview {
|
||||
NSDictionary *frame=nil;
|
||||
@synchronized(self){
|
||||
frame=[_trackingPreviewFrame autorelease];_trackingPreviewFrame=nil;_trackingPreviewQueued=NO;
|
||||
}
|
||||
if(!frame||!_trackingActive.load())return;
|
||||
NSUInteger done=[frame[@"completed"]unsignedIntegerValue],total=[frame[@"total"]unsignedIntegerValue];
|
||||
NSString *direction=[frame[@"backward"]boolValue]?@"反向":@"正向";
|
||||
NSString *message=total?[NSString stringWithFormat:@"%@ · %lu / %lu 帧 · %.0f%%",direction,(unsigned long)done,(unsigned long)total,100.*done/total]
|
||||
:[NSString stringWithFormat:@"%@ · 已分析 %lu 帧",direction,(unsigned long)done];
|
||||
[self postTrackingPreview:frame active:YES message:message];
|
||||
}
|
||||
- (void)queueTrackingPreview:(NSDictionary*)frame {
|
||||
uint64_t generation=_trackingGeneration;
|
||||
@synchronized(self){
|
||||
[_trackingPreviewFrame release];_trackingPreviewFrame=[frame copy];
|
||||
if(_trackingPreviewQueued)return;
|
||||
_trackingPreviewQueued=YES;
|
||||
}
|
||||
// Keep one coherent packet pending. A slow UI may skip intermediate updates
|
||||
// without ever pairing geometry from one frame with pixels from another.
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,NSEC_PER_SEC/30),dispatch_get_main_queue(),^{
|
||||
if(self->_trackingGeneration==generation)[self publishTrackingPreview];
|
||||
});
|
||||
}
|
||||
- (void)toolCanvasSelection:(NSNotification*)notification {
|
||||
NSString *node=notification.userInfo[@"node"],*mask=notification.userInfo[@"mask"];if(!node||!mask)return;NSDictionary *document=notification.userInfo[@"document"];if(document&&DYValidToolDocument(document)){DYToolDocument *immutable=[[[DYToolDocument alloc]init]autorelease];immutable.document=document;[self adoptToolCanvasDocument:immutable.document];}os_log(OS_LOG_DEFAULT,"dayu_tool_canvas_selected");
|
||||
@synchronized(self){if(DYSharedMaskWithID(_toolCanvasDocument,mask))node=@"shared";if(_trackingActive.load()&&(![_trackingNode isEqual:node]||![_trackingMaskID isEqual:mask])){_trackingCancelled.store(true);_trackingDiscard=YES;}[_selectedToolNode release];_selectedToolNode=[node copy];[_selectedToolMask release];_selectedToolMask=[mask copy];_toolCanvasHidden=[notification.userInfo[@"hidden"]boolValue];_toolDrawingPen=[notification.userInfo[@"draw"]boolValue];NSDictionary *shape=[self toolMask:mask node:node document:_toolCanvasDocument];DYMaskParameters shapeParameters=DYMaskAtTime(shape,kCMTimeInvalid);_toolDrawingShape=shape&&shapeParameters.kind<2&&[notification.userInfo[@"drawShape"]boolValue];if(_toolDrawingShape)_toolDrawingPen=NO;++_toolCanvasRevision;_toolCanvasEditTime=kCMTimeInvalid;_toolDragPart=0;_toolCanvasHasHover=NO;[_toolCanvasDraft release];_toolCanvasDraft=nil;[_toolCanvasOriginal release];_toolCanvasOriginal=nil;}[self postToolCanvasStatus:_toolDrawingPen?@"钢笔:点击放点,拖出曲柄;点首节点或完成绘制闭合。":_toolDrawingShape?@"在画面按下并拖出蒙版区域;Esc 取消。":@"已选中本层蒙版"];
|
||||
}
|
||||
- (void)addCloneStampFrom:(NSPoint)source target:(NSRect)target atTime:(CMTime)time completion:(void (^)(NSString *failure))completion {
|
||||
dispatch_async(dispatch_get_main_queue(),^{
|
||||
if(self->_trackingActive.load()){completion(@"请先停止跟踪,再绘制图章。");return;}
|
||||
id<FxCustomParameterActionAPI_v4>action=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];
|
||||
if(!action){completion(@"宿主暂时无法保存图章,请重试。");return;}
|
||||
NSDictionary *selection=nil;
|
||||
NSString *failure=nil;
|
||||
[action startAction:self];@try{
|
||||
// A new stamp is clip-wide. The OSC supplies geometry, while the action
|
||||
// supplies the time for accessing this instance's non-animatable document.
|
||||
CMTime writeTime=DYHostDisplayedFrameTime(self->_apiManager,action.currentTime);
|
||||
id<FxParameterRetrievalAPI_v6>get=[self->_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
|
||||
DYToolDocument *stored=nil;
|
||||
if(!CMTIME_IS_NUMERIC(writeTime)||![get getCustomParameterValue:&stored fromParameter:DYToolsParameterID atTime:writeTime]||![stored isKindOfClass:DYToolDocument.class]){
|
||||
failure=@"宿主暂时无法读取当前图章,请重试。";
|
||||
}else{
|
||||
NSMutableDictionary *doc=DYMutablePlist(stored.document);
|
||||
NSMutableDictionary *stamp=(id)DYAddSharedMask(doc,DYMaskEllipse);
|
||||
if(!stamp){
|
||||
failure=DYSharedMasks(doc).count>=DYSharedMaskLimit?@"已达到蒙版与图章数量上限。":@"无法在当前效果中创建图章。";
|
||||
}else{
|
||||
DYMaskParameters p=DYMaskAtTime(stamp,kCMTimeInvalid);
|
||||
p.centerX=NSMidX(target);p.centerY=NSMidY(target);p.width=target.size.width;p.height=target.size.height;
|
||||
stamp[@"parameters"]=[NSData dataWithBytes:&p length:sizeof(p)];
|
||||
stamp[@"stampSource"]=@[@(source.x),@(source.y),@(p.width),@(p.height)];
|
||||
id<FxUndoAPI>undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];
|
||||
BOOL grouped=[undo startUndoGroup:@"创建仿制图章"];
|
||||
@try{
|
||||
if(DYWriteTools(self->_apiManager,doc,writeTime))selection=@{@"node":@"shared",@"mask":stamp[@"id"],@"document":doc};
|
||||
else failure=@"宿主未保存图章,请重新拖出覆盖区。";
|
||||
}@finally{if(grouped)[undo endUndoGroup];}
|
||||
}
|
||||
}
|
||||
os_log(OS_LOG_DEFAULT,"dayu_clone_commit accepted=%{public}d osc=%{public}.9f action=%{public}.9f",
|
||||
selection!=nil,CMTimeGetSeconds(time),CMTimeGetSeconds(writeTime));
|
||||
}@finally{[action endAction:self];}
|
||||
if(selection){
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:self->_apiManager userInfo:selection];
|
||||
[self postToolCanvasStatus:@"仿制图章已保存 · 可跟踪取样与覆盖区域"];
|
||||
}else [self postToolCanvasStatus:failure];
|
||||
completion(failure);
|
||||
});
|
||||
}
|
||||
- (void)trackCloneStamp:(NSString*)stampID direction:(NSInteger)direction{
|
||||
if(!stampID)return;
|
||||
dispatch_async(dispatch_get_main_queue(),^{
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrack" object:self->_apiManager userInfo:@{@"node":@"shared",@"mask":stampID,@"direction":@(direction)}];
|
||||
});
|
||||
}
|
||||
- (BOOL)toolCanvasVisible {@synchronized(self){return _selectedToolNode&&_selectedToolMask&&!_toolCanvasHidden;}}
|
||||
- (DYViewerParameterBridge*)viewerParameterBridge{return _viewerParameterBridge;}
|
||||
- (NSDictionary*)toolCanvasMaskAtTime:(CMTime)time {
|
||||
@synchronized(self){if(_toolDrawingShape&&_toolCanvasDraft&&(!CMTIME_IS_NUMERIC(time)||CMTimeCompare(time,_toolCanvasEditTime)!=0)){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"播放头已移动,已取消本次框选。"];}if(_toolCanvasHidden||!_selectedToolMask)return nil;BOOL draftTime=_toolCanvasDraft&&CMTIME_IS_NUMERIC(time)&&CMTIME_IS_NUMERIC(_toolCanvasEditTime)&&CMTimeCompare(time,_toolCanvasEditTime)==0;NSDictionary *m=draftTime?_toolCanvasDraft:[self toolMask:_selectedToolMask node:_selectedToolNode document:_toolCanvasDocument];if(!m)return nil;DYMaskParameters p=DYMaskAtTime(m,time);return @{@"id":m[@"id"],@"parameters":[NSData dataWithBytes:&p length:sizeof(p)],@"nodes":(_toolDrawingPen&&!_toolCanvasDraft)?[NSData data]:(m[@"nodes"]?:[NSData data]),@"drawing":@(_toolDrawingPen),@"drawShape":@(_toolDrawingShape),@"shapeStarted":@(_toolDrawingShape&&_toolCanvasDraft!=nil),@"hover":(_toolDrawingPen&&_toolCanvasHasHover)?@[@(_toolCanvasHoverPoint.x),@(_toolCanvasHoverPoint.y)]:@[],@"coverage":@(_toolShowCoverage)};}
|
||||
@synchronized(self){if(_toolDrawingShape&&_toolCanvasDraft&&(!CMTIME_IS_NUMERIC(time)||CMTimeCompare(time,_toolCanvasEditTime)!=0)){[self discardToolCanvasDraft];[self postToolCanvasStatus:@"播放头已移动,已取消本次框选。"];}if(_toolCanvasHidden||!_selectedToolMask)return nil;BOOL draftTime=_toolCanvasDraft&&CMTIME_IS_NUMERIC(time)&&CMTIME_IS_NUMERIC(_toolCanvasEditTime)&&CMTimeCompare(time,_toolCanvasEditTime)==0;NSDictionary *m=draftTime?_toolCanvasDraft:[self toolMask:_selectedToolMask node:_selectedToolNode document:_toolCanvasDocument];if(!m)return nil;DYMaskParameters p=DYMaskAtTime(m,time);return @{@"id":m[@"id"],@"parameters":[NSData dataWithBytes:&p length:sizeof(p)],@"nodes":(_toolDrawingPen&&!_toolCanvasDraft)?[NSData data]:(m[@"nodes"]?:[NSData data]),@"drawing":@(_toolDrawingPen),@"drawShape":@(_toolDrawingShape),@"shapeStarted":@(_toolDrawingShape&&_toolCanvasDraft!=nil),@"hover":(_toolDrawingPen&&_toolCanvasHasHover)?@[@(_toolCanvasHoverPoint.x),@(_toolCanvasHoverPoint.y)]:@[],@"coverage":@(_toolShowCoverage),@"stampSource":DYStampSourceAtTime(draftTime&&_toolDragPart!=DYCloneSourcePart&&_toolCanvasOriginal?_toolCanvasOriginal:m,time)?:@[],@"tracking":@(_trackingActive.load())};}
|
||||
}
|
||||
- (void)toolTrackRequested:(NSNotification*)notification {
|
||||
NSInteger direction=[notification.userInfo[@"direction"]integerValue];if(direction==9){_trackingCancelled.store(true);return;}@synchronized(self){if(_toolDrawingPen||_toolDrawingShape||_toolCanvasCommitPending){[self postToolCanvasStatus:@"请先完成或取消蒙版绘制,再开始跟踪。"];return;}}if(_trackingActive.load()){[self toolStatus:@"请先取消当前跟踪"];return;}
|
||||
@@ -39,10 +120,29 @@
|
||||
@synchronized(self){_trackingReferenceFrame={};if(_toolSourceFrame.valid()&&CMTIME_IS_NUMERIC(_toolSourceTime)&&CMTimeCompare(_toolSourceTime,time)==0)_trackingReferenceFrame=_toolSourceFrame;}
|
||||
id<FxTimingAPI_v4>timing=[_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];NSUInteger numerator=[timing timelineFpsNumeratorForEffect:self],denominator=[timing timelineFpsDenominatorForEffect:self];_trackingFrameDuration=numerator&&denominator&&numerator<=INT32_MAX?CMTimeMake(denominator,(int32_t)numerator):kCMTimeInvalid;if(!CMTIME_IS_NUMERIC(_trackingFrameDuration)||_trackingFrameDuration.value<=0){[self toolStatus:@"宿主未提供精确帧长,跟踪未启动"];return;}
|
||||
[_trackingNode release];_trackingNode=[node copy];[_trackingMaskID release];_trackingMaskID=[notification.userInfo[@"mask"]copy];[_trackingFrozenMask release];_trackingFrozenMask=[mask copy];[_trackingCandidate release];_trackingCandidate=[DYMutablePlist(mask)retain];[_trackingSamples release];_trackingSamples=[NSMutableArray new];[_trackingMessage release];_trackingMessage=nil;
|
||||
NSArray *source=DYStampSourceAtTime(mask,time);
|
||||
_trackingStampMotion=DYStampMotionAtTime(mask,time);
|
||||
if(source){
|
||||
_trackingStampMotion.active=true;
|
||||
_trackingStampSourceSeed={[source[0] floatValue],[source[1] floatValue],
|
||||
std::min(8.f,[source[2] floatValue]*_trackingStampMotion.sourceScaleX),
|
||||
std::min(8.f,[source[3] floatValue]*_trackingStampMotion.sourceScaleY),0};
|
||||
}
|
||||
_trackingReferenceTime=time;_trackingSeed=seed;_trackingBackward=direction<0;_trackingBoth=direction==0;_trackingSingle=std::abs((int)direction)==2;_trackingDiscard=NO;_trackingCancelled.store(false);_trackingFinishing.store(false);_trackingActive.store(true);++_trackingGeneration;_trackingStarted=NSProcessInfo.processInfo.systemUptime;
|
||||
_trackingPreviewInputRange=kCMTimeRangeInvalid;_trackingPreviewTotal=_trackingPreviewCompleted=0;
|
||||
@synchronized(self){[_trackingPreviewFrame release];_trackingPreviewFrame=nil;_trackingPreviewQueued=NO;}
|
||||
os_log(OS_LOG_DEFAULT,"dayu_tool_track_start direction=%{public}ld reference=%{public}.6f cached=%{public}d",(long)direction,CMTimeGetSeconds(time),_trackingReferenceFrame.valid());
|
||||
NSError *error=nil;BOOL started=_trackingBackward?[analysis startBackwardAnalysis:kFxAnalysisLocation_GPU error:&error]:[analysis startForwardAnalysis:kFxAnalysisLocation_GPU error:&error];if(!started){_trackingActive.store(false);[self toolStatus:error.localizedDescription?:@"宿主未启动逐帧分析"];return;}
|
||||
[self toolStatus:@"正在读取宿主源帧并跟踪…"];if(!_toolAnalysisTimer)_toolAnalysisTimer=[[NSTimer scheduledTimerWithTimeInterval:.3 target:self selector:@selector(pollToolAnalysis:) userInfo:nil repeats:YES]retain];
|
||||
if(_trackingSingle)[self toolStatus:@"正在读取下一张源帧…"];
|
||||
else{
|
||||
uint64_t generation=_trackingGeneration;
|
||||
dispatch_async(dispatch_get_main_queue(),^{
|
||||
if(self->_trackingGeneration!=generation||!self->_trackingActive.load())return;
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYColorWorkspaceRequested" object:self->_apiManager userInfo:@{@"page":@"tracking"}];
|
||||
[self postTrackingPreview:nil active:YES message:@"正在读取宿主源帧…"];
|
||||
});
|
||||
}
|
||||
if(!_toolAnalysisTimer)_toolAnalysisTimer=[[NSTimer scheduledTimerWithTimeInterval:.3 target:self selector:@selector(pollToolAnalysis:) userInfo:nil repeats:YES]retain];
|
||||
}@finally{[a endAction:self];}
|
||||
}
|
||||
- (void)pollToolAnalysis:(NSTimer*)timer {
|
||||
@@ -58,34 +158,126 @@
|
||||
}
|
||||
- (BOOL)desiredAnalysisTimeRange:(CMTimeRange*)out forInputWithTimeRange:(CMTimeRange)input error:(NSError**)error {
|
||||
CMTime end=CMTimeRangeGetEnd(input),ref=_trackingReferenceTime,step=_trackingFrameDuration;if(!CMTIME_IS_NUMERIC(input.start)||!CMTIME_IS_NUMERIC(end)||!CMTIME_IS_NUMERIC(ref)||ref.epoch!=input.start.epoch||ref.epoch!=end.epoch||CMTimeCompare(ref,input.start)<0||CMTimeCompare(ref,end)>=0||!CMTIME_IS_NUMERIC(step)||step.value<=0)return [self stopToolAnalysis:@"跟踪起点或帧长无效" error:error];
|
||||
_trackingPreviewInputRange=input;
|
||||
CMTime lo=_trackingBackward?input.start:ref,hi=_trackingBackward?CMTimeAdd(ref,step):end;if(_trackingSingle){if(_trackingBackward){lo=CMTimeSubtract(ref,step);if(CMTimeCompare(lo,input.start)<0)lo=input.start;}else hi=CMTimeAdd(ref,CMTimeMultiply(step,2));}if(CMTimeCompare(hi,end)>0)hi=end;if(_trackingBackward&&CMTimeCompare(ref,input.start)==0&&!_trackingBoth){[_trackingMessage release];_trackingMessage=[@"已到片段边界,未产生新轨迹" copy];}*out=CMTimeRangeFromTimeToTime(lo,hi);return out->duration.value>0;
|
||||
}
|
||||
- (BOOL)setupAnalysisForTimeRange:(CMTimeRange)range frameDuration:(CMTime)duration error:(NSError**)error {
|
||||
if(!CMTIME_IS_NUMERIC(duration)||duration.value<=0||duration.epoch!=0)return [self stopToolAnalysis:@"宿主分析帧长无效" error:error];_trackingFrameDuration=duration;_trackingPreviousTime=kCMTimeInvalid;_trackingFlip=NO;[_trackingSamples removeAllObjects];
|
||||
std::vector<dy::FlowPoint>polygon;NSData *nodes=_trackingCandidate[@"nodes"];if(_trackingSeed.kind==DYMaskBezier){auto path=dyFlattenMask((const DYBezierNode*)nodes.bytes,nodes.length/sizeof(DYBezierNode));for(int i=0;i<path.count;i++)polygon.push_back({path.x[i],path.y[i]});}else if(_trackingSeed.kind==DYMaskRectangle)polygon={{-.5f,-.5f},{.5f,-.5f},{.5f,.5f},{-.5f,.5f}};else for(int i=0;i<128;i++){float angle=i*(2.f*M_PI/128);polygon.push_back({.5f*std::cos(angle),.5f*std::sin(angle)});}_toolTracker.setMask(std::move(polygon));return YES;
|
||||
if(!_trackingSingle&&CMTIMERANGE_IS_VALID(_trackingPreviewInputRange)){
|
||||
double step=CMTimeGetSeconds(duration);
|
||||
double forward=CMTimeGetSeconds(CMTimeSubtract(CMTimeRangeGetEnd(_trackingPreviewInputRange),_trackingReferenceTime))/step;
|
||||
double backward=CMTimeGetSeconds(CMTimeSubtract(_trackingReferenceTime,_trackingPreviewInputRange.start))/step;
|
||||
// Backward includes the reference frame. A bidirectional run counts it once.
|
||||
forward=std::max(1.,std::ceil(forward-1e-7));backward=std::floor(backward+1e-7);
|
||||
double total=_trackingBoth?forward+backward:_trackingBackward?backward+1:forward;
|
||||
_trackingPreviewTotal=NSUInteger(std::clamp(total,1.,double(INT_MAX)));
|
||||
}
|
||||
std::vector<dy::FlowPoint>polygon;NSData *nodes=_trackingCandidate[@"nodes"];if(_trackingSeed.kind==DYMaskBezier){auto path=dyFlattenMask((const DYBezierNode*)nodes.bytes,nodes.length/sizeof(DYBezierNode));for(int i=0;i<path.count;i++)polygon.push_back({path.x[i],path.y[i]});}else if(_trackingSeed.kind==DYMaskRectangle)polygon={{-.5f,-.5f},{.5f,-.5f},{.5f,.5f},{-.5f,.5f}};else for(int i=0;i<128;i++){float angle=i*(2.f*M_PI/128);polygon.push_back({.5f*std::cos(angle),.5f*std::sin(angle)});}
|
||||
if(_trackingStampMotion.active)_stampSourceTracker.setMask(polygon);
|
||||
_toolTracker.setMask(std::move(polygon));return YES;
|
||||
}
|
||||
- (BOOL)finishToolTrackingLoss:(const dy::TrackResult&)lost region:(NSString*)region atTime:(CMTime)time error:(NSError**)error {
|
||||
NSString *reason=@"区域内运动不一致";
|
||||
switch(lost.failure){
|
||||
case dy::TrackFailure::InsufficientMatches:reason=@"可用特征点不足";break;
|
||||
case dy::TrackFailure::LowConfidence:reason=@"运动可信度不足";break;
|
||||
case dy::TrackFailure::OutsideFrame:reason=@"目标已离开画面";break;
|
||||
case dy::TrackFailure::InvalidTransform:reason=@"运动变换过大";break;
|
||||
case dy::TrackFailure::Backend:case dy::TrackFailure::InvalidFrame:reason=@"源画面或跟踪引擎异常";break;
|
||||
default:break;
|
||||
}
|
||||
os_log(OS_LOG_DEFAULT,"dayu_tool_track_loss region=%{public}@ time=%{public}.6f reason=%{public}d features=%{public}d matches=%{public}d inliers=%{public}d confidence=%{public}.3f residual=%{public}.3f",region?:@"蒙版",CMTimeGetSeconds(time),(int)lost.failure,lost.features,lost.matches,lost.inliers,lost.confidence,lost.medianError);
|
||||
NSString *detail=region?[NSString stringWithFormat:@"%@失去跟踪(%@)",region,reason]:reason;
|
||||
return [self finishToolAnalysis:[NSString stringWithFormat:@"%@,已保留 %lu 帧可信轨迹;可调整区域后从此处继续",detail,(unsigned long)_trackingSamples.count] error:error];
|
||||
}
|
||||
- (BOOL)analyzeFrame:(FxImageTile*)tile atTime:(CMTime)time error:(NSError**)error {
|
||||
if(!_trackingActive.load()||_trackingFinishing.load()){if(error)*error=[NSError errorWithDomain:FxPlugErrorDomain code:kFxError_UserCancelled userInfo:nil];return NO;}_trackingInFrame.store(true);@try{
|
||||
if(_trackingCancelled.load())return [self finishToolAnalysis:@"已取消;保留最后连续可信轨迹" error:error];if(_trackingSingle&&_trackingSamples.count>=2)return [self finishToolAnalysis:nil error:error];if(_trackingSamples.count>=DYToolKeyLimit)return [self finishToolAnalysis:@"轨迹已到数量上限,保留已完成部分" error:error];
|
||||
CMTime expected=CMTIME_IS_NUMERIC(_trackingPreviousTime)?(_trackingBackward?CMTimeSubtract(_trackingPreviousTime,_trackingFrameDuration):CMTimeAdd(_trackingPreviousTime,_trackingFrameDuration)):_trackingReferenceTime;if(!CMTIME_IS_NUMERIC(time)||time.epoch!=expected.epoch||CMTimeCompare(time,expected)!=0)return [self stopToolAnalysis:@"宿主帧序列不连续,停在最后可信帧" error:error];
|
||||
dy::GrayFrame frame=[self toolGrayFrame:tile error:error];if(!frame.valid())return [self stopToolAnalysis:@"宿主未返回完整源画面" error:error];
|
||||
NSDictionary *preview=nil;
|
||||
dy::GrayFrame frame=[self toolGrayFrame:tile preview:_trackingSingle?nullptr:&preview error:error];
|
||||
if(!frame.valid())return [self stopToolAnalysis:@"宿主未返回完整源画面" error:error];
|
||||
if(!_trackingSamples.count){if(_trackingReferenceFrame.valid()&&frame.width==_trackingReferenceFrame.width&&frame.height==_trackingReferenceFrame.height){double same=0,flip=0;size_t count=0;for(int y=0;y<frame.height;y+=8)for(int x=0;x<frame.width;x+=8){float p=frame.pixels[y*frame.width+x];same+=fabs(p-_trackingReferenceFrame.pixels[y*frame.width+x]);flip+=fabs(p-_trackingReferenceFrame.pixels[(frame.height-1-y)*frame.width+x]);count++;}same/=MAX(size_t(1),count);flip/=MAX(size_t(1),count);_trackingFlip=flip<.035&&flip+.008<same&&flip<same*.8;}os_log(OS_LOG_DEFAULT,"dayu_tool_track_seed width=%{public}d height=%{public}d flip=%{public}d time=%{public}.6f",frame.width,frame.height,(int)_trackingFlip,CMTimeGetSeconds(time));}
|
||||
if(_trackingFlip)for(int y=0;y<frame.height/2;y++)for(int x=0;x<frame.width;x++)std::swap(frame.pixels[y*frame.width+x],frame.pixels[(frame.height-1-y)*frame.width+x]);
|
||||
if(!_trackingSamples.count){if(!_toolTracker.reset(frame,{_trackingSeed.centerX,_trackingSeed.centerY,_trackingSeed.width,_trackingSeed.height,_trackingSeed.angle}))return [self finishToolAnalysis:@"蒙版内纹理不足,原蒙版已保留" error:error];}else if(!_toolTracker.track(frame).valid){auto lost=_toolTracker.result();NSString *reason=@"区域内运动不一致";switch(lost.failure){case dy::TrackFailure::InsufficientMatches:reason=@"可用特征点不足";break;case dy::TrackFailure::LowConfidence:reason=@"运动可信度不足";break;case dy::TrackFailure::OutsideFrame:reason=@"目标已离开画面";break;case dy::TrackFailure::InvalidTransform:reason=@"运动变换过大";break;case dy::TrackFailure::Backend:case dy::TrackFailure::InvalidFrame:reason=@"源画面或跟踪引擎异常";break;default:break;}os_log(OS_LOG_DEFAULT,"dayu_tool_track_loss time=%{public}.6f reason=%{public}d features=%{public}d matches=%{public}d inliers=%{public}d confidence=%{public}.3f residual=%{public}.3f",CMTimeGetSeconds(time),(int)lost.failure,lost.features,lost.matches,lost.inliers,lost.confidence,lost.medianError);return [self finishToolAnalysis:[NSString stringWithFormat:@"%@,已保留 %lu 帧可信轨迹;可调整蒙版后从此处继续",reason,(unsigned long)_trackingSamples.count] error:error];}
|
||||
auto result=_toolTracker.result();DYMaskParameters p=DYMaskAtTime(_trackingFrozenMask,time);p.centerX=result.cx;p.centerY=result.cy;p.width=_trackingSeed.width*result.scaleX;p.height=_trackingSeed.height*result.scaleY;p.angle=_trackingSeed.angle+result.rotation;if(!dyValidMaskParameters(p))return [self stopToolAnalysis:@"跟踪变换无效,未写入错误结果" error:error];[_trackingSamples addObject:DYMaskKey(time,p,NO,result.confidence)];_trackingPreviousTime=time;
|
||||
if(_trackingSamples.count==1||_trackingSamples.count%15==0)[self toolStatus:[NSString stringWithFormat:@"已分析 %lu 帧 · 置信度 %.0f%%",(unsigned long)_trackingSamples.count,result.confidence*100]];return YES;
|
||||
BOOL stamp=_trackingStampMotion.active;
|
||||
dy::TrackResult target,source;
|
||||
if(!_trackingSamples.count){
|
||||
dy::TrackerROI targetROI={_trackingSeed.centerX,_trackingSeed.centerY,_trackingSeed.width,_trackingSeed.height,_trackingSeed.angle};
|
||||
if(!_toolTracker.reset(frame,targetROI))
|
||||
return [self finishToolAnalysis:stamp?@"覆盖区域内纹理不足,原图章已保留":@"蒙版内纹理不足,原蒙版已保留" error:error];
|
||||
if(stamp&&!_stampSourceTracker.reset(frame,_trackingStampSourceSeed))
|
||||
return [self finishToolAnalysis:@"取样区域内纹理不足,原图章已保留" error:error];
|
||||
target=_toolTracker.result();
|
||||
if(stamp)source=_stampSourceTracker.result();
|
||||
}else{
|
||||
target=_toolTracker.track(frame);
|
||||
if(!target.valid)return [self finishToolTrackingLoss:target region:stamp?@"覆盖区域":nil atTime:time error:error];
|
||||
if(stamp){
|
||||
source=_stampSourceTracker.track(frame);
|
||||
if(!source.valid)return [self finishToolTrackingLoss:source region:@"取样区域" atTime:time error:error];
|
||||
}
|
||||
}
|
||||
DYMaskParameters p=DYMaskAtTime(_trackingFrozenMask,stamp?kCMTimeInvalid:time);
|
||||
p.centerX=target.cx;p.centerY=target.cy;
|
||||
float confidence=target.confidence;
|
||||
DYStampMotion motion=_trackingStampMotion;
|
||||
if(stamp){
|
||||
NSArray *authoredSource=_trackingFrozenMask[@"stampSource"];
|
||||
motion.sourceOffsetX=source.cx-[authoredSource[0] floatValue];
|
||||
motion.sourceOffsetY=source.cy-[authoredSource[1] floatValue];
|
||||
motion.sourceScaleX*=source.scaleX;motion.sourceScaleY*=source.scaleY;
|
||||
motion.targetScaleX*=target.scaleX;motion.targetScaleY*=target.scaleY;
|
||||
for(float scale:{motion.sourceScaleX,motion.sourceScaleY,motion.targetScaleX,motion.targetScaleY})
|
||||
if(!std::isfinite(scale)||scale<1.f/16||scale>16.f)
|
||||
return [self finishToolAnalysis:@"图章缩放超出跟踪范围,已保留连续可信轨迹" error:error];
|
||||
confidence=std::min(confidence,source.confidence);
|
||||
}else{
|
||||
p.width=_trackingSeed.width*target.scaleX;p.height=_trackingSeed.height*target.scaleY;
|
||||
p.angle=_trackingSeed.angle+target.rotation;
|
||||
}
|
||||
if(!dyValidMaskParameters(p))return [self stopToolAnalysis:@"跟踪变换无效,未写入错误结果" error:error];
|
||||
[_trackingSamples addObject:DYStampKey(time,p,NO,confidence,motion)];_trackingPreviousTime=time;
|
||||
if(!_trackingSingle){
|
||||
if(!(_trackingBoth&&_trackingBackward&&_trackingSamples.count==1&&_trackingPreviewCompleted))++_trackingPreviewCompleted;
|
||||
DYMaskParameters covered=p;
|
||||
NSMutableDictionary *packet=[NSMutableDictionary dictionaryWithDictionary:preview?:@{}];
|
||||
if(stamp){
|
||||
covered.width*=motion.targetScaleX;covered.height*=motion.targetScaleY;
|
||||
DYMaskParameters sampled=covered;
|
||||
sampled.centerX=source.cx;sampled.centerY=source.cy;
|
||||
sampled.width=_trackingStampSourceSeed.width*source.scaleX;
|
||||
sampled.height=_trackingStampSourceSeed.height*source.scaleY;
|
||||
packet[@"sourceShape"]=[NSData dataWithBytes:&sampled length:sizeof(sampled)];
|
||||
}
|
||||
packet[@"shape"]=[NSData dataWithBytes:&covered length:sizeof(covered)];
|
||||
packet[@"nodes"]=_trackingFrozenMask[@"nodes"];
|
||||
packet[@"flip"]=@(_trackingFlip);packet[@"time"]=@(CMTimeGetSeconds(time));
|
||||
packet[@"completed"]=@(_trackingPreviewCompleted);
|
||||
packet[@"total"]=@(MAX(_trackingPreviewTotal,_trackingPreviewCompleted));
|
||||
packet[@"backward"]=@(_trackingBackward);
|
||||
[self queueTrackingPreview:packet];
|
||||
}
|
||||
if(_trackingSamples.count==1||_trackingSamples.count%15==0){
|
||||
if(stamp)os_log(OS_LOG_DEFAULT,"dayu_stamp_track_pair time=%{public}.6f target=%{public}.5f,%{public}.5f source=%{public}.5f,%{public}.5f target_scale=%{public}.4f,%{public}.4f source_scale=%{public}.4f,%{public}.4f",CMTimeGetSeconds(time),target.cx,target.cy,source.cx,source.cy,motion.targetScaleX,motion.targetScaleY,motion.sourceScaleX,motion.sourceScaleY);
|
||||
}
|
||||
return YES;
|
||||
}@finally{_trackingInFrame.store(false);}
|
||||
}
|
||||
- (BOOL)cleanupAnalysis:(NSError**)error {
|
||||
if(!_trackingActive.load()||_trackingFinishing.exchange(true))return YES;BOOL changed=_trackingSamples.count>1;if(changed&&!DYMergeTracking(_trackingCandidate,_trackingSamples)){[_trackingMessage release];_trackingMessage=[@"轨迹合并失败,原蒙版已保留" copy];_trackingDiscard=YES;}
|
||||
if(!_trackingActive.load()||_trackingFinishing.exchange(true))return YES;BOOL changed=_trackingSamples.count>1;if(changed&&!DYMergeTracking(_trackingCandidate,_trackingSamples,_trackingFrameDuration)){[_trackingMessage release];_trackingMessage=[@"轨迹合并失败,原蒙版已保留" copy];_trackingDiscard=YES;}
|
||||
_toolTracker.stop();
|
||||
if(_trackingStampMotion.active)_stampSourceTracker.stop();
|
||||
uint64_t generation=_trackingGeneration;BOOL second=_trackingBoth&&!_trackingBackward&&!_trackingCancelled.load()&&!_trackingDiscard;
|
||||
dispatch_async(dispatch_get_main_queue(),^{if(self->_trackingGeneration!=generation)return;
|
||||
if(!self->_trackingSingle)[self publishTrackingPreview];
|
||||
if(second){self->_trackingBackward=YES;self->_trackingFinishing.store(false);self->_trackingStarted=NSProcessInfo.processInfo.systemUptime;id<FxCustomParameterActionAPI_v4>a=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];BOOL started=NO;if(a){[a startAction:self];@try{started=[[self->_apiManager apiForProtocol:@protocol(FxAnalysisAPI)]startBackwardAnalysis:kFxAnalysisLocation_GPU error:nil];}@finally{[a endAction:self];}}if(started){[self toolStatus:@"正向完成,正在从同一起点反向跟踪…"];return;}self->_trackingFinishing.store(true);}
|
||||
BOOL hasResults=![self->_trackingCandidate[@"keys"]isEqual:self->_trackingFrozenMask[@"keys"]];NSString *message=self->_trackingMessage?:[NSString stringWithFormat:@"%@跟踪完成 · %lu 个轨迹键",self->_trackingBoth?@"双向":(self->_trackingBackward?@"反向":@"正向"),(unsigned long)[self->_trackingCandidate[@"keys"]count]];
|
||||
if(hasResults&&!self->_trackingDiscard){id<FxCustomParameterActionAPI_v4>a=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(a){[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(self->_apiManager,a.currentTime).document);NSString *node=DYSharedMaskWithID(doc,self->_trackingMaskID)?@"shared":self->_trackingNode;NSMutableDictionary *mask=[self toolMask:self->_trackingMaskID node:node document:doc];if(mask&&[mask isEqual:self->_trackingFrozenMask]){self->_trackingCandidate[@"status"]=message;[mask setDictionary:self->_trackingCandidate];id<FxUndoAPI>undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"蒙版区域跟踪"];BOOL written=DYWriteTools(self->_apiManager,doc,a.currentTime);[undo endUndoGroup];if(!written)message=@"宿主未接受轨迹,原蒙版已保留";}else message=@"目标工具或蒙版已更改,已丢弃过期跟踪结果";}@finally{[a endAction:self];}}}
|
||||
if(hasResults&&!self->_trackingDiscard){id<FxCustomParameterActionAPI_v4>a=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(a){[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(self->_apiManager,a.currentTime).document);NSString *node=DYSharedMaskWithID(doc,self->_trackingMaskID)?@"shared":self->_trackingNode;NSMutableDictionary *mask=[self toolMask:self->_trackingMaskID node:node document:doc];if(mask&&[mask isEqual:self->_trackingFrozenMask]){self->_trackingCandidate[@"status"]=message;[mask setDictionary:self->_trackingCandidate];id<FxUndoAPI>undo=[self->_apiManager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:mask[@"stampSource"]?@"仿制图章跟踪":@"蒙版区域跟踪"];BOOL written=DYWriteTools(self->_apiManager,doc,a.currentTime);[undo endUndoGroup];if(!written)message=@"宿主未接受轨迹,原蒙版已保留";}else message=@"目标工具或蒙版已更改,已丢弃过期跟踪结果";}@finally{[a endAction:self];}}}
|
||||
CMTime stepTime=self->_trackingPreviousTime;BOOL advance=self->_trackingSingle&&changed&&!self->_trackingDiscard&&!self->_trackingCancelled.load()&&CMTIME_IS_NUMERIC(stepTime);
|
||||
@synchronized(self->_toolCaptureDevices){for(NSMutableDictionary *entry in self->_toolCaptureDevices.allValues)[entry removeObjectsForKeys:@[@"encoded",@"bytes",@"buffer"]];}
|
||||
self->_trackingActive.store(false);if(advance){id<FxCustomParameterActionAPI_v4>seek=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(seek){[seek startAction:self];@try{id<FxTimingAPI_v4>timing=[self->_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];CMTime timelineTime=kCMTimeInvalid;[timing timelineTime:&timelineTime fromInputTime:stepTime];id<FxCommandAPI_v2>command=[self->_apiManager apiForProtocol:@protocol(FxCommandAPI_v2)];if(CMTIME_IS_NUMERIC(timelineTime)){NSError *seekError=nil;BOOL moved=[command movePlayheadToTime:timelineTime error:&seekError];if(!moved)os_log(OS_LOG_DEFAULT,"dayu_tool_track_seek timeline=%{public}.6f code=%{public}ld",CMTimeGetSeconds(timelineTime),(long)seekError.code);}else message=[message stringByAppendingString:@";宿主未提供有效播放头位置"];}@finally{[seek endAction:self];}}}[self->_toolAnalysisTimer invalidate];[self->_toolAnalysisTimer release];self->_toolAnalysisTimer=nil;[self toolStatus:message];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
|
||||
@synchronized(self->_toolCaptureDevices){for(NSMutableDictionary *entry in self->_toolCaptureDevices.allValues)[entry removeObjectsForKeys:@[@"encoded",@"bytes",@"buffer",@"previewBuffer"]];}
|
||||
self->_trackingActive.store(false);if(advance){id<FxCustomParameterActionAPI_v4>seek=[self->_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(seek){[seek startAction:self];@try{id<FxTimingAPI_v4>timing=[self->_apiManager apiForProtocol:@protocol(FxTimingAPI_v4)];CMTime timelineTime=kCMTimeInvalid;[timing timelineTime:&timelineTime fromInputTime:stepTime];id<FxCommandAPI_v2>command=[self->_apiManager apiForProtocol:@protocol(FxCommandAPI_v2)];if(CMTIME_IS_NUMERIC(timelineTime)){NSError *seekError=nil;BOOL moved=[command movePlayheadToTime:timelineTime error:&seekError];if(!moved)os_log(OS_LOG_DEFAULT,"dayu_tool_track_seek timeline=%{public}.6f code=%{public}ld",CMTimeGetSeconds(timelineTime),(long)seekError.code);}else message=[message stringByAppendingString:@";宿主未提供有效播放头位置"];}@finally{[seek endAction:self];}}}[self->_toolAnalysisTimer invalidate];[self->_toolAnalysisTimer release];self->_toolAnalysisTimer=nil;[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
|
||||
if(self->_trackingSingle)[self toolStatus:message];
|
||||
else [self postTrackingPreview:nil active:NO message:message];
|
||||
});return YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
NSString *addedID=nil;@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);if([doc[@"layers"]count]>=DYToolLimit){[self showError:@"最多可添加 32 个独立工具层。"];return;}NSString *type=_cards[sender.tag][@"section"][@"key"],*anchor=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:type];NSMutableDictionary *node=(id)DYInsertTool(doc,type,anchor);if(!node)return;if(DYPrimaryColorState(DYReadAssets(host,a.currentTime).colorManagement)){DYUniforms root;DYReadUniforms(host,a.currentTime,&root);DYSeedPrimaryWorkingSpace(node,root.cm.workingTransfer,root.cm.workingGamut);}addedID=[node[@"id"]copy];id<FxUndoAPI>undo=[host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"再加一层初始化工具"];DYWriteTools(host,doc,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host userInfo:@{@"scrollToTool":addedID?:@""}];[addedID release];
|
||||
}
|
||||
- (void)revealViewerTool:(NSNotification*)note {
|
||||
if(_embedded||![DYToolTypes()containsObject:note.userInfo[@"type"]])return;NSString *type=note.userInfo[@"type"];id<FxCustomParameterActionAPI_v4>a=[self actionAPI];[a startAction:self];@try{DYInspectorToken *old=nil;[[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:a.currentTime];DYInspectorToken *token=old?[[old copy]autorelease]:[[[DYInspectorToken alloc]init]autorelease];NSMutableDictionary *folds=[[token.folds mutableCopy]autorelease];folds[[@"visible:" stringByAppendingString:type]]=@YES;token.folds=folds;[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:a.currentTime];
|
||||
if(_embedded||![DYToolTypes()containsObject:note.userInfo[@"type"]])return;NSString *type=note.userInfo[@"type"];id<FxCustomParameterActionAPI_v4>a=[self actionAPI];[a startAction:self];@try{DYInspectorToken *old=nil;[[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:a.currentTime];DYInspectorToken *token=old?[[old copy]autorelease]:[[[DYInspectorToken alloc]init]autorelease];NSString *visible=[@"visible:" stringByAppendingString:type];if(![token.folds[visible]boolValue]){NSMutableDictionary *folds=[[token.folds mutableCopy]autorelease];folds[visible]=@YES;token.folds=folds;[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:a.currentTime];}
|
||||
NSMutableDictionary *doc=DYMutablePlist(DYReadTools(_manager,a.currentTime).document);if(DYBaseToolRemoved(doc,type)){BOOL existing=NO;for(NSDictionary*n in doc[@"layers"])if([n[@"type"]isEqual:type])existing=YES;if(!existing){id<FxUndoAPI>undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];if([undo startUndoGroup:@"添加画布工具"]){DYInsertTool(doc,type,[@"base:" stringByAppendingString:type]);DYWriteTools(_manager,doc,a.currentTime);[undo endUndoGroup];}}}
|
||||
}@finally{[a endAction:self];}[self refresh];[self setNeedsLayout:YES];
|
||||
}
|
||||
|
||||
+120
-11
@@ -5,9 +5,12 @@
|
||||
@implementation DYToolOSC {
|
||||
id<MTLDevice> _device;id<MTLCommandQueue> _queue;CIContext *_context;
|
||||
DYViewerControls *_viewerControls;CGFloat _height,_canvasWidth,_uiScale;BOOL _maskCapturing;DYPlugIn *_maskCaptureOwner;NSRect _imageRect;NSDictionary *_mask;NSMutableArray *_handles;NSBezierPath *_outline;NSInteger _lastRoute;NSUInteger _drawCount,_hitDiagnostics,_eventDiagnostics;
|
||||
BOOL _stampHasSource,_stampDragging,_stampSaving,_stampNeedsRedraw;
|
||||
NSPoint _stampSource,_stampStart,_stampEnd;
|
||||
NSString *_stampFailure;
|
||||
}
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager{if((self=[super init])){_apiManager=manager;_viewerControls=[DYViewerControls new];_handles=[NSMutableArray new];_lastRoute=-1;_uiScale=1;os_log(OS_LOG_DEFAULT,"dayu_tool_osc_init");}return self;}
|
||||
- (void)dealloc{[_viewerControls release];[_device release];[_queue release];[_context release];[_mask release];[_handles release];[_outline release];[super dealloc];}
|
||||
- (void)dealloc{[_viewerControls release];[_device release];[_queue release];[_context release];[_mask release];[_handles release];[_outline release];[_stampFailure release];[super dealloc];}
|
||||
- (FxDrawingCoordinates)drawingCoordinates{return kFxDrawingCoordinates_CANVAS;}
|
||||
- (DYPlugIn*)pluginAtTime:(CMTime)time{NSString *value=nil;id<FxParameterRetrievalAPI_v6>get=[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];[get getStringParameterValue:&value fromParameter:DYCanvasSessionParameterID];@synchronized(DYToolCanvasSessions()){return [DYToolCanvasSessions()objectForKey:value];}}
|
||||
- (NSPoint)canvasPoint:(float)x y:(float)y parameters:(DYMaskParameters)p{
|
||||
@@ -15,11 +18,57 @@
|
||||
}
|
||||
- (void)addHandle:(NSPoint)p part:(NSInteger)part{[_handles addObject:@{@"point":[NSValue valueWithPoint:p],@"part":@(part)}];}
|
||||
- (NSRect)toolbarRectForItem:(NSInteger)item{
|
||||
// Only the two temporary pen actions remain. The permanent tools live in the
|
||||
// transparent left rail; the middle of the bottom edge opens the workspace.
|
||||
// Keep the temporary pen actions clear of the permanent tool rail.
|
||||
if(![_mask[@"drawing"]boolValue]||(item!=9&&item!=10))return NSZeroRect;
|
||||
NSRect v=NSIntersectionRect(_imageRect,NSMakeRect(0,0,_canvasWidth,_height));CGFloat scale=MAX(.01,MIN(_uiScale,MIN(v.size.width/300.,v.size.height/100.)));
|
||||
return NSMakeRect(NSMidX(v)+(item==9?-144:80)*scale,NSMaxY(v)-32*scale,64*scale,24*scale);
|
||||
return NSMakeRect(NSMinX(v)+(item==9?8:76)*scale,NSMaxY(v)-61*scale,64*scale,24*scale);
|
||||
}
|
||||
- (void)clearStampCreation{
|
||||
_stampHasSource=_stampDragging=NO;
|
||||
[_stampFailure release];_stampFailure=nil;
|
||||
}
|
||||
- (NSRect)stampControlRect:(NSInteger)index{
|
||||
NSRect viewport=NSIntersectionRect(_imageRect,NSMakeRect(0,0,_canvasWidth,_height));
|
||||
CGFloat scale=MIN(_uiScale,viewport.size.width/360.);
|
||||
return NSMakeRect(NSMinX(viewport)+(8+82*index)*scale,NSMaxY(viewport)-62*scale,78*scale,25*scale);
|
||||
}
|
||||
- (NSRect)stampTarget{
|
||||
return NSMakeRect(MIN(_stampStart.x,_stampEnd.x),MIN(_stampStart.y,_stampEnd.y),fabs(_stampStart.x-_stampEnd.x),fabs(_stampStart.y-_stampEnd.y));
|
||||
}
|
||||
- (NSPoint)canvasStampSource:(NSPoint)source{
|
||||
return NSMakePoint(NSMinX(_imageRect)+source.x*NSWidth(_imageRect),NSMinY(_imageRect)+source.y*NSHeight(_imageRect));
|
||||
}
|
||||
- (void)drawStampSource:(NSPoint)source{
|
||||
NSPoint p=[self canvasStampSource:source];
|
||||
CGFloat r=8*_uiScale;
|
||||
NSBezierPath *mark=[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(p.x-r,p.y-r,2*r,2*r)];
|
||||
[mark moveToPoint:NSMakePoint(p.x-r,p.y)];[mark lineToPoint:NSMakePoint(p.x+r,p.y)];
|
||||
[mark moveToPoint:NSMakePoint(p.x,p.y-r)];[mark lineToPoint:NSMakePoint(p.x,p.y+r)];
|
||||
[NSColor.blackColor setStroke];mark.lineWidth=3.5*_uiScale;[mark stroke];
|
||||
[NSColor.systemCyanColor setStroke];mark.lineWidth=1.5*_uiScale;[mark stroke];
|
||||
}
|
||||
- (void)drawStampControls{
|
||||
NSArray *source=_mask[@"stampSource"];
|
||||
if(_viewerControls.stampArmed){
|
||||
NSRect cell=NSUnionRect([self stampControlRect:0],[self stampControlRect:3]);
|
||||
DYDrawSoftControl(cell,4,NO,NO,NO);
|
||||
NSString *prompt=_stampSaving?@"正在保存仿制图章…":_stampFailure?:(_stampHasSource?@"拖出要覆盖的椭圆 · Esc 取消":@"点击画面选择取样中心 · Esc 取消");
|
||||
[prompt drawInRect:NSInsetRect(cell,6,4) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:MAX(8.,NSHeight(cell)*.48)]}];
|
||||
if(_stampHasSource)[self drawStampSource:_stampSource];
|
||||
if(_stampDragging||_stampSaving||_stampFailure){
|
||||
NSRect target=[self stampTarget];
|
||||
NSRect oval=NSMakeRect(NSMinX(_imageRect)+target.origin.x*NSWidth(_imageRect),NSMinY(_imageRect)+target.origin.y*NSHeight(_imageRect),target.size.width*NSWidth(_imageRect),target.size.height*NSHeight(_imageRect));
|
||||
NSBezierPath *outline=[NSBezierPath bezierPathWithOvalInRect:oval];outline.lineWidth=2*_uiScale;[NSColor.systemCyanColor setStroke];[outline stroke];
|
||||
}
|
||||
}else if(source.count==4){
|
||||
[self drawStampSource:NSMakePoint([source[0]doubleValue],[source[1]doubleValue])];
|
||||
BOOL tracking=[_mask[@"tracking"]boolValue];
|
||||
NSArray *titles=tracking?@[@"停止跟踪"]:@[@"向后跟踪",@"双向跟踪",@"向前跟踪"];
|
||||
for(NSUInteger i=0;i<titles.count;i++){
|
||||
NSRect cell=[self stampControlRect:i];DYDrawSoftControl(cell,4,NO,NO,NO);
|
||||
[titles[i] drawInRect:NSInsetRect(cell,6,4) withAttributes:@{NSForegroundColorAttributeName:NSColor.whiteColor,NSFontAttributeName:[NSFont systemFontOfSize:MAX(8.,NSHeight(cell)*.48)]}];
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)drawOSCWithWidth:(NSInteger)width height:(NSInteger)height activePart:(NSInteger)activePart destinationImage:(FxImageTile*)destination atTime:(CMTime)time {@synchronized(self){@autoreleasepool{
|
||||
if(!_device||_device.registryID!=destination.deviceRegistryID){[_device release];_device=nil;NSArray *devices=MTLCopyAllDevices();for(id<MTLDevice>d in devices)if(d.registryID==destination.deviceRegistryID)_device=[d retain];[devices release];[_queue release];_queue=[_device newCommandQueue];[_context release];_context=_device?[[CIContext contextWithMTLDevice:_device options:@{kCIContextWorkingColorSpace:NSNull.null,kCIContextOutputColorSpace:NSNull.null}]retain]:nil;}
|
||||
@@ -29,7 +78,13 @@
|
||||
DYPlugIn *plugin=[self pluginAtTime:time];NSDictionary *mask=[plugin toolCanvasMaskAtTime:time];NSInteger route=(plugin?1:0)+(mask?2:0);if(route!=_lastRoute||_drawCount++<2){_lastRoute=route;os_log(OS_LOG_DEFAULT,"dayu_tool_osc_route plugin=%{public}d mask=%{public}d width=%{public}.2f height=%{public}.2f",plugin!=nil,mask!=nil,_imageRect.size.width,_imageRect.size.height);}[_mask release];_mask=[mask copy];[_handles removeAllObjects];[_outline release];_outline=nil;
|
||||
[_viewerControls setBridge:[plugin viewerParameterBridge]];[_viewerControls setViewport:_imageRect];[_viewerControls prepareWithSize:NSMakeSize(canvasWidth,_height) scale:_uiScale atTime:time];
|
||||
if(plugin&&canvasWidth>0&&_height>0&&canvasWidth<16384&&_height<16384&&_imageRect.size.width>0&&_imageRect.size.height>0){
|
||||
NSBitmapImageRep *bitmap=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)canvasWidth pixelsHigh:(NSInteger)_height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:(NSInteger)canvasWidth*4 bitsPerPixel:32]autorelease];memset(bitmap.bitmapData,0,bitmap.bytesPerRow*bitmap.pixelsHigh);[NSGraphicsContext saveGraphicsState];[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];NSAffineTransform *flip=[NSAffineTransform transform];[flip translateXBy:0 yBy:_height];[flip scaleXBy:1 yBy:-1];[flip concat];
|
||||
NSRect region=mask||_viewerControls.stampArmed?NSMakeRect(0,0,canvasWidth,_height):NSIntegralRect([_viewerControls drawingBounds]);
|
||||
if(NSIsEmptyRect(region)){[commands commit];[commands waitUntilCompleted];return;}
|
||||
NSBitmapImageRep *bitmap=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)NSWidth(region) pixelsHigh:(NSInteger)NSHeight(region) bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:(NSInteger)NSWidth(region)*4 bitsPerPixel:32]autorelease];
|
||||
if(!bitmap){[commands commit];[commands waitUntilCompleted];return;}
|
||||
memset(bitmap.bitmapData,0,bitmap.bytesPerRow*bitmap.pixelsHigh);
|
||||
[NSGraphicsContext saveGraphicsState];[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];
|
||||
NSAffineTransform *flip=[NSAffineTransform transform];[flip translateXBy:-NSMinX(region) yBy:NSMaxY(region)];[flip scaleXBy:1 yBy:-1];[flip concat];
|
||||
// Match AppKit text/image drawing to the top-down canvas CTM.
|
||||
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithCGContext:NSGraphicsContext.currentContext.CGContext flipped:YES]];
|
||||
if(mask){BOOL blankShape=[mask[@"drawShape"]boolValue]&&![mask[@"shapeStarted"]boolValue];DYMaskParameters p;[mask[@"parameters"]getBytes:&p length:sizeof(p)];p.imageAspect=_imageRect.size.width/_imageRect.size.height;_outline=[[NSBezierPath bezierPath]retain];
|
||||
@@ -40,20 +95,31 @@
|
||||
else if(p.kind==DYMaskLinearGradient){[_outline moveToPoint:[self canvasPoint:0 y:-2 parameters:p]];[_outline lineToPoint:[self canvasPoint:0 y:2 parameters:p]];}
|
||||
if([mask[@"coverage"]boolValue]&&p.kind<3){[[NSColor colorWithCalibratedRed:1 green:.7 blue:.05 alpha:.2]setFill];[_outline fill];}
|
||||
[[NSColor colorWithWhite:0 alpha:.8]setStroke];_outline.lineWidth=3.5*_uiScale;[_outline stroke];[[NSColor colorWithCalibratedRed:1 green:.8 blue:.15 alpha:1]setStroke];_outline.lineWidth=1.5*_uiScale;[_outline stroke];
|
||||
if(p.kind<4&&![mask[@"drawing"]boolValue]&&![mask[@"drawShape"]boolValue]){[self addHandle:[self canvasPoint:0 y:0 parameters:p] part:1];if(p.kind!=DYMaskBezier){for(int i=0;i<4;i++)[self addHandle:[self canvasPoint:((float[]){-.5,.5,.5,-.5})[i] y:((float[]){-.5,-.5,.5,.5})[i] parameters:p] part:2+i];}[self addHandle:[self canvasPoint:0 y:-.68 parameters:p] part:6];}
|
||||
if(p.kind<4&&![mask[@"drawing"]boolValue]&&![mask[@"drawShape"]boolValue]){[self addHandle:[self canvasPoint:0 y:0 parameters:p] part:1];if(p.kind!=DYMaskBezier){for(int i=0;i<4;i++)[self addHandle:[self canvasPoint:((float[]){-.5,.5,.5,-.5})[i] y:((float[]){-.5,-.5,.5,.5})[i] parameters:p] part:2+i];}if(![mask[@"stampSource"]count])[self addHandle:[self canvasPoint:0 y:-.68 parameters:p] part:6];}
|
||||
for(NSDictionary *handle in _handles){NSPoint point=[handle[@"point"]pointValue];NSRect rect=NSMakeRect(point.x-4*_uiScale,point.y-4*_uiScale,8*_uiScale,8*_uiScale);[[NSColor colorWithWhite:.1 alpha:1]setFill];[[NSBezierPath bezierPathWithOvalInRect:rect]fill];[NSColor.whiteColor setStroke];[[NSBezierPath bezierPathWithOvalInRect:rect]stroke];}
|
||||
if([mask[@"drawing"]boolValue]){
|
||||
NSShadow *shadow=[[[NSShadow alloc]init]autorelease];shadow.shadowColor=[NSColor colorWithWhite:0 alpha:.95];shadow.shadowBlurRadius=2;shadow.shadowOffset=NSZeroSize;
|
||||
NSMutableParagraphStyle *style=[[[NSMutableParagraphStyle alloc]init]autorelease];style.alignment=NSTextAlignmentCenter;
|
||||
for(NSInteger item=9;item<=10;item++){NSString *title=item==9?@"✓ 完成":@"取消";NSRect cell=[self toolbarRectForItem:item];CGFloat size=cell.size.height*.48;[title drawInRect:NSInsetRect(cell,0,MAX(0.,(cell.size.height-size-3)/2))withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:size weight:NSFontWeightMedium],NSForegroundColorAttributeName:NSColor.whiteColor,NSShadowAttributeName:shadow,NSParagraphStyleAttributeName:style}];}
|
||||
}
|
||||
}[_viewerControls draw];
|
||||
[NSGraphicsContext restoreGraphicsState];CIImage *overlay=[CIImage imageWithCGImage:bitmap.CGImage options:@{kCIImageColorSpace:NSNull.null}];overlay=[overlay imageByApplyingTransform:CGAffineTransformMakeTranslation(0,texture.height-_height)];[_context render:overlay toMTLTexture:texture commandBuffer:commands bounds:CGRectMake(0,0,texture.width,texture.height) colorSpace:nil];
|
||||
}[self drawStampControls];[_viewerControls draw];
|
||||
[NSGraphicsContext restoreGraphicsState];CIImage *overlay=[CIImage imageWithCGImage:bitmap.CGImage options:@{kCIImageColorSpace:NSNull.null}];overlay=[overlay imageByApplyingTransform:CGAffineTransformMakeTranslation(NSMinX(region),texture.height-NSMaxY(region))];[_context render:overlay toMTLTexture:texture commandBuffer:commands bounds:CGRectMake(0,0,texture.width,texture.height) colorSpace:nil];
|
||||
}[commands commit];[commands waitUntilCompleted];
|
||||
}}}
|
||||
- (NSInteger)partAtPoint:(NSPoint)point {
|
||||
BOOL drawing=[_mask[@"drawing"]boolValue];
|
||||
if(drawing)for(NSInteger i=9;i<=10;i++)if(NSPointInRect(point,[self toolbarRectForItem:i]))return 10000+i;
|
||||
NSInteger viewerHit=[_viewerControls partAtPoint:point];if(viewerHit)return viewerHit;
|
||||
if(!_mask)return 0;BOOL drawing=[_mask[@"drawing"]boolValue];if(drawing)for(NSInteger i=9;i<=10;i++)if(NSPointInRect(point,[self toolbarRectForItem:i]))return 10000+i;if([_mask[@"drawShape"]boolValue])return NSPointInRect(point,_imageRect)?1:0;
|
||||
if(_viewerControls.stampArmed)return NSPointInRect(point,_imageRect)?10014:0;
|
||||
NSArray *source=_mask[@"stampSource"];
|
||||
if(source.count==4){
|
||||
BOOL tracking=[_mask[@"tracking"]boolValue];
|
||||
NSInteger count=tracking?1:3;
|
||||
for(NSInteger i=0;i<count;i++)if(NSPointInRect(point,[self stampControlRect:i]))return 10011+i;
|
||||
NSPoint cross=[self canvasStampSource:NSMakePoint([source[0]doubleValue],[source[1]doubleValue])];
|
||||
if(!tracking&&NSPointInRect(point,_imageRect)&&hypot(cross.x-point.x,cross.y-point.y)<=12*_uiScale)return DYCloneSourcePart;
|
||||
}
|
||||
if(!_mask)return 0;if([_mask[@"drawShape"]boolValue])return NSPointInRect(point,_imageRect)?1:0;
|
||||
DYMaskParameters p;[_mask[@"parameters"]getBytes:&p length:sizeof(p)];p.imageAspect=_imageRect.size.width/MAX(1.,_imageRect.size.height);
|
||||
if(drawing){NSData *data=_mask[@"nodes"];if(data.length>=3*sizeof(DYBezierNode)){const DYBezierNode *nodes=(const DYBezierNode*)data.bytes;NSPoint first=[self canvasPoint:nodes[0].x y:nodes[0].y parameters:p];if(hypot(point.x-first.x,point.y-first.y)<=10*_uiScale)return 1000;}return NSPointInRect(point,_imageRect)?1:0;}
|
||||
for(NSDictionary *h in _handles){NSPoint q=[h[@"point"]pointValue];if(hypot(q.x-point.x,q.y-point.y)<=9*_uiScale)return [h[@"part"]integerValue];}
|
||||
@@ -63,9 +129,52 @@
|
||||
- (BOOL)event:(NSEventType)type x:(double)x y:(double)y part:(NSInteger)part modifiers:(FxModifierKeys)modifiers key:(unichar)key time:(CMTime)time {@synchronized(self){
|
||||
DYPlugIn *plugin=[self pluginAtTime:time];if(_eventDiagnostics++<12)os_log(OS_LOG_DEFAULT,"dayu_tool_osc_event type=%{public}ld part=%{public}ld x=%{public}.2f y=%{public}.2f plugin=%{public}d",(long)type,(long)part,x,y,plugin!=nil);[_viewerControls setBridge:[plugin viewerParameterBridge]];[_viewerControls setViewport:_imageRect];[_viewerControls prepareWithSize:NSMakeSize(_canvasWidth,_height) scale:_uiScale atTime:time];NSPoint canvasPoint=NSMakePoint(x,_height-y);
|
||||
if(_maskCapturing&&plugin!=_maskCaptureOwner){_maskCapturing=NO;_maskCaptureOwner=nil;return NO;}
|
||||
if(_stampSaving)return YES;
|
||||
if(!_viewerControls.stampArmed)[self clearStampCreation];
|
||||
if(type==NSEventTypeKeyDown&&key==27&&_viewerControls.stampArmed){
|
||||
_viewerControls.stampArmed=NO;[self clearStampCreation];return YES;
|
||||
}
|
||||
if(type==NSEventTypeLeftMouseDown&&part>=10011&&part<=10013){
|
||||
NSInteger direction=[_mask[@"tracking"]boolValue]?9:part-10012;
|
||||
[plugin trackCloneStamp:_mask[@"id"] direction:direction];return YES;
|
||||
}
|
||||
if(plugin&&_viewerControls.stampArmed&&NSWidth(_imageRect)>0&&NSHeight(_imageRect)>0){
|
||||
NSPoint uv=NSMakePoint(fmax(0,fmin(1,(x-NSMinX(_imageRect))/NSWidth(_imageRect))),fmax(0,fmin(1,(canvasPoint.y-NSMinY(_imageRect))/NSHeight(_imageRect))));
|
||||
if(type==NSEventTypeLeftMouseDown&&part==10014){
|
||||
[_stampFailure release];_stampFailure=nil;
|
||||
if(!_stampHasSource){_stampSource=uv;_stampHasSource=YES;}
|
||||
else {_stampStart=_stampEnd=uv;_stampDragging=YES;}
|
||||
return YES;
|
||||
}
|
||||
if(_stampDragging&&(type==NSEventTypeLeftMouseDragged||type==NSEventTypeLeftMouseUp)){
|
||||
_stampEnd=uv;
|
||||
if(type==NSEventTypeLeftMouseUp){
|
||||
NSRect target=[self stampTarget];_stampDragging=NO;
|
||||
if(NSWidth(target)>=.001&&NSHeight(target)>=.001&&NSWidth(target)*NSWidth(_imageRect)>=3*_uiScale&&NSHeight(target)*NSHeight(_imageRect)>=3*_uiScale){
|
||||
_stampSaving=YES;
|
||||
DYViewerParameterBridge *bridge=_viewerControls.bridge;
|
||||
[plugin addCloneStampFrom:_stampSource target:target atTime:time completion:^(NSString *failure){
|
||||
@synchronized(self){
|
||||
self->_stampSaving=NO;
|
||||
if(self->_viewerControls.bridge!=bridge||!self->_viewerControls.stampArmed){[self clearStampCreation];return;}
|
||||
self->_stampNeedsRedraw=YES;
|
||||
if(failure){
|
||||
[self->_stampFailure release];self->_stampFailure=[failure copy];
|
||||
}else{
|
||||
self->_viewerControls.stampArmed=NO;
|
||||
[self clearStampCreation];
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
BOOL ownedMask=_maskCapturing&&(type==NSEventTypeLeftMouseDragged||type==NSEventTypeLeftMouseUp);
|
||||
if(type==NSEventTypeKeyDown&&key==27&&[_viewerControls capturing])return [_viewerControls finishCapture];
|
||||
if(!ownedMask&&type!=NSEventTypeKeyDown&&[_viewerControls event:type point:canvasPoint atTime:time])return YES;
|
||||
BOOL penAction=type==NSEventTypeLeftMouseDown&&(part==10009||part==10010);
|
||||
if(!ownedMask&&!penAction&&type!=NSEventTypeKeyDown&&[_viewerControls event:type point:canvasPoint atTime:time])return YES;
|
||||
if(!plugin||![plugin toolCanvasVisible]||_imageRect.size.width<=0||_imageRect.size.height<=0){_maskCapturing=NO;return NO;}
|
||||
NSPoint point=NSMakePoint((x-_imageRect.origin.x)/_imageRect.size.width,(_height-y-_imageRect.origin.y)/_imageRect.size.height);
|
||||
if(type==NSEventTypeLeftMouseDown){_maskCapturing=part>0&&part<10000;_maskCaptureOwner=_maskCapturing?plugin:nil;}
|
||||
@@ -76,7 +185,7 @@
|
||||
- (void)mouseUpAtPositionX:(double)x positionY:(double)y activePart:(NSInteger)part modifiers:(FxModifierKeys)m forceUpdate:(BOOL*)update atTime:(CMTime)t{BOOL result=[self event:NSEventTypeLeftMouseUp x:x y:y part:part modifiers:m key:0 time:t];if(update)*update=result;}
|
||||
- (void)keyDownAtPositionX:(double)x positionY:(double)y keyPressed:(unsigned short)key modifiers:(FxModifierKeys)m forceUpdate:(BOOL*)update didHandle:(BOOL*)handled atTime:(CMTime)t{BOOL result=(key==27||key==13||key==10||key==3||key==8||key==127)&&[self event:NSEventTypeKeyDown x:x y:y part:1 modifiers:m key:key time:t];if(update)*update=result;if(handled)*handled=result;}
|
||||
- (void)mouseMovedAtPositionX:(double)x positionY:(double)y activePart:(NSInteger)part modifiers:(FxModifierKeys)m forceUpdate:(BOOL*)update atTime:(CMTime)t{@synchronized(self){
|
||||
DYPlugIn*plugin=[self pluginAtTime:t];[_viewerControls setBridge:[plugin viewerParameterBridge]];[_viewerControls setViewport:_imageRect];[_viewerControls prepareWithSize:NSMakeSize(_canvasWidth,_height) scale:_uiScale atTime:t];NSPoint point=NSMakePoint(x,_height-y);NSInteger viewerHit=[_viewerControls partAtPoint:point];BOOL redraw=[_viewerControls mouseMoved:point];NSDictionary *mask=[plugin toolCanvasMaskAtTime:t];BOOL drawing=[mask[@"drawing"]boolValue]||[mask[@"drawShape"]boolValue];NSCursor *cursor=[_viewerControls headerAtPoint:point]?([_viewerControls capturing]?NSCursor.closedHandCursor:NSCursor.openHandCursor):viewerHit?NSCursor.pointingHandCursor:part>=10000?NSCursor.pointingHandCursor:(drawing||part>=1000)?NSCursor.crosshairCursor:part?NSCursor.openHandCursor:NSCursor.arrowCursor;[[_apiManager apiForProtocol:@protocol(FxOnScreenControlAPI_v4)]setCursor:cursor];if(drawing&&!viewerHit)[self event:NSEventTypeMouseMoved x:x y:y part:part modifiers:m key:0 time:t];if(update)*update=redraw||drawing;
|
||||
DYPlugIn*plugin=[self pluginAtTime:t];[_viewerControls setBridge:[plugin viewerParameterBridge]];[_viewerControls setViewport:_imageRect];[_viewerControls prepareWithSize:NSMakeSize(_canvasWidth,_height) scale:_uiScale atTime:t];NSPoint point=NSMakePoint(x,_height-y);NSInteger viewerHit=[_viewerControls partAtPoint:point];BOOL redraw=[_viewerControls mouseMoved:point];NSDictionary *mask=[plugin toolCanvasMaskAtTime:t];BOOL drawing=[mask[@"drawing"]boolValue]||[mask[@"drawShape"]boolValue];NSCursor *cursor=[_viewerControls headerAtPoint:point]?([_viewerControls capturing]?NSCursor.closedHandCursor:NSCursor.openHandCursor):viewerHit?NSCursor.pointingHandCursor:part==10014?NSCursor.crosshairCursor:part>=10000?NSCursor.pointingHandCursor:(drawing||part>=1000)?NSCursor.crosshairCursor:part?NSCursor.openHandCursor:NSCursor.arrowCursor;[[_apiManager apiForProtocol:@protocol(FxOnScreenControlAPI_v4)]setCursor:cursor];if([mask[@"drawing"]boolValue]&&!viewerHit)[self event:NSEventTypeMouseMoved x:x y:y part:part modifiers:m key:0 time:t];if(update)*update=redraw||[mask[@"drawing"]boolValue]||_stampNeedsRedraw;_stampNeedsRedraw=NO;
|
||||
}}
|
||||
- (void)mouseEnteredAtPositionX:(double)x positionY:(double)y modifiers:(FxModifierKeys)m forceUpdate:(BOOL*)update atTime:(CMTime)t{[self mouseMovedAtPositionX:x positionY:y activePart:0 modifiers:m forceUpdate:update atTime:t];}
|
||||
- (void)mouseExitedAtPositionX:(double)x positionY:(double)y modifiers:(FxModifierKeys)m forceUpdate:(BOOL*)update atTime:(CMTime)t{@synchronized(self){BOOL changed=[_viewerControls mouseExited];if(update)*update=changed;}}
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
});}}
|
||||
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools error:(NSError**)error {@synchronized(self){
|
||||
if(tools&&!DYValidToolDocument(tools))return fail(error,@"工具或蒙版数据损坏,未更改原工程");DYApplyRemovedBaseTools(&u,tools);paths=DYVisibleBaseToolPaths(paths,tools);if(DYBaseToolRemoved(tools,@"spider"))spider=nil;
|
||||
for(NSDictionary *mask in DYSharedMasks(tools))if(mask[@"stampSource"]&&[mask[@"enabled"]boolValue])return fail(error,@"仿制图章属于空间处理,请保存完整预设。");
|
||||
if((u.lensSectionEnabled>.5&&(u.lensStrength!=0||u.lensScale!=1))||(u.skinProtection.x>.5&&u.skinVisualize>.5))return fail(error,@"镜头修复与肤色区域显示无法保存到 Cube,请保存完整预设。");for(NSDictionary *node in tools[@"layers"]){DYUniforms layer=DYToolUniforms(node);if([node[@"type"]isEqual:@"lens"]&&!DYToolIsNeutral(node))return fail(error,@"镜头畸变属于空间处理,请保存完整预设。");}
|
||||
DYUniforms effective=u;if(![paths[@"input"]length]&&effective.inputProfile==0)effective.preLUTStrength=0;if(![paths[@"look0"]length])effective.postLUTStrength=0;for(int i=0;i<4;i++)if(![paths[[NSString stringWithFormat:@"look%d",i+1]]length])effective.extraPostLUTStrengths[i]=0;bypassNeutralTools(&effective);bypassIdleSkin(&effective);if(effective.skinFaceOnly>.5&&effective.skinProtection.x>.5&&effective.skinProtection.y>0)return fail(error,@"人脸限定肤色保护属于空间选区,Cube 无法保存。请保存完整预设,或关闭人脸限定后导出。");for(NSDictionary *node in tools[@"layers"]){DYUniforms layer=DYToolUniforms(node);if([node[@"type"]isEqual:@"skin"]&&layer.skinProtection.x>.5&&layer.skinProtection.y>0&&(layer.skinFaceOnly>.5||layer.skinVisualize>.5))return fail(error,@"新增肤色层含人脸空间选区,请保存完整预设。");}
|
||||
if(DYFilmToolActive(u)&&DYFilmSpatialActive(u.film))return fail(error,@"当前胶片含晕光、辉光、颗粒或暗角,无法完整保存到静态 Cube。请保存完整预设,或关闭这些处理后再导出。");for(NSDictionary *node in tools[@"layers"]){DYUniforms layer=DYToolUniforms(node);if([node[@"type"]isEqual:@"film"]&&DYFilmToolActive(layer)&&DYFilmSpatialActive(layer.film))return fail(error,@"新增胶片层含空间或时间处理,无法完整保存到静态 Cube。请保存完整预设。");}
|
||||
|
||||
+10
-1
@@ -45,7 +45,16 @@ NSDictionary *DYShareToolMask(NSMutableDictionary *document,NSString *nodeID,NSS
|
||||
NSDictionary *DYResolvedToolDocument(NSDictionary *document);
|
||||
DYMaskParameters DYMaskAtTime(NSDictionary *mask,CMTime time);
|
||||
NSDictionary *DYMaskKey(CMTime time,DYMaskParameters parameters,BOOL manual,float confidence);
|
||||
BOOL DYMergeTracking(NSMutableDictionary *mask,NSArray *samples);
|
||||
struct DYStampMotion {
|
||||
float sourceOffsetX=0,sourceOffsetY=0;
|
||||
float sourceScaleX=1,sourceScaleY=1,targetScaleX=1,targetScaleY=1;
|
||||
bool active=false;
|
||||
};
|
||||
DYStampMotion DYStampMotionAtTime(NSDictionary *stamp,CMTime time);
|
||||
NSArray *DYStampSourceAtTime(NSDictionary *stamp,CMTime time);
|
||||
NSArray *DYStampSamplingScaleAtTime(NSDictionary *stamp,CMTime time);
|
||||
NSDictionary *DYStampKey(CMTime time,DYMaskParameters parameters,BOOL manual,float confidence,DYStampMotion motion);
|
||||
BOOL DYMergeTracking(NSMutableDictionary *mask,NSArray *samples,CMTime frameDuration=kCMTimeInvalid);
|
||||
NSDictionary *DYToolRenderSnapshot(NSDictionary *document,CMTime time);
|
||||
DYUniforms DYToolUniforms(NSDictionary *node);
|
||||
BOOL DYToolIsNeutral(NSDictionary *node);
|
||||
|
||||
+234
-27
@@ -1,9 +1,11 @@
|
||||
#include <numeric>
|
||||
#import "DYToolState.h"
|
||||
#include "DYSpiderState.h"
|
||||
#include "DYFilmMath.h"
|
||||
#include <set>
|
||||
#import <objc/runtime.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <os/log.h>
|
||||
|
||||
NSArray *DYToolTypes(void){return @[@"primary",@"spider",@"base",@"skin",@"look",@"hsl",@"curve",@"grading",@"primaries",@"levels",@"blackwhite",@"balance",@"mixer",@"film",@"lens"];}
|
||||
NSDictionary *DYToolSection(NSString *type){for(NSDictionary *s in DYSections())if([s[@"key"]isEqual:type])return s;return nil;}
|
||||
@@ -55,9 +57,21 @@ BOOL DYResetToolParameters(id<PROAPIAccessing> host,NSArray<NSDictionary *> *row
|
||||
for(NSDictionary *d in rows)if(![set setFloatValue:[d[@"default"]doubleValue] toParameter:[d[@"pid"]unsignedIntValue] atTime:time]){if(error)*error=[NSError errorWithDomain:@"com.dayu.color.ToolReset" code:1 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"未能还原“%@”,模块已保留。",d[@"title"]?:d[@"key"]]}];return NO;}
|
||||
return YES;
|
||||
}
|
||||
NSMutableDictionary *DYMutablePlist(NSDictionary *value){if(!value)return [NSMutableDictionary dictionary];NSData *data=[NSPropertyListSerialization dataWithPropertyList:value format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil];return [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainersAndLeaves format:NULL error:nil];}
|
||||
NSMutableDictionary *DYMutablePlist(NSDictionary *value){
|
||||
if(!value)return [NSMutableDictionary dictionary];
|
||||
return [(NSMutableDictionary*)CFPropertyListCreateDeepCopy(kCFAllocatorDefault,(CFPropertyListRef)value,kCFPropertyListMutableContainersAndLeaves) autorelease];
|
||||
}
|
||||
static NSDictionary *DYEmptyTools(){return @{@"schema":@1,@"layers":@[],@"baseMasks":@{}};}
|
||||
static BOOL finiteNumber(id v){return [v isKindOfClass:NSNumber.class]&&std::isfinite([v doubleValue]);}
|
||||
static BOOL validStampValues(id values,NSUInteger count,NSUInteger offsets,double minScale,double maxScale){
|
||||
if(![values isKindOfClass:NSArray.class]||[values count]!=count)return NO;
|
||||
for(NSUInteger i=0;i<count;i++){
|
||||
if(!finiteNumber(values[i]))return NO;
|
||||
double value=[values[i] doubleValue];
|
||||
if(i<offsets?fabs(value)>1:value<minScale||value>maxScale)return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
static BOOL validID(id v){return [v isKindOfClass:NSString.class]&&[[[NSUUID alloc]initWithUUIDString:v]autorelease]!=nil;}
|
||||
static NSData *parameterData(DYMaskParameters p){return [NSData dataWithBytes:&p length:sizeof(p)];}
|
||||
static BOOL readParameters(id data,DYMaskParameters *p){if(![data isKindOfClass:NSData.class]||[data length]!=sizeof(*p))return NO;[data getBytes:p length:sizeof(*p)];return dyValidMaskParameters(*p);}
|
||||
@@ -67,45 +81,57 @@ NSDictionary *DYNewTool(NSString *type){if(![DYToolTypes()containsObject:type])r
|
||||
BOOL DYValidToolMask(NSDictionary *mask){
|
||||
if(![mask isKindOfClass:NSDictionary.class]||!validID(mask[@"id"])||!finiteNumber(mask[@"enabled"])||!finiteNumber(mask[@"combine"])||[mask[@"combine"]integerValue]<0||[mask[@"combine"]integerValue]>2)return NO;
|
||||
DYMaskParameters p;if(!readParameters(mask[@"parameters"],&p))return NO;NSData *nodes=mask[@"nodes"];if(![nodes isKindOfClass:NSData.class]||nodes.length%sizeof(DYBezierNode)||nodes.length>32*sizeof(DYBezierNode))return NO;
|
||||
id source=mask[@"stampSource"];
|
||||
if(source){
|
||||
if(p.kind!=DYMaskEllipse||![source isKindOfClass:NSArray.class]||[source count]!=4)return NO;
|
||||
for(NSUInteger i=0;i<4;i++)if(!finiteNumber(source[i])||[source[i] doubleValue]<(i<2?0:.001)||[source[i] doubleValue]>1)return NO;
|
||||
}
|
||||
id samplingScale=mask[@"stampSamplingScale"];
|
||||
if(samplingScale&&(!source||!validStampValues(samplingScale,2,0,1./256,256)))return NO;
|
||||
const float *n=(const float*)nodes.bytes;for(NSUInteger i=0;i<nodes.length/4;i++)if(!std::isfinite(n[i])||fabs(n[i])>1000)return NO;
|
||||
NSArray *keys=mask[@"keys"];if(![keys isKindOfClass:NSArray.class]||keys.count>DYToolKeyLimit)return NO;CMTime last=kCMTimeInvalid;
|
||||
for(NSDictionary *k in keys){if(![k isKindOfClass:NSDictionary.class]||!finiteNumber(k[@"value"])||!finiteNumber(k[@"scale"])||!finiteNumber(k[@"epoch"])||!finiteNumber(k[@"manual"])||!finiteNumber(k[@"confidence"])||[k[@"confidence"]doubleValue]<0||[k[@"confidence"]doubleValue]>1)return NO;CMTime t=keyTime(k);DYMaskParameters q;if(!CMTIME_IS_NUMERIC(t)||!readParameters(k[@"parameters"],&q)||q.kind!=p.kind||(CMTIME_IS_NUMERIC(last)&&(last.epoch!=t.epoch||CMTimeCompare(last,t)>=0)))return NO;last=t;}return YES;
|
||||
for(NSDictionary *k in keys){if(![k isKindOfClass:NSDictionary.class]||!finiteNumber(k[@"value"])||!finiteNumber(k[@"scale"])||!finiteNumber(k[@"epoch"])||!finiteNumber(k[@"manual"])||!finiteNumber(k[@"confidence"])||[k[@"confidence"]doubleValue]<0||[k[@"confidence"]doubleValue]>1)return NO;CMTime t=keyTime(k);DYMaskParameters q;if(!CMTIME_IS_NUMERIC(t)||!readParameters(k[@"parameters"],&q)||q.kind!=p.kind||(CMTIME_IS_NUMERIC(last)&&(last.epoch!=t.epoch||CMTimeCompare(last,t)>=0)))return NO;
|
||||
if(k[@"stampMotion"]&&(!source||!validStampValues(k[@"stampMotion"],6,2,1./16,16)))return NO;
|
||||
last=t;
|
||||
}return YES;
|
||||
}
|
||||
static BOOL validMasks(id masks,NSMutableSet *ids,NSSet *sharedIDs,BOOL references){
|
||||
if(![masks isKindOfClass:NSArray.class]||[masks count]>DYToolMaskLimit)return NO;NSMutableSet *links=[NSMutableSet set];
|
||||
for(NSDictionary *m in masks){if(![m isKindOfClass:NSDictionary.class])return NO;id shared=m[@"sharedID"];if(shared){if(!references||m.count!=1||![sharedIDs containsObject:shared]||[links containsObject:shared])return NO;[links addObject:shared];continue;}if(!DYValidToolMask(m)||[ids containsObject:m[@"id"]])return NO;[ids addObject:m[@"id"]];}return YES;
|
||||
for(NSDictionary *m in masks){if(![m isKindOfClass:NSDictionary.class])return NO;id shared=m[@"sharedID"];if(shared){if(!references||m.count!=1||![sharedIDs containsObject:shared]||[links containsObject:shared])return NO;[links addObject:shared];continue;}if(!DYValidToolMask(m)||m[@"stampSource"]||[ids containsObject:m[@"id"]])return NO;[ids addObject:m[@"id"]];}return YES;
|
||||
}
|
||||
BOOL DYValidToolDocument(NSDictionary *doc){
|
||||
if(![NSPropertyListSerialization propertyList:doc isValidForFormat:NSPropertyListBinaryFormat_v1_0])return NO;
|
||||
if(![doc isKindOfClass:NSDictionary.class]||(![doc[@"schema"]isEqual:@1]&&![doc[@"schema"]isEqual:@2]&&![doc[@"schema"]isEqual:@3])||![doc[@"layers"]isKindOfClass:NSArray.class]||[doc[@"layers"]count]>DYToolLimit||![doc[@"baseMasks"]isKindOfClass:NSDictionary.class]||[doc[@"baseMasks"]count]>DYToolTypes().count)return NO;
|
||||
BOOL references=[doc[@"schema"]isEqual:@3];id shared=doc[@"sharedMasks"];NSMutableSet *sharedIDs=[NSMutableSet set],*ids=[NSMutableSet set];if(shared){if(!references||![shared isKindOfClass:NSArray.class]||[shared count]>DYSharedMaskLimit)return NO;for(NSDictionary *mask in shared){if(!DYValidToolMask(mask)||[ids containsObject:mask[@"id"]]||mask[@"sharedID"])return NO;[ids addObject:mask[@"id"]];[sharedIDs addObject:mask[@"id"]];}}
|
||||
id removed=doc[@"removedBase"];if(removed){if(![removed isKindOfClass:NSArray.class]||[removed count]>DYToolTypes().count)return NO;NSMutableSet *unique=[NSMutableSet set];for(id type in removed){if(![type isKindOfClass:NSString.class]||![DYToolTypes()containsObject:type]||[unique containsObject:type]||[doc[@"baseMasks"][type]count])return NO;[unique addObject:type];}}
|
||||
for(NSString *key in doc[@"baseMasks"]){if(![DYToolTypes()containsObject:key]||!validMasks(doc[@"baseMasks"][key],ids,sharedIDs,references))return NO;}
|
||||
static NSData *DYValidatedToolData(NSDictionary *doc){
|
||||
if(![NSPropertyListSerialization propertyList:doc isValidForFormat:NSPropertyListBinaryFormat_v1_0])return nil;
|
||||
if(![doc isKindOfClass:NSDictionary.class]||(![doc[@"schema"]isEqual:@1]&&![doc[@"schema"]isEqual:@2]&&![doc[@"schema"]isEqual:@3])||![doc[@"layers"]isKindOfClass:NSArray.class]||[doc[@"layers"]count]>DYToolLimit||![doc[@"baseMasks"]isKindOfClass:NSDictionary.class]||[doc[@"baseMasks"]count]>DYToolTypes().count)return nil;
|
||||
BOOL references=[doc[@"schema"]isEqual:@3];id shared=doc[@"sharedMasks"];NSMutableSet *sharedIDs=[NSMutableSet set],*ids=[NSMutableSet set];if(shared){if(!references||![shared isKindOfClass:NSArray.class]||[shared count]>DYSharedMaskLimit)return nil;for(NSDictionary *mask in shared){if(!DYValidToolMask(mask)||[ids containsObject:mask[@"id"]]||mask[@"sharedID"])return nil;[ids addObject:mask[@"id"]];if(!mask[@"stampSource"])[sharedIDs addObject:mask[@"id"]];}}
|
||||
id removed=doc[@"removedBase"];if(removed){if(![removed isKindOfClass:NSArray.class]||[removed count]>DYToolTypes().count)return nil;NSMutableSet *unique=[NSMutableSet set];for(id type in removed){if(![type isKindOfClass:NSString.class]||![DYToolTypes()containsObject:type]||[unique containsObject:type]||[doc[@"baseMasks"][type]count])return nil;[unique addObject:type];}}
|
||||
for(NSString *key in doc[@"baseMasks"]){if(![DYToolTypes()containsObject:key]||!validMasks(doc[@"baseMasks"][key],ids,sharedIDs,references))return nil;}
|
||||
NSMutableDictionary *descriptors=[NSMutableDictionary dictionary];for(NSDictionary *d in DYDescriptors())descriptors[d[@"key"]]=d;
|
||||
for(NSDictionary *node in doc[@"layers"]){if(![node isKindOfClass:NSDictionary.class]||!validID(node[@"id"])||[ids containsObject:node[@"id"]]||![DYToolTypes()containsObject:node[@"type"]]||![node[@"values"]isKindOfClass:NSDictionary.class]||[node[@"values"]count]>descriptors.count||![node[@"paths"]isKindOfClass:NSDictionary.class]||[node[@"paths"]count]>6)return NO;[ids addObject:node[@"id"]];if(!validMasks(node[@"masks"],ids,sharedIDs,references))return NO;
|
||||
if(node[@"primaryFollow"]&&(![node[@"type"]isEqual:@"primary"]||!finiteNumber(node[@"primaryFollow"])||[node[@"primaryFollow"]doubleValue]!=floor([node[@"primaryFollow"]doubleValue])||[node[@"primaryFollow"]integerValue]<0||[node[@"primaryFollow"]integerValue]>7))return NO;
|
||||
for(NSString *key in node[@"values"]){NSDictionary *d=descriptors[key];id v=node[@"values"][key];if(!d||!finiteNumber(v)||[v doubleValue]<[d[@"min"]doubleValue]||[v doubleValue]>[d[@"max"]doubleValue]||(d[@"values"]&&![d[@"values"]containsObject:@((int)llround([v doubleValue]))]))return NO;}
|
||||
for(id key in node[@"paths"]){id p=node[@"paths"][key];if(![@[@"input",@"look0",@"look1",@"look2",@"look3",@"look4"]containsObject:key]||![p isKindOfClass:NSString.class]||[p length]>8192||![p isAbsolutePath]||![[p pathExtension].lowercaseString isEqual:@"cube"])return NO;}if(node[@"spider"]&&(![node[@"spider"]isKindOfClass:NSData.class]||!DYSpiderMeshIsValid(node[@"spider"])))return NO;
|
||||
for(NSDictionary *node in doc[@"layers"]){if(![node isKindOfClass:NSDictionary.class]||!validID(node[@"id"])||[ids containsObject:node[@"id"]]||![DYToolTypes()containsObject:node[@"type"]]||![node[@"values"]isKindOfClass:NSDictionary.class]||[node[@"values"]count]>descriptors.count||![node[@"paths"]isKindOfClass:NSDictionary.class]||[node[@"paths"]count]>6)return nil;[ids addObject:node[@"id"]];if(!validMasks(node[@"masks"],ids,sharedIDs,references))return nil;
|
||||
if(node[@"primaryFollow"]&&(![node[@"type"]isEqual:@"primary"]||!finiteNumber(node[@"primaryFollow"])||[node[@"primaryFollow"]doubleValue]!=floor([node[@"primaryFollow"]doubleValue])||[node[@"primaryFollow"]integerValue]<0||[node[@"primaryFollow"]integerValue]>7))return nil;
|
||||
for(NSString *key in node[@"values"]){NSDictionary *d=descriptors[key];id v=node[@"values"][key];if(!d||!finiteNumber(v)||[v doubleValue]<[d[@"min"]doubleValue]||[v doubleValue]>[d[@"max"]doubleValue]||(d[@"values"]&&![d[@"values"]containsObject:@((int)llround([v doubleValue]))]))return nil;}
|
||||
for(id key in node[@"paths"]){id p=node[@"paths"][key];if(![@[@"input",@"look0",@"look1",@"look2",@"look3",@"look4"]containsObject:key]||![p isKindOfClass:NSString.class]||[p length]>8192||![p isAbsolutePath]||![[p pathExtension].lowercaseString isEqual:@"cube"])return nil;}if(node[@"spider"]&&(![node[@"spider"]isKindOfClass:NSData.class]||!DYSpiderMeshIsValid(node[@"spider"])))return nil;
|
||||
}
|
||||
// Anchors are stable identities, never an array index or a translated title.
|
||||
// Reject unknown anchors/cycles so layout, rendering and undo share one order.
|
||||
for(NSDictionary *node in doc[@"layers"]){id after=node[@"after"];if(!after)continue;if([doc[@"schema"]isEqual:@1]||![after isKindOfClass:NSString.class])return NO;NSMutableSet *seen=[NSMutableSet setWithObject:node[@"id"]];while(after){if([after hasPrefix:@"base:"]){if(![DYToolTypes()containsObject:[after substringFromIndex:5]])return NO;break;}if([seen containsObject:after])return NO;[seen addObject:after];NSDictionary *parent=DYToolWithID(doc,after);if(!parent)return NO;after=parent[@"after"];}}
|
||||
NSUInteger totalKeys=0;for(NSDictionary *mask in shared)totalKeys+=[mask[@"keys"]count];for(NSArray *masks in [doc[@"baseMasks"]allValues])for(NSDictionary *mask in masks)totalKeys+=[mask[@"keys"]count];for(NSDictionary *node in doc[@"layers"])for(NSDictionary *mask in node[@"masks"])totalKeys+=[mask[@"keys"]count];if(totalKeys>65536)return NO;NSData *bounded=[NSPropertyListSerialization dataWithPropertyList:doc format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil];return bounded&&bounded.length<=24*1024*1024;
|
||||
for(NSDictionary *node in doc[@"layers"]){id after=node[@"after"];if(!after)continue;if([doc[@"schema"]isEqual:@1]||![after isKindOfClass:NSString.class])return nil;NSMutableSet *seen=[NSMutableSet setWithObject:node[@"id"]];while(after){if([after hasPrefix:@"base:"]){if(![DYToolTypes()containsObject:[after substringFromIndex:5]])return nil;break;}if([seen containsObject:after])return nil;[seen addObject:after];NSDictionary *parent=DYToolWithID(doc,after);if(!parent)return nil;after=parent[@"after"];}}
|
||||
NSUInteger totalKeys=0;for(NSDictionary *mask in shared)totalKeys+=[mask[@"keys"]count];for(NSArray *masks in [doc[@"baseMasks"]allValues])for(NSDictionary *mask in masks)totalKeys+=[mask[@"keys"]count];for(NSDictionary *node in doc[@"layers"])for(NSDictionary *mask in node[@"masks"])totalKeys+=[mask[@"keys"]count];if(totalKeys>65536)return nil;NSData *bounded=[NSPropertyListSerialization dataWithPropertyList:doc format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil];return bounded.length<=24*1024*1024?bounded:nil;
|
||||
}
|
||||
BOOL DYValidToolDocument(NSDictionary *doc){return DYValidatedToolData(doc)!=nil;}
|
||||
@implementation DYToolDocument
|
||||
+ (BOOL)supportsSecureCoding{return YES;}
|
||||
- (instancetype)init{if((self=[super init]))_document=[DYEmptyTools()copy];return self;}
|
||||
- (void)dealloc{[_document release];[super dealloc];}
|
||||
- (void)setDocument:(NSDictionary *)d{if(!DYValidToolDocument(d))return;NSData *b=[NSPropertyListSerialization dataWithPropertyList:d format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil];NSDictionary *immutable=[NSPropertyListSerialization propertyListWithData:b options:NSPropertyListImmutable format:NULL error:nil];[_document release];_document=[immutable retain];}
|
||||
- (void)setDocument:(NSDictionary *)d{NSData *b=DYValidatedToolData(d);if(!b)return;NSDictionary *immutable=[NSPropertyListSerialization propertyListWithData:b options:NSPropertyListImmutable format:NULL error:nil];[self setImmutableDocument:immutable];}
|
||||
- (void)setImmutableDocument:(NSDictionary*)document{if(document==_document)return;[document retain];[_document release];_document=document;}
|
||||
- (void)encodeWithCoder:(NSCoder*)c{[c encodeObject:_document forKey:@"document"];}
|
||||
- (instancetype)initWithCoder:(NSCoder*)c{if((self=[self init])){NSDictionary *d=[c decodeObjectOfClasses:[NSSet setWithObjects:NSDictionary.class,NSArray.class,NSString.class,NSNumber.class,NSData.class,nil] forKey:@"document"];if(!DYValidToolDocument(d)){[self release];return nil;}self.document=d;}return self;}
|
||||
- (id)copyWithZone:(NSZone*)zone{DYToolDocument *v=[[[self class]allocWithZone:zone]init];v.document=_document;return v;}
|
||||
- (instancetype)initWithCoder:(NSCoder*)c{if((self=[self init])){NSDictionary *d=[c decodeObjectOfClasses:[NSSet setWithObjects:NSDictionary.class,NSArray.class,NSString.class,NSNumber.class,NSData.class,nil] forKey:@"document"];NSData *data=DYValidatedToolData(d);if(!data){[self release];return nil;}[self setImmutableDocument:[NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:nil]];}return self;}
|
||||
- (id)copyWithZone:(NSZone*)zone{DYToolDocument *v=[[[self class]allocWithZone:zone]init];[v setImmutableDocument:_document];return v;}
|
||||
- (BOOL)isEqual:(id)o{return [o isKindOfClass:DYToolDocument.class]&&[_document isEqual:[o document]];}
|
||||
- (NSUInteger)hash{return _document.hash;}
|
||||
- (id)interpolateBetween:(id)other withWeight:(float)weight{return [[self copy]autorelease];}
|
||||
@end
|
||||
DYToolDocument *DYReadTools(id<PROAPIAccessing>m,CMTime t){DYToolDocument *d=nil;[[(id)m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&d fromParameter:DYToolsParameterID atTime:t];return [d isKindOfClass:DYToolDocument.class]?d:[[[DYToolDocument alloc]init]autorelease];}
|
||||
BOOL DYWriteTools(id<PROAPIAccessing>m,NSDictionary *d,CMTime t){if(!DYValidToolDocument(d))return NO;DYToolDocument *v=[[[DYToolDocument alloc]init]autorelease];v.document=d;return [[m apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:v toParameter:DYToolsParameterID atTime:t];}
|
||||
BOOL DYWriteTools(id<PROAPIAccessing>m,NSDictionary *d,CMTime t){NSData *data=DYValidatedToolData(d);if(!data)return NO;DYToolDocument *v=[[[DYToolDocument alloc]init]autorelease];[v setImmutableDocument:[NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:NULL error:nil]];return [[m apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:v toParameter:DYToolsParameterID atTime:t];}
|
||||
NSDictionary *DYToolWithID(NSDictionary *doc,NSString *ID){for(NSDictionary *n in doc[@"layers"])if([n[@"id"]isEqual:ID])return n;return nil;}
|
||||
static void DYAppendToolChildren(NSDictionary *doc,NSString *parent,NSMutableArray *order,NSMutableSet *seen){for(NSDictionary *node in doc[@"layers"])if([node[@"after"]isEqual:parent]&&![seen containsObject:node[@"id"]]){[seen addObject:node[@"id"]];[order addObject:node[@"id"]];DYAppendToolChildren(doc,node[@"id"],order,seen);}}
|
||||
NSArray *DYToolDisplayOrder(NSDictionary *doc){NSMutableArray *order=[NSMutableArray array];NSMutableSet *seen=[NSMutableSet set];for(NSString *type in DYToolTypes()){NSString *base=[@"base:" stringByAppendingString:type];[order addObject:base];DYAppendToolChildren(doc,base,order,seen);}for(NSDictionary *node in doc[@"layers"])if(!node[@"after"]&&![seen containsObject:node[@"id"]]){[seen addObject:node[@"id"]];[order addObject:node[@"id"]];DYAppendToolChildren(doc,node[@"id"],order,seen);}return order;}
|
||||
@@ -129,7 +155,7 @@ NSDictionary *DYAddSharedMask(NSMutableDictionary *doc,NSInteger kind){
|
||||
if(!DYValidToolDocument(doc)||DYSharedMasks(doc).count>=DYSharedMaskLimit)return nil;NSDictionary *fresh=DYNewMask(kind);if(!fresh)return nil;NSMutableDictionary *mask=DYMutablePlist(fresh);NSMutableArray *shared=[NSMutableArray arrayWithArray:DYSharedMasks(doc)];[shared addObject:mask];doc[@"schema"]=@3;doc[@"sharedMasks"]=shared;return mask;
|
||||
}
|
||||
BOOL DYSetSharedMaskAssigned(NSMutableDictionary *doc,NSString *maskID,NSString *nodeID,BOOL assigned){
|
||||
if(!DYSharedMaskWithID(doc,maskID)||[nodeID isEqual:@"shared"])return NO;if([nodeID hasPrefix:@"base:"]){NSString *type=[nodeID substringFromIndex:5];if(![DYToolTypes()containsObject:type]||DYBaseToolRemoved(doc,type))return NO;}else if(!DYToolWithID(doc,nodeID))return NO;
|
||||
NSDictionary *mask=DYSharedMaskWithID(doc,maskID);if(!mask||mask[@"stampSource"]||[nodeID isEqual:@"shared"])return NO;if([nodeID hasPrefix:@"base:"]){NSString *type=[nodeID substringFromIndex:5];if(![DYToolTypes()containsObject:type]||DYBaseToolRemoved(doc,type))return NO;}else if(!DYToolWithID(doc,nodeID))return NO;
|
||||
NSMutableArray *raw=[NSMutableArray arrayWithArray:DYRawMasksForTool(doc,nodeID)];NSUInteger index=[raw indexOfObjectPassingTest:^BOOL(NSDictionary *entry,NSUInteger i,BOOL *stop){return [entry[@"sharedID"]isEqual:maskID];}];if(assigned){if(index!=NSNotFound)return YES;if(raw.count>=DYToolMaskLimit)return NO;[raw addObject:@{@"sharedID":maskID}];}else if(index!=NSNotFound)[raw removeObjectAtIndex:index];return DYStoreRawMasks(doc,nodeID,raw);
|
||||
}
|
||||
NSArray *DYToolIDsForSharedMask(NSDictionary *doc,NSString *maskID){NSMutableArray *nodes=[NSMutableArray array];for(NSString *ID in DYToolDisplayOrder(doc))for(NSDictionary *entry in DYRawMasksForTool(doc,ID))if([entry[@"sharedID"]isEqual:maskID]){[nodes addObject:ID];break;}return nodes;}
|
||||
@@ -147,15 +173,184 @@ static NSDictionary *DYExpandSharedMasks(NSDictionary *doc,BOOL keepKeys){
|
||||
for(NSString *type in doc[@"baseMasks"])base[type]=resolve([@"base:" stringByAppendingString:type]);out[@"baseMasks"]=base;NSMutableArray *layers=[NSMutableArray array];for(NSDictionary *node in doc[@"layers"]){NSMutableDictionary *copy=[[node mutableCopy]autorelease];copy[@"masks"]=resolve(node[@"id"]);[layers addObject:copy];}out[@"layers"]=layers;out[@"schema"]=@2;[out removeObjectForKey:@"sharedMasks"];return out;
|
||||
}
|
||||
NSDictionary *DYResolvedToolDocument(NSDictionary *doc){return DYExpandSharedMasks(doc,NO);}
|
||||
DYMaskParameters DYMaskAtTime(NSDictionary *mask,CMTime time){DYMaskParameters p=dyDefaultMaskParameters();readParameters(mask[@"parameters"],&p);NSArray *keys=mask[@"keys"];if(!keys.count||!CMTIME_IS_NUMERIC(time))return p;if(keyTime(keys[0]).epoch!=time.epoch)return p;NSUInteger low=0,high=keys.count;while(low<high){NSUInteger mid=low+(high-low)/2;if(CMTimeCompare(keyTime(keys[mid]),time)<0)low=mid+1;else high=mid;}NSDictionary *left=keys[low?low-1:0],*right=keys[MIN(low,keys.count-1)];DYMaskParameters a,b;readParameters(left[@"parameters"],&a);readParameters(right[@"parameters"],&b);double duration=CMTimeGetSeconds(CMTimeSubtract(keyTime(right),keyTime(left)));float w=duration>0?fmax(0,fmin(1,CMTimeGetSeconds(CMTimeSubtract(time,keyTime(left)))/duration)):0;
|
||||
// Only temporal geometry/feather/strength interpolate; key selection and levels stay authored.
|
||||
float *v=&p.centerX,*av=&a.centerX,*bv=&b.centerX;for(int i=0;i<8;i++)v[i]=av[i]+(bv[i]-av[i])*w;return p;}
|
||||
struct DYMaskKeySpan {
|
||||
NSDictionary *left=nil,*right=nil;
|
||||
float fraction=0;
|
||||
};
|
||||
static DYMaskKeySpan maskKeySpan(NSDictionary *mask,CMTime time){
|
||||
NSArray *keys=mask[@"keys"];
|
||||
if(!keys.count||!CMTIME_IS_NUMERIC(time)||keyTime(keys[0]).epoch!=time.epoch)return {};
|
||||
NSUInteger low=0,high=keys.count;
|
||||
while(low<high){
|
||||
NSUInteger mid=low+(high-low)/2;
|
||||
if(CMTimeCompare(keyTime(keys[mid]),time)<0)low=mid+1;
|
||||
else high=mid;
|
||||
}
|
||||
NSDictionary *left=keys[low?low-1:0],*right=keys[MIN(low,keys.count-1)];
|
||||
double duration=CMTimeGetSeconds(CMTimeSubtract(keyTime(right),keyTime(left)));
|
||||
float fraction=duration>0?std::clamp(CMTimeGetSeconds(CMTimeSubtract(time,keyTime(left)))/duration,0.,1.):0;
|
||||
return {left,right,fraction};
|
||||
}
|
||||
static DYStampMotion stampMotionFromKey(NSDictionary *key){
|
||||
NSArray *v=key[@"stampMotion"];
|
||||
if(!v)return {};
|
||||
return {[v[0] floatValue],[v[1] floatValue],[v[2] floatValue],
|
||||
[v[3] floatValue],[v[4] floatValue],[v[5] floatValue],true};
|
||||
}
|
||||
static DYStampMotion stampMotionInSpan(DYMaskKeySpan span){
|
||||
auto a=stampMotionFromKey(span.left),b=stampMotionFromKey(span.right);
|
||||
if(span.fraction<=0)return a;
|
||||
if(span.fraction>=1)return b;
|
||||
auto blend=[&](float x,float y){return x+(y-x)*span.fraction;};
|
||||
return {blend(a.sourceOffsetX,b.sourceOffsetX),blend(a.sourceOffsetY,b.sourceOffsetY),
|
||||
blend(a.sourceScaleX,b.sourceScaleX),blend(a.sourceScaleY,b.sourceScaleY),
|
||||
blend(a.targetScaleX,b.targetScaleX),blend(a.targetScaleY,b.targetScaleY),a.active||b.active};
|
||||
}
|
||||
DYStampMotion DYStampMotionAtTime(NSDictionary *stamp,CMTime time){return stampMotionInSpan(maskKeySpan(stamp,time));}
|
||||
NSArray *DYStampSourceAtTime(NSDictionary *stamp,CMTime time){
|
||||
NSArray *source=stamp[@"stampSource"];
|
||||
DYStampMotion motion=DYStampMotionAtTime(stamp,time);
|
||||
if(!source||!motion.active)return source;
|
||||
return @[@(std::clamp([source[0] doubleValue]+motion.sourceOffsetX,0.,1.)),
|
||||
@(std::clamp([source[1] doubleValue]+motion.sourceOffsetY,0.,1.)),source[2],source[3]];
|
||||
}
|
||||
NSArray *DYStampSamplingScaleAtTime(NSDictionary *stamp,CMTime time){
|
||||
NSArray *base=stamp[@"stampSamplingScale"];
|
||||
DYStampMotion motion=DYStampMotionAtTime(stamp,time);
|
||||
if(!motion.active)return base;
|
||||
double x=(base?[base[0] doubleValue]:1)*motion.sourceScaleX/motion.targetScaleX;
|
||||
double y=(base?[base[1] doubleValue]:1)*motion.sourceScaleY/motion.targetScaleY;
|
||||
return @[@(std::clamp(x,1./256,256.)),@(std::clamp(y,1./256,256.))];
|
||||
}
|
||||
DYMaskParameters DYMaskAtTime(NSDictionary *mask,CMTime time){
|
||||
DYMaskParameters p=dyDefaultMaskParameters();
|
||||
readParameters(mask[@"parameters"],&p);
|
||||
BOOL stamp=mask[@"stampSource"]!=nil;
|
||||
if(stamp)p.angle=0;
|
||||
DYMaskKeySpan span=maskKeySpan(mask,time);
|
||||
if(!span.left)return p;
|
||||
DYMaskParameters a,b;
|
||||
readParameters(span.left[@"parameters"],&a);readParameters(span.right[@"parameters"],&b);
|
||||
float *v=&p.centerX,*av=&a.centerX,*bv=&b.centerX;
|
||||
for(int i=0;i<(stamp?2:8);i++)v[i]=av[i]+(bv[i]-av[i])*span.fraction;
|
||||
if(stamp){
|
||||
DYStampMotion motion=stampMotionInSpan(span);
|
||||
if(motion.active){
|
||||
p.width=std::clamp(p.width*motion.targetScaleX,.001f,4000.f);
|
||||
p.height=std::clamp(p.height*motion.targetScaleY,.001f,4000.f);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
NSDictionary *DYMaskKey(CMTime t,DYMaskParameters p,BOOL manual,float confidence){return @{@"value":@(t.value),@"scale":@(t.timescale),@"epoch":@(t.epoch),@"parameters":parameterData(p),@"manual":@(manual),@"confidence":@(confidence)};}
|
||||
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples){if(!samples.count)return YES;NSMutableArray *all=[NSMutableArray array];CMTime lo=keyTime(samples.firstObject),hi=keyTime(samples.lastObject);if(CMTimeCompare(lo,hi)>0)std::swap(lo,hi);for(NSDictionary *key in m[@"keys"])if([key[@"manual"]boolValue]||CMTimeCompare(keyTime(key),lo)<0||CMTimeCompare(keyTime(key),hi)>0)[all addObject:key];for(NSDictionary *key in samples){BOOL manual=NO;for(NSDictionary *old in all)if(CMTimeCompare(keyTime(old),keyTime(key))==0){manual=YES;break;}if(!manual)[all addObject:key];}[all sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){return (NSComparisonResult)CMTimeCompare(keyTime(a),keyTime(b));}];NSMutableDictionary *candidate=DYMutablePlist(m);candidate[@"keys"]=all;if(!DYValidToolMask(candidate))return NO;m[@"keys"]=all;return YES;}
|
||||
NSDictionary *DYStampKey(CMTime time,DYMaskParameters p,BOOL manual,float confidence,DYStampMotion motion){
|
||||
NSDictionary *key=DYMaskKey(time,p,manual,confidence);
|
||||
if(!motion.active)return key;
|
||||
NSMutableDictionary *paired=[[key mutableCopy]autorelease];
|
||||
paired[@"stampMotion"]=@[@(motion.sourceOffsetX),@(motion.sourceOffsetY),@(motion.sourceScaleX),
|
||||
@(motion.sourceScaleY),@(motion.targetScaleX),@(motion.targetScaleY)];
|
||||
return paired;
|
||||
}
|
||||
// Analysis supplies a contiguous pass in either time direction. A symmetric
|
||||
// kernel has no phase lag, and shrinking it at the ends keeps the seed and
|
||||
// the last trusted frame fixed. Work in log scale so zoom in/out is symmetric.
|
||||
static NSArray *smoothStampTrackingSamples(NSArray *samples){
|
||||
if(samples.count<3)return samples;
|
||||
for(NSDictionary *key in samples)
|
||||
if(!key[@"stampMotion"]||[key[@"manual"]boolValue])return samples;
|
||||
|
||||
NSMutableArray *result=[NSMutableArray arrayWithCapacity:samples.count];
|
||||
[result addObject:samples.firstObject];
|
||||
for(NSUInteger i=1;i+1<samples.count;i++){
|
||||
NSUInteger radius=std::min<NSUInteger>(2,std::min(i,samples.count-1-i));
|
||||
const double weights[]={1,4,6,4,1};
|
||||
const double endWeights[]={1,2,1};
|
||||
double values[8]={};
|
||||
for(NSUInteger j=0;j<=2*radius;j++){
|
||||
NSDictionary *neighbor=samples[i-radius+j];
|
||||
DYMaskParameters p;
|
||||
if(!readParameters(neighbor[@"parameters"],&p))return samples;
|
||||
auto m=stampMotionFromKey(neighbor);
|
||||
double weight=radius==2?weights[j]/16:endWeights[j]/4;
|
||||
const double components[]={p.centerX,p.centerY,m.sourceOffsetX,m.sourceOffsetY,
|
||||
std::log(m.sourceScaleX),std::log(m.sourceScaleY),std::log(m.targetScaleX),std::log(m.targetScaleY)};
|
||||
for(int k=0;k<8;k++)values[k]+=weight*components[k];
|
||||
}
|
||||
NSDictionary *original=samples[i];
|
||||
DYMaskParameters p;
|
||||
if(!readParameters(original[@"parameters"],&p))return samples;
|
||||
p.centerX=values[0];p.centerY=values[1];
|
||||
auto scale=[&](int index){return float(std::clamp(std::exp(values[index]),1./16,16.));};
|
||||
DYStampMotion m={float(values[2]),float(values[3]),scale(4),scale(5),scale(6),scale(7),true};
|
||||
[result addObject:DYStampKey(keyTime(original),p,NO,[original[@"confidence"]floatValue],m)];
|
||||
}
|
||||
[result addObject:samples.lastObject];
|
||||
return result;
|
||||
}
|
||||
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples,CMTime frameDuration){
|
||||
if(!samples.count)return YES;
|
||||
NSMutableArray *all=[NSMutableArray array];
|
||||
NSMutableDictionary *manualByTime=[NSMutableDictionary dictionary];
|
||||
CMTime lo=keyTime(samples.firstObject),hi=keyTime(samples.lastObject);
|
||||
if(CMTimeCompare(lo,hi)>0)std::swap(lo,hi);
|
||||
if(m[@"stampSource"]&&CMTIME_IS_NUMERIC(frameDuration)&&frameDuration.value>0){
|
||||
samples=smoothStampTrackingSamples(samples);
|
||||
// FCP can shift analysis timestamps by a fraction of a frame between passes.
|
||||
// Replace an older automatic key belonging to the first or last new frame.
|
||||
CMTime half=CMTimeMultiplyByRatio(frameDuration,1,2);
|
||||
lo=CMTimeSubtract(lo,half);hi=CMTimeAdd(hi,half);
|
||||
}
|
||||
// Normalize equivalent time fractions when preserving authored keys.
|
||||
auto timeID=[](NSDictionary *key){
|
||||
CMTime time=keyTime(key);
|
||||
int64_t divisor=time.timescale>0?std::gcd(time.value%time.timescale,int64_t(time.timescale)):1;
|
||||
return [NSString stringWithFormat:@"%lld/%lld/%lld",time.value/divisor,time.timescale/divisor,time.epoch];
|
||||
};
|
||||
for(NSDictionary *key in m[@"keys"]){
|
||||
if([key[@"manual"] boolValue]){manualByTime[timeID(key)]=@(all.count);[all addObject:key];}
|
||||
else if(CMTimeCompare(keyTime(key),lo)<0||CMTimeCompare(keyTime(key),hi)>0)[all addObject:key];
|
||||
}
|
||||
for(NSDictionary *key in samples){
|
||||
NSNumber *index=manualByTime[timeID(key)];
|
||||
if(!index){[all addObject:key];continue;}
|
||||
if(key[@"stampMotion"]){
|
||||
NSUInteger slot=index.unsignedIntegerValue;
|
||||
NSMutableDictionary *authored=[[all[slot] mutableCopy]autorelease];
|
||||
authored[@"stampMotion"]=key[@"stampMotion"];
|
||||
all[slot]=authored;
|
||||
}
|
||||
}
|
||||
[all sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){return (NSComparisonResult)CMTimeCompare(keyTime(a),keyTime(b));}];
|
||||
NSMutableDictionary *candidate=[[m mutableCopy]autorelease];
|
||||
candidate[@"keys"]=all;
|
||||
if(!DYValidToolMask(candidate))return NO;
|
||||
m[@"keys"]=all;
|
||||
return YES;
|
||||
}
|
||||
NSDictionary *DYToolRenderSnapshot(NSDictionary *doc,CMTime t){
|
||||
NSArray *shared=DYSharedMasks(doc);
|
||||
doc=DYExpandSharedMasks(doc,YES);
|
||||
auto resolve=[&](NSArray *masks){NSMutableArray *result=[NSMutableArray arrayWithCapacity:masks.count];for(NSDictionary *mask in masks){NSMutableDictionary *m=[[mask mutableCopy]autorelease];m[@"parameters"]=parameterData(DYMaskAtTime(mask,t));m[@"keys"]=@[];[result addObject:m];}return result;};
|
||||
NSMutableDictionary *out=[[doc mutableCopy]autorelease],*base=[NSMutableDictionary dictionary];for(NSString *type in doc[@"baseMasks"])base[type]=resolve(doc[@"baseMasks"][type]);out[@"baseMasks"]=base;NSMutableArray *layers=[NSMutableArray array];for(NSDictionary *node in doc[@"layers"]){NSMutableDictionary *layer=[[node mutableCopy]autorelease];layer[@"masks"]=resolve(node[@"masks"]);[layers addObject:layer];}out[@"layers"]=layers;return out;
|
||||
auto resolve=[&](NSArray *masks){
|
||||
NSMutableArray *result=[NSMutableArray arrayWithCapacity:masks.count];
|
||||
for(NSDictionary *mask in masks){
|
||||
if(![mask[@"keys"]count]){[result addObject:mask];continue;}
|
||||
NSMutableDictionary *m=[[mask mutableCopy]autorelease];m[@"parameters"]=parameterData(DYMaskAtTime(mask,t));m[@"keys"]=@[];
|
||||
if(mask[@"stampSource"]){
|
||||
m[@"stampSource"]=DYStampSourceAtTime(mask,t);
|
||||
m[@"stampSamplingScale"]=DYStampSamplingScaleAtTime(mask,t)?:@[@1,@1];
|
||||
}
|
||||
[result addObject:m];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
NSMutableDictionary *out=[[doc mutableCopy]autorelease],*base=[NSMutableDictionary dictionary];
|
||||
for(NSString *type in doc[@"baseMasks"])base[type]=resolve(doc[@"baseMasks"][type]);out[@"baseMasks"]=base;
|
||||
NSMutableArray *layers=[NSMutableArray array];
|
||||
for(NSDictionary *node in doc[@"layers"]){NSMutableDictionary *layer=[[node mutableCopy]autorelease];layer[@"masks"]=resolve(node[@"masks"]);[layers addObject:layer];}
|
||||
out[@"layers"]=layers;
|
||||
NSMutableArray *stamps=[NSMutableArray array];for(NSDictionary *mask in shared)if(mask[@"stampSource"])[stamps addObject:mask];
|
||||
if(stamps.count){out[@"schema"]=@3;out[@"sharedMasks"]=resolve(stamps);}
|
||||
return out;
|
||||
}
|
||||
DYUniforms DYToolUniforms(NSDictionary *node){DYUniforms u;DYDefaultUniforms(&u);NSString *type=node[@"type"];for(NSDictionary *s in DYSections())for(NSDictionary *d in DYDescriptors())if([d[@"pid"]isEqual:s[@"enabled"]])*(float*)((uint8_t*)&u+[d[@"offset"]unsignedIntegerValue])=0;u.primarySectionEnabled=0;u.cm.configured=-1;u.inputProfile=u.preLUTStrength=0;u.skinProtection.x=0;
|
||||
NSArray *parts=[type isEqual:@"primary"]?@[@"input",@"primary",@"output"]:[type isEqual:@"base"]?@[@"base",@"color"]:@[type];for(NSString *part in parts){NSDictionary *s=DYToolSection(part);for(NSDictionary *d in DYDescriptors())if([d[@"pid"]isEqual:s[@"enabled"]])*(float*)((uint8_t*)&u+[d[@"offset"]unsignedIntegerValue])=1;}
|
||||
@@ -173,7 +368,19 @@ BOOL DYToolIsNeutral(NSDictionary *node){NSString *type=node[@"type"];DYUniforms
|
||||
- (void)dealloc{[_nodeID release];[_type release];[_pending release];[_token release];[super dealloc];}
|
||||
- (id)apiForProtocol:(Protocol*)p{if(protocol_isEqual(p,@protocol(FxParameterRetrievalAPI_v6))||protocol_isEqual(p,@protocol(FxParameterSettingAPI_v6))||protocol_isEqual(p,@protocol(FxCustomParameterActionAPI_v4)))return self;return [_host apiForProtocol:p];}
|
||||
- (void)startAction:(id)sender{if(_depth++==0){[[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]startAction:sender];_time=[(id<FxCustomParameterActionAPI_v4>)[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]currentTime];[_pending release];_pending=[DYMutablePlist(DYReadTools(_host,_time).document)retain];}}
|
||||
- (void)endAction:(id)sender{if(_depth<=0)return;if(--_depth==0){NSDictionary *original=DYReadTools(_host,_time).document;if(![_pending isEqual:original])DYWriteTools(_host,_pending,_time);if(_token)[[_host apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:_token toParameter:DYInspectorParameterID atTime:_time];[_token release];_token=nil;[[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]endAction:sender];}}
|
||||
- (void)endAction:(id)sender{
|
||||
if(_depth<=0||--_depth>0)return;
|
||||
@try{
|
||||
NSDictionary *original=DYReadTools(_host,_time).document;
|
||||
if(![_pending isEqual:original]&&!DYWriteTools(_host,_pending,_time))
|
||||
os_log_error(OS_LOG_DEFAULT,"dayu_tool_save_rejected kind=document");
|
||||
if(_token&&![[_host apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setCustomParameterValue:_token toParameter:DYInspectorParameterID atTime:_time])
|
||||
os_log_error(OS_LOG_DEFAULT,"dayu_tool_save_rejected kind=inspector");
|
||||
}@finally{
|
||||
[_token release];_token=nil;
|
||||
[[_host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)]endAction:sender];
|
||||
}
|
||||
}
|
||||
- (CMTime)currentTime{return _time;}
|
||||
- (NSDictionary*)node{return DYToolWithID(_pending?:DYReadTools(_host,_time).document,_nodeID);}
|
||||
- (BOOL)getFloatValue:(double*)out fromParameter:(UInt32)pid atTime:(CMTime)t{NSDictionary *n=[self node];DYUniforms u=DYToolUniforms(n?:@{@"type":_type});for(NSDictionary *d in DYDescriptors())if([d[@"pid"]unsignedIntValue]==pid){*out=[d[@"offset"]integerValue]>=0?*(float*)((uint8_t*)&u+[d[@"offset"]unsignedIntegerValue]):[d[@"default"]doubleValue];return YES;}return NO;}
|
||||
|
||||
@@ -7,13 +7,34 @@
|
||||
auto timeAt=[](int frame){return CMTimeMake(frame*1001,24000);};auto capture=[&](int step){setFrame(step);host->_time=timeAt(step);NSData *state=nil;[plugin pluginState:&state atTime:host->_time quality:(FxQuality)0 error:&error];return [plugin renderDestinationImage:out sourceImages:@[frame] pluginState:state atTime:host->_time error:&error];};
|
||||
auto request=[&](int direction){if(direction!=9)host->_state=kFxAnalysisState_NotAnalyzing;[plugin toolTrackRequested:[NSNotification notificationWithName:@"DYToolTrack" object:host userInfo:@{@"node":@"base:hsl",@"mask":mask[@"id"],@"direction":@(direction)}]];};
|
||||
auto drain=[&](){double end=NSProcessInfo.processInfo.systemUptime+.15;while(NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.005]];};CMTimeRange inputRange=CMTimeRangeMake(kCMTimeZero,CMTimeMake(6*1001,24000)),desired;
|
||||
NSMutableArray *updates=[NSMutableArray array];
|
||||
id observer=[NSNotificationCenter.defaultCenter addObserverForName:@"DYToolTrackingStatus" object:host queue:nil usingBlock:^(NSNotification *note){if(note.userInfo[@"tracking"])[updates addObject:note.userInfo];}];
|
||||
run.need(@"tracking-renders-valid-source-before-analysis",capture(0));run.record(@"inactive-tracking-avoids-full-frame-motion-readback",[[plugin valueForKey:@"toolCaptureDevices"]count]==0);int undoBefore=base->_undoStarts;request(1);BOOL callbacks=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:&error]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:&error];
|
||||
for(int i=0;i<6&&callbacks;i++){setFrame(i);callbacks&=[plugin analyzeFrame:frame atTime:timeAt(i) error:&error];}host->_state=kFxAnalysisState_AnalysisCompleted;[plugin cleanupAnalysis:nil];drain();NSDictionary *tracked=DYReadTools(base,kCMTimeZero).document[@"baseMasks"][@"hsl"][0];DYMaskParameters end=DYMaskAtTime(tracked,timeAt(5));run.record(@"host-callback-opencv-tracking-six-exact-frames",callbacks&&[tracked[@"keys"]count]==6&&fabs(end.centerX-(.5+10./tw))<.004&&fabs(end.centerY-(.5+5./th))<.004,@{@"keyCount":@([tracked[@"keys"]count]),@"centerX":@(end.centerX),@"centerY":@(end.centerY),@"error":reason(error)});
|
||||
run.record(@"tracking-results-use-one-undo-action",base->_undoStarts==undoBefore+1&&base->_undoStarts==base->_undoEnds);BOOL captureFreed=YES;for(NSDictionary *entry in [[plugin valueForKey:@"toolCaptureDevices"]allValues])captureFreed&=!entry[@"encoded"]&&!entry[@"bytes"]&&!entry[@"buffer"];run.record(@"completed-tracking-releases-4k-gpu-analysis-working-images",captureFreed);int writes=base->_undoStarts;[plugin cleanupAnalysis:nil];[plugin cleanupAnalysis:nil];drain();run.record(@"duplicate-analysis-cleanup-never-commits-twice",base->_undoStarts==writes);
|
||||
NSDictionary *lastPreview=updates.count>=2?updates[updates.count-2]:nil;
|
||||
DYMaskParameters shown{};
|
||||
[lastPreview[@"shape"] getBytes:&shown length:sizeof(shown)];
|
||||
NSData *previewPixels=lastPreview[@"rgba"];
|
||||
run.record(@"mask-analysis-emits-matching-frame-geometry-and-completed-progress",
|
||||
[lastPreview[@"completed"]intValue]==6&&[lastPreview[@"total"]intValue]==6&&
|
||||
fabs([lastPreview[@"time"]doubleValue]-CMTimeGetSeconds(timeAt(5)))<1e-9&&
|
||||
previewPixels.length==tw*th*4&&shown.centerX==end.centerX&&shown.centerY==end.centerY&&
|
||||
!lastPreview[@"sourceShape"]&&![updates.lastObject[@"tracking"]boolValue]&&host->_seekCount==0);
|
||||
run.record(@"tracking-results-use-one-undo-action",base->_undoStarts==undoBefore+1&&base->_undoStarts==base->_undoEnds);BOOL captureFreed=YES;for(NSDictionary *entry in [[plugin valueForKey:@"toolCaptureDevices"]allValues])captureFreed&=!entry[@"encoded"]&&!entry[@"bytes"]&&!entry[@"buffer"]&&!entry[@"previewBuffer"];run.record(@"completed-tracking-releases-4k-gpu-analysis-working-images",captureFreed);int writes=base->_undoStarts;[plugin cleanupAnalysis:nil];[plugin cleanupAnalysis:nil];drain();run.record(@"duplicate-analysis-cleanup-never-commits-twice",base->_undoStarts==writes);
|
||||
// Mid-analysis author edits must reject the result rather than clobber them.
|
||||
capture(0);request(1);callbacks=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=0;i<3&&callbacks;i++){setFrame(i);callbacks&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}NSMutableDictionary *changed=DYMutablePlist(DYReadTools(base,kCMTimeZero).document);changed[@"baseMasks"][@"hsl"][0][@"enabled"]=@NO;DYWriteTools(base,changed,kCMTimeZero);[plugin cleanupAnalysis:nil];drain();run.record(@"stale-analysis-cannot-overwrite-edited-mask",[DYReadTools(base,kCMTimeZero).document isEqual:changed]&&base->_undoStarts==writes);
|
||||
DYWriteTools(base,doc,kCMTimeZero);capture(0);request(1);callbacks=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=0;i<3&&callbacks;i++){setFrame(i);callbacks&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}request(9);setFrame(3);NSError *cancelError=nil;BOOL stopped=![plugin analyzeFrame:frame atTime:timeAt(3) error:&cancelError];drain();tracked=DYReadTools(base,kCMTimeZero).document[@"baseMasks"][@"hsl"][0];run.record(@"cancel-keeps-only-contiguous-trusted-segment",callbacks&&stopped&&[tracked[@"keys"]count]==3&&base->_undoStarts==writes+1);run.record(@"cancel-sends-sdk-quiet-analysis-termination",[cancelError.domain isEqual:FxPlugErrorDomain]&&cancelError.code==kFxError_UserCancelled);
|
||||
[updates removeAllObjects];
|
||||
DYWriteTools(base,doc,kCMTimeZero);capture(2);host->_state=kFxAnalysisState_NotAnalyzing;request(0);callbacks=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=2;i<6&&callbacks;i++){setFrame(i);callbacks&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}[plugin cleanupAnalysis:nil];drain();BOOL backward=host->_backwardStarts==1;callbacks&=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=2;i>=0&&callbacks;i--){setFrame(i);callbacks&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}[plugin cleanupAnalysis:nil];drain();tracked=DYReadTools(base,kCMTimeZero).document[@"baseMasks"][@"hsl"][0];run.record(@"bidirectional-passes-share-reference-and-merge-once",callbacks&&backward&&[tracked[@"keys"]count]==6&&base->_undoStarts==writes+2);
|
||||
NSUInteger previous=0;BOOL progress=YES,sawForward=NO,sawBackward=NO;
|
||||
for(NSDictionary *update in updates){
|
||||
if(!update[@"shape"])continue;
|
||||
NSUInteger current=[update[@"completed"]unsignedIntegerValue];
|
||||
progress&=current>=previous&&[update[@"total"]intValue]==6;
|
||||
if([update[@"backward"]boolValue])sawBackward=YES;else sawForward=YES;
|
||||
previous=current;
|
||||
}
|
||||
run.record(@"bidirectional-progress-counts-reference-once-and-never-regresses",progress&&sawForward&&sawBackward&&previous==6);
|
||||
DYWriteTools(base,doc,kCMTimeZero);capture(2);host->_timelineOffset=CMTimeMake(4,1);host->_state=kFxAnalysisState_NotAnalyzing;request(-2);BOOL range=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&CMTimeCompare(desired.start,timeAt(1))==0&&CMTimeCompare(desired.duration,timeAt(2))==0;[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=2;i>=1;i--){setFrame(i);[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}setFrame(0);NSError *singleStopError=nil;stopped=![plugin analyzeFrame:frame atTime:timeAt(0) error:&singleStopError];drain();tracked=DYReadTools(base,kCMTimeZero).document[@"baseMasks"][@"hsl"][0];run.record(@"backward-single-step-includes-reference-and-one-neighbor",range&&stopped&&[tracked[@"keys"]count]==2);run.record(@"single-step-sends-sdk-quiet-analysis-termination",[singleStopError.domain isEqual:FxPlugErrorDomain]&&singleStopError.code==kFxError_UserCancelled);
|
||||
run.record(@"backward-single-step-seeks-timeline-with-clip-offset",host->_seekCount==1&&CMTimeCompare(host->_seekTime,CMTimeAdd(CMTimeMake(4,1),timeAt(1)))==0&&CMTimeCompare(host->_time,timeAt(1))==0);
|
||||
DYWriteTools(base,doc,kCMTimeZero);capture(2);BOOL repeated=YES;for(int first=2;first<4;first++){request(2);repeated&=[plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];for(int i=first;i<=first+1&&repeated;i++){setFrame(i);repeated&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}[plugin cleanupAnalysis:nil];drain();repeated&=CMTimeCompare(host->_time,timeAt(first+1))==0;}run.record(@"repeated-forward-single-step-continues-source-frames-at-offset-clip",repeated&&host->_seekCount==3&&CMTimeCompare(host->_seekTime,CMTimeAdd(CMTimeMake(4,1),timeAt(4)))==0);
|
||||
@@ -66,5 +87,88 @@
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolTrackingStatus" object:host userInfo:@{@"node":@"shared",@"mask":sharedID,@"message":@"共享跟踪状态"}];BOOL statusVisible=[[[panel valueForKey:@"_status"]stringValue]isEqual:@"共享跟踪状态"];
|
||||
run.record(@"shared-mask-inspector-alias-activates-canvas-and-receives-canonical-status",aliasActive&&statusVisible&&[[(NSObject*)plugin valueForKey:@"_selectedToolNode"]isEqual:@"shared"]);
|
||||
}
|
||||
{
|
||||
NSMutableDictionary *stampDoc=DYMutablePlist([[[DYToolDocument alloc]init]autorelease].document);
|
||||
NSMutableDictionary *stamp=(id)DYAddSharedMask(stampDoc,DYMaskEllipse);
|
||||
NSString *stampID=stamp[@"id"];
|
||||
DYMaskParameters target=DYMaskAtTime(stamp,kCMTimeZero);
|
||||
target.centerX=.75f;target.centerY=.5f;target.width=.32f;target.height=.54f;
|
||||
stamp[@"parameters"]=[NSData dataWithBytes:&target length:sizeof(target)];
|
||||
stamp[@"stampSource"]=@[@.25,@.5,@.32,@.54];
|
||||
auto noise=[](int x,int y){
|
||||
uint32_t n=uint32_t(x)*73856093u^uint32_t(y)*19349663u;
|
||||
n^=n>>13;n*=1274126177u;
|
||||
return .15f+.7f*((n>>8)&255)/255.f;
|
||||
};
|
||||
auto pairedFrame=[&](int step,bool flatSource){
|
||||
Pixels pixels(tw*th*4);
|
||||
for(NSUInteger y=0;y<th;y++)for(NSUInteger x=0;x<tw;x++){
|
||||
bool source=x<tw/2;
|
||||
float cx=tw*(source?.25f:.75f),cy=th*.5f,scale=1+step*(source?-.025f:.035f);
|
||||
float u=(cx+(float(x)-cx-step*(source?-1.5f:2.f))/scale)/4;
|
||||
float v=(cy+(float(y)-cy-step*(source?1.f:-.75f))/scale)/4;
|
||||
int ix=int(floorf(u)),iy=int(floorf(v));float fx=u-ix,fy=v-iy;
|
||||
float top=noise(ix,iy)*(1-fx)+noise(ix+1,iy)*fx;
|
||||
float bottom=noise(ix,iy+1)*(1-fx)+noise(ix+1,iy+1)*fx;
|
||||
float code=source&&flatSource?.4f:top*(1-fy)+bottom*fy;
|
||||
float linear=powf((code+.055f)/1.055f,2.4f);
|
||||
auto index=(y*tw+x)*4;pixels[index]=pixels[index+1]=pixels[index+2]=linear;pixels[index+3]=1;
|
||||
}
|
||||
[[frame metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,tw,th) mipmapLevel:0 withBytes:pixels.data() bytesPerRow:tw*8];
|
||||
};
|
||||
auto requestStamp=[&](int start){
|
||||
host->_time=timeAt(start);host->_state=kFxAnalysisState_NotAnalyzing;
|
||||
[plugin toolTrackRequested:[NSNotification notificationWithName:@"DYToolTrack" object:host userInfo:@{@"node":@"shared",@"mask":stampID,@"direction":@1}]];
|
||||
return [plugin desiredAnalysisTimeRange:&desired forInputWithTimeRange:inputRange error:nil]&&
|
||||
[plugin setupAnalysisForTimeRange:desired frameDuration:timeAt(1) error:nil];
|
||||
};
|
||||
auto finish=[&](){host->_state=kFxAnalysisState_AnalysisCompleted;[plugin cleanupAnalysis:nil];drain();};
|
||||
DYWriteTools(base,stampDoc,kCMTimeZero);
|
||||
int beforeStamp=base->_undoStarts;
|
||||
BOOL paired=requestStamp(0);
|
||||
NSError *pairError=nil;
|
||||
for(int i=0;i<6&&paired;i++){pairedFrame(i,false);paired&=[plugin analyzeFrame:frame atTime:timeAt(i) error:&pairError];}
|
||||
finish();
|
||||
NSDictionary *saved=DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,stampID);
|
||||
DYStampMotion motion=DYStampMotionAtTime(saved,timeAt(5));
|
||||
DYMaskParameters covered=DYMaskAtTime(saved,timeAt(5));
|
||||
NSArray *sampled=DYStampSourceAtTime(saved,timeAt(5));
|
||||
lastPreview=updates.count>=2?updates[updates.count-2]:nil;
|
||||
DYMaskParameters shownSource{},shownTarget{};
|
||||
[lastPreview[@"sourceShape"] getBytes:&shownSource length:sizeof(shownSource)];
|
||||
[lastPreview[@"shape"] getBytes:&shownTarget length:sizeof(shownTarget)];
|
||||
run.record(@"clone-analysis-preview-displays-both-regions-on-the-same-frame",
|
||||
[lastPreview[@"completed"]intValue]==6&&fabs([lastPreview[@"time"]doubleValue]-CMTimeGetSeconds(timeAt(5)))<1e-9&&
|
||||
fabs(shownSource.centerX-[sampled[0]doubleValue])<1e-6&&shownTarget.centerX==covered.centerX&&
|
||||
fabs(shownTarget.width-covered.width)<1e-6&&[lastPreview[@"rgba"]length]==tw*th*4);
|
||||
run.record(@"host-clone-stamp-follows-two-independent-centers-and-scales",
|
||||
paired&&[saved[@"keys"] count]==6&&motion.active&&
|
||||
fabs(covered.centerX-(.75+10./tw))<.006&&fabs(covered.centerY-(.5-3.75/th))<.008&&
|
||||
fabs([sampled[0] doubleValue]-(.25-7.5/tw))<.006&&fabs([sampled[1] doubleValue]-(.5+5./th))<.008&&
|
||||
fabs(motion.targetScaleX-1.175)<.045&&fabs(motion.targetScaleY-1.175)<.045&&
|
||||
fabs(motion.sourceScaleX-.875)<.04&&fabs(motion.sourceScaleY-.875)<.04&&base->_undoStarts==beforeStamp+1,
|
||||
@{@"keys":@([saved[@"keys"] count]),@"source":sampled?:@[],@"target":@[@(covered.centerX),@(covered.centerY)],
|
||||
@"sourceScale":@[@(motion.sourceScaleX),@(motion.sourceScaleY)],
|
||||
@"targetScale":@[@(motion.targetScaleX),@(motion.targetScaleY)],@"error":reason(pairError)});
|
||||
DYStampMotion restart=DYStampMotionAtTime(saved,timeAt(2));
|
||||
paired=requestStamp(2);
|
||||
for(int i=2;i<6&&paired;i++){pairedFrame(i,false);paired&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}
|
||||
finish();
|
||||
saved=DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,stampID);
|
||||
DYStampMotion resumed=DYStampMotionAtTime(saved,timeAt(2));
|
||||
run.record(@"host-clone-stamp-restarts-from-current-paired-scale",
|
||||
paired&&[saved[@"keys"] count]==6&&resumed.active&&restart.sourceScaleX==resumed.sourceScaleX&&restart.targetScaleX==resumed.targetScaleX);
|
||||
DYWriteTools(base,stampDoc,kCMTimeZero);
|
||||
paired=requestStamp(0);
|
||||
for(int i=0;i<3&&paired;i++){pairedFrame(i,false);paired&=[plugin analyzeFrame:frame atTime:timeAt(i) error:nil];}
|
||||
pairedFrame(3,true);NSError *sourceLoss=nil;
|
||||
BOOL ended=![plugin analyzeFrame:frame atTime:timeAt(3) error:&sourceLoss];
|
||||
finish();
|
||||
saved=DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,stampID);
|
||||
run.record(@"host-clone-stamp-source-loss-stops-both-tracks-at-last-paired-frame",
|
||||
paired&&ended&&[saved[@"keys"] count]==3&&[sourceLoss.domain isEqual:FxPlugErrorDomain]&&
|
||||
sourceLoss.code==kFxError_UserCancelled&&[sourceLoss.localizedDescription containsString:@"取样区域"]);
|
||||
}
|
||||
[NSNotificationCenter.defaultCenter removeObserver:observer];
|
||||
[plugin release];
|
||||
}
|
||||
@@ -58,3 +58,16 @@ kernel void dyToolCapture(texture2d<float> source [[texture(0)]],device float* p
|
||||
if(pos.x>=info.x||pos.y>=info.y)return;uint2 point=uint2(pos.x,info.z?info.y-1-pos.y:pos.y);uint3 rgb=uint3(rint(source.read(point).rgb*255.f));
|
||||
pixels[pos.y*info.x+pos.x]=float((rgb.r*9798u+rgb.g*19235u+rgb.b*3735u+16384u)>>15)/255.f;
|
||||
}
|
||||
|
||||
// Reuse the analysis source texture for the lightweight color preview.
|
||||
kernel void dyToolTrackingPreview(texture2d<float> source [[texture(0)]],
|
||||
device uchar4 *pixels [[buffer(0)]],
|
||||
constant uint3 &info [[buffer(1)]],
|
||||
uint2 pos [[thread_position_in_grid]]){
|
||||
if(any(pos>=info.xy))return;
|
||||
constexpr sampler filter(coord::normalized,address::clamp_to_edge,filter::linear);
|
||||
float2 uv=(float2(pos)+.5f)/float2(info.xy);
|
||||
if(info.z)uv.y=1-uv.y;
|
||||
float3 rgb=source.sample(filter,uv).rgb;
|
||||
pixels[pos.y*info.x+pos.x]=uchar4(uchar3(rint(saturate(rgb)*255)),255);
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
@interface DYTrackingPreviewImage : NSView
|
||||
- (void)showFrame:(NSDictionary *)frame;
|
||||
@end
|
||||
|
||||
@implementation DYTrackingPreviewImage {
|
||||
NSDictionary *_frame;
|
||||
NSImage *_image;
|
||||
}
|
||||
- (instancetype)initWithFrame:(NSRect)frame {
|
||||
if((self=[super initWithFrame:frame]))self.clipsToBounds=YES;
|
||||
return self;
|
||||
}
|
||||
- (BOOL)isFlipped {return YES;}
|
||||
- (BOOL)isAccessibilityElement {return YES;}
|
||||
- (NSString *)accessibilityRole {return NSAccessibilityImageRole;}
|
||||
- (void)dealloc {[_frame release];[_image release];[super dealloc];}
|
||||
- (void)showFrame:(NSDictionary *)frame {
|
||||
[_frame release];_frame=[frame copy];[_image release];_image=nil;
|
||||
NSData *pixels=frame[@"rgba"];
|
||||
NSUInteger w=[frame[@"width"] unsignedIntegerValue],h=[frame[@"height"] unsignedIntegerValue];
|
||||
if(w&&h&&pixels.length==w*h*4){
|
||||
CGDataProviderRef provider=CGDataProviderCreateWithCFData((CFDataRef)pixels);
|
||||
CGColorSpaceRef space=CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
|
||||
CGImageRef cg=CGImageCreate(w,h,8,32,w*4,space,kCGImageAlphaNoneSkipLast,provider,nil,true,kCGRenderingIntentDefault);
|
||||
if(cg){_image=[[NSImage alloc]initWithCGImage:cg size:NSMakeSize(w,h)];CGImageRelease(cg);}
|
||||
CGColorSpaceRelease(space);CGDataProviderRelease(provider);
|
||||
}
|
||||
self.accessibilityLabel=_image?[NSString stringWithFormat:@"同步预览 · 源帧 %.3f 秒 · %@",[frame[@"time"] doubleValue],
|
||||
frame[@"sourceShape"]?@"取样与覆盖区域":@"蒙版轮廓"]:@"等待源帧";
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
- (void)drawShape:(NSData *)shape nodes:(NSData *)nodes inRect:(NSRect)rect source:(BOOL)source {
|
||||
if(shape.length!=sizeof(DYMaskParameters))return;
|
||||
DYMaskParameters p;[shape getBytes:&p length:sizeof(p)];
|
||||
double aspect=rect.size.width/rect.size.height,c=cos(p.angle),s=sin(p.angle);
|
||||
auto point=[&](double x,double y){
|
||||
double px=x*p.width*aspect,py=y*p.height;
|
||||
return NSMakePoint(rect.origin.x+(p.centerX+(px*c-py*s)/aspect)*rect.size.width,
|
||||
rect.origin.y+(p.centerY+px*s+py*c)*rect.size.height);
|
||||
};
|
||||
NSBezierPath *path=[NSBezierPath bezierPath];
|
||||
auto add=[&](NSPoint position,int i){if(i)[path lineToPoint:position];else [path moveToPoint:position];};
|
||||
if(p.kind==DYMaskBezier){
|
||||
auto contour=dyFlattenMask((const DYBezierNode *)nodes.bytes,nodes.length/sizeof(DYBezierNode));
|
||||
for(int i=0;i<contour.count;i++)add(point(contour.x[i],contour.y[i]),i);
|
||||
}else if(p.kind==DYMaskRectangle){
|
||||
const double corners[][2]={{-.5,-.5},{.5,-.5},{.5,.5},{-.5,.5}};
|
||||
for(int i=0;i<4;i++)add(point(corners[i][0],corners[i][1]),i);
|
||||
}else{
|
||||
for(int i=0;i<80;i++){double a=i*2*M_PI/80;add(point(.5*cos(a),.5*sin(a)),i);}
|
||||
}
|
||||
[path closePath];path.lineWidth=3.5;[NSColor.blackColor setStroke];[path stroke];
|
||||
if(source){CGFloat dashes[]={4,3};[path setLineDash:dashes count:2 phase:0];}
|
||||
[(source?NSColor.systemCyanColor:NSColor.systemYellowColor) setStroke];path.lineWidth=1.6;[path stroke];
|
||||
}
|
||||
- (void)drawRect:(NSRect)dirty {
|
||||
[NSColor.blackColor setFill];NSRectFill(NSIntersectionRect(dirty,self.bounds));
|
||||
if(!_image||NSIsEmptyRect(self.bounds))return;
|
||||
double aspect=[_frame[@"aspect"] doubleValue];
|
||||
if(!std::isfinite(aspect)||aspect<=0)aspect=_image.size.width/_image.size.height;
|
||||
CGFloat w=MIN(NSWidth(self.bounds),NSHeight(self.bounds)*aspect),h=w/aspect;
|
||||
NSRect picture=NSMakeRect(NSMidX(self.bounds)-w/2,NSMidY(self.bounds)-h/2,w,h);
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
NSRectClip(picture);
|
||||
if([_frame[@"flip"] boolValue]){
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
NSAffineTransform *flip=[NSAffineTransform transform];[flip translateXBy:0 yBy:2*NSMidY(picture)];[flip scaleXBy:1 yBy:-1];[flip concat];
|
||||
}
|
||||
[_image drawInRect:picture fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];
|
||||
if([_frame[@"flip"] boolValue])[NSGraphicsContext restoreGraphicsState];
|
||||
[self drawShape:_frame[@"shape"] nodes:_frame[@"nodes"] inRect:picture source:NO];
|
||||
[self drawShape:_frame[@"sourceShape"] nodes:nil inRect:picture source:YES];
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface DYTrackingProgressBar : NSView
|
||||
@property(nonatomic) double doubleValue;
|
||||
@end
|
||||
|
||||
@implementation DYTrackingProgressBar
|
||||
- (BOOL)isAccessibilityElement {return YES;}
|
||||
- (NSString *)accessibilityRole {return NSAccessibilityProgressIndicatorRole;}
|
||||
- (id)accessibilityValue {return @(_doubleValue);}
|
||||
- (id)accessibilityMinValue {return @0;}
|
||||
- (id)accessibilityMaxValue {return @1;}
|
||||
- (void)setDoubleValue:(double)value {
|
||||
_doubleValue=std::clamp(value,0.,1.);
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
- (void)drawRect:(NSRect)dirty {
|
||||
NSRect rail=NSInsetRect(self.bounds,0,2);
|
||||
CGFloat radius=NSHeight(rail)/2;
|
||||
NSBezierPath *track=[NSBezierPath bezierPathWithRoundedRect:rail xRadius:radius yRadius:radius];
|
||||
[[[NSColor labelColor] colorWithAlphaComponent:.18] setFill];
|
||||
[track fill];
|
||||
if(_doubleValue<=0)return;
|
||||
[NSGraphicsContext saveGraphicsState];[track addClip];
|
||||
NSRect fill=rail;fill.size.width*=_doubleValue;
|
||||
[NSColor.controlAccentColor setFill];NSRectFill(fill);
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface DYTrackingPreview : NSView
|
||||
- (instancetype)initWithTarget:(id)target action:(SEL)action;
|
||||
- (void)applyUpdate:(NSDictionary *)info;
|
||||
- (void)reset;
|
||||
@property(nonatomic,readonly) BOOL running;
|
||||
@property(nonatomic,readonly) NSString *maskID;
|
||||
@end
|
||||
|
||||
@implementation DYTrackingPreview {
|
||||
DYTrackingPreviewImage *_preview;
|
||||
NSTextField *_title,*_detail,*_status;
|
||||
NSButton *_action;
|
||||
DYTrackingProgressBar *_progress;
|
||||
NSString *_maskID;
|
||||
BOOL _running;
|
||||
}
|
||||
- (BOOL)isFlipped {return YES;}
|
||||
- (BOOL)running {return _running;}
|
||||
- (NSString *)maskID {return _maskID;}
|
||||
- (void)dealloc {[_maskID release];[super dealloc];}
|
||||
- (instancetype)initWithTarget:(id)target action:(SEL)action {
|
||||
if((self=[super initWithFrame:NSZeroRect])){
|
||||
self.identifier=@"DYTrackingPreview";
|
||||
_title=[DYThemeLabel labelWithString:@"跟踪预览"];_title.font=[NSFont systemFontOfSize:12 weight:NSFontWeightSemibold];
|
||||
_detail=[DYThemeLabel labelWithString:@""];_detail.font=[NSFont monospacedDigitSystemFontOfSize:10 weight:NSFontWeightRegular];
|
||||
_status=[DYThemeLabel labelWithString:@""];_status.font=[NSFont systemFontOfSize:11];_status.maximumNumberOfLines=2;_status.lineBreakMode=NSLineBreakByWordWrapping;
|
||||
_action=DYWorkspaceButton(@"停止跟踪",target,action);
|
||||
_progress=[[[DYTrackingProgressBar alloc]init]autorelease];_progress.accessibilityLabel=@"跟踪进度";
|
||||
_preview=[[[DYTrackingPreviewImage alloc]init]autorelease];[_preview showFrame:nil];
|
||||
for(NSView *view in @[_title,_detail,_status,_action,_progress,_preview])[self addSubview:view];
|
||||
self.hidden=YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)layout {
|
||||
[super layout];
|
||||
CGFloat w=NSWidth(self.bounds),h=NSHeight(self.bounds),body=MAX(1,w-16);
|
||||
_title.frame=NSMakeRect(8,6,MAX(1,w-108),18);
|
||||
_action.frame=NSMakeRect(MAX(0,w-98),2,92,24);
|
||||
_progress.frame=NSMakeRect(8,28,body,10);
|
||||
_status.frame=NSMakeRect(8,43,body,32);
|
||||
_preview.frame=NSMakeRect(8,80,body,MAX(1,h-106));
|
||||
_detail.frame=NSMakeRect(8,MAX(80,h-22),body,18);
|
||||
}
|
||||
- (void)applyUpdate:(NSDictionary *)info {
|
||||
if(![_maskID isEqual:info[@"mask"]]){[_maskID release];_maskID=[info[@"mask"]copy];}
|
||||
BOOL active=[info[@"tracking"] boolValue];
|
||||
if(active&&!info[@"shape"]){[_preview showFrame:nil];_detail.stringValue=@"";_title.stringValue=@"跟踪预览";}
|
||||
if(info[@"shape"]){
|
||||
BOOL stamp=info[@"sourceShape"]!=nil;
|
||||
_title.stringValue=stamp?@"图章跟踪预览":@"蒙版跟踪预览";
|
||||
[_preview showFrame:info];
|
||||
_detail.stringValue=[NSString stringWithFormat:@"%.3fs %@",[info[@"time"] doubleValue],stamp?@"青色取样 · 黄色覆盖":@"黄色轮廓"];
|
||||
}
|
||||
NSUInteger total=[info[@"total"] unsignedIntegerValue];
|
||||
if(active)_progress.doubleValue=total?[info[@"completed"] doubleValue]/total:0;
|
||||
_running=active;_action.title=active?@"停止跟踪":@"返回示波器";_action.accessibilityLabel=_action.title;
|
||||
_status.stringValue=info[@"message"]?:@"";_status.toolTip=_status.stringValue;
|
||||
}
|
||||
- (void)reset {
|
||||
_progress.doubleValue=0;[_preview showFrame:nil];[_maskID release];_maskID=nil;_running=NO;self.hidden=YES;
|
||||
}
|
||||
@end
|
||||
@@ -1,13 +1,48 @@
|
||||
// One OSC root owns a lower-left tool rail and independent movable editors.
|
||||
// One OSC root owns a lower-right tool rail and independent movable editors.
|
||||
// Positions are view state; opening, moving and channel selection never edit a grade.
|
||||
#import "DYTheme.h"
|
||||
#include "DYViewerParameterPanel.inc.h"
|
||||
static const NSInteger DYViewerPartBase=20000;
|
||||
static void DYDrawDistortionGrid(NSRect rect,NSColor *color){
|
||||
CGFloat side=MIN(rect.size.width,rect.size.height);
|
||||
auto point=[&](CGFloat x,CGFloat y){
|
||||
CGFloat scale=side*(.34+.075*(x*x+y*y));
|
||||
return NSMakePoint(NSMidX(rect)+scale*x,NSMidY(rect)+scale*y);
|
||||
};
|
||||
NSBezierPath *grid=[NSBezierPath bezierPath];
|
||||
grid.lineWidth=MAX(.75,side*.067);
|
||||
for(CGFloat edge:{-1.,0.,1.})for(BOOL vertical:{NO,YES}){
|
||||
for(int i=0;i<=12;i++){
|
||||
CGFloat t=(i-6)/6.;
|
||||
NSPoint p=vertical?point(edge,t):point(t,edge);
|
||||
if(i==0)[grid moveToPoint:p];else [grid lineToPoint:p];
|
||||
}
|
||||
}
|
||||
[color setStroke];[grid stroke];
|
||||
}
|
||||
static void DYDrawCloneStamp(NSRect rect,NSColor *color){
|
||||
CGFloat side=NSWidth(rect),x=NSMinX(rect),y=NSMinY(rect);
|
||||
NSBezierPath *handle=[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(x+side*.31,y+side*.05,side*.38,side*.43) xRadius:side*.16 yRadius:side*.16];
|
||||
NSBezierPath *body=[NSBezierPath bezierPath];
|
||||
[body moveToPoint:NSMakePoint(x+side*.39,y+side*.31)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.61,y+side*.31)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.72,y+side*.55)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.88,y+side*.55)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.91,y+side*.78)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.09,y+side*.78)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.12,y+side*.55)];
|
||||
[body lineToPoint:NSMakePoint(x+side*.28,y+side*.55)];
|
||||
[body closePath];
|
||||
[color setFill];[handle fill];[body fill];
|
||||
[[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(x+side*.10,y+side*.86,side*.80,side*.09) xRadius:side*.045 yRadius:side*.045]fill];
|
||||
}
|
||||
@interface DYViewerControls : NSObject
|
||||
@property(nonatomic,retain) DYViewerParameterBridge *bridge;
|
||||
- (void)setViewport:(NSRect)viewport;
|
||||
- (void)prepareWithSize:(NSSize)size scale:(CGFloat)scale atTime:(CMTime)time;
|
||||
- (void)draw;
|
||||
- (NSRect)drawingBounds;
|
||||
@property(nonatomic) BOOL stampArmed;
|
||||
- (NSInteger)partAtPoint:(NSPoint)point;
|
||||
- (BOOL)event:(NSEventType)type point:(NSPoint)point atTime:(CMTime)time;
|
||||
- (BOOL)mouseMoved:(NSPoint)point;
|
||||
@@ -18,15 +53,15 @@ static const NSInteger DYViewerPartBase=20000;
|
||||
@end
|
||||
@implementation DYViewerControls {
|
||||
DYViewerParameterBridge *_bridge;NSMutableArray *_panels,*_areas;DYViewerParameterPanel *_capture;
|
||||
NSRect _viewport,_rail;NSSize _size;CGFloat _scale;CMTime _time;NSInteger _pressed,_hover,_railPage;BOOL _hasViewport,_pendingSkinPreview;
|
||||
NSRect _viewport,_rail;NSSize _size;CGFloat _scale,_backingScale;CMTime _time;NSInteger _pressed,_hover,_railPage;BOOL _hasViewport,_pendingSkinPreview;
|
||||
}
|
||||
@synthesize bridge=_bridge;
|
||||
- (instancetype)init{if((self=[super init])){_panels=[NSMutableArray new];_areas=[NSMutableArray new];_scale=1;_time=kCMTimeInvalid;}return self;}
|
||||
- (void)dealloc{[self finishCapture];[_bridge release];[_panels release];[_areas release];[super dealloc];}
|
||||
- (void)setBridge:(DYViewerParameterBridge*)bridge{if(bridge==_bridge)return;[self finishCapture];for(DYViewerParameterPanel*p in _panels)p.bridge=nil;[_panels removeAllObjects];[_bridge release];_bridge=[bridge retain];_pendingSkinPreview=NO;}
|
||||
- (void)setBridge:(DYViewerParameterBridge*)bridge{if(bridge==_bridge)return;[self finishCapture];for(DYViewerParameterPanel*p in _panels)p.bridge=nil;[_panels removeAllObjects];[_bridge release];_bridge=[bridge retain];_pendingSkinPreview=NO;_stampArmed=NO;}
|
||||
- (void)setViewport:(NSRect)viewport{_viewport=viewport;_hasViewport=YES;}
|
||||
- (void)prepareWithSize:(NSSize)size scale:(CGFloat)scale atTime:(CMTime)time{
|
||||
_size=size;_time=time;
|
||||
_size=size;_time=time;_backingScale=scale;
|
||||
if(_pendingSkinPreview){NSDictionary *snapshot=[_bridge snapshotAtTime:time];if(snapshot&&[self skinNodeInSnapshot:snapshot]){_pendingSkinPreview=NO;[self toggleSkinPreview];}}
|
||||
NSRect bounds=NSMakeRect(0,0,size.width,size.height),v=_hasViewport?NSIntersectionRect(_viewport,bounds):bounds;_viewport=v;
|
||||
_scale=MAX(.6,MIN(MAX(1.,scale),MIN(v.size.width/420.,v.size.height/350.)));CGFloat s=_scale;
|
||||
@@ -34,11 +69,12 @@ NSRect bounds=NSMakeRect(0,0,size.width,size.height),v=_hasViewport?NSIntersecti
|
||||
if(_capture&&![_capture capturing])_capture=nil;
|
||||
[_areas removeAllObjects];if(!_bridge||v.size.width<100||v.size.height<80)return;
|
||||
// Only tools that benefit from direct image interaction belong on the canvas.
|
||||
NSArray *types=@[@"curve",@"lens",@"skin",@"look"],*titles=@[@"曲线",@"畸变",@"肤色",@"LUT"],*symbols=@[@"point.topleft.down.to.point.bottomright.curvepath",@"camera.aperture",@"person.crop.circle",@"square.stack.3d.up"];
|
||||
CGFloat railScale=MIN(s,MIN((v.size.width-24)/388.,(v.size.height-16)/27.));CGFloat x=NSMinX(v)+8*railScale,y=NSMaxY(v)-33*railScale,w=36*railScale;
|
||||
_rail=NSMakeRect(x,y,276*railScale,25*railScale);
|
||||
NSArray *types=@[@"curve",@"lens",@"skin",@"look",@"whiteBalance",@"cloneStamp"],*titles=@[@"曲线",@"畸变修复",@"肤色",@"LUT",@"白平衡吸管",@"仿制图章"],*symbols=@[@"point.topleft.down.to.point.bottomright.curvepath",@"pincushion-grid",@"person.crop.circle",@"square.stack.3d.up",@"eyedropper",@"clone-stamp"];
|
||||
CGFloat railScale=MIN(s,v.size.width/480.),y=NSMaxY(v)-33*railScale,w=36*railScale;
|
||||
CGFloat x=NSMaxX(v)-476*railScale;
|
||||
_rail=NSMakeRect(x,y,356*railScale,25*railScale);
|
||||
for(NSInteger i=0;i<3;i++)[_areas addObject:@{@"part":@(20010+i),@"kind":@"mask",@"index":@([@[@1,@0,@2][i]integerValue]),@"title":@[@"矩形",@"椭圆",@"钢笔"][i],@"symbol":@[@"rectangle",@"circle",@"pencil.tip"][i],@"rect":[NSValue valueWithRect:NSMakeRect(x+i*40*railScale,y,w,25*railScale)]}];
|
||||
for(NSInteger i=0;i<4;i++)[_areas addObject:@{@"part":@(20020+i),@"kind":@"tool",@"toolType":types[i],@"title":titles[i],@"symbol":symbols[i],@"rect":[NSValue valueWithRect:NSMakeRect(x+(i+3)*40*railScale,y,w,25*railScale)]}];
|
||||
for(NSInteger i=0;i<types.count;i++)[_areas addObject:@{@"part":@(20020+i),@"kind":@"tool",@"toolType":types[i],@"title":titles[i],@"symbol":symbols[i],@"rect":[NSValue valueWithRect:NSMakeRect(x+(i+3)*40*railScale,y,w,25*railScale)]}];
|
||||
CGFloat buttonWidth=100*railScale,buttonHeight=27*railScale;
|
||||
[_areas addObject:@{@"part":@20001,@"kind":@"workspace",@"title":@"控制面板",@"rect":[NSValue valueWithRect:NSMakeRect(NSMaxX(v)-buttonWidth-8*railScale,NSMaxY(v)-buttonHeight-8*railScale,buttonWidth,buttonHeight)]}];
|
||||
}
|
||||
@@ -66,12 +102,32 @@ NSRect bounds=NSMakeRect(0,0,size.width,size.height),v=_hasViewport?NSIntersecti
|
||||
DYUniforms u;if([node hasPrefix:@"base:"]){NSData *raw=snapshot[@"uniforms"];if(raw.length!=sizeof(u))return;[raw getBytes:&u length:sizeof(u)];}else u=DYToolUniforms(DYToolWithID(snapshot[@"document"],node));
|
||||
for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"skinVisualize"]){[_bridge beginParameter:d node:node value:u.skinVisualize atTime:_time];[_bridge changeValue:u.skinVisualize>.5?0:1];[_bridge endGesture];break;}
|
||||
}
|
||||
- (NSRect)drawingBounds{
|
||||
if(!_areas.count)return NSZeroRect;
|
||||
NSRect rect=_rail;
|
||||
for(NSDictionary *area in _areas)rect=NSUnionRect(rect,[area[@"rect"] rectValue]);
|
||||
for(DYViewerParameterPanel *panel in _panels){NSRect bounds=[panel drawingBounds];if(!NSIsEmptyRect(bounds))rect=NSUnionRect(rect,bounds);}
|
||||
// Tooltips and control shadows extend beyond the buttons.
|
||||
return NSIntersectionRect(_viewport,NSInsetRect(rect,-24*_scale,-32*_scale));
|
||||
}
|
||||
- (void)draw{
|
||||
if(!_areas.count)return;[NSGraphicsContext saveGraphicsState];NSRectClip(_viewport);CGFloat s=_scale;for(DYViewerParameterPanel*p in _panels)[p draw];
|
||||
for(NSDictionary*a in _areas){NSRect r=[a[@"rect"]rectValue];BOOL selected=[a[@"toolType"]isEqual:@"skin"]&&[self skinPreviewEnabled];for(DYViewerParameterPanel*p in _panels)if([p.toolType isEqual:a[@"toolType"]])selected=YES;
|
||||
for(NSDictionary*a in _areas){NSRect r=[a[@"rect"]rectValue];BOOL selected=([a[@"toolType"]isEqual:@"skin"]&&[self skinPreviewEnabled])||([a[@"toolType"]isEqual:@"cloneStamp"]&&_stampArmed);for(DYViewerParameterPanel*p in _panels)if([p.toolType isEqual:a[@"toolType"]])selected=YES;
|
||||
BOOL hover=_hover==[a[@"part"]integerValue];
|
||||
BOOL pressed=_pressed==[a[@"part"]integerValue];DYDrawSoftControl(r,4*s,NO,selected||hover,pressed);
|
||||
if(a[@"symbol"]){NSImage *icon=[NSImage imageWithSystemSymbolName:a[@"symbol"] accessibilityDescription:a[@"title"]];NSImageSymbolConfiguration *configuration=[[NSImageSymbolConfiguration configurationWithPointSize:14*s weight:NSFontWeightRegular]configurationByApplyingConfiguration:[NSImageSymbolConfiguration configurationWithPaletteColors:@[selected?NSColor.systemCyanColor:NSColor.whiteColor]]];icon=[icon imageWithSymbolConfiguration:configuration];CGFloat side=MIN(17*s,r.size.height-6*s);[icon drawInRect:NSMakeRect(NSMidX(r)-side/2,NSMidY(r)-side/2,side,side) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];continue;}
|
||||
if(a[@"symbol"]){
|
||||
NSColor *ink=selected?NSColor.systemCyanColor:NSColor.whiteColor;
|
||||
CGFloat side=MIN(17*s,r.size.height*.7);
|
||||
NSRect glyph=NSMakeRect(NSMidX(r)-side/2,NSMidY(r)-side/2,side,side);
|
||||
if([a[@"symbol"]isEqual:@"pincushion-grid"])DYDrawDistortionGrid(NSInsetRect(glyph,1,1),ink);
|
||||
else if([a[@"symbol"]isEqual:@"clone-stamp"])DYDrawCloneStamp(glyph,ink);
|
||||
else{
|
||||
NSImage *icon=[NSImage imageWithSystemSymbolName:a[@"symbol"] accessibilityDescription:a[@"title"]];
|
||||
NSImageSymbolConfiguration *configuration=[[NSImageSymbolConfiguration configurationWithPointSize:14*s weight:NSFontWeightRegular]configurationByApplyingConfiguration:[NSImageSymbolConfiguration configurationWithPaletteColors:@[ink]]];
|
||||
[[icon imageWithSymbolConfiguration:configuration]drawInRect:glyph fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// The bottom workspace entry keeps its explicit text label.
|
||||
NSMutableParagraphStyle*style=[[[NSMutableParagraphStyle alloc]init]autorelease];style.alignment=NSTextAlignmentCenter;
|
||||
NSShadow *shadow=[[[NSShadow alloc]init]autorelease];shadow.shadowColor=[NSColor colorWithWhite:0 alpha:.95];shadow.shadowBlurRadius=2;shadow.shadowOffset=NSMakeSize(0,-1);
|
||||
@@ -79,27 +135,29 @@ NSRect bounds=NSMakeRect(0,0,size.width,size.height),v=_hasViewport?NSIntersecti
|
||||
[a[@"title"]drawInRect:NSInsetRect(r,1,MAX(1.,(r.size.height-fontSize-3)/2)) withAttributes:attributes];
|
||||
if(selected){NSBezierPath *mark=[NSBezierPath bezierPath];[mark moveToPoint:NSMakePoint(NSMinX(r),NSMidY(r)-3*s)];[mark lineToPoint:NSMakePoint(NSMinX(r),NSMidY(r)+3*s)];[NSColor.systemCyanColor setStroke];mark.lineWidth=2*s;[mark stroke];}
|
||||
}
|
||||
for(NSDictionary *a in _areas)if(a[@"symbol"]&&_hover==[a[@"part"]integerValue]){NSRect r=[a[@"rect"]rectValue],tip=NSMakeRect(NSMaxX(r)+6*s,NSMinY(r),72*s,25*s);DYDrawSoftControl(tip,4*s,NO,NO,NO);[a[@"title"]drawInRect:NSInsetRect(tip,5*s,5*s)withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:10*s],NSForegroundColorAttributeName:NSColor.whiteColor}];break;}
|
||||
for(NSDictionary *a in _areas)if(a[@"symbol"]&&_hover==[a[@"part"]integerValue]){NSRect r=[a[@"rect"]rectValue],tip=NSMakeRect(NSMidX(r)-36*s,NSMinY(r)-28*s,72*s,25*s);DYDrawSoftControl(tip,4*s,NO,NO,NO);[a[@"title"]drawInRect:NSInsetRect(tip,5*s,5*s)withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:10*s],NSForegroundColorAttributeName:NSColor.whiteColor}];break;}
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}
|
||||
- (void)activateTool:(NSString*)type{
|
||||
if([type isEqual:@"cloneStamp"]){_stampArmed=!_stampArmed;return;}
|
||||
_stampArmed=NO;
|
||||
if([type isEqual:@"look"]){[_bridge requestWorkspacePage:@"lut"];return;}
|
||||
if([type isEqual:@"skin"]){[self toggleSkinPreview];return;}
|
||||
if([type isEqual:@"whiteBalance"]){[_bridge requestWhiteBalanceAtTime:_time];return;}
|
||||
for(DYViewerParameterPanel*p in [[_panels copy]autorelease])if([p.toolType isEqual:type]){[p finishCapture];p.bridge=nil;[_panels removeObjectIdenticalTo:p];return;}
|
||||
[_bridge requestTool:type];DYViewerParameterPanel*p=[[[DYViewerParameterPanel alloc]init]autorelease];p.toolType=type;p.bridge=_bridge;
|
||||
CGFloat x=16*_scale/MAX(1.,_viewport.size.width),offset=0;
|
||||
[p setInitialPosition:NSMakePoint(x+offset/MAX(1.,_viewport.size.width),(8*_scale+offset)/MAX(1.,_viewport.size.height))];[_panels addObject:p];
|
||||
[_panels addObject:p];
|
||||
}
|
||||
- (BOOL)event:(NSEventType)type point:(NSPoint)p atTime:(CMTime)time{
|
||||
if(!std::isfinite(p.x)||!std::isfinite(p.y))return NO;[self prepareWithSize:_size scale:_scale atTime:time];
|
||||
if(_capture){BOOL used=[_capture event:type point:p atTime:time];if(![_capture capturing]){_capture=nil;[self prepareWithSize:_size scale:_scale atTime:time];}return used;}
|
||||
if(!std::isfinite(p.x)||!std::isfinite(p.y))return NO;
|
||||
if(_capture){BOOL used=[_capture event:type point:p atTime:time];if(![_capture capturing]){_capture=nil;[self prepareWithSize:_size scale:_backingScale atTime:time];}return used;}
|
||||
NSInteger hit=[self partAtPoint:p];
|
||||
if(type==NSEventTypeLeftMouseDown){
|
||||
if(hit>=100000){NSInteger index=(hit-100000)/10000-1;if(index<0||index>=(NSInteger)_panels.count)return NO;DYViewerParameterPanel*panel=[[_panels[index]retain]autorelease];[_panels removeObjectIdenticalTo:panel];[_panels addObject:panel];_capture=panel;return [panel event:type point:p atTime:time];}
|
||||
if(!hit)return NO;_pressed=hit;return YES;
|
||||
}
|
||||
if(!_pressed)return NO;
|
||||
if(type==NSEventTypeLeftMouseUp){NSInteger pressed=_pressed;_pressed=0;if(hit==pressed){for(NSDictionary*a in _areas)if([a[@"part"]integerValue]==hit){NSString*kind=a[@"kind"];if([kind isEqual:@"tool"])[self activateTool:a[@"toolType"]];else if([kind isEqual:@"mask"])[_bridge requestMask:[a[@"index"]integerValue]];else if([kind isEqual:@"workspace"])[_bridge requestWorkspace];else if([kind isEqual:@"hidePanels"]){for(DYViewerParameterPanel*panel in _panels){[panel finishCapture];panel.bridge=nil;}[_panels removeAllObjects];}else if([kind isEqual:@"railPage"])_railPage++;break;}}[self prepareWithSize:_size scale:_scale atTime:time];}
|
||||
if(type==NSEventTypeLeftMouseUp){NSInteger pressed=_pressed;_pressed=0;if(hit==pressed){for(NSDictionary*a in _areas)if([a[@"part"]integerValue]==hit){NSString*kind=a[@"kind"];if([kind isEqual:@"tool"])[self activateTool:a[@"toolType"]];else if([kind isEqual:@"mask"]){_stampArmed=NO;[_bridge requestMask:[a[@"index"]integerValue]];}else if([kind isEqual:@"workspace"])[_bridge requestWorkspace];else if([kind isEqual:@"hidePanels"]){for(DYViewerParameterPanel*panel in _panels){[panel finishCapture];panel.bridge=nil;}[_panels removeAllObjects];}else if([kind isEqual:@"railPage"])_railPage++;break;}}[self prepareWithSize:_size scale:_backingScale atTime:time];}
|
||||
return YES;
|
||||
}
|
||||
- (BOOL)capturing{return _pressed||[_capture capturing];}
|
||||
|
||||
@@ -12,7 +12,15 @@
|
||||
publish();int undo=base->_undoStarts;NSDictionary *initial=[[base->_values copy]autorelease];
|
||||
NSMutableSet *types=[NSMutableSet set];NSInteger masks=0;CGFloat lastX=-1,y=-1;BOOL horizontal=YES;
|
||||
for(NSDictionary *a in [controls valueForKey:@"areas"]){if([a[@"kind"]isEqual:@"mask"])masks++;if([a[@"kind"]isEqual:@"tool"]){NSRect r=[a[@"rect"]rectValue];if(lastX>=0)horizontal&=r.origin.x>lastX&&r.origin.y==y;lastX=r.origin.x;y=r.origin.y;[types addObject:a[@"toolType"]];}}
|
||||
run.record(@"viewer-lower-left-rail-has-only-four-image-tools-and-three-persistent-mask-shapes",horizontal&&y>size.height*.9&&[types isEqual:[NSSet setWithArray:@[@"curve",@"lens",@"skin",@"look"]]]&&masks==3&&[[controls valueForKey:@"panels"]count]==0);
|
||||
run.record(@"viewer-lower-right-rail-has-six-image-tools-and-three-persistent-mask-shapes",horizontal&&lastX>size.width*.8&&y>size.height*.9&&[types isEqual:[NSSet setWithArray:@[@"curve",@"lens",@"skin",@"look",@"whiteBalance",@"cloneStamp"]]]&&masks==3&&[[controls valueForKey:@"panels"]count]==0);
|
||||
NSDictionary *stamp=areaFor(controls,@"tool",@"cloneStamp");
|
||||
click(stamp);BOOL armed=controls.stampArmed;click(stamp);
|
||||
run.record(@"viewer-stamp-arms-and-disarms-without-changing-the-grade",armed&&!controls.stampArmed&&[initial isEqual:base->_values]&&base->_undoStarts==undo);
|
||||
[controls prepareWithSize:NSMakeSize(3840,2160) scale:2 atTime:host->_time];
|
||||
NSRect overlay=[controls drawingBounds];
|
||||
double fraction=NSWidth(overlay)*NSHeight(overlay)/(3840.*2160.);
|
||||
run.record(@"viewer-idle-4k-toolbar-rasterizes-under-five-percent-of-the-canvas",fraction>0&&fraction<.05,@{@"canvasPixelFraction":@(fraction),@"overlayWidth":@(NSWidth(overlay)),@"overlayHeight":@(NSHeight(overlay))});
|
||||
publish();
|
||||
NSDictionary *workspace=areaFor(controls,@"workspace",nil);NSRect workspaceRect=[workspace[@"rect"]rectValue];
|
||||
run.record(@"viewer-control-panel-entry-is-labelled-and-anchored-at-bottom",[workspace[@"title"]isEqual:@"控制面板"]&&NSMidY(workspaceRect)>size.height*.9);
|
||||
__block NSInteger workspaceRequests=0;__block NSString *requestedPage=nil;__block NSInteger requestedMask=-1;
|
||||
@@ -23,16 +31,34 @@
|
||||
BOOL maskRoutes=YES;for(NSDictionary *a in [[[controls valueForKey:@"areas"]copy]autorelease])if([a[@"kind"]isEqual:@"mask"]){click(a);drain();maskRoutes&=[requestedPage isEqual:@"masks"]&&requestedMask==[a[@"index"]integerValue];}
|
||||
run.record(@"viewer-persistent-mask-entries-route-shapes-to-shared-workspace",maskRoutes&&base->_undoStarts==undo);
|
||||
[NSNotificationCenter.defaultCenter removeObserver:observer];[requestedPage release];
|
||||
__block NSInteger eyedropperRequests=0;__block CMTime eyedropperTime=kCMTimeInvalid;
|
||||
id sampleObserver=[NSNotificationCenter.defaultCenter addObserverForName:@"DYViewerWhiteBalanceRequested" object:host queue:nil usingBlock:^(NSNotification *note){eyedropperRequests++;eyedropperTime=CMTimeMakeFromDictionary((CFDictionaryRef)note.userInfo[@"time"]);}];
|
||||
click(areaFor(controls,@"tool",@"whiteBalance"));drain();
|
||||
run.record(@"viewer-white-balance-icon-routes-a-single-time-bound-pick",eyedropperRequests==1&&CMTimeCompare(eyedropperTime,host->_time)==0&&!panelFor(@"whiteBalance")&&[initial isEqual:base->_values]);
|
||||
[NSNotificationCenter.defaultCenter removeObserver:sampleObserver];
|
||||
run.record(@"viewer-distortion-entry-uses-pincushion-grid", [areaFor(controls,@"tool",@"lens")[@"symbol"]isEqual:@"pincushion-grid"]);
|
||||
|
||||
click(areaFor(controls,@"tool",@"skin"));drain();publish();
|
||||
run.record(@"viewer-skin-entry-toggles-actual-protection-preview-without-parameter-card",value(@"skinVisualize")==1&&!panelFor(@"skin")&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
click(areaFor(controls,@"tool",@"skin"));drain();publish();run.record(@"viewer-skin-preview-toggle-restores-review-image",value(@"skinVisualize")==0&&!panelFor(@"skin"));
|
||||
click(areaFor(controls,@"tool",@"curve"));id curve=panelFor(@"curve");
|
||||
run.record(@"viewer-curve-is-graph-only-without-title-catalog-or-parameter-page",curve&&areaFor(curve,@"curvePlot",nil)&&!areaFor(curve,@"open",nil)&&!areaFor(curve,@"catalog",nil)&&!areaFor(curve,@"graphMode",nil)&&!areaFor(curve,@"slider",nil));
|
||||
NSRect plot=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue];NSPoint point=NSMakePoint(plot.origin.x+.43*plot.size.width,plot.origin.y+.18*plot.size.height);undo=base->_undoStarts;
|
||||
NSRect plot=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue],grip=[areaFor(curve,@"curveGrip",nil)[@"rect"]rectValue];
|
||||
run.record(@"viewer-curve-opens-above-the-lower-right-controls",NSMidX(plot)>size.width*.8&&NSMaxY(plot)<NSMinY(workspaceRect)&&NSMaxY(plot)>size.height*.8&&!NSIsEmptyRect(grip));
|
||||
NSPoint gripStart=NSMakePoint(NSMidX(grip),NSMidY(grip)),gripEnd=NSMakePoint(gripStart.x-70,gripStart.y-52);
|
||||
undo=base->_undoStarts;[controls event:NSEventTypeLeftMouseDown point:gripStart atTime:host->_time];[controls event:NSEventTypeLeftMouseDragged point:gripEnd atTime:host->_time];[controls event:NSEventTypeLeftMouseUp point:gripEnd atTime:host->_time];drain();
|
||||
NSRect shifted=[areaFor(curve,@"curvePlot",nil)[@"rect"]rectValue];
|
||||
run.record(@"viewer-curve-grip-moves-both-axes-without-a-grade-or-undo",fabs(NSMinX(shifted)-NSMinX(plot)+70)<.1&&fabs(NSMinY(shifted)-NSMinY(plot)+52)<.1&&base->_undoStarts==undo);
|
||||
plot=shifted;NSPoint point=NSMakePoint(plot.origin.x+.43*plot.size.width,plot.origin.y+.18*plot.size.height);undo=base->_undoStarts;
|
||||
[controls event:NSEventTypeLeftMouseDown point:point atTime:host->_time];NSString *xKey=[[[curve valueForKey:@"captured"][@"xKey"]copy]autorelease],*yKey=[[[curve valueForKey:@"captured"][@"yKey"]copy]autorelease];drain();
|
||||
[controls event:NSEventTypeLeftMouseDragged point:NSMakePoint(plot.origin.x+.54*plot.size.width,plot.origin.y+.23*plot.size.height)atTime:host->_time];drain();
|
||||
run.record(@"viewer-curve-point-is-live-xy-not-a-scalar-only-control",xKey&&yKey&&fabs(value(xKey)-.54)<1e-5&&fabs(value(yKey)-23)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo);
|
||||
[controls event:NSEventTypeLeftMouseUp point:NSMakePoint(plot.origin.x+.61*plot.size.width,plot.origin.y+.3*plot.size.height)atTime:host->_time];drain();publish();
|
||||
[controls event:NSEventTypeLeftMouseUp point:NSMakePoint(plot.origin.x+.61*plot.size.width,plot.origin.y+.3*plot.size.height)atTime:host->_time];
|
||||
auto visibleCurveX=[&](NSString *key)->double{for(NSDictionary *p in [curve performSelector:@selector(curvePoints)])if([p[@"xKey"]isEqual:key])return [p[@"x"]doubleValue];return NAN;};
|
||||
BOOL pendingStays=fabs(visibleCurveX(xKey)-.61)<1e-5;
|
||||
drain();[controls prepareWithSize:size scale:1 atTime:host->_time];
|
||||
run.record(@"viewer-curve-release-never-exposes-the-stale-plot-before-or-after-write",pendingStays&&fabs(visibleCurveX(xKey)-.61)<1e-5);
|
||||
publish();
|
||||
run.record(@"viewer-curve-final-release-commits-both-axes-with-one-undo",fabs(value(xKey)-.61)<1e-5&&fabs(value(yKey)-9)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
undo=base->_undoStarts;NSDictionary *deleteArea=areaFor(curve,@"deletePoint",nil);click(deleteArea);drain();publish();
|
||||
run.record(@"viewer-curve-delete-deactivates-the-selected-slot",deleteArea&&value(xKey)==-1&&value(yKey)==0&&base->_undoStarts==undo+1);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
- (void)setViewport:(NSRect)viewport;
|
||||
- (void)prepareWithSize:(NSSize)size scale:(CGFloat)scale atTime:(CMTime)time;
|
||||
- (void)draw;
|
||||
- (NSRect)drawingBounds;
|
||||
@property(nonatomic) BOOL stampArmed;
|
||||
- (NSInteger)partAtPoint:(NSPoint)point;
|
||||
- (BOOL)event:(NSEventType)type point:(NSPoint)point atTime:(CMTime)time;
|
||||
- (BOOL)mouseMoved:(NSPoint)point;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
return;
|
||||
}
|
||||
[NSGraphicsContext saveGraphicsState];NSRectClip(r);
|
||||
NSData *rawHistogram=_snapshot[@"histogram"];const DYHistogram *hist=rawHistogram.length==sizeof(DYHistogram)?(const DYHistogram*)rawHistogram.bytes:nullptr;
|
||||
NSData *rawHistogram=[_bridge canvasHistogramAtTime:_time];const DYHistogram *hist=rawHistogram.length==sizeof(DYHistogram)?(const DYHistogram*)rawHistogram.bytes:nullptr;
|
||||
if(hist&&hist->samples){uint32_t peak=1;for(int c=0;c<4;c++)if(_channel==0||c==_channel)for(int b=0;b<256;b++)peak=MAX(peak,hist->bins[c][b]);NSArray *colors=@[ink,NSColor.systemRedColor,NSColor.systemGreenColor,NSColor.systemBlueColor];for(int c=3;c>=0;c--){if(_channel&&c!=_channel)continue;NSBezierPath *area=[NSBezierPath bezierPath];[area moveToPoint:NSMakePoint(NSMinX(r),NSMaxY(r))];for(int b=0;b<256;b++)[area lineToPoint:NSMakePoint(NSMinX(r)+b/255.*r.size.width,NSMaxY(r)-sqrt(hist->bins[c][b]/double(peak))*r.size.height*.86)];[area lineToPoint:NSMakePoint(NSMaxX(r),NSMaxY(r))];[area closePath];[[colors[c]colorWithAlphaComponent:c==0?.08:.2]setFill];[area fill];}}
|
||||
[[ink colorWithAlphaComponent:.16]setStroke];NSBezierPath*grid=[NSBezierPath bezierPath];grid.lineWidth=.5*s;
|
||||
for(int i=0;i<5;i++){CGFloat x=r.origin.x+r.size.width*i/4,y=r.origin.y+r.size.height*i/4;[grid moveToPoint:NSMakePoint(x,NSMinY(r))];[grid lineToPoint:NSMakePoint(x,NSMaxY(r))];[grid moveToPoint:NSMakePoint(NSMinX(r),y)];[grid lineToPoint:NSMakePoint(NSMaxX(r),y)];}[grid stroke];
|
||||
@@ -130,5 +130,5 @@
|
||||
NSDictionary*values=@{xKey:@(x),yKey:@(y)};[_draftValues addEntriesFromDictionary:values];[_bridge changeValues:values];
|
||||
}
|
||||
- (void)deleteSelectedPoint{
|
||||
if(!_selectedX)return;for(NSDictionary*point in [self curvePoints])if([point[@"xKey"]isEqual:_selectedX]){NSString*x=point[@"xKey"],*y=point[@"yKey"];[_bridge beginParameters:@[[self descriptorForKey:x],[self descriptorForKey:y]]node:_nodeID values:@{x:@([self graphicValue:x]),y:@([self graphicValue:y])}atTime:_time];[_bridge changeValues:@{x:@(-1),y:@0}];[_bridge endGesture];break;}[_selectedX release];_selectedX=nil;
|
||||
if(!_selectedX)return;for(NSDictionary*point in [self curvePoints])if([point[@"xKey"]isEqual:_selectedX]){NSString*x=point[@"xKey"],*y=point[@"yKey"];[_bridge beginParameters:@[[self descriptorForKey:x],[self descriptorForKey:y]]node:_nodeID values:@{x:@([self graphicValue:x]),y:@([self graphicValue:y])}atTime:_time];NSDictionary *values=@{x:@(-1),y:@0};[_bridge changeValues:values];[self finishCurveWithValues:values];break;}[_selectedX release];_selectedX=nil;
|
||||
}
|
||||
@@ -15,16 +15,20 @@
|
||||
// incomplete samples are rejected as a unit, before the first host write.
|
||||
- (void)changeValues:(NSDictionary<NSString*,NSNumber*>*)values;
|
||||
- (void)endGesture;
|
||||
- (uint64_t)endCurveGesture;
|
||||
- (BOOL)gesturePending:(uint64_t)gesture;
|
||||
// Call before the owning plug-in releases this object during teardown.
|
||||
- (void)invalidate;
|
||||
- (void)requestWorkspace;
|
||||
- (void)requestWorkspacePage:(NSString *)page;
|
||||
- (void)requestMask:(NSInteger)kind;
|
||||
- (void)requestTool:(NSString*)type;
|
||||
- (void)publishAssets:(DYAssetState*)assets histogram:(NSData*)histogram atTime:(CMTime)time;
|
||||
- (void)requestWhiteBalanceAtTime:(CMTime)time;
|
||||
@property(nonatomic,retain) DYRenderer *renderer;
|
||||
- (NSData*)canvasHistogramAtTime:(CMTime)time;
|
||||
- (void)publishAssets:(DYAssetState*)assets atTime:(CMTime)time;
|
||||
- (void)beginSpider:(NSData*)mesh node:(NSString*)node enabled:(double)enabled atTime:(CMTime)time;
|
||||
- (void)changeSpider:(NSData*)mesh;
|
||||
- (void)publishHistogram:(NSData*)histogram atTime:(CMTime)time;
|
||||
@end
|
||||
|
||||
static BOOL DYViewerSameValue(double a,double b) {
|
||||
@@ -61,7 +65,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
|
||||
NSDictionary *_snapshot,*_sourceDocument;NSString *_selectedNode;
|
||||
CMTime _snapshotTime;
|
||||
BOOL _invalidated,_validationScheduled;
|
||||
uint64_t _requestSequence,_requestedGesture;
|
||||
uint64_t _requestSequence,_requestedGesture,_completedGesture;
|
||||
|
||||
// The fields below are confined to the main queue.
|
||||
id<PROAPIAccessing> _writerHost,_writerTarget;
|
||||
@@ -72,6 +76,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
|
||||
uint64_t _writerGesture;
|
||||
BOOL _writerUndoOpen,_writerSpider; NSData *_writerLastMesh;
|
||||
}
|
||||
@synthesize renderer=_renderer;
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager {
|
||||
if((self=[super init])){_apiManager=manager;_snapshotTime=kCMTimeInvalid;_writerTime=kCMTimeInvalid;[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(workspaceSelected:) name:@"DYWorkspaceToolSelection" object:manager];}return self;
|
||||
}
|
||||
@@ -79,14 +84,21 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
|
||||
// invalidate enqueues closure before the owner releases its final reference;
|
||||
// the queued block keeps the bridge alive until its host group is closed.
|
||||
NSCAssert(!_writerUndoOpen,@"Viewer parameter group must be closed before teardown");
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];[_selectedNode release];[_snapshot release];[_sourceDocument release];[_writerHost release];[_writerTarget release];
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[_selectedNode release];[_snapshot release];[_sourceDocument release];[_writerHost release];[_writerTarget release];
|
||||
[_writerDescriptors release];[_writerLastValues release];[_writerCompanions release];[_writerNode release];[_writerType release];[super dealloc];
|
||||
}
|
||||
- (void)publishAssets:(DYAssetState*)assets histogram:(NSData*)histogram atTime:(CMTime)time {
|
||||
@synchronized(self){if(_invalidated||!_snapshot||CMTimeCompare(time,_snapshotTime)!=0)return;NSMutableDictionary *next=[[_snapshot mutableCopy]autorelease];next[@"spider"]=assets.spiderMesh?:[NSData data];if(histogram)next[@"histogram"]=histogram;[_snapshot release];_snapshot=[next copy];}
|
||||
- (void)publishAssets:(DYAssetState*)assets atTime:(CMTime)time {
|
||||
@synchronized(self){if(_invalidated||!_snapshot||CMTimeCompare(time,_snapshotTime)!=0)return;NSMutableDictionary *next=[[_snapshot mutableCopy]autorelease];next[@"spider"]=assets.spiderMesh?:[NSData data];[_snapshot release];_snapshot=[next copy];}
|
||||
}
|
||||
- (void)publishHistogram:(NSData*)histogram atTime:(CMTime)time {
|
||||
if(histogram.length!=sizeof(DYHistogram))return;@synchronized(self){if(_invalidated||!_snapshot||CMTimeCompare(time,_snapshotTime)!=0)return;NSMutableDictionary *next=[[_snapshot mutableCopy]autorelease];next[@"histogram"]=histogram;[_snapshot release];_snapshot=[next copy];}
|
||||
- (NSData*)canvasHistogramAtTime:(CMTime)time {
|
||||
return [_renderer canvasHistogramAtTime:time];
|
||||
}
|
||||
- (void)requestWhiteBalanceAtTime:(CMTime)time {
|
||||
if(!CMTIME_IS_NUMERIC(time))return;
|
||||
dispatch_async(dispatch_get_main_queue(),^{
|
||||
id manager=nil;@synchronized(self){if(!self->_invalidated)manager=self->_apiManager;}
|
||||
if(manager)[NSNotificationCenter.defaultCenter postNotificationName:@"DYViewerWhiteBalanceRequested" object:manager userInfo:@{@"time":[(NSDictionary*)CMTimeCopyAsDictionary(time,kCFAllocatorDefault) autorelease]}];
|
||||
});
|
||||
}
|
||||
- (void)requestTool:(NSString*)type {
|
||||
if(![DYToolTypes()containsObject:type])return;
|
||||
@@ -121,9 +133,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
|
||||
NSData *bytes=[NSData dataWithBytes:uniforms length:sizeof(*uniforms)];BOOL validate=NO;
|
||||
@synchronized(self){
|
||||
if(!_invalidated){
|
||||
NSData *sameHistogram=CMTimeCompare(_snapshotTime,time)==0?[_snapshot[@"histogram"]retain]:nil;
|
||||
[_snapshot release];_snapshot=[@{@"uniforms":bytes,@"document":frozen,@"timeValue":@(time.value),@"timeScale":@(time.timescale),@"timeEpoch":@(time.epoch)}copy];
|
||||
if(sameHistogram){NSMutableDictionary *withHistogram=[[_snapshot mutableCopy]autorelease];withHistogram[@"histogram"]=sameHistogram;[_snapshot release];_snapshot=[withHistogram copy];[sameHistogram release];}
|
||||
[_sourceDocument release];_sourceDocument=[document retain];_snapshotTime=time;
|
||||
if(_requestedGesture&&!_validationScheduled){_validationScheduled=YES;validate=YES;}
|
||||
}
|
||||
@@ -329,9 +339,55 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
|
||||
if(gesture)dispatch_async(dispatch_get_main_queue(),^{[self writeValues:frozen gesture:gesture];});
|
||||
[frozen release];
|
||||
}
|
||||
- (void)endGesture {
|
||||
- (void)refreshSavedCurve {
|
||||
if(![_writerType isEqual:@"curve"])return;
|
||||
id<FxCustomParameterActionAPI_v4> action=[_writerHost apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];
|
||||
id<FxParameterRetrievalAPI_v6> get=[_writerHost apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
|
||||
BOOL base=[_writerNode hasPrefix:@"base:"];
|
||||
NSMutableDictionary *values=[NSMutableDictionary dictionary];
|
||||
NSDictionary *document=nil;
|
||||
[action startAction:self];@try{
|
||||
if(CMTimeCompare(DYHostDisplayedFrameTime(_writerHost,action.currentTime),_writerTime)!=0)return;
|
||||
if(base)for(NSDictionary *d in _writerDescriptors){
|
||||
double value=NAN;
|
||||
if(![get getFloatValue:&value fromParameter:[d[@"pid"]unsignedIntValue] atTime:_writerTime]||!std::isfinite(value))return;
|
||||
values[d[@"offset"]]=@(value);
|
||||
}else document=DYReadTools(_writerHost,_writerTime).document;
|
||||
}@finally{[action endAction:self];}
|
||||
@synchronized(self){
|
||||
if(_invalidated||!_snapshot||CMTimeCompare(_snapshotTime,_writerTime)!=0)return;
|
||||
NSMutableDictionary *next=[[_snapshot mutableCopy]autorelease];
|
||||
if(base){
|
||||
DYUniforms uniforms;
|
||||
[next[@"uniforms"] getBytes:&uniforms length:sizeof(uniforms)];
|
||||
for(NSNumber *offset in values)*(float*)((uint8_t*)&uniforms+offset.unsignedIntegerValue)=[values[offset]floatValue];
|
||||
next[@"uniforms"]=[NSData dataWithBytes:&uniforms length:sizeof(uniforms)];
|
||||
}else if(document){
|
||||
next[@"document"]=document;
|
||||
[_sourceDocument release];_sourceDocument=nil;
|
||||
}
|
||||
[_snapshot release];_snapshot=[next copy];
|
||||
}
|
||||
}
|
||||
- (uint64_t)finishGestureRefreshingCurve:(BOOL)refresh {
|
||||
uint64_t gesture;@synchronized(self){gesture=_requestedGesture;_requestedGesture=0;}
|
||||
if(gesture)dispatch_async(dispatch_get_main_queue(),^{if(self->_writerGesture==gesture)[self closeWriter];});
|
||||
if(gesture)dispatch_async(dispatch_get_main_queue(),^{
|
||||
if(self->_writerGesture==gesture){
|
||||
if(refresh)[self refreshSavedCurve];
|
||||
[self closeWriter];
|
||||
}
|
||||
@synchronized(self){self->_completedGesture=MAX(self->_completedGesture,gesture);}
|
||||
});
|
||||
return gesture;
|
||||
}
|
||||
- (void)endGesture {
|
||||
[self finishGestureRefreshingCurve:NO];
|
||||
}
|
||||
- (uint64_t)endCurveGesture {
|
||||
return [self finishGestureRefreshingCurve:YES];
|
||||
}
|
||||
- (BOOL)gesturePending:(uint64_t)gesture {
|
||||
@synchronized(self){return !_invalidated&&gesture>_completedGesture;}
|
||||
}
|
||||
- (void)invalidate {
|
||||
@synchronized(self){if(_invalidated)return;_invalidated=YES;_requestedGesture=0;_apiManager=nil;}
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
[document setObject:@[@"base"] forKey:@"removedBase"];
|
||||
run.record(@"viewer-bridge-published-snapshot-is-immutable-and-frame-bound",[snapshot[@"uniforms"]length]==sizeof(DYUniforms)&&![snapshot[@"document"][@"removedBase"]count]&&![bridge snapshotAtTime:CMTimeMake(1,24)]);
|
||||
int undo=base->_undoStarts;
|
||||
[bridge beginParameter:exposure node:@"base:base" value:0 atTime:kCMTimeZero];[bridge changeValue:.4];drain();
|
||||
[bridge beginParameter:exposure node:@"base:base" value:0 atTime:kCMTimeZero];[bridge changeValue:.4];
|
||||
// Wait for the asynchronous write itself, allowing a busy test runner to
|
||||
// service the main queue before asserting the still-open undo group.
|
||||
double writeDeadline=NSProcessInfo.processInfo.systemUptime+.5;
|
||||
while(fabs(value(exposure)-.4)>=1e-6&&NSProcessInfo.processInfo.systemUptime<writeDeadline)drain();
|
||||
run.record(@"viewer-bridge-drag-writes-before-mouse-up-asynchronously",fabs(value(exposure)-.4)<1e-6&&base->_undoStarts==undo+1&&base->_undoEnds==undo);
|
||||
[bridge changeValue:.8];[bridge endGesture];[bridge endGesture];drain();
|
||||
run.record(@"viewer-bridge-continuous-drag-closes-one-host-undo-group",fabs(value(exposure)-.8)<1e-6&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
@property(nonatomic,retain) DYViewerParameterBridge *bridge;
|
||||
@property(nonatomic,copy) NSString *toolType;
|
||||
@property(nonatomic) BOOL visible;
|
||||
- (void)setInitialPosition:(NSPoint)position;
|
||||
- (void)setViewport:(NSRect)viewport;
|
||||
- (NSRect)drawingBounds;
|
||||
- (void)prepareWithSize:(NSSize)size scale:(CGFloat)scale atTime:(CMTime)time;
|
||||
- (void)draw;
|
||||
- (NSInteger)partAtPoint:(NSPoint)point;
|
||||
@@ -21,18 +21,26 @@
|
||||
NSString *_nodeID,*_toolType,*_selectedX;NSMutableDictionary *_draftValues;NSInteger _channel,_hslAxis,_selectedSpider;NSData *_spiderDraft;BOOL _graphMode,_visible;NSSize _size;NSRect _panel,_viewport;BOOL _hasViewport;CGFloat _scale;BOOL _open,_catalog,_dragging,_hasDraft,_positioned,_movingPanel;NSPoint _position,_panelStart;
|
||||
NSInteger _page,_catalogPage,_capacity,_catalogCapacity,_hover,_pressed;NSPoint _down;NSDictionary *_captured;
|
||||
double _draftValue,_downValue;CGFloat _knobOffset;CMTime _time,_downTime;
|
||||
NSDictionary *_releasedCurveValues;uint64_t _curveCommit;CMTime _curveCommitTime;
|
||||
}
|
||||
@synthesize bridge=_bridge,toolType=_toolType,visible=_visible;
|
||||
- (void)setInitialPosition:(NSPoint)p{_position=p;_positioned=YES;}
|
||||
- (instancetype)init{if((self=[super init])){_areas=[NSMutableArray new];_nodeID=[@"base:base" copy];_scale=1;_open=YES;_visible=YES;_graphMode=YES;_selectedSpider=-1;_draftValues=[NSMutableDictionary new];_time=_downTime=kCMTimeInvalid;}return self;}
|
||||
- (void)dealloc{if(_pressed)[_bridge endGesture];[_bridge release];[_spiderDraft release];[_snapshot release];[_nodes release];[_rows release];[_areas release];[_nodeID release];[_toolType release];[_selectedX release];[_draftValues release];[_captured release];[super dealloc];}
|
||||
- (void)setBridge:(DYViewerParameterBridge*)bridge{if(bridge==_bridge)return;if(_pressed)[_bridge endGesture];[_bridge release];_bridge=[bridge retain];_pressed=0;_dragging=NO;_movingPanel=NO;[_captured release];_captured=nil;}
|
||||
- (void)dealloc{if(_pressed)[_bridge endGesture];[_bridge release];[_spiderDraft release];[_snapshot release];[_nodes release];[_rows release];[_areas release];[_nodeID release];[_toolType release];[_selectedX release];[_draftValues release];[_releasedCurveValues release];[_captured release];[super dealloc];}
|
||||
- (void)clearReleasedCurve{[_releasedCurveValues release];_releasedCurveValues=nil;_curveCommit=0;}
|
||||
- (void)finishCurveWithValues:(NSDictionary*)values{
|
||||
[self clearReleasedCurve];
|
||||
_releasedCurveValues=[values copy];_curveCommitTime=_time;
|
||||
_curveCommit=[_bridge endCurveGesture];
|
||||
}
|
||||
- (void)setBridge:(DYViewerParameterBridge*)bridge{if(bridge==_bridge)return;[self finishCapture];[self clearReleasedCurve];[_bridge release];_bridge=[bridge retain];}
|
||||
- (BOOL)capturing{return _pressed!=0;}
|
||||
- (BOOL)finishCapture{BOOL had=_pressed!=0;if(had)[_bridge endGesture];_pressed=0;_hasDraft=NO;[_spiderDraft release];_spiderDraft=nil;[_draftValues removeAllObjects];_movingPanel=NO;_dragging=NO;[_captured release];_captured=nil;return had;}
|
||||
- (NSDictionary*)descriptorForKey:(NSString*)key{for(NSDictionary*d in DYDescriptors())if([d[@"key"]isEqual:key])return d;return nil;}
|
||||
- (NSDictionary*)node{for(NSDictionary*n in _nodes)if([n[@"id"]isEqual:_nodeID])return n;return nil;}
|
||||
- (double)valueForDescriptor:(NSDictionary*)d{
|
||||
if(_pressed&&_draftValues[d[@"key"]])return [_draftValues[d[@"key"]]doubleValue];
|
||||
NSNumber *released=_releasedCurveValues[d[@"key"]];
|
||||
if(released)return released.doubleValue;
|
||||
if(_hasDraft&&_captured&&[_captured[@"descriptor"][@"pid"]isEqual:d[@"pid"]]&&_pressed)return _draftValue;
|
||||
NSDictionary*n=[self node];DYUniforms u;NSData*raw=_snapshot[@"uniforms"];if(raw.length!=sizeof(u))return [d[@"default"]doubleValue];
|
||||
if([_nodeID hasPrefix:@"base:"])[raw getBytes:&u length:sizeof(u)];else u=DYToolUniforms(n[@"layer"]);
|
||||
@@ -45,6 +53,7 @@
|
||||
- (void)prepareWithSize:(NSSize)canvasSize scale:(CGFloat)scale atTime:(CMTime)time{
|
||||
_size=canvasSize;NSRect viewport=_hasViewport?NSIntersectionRect(_viewport,NSMakeRect(0,0,canvasSize.width,canvasSize.height)):NSMakeRect(0,0,canvasSize.width,canvasSize.height);NSSize size=viewport.size;_scale=MAX(.6,MIN(MAX(1.,scale),MIN(size.width/360.,size.height/230.)));_time=time;
|
||||
if(_pressed&&(!CMTIME_IS_NUMERIC(time)||CMTimeCompare(time,_downTime)!=0)){[self finishCapture];}
|
||||
if(_releasedCurveValues&&(!_curveCommit||CMTimeCompare(time,_curveCommitTime)!=0||![_bridge gesturePending:_curveCommit]))[self clearReleasedCurve];
|
||||
[_snapshot release];_snapshot=[[_bridge snapshotAtTime:time]retain];NSDictionary*doc=_snapshot[@"document"];
|
||||
if(doc){NSMutableArray*nodes=[NSMutableArray array];NSMutableDictionary*counts=[NSMutableDictionary dictionary];
|
||||
for(NSString*ID in DYToolDisplayOrder(doc?:@{})){
|
||||
@@ -53,8 +62,8 @@
|
||||
NSInteger count=[counts[type]integerValue];counts[type]=@(count+1);if(!base)title=[title stringByAppendingFormat:@" · %ld",(long)(count+1)];
|
||||
[nodes addObject:@{@"id":ID,@"type":type,@"title":title,@"layer":layer?:@{}}];
|
||||
}[_nodes release];_nodes=[nodes copy];
|
||||
NSString *selected=_snapshot[@"selectedNode"];for(NSDictionary *candidate in _nodes)if([candidate[@"id"]isEqual:selected]&&![_nodeID isEqual:selected]){[self finishCapture];[_nodeID release];_nodeID=[selected copy];[_selectedX release];_selectedX=nil;break;}
|
||||
if(![self node]){[self finishCapture];[_nodeID release];_nodeID=_nodes.count?[_nodes[0][@"id"]copy]:nil;_page=0;[_selectedX release];_selectedX=nil;}}
|
||||
NSString *selected=_snapshot[@"selectedNode"];for(NSDictionary *candidate in _nodes)if([candidate[@"id"]isEqual:selected]&&![_nodeID isEqual:selected]){[self finishCapture];[self clearReleasedCurve];[_nodeID release];_nodeID=[selected copy];[_selectedX release];_selectedX=nil;break;}
|
||||
if(![self node]){[self finishCapture];[self clearReleasedCurve];[_nodeID release];_nodeID=_nodes.count?[_nodes[0][@"id"]copy]:nil;_page=0;[_selectedX release];_selectedX=nil;}}
|
||||
NSString*type=[self node][@"type"]?:_toolType;NSMutableArray*rows=[NSMutableArray array];
|
||||
// These are the existing public scalar controls, never hidden curve-slot metadata.
|
||||
NSArray*sections=[type isEqual:@"base"]?@[@"base",@"color"]:type?@[type]:@[];
|
||||
@@ -71,10 +80,13 @@
|
||||
[self addArea:NSMakeRect(center.x-11*s,center.y-11*s,22*s,22*s) part:22401 kind:@"lensCenter" title:@"" descriptor:nil index:0];
|
||||
[self addArea:NSMakeRect(strength.x-11*s,strength.y-11*s,22*s,22*s) part:22402 kind:@"lensStrength" title:@"" descriptor:nil index:0];return;
|
||||
}
|
||||
w=MIN(260*s,size.width-2*margin);CGFloat h=MIN(214*s,size.height-2*margin),x=viewport.origin.x+margin,top=viewport.origin.y+margin;
|
||||
w=MIN(260*s,size.width-2*margin);
|
||||
CGFloat h=MIN(214*s,size.height-2*margin-33*s);
|
||||
CGFloat x=NSMaxX(viewport)-margin-w,top=NSMaxY(viewport)-margin-33*s-h;
|
||||
if(_positioned){x=MAX(viewport.origin.x+margin,MIN(NSMaxX(viewport)-margin-w,viewport.origin.x+_position.x*size.width));top=MAX(viewport.origin.y+margin,MIN(NSMaxY(viewport)-margin-h,viewport.origin.y+_position.y*size.height));}
|
||||
_panel=NSMakeRect(x,top,w,h);if(!_snapshot||![self node]||w<100*s||h<65*s)return;
|
||||
for(NSInteger c=0;c<4;c++)[self addArea:NSMakeRect(x+c*24*s,top,23*s,18*s)part:22010+c kind:@"channel" title:@[@"Y",@"R",@"G",@"B"][c] descriptor:nil index:c];
|
||||
[self addArea:NSMakeRect(x+98*s,top,MAX(1,w-121*s),20*s)part:20000 kind:@"curveGrip" title:@"⠿" descriptor:nil index:0];
|
||||
[self addArea:NSMakeRect(x,top+22*s,w,MAX(24*s,h-22*s))part:22000 kind:@"curvePlot" title:@"" descriptor:nil index:0];
|
||||
if(_selectedX)[self addArea:NSMakeRect(NSMaxX(_panel)-19*s,top,19*s,18*s)part:22020 kind:@"deletePoint" title:@"×" descriptor:nil index:0];return;
|
||||
}
|
||||
@@ -119,6 +131,7 @@
|
||||
if([d[@"kind"]isEqual:@"popup"]){NSArray*values=d[@"values"],*options=d[@"options"];NSInteger i=values?[values indexOfObject:@((NSInteger)llround(v))]:(NSInteger)llround(v);return i>=0&&i<(NSInteger)options.count?options[i]:@"—";}
|
||||
return [NSString stringWithFormat:[d[@"max"]doubleValue]-[d[@"min"]doubleValue]>20?@"%.1f":@"%.2f",v];
|
||||
}
|
||||
- (NSRect)drawingBounds{return _areas.count?_panel:NSZeroRect;}
|
||||
- (void)draw{
|
||||
if(!_areas.count)return;[NSGraphicsContext saveGraphicsState];NSRectClip(NSIntersectionRect(_panel,NSMakeRect(0,0,_size.width,_size.height)));CGFloat s=_scale;NSColor*ink=DYThemeColor(@"text")?:NSColor.whiteColor,*accent=DYThemeColor(@"accent")?:NSColor.systemCyanColor;
|
||||
NSBezierPath*panel=[NSBezierPath bezierPathWithRoundedRect:_panel xRadius:9*s yRadius:9*s];BOOL solid=NSWorkspace.sharedWorkspace.accessibilityDisplayShouldReduceTransparency;
|
||||
@@ -165,8 +178,11 @@
|
||||
if([_captured[@"kind"]isEqual:@"slider"]&&_snapshot){NSRect t=[self trackForArea:_captured];if(NSPointInRect(p,NSInsetRect(t,-8*_scale,-8*_scale))){_downValue=[self valueForDescriptor:d];_draftValue=_downValue;_hasDraft=YES;[_bridge beginParameter:d node:_nodeID value:_downValue atTime:time];CGFloat knob=t.origin.x+(_downValue-[d[@"min"]doubleValue])/([d[@"max"]doubleValue]-[d[@"min"]doubleValue])*t.size.width;_knobOffset=fabs(p.x-knob)<=8*_scale?p.x-knob:0;if(fabs(p.x-knob)>8*_scale)[self applySliderPoint:p];}}return YES;
|
||||
}
|
||||
if(!_pressed)return NO;
|
||||
if(type==NSEventTypeLeftMouseDragged){if(fabs(p.x-_down.x)>2*_scale||fabs(p.y-_down.y)>2*_scale)_dragging=YES;if(_dragging&&[_captured[@"kind"]isEqual:@"open"])[self movePanelToPointer:p];if(_dragging&&([self graphicKind:_captured[@"kind"]]))[self updateGraphicAt:p];if(_dragging&&_hasDraft&&[_captured[@"kind"]isEqual:@"slider"]&&_snapshot)[self applySliderPoint:p];return YES;}
|
||||
if(type==NSEventTypeLeftMouseUp){if([_captured[@"kind"]isEqual:@"open"]&&(_dragging||fabs(p.x-_down.x)>2*_scale||fabs(p.y-_down.y)>2*_scale))[self movePanelToPointer:p];BOOL moved=_movingPanel;BOOL graphic=[self graphicKind:_captured[@"kind"]];if(graphic){if(_dragging||fabs(p.x-_down.x)>2*_scale||fabs(p.y-_down.y)>2*_scale)[self updateGraphicAt:p];[_bridge endGesture];}BOOL slider=[_captured[@"kind"]isEqual:@"slider"];NSDictionary*a=[_captured retain];NSInteger pressed=_pressed;
|
||||
NSString *kind=_captured[@"kind"];
|
||||
BOOL moveHandle=[kind isEqual:@"open"]||[kind isEqual:@"curveGrip"];
|
||||
BOOL movedPointer=_dragging||fabs(p.x-_down.x)>2*_scale||fabs(p.y-_down.y)>2*_scale;
|
||||
if(type==NSEventTypeLeftMouseDragged){_dragging=movedPointer;if(_dragging&&moveHandle)[self movePanelToPointer:p];if(_dragging&&[self graphicKind:kind])[self updateGraphicAt:p];if(_dragging&&_hasDraft&&[kind isEqual:@"slider"]&&_snapshot)[self applySliderPoint:p];return YES;}
|
||||
if(type==NSEventTypeLeftMouseUp){if(moveHandle&&movedPointer)[self movePanelToPointer:p];BOOL moved=_movingPanel;BOOL graphic=[self graphicKind:kind];if(graphic){if(movedPointer)[self updateGraphicAt:p];if([kind isEqual:@"curvePlot"]&&_draftValues.count)[self finishCurveWithValues:_draftValues];else [_bridge endGesture];}BOOL slider=[kind isEqual:@"slider"];NSDictionary*a=[_captured retain];NSInteger pressed=_pressed;
|
||||
if(slider){if(_hasDraft&&(_dragging||fabs(p.x-_down.x)>2*_scale||fabs(p.y-_down.y)>2*_scale))[self applySliderPoint:p];[_bridge endGesture];}
|
||||
_pressed=0;_dragging=NO;_movingPanel=NO;_hasDraft=NO;[_captured release];_captured=nil;[_spiderDraft release];_spiderDraft=nil;[_draftValues removeAllObjects];if(!moved&&!slider&&!graphic&&hit==pressed&&(!a[@"nodeID"]||[a[@"nodeID"]isEqual:[self areaForPart:hit][@"nodeID"]]))[self clickArea:a];[a release];[self prepareWithSize:_size scale:_scale atTime:time];return YES;}
|
||||
return NO;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
- (void)changeValue:(double)value;
|
||||
- (void)beginParameters:(NSArray<NSDictionary*>*)descriptors node:(NSString*)nodeID values:(NSDictionary<NSString*,NSNumber*>*)values atTime:(CMTime)time;
|
||||
- (void)changeValues:(NSDictionary<NSString*,NSNumber*>*)values;
|
||||
- (void)publishAssets:(DYAssetState*)assets histogram:(NSData*)histogram atTime:(CMTime)time;
|
||||
- (void)publishHistogram:(NSData*)histogram atTime:(CMTime)time;
|
||||
- (void)publishAssets:(DYAssetState*)assets atTime:(CMTime)time;
|
||||
- (NSData*)canvasHistogramAtTime:(CMTime)time;
|
||||
- (void)beginSpider:(NSData*)mesh node:(NSString*)node enabled:(double)enabled atTime:(CMTime)time;
|
||||
- (void)changeSpider:(NSData*)mesh;
|
||||
- (void)endGesture;
|
||||
|
||||
@@ -29,6 +29,30 @@
|
||||
[host->_parent setFrameSize:NSMakeSize(840,300)];run.record(@"workspace-follows-remote-container-resize",NSEqualRects(root.frame,host->_parent.bounds));
|
||||
headerBitmap=DYWorkspaceHeaderBitmap(root);toolbarInk=DYWorkspaceHeaderInk(headerBitmap,root,toolbar);closeInk=DYWorkspaceHeaderInk(headerBitmap,root,closeButton);
|
||||
run.record(@"workspace-topbar-survives-minimum-resize-and-large-dirty-redraw",toolbarInk>80&&closeInk>10&&DYWorkspaceLargeDirtyPreservesHeader(headerBitmap,root,scopePane),@{@"toolbarPixels":@(toolbarInk),@"closePixels":@(closeInk)});
|
||||
NSNotificationCenter *trackingCenter=NSNotificationCenter.defaultCenter;
|
||||
DYMaskParameters trackedShape=dyDefaultMaskParameters();
|
||||
NSData *shapeBytes=[NSData dataWithBytes:&trackedShape length:sizeof(trackedShape)];
|
||||
[trackingCenter postNotificationName:@"DYToolTrackingStatus" object:host
|
||||
userInfo:@{@"tracking":@YES,@"message":@"正向 · 3 / 6 帧 · 50%",@"shape":shapeBytes,
|
||||
@"rgba":[NSData dataWithBytes:"\xff\x00\x00\xff" length:4],@"width":@1,@"height":@1,
|
||||
@"time":@.08,@"aspect":@1,@"total":@6,@"completed":@3}];
|
||||
NSView *trackingPreview=[workspace valueForKey:@"trackingPreview"];
|
||||
NSView *progress=[trackingPreview valueForKey:@"progress"];
|
||||
NSView *image=[trackingPreview valueForKey:@"preview"];
|
||||
NSButton *previewAction=[trackingPreview valueForKey:@"action"];
|
||||
[trackingPreview layoutSubtreeIfNeeded];
|
||||
run.record(@"workspace-tracking-preview-replaces-scopes-with-readable-progress-and-image",
|
||||
!trackingPreview.hidden&&[(NSView *)plots.firstObject isHidden]&&[progress.accessibilityValue doubleValue]==.5&&
|
||||
[image.accessibilityLabel containsString:@"0.080"]&&image.clipsToBounds&&NSWidth(image.frame)>200&&NSHeight(image.frame)>120);
|
||||
__block BOOL cancelRouted=NO;
|
||||
id stopObserver=[trackingCenter addObserverForName:@"DYToolTrack" object:host queue:nil usingBlock:^(NSNotification *n){cancelRouted=[n.userInfo[@"direction"]intValue]==9;}];
|
||||
[previewAction performClick:nil];
|
||||
[trackingCenter removeObserver:stopObserver];
|
||||
[trackingCenter postNotificationName:@"DYToolTrackingStatus" object:host userInfo:@{@"tracking":@NO,@"message":@"已取消;保留最后连续可信轨迹"}];
|
||||
BOOL resultRetained=!trackingPreview.hidden&&[image.accessibilityLabel containsString:@"0.080"]&&[previewAction.title isEqual:@"返回示波器"];
|
||||
[previewAction performClick:nil];
|
||||
run.record(@"workspace-preview-stop-routes-to-analysis-and-dismiss-restores-scopes",
|
||||
cancelRouted&&resultRetained&&trackingPreview.hidden&&![(NSView *)plots.firstObject isHidden]);
|
||||
|
||||
[workspace showRelativeToView:nil];workspaceDrain();run.record(@"workspace-reopens-existing-host-remote-window",host->_requests==2&&workspace.visible&&root.superview==host->_parent);
|
||||
[workspace close];[workspace close];run.record(@"workspace-closes-host-window-once-and-stops-scopes",host->_closes==1&&!workspace.visible&&![[scopeRenderer valueForKey:@"scopeEnabled"]boolValue]&&!host->_permissionFailure&&host->_actionDepth==0);
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
NSString*title=titles[ID]?:DYToolSection(type)[@"title"]?:type;[rows addObject:@{@"node":ID,@"type":type,@"title":title,@"enabled":@(DYWorkspaceEnabled(node?DYToolUniforms(node):rootUniforms,type)),@"kind":@"tool",@"maskCount":@(DYMasksForTool(document,ID).count)}];
|
||||
for(NSDictionary*mask in DYMasksForTool(document,ID)){[assignedMasks addObject:mask[@"id"]];DYMaskParameters p=DYMaskAtTime(mask,_toolTime);NSString*name=@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind];[rows addObject:@{@"node":ID,@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":[@" ◩ " stringByAppendingString:name],@"kind":@"mask"}];}
|
||||
}
|
||||
for(NSDictionary*mask in DYSharedMasks(document))if(!DYToolIDsForSharedMask(document,mask[@"id"]).count){DYMaskParameters p=DYMaskAtTime(mask,_toolTime);[rows addObject:@{@"node":@"shared",@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":[@"◩ 未分配 · " stringByAppendingString:@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind]],@"kind":@"mask"}];}
|
||||
for(NSDictionary*mask in DYSharedMasks(document))if(!DYToolIDsForSharedMask(document,mask[@"id"]).count){DYMaskParameters p=DYMaskAtTime(mask,_toolTime);[rows addObject:@{@"node":@"shared",@"mask":mask[@"id"],@"enabled":mask[@"enabled"],@"title":mask[@"stampSource"]?@"◩ 仿制图章":[@"◩ 未分配 · " stringByAppendingString:@[@"椭圆",@"矩形",@"钢笔",@"渐变",@"HSL",@"亮度"][p.kind]],@"kind":@"mask"}];}
|
||||
}@finally{[action endAction:self];}
|
||||
[_toolDocument release];_toolDocument=document;[_layerRows release];_layerRows=[rows copy];[_layerTable reloadData];
|
||||
NSString *requested=note.userInfo[@"scrollToTool"];if(requested.length){_hasUserSelection=YES;[_selectedNode release];_selectedNode=[requested copy];[_selectedMask release];_selectedMask=nil;}
|
||||
@@ -90,7 +90,8 @@
|
||||
- (void)rebuildWorkspaceEditor {
|
||||
NSDictionary*node=DYToolWithID(_toolDocument,_selectedNode);NSString*type=node?node[@"type"]:[_selectedNode hasPrefix:@"base:"]?[_selectedNode substringFromIndex:5]:nil;
|
||||
if(_selectedMask)_editorMode=1;else if(![_editorNode isEqual:_selectedNode]||_editorMode==1)_editorMode=[type isEqual:@"look"]?2:0;
|
||||
_selectionTitle.stringValue=_selectedMask?@"蒙版 · 编辑与跟踪":DYToolSection(type)[@"title"]?:@"从上方添加模块";if(!_selectedMask)for(NSDictionary*row in _layerRows)if([row[@"node"]isEqual:_selectedNode]&&!row[@"mask"]){_selectionTitle.stringValue=row[@"title"];break;}
|
||||
BOOL stamp=DYSharedMaskWithID(_toolDocument,_selectedMask)[@"stampSource"]!=nil;
|
||||
_selectionTitle.stringValue=_selectedMask?(stamp?@"仿制图章 · 编辑与跟踪":@"蒙版 · 编辑与跟踪"):DYToolSection(type)[@"title"]?:@"从上方添加模块";if(!_selectedMask)for(NSDictionary*row in _layerRows)if([row[@"node"]isEqual:_selectedNode]&&!row[@"mask"]){_selectionTitle.stringValue=row[@"title"];break;}
|
||||
if(![_editorNode isEqual:_selectedNode]){[_toolEditor removeFromSuperview];[_toolEditor release];_toolEditor=nil;[_editorNode release];_editorNode=[_selectedNode copy];if(type){id<PROAPIAccessing>target=node?[[[DYToolManager alloc]initWithHost:[self rootHost]node:node]autorelease]:[self rootHost];_toolEditor=[[DYInspector alloc]initWithAPIManager:target renderer:_renderer workspaceType:type];[_editorHost addSubview:_toolEditor positioned:NSWindowBelow relativeTo:_maskPane];}}
|
||||
[_toolEditor refresh];
|
||||
if(_selectedNode.length&&![_selectedNode isEqual:@"shared"])[NSNotificationCenter.defaultCenter postNotificationName:@"DYWorkspaceToolSelection" object:[self rootHost]userInfo:@{@"node":_selectedNode}];
|
||||
@@ -126,9 +127,10 @@
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:host userInfo:@{@"node":@"shared",@"mask":ID,@"document":_toolDocument?:@{},@"draw":@(kind==2),@"drawShape":@(kind==0||kind==1)}];
|
||||
}
|
||||
- (void)rebuildMaskAssignments {
|
||||
DYWorkspaceList*list=[[[DYWorkspaceList alloc]init]autorelease];NSTextField*heading=[DYThemeLabel labelWithString:_selectedMask?@"应用到模块":@"选择或绘制蒙版"];heading.font=[NSFont systemFontOfSize:11 weight:NSFontWeightSemibold];[list addSubview:heading];
|
||||
BOOL stamp=DYSharedMaskWithID(_toolDocument,_selectedMask)[@"stampSource"]!=nil;
|
||||
DYWorkspaceList*list=[[[DYWorkspaceList alloc]init]autorelease];NSTextField*heading=[DYThemeLabel labelWithString:stamp?@"仿制图章":_selectedMask?@"应用到模块":@"选择或绘制蒙版"];heading.font=[NSFont systemFontOfSize:11 weight:NSFontWeightSemibold];[list addSubview:heading];
|
||||
NSArray*assigned=DYToolIDsForSharedMask(_toolDocument,_selectedMask);
|
||||
for(NSDictionary*row in _layerRows)if([row[@"kind"]isEqual:@"tool"]){NSButton*check=[NSButton checkboxWithTitle:row[@"title"]target:self action:@selector(maskAssignmentChanged:)];check.identifier=row[@"node"];check.font=[NSFont systemFontOfSize:11];check.state=[assigned containsObject:row[@"node"]]?NSControlStateValueOn:NSControlStateValueOff;check.enabled=_selectedMask.length>0;check.accessibilityLabel=[@"蒙版应用到 " stringByAppendingString:row[@"title"]];[list addSubview:check];}
|
||||
if(!stamp)for(NSDictionary*row in _layerRows)if([row[@"kind"]isEqual:@"tool"]){NSButton*check=[NSButton checkboxWithTitle:row[@"title"]target:self action:@selector(maskAssignmentChanged:)];check.identifier=row[@"node"];check.font=[NSFont systemFontOfSize:11];check.state=[assigned containsObject:row[@"node"]]?NSControlStateValueOn:NSControlStateValueOff;check.enabled=_selectedMask.length>0;check.accessibilityLabel=[@"蒙版应用到 " stringByAppendingString:row[@"title"]];[list addSubview:check];}
|
||||
_assignmentScroll.documentView=list;[self layoutMaskAssignments];
|
||||
}
|
||||
- (void)layoutMaskAssignments {
|
||||
@@ -140,7 +142,11 @@
|
||||
if(written)[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host];else [self reportError:@"宿主未保存蒙版关联,原设置已保留"];
|
||||
}
|
||||
- (void)workspaceCanvasSelection:(NSNotification*)note {
|
||||
if(!_visible||_refreshingStack||![note.userInfo[@"mask"]length])return;NSString*mask=note.userInfo[@"mask"];if([mask isEqual:_selectedMask])return;[_selectedMask release];_selectedMask=[mask copy];if(![note.userInfo[@"node"]isEqual:@"shared"]){[_selectedNode release];_selectedNode=[note.userInfo[@"node"]copy];}_editorMode=1;[self rebuildWorkspaceEditor];
|
||||
if(!_visible||_refreshingStack||![note.userInfo[@"mask"]length])return;NSString*mask=note.userInfo[@"mask"];
|
||||
if(!_trackingPreview.hidden&&!_trackingPreview.running&&![_trackingPreview.maskID isEqual:mask]){
|
||||
[_trackingPreview reset];[self setTrackingPreviewVisible:NO];
|
||||
}
|
||||
if([mask isEqual:_selectedMask])return;[_selectedMask release];_selectedMask=[mask copy];if(![note.userInfo[@"node"]isEqual:@"shared"]){[_selectedNode release];_selectedNode=[note.userInfo[@"node"]copy];}_editorMode=1;[self rebuildWorkspaceEditor];
|
||||
}
|
||||
- (void)externalWorkspaceToolSelection:(NSNotification*)note {
|
||||
if(![note.userInfo[@"source"]isEqual:@"inspector"]||![note.userInfo[@"node"]length])return;_hasUserSelection=YES;[_selectedNode release];_selectedNode=[note.userInfo[@"node"]copy];[_selectedMask release];_selectedMask=nil;if(_visible){_editorMode=0;[self refreshToolWorkspace:nil];}
|
||||
|
||||
+3
-3
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.12.0</string>
|
||||
<string>1.14.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>79</string>
|
||||
<string>95</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
@@ -71,7 +71,7 @@
|
||||
<key>uuid</key>
|
||||
<string>1C17B73B-F229-4C09-A434-EAF6DFF5F22A</string>
|
||||
<key>version</key>
|
||||
<string>1.12.0</string>
|
||||
<string>1.14.4</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>className</key>
|
||||
|
||||
+19
-1
@@ -1,5 +1,23 @@
|
||||
#import <FxPlug/FxPlugSDK.h>
|
||||
#import "DYDiagnostics.h"
|
||||
#import "../Shared/DYBetaDiagnostics.h"
|
||||
#import "../Shared/DYCodeIntegrity.h"
|
||||
#include <string.h>
|
||||
int main(int argc,const char*argv[]){@autoreleasepool{if(argc==2&&strcmp(argv[1],"--self-test")==0)return DYRunDiagnostics();DYBetaStart();[FxPrincipal startServicePrincipal];DYBetaStop();return 0;}}
|
||||
#include <sysexits.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
@autoreleasepool {
|
||||
NSString *component = nil;
|
||||
OSStatus status = DYValidateRunningInstallation(DYCodeRoleService, &component);
|
||||
if (status != errSecSuccess) {
|
||||
NSLog(@"大鱼调色拒绝启动插件服务,验签失败 (%@, %d)。%@", component, (int)status,
|
||||
DYIntegrityRecoveryMessage);
|
||||
return EX_CONFIG;
|
||||
}
|
||||
if (argc == 2 && strcmp(argv[1], "--self-test") == 0) return DYRunDiagnostics();
|
||||
DYBetaStart();
|
||||
[FxPrincipal startServicePrincipal];
|
||||
DYBetaStop();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Security/Security.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, DYCodeRole) {
|
||||
DYCodeRoleWrapper,
|
||||
DYCodeRoleService,
|
||||
};
|
||||
|
||||
FOUNDATION_EXPORT NSString *const DYPluginRelativePath;
|
||||
FOUNDATION_EXPORT NSString *const DYIntegrityRecoveryMessage;
|
||||
|
||||
FOUNDATION_EXPORT OSStatus DYValidateSignedInstallation(NSURL *wrapperURL, NSString **failedComponent);
|
||||
FOUNDATION_EXPORT OSStatus DYValidateRunningInstallation(DYCodeRole role, NSString **failedComponent);
|
||||
@@ -0,0 +1,96 @@
|
||||
#import "DYCodeIntegrity.h"
|
||||
|
||||
NSString *const DYPluginRelativePath = @"Contents/PlugIns/大鱼调色 XPC Service.pluginkit";
|
||||
NSString *const DYIntegrityRecoveryMessage = @"大鱼调色未通过官方签名或完整性验证。请使用原始安装包重新安装。";
|
||||
|
||||
static NSString *const DYWrapperIdentifier = @"com.dayu.color";
|
||||
static NSString *const DYServiceIdentifier = @"com.dayu.color.XPC";
|
||||
|
||||
static OSStatus DYCreateSigningRequirement(NSString *identifier, SecRequirementRef *requirement) {
|
||||
// Pin the Developer ID team and signing identifier, allowing certificate renewal.
|
||||
NSString *text = [NSString stringWithFormat:
|
||||
@"identifier \"%@\" and anchor apple generic and "
|
||||
"certificate 1[field.1.2.840.113635.100.6.2.6] exists and "
|
||||
"certificate leaf[field.1.2.840.113635.100.6.1.13] exists and "
|
||||
"certificate leaf[subject.OU] = \"B3W25FX5H5\"", identifier];
|
||||
return SecRequirementCreateWithString((__bridge CFStringRef)text, kSecCSDefaultFlags, requirement);
|
||||
}
|
||||
|
||||
static OSStatus DYValidateRunningCode(NSString *identifier) {
|
||||
SecRequirementRef requirement = NULL;
|
||||
OSStatus status = DYCreateSigningRequirement(identifier, &requirement);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
SecCodeRef code = NULL;
|
||||
status = SecCodeCopySelf(kSecCSDefaultFlags, &code);
|
||||
if (status == errSecSuccess) {
|
||||
status = SecCodeCheckValidity(code, kSecCSDefaultFlags, requirement);
|
||||
CFRelease(code);
|
||||
}
|
||||
CFRelease(requirement);
|
||||
return status;
|
||||
}
|
||||
|
||||
static OSStatus DYValidateBundle(NSURL *url, NSString *identifier, SecCSFlags flags) {
|
||||
SecRequirementRef requirement = NULL;
|
||||
OSStatus status = DYCreateSigningRequirement(identifier, &requirement);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
SecStaticCodeRef code = NULL;
|
||||
status = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &code);
|
||||
if (status == errSecSuccess) {
|
||||
status = SecStaticCodeCheckValidity(code, flags, requirement);
|
||||
CFRelease(code);
|
||||
}
|
||||
CFRelease(requirement);
|
||||
return status;
|
||||
}
|
||||
|
||||
static OSStatus DYValidateInstallation(NSURL *wrapperURL, SecCSFlags wrapperFlags, SecCSFlags serviceFlags,
|
||||
NSString **failedComponent) {
|
||||
if (failedComponent) *failedComponent = @"wrapper";
|
||||
OSStatus status = DYValidateBundle(wrapperURL, DYWrapperIdentifier, wrapperFlags);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
if (failedComponent) *failedComponent = @"service";
|
||||
NSURL *serviceURL = [wrapperURL URLByAppendingPathComponent:DYPluginRelativePath isDirectory:YES];
|
||||
status = DYValidateBundle(serviceURL, DYServiceIdentifier, serviceFlags);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
// A separately signed older service with the same identity must not be mixed into this build.
|
||||
NSDictionary *wrapper = [NSDictionary dictionaryWithContentsOfURL:[wrapperURL URLByAppendingPathComponent:@"Contents/Info.plist"]];
|
||||
NSDictionary *service = [NSDictionary dictionaryWithContentsOfURL:[serviceURL URLByAppendingPathComponent:@"Contents/Info.plist"]];
|
||||
if (failedComponent) *failedComponent = @"component-build";
|
||||
if (![wrapper[@"CFBundleVersion"] isEqual:service[@"CFBundleVersion"]] ||
|
||||
![wrapper[@"CFBundleShortVersionString"] isEqual:service[@"CFBundleShortVersionString"]]) return errSecCSReqFailed;
|
||||
|
||||
if (failedComponent) *failedComponent = nil;
|
||||
return errSecSuccess;
|
||||
}
|
||||
|
||||
OSStatus DYValidateSignedInstallation(NSURL *wrapperURL, NSString **failedComponent) {
|
||||
const SecCSFlags strict = kSecCSStrictValidate | kSecCSCheckAllArchitectures;
|
||||
return DYValidateInstallation(wrapperURL, strict, strict | kSecCSCheckNestedCode, failedComponent);
|
||||
}
|
||||
|
||||
OSStatus DYValidateRunningInstallation(DYCodeRole role, NSString **failedComponent) {
|
||||
BOOL isService = role == DYCodeRoleService;
|
||||
if (failedComponent) *failedComponent = isService ? @"running-service" : @"running-wrapper";
|
||||
OSStatus status = DYValidateRunningCode(isService ? DYServiceIdentifier : DYWrapperIdentifier);
|
||||
if (status != errSecSuccess) return status;
|
||||
|
||||
NSURL *bundleURL = NSBundle.mainBundle.bundleURL.URLByResolvingSymlinksInPath;
|
||||
NSURL *wrapperURL = bundleURL;
|
||||
if (isService) {
|
||||
// The service must be embedded in the wrapper being verified.
|
||||
for (NSInteger level = 0; level < 3; level++) wrapperURL = wrapperURL.URLByDeletingLastPathComponent;
|
||||
NSURL *expected = [wrapperURL URLByAppendingPathComponent:DYPluginRelativePath isDirectory:YES];
|
||||
if (failedComponent) *failedComponent = @"service-location";
|
||||
if (![wrapperURL.pathExtension isEqualToString:@"app"] ||
|
||||
![bundleURL.path isEqualToString:expected.path]) return errSecCSBadBundleFormat;
|
||||
}
|
||||
// At launch, verify both native executables and their signed identities.
|
||||
// Leave resource and nested-framework traversal to downloaded-package verification.
|
||||
return DYValidateInstallation(wrapperURL, kSecCSDoNotValidateResources, kSecCSDoNotValidateResources,
|
||||
failedComponent);
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
#import "AppDelegate.h"
|
||||
#import "DYBetaUpdater.h"
|
||||
#import "../Shared/DYBetaDiagnostics.h"
|
||||
#import "../Shared/DYCodeIntegrity.h"
|
||||
|
||||
static NSString *const DYPluginID = @"com.dayu.color.XPC";
|
||||
static NSString *const DYReleaseAddress = @"https://dayu.media";
|
||||
static dispatch_queue_t DYPluginRegistrationQueue(void) {
|
||||
static dispatch_queue_t queue;
|
||||
static dispatch_once_t once;
|
||||
dispatch_once(&once, ^{ queue = dispatch_queue_create("com.dayu.color.registration", DISPATCH_QUEUE_SERIAL); });
|
||||
return queue;
|
||||
}
|
||||
static NSColor *DYColor(CGFloat r, CGFloat g, CGFloat b) { return [NSColor colorWithSRGBRed:r green:g blue:b alpha:1]; }
|
||||
static NSColor *DYBlue(void) { return DYColor(.36,.65,1); }
|
||||
static NSColor *DYGreen(void) { return DYColor(.26,.86,.53); }
|
||||
@@ -125,6 +132,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
@property(assign) NSProgressIndicator *updateProgress;
|
||||
@property(retain) NSTimer *updateProgressTimer;
|
||||
@property BOOL updateCheckDone;
|
||||
@property BOOL integrityRejected;
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
@@ -278,32 +286,84 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
- (BOOL)registry:(NSDictionary *)query listsExactPath:(NSString *)path {
|
||||
NSString *suffix = [@"\t" stringByAppendingString:path];
|
||||
for (NSString *line in [query[@"output"] componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]) {
|
||||
if ([line hasSuffix:suffix]) return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
- (NSString *)removeRejectedPluginRegistration:(NSString *)path {
|
||||
NSArray *arguments = @[@"-m",@"-A",@"-D",@"-v",@"-i",DYPluginID];
|
||||
NSDictionary *before = [self runPluginKit:arguments];
|
||||
if ([before[@"code"] intValue] != 0) return @"query-failed";
|
||||
if (![self registry:before listsExactPath:path]) return @"not-registered";
|
||||
if (![path.stringByStandardizingPath isEqualToString:path.stringByResolvingSymlinksInPath]) return @"skipped-symlink";
|
||||
[self runPluginKit:@[@"-r",path]];
|
||||
NSDictionary *after = [self runPluginKit:arguments];
|
||||
if ([after[@"code"] intValue] != 0 || [self registry:after listsExactPath:path]) return @"removal-unverified";
|
||||
return @"removed";
|
||||
}
|
||||
- (void)rejectModifiedInstallation:(NSDictionary *)results {
|
||||
if (self.integrityRejected || self.terminating) return;
|
||||
self.integrityRejected = YES;
|
||||
[self.updater stopForIntegrityFailure];
|
||||
[self finishRegistration:NO details:DYIntegrityRecoveryMessage results:results];
|
||||
self.retryButton.enabled = NO;
|
||||
self.exitDetail.stringValue = @"此副本的自动更新已停用。请安装原始安装包后重新打开。";
|
||||
|
||||
NSString *path = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:DYPluginRelativePath];
|
||||
dispatch_async(DYPluginRegistrationQueue(), ^{
|
||||
@autoreleasepool {
|
||||
NSString *removal = [self removeRejectedPluginRegistration:path];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.diagnostics[@"registrationRevocation"] = removal;
|
||||
[self writeDiagnostics];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
- (void)checkRegistration:(id)sender {
|
||||
if (self.integrityRejected) return;
|
||||
if (self.diagnostics && (self.registrationState == DYChecking || self.registrationState == DYRegistering)) return;
|
||||
[self.exitTimer invalidate]; self.exitTimer = nil; self.registrationState = DYChecking;
|
||||
self.retryButton.enabled = NO; self.retryButton.title = @"检查中…";
|
||||
self.statusTitle.stringValue = @"正在检查插件…"; self.statusTitle.textColor = NSColor.whiteColor;
|
||||
self.statusDetail.stringValue = @"正在检查本机插件登记,随后自动提交注册。";
|
||||
self.progress.indeterminate = YES; [self.progress startAnimation:nil];
|
||||
NSString *path = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"Contents/PlugIns/大鱼调色 XPC Service.pluginkit"];
|
||||
NSString *path = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:DYPluginRelativePath];
|
||||
self.diagnostics = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
@"bundleID":NSBundle.mainBundle.bundleIdentifier,@"version":[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
|
||||
@"build":[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"],@"executable":NSBundle.mainBundle.executablePath,
|
||||
@"bundleID":NSBundle.mainBundle.bundleIdentifier ?: @"",@"version":[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: @"",
|
||||
@"build":[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"] ?: @"",@"executable":NSBundle.mainBundle.executablePath ?: @"",
|
||||
@"pid":@(NSProcessInfo.processInfo.processIdentifier),@"plugin":path,@"status":@"checking"}];
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0), ^{
|
||||
dispatch_async(DYPluginRegistrationQueue(), ^{
|
||||
@autoreleasepool {
|
||||
NSString *failedComponent = nil;
|
||||
OSStatus status = DYValidateRunningInstallation(DYCodeRoleWrapper, &failedComponent);
|
||||
if (status != errSecSuccess) {
|
||||
NSDictionary *results = @{@"integrity":@"rejected", @"integrityComponent":failedComponent,
|
||||
@"integrityOSStatus":@(status)};
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self rejectModifiedInstallation:results];
|
||||
});
|
||||
return;
|
||||
}
|
||||
NSBundle *plugin = [NSBundle bundleWithPath:path];
|
||||
NSDictionary *attributes = [plugin objectForInfoDictionaryKey:@"PlugInKit"][@"Attributes"];
|
||||
BOOL validComponent = [plugin.bundleIdentifier isEqualToString:DYPluginID] &&
|
||||
[[plugin objectForInfoDictionaryKey:@"CFBundleVersion"] isEqual:[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]] &&
|
||||
[attributes[@"com.apple.protocol"] isEqual:@"FxPlug"] && [attributes[@"com.apple.version"] isEqual:@"1.1"];
|
||||
if (!validComponent) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{ [self finishRegistration:NO details:@"未找到完整的插件组件。请从发布地址重新安装大鱼调色。" results:@{}]; }); return;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (!self.integrityRejected)
|
||||
[self finishRegistration:NO details:@"未找到完整的插件组件。请从发布地址重新安装大鱼调色。" results:@{}];
|
||||
}); return;
|
||||
}
|
||||
// The stand-alone wrapper can inspect the registry directly. Registration
|
||||
// and actual host rendering remain separate states; the user confirms FCP.
|
||||
NSDictionary *before = [self runPluginKit:@[@"-m",@"-v",@"-i",DYPluginID]];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.integrityRejected) return;
|
||||
self.registrationState = DYRegistering; self.statusTitle.stringValue = @"正在注册插件…";
|
||||
self.statusDetail.stringValue = @"正在向系统提交插件注册,并核对当前安装位置。";
|
||||
});
|
||||
@@ -318,10 +378,12 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
NSString *message = registered ?
|
||||
@"已确认当前插件登记。请在 Final Cut Pro 中实际应用并确认效果正常;若宿主已打开,请保存后重新打开。" :
|
||||
@"插件注册尚未完成。请点击“重新检查”,或重新安装后再试。窗口将保持打开。";
|
||||
NSDictionary *results = @{@"before":before,@"submission":add,@"after":after ?: @{},@"registered":@(registered),
|
||||
NSDictionary *results = @{@"integrity":@"verified",@"before":before,@"submission":add,@"after":after ?: @{},@"registered":@(registered),
|
||||
@"discoveryVerified":@(registered),@"submissionAccepted":@(submissionAccepted),@"hostVerification":@"awaiting-user-confirmation",
|
||||
@"confirmationMethod":registered ? @"exact-path-discovery" : @"unconfirmed"};
|
||||
dispatch_async(dispatch_get_main_queue(), ^{ [self finishRegistration:registered details:message results:results]; });
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (!self.integrityRejected) [self finishRegistration:registered details:message results:results];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -330,7 +392,7 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
self.registrationState = success ? DYReady : DYFailed;
|
||||
[self.progress stopAnimation:nil]; self.progress.indeterminate = NO; self.progress.doubleValue = success ? 100 : 0;
|
||||
self.registrationCard.tint = success ? DYGreen() : DYColor(1,.67,.30); [self.registrationCard setNeedsDisplay:YES];
|
||||
self.statusTitle.stringValue = success ? @"✓ 插件注册成功" : @"需要重新检查";
|
||||
self.statusTitle.stringValue = success ? @"✓ 插件注册成功" : (self.integrityRejected ? @"安装完整性验证失败" : @"需要重新检查");
|
||||
self.statusTitle.textColor = success ? DYGreen() : DYColor(1,.75,.4); self.statusDetail.stringValue = details;
|
||||
self.retryButton.title = @"重新检查"; self.retryButton.enabled = YES;
|
||||
self.confirmationButton.enabled = success;
|
||||
@@ -352,12 +414,14 @@ typedef NS_ENUM(NSInteger,DYRegistrationState) { DYChecking, DYRegistering, DYRe
|
||||
- (void)updateChanged:(NSDictionary *)state {
|
||||
if(self.terminating)return;
|
||||
NSString *phase=state[@"phase"];
|
||||
BOOL rejected = [phase isEqual:@"integrity_rejected"];
|
||||
if (rejected) [self rejectModifiedInstallation:@{@"integrity":@"rejected"}];
|
||||
BOOL busy=[@[@"checking",@"downloading",@"validating"]containsObject:phase];
|
||||
BOOL available=[@[@"available",@"ready",@"host_wait",@"installer"]containsObject:phase];
|
||||
if(![phase isEqual:@"checking"]){self.updateCheckDone=YES;if(available)[self keepIntroduction:nil];}
|
||||
self.updateTitle.stringValue=[phase isEqual:@"available"]?state[@"message"]:@"公测更新";
|
||||
self.updateDetail.stringValue=state[@"message"]?:@"";
|
||||
self.updateCheckButton.enabled=!busy;
|
||||
self.updateCheckButton.enabled=!busy && !rejected;
|
||||
self.updateInstallButton.enabled=[@[@"available",@"ready",@"host_wait",@"installer"]containsObject:phase];
|
||||
self.updateInstallButton.title=[phase isEqual:@"available"]?@"下载更新":@"安装更新";
|
||||
self.updateCancelButton.hidden=![phase isEqual:@"downloading"];
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- (void)check;
|
||||
- (void)download;
|
||||
- (void)install;
|
||||
- (void)stopForIntegrityFailure;
|
||||
- (void)cancel;
|
||||
+ (BOOL)validateManifest:(NSDictionary *)manifest error:(NSError **)error;
|
||||
+ (BOOL)validatePackage:(NSURL *)package manifest:(NSDictionary *)manifest error:(NSError **)error;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#import "DYBetaUpdater.h"
|
||||
#import "../Shared/DYBetaDiagnostics.h"
|
||||
#import "../Shared/DYCodeIntegrity.h"
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#include <atomic>
|
||||
@@ -31,6 +32,7 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
NSURL *_package;
|
||||
NSDictionary *_state,*_manifest;
|
||||
std::atomic_uint _generation;
|
||||
BOOL _integrityRejected;
|
||||
}
|
||||
- (void)emit:(NSString *)phase message:(NSString *)message;
|
||||
@end
|
||||
@@ -57,6 +59,21 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
if(!NSThread.isMainThread){dispatch_async(dispatch_get_main_queue(),^{[self emit:phase message:message];});return;}
|
||||
[_state release];_state=[@{@"phase":phase,@"message":message?:@"",@"version":_manifest[@"version"]?:@""}copy];if(self.changed)self.changed(_state);
|
||||
}
|
||||
- (BOOL)requireOfficialInstallation {
|
||||
if (_integrityRejected) return NO;
|
||||
if (DYValidateRunningInstallation(DYCodeRoleWrapper, NULL) == errSecSuccess) return YES;
|
||||
[self stopForIntegrityFailure];
|
||||
return NO;
|
||||
}
|
||||
- (void)stopForIntegrityFailure {
|
||||
if (_integrityRejected) return;
|
||||
_integrityRejected = YES;
|
||||
++_generation;
|
||||
[_task cancel];
|
||||
[_manifest release]; _manifest = nil;
|
||||
[_package release]; _package = nil;
|
||||
[self emit:@"integrity_rejected" message:DYIntegrityRecoveryMessage];
|
||||
}
|
||||
+ (BOOL)validateManifest:(NSDictionary *)manifest error:(NSError **)error {
|
||||
if(![manifest isKindOfClass:NSDictionary.class]){if(error)*error=DYUpdateError(@"公测更新清单格式错误。");return NO;}
|
||||
id build=manifest[@"build"],size=manifest[@"size"];
|
||||
@@ -90,13 +107,12 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
}
|
||||
if(apps.count!=1){if(error)*error=DYUpdateError(@"更新包必须包含一个完整的大鱼调色 APP。");return NO;}
|
||||
NSURL *app=apps.firstObject;NSDictionary *info=[NSDictionary dictionaryWithContentsOfURL:[app URLByAppendingPathComponent:@"Contents/Info.plist"]];
|
||||
NSDictionary *plugin=[NSDictionary dictionaryWithContentsOfURL:[app URLByAppendingPathComponent:@"Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/Info.plist"]];
|
||||
NSURL *service=[app URLByAppendingPathComponent:DYPluginRelativePath isDirectory:YES];
|
||||
NSDictionary *plugin=[NSDictionary dictionaryWithContentsOfURL:[service URLByAppendingPathComponent:@"Contents/Info.plist"]];
|
||||
if(![info[@"CFBundleIdentifier"]isEqual:@"com.dayu.color"]||![plugin[@"CFBundleIdentifier"]isEqual:@"com.dayu.color.XPC"]||
|
||||
[info[@"CFBundleVersion"]integerValue]!=[manifest[@"build"]integerValue]||[plugin[@"CFBundleVersion"]integerValue]!=[manifest[@"build"]integerValue]||
|
||||
![info[@"CFBundleShortVersionString"]isEqual:manifest[@"version"]]){if(error)*error=DYUpdateError(@"更新包产品或版本与清单不一致。");return NO;}
|
||||
if(!command(@"/usr/bin/codesign",@[@"--verify",@"--deep",@"--strict",app.path],error))return NO;
|
||||
NSString *identity=command(@"/usr/bin/codesign",@[@"-dvvv",app.path],error);
|
||||
if(![identity containsString:@"TeamIdentifier=B3W25FX5H5"]){if(error)*error=DYUpdateError(@"包内 APP 签名团队不匹配。");return NO;}
|
||||
if(DYValidateSignedInstallation(app,NULL)!=errSecSuccess){if(error)*error=DYUpdateError(@"更新包内的 APP 或插件未通过官方签名验证。");return NO;}
|
||||
// Product PKGs install the wrapper at its fixed FxPlug location and carry templates.
|
||||
BOOL appTarget=NO,templates=NO;
|
||||
for(NSURL *url in [NSFileManager.defaultManager enumeratorAtURL:inspection includingPropertiesForKeys:nil options:0 errorHandler:nil]){
|
||||
@@ -116,6 +132,7 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
}
|
||||
- (void)check {
|
||||
NSString *phase=_state[@"phase"];if([@[@"checking",@"downloading",@"validating"]containsObject:phase])return;
|
||||
if (![self requireOfficialInstallation]) return;
|
||||
unsigned generation=++_generation;[self emit:@"checking" message:@"正在检查公测更新…"];
|
||||
NSString *url=[NSString stringWithFormat:@"https://dayu.media/wp-json/dayu-color/v1/update?bundle_id=com.dayu.color&channel=beta¤t_build=%@",([NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]?:@"0")];
|
||||
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:6];
|
||||
@@ -137,6 +154,7 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
}
|
||||
- (void)download {
|
||||
if(![_state[@"phase"]isEqual:@"available"])return;NSError *error=nil;
|
||||
if (![self requireOfficialInstallation]) return;
|
||||
if(![DYBetaUpdater validateManifest:_manifest error:&error]){[self emit:@"failed" message:error.localizedDescription];return;}
|
||||
if([_manifest[@"build"]integerValue]<=[[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]integerValue])return;
|
||||
unsigned generation=++_generation;NSDictionary *manifest=[[_manifest copy]autorelease];[self emit:@"downloading" message:@"正在下载公测更新,可随时取消。"];
|
||||
@@ -147,7 +165,9 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
if(!error&&[(NSHTTPURLResponse*)response statusCode]==200&&DYBetaAllowedURL(response.URL,YES)){
|
||||
[NSFileManager.defaultManager removeItemAtURL:destination error:nil];
|
||||
if([NSFileManager.defaultManager moveItemAtURL:temporary toURL:destination error:&error]){
|
||||
[self emit:@"validating" message:@"正在验证完整性、签名、公证和插件版本…"];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(generation==self->_generation.load()) [self emit:@"validating" message:@"正在验证完整性、签名、公证和插件版本…"];
|
||||
});
|
||||
BOOL valid=[DYBetaUpdater validatePackage:destination manifest:manifest error:&error];
|
||||
if(!valid&&!error)error=DYUpdateError(@"更新包未通过验证。");
|
||||
}
|
||||
@@ -163,15 +183,20 @@ static NSString *command(NSString *path,NSArray *arguments,NSError **error) {
|
||||
}
|
||||
- (void)install {
|
||||
if(![@[@"ready",@"host_wait",@"installer"]containsObject:_state[@"phase"]])return;
|
||||
if (![self requireOfficialInstallation]) return;
|
||||
for(NSString *ID in @[@"com.apple.FinalCut",@"com.apple.FinalCutApp",@"com.apple.motionapp",@"com.apple.motionappApp"])
|
||||
if([NSRunningApplication runningApplicationsWithBundleIdentifier:ID].count){[self emit:@"host_wait" message:@"请先保存并正常退出 FCP / Motion,再点击安装更新。不会强制退出宿主。"];
|
||||
DYBetaEvent(@"update_installer",@{@"status":@"waiting_for_host"});return;}
|
||||
if(_package&&[NSWorkspace.sharedWorkspace openURL:_package]){
|
||||
if (!_package || ![digest(_package) isEqualToString:_manifest[@"sha256"]]) {
|
||||
[self emit:@"failed" message:@"更新包已更改或不可读。请重新检查并下载更新。"];
|
||||
return;
|
||||
}
|
||||
if([NSWorkspace.sharedWorkspace openURL:_package]){
|
||||
[NSUserDefaults.standardUserDefaults setObject:_manifest[@"build"] forKey:@"betaPendingUpdateBuild"];[self emit:@"installer" message:@"已打开系统安装程序,请按提示授权并完成安装。"];
|
||||
DYBetaEvent(@"update_installer",@{@"status":@"system_installer_opened"});}
|
||||
else [self emit:@"failed" message:@"无法打开系统安装程序,请重试。"];
|
||||
}
|
||||
- (void)cancel {++_generation;[_task cancel];BOOL newer=[_manifest[@"build"]integerValue]>[[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]integerValue];[self emit:newer?@"available":@"idle" message:@"已取消,不影响当前插件。"];}
|
||||
- (void)cancel {if(_integrityRejected)return;++_generation;[_task cancel];BOOL newer=[_manifest[@"build"]integerValue]>[[NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"]integerValue];[self emit:newer?@"available":@"idle" message:@"已取消,不影响当前插件。"];}
|
||||
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completion {
|
||||
BOOL download=[task isKindOfClass:NSURLSessionDownloadTask.class];completion(DYBetaAllowedURL(request.URL,download)?request:nil);
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.12.0</string>
|
||||
<string>1.14.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>79</string>
|
||||
<string>95</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 2026-11-04 画布工具与辅助工作区:1.10.0(72)验收完成
|
||||
|
||||
> 当前工程、正式版本和下一步见 [开发交接.md](开发交接.md)。本文件保留历史 FxPlug 交付和技术记录。
|
||||
|
||||
下一阶段完善自定控件,先读[自定控件开发交接](/Volumes/备份/大鱼调色/大鱼调色/自定控件开发交接.md)。该文件集中说明当前代码、尚未补齐的专用图形和后续验证方式;本文件保留完整产品交付与历史。
|
||||
|
||||
当前正式安装 **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 项原生检查**与用户实鼠验收通过。
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
> 当前主 APP、本机安装与公测通道版本见 [开发交接.md](开发交接.md)。本文件保留主 APP 的历史交付与设计记录。
|
||||
|
||||
> 2026-11-02 更新:主 APP 已交付 1.7.0(45)公测。自动更新和云端诊断已经接入,当前实现与部署/隐私/回滚说明见 [Backend/README.md](Backend/README.md),发行与验证见 [Packaging/Release-1.7.0.md](Packaging/Release-1.7.0.md) 和 [verification/BetaClientQA.json](verification/BetaClientQA.json)。下方原始交接保留作背景;登录、授权和业务加密仍未实施,不能把原规划当成已完成状态。
|
||||
|
||||
# 大鱼调色主 APP 开发交接
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
# 大鱼调色开发交接
|
||||
|
||||
更新于 2026-11-06(Asia/Shanghai)。这是新对话的接手入口。历史设计和实现细节按需查阅专项交接,复现和交付证据以对应版本的报告为准。
|
||||
|
||||
## 当前基线
|
||||
|
||||
| 项目 | 已核对状态 |
|
||||
| --- | --- |
|
||||
| 工程与源码 | `/Volumes/备份/大鱼调色/大鱼调色`,`大鱼调色.xcodeproj`,`Wrapper Application` / Release。远程为 `https://dayu.media/git/dayu/dayu-color.git`,分支 `main`。1.14.4(95)实际编译节点为 `9f5f0659774c8c05e2640db0d62fb61cb529734e`,资源权限与验包工具修正提交为 `474bff9ea9713df28e587de712613e7748200627`。 |
|
||||
| 本机正式安装 | **1.14.4(95)**,`/Library/Plug-Ins/FxPlug/大鱼调色.app`。签名、公证、票据、Gatekeeper 及 893 项原生检查通过。主 App 注册、FCP 12.4 实拍验收项目的原有效果和控制面板已核对。[交付](verification/Delivery.json) · [验签和权限核验](verification/Integrity1.14.4.json) |
|
||||
| Git Release | **1.14.3(94)**,标签 `v1.14.3-tracking-preview-20261106` 指向 `8b96e8b8c1b0c9356ae9871a2bc042a83e7e97d6`。公测 Release 395/附件 39。草稿和发布后均完整下载核对。正式包 `/Volumes/备份/大鱼调色/发行包/大鱼调色-1.14.3.pkg`。[发布页](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.14.3-tracking-preview-20261106) · [核验](verification/Release.json) |
|
||||
| 站点及自动更新 | 文章 15792 已发布 **1.14.3(94)**。正文首图为用户提供的界面原图,特色图片为新封面,站内主下载包已完整校验。主 APP 公测通道上次回读为 **1.12.0(79)**。[原文章](https://dayu.media/15792/) · [文章核验](verification/Article1.14.3.json) · [更新通道核验](verification/BetaPublication1.12.0.json) |
|
||||
| 本机开发与验收 | AppKit / Objective-C++ / FxPlug 4 / Metal,Apple Silicon,macOS 14.6+。交付记录使用 Xcode 27.1、FxPlug SDK 4.3.5 和 FCP 12.4。构建缓存为 `/Users/mac/Library/Caches/CodexBuilds/com.dayu.color`,验收素材库位于其中的 `fcp-qa/大鱼调色_验收.fcpbundle`。产品交付锁为 `/Users/mac/.codex/app-delivery-locks/com.dayu.color.lock`,接手时重新检查。 |
|
||||
|
||||
## 1.14.4 安装权限和启动验签
|
||||
|
||||
- 94 版分发后,多名用户反馈“安装完整性验证失败”。用户提供的修复记录指出有四个不可读资源及一份放在 `/Applications` 的重复 App。94 正式 PKG 的 BOM 恰有四个 `root:wheel`、`0700` 文件,分别为外层 App 的 `Basis_balanceWheel.png` 和内置模板的 `large.png`、`small.png`、`大鱼调色.moef`。在原签名副本上模拟读权限丢失可复现严格验签的 `Permission denied`,修正为 `0644` 后通过,不需要重签。PKG 自身的载荷与脚本均指向固定 FxPlug 路径并禁用重定位。未获取受影响设备的诊断或确认重复副本来源。
|
||||
- 94 包中主 App 和插件服务的 Apple Developer ID 证书链均完整。单独使用系统信任根、排除用户钥匙串和联网,两条链均通过。开发机本轮复核的 94 App 是由交付脚本复制、当前用户持有的正式安装,能读取这些文件,未覆盖安装器改为 `root` 后的权限场景。
|
||||
- 95 版启动和注册检查两个可执行文件、Apple Developer ID 团队、签名标识、位置关系和版本一致性。全资源和嵌套框架扫描保留给下载更新包,签名改动、重签、缺失及混装对照检查通过。交付脚本将上述四个资源设为 `0644`,打包前检查实际 App,公证后检查最终 BOM。未发布的原始 95 候选经新权限门槛确认失败后重制,历史 94 包保留。第三方机器的新版安装结果仍需回访。
|
||||
|
||||
## 1.14.3 站点文章
|
||||
|
||||
- 在原文 15792 就地发布 1.14.3(94),更新版本介绍、安装说明、SEO、特色图片与站内主包。正文展示用户提交的 2046×1570 原图。1672×941 封面注明「不加密 · 不限制安装数量」。文章的历史界面图片、普通用户 50 元和鱼粉会员 0 元均经前台核验。
|
||||
- 文章主包下载名为「大鱼调色-1.14.3.pkg」,完整下载与公证发行包的字节数及 SHA-256 一致。发布输入与两张图片保存在 [1.14.3 发布目录](Publishing/1.14.3/),前后台和附件验证见 [站点验收](verification/Article1.14.3.json)。下次更新从文章 15792 的当前内容和资源字段回读开始。
|
||||
|
||||
## 1.14.3 图章稳定与逐帧跟踪预览
|
||||
|
||||
- `DYToolState.mm` 在连续分析段写入前,使用最多五帧的对称窗口平滑图章两侧坐标和对数缩放,起点与最后可信帧保持原值。Metal 跟踪渲染支持连续的亚像素取样,相对缩放经过 1 倍时连续过渡。取样跨出画面边缘时在最后一个像素内过渡。旧图章重新执行双向跟踪即可应用轨迹平滑。
|
||||
- 仿制图章和普通蒙版共用控制面板右侧的进度和同步预览。预览采用同一分析帧的画面与轮廓,图章显示青色取样和黄色覆盖,普通蒙版显示黄色轮廓。进度统计双向分析时的唯一帧数,进度条直接按比例绘制。自动分析期间时间线播放头停在起始位置,单帧跟踪仍按宿主时间映射移动播放头。
|
||||
- 在上次 257 帧 4K 轨迹离线回放中,取样中心二阶帧差 RMS 从 2.71 降到 0.95 像素,覆盖中心从 2.43 降到 0.92 像素。独立实拍副本中,图章和矩形蒙版均完成 190 帧跟踪,保存回读为连续 25 fps。94 版重跑验证了画面、轮廓和进度,51% 时条形填充与数值一致。验收覆盖本机 Final Cut Pro 12.4 与原生自检。[实拍验收](verification/HostTrackingPreview1.14.3.json)
|
||||
- 接续实拍反馈时,先在原问题片段重新跟踪旧图章,记录方向、首个异常时间码和取样区。若需复测,可使用本机验收库的独立副本。
|
||||
|
||||
## 1.14.0 图章取样与覆盖跟踪
|
||||
|
||||
- 用户在 1.13.4 的实拍工程中确认图章可落位、拖动,随后要求取样点和覆盖目标都参与跟踪并识别缩放。[1.13.4 实鼠确认](verification/HostCloneStampSave1.13.4.json)
|
||||
- 两个区域各自使用同一宿主源帧运行 OpenCV 分析。写入的每个轨迹键同时记录两点的位置与缩放。任一侧跟丢时,提交本次最后一段两侧均可信的连续轨迹。普通蒙版沿用原分析。旧图章单点轨迹仍按位移求值,可重新跟踪以获得双点数据。
|
||||
- 覆盖圈随覆盖区域缩放。渲染按取样区域和覆盖区域的相对缩放映射当前帧的源像素,两侧缩放相同时保留整数像素平移。调大或调小覆盖范围仍可独立操作。清除轨迹时将当前帧的图章外观保留为静态值。
|
||||
- 89 版在 FCP 12.4 实拍素材上完成正向和双向跟踪。双向导出得到 257 个连续双点键,并发现片尾一个原有自动键与最后的新键只差 6.33 毫秒。90 版按半帧识别同帧自动键,在分析范围边缘替换旧键,同时保留手工编辑和分析范围之外的轨迹。90 版在同一 4K 源帧上生成 257 个连续双点键,无旧键残留。最终帧横纵缩放分别约为取样 1.387 / 1.689 倍,覆盖 1.169 / 1.203 倍。两边各有独立的中心轨迹。[1.14.0 实拍与原生核验](verification/HostCloneTracking1.14.0.json)
|
||||
|
||||
## 1.13.1 等像素复制与取样十字拖动
|
||||
|
||||
- 选中图章后可拖动青色取样十字。拖动时更新标记,松手后换取样位置并形成一次撤销。Esc 取消,旧图章可直接编辑。源点调整适用于图章的全部帧,目标位置轨迹保持原样。
|
||||
- Metal 按整数像素偏移直接复制当前帧中的原像素,羽化只混合覆盖边缘。改变椭圆宽高只修改覆盖范围。画布和工作区移除图章旋转控件。跟踪继续用现有分析器求解运动,图章只应用中心位移。旧项目的轨迹键保留,历史缩放与旋转分量在图章求值时忽略。普通蒙版仍使用原有变换。
|
||||
- 入口为 `DYToolOSC.inc.h`、`DYToolCanvasEditing.inc.h`、`DYToolHostMethods.inc.h`、`DYToolState.mm` 和 `DYGrade.metal`。画布写回继续校验时间、图章 ID 和外部修改冲突。原生检查覆盖一次撤销、Esc 取消、拖动和调尺寸时保持跟踪键,以及实际 Metal 输出的等像素复制。
|
||||
|
||||
## 1.13.0 历史交付 · 画布响应与仿制图章
|
||||
|
||||
- 旧版工具栏重绘会清零并上传整张 CPU 位图。无蒙版、未进入图章取样时,新版只绘制工具栏和已打开面板所需的区域,并沿用宿主提供的透明画布。4K、2 倍缩放的空闲工具栏位图为 1000×134,约占 3840×2160 的 1.6%。蒙版与图章绘制仍可能使用整画布。
|
||||
- 工具文档复制改用内存深拷贝,已验证的不可变文档副本共享内容。每帧快照直接从选中的关键帧生成,不再绕一次序列化往返,也只为胶片层读取颗粒参数。M4 合成测试用四条各含 2400 个键的轨迹,40 次复制平均耗时从 18.018 ms 降到 10.949 ms。上述是局部测量,第三方反馈缺少触发动作、素材和工程,尚无法对同一场景前后复测。
|
||||
- 点击画布右下角仿制图章,点选取样中心,再拖出椭圆覆盖区。Esc 取消未保存操作。选中图章可直接在画布启动正向、反向或双向跟踪,也可在工作区选择图章,调整几何、强度和羽化、清除轨迹、旁路或删除。
|
||||
- 图章用现有共享蒙版文档和跟踪轨迹保存,使用独立标识,每次创建为一组撤销。取样位置和原取样尺寸固定,目标跟踪位移、缩放和旋转。Metal 从每帧同一源画面采样,在调色前处理预乘 RGBA,重叠图章按创建顺序合成。完整预设保留图章,启用图章时拒绝导出无法表达空间修改的 Cube。
|
||||
- 关键路径为 `DYToolOSC.inc.h`、`DYViewerControls.inc.h`、`DYToolHostMethods.inc.h`、`DYToolState.mm`、`DYManagedRender.inc.h` 和 `DYGrade.metal`。下一次排查卡顿时,先区分空闲画布、曲线拖动、工作区示波器和有蒙版的 4K 播放,再抓取对应场景的运行时间。
|
||||
|
||||
## 1.12.1 历史交付
|
||||
|
||||
- 检视器以紧凑高度打开,顶部按钮固定在参数滚动区外。80 版在接入宿主后强改视图高度,造成顶部裁切。81 版由 FCP 管理已挂载视图的空间,超出可用高度的模块在参数区内滚动。
|
||||
- 画布工具栏与曲线默认在右下。曲线顶部手柄可移动面板。松手后保留最终点位,等宿主写回后接续正式参数;保留时间和图层校验及一次手势一次撤销。
|
||||
- 画布与检视器的曲线直方图取样自当前效果的输出。画布按显示帧匹配,检视器接收效果输出更新。曲线直方图与工作区四宫格示波器各有显示用途,继续沿用各自的取样和色彩说明。
|
||||
- 画布新增白平衡吸管,复用基础调整的求解和参数写入;畸变修复使用枕形网格图标。独立图层被宿主拒绝写入时增加本机诊断 `dayu_tool_save_rejected`。
|
||||
|
||||
## 接手时的代码入口
|
||||
|
||||
下表中的文件位于 `大鱼调色/Plugin/`。
|
||||
|
||||
| 范围 | 入口 |
|
||||
| --- | --- |
|
||||
| 检视器高度、滚动和曲线刷新 | `DYInspector.mm` 的 `layout`、`curveOutputChanged:` |
|
||||
| 画布工具、曲线拖动和写回 | `DYViewerControls.inc.h`、`DYViewerParameterPanel.inc.h`、`DYViewerParameterBridge.inc.h` |
|
||||
| 效果输出取样与直方图 | `DYScopeCapture.inc.h`、`DYScopeSample.mm`、`DYHistogram.h` |
|
||||
| 画布白平衡与宿主写入诊断 | `DYPlugIn.mm`、`DYColorTables.h`、`DYToolState.mm` |
|
||||
| 工作区、共享蒙版与跟踪 | `DYColorWorkspace.mm`、`DYToolState.mm`、`DYToolOSC.inc.h`。共享蒙版以工具文档 schema 3 为编辑源,渲染展开副本只用于渲染。[工作区与跟踪专项交接](自定控件开发交接.md) |
|
||||
|
||||
## 验收与待跟进
|
||||
|
||||
- **86 版安装完整性加固。** `Shared/DYCodeIntegrity.m` 固定 Apple Developer ID Application、团队和签名标识,验证正在运行的代码及磁盘上的外层 APP、插件服务与签名资源。外层注册前拒绝改包并撤销此副本登记。XPC 在进入 FxPrincipal 前独立校验。更新器验签失败后取消本次运行的更新任务,停用检查、下载、安装,恢复须安装原包并重开。
|
||||
- **分发与边界。** 原始 PKG 允许原样转发,无机器码或账号授权。用户选择保留后端自动更新策略,由新版本在本地拒绝改包。对方若保留签名内件,只在外部加装控制,内件验签仍可通过。缺少倒卖样本,实际改法待确认。拒绝路径、旧包校验、原版更新及宿主画面均有独立记录。[完整性测试](verification/Integrity1.13.2.json)
|
||||
|
||||
- **85 版历史防护评估。** 1.13.1(85)的正式 APP `com.dayu.color` 与 FxPlug 服务 `com.dayu.color.XPC` 都由 `B3W25FX5H5` 的 Developer ID Application 签名。该版的外层 `AppDelegate.m` 在调用 `pluginkit -a` 前只检查组件元数据。插件 `Plugin/main.m` 直接进入 `FxPrincipal`,效果清单为静态登记。
|
||||
- **验签实测。** 用临时 Security.framework 探针对正式安装与独立副本执行静态签名校验,要求 Apple 签发的 Developer ID Application、指定 Team ID 和各自的签名标识。正式 APP 与服务均通过,错误标识、服务掉签、服务临时重签、Metal 资源被改及外层 APP 临时重签均被拒绝。仅重签外层时,原版内层服务单独校验仍通过。临时副本已清理。本轮未运行改包,也未获得倒卖样本,无法确认对方实际改动。
|
||||
|
||||
- **85 版像素复制与十字。** 正式安装的 864 项原生检查通过,实际 Metal 输出验证扩大覆盖只增加复制面积,重合像素逐值相同。FCP 12.4 独立项目副本读入 83 版图章,画布和工作区都只提供中心与尺寸控制,导出后原图章和 99 个轨迹键逐项一致。实窗自动拖动未产生宿主写入,十字拖动、一次撤销和 Esc 取消由正式安装版的原生回调覆盖。工作区“画面编辑”按钮仍沿用通用蒙版提示文字。[验收证据](verification/HostCloneSource1.13.1.json)
|
||||
|
||||
- **83 版图章与跟踪。** 安装后的 858 项原生检查通过。FCP 12.4 独立验收项目副本中已看到图标、取样十字、目标区及实际贴图。工作区触发真实正向跟踪,冷重开后导出的预设保留 99 个轨迹键,目标几何变化,取样坐标和尺寸一致。宿主测试通过载入验收预设创建图章。画布点击及拖选由原生 FxPlug 回调测试覆盖,自动鼠标输入没有进入实窗的 OSC 回调。[验收证据](verification/HostCloneStamp1.13.0.json)
|
||||
|
||||
- 正式 81 版通过 844 项原生检查。FCP 12.4 冷重开后,检视器顶部完整显示,曲线读到 57,600 个输出样本,原调色参数成功读回。同帧输出变更和检视器直方图刷新已通过原生检查。用户手动确认的是 80 版的画布曲线和实时直方图。[宿主验收](verification/HostCanvasInspector1.12.1.json)
|
||||
- **画布白平衡待实机复核。** 已验证取样入口分发、播放头改变后的写入保护、白平衡求解、色温和色调写入及一次撤销。下一次实机验收补做系统取样界面的点选和取消,核对取样后色温与色调的实际变化。[宿主验收范围](verification/HostCanvasInspector1.12.1.json)
|
||||
- **第三方 FCP 保存告警待反馈。** 本机内置 APFS 验收库未复现,退出重开读回正常。收到报错前的操作、时间、FCP 和插件版本、素材库位置后,再区分卷写入故障、素材库异常与特定插件写入触发;先保护原库与备份,复现在独立验收库进行。[保存告警排查](research/FinalCutSaveFailure-20261105.md)
|
||||
- 站点文章、自动更新通道和 Git Release 分别交付。接手通道更新时,以实时清单、正式包和对应的生产回滚记录为准。[更新部署说明](Backend/README.md)
|
||||
|
||||
## 继续工作
|
||||
|
||||
1. 核对 `git status --short --branch`、远端引用、正式安装版本与交付锁。先在独立 FCP 验收库重现用户本轮指定的问题,保留原工程和既有参数语义。
|
||||
2. 代码变更按 [RECOVERY.md](RECOVERY.md) 恢复和验收。常用入口为 `tools/checkpoint.py`、`tools/deliver.py` 与 `Packaging/build_pkg.py`;交付脚本等待宿主验收时,通过后才输入 `complete`。
|
||||
3. 按 [AGENTS.md](AGENTS.md) 在结束前更新本文并提交、推送、回读。
|
||||
|
||||
可复制到新对话:
|
||||
|
||||
> 在 `/Volumes/备份/大鱼调色/大鱼调色` 继续优化大鱼调色。先读项目 `AGENTS.md` 和 `开发交接.md`,以核实后的正式安装和验收记录为基线,按我接下来指定的内容修改。完成后更新交接文档。
|
||||
|
||||
## 任务记录
|
||||
|
||||
| 日期 | 任务 | 结果与接续 |
|
||||
| --- | --- | --- |
|
||||
| 2026-11-05 | 检视器、画布控件与保存告警排查 | 81 版正式安装并发布。80 版的画布反馈已复核,81 版修复检视器裁切与直方图刷新。剩余实机取样和第三方告警见上。 |
|
||||
| 2026-11-05 | 建立每次任务的交接流程 | 新建本入口及项目规则,为历史专项交接加指引。回读核对了正式安装 81、远程版本标签、站点文章及公测通道 79。本轮成果为项目文档。 |
|
||||
| 2026-11-05 | 画布响应与仿制图章 | 83 版正式安装,补齐图章渲染、现有跟踪复用及工作区编辑。性能局部测量、FCP 实帧和冷重开证据见本页,反馈场景待复现。 |
|
||||
| 2026-11-05 | 仿制图章等像素复制与取样十字拖动 | 加入源点拖动和撤销,复制改为整数像素平移,目标跟踪保留中心位移。 |
|
||||
| 2026-11-05 | 二次打包与重签防护评估 | 已核对注册和 XPC 启动入口,并用正式 85 版和改动副本验证候选验签规则。下一步可接入双入口校验并在正式安装版上复测 FCP。 |
|
||||
| 2026-11-05 | 防二次加密和重签 | 1.13.2(86)正式安装。注册、服务启动和更新入口加入验签,FCP 和安装包通过验收。公测 Release 393 已发布并完整下载核对,站点及自动更新策略沿用原配置。 |
|
||||
| 2026-11-05 | 更新 1.13.2 站点文章 | 在原文章 15792 更新正文、SEO 和主下载包,加入验签、原包转发规则、仿制图章与故障排查说明。原售价、会员权益、封面和历史图片均已回读,主包完整下载校验通过。公测自动更新通道回读为 1.12.0。 |
|
||||
| 2026-11-06 | 仿制图章松手消失和拖动回弹 | FCP 在同一次手势给出相差约 32 毫秒的绘制时间与参数写入时间。88 版将图章文档写入与几何时间分开,用户实拍确认可拖动。本机正式安装和 88 安装包已验收;接续实现取样与覆盖区域独立跟踪及缩放后再发 Release。 |
|
||||
| 2026-11-06 | 图章跳动闪烁与逐帧跟踪预览 | 1.14.3(94)正式安装和发布。图章与矩形蒙版实拍双向跟踪、轨迹回读、进度和取样连续性通过验收。 |
|
||||
| 2026-11-06 | 1.14.3 更新到站点文章 | 原文已发布新版本,绑定界面原图、新封面和 94 版主下载包。前台 SEO、原图与封面、商业字段和完整下载均已核验。 |
|
||||
| 2026-11-06 | 复核分发后的完整性失败 | 核实 94 包四个资源的落盘权限并复现严格验签失败。95 版修正权限、缩小启动检查范围并加入打包权限检查。现场证书链和宿主核验见上。 |
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
# 大鱼调色自定控件开发交接
|
||||
|
||||
> 当前正式版本、最新控件行为和待验收事项见 [开发交接.md](开发交接.md)。下文保留 1.12.0 及更早版本的实现与研究记录。
|
||||
|
||||
更新日期:2026-11-05,Asia/Shanghai。
|
||||
|
||||
当前正式安装为 **1.12.0(79)统一工作区与共享蒙版**,编译源码beccf2fc01f8dc06c5d3d505f88289885d209bc8,834项正式原生检查及本轮FCP反馈验收通过。实际交付进度以 `verification/Delivery.json`、`HostFeedback78.json`、`HostFeedback79.json`、`Package.json`、`Release.json` 为准;安装包及Release完成前不宣称整体交付完成。新增最近LUT快捷缩略图与左下横排画布图标,肤色线、片尾时间修复和真实跟踪误差见research/WorkspaceFeedback-20261105.md。
|
||||
当前正式安装为 **1.12.0(79)统一工作区与共享蒙版**,编译源码beccf2fc01f8dc06c5d3d505f88289885d209bc8,834项正式原生检查及本轮FCP反馈验收通过。实际交付进度以 `verification/Delivery.json`、`HostFeedback78.json`、`HostFeedback79.json`、`Package.json`、`Release.json` 为准;正式安装包签名、公证、20项验包、Release389草稿与发布后完整下载校验均完成。新增最近LUT快捷缩略图与左下横排画布图标,肤色线、片尾时间修复和真实跟踪误差见research/WorkspaceFeedback-20261105.md。
|
||||
|
||||
画布**左侧**常驻矩形、椭圆、钢笔蒙版入口,另有曲线、畸变、肤色、LUT;底部“控制面板”打开统一工作区。HSL、蜘蛛盘、色轮和通用参数浮卡已退出画布。曲线只显示透明曲线/直方图及必要通道,畸变直接操作网格,肤色切换真实保护范围显示,LUT直接进入原缩略图浏览器。
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户