比较提交

...
作者 SHA1 备注 提交日期
mac a2c8dfafcf docs: record task-scoped PKG staging cleanup and maintained skill revision 2026-11-01 14:07:30 +08:00
mac 95fe3019cc release: record signed notarized Dayu Color PKG with strict FxPlug payload verification 2026-11-01 14:02:08 +08:00
mac 2bb062c82f build: package verified Dayu Color app and FCP template using PKG Forge skill 2026-11-01 14:00:15 +08:00
mac cd54104b6a release: verify notarized 1.1.3 build14 asynchronous LUT loading in Final Cut Pro 2026-11-01 12:28:04 +08:00
mac 6452e793f9 docs: preserve asynchronous LUT benchmarks, recovery checks and pending host acceptance 2026-11-01 11:32:04 +08:00
mac d64430cd66 fix: leave LUT menu tracking before opening file and browser panels 2026-11-01 11:29:59 +08:00
mac cc7f9c952a fix: retain FxPlug-compatible file dialogs and preserve previous app through host acceptance 2026-11-01 11:17:31 +08:00
mac 875add7adf fix: identify inspector LUT requests by generation and clarify import cancellation 2026-11-01 11:11:59 +08:00
mac ddcaa821be docs: add reproducible large-LUT host fixture and asynchronous loading notes 2026-11-01 11:11:05 +08:00
mac 838037a7e0 perf: virtualize LUT directory rows as well as thumbnails for large libraries 2026-11-01 11:09:41 +08:00
mac 87baa785fd feat: load LUT libraries and selections in background with cancellation and visible-only thumbnails 2026-11-01 11:08:10 +08:00
mac 57830ca744 docs: record repository description permission gap after documentation cleanup 2026-10-31 16:17:43 +08:00
mac 719229ddd8 docs: organize Color Finale migration research and remove prior target descriptions from current tree 2026-10-31 16:16:47 +08:00
mac 29dc4d385c docs: verify notarized 1.1.2 group folding in FCP and independent source recovery 2026-10-31 12:58:39 +08:00
mac cdcb30a6aa fix: defer remote group accessibility updates until the host parameter action has ended 2026-10-31 12:13:25 +08:00
mac 5ff62b9bb3 fix: fully bypass all LUT layers for collapsed groups and preflight releases before notarizing 2026-10-31 12:03:29 +08:00
mac e3635a9831 feat: couple group expansion to activation and default to basic adjustments only 2026-10-31 12:00:55 +08:00
mac 3645119118 fix: keep bypassed group controls legible and correct skin strength percentage in 1.1.2 2026-10-31 11:50:46 +08:00
mac 09321ed524 docs: verify notarized 1.1.1 brand assets in native app and FCP with reproducible recovery 2026-10-31 11:37:19 +08:00
mac bd02c7a368 feat: add spectral fish app icon and branded FCP effect thumbnails for 1.1.1 2026-10-31 11:33:39 +08:00
共修改 60 个文件,包含 2716 行新增和 3223 行删除

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

+115
查看文件
@@ -0,0 +1,115 @@
#!/usr/bin/env python3
"""Package the verified formal Dayu Color installation through the PKG Forge skill."""
import argparse
import datetime
import hashlib
import json
import os
from pathlib import Path
import plistlib
import shutil
import subprocess
ROOT = Path(__file__).resolve().parent.parent
APP = Path("/Library/Plug-Ins/FxPlug/大鱼调色.app")
CACHE = Path.home() / "Library/Caches/CodexBuilds/com.dayu.color"
LOCK = Path.home() / ".codex/app-delivery-locks/com.dayu.color.lock"
def run(*args, cwd=None):
return subprocess.check_output(args, cwd=cwd, text=True, stderr=subprocess.STDOUT).strip()
def history(profile, keychain):
return json.loads(run("xcrun", "notarytool", "history", "--keychain-profile", profile,
"--keychain", keychain, "--output-format", "json"))["history"]
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--pkg-forge-repo", type=Path,
default=Path.home() / "Documents/dayu-git/repositories/pkg-forge")
parser.add_argument("--output-dir", type=Path, default=ROOT.parent / "发行包")
parser.add_argument("--prepare-only", action="store_true")
args = parser.parse_args()
args.output_dir = args.output_dir.expanduser().resolve()
forge = args.pkg_forge_repo.expanduser().resolve()
skill = forge / "skills/pkg-forge/scripts"
assert (skill / "package_fxplug.py").is_file(), "请指定含 pkg-forge 技能的 PKG 工坊 checkout"
delivery = json.loads((ROOT / "verification/Delivery.json").read_text())
info = plistlib.loads((APP / "Contents/Info.plist").read_bytes())
assert delivery["status"] == "verified" and delivery["path"] == str(APP)
assert info["CFBundleIdentifier"] == "com.dayu.color"
assert (info["CFBundleShortVersionString"], info["CFBundleVersion"]) == (delivery["version"], delivery["build"])
args.output_dir.mkdir(parents=True, exist_ok=True)
CACHE.mkdir(parents=True, exist_ok=True)
LOCK.parent.mkdir(parents=True, exist_ok=True)
LOCK.mkdir()
(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:
source = APP / "Contents/Resources/FCP Templates"
staged = CACHE / "pkg-inputs/大鱼调色/大鱼调色"
staged.mkdir(parents=True, exist_ok=True)
hashes = {}
for name in ["大鱼调色.moef", "large.png", "small.png"]:
data = (source / name).read_bytes()
assert data == (ROOT / "template" / name).read_bytes(), name
target = staged / name
if target.exists():
os.chflags(target, 0)
target.write_bytes(data)
target.chmod(0o644)
if name.endswith(".png"):
os.chflags(target, 2)
hashes[name] = hashlib.sha256(data).hexdigest()
for folder in [staged, staged.parent]:
folder.chmod(0o755)
keychain = str(Path.home() / "Library/Keychains/login.keychain-db")
profile = "codex-dayu-notary-B3W25FX5H5"
version = info["CFBundleShortVersionString"]
manifest = dict(name="大鱼调色", output=str(args.output_dir / "大鱼调色.pkg"),
identifierPrefix="com.dayu.color.installer", resources=[dict(source=str(APP)),
dict(source=str(staged.parent), destination="~/Movies/Motion Templates.localized/Effects.localized")],
signing=dict(identity="Developer ID Installer: zhong luo (B3W25FX5H5)", profile=profile,
keychain=keychain, notaryKeychain=keychain),
appearance=dict(title="大鱼调色", subtitle="适用于 Final Cut Pro 与 Motion 的原生调色效果",
badgeImage=str(ROOT / "design/dayu-color-app-icon-v1.png"), authorContact="https://dayu.media"),
pages=dict(welcome="安装大鱼调色 " + version + ",包含原生 FxPlug 调色插件和 Final Cut Pro 效果入口。",
readme="系统要求:macOS 14.6 或更高版本。本发行构建适用于 Apple Silicon Mac。\n\n安装内容:\n/Library/Plug-Ins/FxPlug/大鱼调色.app\n登录用户“影片/Motion Templates/Effects/大鱼调色”中的效果模板与预览图。\n\n重新打开 Final Cut Pro 后,在“效果 → 大鱼调色”中应用;Motion 中可选择原生滤镜。\n本安装包不包含用户自选 LUT、预设或媒体文件。",
license="", conclusion="大鱼调色已安装。请完成插件 APP 的系统提示,随后退出并重新打开 Final Cut Pro / Motion。\n如果效果未出现,可在访达打开 /Library/Plug-Ins/FxPlug/大鱼调色.app 后再次启动宿主。"))
manifest_path = CACHE / "dayu-color-package-manifest.json"
manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2) + "\n")
command = ["/usr/bin/python3", str(skill / "package_fxplug.py"), "--repo", str(forge), "--manifest", str(manifest_path)]
subprocess.run(command + ["--check"], check=True)
if args.prepare_only:
print("清单:" + str(manifest_path))
return
before = {x["id"] for x in history(profile, keychain)}
log_path = CACHE / "pkg-release-build.log"
with log_path.open("w") as log:
subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=True)
package = args.output_dir / ("大鱼调色-" + version + ".pkg")
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)
jobs = [x for x in history(profile, keychain) if x["id"] not in before and x["name"] == package.name]
assert len(jobs) == 1, "安装包已生成,请核对公证 ID;不要重复提交同一包"
job = json.loads(run("xcrun", "notarytool", "info", jobs[0]["id"], "--keychain-profile", profile,
"--keychain", keychain, "--output-format", "json"))
assert job["status"] == "Accepted"
report = json.loads(report_path.read_text())
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,
installedAppHostAcceptance="verification/HostLUTLoading.json",
installScope="本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。")
report_path.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
print("正式安装包:" + str(package))
finally:
(LOCK / "owner.json").unlink()
LOCK.rmdir()
if __name__ == "__main__":
main()
+23 -4
查看文件
@@ -1,22 +1,41 @@
# 大鱼调色
在原初始化 Xcode 工程中完成的原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
支持 17 种相机输入转换、自选输入 LUT、基础光影、白平衡、局部增强、肤色保护、五层风格 LUT、RGB 曲线、8 色与自定义 HSL、四个色轮、三原色、色阶、黑白和色彩平衡。包含自动调色、复制时自动分析、系统吸管、JSON 预设和 Cube 导出。
- [分析与范围](research/ANALYSIS.md)
- [Color Finale 移植研究与算法来源](research/ALGORITHM_SOURCES.md)
- [恢复、依赖与正式交付](RECOVERY.md)
- [GPU 数学来源与验证](tools/kernels/README.md)
- [正式安装记录](verification/Delivery.json)
- [LUT 后台加载的 FCP 验收](verification/HostLUTLoading.json)
- [LUT 加载响应压力测试](verification/LUTResponsiveness.json)
- [程序图标与插件缩略图验收](verification/BrandAssets.json)
- [分组展开与启用验收](verification/HostGroupFolding.json)
- [主题与 LUT 库的 FCP 验收](verification/HostThemeLUT.json)
- [早期调色链的 FCP 验收](verification/Host.json)
主题与 LUT 浏览库版本为 1.1.0(6),源码标签 `v1.1.0-theme-lut-20261031`。灰、蓝、紫、绿、橙五套主题采用原版完整配色和分组样式,切换后跨实例记忆。风格 LUT 左侧网格按钮打开缩略图浏览器,右侧文件夹按钮打开 `~/Movies/大鱼调色LUT/look LUTs`。可导入文件或目录,按目录与名称过滤,单击应用,缩略图大小与目录会保存。
当前正式版本为 1.1.3(14),交付标签 `v1.1.3-async-lut-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。
主题与 LUT 浏览库自 1.1.0(6)提供,源码标签 `v1.1.0-theme-lut-20261031`。灰、蓝、紫、绿、橙五套主题切换后跨实例记忆。风格 LUT 左侧网格按钮打开缩略图浏览器,右侧文件夹按钮打开 `~/Movies/大鱼调色LUT/look LUTs`。可导入文件或目录,按目录与名称过滤,单击应用,缩略图大小与目录会保存。
缩略图使用当前素材先经过输入 LUT 的画面;没有源帧时显示本产品生成的色卡。显示方向与宿主图像原点一致,自动分析保留自己的原始数据。浏览器优先采用 FxPlug 宿主窗口,不能使用时回退为锚定弹出面板。品牌保留大鱼,吸管仍为系统取色器。
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建不读取 LumiGrade 应用。Compositor 数学表的 MIT 许可随资源保留。
算法背景资料补充了同系列工程的 **Color Finale 移植研究**,涵盖调色工具、LUT 预览、图层与蒙版工作流;归档记录、适用范围及当前实现的来源区分见 [算法说明](research/ALGORITHM_SOURCES.md)。Camera Raw 查表数据与组合行为采用 Compositor 的 MIT 许可实现,许可证随资源保留。
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建使用仓库中的源码和资源。
选择自有 LUT 后,预设记录其绝对路径;跨机器搬移时同时保留 LUT 文件并重新选择。LUT 导出只保存逐像素颜色,不包含纹理、清晰度或逐画面分析。
`tools/create_lut_host_fixture.py` 可重建独立 FCP 验收 XML 和四个合成测试 LUT;它只写产品缓存,不会向用户库自动导入。LUT 核心检查见 `verification/LUTLibrary.json`,原版主题与浏览行为证据见 `research/ThemeLUT-analysis.md`。
`tools/create_lut_host_fixture.py` 可重建独立 FCP 验收 XML 和四个合成测试 LUT;它只写产品缓存,不会向用户库自动导入。LUT 核心检查见 `verification/LUTLibrary.json`,主题与浏览库实现说明见 `research/ThemeLUT-analysis.md`。
`tools/create_group_fold_host_fixture.py` 可创建独立的合成验收时间线,用于检查新实例仅基础调节默认启用、分组展开/折叠与数值保留。风格 LUT 总组停用会旁路全部五层;停用的输入或风格 LUT 不加载其文件。
LUT 文件夹扫描、逐项校验/复制和选择文件后的解析均在后台执行;导入期间可继续搜索、滚动和选择,刷新按钮临时变为“取消”。失败或取消会移除本次新复制的文件并保留既有库。目录与缩略图只为可见范围创建控件,预览逐项出现;快速切换时仅应用最后一次选择。24个65级合成LUT与3,025项库的响应测试见 [LUTResponsiveness.json](verification/LUTResponsiveness.json)。
正式 PKG 打包使用 PKG 工坊源码中的 `pkg-forge` 技能。运行 `python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录`,默认输出到上级“发行包”目录;先使用 `--prepare-only` 可只检查清单。打包使用已验证的正式 APP,并从相同 APP 资源中核对、整理 FCP 模板与缩略图,不重签或重建调色 APP。生成包将要求正常退出四种 FCP/Motion 宿主并在登录用户会话验证注册;签名公证和真实展开验包由该技能的原打包器与校验器完成。已有同名版本包不会覆盖。
当前正式安装包:[大鱼调色-1.1.3.pkg](../发行包/大鱼调色-1.1.3.pkg),包含1.1.3(14)正式APP及相同版本的FCP模板/预览图;本机Apple Silicon,最低macOS14.6。签名、公证与20项真实展开验包记录见 [Package.json](verification/Package.json)。本轮没有重复执行系统安装;包内APP与已验收的正式安装逐字节一致。
+57 -7
查看文件
@@ -4,29 +4,41 @@
初始化基线:10987dd6bcc6986ea321eff75b37d4e8b48e966d;后续节点见git log。
产品主ID:com.dayu.color,XPC:com.dayu.color.XPC;唯一正式位置:/Library/Plug-Ins/FxPlug/大鱼调色.app。
当前交付标签:v1.1.0-theme-lut-20261031。APP 1.1.0(6)编译源码:c8d92077e5a017fa4b1a7ee7b24be2386b29294d;标签另含本次宿主验收与恢复记录。Apple公证ID 3629c27c-7689-4cde-b591-666aa93320a3,Accepted;正式签名、票据和实际安装状态见 verification/Delivery.json,主题/LUT宿主验收见 verification/HostThemeLUT.json。
当前交付标签:v1.1.3-async-lut-20261101。APP 1.1.3(14)编译源码:6452e793f974234b5ffffdfad5dc3ddeee64d53c;标签另含最终宿主验收与恢复记录。Apple 公证 ID d47784c7-7cad-4837-93ab-9bce5d8c19da,Accepted;正式签名、票据、Gatekeeper 与唯一安装均通过,见 verification/Delivery.json。
分组折叠版本 v1.1.2-group-fold-20261031 保留,编译源码 cdcb30a6aa1519bfb2f183165fef11cbf278bc7c,原公证 ID 398b020c-9e1e-4c2b-b637-e8e3af2a8f59。
所有调色分组展开即启用、折叠即停用,关闭时参数不可见;仅基础调节在新实例和全部还原后默认展开。折叠保留数值和 LUT 路径;打开已保存实例时按其实际启用状态展开。基础调节同时控制原光影与颜色两个子组。风格 LUT 总组停用时全部五层均旁路,关闭的输入或风格 LUT 不加载文件。肤色保护的百分比字段按0–100范围显示和保存。
FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红45与肤色65%跨折叠及保存重开保留、全部还原后只展开基础调节的验收见 verification/HostGroupFolding.json。仅在独立合成验收项目中改值,最后恢复默认;用户媒体和其他产品未作改动。
图标交付标签 v1.1.1-brand-icons-20261031 保留,编译源码 bd02c7a368348fdea6357889a09fba298872487a,原公证ID 352e85a7-f603-4e93-8c1a-43f6c107bea1。正式程序关于窗口的新图标、FCP12.4效果浏览器缩略图与安装资源校验见 verification/BrandAssets.json;本次沿用相同品牌资源。
主题/LUT交付标签 v1.1.0-theme-lut-20261031 保留,编译源码 c8d92077e5a017fa4b1a7ee7b24be2386b29294d,宿主验收见 verification/HostThemeLUT.json。
历史交付 v1.0.0-build2-20261031 保留;其编译源码 ce7e0a3371693c84c97267af12ca0f078b0db981,原生调色链及初次 FCP 导出验收见 verification/Host.json。
当前源码的远端独立克隆、逐文件比对、strict/full fsck、完整 XPC Release 重建和73项原生自检见 verification/ThemeLUTRecovery.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建不依赖原厂APP。
本次编译节点的远端独立克隆116个已提交文件比对、strict/full fsck、从源码与本机SDK重建原生模型注册信息及FCP模板逐字节一致,见 verification/GroupFoldingRecovery.json。当前模板 SHA256:ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1。
图标版本的远端独立克隆113文件比对、strict/full fsck和三种导出资源逐字节重建见 verification/BrandRecovery.json。主题/LUT源码的完整 XPC Release 重建和73项原生自检见 verification/ThemeLUTRecovery.json;本次Release送公证前及正式安装后均通过82项原生自检,正式结果见 verification/InstalledSelfTest.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建只使用仓库内的源码与资源。
## 恢复和构建
1. 登录大鱼站获取Git令牌,通过系统凭据管理登录;克隆上述私有仓库。
1. 登录大鱼站获取Git令牌,通过系统凭据管理登录;克隆上述仓库。
2. git switch --detach <完整提交SHA> 恢复任一已保存节点;发布节点见版本标签与verification/Delivery.json。
3. 依赖:Xcode27.1 / macOS SDK27,Metal Toolchain,FxPlug SDK4.3.5(/Library/Developer/SDKs/FxPlug.sdk),FxPlug及PluginManager运行框架(/Library/Developer/Frameworks)。最低系统14.6,当前验证Apple M4。
4. Xcode打开大鱼调色.xcodeproj,Wrapper Application方案,Release。构建脚本由版本化LLVM文本重建Metal库;不读取参考LumiGrade或网络源。17相机输入、Camera Raw数学表均已入Git,无LFS、无子模块。
4. Xcode打开大鱼调色.xcodeproj,Wrapper Application方案,Release。构建脚本由版本化LLVM文本重建Metal库;不读取外部应用或网络源。17相机输入、Camera Raw数学表均已入Git,无LFS、无子模块。
5. 更改模型后运行 python3 tools/build_template.py --refresh-model --overwrite,更新FCP原生壳的注册参数与归档。
6. 正式交付运行 python3 tools/deliver.py;脚本持有产品锁,Release、逐层Developer ID签名、Apple Accepted、staple/validate、Gatekeeper、原子替换、清理副本、PluginKit唯一登记。等待宿主验收后输入complete才记通过。
6. 正式交付运行 python3 tools/deliver.py;脚本持有产品锁,Release、逐层Developer ID签名、自检通过后送Apple Accepted、staple/validate、Gatekeeper、原子替换、正式版自检、清理副本、PluginKit唯一登记。等待宿主验收后输入complete才记通过。
7. 固定缓存:/Users/mac/Library/Caches/CodexBuilds/com.dayu.color。正式XPC支持 --self-test 输出原生模型/IOSurface/颜色/LUT集成JSON。请从正式安装路径运行。
## 证书和数据
Developer ID团队B3W25FX5H5,公证profile codex-dayu-notary-B3W25FX5H5。证书私钥及钥匙串需独立恢复,不在Git。
资产预设保存调色数字和用户所选LUT绝对路径;用户自选LUT本身、用户媒体和宿主资料库不属于代码备份。跨机器恢复预设时需同时搬移用户LUT并重新选择。源代码不读取原厂授权、设备凭据或联网服务。
资产预设保存调色数字和用户所选LUT绝对路径;用户自选LUT本身、用户媒体和宿主资料库不属于代码备份。跨机器恢复预设时需同时搬移用户LUT并重新选择。运行与构建使用本工程的参数、资源及用户选择的文件。
原程序版本、SHA、方法证据与局限见research/。GPU/数学/原生集成与实际宿主验证分别记录,单项算法通过不代表所有宿主/GPU/素材完全等同。
Color Finale 移植研究、当前算法来源及历史记录入口见 research/ALGORITHM_SOURCES.md。GPU/数学/原生集成与实际宿主验证分别记录,单项算法通过不代表所有宿主/GPU/素材完全等同。
此工作区在exFAT外置卷,Git元数据位于本机APFS /Users/mac/Library/Application Support/DayuGitMetadata/dayu-color.git,工作区.git为指向文件。远端克隆在新机器会生成正常独立.git;无需复制此本机指向。
@@ -37,3 +49,41 @@ Developer ID团队B3W25FX5H5,公证profile codex-dayu-notary-B3W25FX5H5。证
缩略图捕获输入转换后的源帧,显示层按 FxPlug 的原点单独转换为顶部优先。原分析帧字节序、调色核心和 Metal 数学库未变。当前宿主验收采用原生锚定 Popover;支持 FxRemoteWindow 的宿主也可使用其窗口接口。
运行 python3 tools/create_lut_host_fixture.py 可重建合成验收图、独立 XML 与四个测试 LUT,输出只在产品缓存。随后从浏览器导入测试目录并在 FCP 验证,不自动写入用户库。
## 品牌资源
程序图标与插件缩略图由内置图像生成工具分别生成,采用同一光谱鱼标志。原始 PNG 和完整提示词见 design/ASSETS.json。程序 ICNS 含16至1024像素的标准图标表示;FCP预览为640×360与240×135。恢复后运行 python3 tools/build_brand_assets.py 可使用macOS自带sips/iconutil重建三项资源,不需要联网生成,使用仓库内已保存的资源。大图原始PNG、ICNS及两种FCP缩略图均保存在普通Git对象中,无LFS或子模块。
## 仓库说明整理(2026-10-31)
当前主分支增加了来自同系列“大鱼调色盘”工程的 Color Finale 移植研究快照,来源提交4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca与逐文件摘要见 research/color-finale/SOURCES.json。当前算法链、相关研究和MIT查表来源分别在 research/ALGORITHM_SOURCES.md 说明。整理前完整资料保存在提交29dc4d385c1459cd330d8a9083ec9756787afef3,现有历史和发行标签不改写。
该次整理仅涉及说明、源码注释和验证工具的输入方式,当时正式程序为1.1.2(11);实际功能代码、GPU内核、模型、资源、签名与已公证安装未变。GPU对照工具改为显式传入第三个参数指定对照库,使用方法见 tools/kernels/README.md。
## LUT 后台加载优化(2026-11-01)
扫描、逐项校验、复制、LUT 解析和缩略图生成均在后台;主线程只读短锁快照并更新界面。导入可取消,失败或取消回滚本次文件并保留原有库;预览只为可见项创建视图。独立选择队列使当前选中的 LUT 不必等待缩略图,连续选择以最后一次为准。菜单退出后再打开文件选择框,避免在远程检查器中嵌套菜单与文件框。
verification/LUTResponsiveness.json 记录同一组 24 个 65³ 合成 LUT(197,731,344 字节)导入:旧实现主线程最大空档 10,018.8 毫秒,新实现 6.251 毫秒,耗时从 10.019 秒降为 7.399 秒。3,025 条目/3,000 文件夹仅创建 45 个缩略图视图和 15 个文件夹视图,56 项后台检查及 92 项库检查通过。此数据来自本机 Apple M4、APFS 与真实主运行循环心跳,网络卷和旧机器尚未测量。
正式 14 版在 FCP12.4 独立合成项目中完成 8.2 MB 单文件载入、24 文件目录导入、192 文件校验期间搜索和取消、渐进缩略图、滚动与快速选择,正常退出重开保留最后一次 LUT。单文件旧问题与各版本的实际验收分别见 verification/HostLUTLoading.json。13 版等待状态按用户明确授权强制退出一次;14 版后续正常退出与重开均通过。
验收后仅核对合成文件 SHA256 再清理本次 72 个导入副本,原有 4 个 LUT 保留。浏览器恢复原目录、空搜索与160大小,验收项目全部还原后仅基础调节展开、LUT 路径清空。正式安装、启动与宿主检查通过后清理旧12/13候选备份;已检查的构建、工程和标准安装目录只有正式外层 APP。用户资料库与源媒体未用于测试。
远端编译源码 6452e793f974234b5ffffdfad5dc3ddeee64d53c 独立恢复129个已提交文件逐字节一致、strict/full fsck、从恢复源码重建92项库检查通过,见 verification/AsyncLUTRecovery.json。Release 送公证前与正式安装后82项 Metal/IOSurface原生集成检查通过。无需读取外部目标程序,模型 ABI、模板及 Metal 数学库未变。
运行 python3 tools/create_async_lut_host_fixture.py --cancel-pack 可在产品缓存重建24个65³导入样本和192个硬链接取消样本,不自动写入用户库;运行 tools/verify_lut_responsiveness.mm 构建出的独立检查器可重测响应。完整 VoiceOver、旧系统、Intel、网络卷未作验收;SwiftUI 专用审查对现有 AppKit 实现不适用。
## 正式 PKG(2026-11-01)
安装包:上级发行包/大鱼调色-1.1.3.pkg,13,742,355字节,SHA256 2538d513debe9357b4cb78cc7de96783390b41133ad6d1bacf99ed42b18d470c。Apple 公证 ID 70a315dc-5741-45f2-95fa-875454447177,Accepted;Developer ID Installer团队B3W25FX5H5、可信时间戳、票据与Gatekeeper install通过。发行记录标签 v1.1.3-pkg-20261101。
打包脚本 Packaging/build_pkg.py,编写节点2bb062c82fcd7eddcba742f7324c662c079bf13c;复用 https://dayu.media/git/dayu/pkg-forge.git 的6d4266efbf85d13582a5d9d97f492273872128f4节点内 skills/pkg-forge 技能。恢复该源码并准备已公证正式APP及本机独立签名凭据后运行:
python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录 --output-dir /新的发行目录
新机器需先按前述编译源码6452e793f974234b5ffffdfad5dc3ddeee64d53c恢复、正式签名公证并安装APP;打包不会替APP重签。默认输出已有同版本包时停止,不覆盖历史包。
包内完整APP固定至/Library/Plug-Ins/FxPlug/大鱼调色.app;模板分类文件夹及3个必要文件单独安装至登录用户的Motion Templates效果目录,预览锁恢复命令已核对。四种FCP/Motion must-close、root授权、桌面与Bundle ID前置检查、用户GUI注册worker、逐插件真实验证调用、连续验证、修复、成功/失败均显示目录、禁止relocation、欢迎与结束页均通过实际展开检查。包内APP与正式APP全部文件/符号链接一致,APP独立签名票据和Gatekeeper通过。
系统安装器介绍页、说明页及光谱鱼角标已预览;没有执行安装动作,不宣称本PKG实际安装流程/注册或旧系统已验收。已有正式APP的FCP保存重开等验收仍见HostLUTLoading.json。包、用户媒体和凭据不进入源码Git;重建的签名时间戳、随机组件ID与公证票据会使PKG摘要不同。完整验包结果见verification/Package.json。
打包技能清理修正:当前推荐技能标签skill-pkg-forge-20261101-r2,节点191da9dc0abfda83fcc5939f6fc90e4c9019f4d9。最初生成正式包所用6d4266e保留为真实来源;修正版只增加唯一组件ID关联的暂存清理,不改原PackageBuilder或正式包内容。旧版打包器因保护预览留下的两份载荷及本次探针副本已按任务ID核实清理;修正版真实测试完成后无本任务APP暂存,源预览锁保留。补充交付记录标签v1.1.3-pkg-20261101-r2;初次PKG标签保留。
+24
查看文件
@@ -0,0 +1,24 @@
{
"generator": "OpenAI built-in image_gen",
"created": "2026-10-31",
"brand": "大鱼调色",
"assets": [
{
"path": "design/dayu-color-app-icon-v1.png",
"width": 1254,
"height": 1254,
"alpha": true,
"prompt": "Use case: logo-brand.\nAsset type: final macOS application icon for the Chinese color-grading FxPlug product 大鱼调色 (Dayu Color).\nCreate ONE polished square 1024×1024 raster app icon, NOT a presentation board or mockup. A single bold, abstract fish silhouette formed from a smooth continuous spectral ribbon flowing cyan → blue → violet → magenta → warm orange, curving around a dark circular negative space like a color-grading wheel. The fish should read immediately at small Dock sizes, with a clear tail and elegantly tapered head, no eye details. Center it on a deep midnight-navy rounded-square app tile, restrained dimensional glass/enamel shading, clean premium native macOS software aesthetic. The tile occupies about 88% of the canvas, equal safety margins, subtle soft shadow, no extra rings or small controls. Outside the rounded square is genuinely transparent alpha. Crisp silhouette, balanced negative space, vivid color and controlled highlights. No lettering, no words, no badges, no watermark, no borrowed brand marks. This is the standalone icon asset itself, straight-on, not an icon pictured on a device or in a scene."
},
{
"path": "design/dayu-color-plugin-thumbnail-v1.png",
"width": 1672,
"height": 941,
"alpha": false,
"reference": "design/dayu-color-app-icon-v1.png",
"prompt": "Use case: logo-brand.\nAsset type: final widescreen 16:9 plugin thumbnail for the Final Cut Pro effects browser, for 大鱼调色.\nInput Image 1 is a brand reference, not an edit target. Preserve its recognizable spectral fish silhouette and cyan-blue-violet-magenta-orange enamel material, but generate a NEW horizontal composition. One 16:9 image, preferably 1536×864 or 1920×1080, not a presentation board.\nFull-bleed midnight navy background, very restrained soft chromatic illumination. The same circular spectral fish emblem sits prominently on the left half, WITHOUT a rounded-square app tile around it. On the right half, large perfectly legible white Chinese typography reading exactly \"大鱼调色\" in a modern bold sans-serif, horizontal one-line title. A little breathing room between emblem and title. The emblem and title have equal visual authority; both remain readable when reduced to a small effect thumbnail. Keep all essential content inside an 8% safety margin. Premium native creative-software identity, crisp luminous ribbon edges, controlled highlights and generous negative space. No other words or letters, no version numbers, no fake interface, no devices, no watermark, no extra logos, no additional fish. The final asset fills the entire rectangular canvas, with no outer transparent margin."
}
],
"exportCommand": "python3 tools/build_brand_assets.py",
"note": "原始生成图保留;通过 macOS sips 和 iconutil 导出图标与 FCP 的两种预览尺寸。"
}
二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.5 MiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.4 MiB

+31
查看文件
@@ -0,0 +1,31 @@
# Color Finale 移植研究与算法来源
整理日期:2026-10-31。依据用户指出的上级工程,已核对 `../大鱼调色盘` 中的 Color Finale 移植研究,并将四份已提交的资料逐字节归档到 [color-finale/](color-finale/)。来源工程为 `dayu/dayu-colorplate`,提交 `4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca`;逐文件摘要见 [SOURCES.json](color-finale/SOURCES.json)。
## Color Finale 移植背景
该系列研究涵盖 Color Finale 2.16.2(625)的调色工具、RGB/HSL 曲线、色轮、相机矩阵、LUT 库和当前帧批量预览,以及图层、蒙版、跟踪、色彩管理与胶片处理。资料分别记录了静态观察、独立算法设计、迁移目标和验收边界:
- [研究记录](color-finale/colorfinale.md):工具结构、LUT 预览与缓存、跟踪流程及证据编号。
- [颜色工具设计](color-finale/colorfinale-color-tools-design.md):曲线、Log 色轮、相机矩阵和其他颜色算子的独立实现设计。
- [迁移矩阵](color-finale/colorfinale-2.0-matrix.md):功能目标、已实现项和开放项。
- [静态证据索引](color-finale/evidence-index/colorfinale-index.json):发行包身份与证据编号。
这些资料属于“大鱼调色盘”的移植工程。当前“大鱼调色”的 944 字节状态、CPU 查表与 GPU 链路仍按本仓库实现保存;已核对的颜色工具设计使用 1032 字节状态,自动调色的参数、阈值和计算式也不同。现有资料支持将 Color Finale 迁移研究列为相关算法与工作流背景,尚未建立当前这些实现逐段移植自该工程的代码继承关系。
## 当前实现的来源记录
| 部分 | 已核实依据 |
| --- | --- |
| Color Finale 相关研究 | 上述同系列工程的研究、设计和迁移矩阵;其功能范围和验收状态以各原文为准 |
| Camera Raw 查表与组合 | Compositor,MIT;提交 `92f5225afe7e921dbfa4c563462980e45db345fc`;数据 SHA-256 `e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190` |
| 当前 GPU 调色核 | 从已发行着色器指令图还原的 LLVM AIR 文本;输入摘要、模块范围和改动见 [PROVENANCE.json](../tools/kernels/PROVENANCE.json) |
| 当前自动调色与 CPU 数学 | 本工程的数值实现与既有对照检查;详见 [ColorTableNotes.md](ColorTableNotes.md)、`DYAutoGrade.mm` 和 `verification/` |
| 17 种输入 LUT | 随工程版本化的压缩采样表;原始采样文件和压缩资源摘要见 `大鱼调色/Plugin/Resources/InputLUTs/manifest.json` |
| 界面、主题与浏览库 | 当前 AppKit 实现和大鱼命名空间;说明见 [ThemeLUT-analysis.md](ThemeLUT-analysis.md),正式宿主结果见 `verification/` |
## 记录保留
本次清理当前主分支中的旧参考程序介绍和原始分析大文件,保留算法输入摘要、必要的第三方归属、许可证和验证记录。完整整理前资料仍可从提交 `29dc4d385c1459cd330d8a9083ec9756787afef3` 恢复;已有提交和发行标签保持原样。原始分析记录中的地址、函数身份及采样对象不改名为其他产品。
本次修改为仓库说明、研究资料与验证工具入口整理,正式安装程序仍为已验收的 1.1.2(11)。
+9 -18
查看文件
@@ -1,26 +1,17 @@
# LumiGrade → 大鱼调色
# 大鱼调色:实现与范围
参考:/Library/Plug-Ins/FxPlug/LumiGrade.app,3.0 build56,主ID com.quliang.LumiGrade。
XPC universal SHA256 33c273d6a58314f5068959fcda911d741884a1937077b41a969a990dd40d0b6d;用于静态分析的arm64切片SHA c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97。
本工程提供原生 Wrapper / XPC / FxPlug 4 结构,使用 944 字节、102 字段的 CPU/GPU 状态,Metal 调色、全帧白场统计和 LUT 导出。
## 已确认与实现
支持 17 种相机输入转换、自选 3D Cube、白平衡、光影、局部增强、鲜艳度、饱和度、独立肤色保护;最多五层风格 LUT;主/R/G/B 单调 Hermite 曲线;8 色与自定义 HSL;四区色轮;三原色、RGB/单通道色阶、黑白混色和三向色彩平衡。自动调色、自动白平衡、复制时分析、系统吸管、预设和 33³ Cube 导出均接入原生参数。
- 原生Wrapper/XPC/FxPlug4,944字节102字段GPU状态,Metal滤镜、全帧白场统计、LUT导出。
- 输入17种相机曲线、可自选3D Cube;白平衡、曝光/对比度/高光/阴影/白/黑、纹理/清晰度/去雾、鲜艳/饱和、独立肤色保护。
- 最多五层顺序风格LUT;主/R/G/B可加删点的单调Hermite曲线;8色+自定义RGB选区HSL;阴影/中间调/高光/全局色轮及明亮度、混合、平衡;三原色、RGB/单通道色阶、黑白混色、三向色彩平衡。
- 自动调色与自动白平衡、复制时自动分析、系统白平衡/自定义色吸管、预设保存加载、33³Cube导出。
- 所有调色浮点均由FxPlug原生参数保存,控件按宿主action读写;实例通知以manager对象隔离。资产独立secure coding,渲染状态使用带版本不可变plist。
Color Finale 移植研究资料、相关工程和各算法来源分别见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。Camera Raw 数据采用 Compositor 的 MIT 许可数据与组合实现;GPU 指令图输入、模块范围和改动见 `tools/kernels/PROVENANCE.json`。正式构建使用仓库内源码和必要资源。
## 证据
浮点参数由 FxPlug 保存,控件按宿主 action 读写,实例通知按 manager 隔离。LUT 路径状态使用 secure coding,渲染状态采用带版本的不可变 plist。所有分组展开即启用、折叠即停用并隐藏参数;新实例与全部还原仅展开基础调节。旧实例按保存的启用状态显示。
LumiGrade-analysis.json包含REA/Ghidra返回的20条证据及分析限制;关键CPU行为与地址见ColorTableNotes.md,GPU来源见tools/kernels/PROVENANCE.json及README。CameraRaw数据与MIT的Compositor源码逐字节一致,原许可保留在正式资源中。17张输入LUT由指定参考应用的一次性提取生成,原始和压缩数据SHA见Resources/InputLUTs/manifest.json。构建不依赖原厂应用。
界面使用大鱼品牌。基础组汇集白平衡、光影、鲜艳度和饱和度;HSL、色阶和色彩平衡按通道切换。主题偏好和用户 LUT 使用独立大鱼目录与偏好域。浏览器支持菜单、文件选择、缩略图、导入、目录与名称过滤及尺寸记忆;实现说明见 [ThemeLUT-analysis.md](ThemeLUT-analysis.md)。
35项GPU检查与5,342,405个分量对照通过;CPU查表、83项自动分析边界、73项完整模型/IOSurface/Metal/LUT与预览方向集成分别验证。正式安装及宿主结果见verification。
GPU 数学、CPU 查表、自动分析和真实 Metal/IOSurface 集成分别验证;当前正式版本通过 82 项原生集成检查。FCP 分组展开、数值保留及保存重开见 `verification/HostGroupFolding.json`,主题/LUT 与历史导出结果见 `verification/HostThemeLUT.json`。
## 适配与边界
自动分析使用 320×180 样本,在输入转换后统计;GPU 半精度、缩略采样与图像重采样存在数值边界。局部增强和全帧统计需要完整源帧,超大图受 GPU 纹理与内存限制。Cube 保存逐像素颜色,空间纹理、清晰度和逐画面分析无法完整写入 3D LUT。
重建的是调色行为与可编辑控件,界面保留大鱼标识,并按原版收紧工具栏、主题色块、标题胶囊、参数行与分组;白平衡/光影/鲜艳度/饱和度合入基础组,HSL、色阶和色彩平衡按通道切换显示。肤色保护维持独立数学旁路,设置单独折叠。未接原厂许可、售后或联网服务。吸管使用系统取色器,未复用原厂Viewer OSC。五套主题按原版完整17色和控件用途恢复,偏好使用独立大鱼域并跨实例同步。风格 LUT 可用菜单、文件选择或缩略图浏览器;浏览器按原版760×560、16:9缩略图、70–255尺寸范围及目录/尺寸记忆实现,另支持安全导入、搜索和懒加载。原版用户LUT内容未复制,产品库在 ~/Movies/大鱼调色LUT/look LUTs。主题和浏览库的静态证据见 ThemeLUT-analysis.md。
自动分析同为320×180 RGB8,转换前后量化并先应用输入LUT;Metal双线性缩图与原CoreGraphics缩图可能在边缘产生微小差异。原GPU使用half纹理和输出;32位宿主也遵循这一原精度边界。局部增强/全帧统计需要完整源帧,超大图受GPU纹理/内存限制。Cube仅保存逐像素颜色,无法承载邻域纹理、清晰度或逐画面分析。
有限状态对照不等于对所有参数/GPU/素材的穷尽证明。自定义LUT绝对路径随预设保存,跨机器需搬移用户LUT并重新选择;用户媒体与预设不在源码备份范围内。
有限状态对照不构成所有参数、GPU、素材或宿主的穷尽验证。自定义 LUT 绝对路径随预设保存,跨机器需搬移文件并重新选择;用户媒体和个人预设需独立备份。
+18 -81
查看文件
@@ -1,97 +1,34 @@
# 颜色查表与接入核验
本记录区分发布二进制静态证据、公开源码和本项目的实现验证。没有将静态调用关系当作实际宿主运行结果。
## 参考身份
- LumiGrade 3.0,构建 56。
- 参考服务:`/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/MacOS/LumiGrade XPC Service`。
- 原始 universal Mach-O SHA-256:`33c273d6a58314f5068959fcda911d741884a1937077b41a969a990dd40d0b6d`。
- 只读抽取 arm64 SHA-256:`c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97`。
- 本记录的地址属于该 arm64 slice,image base 为 `0x100000000`。使用现有 `otool -arch arm64 -tvV` 输出核对具体 ARM 指令,不需要重新打开 REA 会话。
- REA/Ghidra 提供的相关函数伪代码属于还原结果,不是原始 Swift 源码。关键结论同时以 ARM 调用或资源字节校验确认。
本记录说明当前 CPU/GPU 数学契约和已有核验范围。Color Finale 相关迁移研究、第三方来源及历史记录入口见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。
## MIT 查表数据
参考包的 `THIRD-PARTY-NOTICES.txt` 声明,Camera Raw 查表数据与组合行为来自 [Compositor](https://github.com/robbietilton/Compositor),MIT,Copyright 2026 Wonder Assembly LLC。
Camera Raw 查表数据和组合行为来自 [Compositor](https://github.com/robbietilton/Compositor),MIT,Copyright 2026 Wonder Assembly LLC。已核对提交 `92f5225afe7e921dbfa4c563462980e45db345fc` 的 `Compositor/Resources/CameraRawTables.bin`;项目资源 `DayuColorTables.bin` 的 SHA-256 为 `e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190`。完整许可位于正式资源 `THIRD-PARTY-NOTICES.txt`。
核对公开源提交 `92f5225afe7e921dbfa4c563462980e45db345fc` 的 `Compositor/Resources/CameraRawTables.bin`,与参考包文件逐字节相同。项目中的 `DayuColorTables.bin` 保存这份必要数学数据,保留 MIT 许可;没有复制参考应用的图标、品牌、授权代码或原始应用程序。
- `CRT3` 头;维度17、763张表、差值量化步长3。10字节头后为LZMA/xz,解压长度11,245,857字节。
- 每张表按通道累计有符号Int8差值,还原为 `round(axis * 255 / 16) + signedDelta * 3`,钳制0–255。
- 源表红轴最慢、蓝轴最快,RGB8;采用17³三线性插值。组合输出33³ RGBA32Float,Metal纹理红轴最快,alpha固定1。
- 白平衡:温度和色调各−100…100、间隔25,四张相邻表双线性混合。
- 八色HSL:依次组合明度、饱和度、色相;表起点 `285 + (kind * 8 + color) * 5`;各项−100…100、间隔50。
- 分级:先阴影、中间调、高光、全局明度,再组合全局、中间调、高光、阴影色轮;保留公开实现的插值及平衡系数。
数据 SHA-256:`e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190`。
## 字段与旁路
格式经公开 `Compositor/Document/CameraRawTables.swift` 和参考 `loadSourceTables` / `sample` 核对:
CPU/Metal共用944字节 `DYUniforms`,字段偏移由静态断言检查。白平衡、HSL和颜色分级由CPU生成有效或中性3D纹理,停用时不能复用非中性的缓存。基础分组同时控制光影与颜色子组;纹理、清晰度和去雾遵循基础组旁路,肤色保护独立启停。
- `CRT3` 头;维度 17,763 张表,差值量化步长 3。
- 10 字节头之后为 LZMA/xz;解压长度 11,245,857 字节。
- 每张表逐通道保存 running delta,累计值按有符号 Int8 解释;还原到 `round(axis * 255 / 16) + signedDelta * 3` 并钳制 0–255。原 ARM `0x10009bf28` 的 `frinta` 确认这里要四舍五入,不能直接截断。
- 源表顺序为红轴最慢、蓝轴最快;每格 RGB8。读取采用 17³ 三线性插值。
- 组合结果为 33³ RGBA32Float,Metal 纹理红轴最快,alpha 固定 1。
- 白平衡:温度、色调各 -100…100、间隔 25,四张相邻表双线性混合。
- 8 色 HSL:明亮度、饱和度、色相依次组合;表起点 `285 + (kind * 8 + color) * 5`,每项 -100…100、间隔 50。逐项运算保留 `low + (high - low) * fraction`。
- 分级:先阴影、中间调、高光、全局的明度,再全局、中间调、高光、阴影色轮;色轮在相邻色相、饱和度、混合档位间混合。分级 balance 对阴影、高光饱和度份额的系数按公开源及二进制一致恢复。
肤色保护开关阈值0.5,保护程度为0–100,内部乘0.01并钳制;中心色相除以360后参与HSL圆周距离。默认保护程度60、中心色相28。黑白六色默认系数依次为 `40,60,40,60,20,80`,着色色相与饱和度默认0。
## 已确认的字段与旁路依赖
三原色矩阵为列向量,GPU使用 `r*M0 + g*M1 + b*M2`。色相沿灰轴旋转,幅度 `hue / 100 * 0.5235987305641174`;饱和度系数 `sat / 100 * 0.55`,矩阵保持D65白点并限制极端偏移。
944 字节 CPU/GPU ABI 的每字段偏移有 `DYUniforms.h` 的静态断言。
## 自动调色与导出
### 白平衡
当前自动调色在320×180、RGB8数值域中计算分位数、饱和度和中性样本权重;先做输入转换和强度混合,再进行统计。阈值与计算式见 `DYAutoGrade.mm`。该实现与同系列 Color Finale 迁移工程的 `Core/DYAuto.hpp` 使用不同参数和公式,来源分别保存。
原 fragment 无条件读取已生成的白平衡 3D 纹理,因此组旁路必须在 CPU 构造纹理时落实。
LUT导出输出 `cubeSize³ * 3` 个float,红轴最快。输入为输入LUT、五层风格LUT、HSL、白平衡及分级纹理;参数、RGB输出和cubeSize分别绑定buffer0/1/2。空间纹理、清晰度及逐画面统计无法完整表达为3D LUT。
原渲染器 `0x100077054…0x10007708c`:
## 验证范围
1. 从 uniforms `+104/+108` 读取 temperatureEnabled/tintEnabled,分别决定是否使用对应数值。
2. 从 uniforms `+140` 读取 colorSectionEnabled,作为 `whiteBalanceTexture(... enabled:)` 的 enabled 参数。
3. `0x10007708c` 调用白平衡纹理生成方法;未启用时采用中性 LUT。
`tools/verify_color_tables.mm` 覆盖数据摘要、损坏拒绝、独立double三线性对照、白平衡、纹理轴序、24项HSL端点、四色轮、色相环绕、明度端点、三原色控制和D65保持。真实Metal纹理接口与非中性缓存后的组旁路由原生集成检查覆盖。
`DYColorTables` 已按此处理。为使自定义检查器的组旁路与实际字段含义一致,本项目把白平衡与鲜艳度、饱和度放在“白平衡与颜色”组;这是明确的界面分组适配。
HSL 与颜色分级分别以 `hslSectionEnabled`、`colorGradingSectionEnabled` 生成有效或中性纹理,旁路不能复用此前非中性的缓存结果。
纹理、清晰度、去朦胧由原 fragment 的 `baseSectionEnabled` 分支控制,属于基础组。肤色保护 shader 只检查 `skinProtection.x`,应保持独立开关,不能暗示它自动跟随颜色组。
### 肤色保护
原 `applySkinProtection`:
- `.x`:开关,阈值 0.5。
- `.y`:保护程度,乘 0.01 后钳制到 0–1。
- `.z`:中心色相,除以 360 后与像素 HSL 色相做圆周距离计算。
原 `addParameters` 对参数 `0x468` 设置默认 60、范围 0–100;对 `0x469` 设置默认 28、范围 0–60。两项不是色相范围和饱和度范围。对应静态伪代码在 `addParameters.c:504…510`,数值十六进制为 `0x404e000000000000`、`0x403c000000000000`。
### 黑白混色
原 `addParameters` 从 `DAT_1000dc7e8` 读取黑白参数默认值。该 slice 对应文件偏移的 8 个 double 是:
`40, 60, 40, 60, 20, 80, 0, 0`
依次对应红、黄、绿、青、蓝、洋红,以及着色色相、着色饱和度。原 `applyBlackWhite` 直接读取这些六色系数参与灰度计算;六项设成 100 会改变启用黑白后的明度。
### 分级与三原色
- `colorGradingHueSatA.xy` 为中间调 H/S,`.zw` 为阴影 H/S;`HueSatB.xy` 为高光 H/S。
- `colorGradingLuma` 为中间调、阴影、高光明度;`colorGradingGlobal` 为全局 H/S/L。原包装方法 `0x100083320…0x1000833e8` 的向量重排确认此顺序。
- 三原色矩阵是列向量。GPU 将 `r*M0 + g*M1 + b*M2` 相加,无需转置。
- 色相沿灰轴旋转,幅度为 `hue / 100 * 0.5235987305641174`;饱和度沿对应原色相对中性灰的轴变化,系数 `sat / 100 * 0.55`。矩阵保持 D65 白点,并沿用原版过大矩阵偏移的限制。
## 自动调色预览确实应用输入 LUT
这是已确认的静态调用与数学流程,不再只是从函数名称作推测:
1. `capturePreviewFrameIfNeeded` 位于 `0x1000833ec`。它缓存原始预览图,并保存输入 LUT、路径、强度;LUT 路径或强度改变时更新版本、清除已转换缓存。此方法本身没有直接转换图像。
2. `currentPreviewFrame` 位于 `0x10007f4f4`。缓存不命中且有输入 LUT 时,`0x10007f5ec` 明确调用 `imageByApplyingInputLUT(to:lut:strength:)`;`s0` 在前一条指令从保存的强度装入。
3. 自动调色闭包 `0x100075e00` 在 `0x100075e44` 调用 `currentPreviewFrame`,在 `0x100075e54` 把该结果传给 `autoGradeResult`。
4. `imageByApplyingInputLUT` 位于 `0x100090a34`。`0x100090a68/6c` 指定 320×180 的 RGB8 缓冲;`0x100090aec…0x100090b0c` 将 RGB8 除以 255;`0x100090b40` 调用 `CubeLUT.sample`;`0x100090b48…0x100090b50` 计算 `original + (sample - original) * strength`;`0x100090b78` 起钳制、四舍五入回 RGB8。
因此,本项目的自动调色输入应在标准线性→sRGB 编码之后应用输入 LUT 与强度,再进入统计。使用未转换的 Log 原图统计会偏离参考行为。GPU 缩略采样与原版 NSImage/CoreGraphics 320×180 重采样仍可能有量化或重采样差异,不声明逐字节相同。
## LUT 导出与验证边界
原 `lutExportKernel` 输出 `cubeSize³ * 3` 个 float,红轴最快;texture0–8 为输入 LUT、五层风格 LUT、HSL、白平衡、分级,buffer0 uniforms、buffer1 RGB 输出、buffer2 cubeSize。当前接入按此布局,不能按 float4 分配后误读。
导出核接收、输出的是 LUT 的编码域 RGB,空间纹理和清晰度操作不写入 3D LUT。画面相关统计与导出核固定处理也不等同于任意素材的逐帧渲染。
`tools/verify_color_tables.mm` 已通过严格 `-Wall -Wextra -Werror` 编译。验证覆盖数据 SHA、损坏拒绝、独立 double 三线性对照、四表白平衡、纹理轴顺序、24 项 HSL 端点、4 色轮、色相环绕、4 明度端点、6 个三原色控制及 D65 保持。带资源的 CLI 测试 bundle 另验证真实 Metal 纹理接口与非中性缓存后的 WB/HSL/分级旁路;没有运行未公证 GUI 应用。
宿主的半透明表示、图像原点、色彩空间和最终视觉结果仍须用正式安装的已公证版本验收;数学和静态结构验证不能替代宿主验证。
GPU数学、CPU表、自动分析、宿主交互和实际导出各自保留报告。有限数值检查与静态结构检查不能替代所有宿主、素材、图像原点、alpha和色彩空间的实际验收。
-1
查看文件
@@ -1 +0,0 @@
{"binding":{"analysis_profile":{"digest":"3fc72c9b4b78498fb992b938f8f3389dc670244a293c1d40abf5e1d10162ed3b","parameters":{"analyzer_preset":"ghidra-default","annotation_policy":"atomic-function-entry-metadata-v1","architecture":"arm64","available_architectures":["arm64"],"call_relationship_coverage":"function-body-call-coverage-v5","compiler_spec_id":"auto-default","decompiler_jump_loads":true,"function_body_evidence":"complete-inclusive-ranges-v1","function_boundary_observations":"ghidra-function-boundary-limitations-v4","function_dossier_coverage":"observed-facets-and-call-relationships-v1","function_references":"complete-body-and-entry-reference-manager-v2","import_mode":"ephemeral-source-immutable","instruction_flow_evidence":"decoded-return-pcode-v1","instruction_references":"exact-address-incoming-without-synthetic-entry-v2","jump_table_evidence":"typed-case-default-blocks-v1","language_id":"auto-from-header","load_image_observations":"source-mappings-entry-context-v2","loader":"auto-from-header","location_resolution":"explicit-address-exact-entry-symbol-first-v3","no_return_repair":"returning-imports-decoded-return-v2","procedure_file_offset_resolution":"address-first-unique-target-source-mapping-v2","process_launch":"inspected-jvm-launch-support-v1","string_inventory_evidence":"defined-data-coverage-v1","target_format":"mach-o","target_kind":"executable"},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"entries":[],"evidence_bundle":{"artifacts":[{"architecture":"arm64","digest":{"sha256":"c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97"},"format":"mach-o"}],"captures":[],"environments":[],"providers":[{"id":"ghidra","name":"Ghidra","version":"12.1.4"}],"records":[{"analysis_profile":{"digest":"3fc72c9b4b78498fb992b938f8f3389dc670244a293c1d40abf5e1d10162ed3b","parameters":{"analyzer_preset":"ghidra-default","annotation_policy":"atomic-function-entry-metadata-v1","architecture":"arm64","available_architectures":["arm64"],"call_relationship_coverage":"function-body-call-coverage-v5","compiler_spec_id":"auto-default","decompiler_jump_loads":true,"function_body_evidence":"complete-inclusive-ranges-v1","function_boundary_observations":"ghidra-function-boundary-limitations-v4","function_dossier_coverage":"observed-facets-and-call-relationships-v1","function_references":"complete-body-and-entry-reference-manager-v2","import_mode":"ephemeral-source-immutable","instruction_flow_evidence":"decoded-return-pcode-v1","instruction_references":"exact-address-incoming-without-synthetic-entry-v2","jump_table_evidence":"typed-case-default-blocks-v1","language_id":"auto-from-header","load_image_observations":"source-mappings-entry-context-v2","loader":"auto-from-header","location_resolution":"explicit-address-exact-entry-symbol-first-v3","no_return_repair":"returning-imports-decoded-return-v2","procedure_file_offset_resolution":"address-first-unique-target-source-mapping-v2","process_launch":"inspected-jvm-launch-support-v1","string_inventory_evidence":"defined-data-coverage-v1","target_format":"mach-o","target_kind":"executable"},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"authority":"shipped-artifact","confidence":"observed","environment":null,"evidence_id":"ev_03d96959bfe24004d31380076ff89441e1486ddbdd69a2c3d636b86b8ac02976","evidence_links":[],"limitations":["The session serves operations only after Ghidra reports default auto-analysis complete; incomplete analysis does not expose partial results.","The imported Program and temporary project are ephemeral and deleted on close. Annotation operations edit session database metadata; original executable bytes are never written.","Cancelling an active Ghidra request terminates its ephemeral database and discards session annotations. The selected target remains open; the next provider query imports the original artifact again.","Default-space addresses use lowercase 0x-prefixed hexadecimal; other address spaces use <percent-encoded-space>:0x<hex>.","Pseudocode is Ghidra decompiler output, not original source and not text-equivalent to Hopper output.","External functions and functions without an analyzable body return null; other decompiler failures remain explicit.","macOS sessions require a matching executable Ghidra native decompiler; REA checks for it but does not build native components or change Gatekeeper quarantine state."],"locations":[],"normalized_result":"\n/* adjustPrimaryHue #1 (_: Swift.SIMD3<Swift.Float>, hueShift: Swift.Float) ->\n Swift.SIMD3<Swift.Float> in static\n LumiGrade_XPC_Service.LumiGradePlugIn.computePrimariesMatrix(redHue: Swift.Float, redSat:\n Swift.Float, greenHue: Swift.Float, greenSat: Swift.Float, blueHue: Swift.Float, blueSat:\n Swift.Float) -> __C.simd_float3x3 */\n\nSIMD3<float> _adjustPrimaryHue_1(SIMD3<float> param_1,float hueShift)\n\n{\n undefined8 uVar1;\n undefined1 auVar2 [16];\n undefined1 auVar3 [16Line truncated
文件差异过大,未显示。 加载差异
+13 -38
查看文件
@@ -1,50 +1,25 @@
# LumiGrade 主题和 LUT 浏览库补充分析
# 主题与 LUT 浏览库实现说明
目标仍为已安装 LumiGrade 3.0(56),arm64 分析切片 SHA256 `c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97`。本记录基于 Ghidra 12.1.4 的静态反编译、原文件资源清单和 Swift 符号;静态布局常量不表示已经观测到窗口在宿主实际弹出。完整的 35 条新增 Evidence 位于 `ThemeLUT-analysis.json`。`ThemePalette.json` 是从原双精度常量逐值解码的颜色数据,不是截图估色。
五套主题、浏览器和预览由本工程的 `DYTheme`、`DYLUTLibrary`、`DYLUTBrowser`、`DYInspector` 与 `DYRenderer` 实现。相关 Color Finale 移植研究与来源边界见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。本文件说明当前产品行为,历史静态观察完整保留在整理前提交中。
## 主题
- `ThemePreference.selectedIndex`(`0x100059374`,`ev_a8688461143765f6d38667a24dc736bcfcce133f76c6c1003b3e2d86ee6bfc67`)读取 `NSUserDefaults.standard`,合法整数为 0–4;缺失、错误类型、越界均回到 1。`refreshFromDisk` 为真时先 `synchronize`。
- `ThemePreference.select`(`0x1000594c4`,`ev_5dcc78a25578273dc8d179c57dc0afd79cf31d176d3cd88f806ab3a060f387df`)仅写合法索引,写后 `synchronize`,并向普通和分布式通知中心发布同一通知。因此原版主题是跨实例、跨进程的全局偏好,不是逐滤镜的可动画调色参数。
- 原偏好键 `LumiGrade.globalThemeIndex`(`ev_2dea9886c635b29b0e21643ccb31c1264ffd35280494e35f03405af8202bb692`),通知 `LumiGradeGlobalThemeDidChange`(`ev_fd94a34bf03cae7ae8a372d5c9b5b60a322d1e238115dac8e7996f8baa3b6ae5`)。复刻应使用产品自己的命名空间,不改原厂偏好。
- 依 `family(for:)`(`0x100059cec`)的比较常量和界面观测,五个色块顺序为灰、蓝、紫、绿、橙;这五个中文名称是说明性名称,不主张它们是原版 tooltip 文案。色块 RGB 分别为 `(0.30,0.33,0.38)`、`(0.28,0.72,1)`、`(0.58,0.52,1)`、`(0.30,0.86,0.52)`、`(1,0.61,0.28)`,默认蓝。
- `chromeAccent`(`0x10005b1bc`,`ev_e814744aa17fdd27bbd3b46f60561201c4bdebf068a430b2007006b5c51ee7f2`)另将灰转为 `(0.72,0.77,0.84)`、蓝转为 `(0.22,0.67,1)`,其余三个保持对应主题色。不能直接把灰色块的暗灰当文字和工具图标 tint。
- `palette`(`0x10005a028`,`ev_0a2bea4354863fd7685a919ca6dae83ba5cf582f12cd0592edb24f0816eee35a`)生成每主题 17 色,使用 `colorWithCalibratedRed:green:blue:alpha:`。数组按原 Palette 存储顺序保留。消费者确认的槽含义如下。
主题顺序为灰、蓝、紫、绿、橙,默认蓝。每套包含 17 个颜色槽,数值快照见 `ThemePalette.json`。色块 RGB 分别为 `(0.30,0.33,0.38)`、`(0.28,0.72,1)`、`(0.58,0.52,1)`、`(0.30,0.86,0.52)`、`(1,0.61,0.28)`。
| 槽 | 实际用途 | 消费函数 |
| --- | --- | --- |
| 1 | 整体面板底色 | InspectorView.applyAccent,`0x10001c9a4` |
| 3 | section 内容底色 | SectionView.applyAccent,`0x100022d98` |
| 6、7 | section 标题胶囊渐变 | SectionTitleButton.applyAccent,`0x100049e6c` |
| 8、9 | 普通滑条轨道渐变 | SliderCell.drawTrackBackground,`0x100041fa8` |
| 10、11 | 普通滑条活动段渐变 | SliderCell.drawBar,`0x10006c9c0` |
| 14 | Logo 和 section 标题文字 | InspectorView / SectionTitleButton.applyAccent |
| 15 | 参数行、输入和 LUT 标签 | InspectorView.applyAccent |
| 16 | 版本文字 | InspectorView.applyAccent |
整体底色使用槽1,分组底色使用槽3,标题胶囊渐变使用槽6/7,滑条轨道使用槽8/9,活动段使用槽10/11;标题、参数标签和版本分别使用槽14/15/16。灰色工具强调色为 `(0.72,0.77,0.84)`,蓝色为 `(0.22,0.67,1)`。主题保存到独立大鱼偏好域并通知其他实例;主题不属于可动画调色参数。
Section 描边使用 chrome accent 的 alpha 0.38;可见性、展开和其他工具按钮常用 alpha 0.92。普通滑条高度 5、圆角 2.5、黑色描边 alpha 0.28 / 线宽 0.6。其余槽在本次有完整颜色值,但不额外猜测语义。
## 用户库与浏览器
## LUT 库发现与入口
用户 LUT 库位于 `~/Movies/大鱼调色LUT/look LUTs`。支持递归发现 `.cube`、目录过滤、名称搜索、收藏、导入和 Finder 打开目录。顶层文件可归入未分类;隐藏项跳过,路径去重。导入保留源文件,重名时产生带数字后缀的副本。
- `userLookLUTFolderURL`(`0x100070058`,`ev_9a37e0a0dcdc73db9e2c58ceb5d34dfbbe0629d4b59cc2c082f68ac7d69c5c56`)使用用户 Movies 目录,回退 `~/Movies`,再拼接 `梁哥调色LUT/look LUTs`。复刻使用自己的目录,不修改原厂库。
- `lookLUTFolders`(`0x1000822b4`,`ev_abc8f7799dfd67b519733d2de59c75c013b02dd07b59f009a770fa6ab41c76b0`)另加入插件 bundleForClass 和 mainBundle 的 `Resources/LUTs/Look`,再加入用户目录。
- `discoverLookLUTOptions`(`0x100070bc8`)读取目录内容,跳过隐藏内容(options=4),文件扩展名小写比较 `cube`。顶层目录分别递归枚举;顶层文件进入「未分类」,以路径去重,再排序。此次安装包里的 17 个 `.cube` 全部为输入相机配置;清单中没有 `LUTs/Look` 内置风格文件。未在此调查中读取用户 LUT 文件内容。
- `lookLUTMenuGroups`(`0x100090360`,`ev_db2b7ee3dceb2a58706ee4515113437a34f4199bcc0508ab053933fa590529ad`)排除第 0 个「无」选项,以已有 group title 分组,无 group 时归「未分类」,保留 selection index 给点击回写。
- `openLookLUTFolder`(`0x100066c10`,`ev_82b900e1fdd53b69048bcf894b4fba6bff9f958acdbc26c4e7b7bc58320eab67`)创建用户目录并调用 `NSWorkspace.openURL`;右侧文件夹图标用于在 Finder 打开文件夹,未显示选择根目录的 open panel。
浏览器采用 760×560 点布局,缩略图比例为16:9,大小默认96、范围70–255;目录和尺寸偏好独立保存。优先使用宿主窗口接口,必要时使用锚定弹出面板。单击应用所选 LUT,目录切换和预览生成不应意外写入调色参数。
## 浏览器布局、选择和缩略图
## 真实帧与方向
- `showLookLUTPreviewBrowser`(`0x10001ee8c`,`ev_7e6daea432f64c3380b5399e539dcf6abaafc0fe4ad7efe3d507121a1d722813`)以 **760×560** 展示 `LookLUTBrowserView`;可按宿主选择原生 host presentation 或 anchored `NSPopover`。Popover behavior=1,锚在入口按钮。
- `build`(`0x10004f9fc`,`ev_70bccecb4b8d036ad6303ee9fa6b2c34dd9768db7a0a5f9428db4a4d81c4329d`)浏览器底色固定 Calibrated RGB `(0.035,0.08,0.12)`;整体内边距 12、纵间距 10;左目录宽 150,顶部左标题宽 145,右网格容器宽 560,最小高 240;左右列间距 12。顶部同时显示库标题、当前目录及文件数和缩略图大小滑杆。标题 14 semibold;文件数 10 medium。
- initializer(`0x100066534`,`ev_98b1bcc280692122ab576ba2cf0062846372dfee4db01a703307f2c4ac5d8e3d`)创建 size slider:默认 **96**、最小 **70**、最大 **255**,宽 150。读取 `LumiGrade.lookLUTPreview.thumbnailSize`(无有效正数时为 96)及 `LumiGrade.lookLUTPreview.selectedFolder`。该偏好同样应在复刻中使用独立键。
- `thumbnailClicked`(`0x100052784`,`ev_cc54cc6744ddd7a436ee769e86209c3306f4576995f7033b108ea225d803bd6f`)单击即设置所选 index、更新 tile 选择边框并调用 onSelect;该函数没有关闭浏览器。未发现必须双击才应用的路径。
- Tile initializer(`0x100066338`)设置宽度为缩略图大小,高度为 `size×9/16+24`。图像为 16:9,下方额外 24 像素放名称。
- `sizeChanged`(`0x100052814`,`ev_083dcc84539e4a5e2e388f33f77929bc857b3ef6651054aab08593f6fcd1c52a`)保存偏好,取消旧 work item,**0.22 秒 debounce** 后重建。
- `reloadThumbnails`(`0x100051238`)按当前尺寸重新分行,每行 spacing 10;后台 previewQueue 逐项生成,generationID 与弱引用用于抛弃旧代、已关闭视图或过期 tile 的结果。UI 更新回主线程。
- `currentLookLUTPreviewItem`(`0x10007f148`)缓存键为 `frameVersion|Int(size)|LUT path`,超过 600 项清空缓存;用 currentPreviewFrame 或 fallbackPreviewFrame,对每个候选施加对应 LUT。
- `currentPreviewFrame`(`0x10007f4f4`,`ev_7f13d031b53f51bd16e7cea9755f085d590d702c7dc993a31040568a17b4d9b9`)在缩略图 LUT 前先处理当前输入 LUT 及其强度,并按源帧版本缓存结果。`capturePreviewFrameIfNeeded`(`0x1000833ec`)捕获节流 **0.35 秒**;输入路径/强度变化立即递增版本并失效 processedPreviewFrame。
- `thumbnailImage`(`0x100091a04`,`ev_47a86ed56280777069e755d726b84701244573dceed4b182f9ec8de02d12fc40`)宽 `max(64,Int(size))`,高 `max(40,Int(width×9/16))`;先转 RGBA8,以每通道 `/255` 经 CubeLUT.sample,然后 clamp/量化回显示字节。此浏览器缩略图并非整套基础调色和五层 LUT 合成后的画面。
缩略图取当前素材经过输入转换后的源帧,再应用候选 LUT;解析和采样使用产品的 LUT 实现。没有源帧时显示合成色卡。分析帧保留物理行序,浏览显示根据 FxPlug 图像原点转换,避免上下翻转。
## 证据边界
图库任务采用缓存、懒加载和失效处理。用户 LUT、收藏与偏好是本机用户资料,换机时需独立搬移;源码中仅包含合成验收 LUT 的生成脚本。
地址对应本次 arm64 切片,不能当作其他版本地址。Ghidra 对 Swift 参数和 SIMD 值有类型恢复误差,本文仅将直接常量、可见 API、字段读写及可验证的堆栈偏移用作实现规格。颜色槽用途按原存储偏移与具体消费者对应;布局常量仍需正式宿主进行视觉核对。浏览器没有从此静态清单中推断出网络商店、账号收藏、搜索框或动态商业 LUT 下载功能。已关闭本次 REA 原生会话;可复用的完整 session snapshot 保存在本机产品缓存 `research/ThemeLUT-snapshot.json`。
## 验收
五主题、导入、目录与名称过滤、尺寸记忆、缩略图方向、单击应用、保存重开和 ProRes 导出见 `verification/HostThemeLUT.json`。当前分组展开与启用规则见 `verification/HostGroupFolding.json`。历史报告对应其记录的版本,不能将其范围自动扩展为所有素材、宿主与系统均已验证。
+2 -3
查看文件
@@ -554,8 +554,6 @@
]
]
},
"preferenceKey": "LumiGrade.globalThemeIndex",
"notificationName": "LumiGradeGlobalThemeDidChange",
"chromeAccentRGB": [
[
0.72,
@@ -595,5 +593,6 @@
"logoAndSectionTitleText": 14,
"rowLabelText": 15,
"versionText": 16
}
},
"historicalEvidenceCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3"
}
+12
查看文件
@@ -0,0 +1,12 @@
# Color Finale 移植资料快照
四份资料来自同系列“大鱼调色盘”工程,原文逐字节保留。提交与SHA-256见 [SOURCES.json](SOURCES.json),本仓库的适用范围见 [算法来源说明](../ALGORITHM_SOURCES.md)。
| 资料 | 本地快照 | 原工程固定版本 |
| --- | --- | --- |
| 研究记录 | [colorfinale.md](colorfinale.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale.md) |
| 颜色工具设计 | [colorfinale-color-tools-design.md](colorfinale-color-tools-design.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-color-tools-design.md) |
| 迁移矩阵 | [colorfinale-2.0-matrix.md](colorfinale-2.0-matrix.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-2.0-matrix.md) |
| 证据索引 | [colorfinale-index.json](evidence-index/colorfinale-index.json) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/evidence-index/colorfinale-index.json) |
快照中的其他相对链接仍指向原工程的文件;使用上表固定版本可继续浏览其完整上下文。设计目标、独立实现与发行验收以各原文的范围说明为准。
+34
查看文件
@@ -0,0 +1,34 @@
{
"project": "大鱼调色盘",
"remote": "https://dayu.media/git/dayu/dayu-colorplate.git",
"commit": "4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca",
"verifiedRecordsMatchCommittedFiles": true,
"records": [
{
"sourcePath": "research/colorfinale.md",
"path": "research/color-finale/colorfinale.md",
"sha256": "f669841b2f0402543ad87522cf23fd17e3eced5ef481f5b0e1b0a489d6e2d70d",
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale.md"
},
{
"sourcePath": "research/colorfinale-color-tools-design.md",
"path": "research/color-finale/colorfinale-color-tools-design.md",
"sha256": "0b5f75d50cf4427dd74c68e5612d15b8cf7748b63a99bf7101c2945663460d07",
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-color-tools-design.md"
},
{
"sourcePath": "research/colorfinale-2.0-matrix.md",
"path": "research/color-finale/colorfinale-2.0-matrix.md",
"sha256": "721d50ac0391b515747820632612d56aa34084251e3a347bf16911bdb3f3e7b0",
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-2.0-matrix.md"
},
{
"sourcePath": "research/evidence-index/colorfinale-index.json",
"path": "research/color-finale/evidence-index/colorfinale-index.json",
"sha256": "fecb1a8e2fa23d664acbc878cc91c9cf7c0dc646212197b0dd68e34a5d2b244a",
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/evidence-index/colorfinale-index.json"
}
],
"scope": "Related-product Color Finale migration research. These documents distinguish observations, independent implementations, planned work and unverified scope; copying the research does not establish a direct code port in this repository.",
"relativeLinkPolicy": "Archived documents retain their original bytes. Relative links inside them resolve against their sourceURL in the original repository."
}
@@ -0,0 +1,169 @@
# 大鱼调色盘 2.0:Color Finale 迁移对照
研究日期:2026-10-26(Asia/Shanghai)。这是功能目标和证据矩阵,**不是已实现清单或发行验收记录**。当前正式安装为大鱼调色盘 2.0.0(56),已完成图层/空间工具、外部输入、CMS、首轮五组胶片处理和Classic24色卡匹配;矩形真实拖动及窗口一次前置已有用户确认。具体范围见verification/release-2.0.0-build56.json。完整迁移尚未完成。
色卡56进度(2026-10-29):Classic24(2014年11月后)6×4参考、射影四角、三模式、CMS前置线性校正、schema19冻结状态和原生控件已接入并正式验收;实际FCP匹配RMS 0.03309→0.00398,一次Undo/Redo与冷重开2557字节一致。Video/Passport Video仍开放,不能视作本矩阵原厂色卡条目已全部完成。自动指针拖动没有确认参数变化,真实四角手势仍未确认;合同和证据见research/chart-matching-contract.md、verification/release-2.0.0-build56.json。
CMS开发进度:根schema16/CMS作者v2、实际源/目的ICC、CPU/Metal整帧、浮点主预览/图库/取色/导出约束已接通;根CMS控件1257项和实际HDR媒体导入37950项通过。正式34完成独立PQ/HLG取帧与FCP CMS撤销/重做;35修复说明换行并通过FCP冷重开,完整调色文件141187字节一致。见 `verification/cms-controls-media-development.json` 与正式35报告。HDR显示器EDR亮度及4K实时未认证。
运动/散景已在正式36验收:方向、光环宽度/强度/柔和度、RGB/HSL、各自参数保留、撤销/重做和冷重开逐字节一致。算法为独立实现,见research/motion-bokeh-contract.md;最大半径4K HSL散景约2.06秒,不承诺实时。
胶片55进度(2026-10-29):减色/晕光/辉光/暗角/颗粒的独立算法、根级控件、schema18归档、CPU/Metal、精确有理帧保持、Undo及FCP冷重开已验证;完整处理文件重开前后7108字节一致。没有原厂同名八种印片外观,色卡和其他工作流仍开放,详见 [胶片合同](film-processing-contract.md)。
## 对照版本与证据边界
本机 `/Applications/ColorFinale.app` 为 **2.16.2(625)**,主插件可执行文件 SHA-256:
`49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f`
本次重新计算的摘要与 [已有静态研究](colorfinale.md) 及 [证据索引](evidence-index/colorfinale-index.json) 一致。REA 当前没有打开的目标,无需重复全量分析。已有证据解释的是该发行包的结构,不等于实际 FCP 运行验收。
本次读取了 Color Finale 官方文档和官方界面截图。文档可能包含比本机版更新的功能;涉及 Tone/Chroma、Texture EQ 频段和 FCP 12 的行为需另做版本核验。未改动用户的 FCP 工程,未将专有资源、图标、LUT 或反编译源码复制到项目。
## 本轮优先迁移
| 能力 | 已证实的原产品语义 | 大鱼实现与验收目标 |
| --- | --- | --- |
| 真正的工具图层 | 顶部工具入口创建工具层;同类工具可多次添加;下旧上新,底至顶处理;可排序、启停、重命名、复制、删除 | 有序、稳定身份、独立参数;选择层不改变输出;禁用层是恒等;复制生成新身份;保存和撤销不串层 |
| 图层工具区 | 左侧层列表,主区域显示选中工具,底部为混合量、混合模式、蒙版和删除 | 所有精细工具集中在独立图层编辑器;明确“添加图层”和“编辑当前层”,避免切页意外创建层 |
| 图层蒙版 | 蒙版属于层;同层可有多个形状,以 Add/Subtract/Intersect 组合 | 层全部处理受蒙版约束,包括曲线、LUT、六色向量和蜘蛛盘;无蒙版时全画面生效 |
| 区域跟踪 | 每个节点保存轨迹;按宿主 effectTime 持久化归一化变换;前后跟踪与关键帧操作 | 冻结实例、层 ID、蒙版 ID、形状修订及参考帧;删除或改形后拒绝旧回调;倒序和随机时间输出一致 |
| 六色向量 | RGBCMY 独立 H/S/L;新版另有肤色向量及可调 Skin Target | 六区独立,灰阶不染色,色相首尾连续;肤色扩展单列;不能把全图 HSL 当作六色选择调整 |
| 检查器快捷 HSL | 此位置是大鱼的产品要求,不是对原版行为的断言 | 保留原基础调色和蜘蛛盘;快捷 HSL 直接可用,作用范围及与图层关系明确 |
| 持久 LUT 目录 | Preferences 登记目录并递归发现 `.cube`;图库支持当前片段 Live Preview | 同产品进程共享配置;目录可添加、移除、重定位;空目录、离线、权限和坏文件有不同提示 |
| 当前帧批量预览 | 缓存源帧,应用项目调整,再应用候选 LUT,最终作颜色/方向转换 | 每批冻结同一真实宿主帧及图层快照;旧任务失效;预览不写工程;点击才提交 |
| LUT 插入 | 图库双击或 Insert 新建 LUT 层;可叠加不同 LUT | 默认明确新建层;替换现有 LUT 是独立操作,候选预览不能叠加被替换的原 LUT |
来源:[图层编辑器](https://docs.colorfinale.com/docs/layers/)、[六色向量](https://docs.colorfinale.com/docs/layers/sixvectors/)、[蒙版](https://docs.colorfinale.com/docs/masks/masks/)、[区域跟踪](https://docs.colorfinale.com/docs/masks/tracking/)、[LUT 工作流](https://courses.colorfinale.com/blog/post/cf-lut-management-08-23)、[偏好设置](https://docs.colorfinale.com/docs/preferences/)。
## 完整功能差距登记
以下能力不能因为本轮五个重点完成就自动标记为“全部迁移”。没有相应实现和验证时保持未验收。
| 领域 | 官方能力 | 依据 |
| --- | --- | --- |
| 色轮 | Lift/Gamma/Gain、RGB 滑块、各区亮度与饱和度、分界范围、CDL 导入导出 | [Color Wheels](https://docs.colorfinale.com/docs/layers/wheels/) |
| RGB/Luma 曲线 | Master+RGB、Luma+RGB、Luma Preserving、取色建点、S 曲线捷径 | [Curves](https://docs.colorfinale.com/docs/layers/curves/) |
| 六色与肤色 | 六个标准色区及第七肤色向量,H/S/L、肤色中心、Extended 饱和度模式 | [Six Vectors](https://docs.colorfinale.com/docs/layers/sixvectors/) |
| HSL 曲线 | 按色相改变色相/饱和度/亮度,按亮度或饱和度调饱和度;单曲线旁路及不同插值形式 | [HSL Curves](https://docs.colorfinale.com/docs/layers/hsl/) |
| 滤镜 | Box/Gaussian/Disc 模糊和锐化,RGB/HSL 分通道 | [Filter](https://docs.colorfinale.com/docs/layers/filter-layer/) |
| 通道路由与混合 | RGB 路由、直接常量/颜色、通道混合、系数归一化、通道反相 | [Shuffle](https://docs.colorfinale.com/docs/layers/shuffle-layer/) |
| 相机矩阵 | RGB 基色独立色相与饱和度,保持整体白平衡 | [Camera Matrix](https://docs.colorfinale.com/docs/layers/camera-matrix/) |
| Log 色轮 | 阴影/中间调/高光/Offset;范围分界;位于 Log 转换前处理 | [Log Wheels](https://docs.colorfinale.com/docs/layers/log-wheels/) |
| 色调映射 | 最多 11 点 HSLA 渐变、不同亮度来源、取色和预设 | [Color Atlas](https://docs.colorfinale.com/docs/layers/color-atlas/) |
| 纹理均衡 | 当前文档列六个尺度频段,基于多尺度模糊分解 | [Texture EQ](https://docs.colorfinale.com/docs/layers/texture-eq/) |
| LUT 强度扩展 | 最新文档包含 Tone 和 Chroma 独立强度;本机版对应性尚未逐项核验 | [LUTs](https://docs.colorfinale.com/docs/layers/luts/) |
| 图层组 | 多选建组、折叠、混合组与独立层;组默认 Pass-through | [Groups](https://docs.colorfinale.com/docs/layers/groups/)、[Blend Modes](https://docs.colorfinale.com/docs/layers/blend/) |
| 形状种类 | 矩形、椭圆、折线、B 样条、Bezier、渐变边缘、图像蒙版 | [Masks](https://docs.colorfinale.com/docs/masks/masks/) |
| 内外调色 | 组的父蒙版供多层共用,单层可反转父蒙版 | [Parent Masks](https://docs.colorfinale.com/docs/masks/parent/) |
| 形状组 | 形状多选编组、整体移动、组级 Add/Subtract/Intersect | [Grouping Masks](https://docs.colorfinale.com/docs/masks/grouping-mask-shapes/) |
| HSL 蒙版 | 选色范围/衰减、取色增减、输入输出阶、模糊、源阶段选择 | [HSL Mask](https://docs.colorfinale.com/docs/masks/hsl-mask/) |
| 人物与外部蒙版 | 人物分割、FCP 外部蒙版接入,四种蒙版显示方式 | [Person Mask](https://docs.colorfinale.com/docs/masks/person-mask/)、[External Masks](https://docs.colorfinale.com/docs/masks/external-mask/)、[Display Modes](https://docs.colorfinale.com/docs/masks/fourmaskdisplaymode/) |
| 蒙版发布与抠出 | 从图层或组发布蒙版,在外层检查器选择 Mask Output / Cutout,将结果用于时间线合成 | [官方2.9工作流](https://colorfinale.com/blog/post/cf-2-9-masks-09-24);准确组合与alpha语义待本机发行代码核对 |
| 色彩管理 | Assume Video/Log、ACES、相机输入变换、输出变换、工作空间 | [Color Management](https://docs.colorfinale.com/docs/inspector/cms/) |
| 色卡匹配 | ColorChecker Video/Passport,四角定位、自动匹配和色卡预设 | [Color Chart](https://docs.colorfinale.com/docs/inspector/chart/) |
| 胶片模拟 | 减色、晕光、辉光、暗角、颗粒;部分 Film Look 位于 ACES 链路 | [Film Emulation](https://docs.colorfinale.com/docs/inspector/film-emulation/) |
| LUT 导出 | 将可用纯颜色处理及已有 LUT 合成为 `.cube`;空间蒙版不可烘焙进 LUT | [Export as LUT](https://docs.colorfinale.com/docs/inspector/export-as-lut/) |
| 其他工作流 | 调色预设、跨片段组同步、图像分析、硬件控制面板 | [完整文档目录](https://docs.colorfinale.com/docs/) |
## 界面观察与独立设计
官方 [总览截图](https://docs.colorfinale.com/docs/overview/overview.png) 显示检查器一级调整和独立浮动图层面板并存。浮动面板是横向布局:顶部工具图标、左侧层栈、右侧大面积当前工具、左下层混合和蒙版入口。总览截图标示原版 2.15.0,不作为本机 2.16.2 运行证据。
官方 [六色向量截图](https://docs.colorfinale.com/docs/layers/sixvectors/images/sixvectors.png) 中,七枚颜色按钮横排,下方仅显示当前颜色的 H/S/L 三条滑块;肤色多一条 Target。右侧为可编辑数值,底部为整体和当前向量复位。
大鱼可借鉴信息层级、选择反馈和直接编辑,但不复制原图标或专有素材。清晰标注“全局快速调节”与“当前层”,比让外层控件随选层暗中改变含义更容易判断。本项目最终采用哪种绑定,以实现记录为准。
## 尚未确认的数学与运行事项
- 六色/肤色选择的确切权重、带宽和亮度公式未由公开资料确定,独立实现需自身数值与实际画面验收。
- 旧静态跟踪证据观察到仿射拟合及位置/旋转/双轴缩放输出,不能因此宣称有透视、逐节点形变或遮挡重识别。
- 官网 2025 年介绍 Texture EQ 为五个频段,当前文档为六个;两者应按版本区分。[旧说明](https://colorfinale.com/blog/post/cf-6-vectors-06-25)
- 官方 HSL 页面中“Sat vs Luma”标题与正文轴描述存在命名混淆;大鱼 UI 应使用明确的“亮度 → 饱和度”名称,不照抄含混标签。
- 原版区域跟踪的具体失败恢复、图库插入位置、原版完整运行交互尚未实际比较。不能将官方文字与已有静态分析合并声称运行验收通过。
## 关键验收
1. 两层分别处理天空和建筑;切层、复制、重排、启停、撤销、保存重开后参数与蒙版归属正确。
2. LUT/曲线/六色向量在蒙版外保持该层输入,蒙版中羽化和混合量连续;alpha 不被空间遮罩误裁。
3. 跟踪时重排或切层不改变目标;删除目标或改形后拒绝过期结果;取消保留可信段。
4. LUT 登记一次后重开可见;递归去重且不跟随目录符号链接;失败目录和坏文件可见,不删除工程中已应用的采样数据。
5. 快速切片段、移动播放头、换目标层后,整批卡片最终来自同一当前快照;点击结果与预览的位置、强度一致。
6. 六色条和连续色相环验证区域隔离、灰阶安全及首尾连续;旧 schema 归档保持原有输出和轨迹。
## 2026-10-26 第二阶段实现进度(尚待正式宿主验收)
- 已接入:Pass-through 图层组、8 种叶子混合、父蒙版内部/外部、HSL 五条曲线及线性/平滑过点插值、RGB Master/Luma/Luma-preserving 自由曲线、相机矩阵、四区 Log 调节、独立 ASC CDL 与 CC/CCC 导入导出、最多 11 点颜色映射、原生调色文件、持久预设及 17³、33³、65³ LUT 导出。
- 工具算法为独立实现。B 样条近似、取色创建曲线点、原三色轮的完整 CDL 对应、自动相机输入判定仍未覆盖。
- 组只实现 Pass-through;8 种混合用于叶子层,未声称实现所有 Color Finale 组混合模式。颜色映射的渐变显示是空间输出,明确拒绝导出成 3D LUT。
- 更多蒙版形状、HSL 与亮度键、人物或外部蒙版、手动形状动画、空间滤镜、纹理、色彩管理、胶片模拟、色卡、硬件及跨片段同步仍是开放项。
## 2026-10-26 蒙版与羽化进度
构建23已经正式验收类型蒙版、精确时间关键帧、颜色源阶段与手动/自动轨迹合并;构建24已公证安装内/外羽化双轮廓。主体宽高与羽化拖动独立,保留旧向内效果,轨迹合并保留非几何动画。布局修正版25已公证,待宿主退出后安装;最终冷重开未完成。报告及确切限制见HANDOFF.md,完整目标仍未完成。空间工具、人物/外部蒙版、色彩管理及其他上表未验收项继续保留。
## 2026-10-26 空间工具源码进度(未正式安装)
`d31b3551ca55f787605279f821c163cf3411cb75` 已接入空间滤镜(均值/高斯/圆盘/锐化柔化)、六频段纹理、逐蒙版独立模糊及可操作图层控件。CPU/Metal完整帧、schema8与原生文件、异步取消和图库预览已联通,独立远程恢复186个文件并重编译通过728项面板测试。实际正式APP/FCP验收仍待完成,不能从源码测试推定正式效果或实时性能。Motion/Bokeh、人物/外部蒙版、色彩管理、胶片、色卡及其它未覆盖细项继续保留。
## 2026-10-26 帧蒙版开发基础(未接产品界面)
`1772fd65aac5d9e13b140c82a42705a8faaacbfa` 增加共享标量帧绑定及独立帧Vision人物提供者。CPU/Metal蒙版与父组组合、9次真实人物推理、乱序/同时间换图、均衡/高质量、内存与取消和远程197文件恢复已验证。没有复用Color Finale模型;没有把执行模块当作完整人物功能。作者归档、工作空间/宿主输入适配、人物选择与轮廓细化UI、外部image well/模板和正式验收仍为开放项。见HANDOFF.md和research/colorfinale-frame-mask-design.md。
## 人物帧来源进入真实渲染的开发检查点
`b0f3d5f2563aae51fc4573c95ab629634f9b1cbd` 完成人物/外部来源schema9、精确强度动画、运行计划6与逐帧解析。人物已接CPU/Metal位图、宿主纹理和取色;使用来源RGB配置转换分析图像,保留原调色图像。6次实际人物推理、两种图像原点、透明度、失败原子性及734项离屏面板检查通过;远端独立恢复206文件和重新编译测试通过。仍未开放人物添加/质量菜单,外部输入还未接FxPlug调度,轮廓/实例细化、预览与LUT共用全幅人物分析及正式发布验证仍未完成。颜色转换仅服务人物分析,不等于CMS/ACES迁移完成。
## 2026-10-26 人物控件和 LUT 分析复用开发节点
`7b3f0ad97321b7801fe19032edd92ad05a7a56d0` 已实现人物添加、质量、公共色阶/模糊/强度动画,隐藏无关的几何和纹理跟踪,修复同名蒙版选择及延迟编辑隔离。LUT批次对完整可用面板源按不同请求分析一次并共享原始覆盖度;真实人物图库换帧/应用、807项离屏面板检查、CPU/Metal蒙版显示及212文件远端重建通过。正式24和待装25未变。面板仍是8位缩略图,主预览与图库尚未共用一次分析;人物实例/轮廓/细节细化、外部输入、四种显示模式及正式界面性能/无障碍验收仍开放,不能称人物功能完整迁移。证据见 `verification/person-mask-ui-development.json`。
## 2026-10-26 人物轮廓/细化独立模块
`64a8f56d233d003bb4ab20766c70b18aa78267eb` 完成独立欧氏轮廓、细节与柔和度CPU/Metal模块,提供人物/轮廓/组合及内/中/外位置。修复50%边界浮点分类和软内部覆盖保留问题,177个GPU案例含4K与CPU一致、默认逐位恒等;独立远端224文件恢复和重编译通过。当前仍未接入作者归档、运行计划、产品面板和正式版本,三种处理模式不替代四种显示模式;该条继续标记开发中。
## 2026-10-26 人物细化接入产品源码
人物/仅轮廓/人物加轮廓、内/中/外位置、宽度/细节/柔和度已接入schema10、计划7、原生面板及CPU/Metal完整帧。三种处理模式与四种蒙版显示模式分开;后者继续开放。人物推理请求32字节不变,LUT批次复用原始分析;旧缺省保持恒等,外部源不能误用人物细化。离屏归档、真实人物宿主纹理、父组、边缘重采样、撤销和延迟编辑验证见 `verification/person-refinement-integration-development.json`。正式24和待装25仍不变,人物实例、外部输入、完整CMS/ACES、胶片/色卡及正式界面/性能/无障碍验收继续开放。
## 2026-10-26 四种蒙版显示进入产品源码
`69fc3712f2322155b10c4ebbe3af3f72bcda2b8b` 已接入结果/输入/输入与蒙版/合成蒙版。实际图层入口、同层组合和父组内部/外部覆盖经独立像素参考及CPU/Metal核对;真实人物细化、精确时间、异步旧结果拒绝和原生下拉菜单已接通。显示方式只在窗口内生效,不写入工程、撤销或LUT;旧输出蒙版标记保持兼容。此节点补齐上节的显示模式源码,正式界面与宿主验收仍开放。详见 `research/mask-display-contract.md` 和 `verification/mask-display-development.json`。
## 2026-10-26 主预览与 LUT 共享人物分析
`c281e39a1d6ffbc3b86d18b8783f8e8fc81d072e` 将同一窗口当前精确帧的原始人物覆盖度共享给主预览、蒙版检查和图库。并发请求共用同一覆盖度对象,部分质量命中保留已有结果,颜色/轮廓编辑复用;换源、换时间及同时间上游变化隔离,取消与失败不污染其他消费者。面板仍采用RGBA8缩略图,完整HDR/全分辨率取帧和正式播放性能仍待完成。证据见 `verification/preview-sharing-development.json`。
## 2026-10-26 外部图像调度与配对快照
`a57576e3bc353f641fbd864fe0d9fa35228fb466` 已接入固定ID4图像槽、EffectClip/Parameter双路调度、冻结时间映射、独立坐标与原点、Alpha/Luma实际GPU渲染,以及主预览和LUT共享的自有外部快照。输入顺序、错帧、缺失、父组、代理范围、宿主纹理变更及精确配对已通过离屏测试;真实插件回调以模拟宿主元数据验证,不能替代FCP验收。远端248文件恢复、两目标Release链接、Address/UB与Metal验证通过。接收模板、添加/通道控件、外部轮廓、实际Drop Zone时间与保存重开仍开放;正式24及冻结25未变。见 `external-input-contract.md` 和 `../verification/external-input-development.json`。
## 外部作者与原生接收模板开发(未正式安装)
`576add796cf9daa8b74271a83f2b96d7ec3d7adc` 补齐图层/组外部蒙版入口、Alpha/Luma、轮廓位置/宽度/细节/柔和度,schema11和计划9;精确强度动画保持,矩形/椭圆羽化外框与区域跟踪回归通过。独立接收模板连接固定ID4,普通模板不变;未来正式APP安装两个缺失模板,保留用户修改。1,026项面板、19,128项输入/实际GPU、144组人物/外部细化、15项模板结构及259文件远程恢复通过,详见配套verification报告。实际FCP接收、空来源、变速、保存重开、正式UI/性能未验收;本轮不把静态模板或离屏测试视为完整外部功能交付。
## 迁移范围校正:人物实例与蒙版发布
2026-10-26重新核对:`colorfinale-frame-mask-design.md`中单独人物实例是“第二阶段可评估”的大鱼扩展设想,官方Person Mask当前说明只证明显著人物整体识别、质量和边缘细化。尚未找到单独人物选择是本机2.16.2功能的充分证据;它保留为可选评估项,不作为已证实Color Finale功能缺口。此结论不把缺失证据当作原版不支持的证明,也不减少用户原定的完整迁移范围。
反而已有明确但此前矩阵漏列的功能是“Publish Mask / Mask Output / Cutout”:官方2.9文章展示图层或组蒙版输出,用于把文字放在人物后面等时间线合成。大鱼现有maskView黑白输出、临时四种检查视图、外部输入三者都不能单独证明这一持久发布流程已完成;该项新增为必需迁移和验收项,正在核对本机发布目标及alpha行为。当前完整目标继续进行。
### 发布蒙版与抠出开发接入(2026-10-26)
`bbb4f00bc45170eab1312c6b39989a37f98c02ea` 已实现schema12的唯一图层/组目标与独立输出模式、CPU/Metal节点后发布、真实alpha、外层检查器和图层按钮、透明棋盘格以及归档/撤销/预设/LUT限制。组强度同步插值straight RGB与alpha,旧未发布结果保持。432组独立数值用例(220740断言)最大浮点差8.94069672e-8、8位差0;离屏面板1086项、真实插件回调夹具48项、解析14项通过。详见 `research/published-mask-contract.md`。正式安装、宿主叠层/冷重开及视觉验收仍开放。
原版静态证据确认发布时序和own mask,并发现其组结果后置蒙版、发布重新取样阶段与当前大鱼规则仍有差别。逐子层父蒙版与完整组混合继续列为待升级,不能因发布功能落地而勾选全等。人物已核实路径为整体分割,单人实例选择保留可选扩展。原版证据和限制见 `research/colorfinale-published-mask-design.md`。
### 组内外双链与混合开发接入(2026-10-26)
`b38bc7739f1605e81e0596e4ea942e3b4c7b8ff5` 已实现schema13/计划11的新式组:两链独立从入口开始、直属父蒙版外部路由、组混合和straight RGBA强度、最后按蒙版预乘合成。旧文件仍走旧式逐层覆盖,兼容切换可撤销;嵌套混合版本、空间工具、入口取色、临时监看、发布、LUT候选和导出接入统一流程。54场景/33231断言、1096面板及15解析测试通过,独立远端恢复281文件、两目标Release链接通过,未正式安装。原版证据及独立产品规则见 `colorfinale-group-rendering-v21.md`、`group-compositing-contract.md`。
当前组仅开放既有0–8共9模式,普通层保持8模式旧算法。底层27模式有真实Core Image独立oracle,但两例Luminosity极低alpha差异、Add的扩展alpha链、叶层版本迁移和工作空间转换尚未全部接入,不能勾选“全部混合完成”。原版真实菜单是组23项、普通层22项;四个非分离颜色枚举未出现在该菜单,不将它们当作已证实菜单必需项。正式UI/键盘/VoiceOver/宿主重开/性能、CMS/ACES、胶片/色卡、Motion/Bokeh和其它矩阵细项仍开放。
### 完整混合模式开发与正式25验收(2026-10-26)
schema14/计划12已接入26种叶层、27种组模式及版本化预乘中间链,使用系统CI真实过滤器,不以旧近似数学冒充扩展alpha一致。叶层Add设alpha1、组Add保留扩展alpha;强度和蒙版各自处理,旧节点保留原算法。84完整场景和1160面板断言通过,极端数值安全及4K动态预算修复已验证,尚未正式安装。正式25仅是羽化/布局阶段:FCP冷重开文件逐字节一致,椭圆/旋转矩形实际外框拖动与撤销重做通过,生成副本已清理。完整迁移余项仍按矩阵保持开放。
@@ -0,0 +1,147 @@
# 后续颜色工具的独立实现设计
日期:2026-10-26(Asia/Shanghai)。这是下一阶段工程设计,不是已实现清单,也不表示与 Color Finale 逐像素等价。本文件只新增设计文档;没有修改颜色源码、宿主工程或界面。
审阅基线:`19b3d80039875d09b46f4418e6cfdddf0b0d036a`。审阅时 `Core/DYColorMath.h` 的 SHA-256 为 `4ce03351e3b93b94971e15f8b68d4448c98d8bd5308580595980ef399e5ad7aa`。功能来源和本机版本边界继续见 [迁移矩阵](colorfinale-2.0-matrix.md)。
## 1. 已有实现与需要保留的约束
当前 `DYGrade` 为 1032 字节,前 808 字节是旧参数 ABI;新增 224 字节为快捷 HSL、七个向量、RGB 曲线和通道矩阵。当前五点 `curve` 分别作用于 R/G/B,是 Master RGB 语义,不是真正的单独亮度曲线。RGB 曲线随后处理各通道。当前实际顺序是:
`曝光/白平衡 → lift/gain/midtone → 黑白点/对比/阴影高光/伽马 → Master RGB 曲线 → 各 RGB 曲线 → 饱和度 → 蜘蛛盘 → 快捷 HSL/向量 → 通道混合 → LUT → 局部处理/图层蒙版与混合`。
这条链已承载保存的用户画面。增加新工具时不得重新排列旧链、把现有曲线改解释为 Luma、把现有三色轮改解释为 CDL,或因图层的显示类型改变旧参数的意义。旧参数的默认旁路、alpha、CPU/Metal 共用数学和保存重开行为继续作为回归基线。
## 2. 参数、归档与渲染计划
建议冻结 `DYGrade` 的 1032 字节布局。可变节点和新增模式另存为 `DYAdvancedColorState`,以可安全归档的命名字段编码,挂在每个 `DYSettings` 的可选 `advancedColor` 键下;归档 schema 升为 5。不要把大数组、枚举或可变数量控制点继续追加进现有按整块 float 插值的区域。
| 项目 | 建议布局与默认值 |
| --- | --- |
| `DYAdvancedColorState` | `version=1`、`kind`、`enabled=false`,一个与 kind 匹配的工具状态;空值为严格恒等 |
| 工具身份 | `hsl_curves`、`log_wheels`、`camera_matrix`、`cdl`、`color_atlas`、`rgb_curves_v2`;复用外层稳定 layer ID |
| 曲线作者数据 | 每条曲线独立 ID、enabled、interpolation、domain、点列表;每点稳定 ID、x/y、左右切线或手柄;每条最多 32 点 |
| CPU/Metal 渲染头 | 显式 `uint32_t version, kind, flags, payloadIndex`;参数、曲线采样表与节点各自有长度校验;不要持久化平台指针、`BOOL` 或 `simd_float3` padding |
| 时间采样 | 固定标量仅在同工具版本间插值;曲线、节点数量、模式为离散快照,或仅在稳定点 ID 完全匹配时插值;禁止将枚举当 float 混合 |
| 颜色上下文 | 记录工作 RGB、传递函数/Log 编码、参考白、是否已经过输入变换;未知信息明确为 unknown,不能从画面观感猜测 |
新建高级工具层把原 `DYGrade` 留在恒等值,先走旧 grade,再执行该层高级算子,再接现有 LUT、局部处理、蒙版与层混合。已有层没有高级块,输出保持原样。高级工具排列由图层栈显式决定;不在后台把 Log 色轮、矩阵或 CDL 自动移动到别处。若同层保留旧参数和高级块,工具区需说明该内部顺序。RGB 曲线 v2 是独立新算子;旧 5 点曲线不被隐式搬移。
迁移要求:
1. 808 字节:先 `dyDefaultGrade()`,只拷贝 808 字节,再执行原迁移;新增颜色参数和高级块为恒等。1032 字节:完整保留原值,高级块为空。未知长度必须报错或明确保留原数据,不能按较短长度猜测结构。
2. schema 5 仍存 1032 字节 grade 和独立高级块。解码类表、深拷贝、相等比较、撤销、渲染快照、宿主证据读取、恢复工具同时更新。
3. 新读者遇到未知但启用的高级工具版本要拒绝静默丢弃。旧已发行程序不会因为新 writer 增加一个版本字段就自动学会拒绝;因此只承诺旧→新迁移,不承诺新文件可被旧程序正确打开。恢复说明标明最低版本。
4. 旧 808 与现有 1032 的真实归档、带 LUT/钢笔/轨迹的文档都建立画面对照。新格式保存再重开、随机时间、CPU 与 Metal 必须分别验证。
## 3. HSL 曲线
**官方证据。** 文档列出按色相调色相、饱和度、亮度,以及按亮度或饱和度调饱和度的五条曲线;支持独立旁路、取色加点及不同插值。正文中 Sat vs Luma 的横轴实际描述为亮度,大鱼应直接标成“亮度 → 饱和度”。公开页没有给出精确颜色转换、区间外推和样条系数。[官方 HSL Curves](https://docs.colorfinale.com/docs/layers/hsl/)
**建议参数。** `DYHSLCurvesState` 包含五个 `DYCurveState`、`extendedSaturation=false`、`mathVersion=1`。坐标和输出单位如下:
| 曲线 | x | y 与中性值 | 建议初始界限 |
| --- | --- | --- | --- |
| 色相 → 色相 | 周期 hue,0–1 turns | hue 位移,0 | ±0.5 turns |
| 色相 → 饱和度 | 周期 hue | 饱和度倍率,1 | 0–4 |
| 色相 → 亮度 | 周期 hue | 曝光位移 EV,0 | −4 至 +4 EV |
| 亮度 → 饱和度 | 层输入的归一化代码亮度 | 饱和度倍率,1 | 0–4 |
| 饱和度 → 饱和度 | 层输入的选定饱和度定义 | 饱和度倍率,1 | 0–4 |
上述 EV、倍率和界限是大鱼的独立选择,不是对 Color Finale 数值刻度的断言。工具名中的亮度不复用当前快捷 HSL 的 lightness 字段;两者的数学语义不同。
**建议评估。** 从该算子的同一输入一次性取 hue、saturation、亮度 Y。五条曲线全部以这些原始坐标取值,避免前一条曲线移动后一条的选择区域。色相位移后合成颜色,三个饱和度倍率相乘;在亮度为零的色差子空间缩放色差。最终目标亮度为 `Y × 2^EV(hue)`,通过下节的亮度恢复函数恢复。近中性像素用平滑色度权重抑制色相选择噪声;精确灰色只响应亮度型处理,不凭无定义 hue 生成染色。扩展模式保留额外色度,不在中间强制裁到 SDR;最终有限范围沿用现有渲染策略。
饱和度轴必须有固定定义并随 `mathVersion` 保存,建议第一版沿用当前 HSL 工具使用的归一化颜色基础;亮度轴明确采用当前工作空间的代码亮度。不要按每帧直方图自动拉伸坐标,否则随机跳帧和图库预览会改变结果。对超出 0–1 的亮度/饱和度选择坐标使用端点值,RGB 输出仍可超范围。
**曲线表示。** 提供线性、平滑逼近、平滑过点三种明确模式。平滑逼近可独立用三次 B 样条(de Boor),平滑过点可用受限 Hermite/Bezier。它们不是同一个算法的三个名称。x 必须严格递增,Bezier 手柄 x 不跨邻点;周期曲线使用首尾共享约束和虚拟邻点,保证接缝值与斜率连续。作者点原样保存,编辑后后台烘焙 4097 个 float 样本,CPU/Metal 共用相同表和插值。不能把采样表作为唯一可编辑文件。若误差门限未达到,再增加分辨率或改为分段系数。
**验收。** 连续色相环跨红色接缝;原始色相选择的顺序独立性;全部曲线旁路与中性值严格恒等;色相区间外不变;黑白端去饱和渐变平滑;B 样条不过点与过点模式确实不同;重排/删除点后无重复 x、NaN 或越界。查表与双精度直接求值对照,目标归一化误差 ≤2e−4,并以视觉渐变检查条带。CPU/Metal 允许最后量化误差不超过 1 个 8-bit 色阶,alpha 必须逐位保留。
## 4. RGB 曲线模式
**官方证据。** Master + RGB 对各 RGB 值共同套主曲线;Luma + RGB 的主曲线针对亮度;Luma Preserving 在调整 RGB 曲线时保持亮度。还支持取色建点及 S 曲线快捷操作。公开说明没有给出保持亮度的确切公式或 HDR 边界处理。[官方 Curves](https://docs.colorfinale.com/docs/layers/curves/)
**建议参数。** `DYRGBCurvesState { version, enabled, mode, master, red, green, blue }`。mode 为 `masterRGB / lumaRGB / lumaPreserving`。每条最多 32 点;默认 `(0,0),(1,1)`。所有通道拥有各自旁路状态;原 `curve[5]` 与 `rgbCurve[3][5]` 保留原模式和旧插值。
令 `Y(c)=dot(w,c)`,w 为当前工作空间亮度权重。定义独立辅助函数 `setLuma(c,target)`:当原 Y 大于正 epsilon 且 target 非负时按 `target/Y` 等比缩放 RGB;其余情况采用 `c + (target−Y)·1`,避免黑色、负值和除零引起色相翻转。此回退边界应连续化并版本固定;它是工程选择,不是原产品公式。
| 模式 | 明确处理顺序 |
| --- | --- |
| Master RGB | `m_k=Master(c_k)`,再 `out_k=RGB_k(m_k)` |
| Luma RGB | `target=Master(Y(c))`,`m=setLuma(c,target)`,再逐通道 RGB 曲线 |
| Luma Preserving | 同上得到 RGB 曲线结果 q,最后 `out=setLuma(q,target)` |
对黑/负亮度的 `setLuma` 建议最终实现采用有界平滑过渡,而不是在 epsilon 处硬切。要先确定此过渡再固定 mathVersion。曲线的区间外推第一版可采用端点斜率且限制极端斜率;旧五点曲线继续原端点偏移外推。取色只在当前冻结源帧和该层输入上建点,不能从已经过该层输出的屏幕颜色反复反馈。
**验收。** 同一 S 曲线在 Master RGB 与 Luma 模式具有可解释差异;Luma Preserving 改红曲线后 `dot(w,out)` 保持目标亮度;灰阶、接近黑色、负通道、HDR、同 x 重复点、极陡曲线都保持有限输出;旧归档仍调用旧五点路径。S 曲线快捷操作只建立普通可编辑点,没有额外隐形对比度参数。
## 5. Log 色轮
**官方证据。** 原工具有阴影、中间调、高光及 Offset,带亮度控制和范围分界;推荐位于 Log 转视频空间的层之前,并保持传入 Log 状态。文档没有公布具体区域权重或相机编码公式。[官方 Log Wheels](https://docs.colorfinale.com/docs/layers/log-wheels/)
**建议参数。** `DYLogWheelsState`:四组 `chroma[3]` 和 `brightness`,全部默认 0;`shadowEnd`、`shadowSoftness`、`highlightStart`、`highlightSoftness`;`domain=encodedLog`;独立 mathVersion。参数单位是输入 Log 的代码值偏移,不标作 EV。初始范围可取阴影过渡 `[0.20,0.40]`、高光过渡 `[0.60,0.80]`,但这些只是产品初始值,不代表任何相机标准。
在层输入的代码亮度 Y 上构造 `ws=1−smoothstep(s0,s1,Y)`、`wh=smoothstep(h0,h1,Y)`、`wm=1−ws−wh`,要求 `s0<s1≤h0<h1`。边界编辑自动保持最小间隔,令权重非负且总和 1。每个色轮的色差向量减去其加权亮度分量;最终:
`out = input + offsetChroma + offsetBrightness·1 + Σ weight_region × (regionChroma + regionBrightness·1)`。
四个色轮的二维位置与 RGB 数值是同一参数的两种编辑方式,不能保存两套可能不同步的真值。输入范围外仍使用端区权重,但不裁剪 RGB。中性参数直接返回输入。
当前宿主请求的是 gamma-video 图像;如果宿主或上游相机 LUT 已把素材转换成视频空间,新增一个叫 Log 的色轮不能恢复原始 Log。应把“输入保持 Log”的上下文条件接入色彩管理和层顺序,支持用户明确指定已有输入编码,不自动检测或偷偷反转换。先完成该前提,才报告 Log 工作流可用。可验证的初版是对明确声明的 Log 代码值做上述算子,不声称具备相机自动识别。
**验收。** 灰阶 ramp 显示三个区间的局部响应;分界处无阶跃;Offset 对全范围一致;保持 Log 输入、先色轮后 Log→709 LUT 与反向顺序确实不同且可撤销;导出随机帧不依赖播放顺序。用真实指定 Log 素材对照前,不以 SDR 画面“看起来正常”代替验收。
## 6. 相机矩阵
**官方证据。** 文档说明可独立调整 R/G/B 基色的 hue/saturation,并保持整体白平衡。它没有给出矩阵构建方式,也没有说明等于某家相机的 IDT 或校准矩阵。[官方 Camera Matrix](https://docs.colorfinale.com/docs/layers/camera-matrix/)
**建议参数。** `DYCameraMatrixState { enabled, hueTurns[3]={0}, saturation[3]={1}, preserveNeutral=true, mathVersion=1 }`。建议 hue 初始可编辑范围 ±1/6 turns,saturation 0–2;这些与当前九系数 `channelMixer` 是独立工具。保存控件值,在构建渲染计划时生成 3×3 矩阵,不在每个像素重新计算三角函数。
一个可验证的独立构造:令 `1=(1,1,1)^T`、`w^T·1=1`,e_i 是 R/G/B 基向量。先将每个基色分成 `w_i·1` 与零亮度色差 `q_i=e_i−w_i·1`。在与 w 正交的平面中旋转 q_i,再乘对应饱和度,得到候选列 `A_i=w_i·1+s_i·Rotate(q_i,2πh_i)`。旋转可用绕单位 w 轴的 Rodrigues 公式。最后施加投影:
`M = A + (1−A·1)·w^T`。
这个构造满足 `M·1=1`,因此所有中性灰保持;也满足 `w^T·M=w^T`,保持所选代码亮度。默认 A 和 M 均为单位阵。白平衡保持需要对其他基色作补偿,所以“独立控件”不表示其他 RGB 数值永远不变。矩阵可输出负值,不在算子内部硬裁色域;该边界由后续显示/输出处理承担。
此公式是大鱼设计推导,未从 Color Finale 反编译所得。矩阵的工作域、亮度权重及是否保持亮度须版本固定;后续接入不同 RGB 工作空间时,不能继续无条件使用 Rec.709 系数。
**验收。** 对随机允许参数验证 `M·1=1` 和 `w^T·M=w^T`;灰阶 −2…16 保持;单个主色控件变化方向稳定;默认严格恒等;CPU/Metal 矩阵排列一致;处理负输入和高亮不产生 NaN。不能把这些数学通过项说成相机色彩科学已校准。
## 7. CDL 交换
**官方证据。** Color Finale 色轮提供单个片段/色轮的 CDL 导入导出,交换 slope、offset、power、saturation。公开页没有承诺把整条时间线或任意工具堆栈压成一个 CDL。[官方 Color Wheels](https://docs.colorfinale.com/docs/layers/wheels/)
采用明确的独立 `DYCDLState { slope[3]={1}, offset[3]={0}, power[3]={1}, saturation=1, style, id, description }`。标准前向与不裁剪前向是不同 style;不能依据数值是否中性擅自改变 style。[ACES CLF 的 ASC_CDL 定义](https://docs.acescentral.com/clf/specification/#asc_cdl) 和 [OpenColorIO CDLTransform](https://opencolorio.readthedocs.io/en/stable/api/transforms.html#cdltransform) 可作为实现/对照依据。
标准前向按通道 `q=clamp(input×slope+offset,0,1)^power`,再以 Rec.709 权重得到 Y,输出 `clamp(Y+saturation×(q−Y),0,1)`。NoClamp 省略两处 clamp,且对 SOP 的负中间值跳过 power。slope≥0、power>0、saturation≥0,输入必须为有限数。标准 clamp 模式即使数值默认也会裁超范围值,因此不能把它优化成对 HDR 的无条件恒等;NoClamp 的默认值才可直接旁路。
第一版导入 `.cc`,以及从 `.ccc` 中选择一个明确 ID;若支持 `.cdl` 则解析其中的条目结构,不能仅按扩展名选择第一个 XML 节点。保存 ID/描述与十个数值,使用足够有效位数输出。禁用外部 XML 实体/网络解析,拒绝重复必须字段、非有限值和非法数量。参数读入不写入原文件。NoClamp style 若目标文件格式无法表达,导出界面明确其互操作限制,不用注释伪装标准字段。
当前三色轮并非直接的 CDL 数据。在其他工具全中性、没有不兼容范围饱和度、LUT、混合或蒙版时,单通道的代数近似可整理为:`slope=(1−lift)×(1+gain)`,`offset=lift×(1+gain)`,`power=1/(1+midtone)`。这只是当前公式的特定条件转换,仍须数值验证并检查非负 slope 等合法性。默认优先新增真正 CDL 工具层,精确保存交换参数。不能把任意调色结果压成十个数并声称无损。
**验收。** 用公开 CDL/CLF 的固定数值案例和独立 OCIO CPU 参考比较;SDR、负值、>1 输入、power=1、零 slope、零饱和度、非法 power 分别覆盖;导入→导出→再导入十个参数稳定;Unicode 描述和多 ID 选择正确;没有颜色管理上下文时不声称跨应用显示外观必然一致。旧三色轮转换另设输出误差检查,不与直接 CDL 往返混为一项。
## 8. Color Atlas 色调渐变映射
**官方证据。** 原工具最多 11 个 HSLA 渐变点,按 Rec.709 亮度、单个 R/G/B 通道或 CIE L* 选取渐变;包含结果、亮度图、渐变输出及取色/本地预设。公开页没有给出渐变插值色彩空间。[官方 Color Atlas](https://docs.colorfinale.com/docs/layers/color-atlas/)
**建议参数。** `DYColorAtlasState` 包含 `points[2…11]`、`tonalSource`、`outputMode`、`interpolation=RGBPremultiplied` 和 mathVersion。每点存稳定 ID、position、hueTurns、saturation、lightness、alpha。position 单调,端点固定 0/1,重复位置明确拒绝或作为同一次编辑替换;不让排序随机决定结果。默认两点 alpha=0,使新层恒等,这是大鱼的产品选择。
**建议评估。** 先从该层输入计算 tonal coordinate,范围外夹到端点。HSLA 只作为点颜色的编辑表示;第一版在当前明确工作 RGB 中对预乘色和 alpha 线性插值:`P=lerp(a0·RGB0,a1·RGB1,t)`、`A=lerp(a0,a1,t)`,结果为 `input×(1−A)+P`。这样完全透明的点不会污染相邻颜色。点 alpha 控制颜色覆盖量,仍保留素材的 alpha;之后还要乘图层蒙版/混合量,不能重复把素材 alpha 当点 alpha。原版是否采用同一插值仍未知。
Rec.709 代码亮度与 CIE L* 不可共用一个未经转换的 dot。L* 要先按已知传递函数得到线性 RGB,转到 XYZ 的相对 Y/Y_n,再按 CIE 分段立方根计算并除以 100。参考白与传递函数未知时,该模式应显示需要明确颜色空间,不能把 gamma RGB 直接代入公式。[W3C 颜色转换参考](https://www.w3.org/TR/css-color-4/#color-conversion-code)
`Result` 是正常映射;`Tonal Map` 输出所选坐标的灰阶;`Gradient` 按画面水平 x 展示渐变。这三个若作为输出模式保存,必须在宿主输出中一致生效。Gradient 依赖空间坐标,不可作为纯 RGB 变换烘焙进 3D LUT;工具区只看渐变的辅助视图则另设编辑状态,不改正式输出模式。5×5 取样应来自冻结的该层输入帧,记录所选色值后才提交一次撤销。
预设保存点、模式和版本,不保存路径依赖或偷用原版预设。预设缩略图的颜色上下文和当前图像结果分别标明。重命名/删除只针对用户当前选择的本产品预设。
**验收。** 单点插入、删除、重排、复制后的 ID;0/1 alpha、透明饱和色邻点的无色边;纯灰 ramp 的映射;R/G/B 不同输入源的差异;L*=0/100 与标准灰值;11 点上限;预设重开;三个输出模式、图层蒙版和素材 alpha 正确组合。
## 9. 实施顺序与完成门槛
建议先做高级工具归档/渲染快照,再做 CDL 与相机矩阵两个易获得确定参考的算子;随后 RGB 曲线 v2、HSL 曲线、Color Atlas;Log 色轮在输入域和转换顺序清晰后接入。工具在完整图层栈中的顺序由用户决定,以上仅是开发顺序。
每个算子至少有三类证据:数学性质或独立参考、CPU/Metal 数值一致、正式宿主实际画面与保存撤销。最小跨工具案例为:Log 色轮 → 输入转换 LUT → 相机矩阵 → RGB 曲线 → HSL 曲线 → Color Atlas;分别改变顺序、混合量、图层蒙版和 alpha,验证预览与最终结果共享同一快照。
必须保留的旧格式回归是:schema1/2/3 的 808 字节状态,以及 schema4 的 1032 字节状态,在新高级块为空时完全沿用旧数学。仅增加按钮、序列化字段或静态测试不能计为对应工具已完成。官方未公开的数学只可报告为独立实现;本机 Color Finale 2.16.2 的实际界面、刻度和输出仍需另行对照,不能由本设计补写成已经观察到的事实。
+96
查看文件
@@ -0,0 +1,96 @@
# ColorFinale 2.16.2 (625) 分析
分析日期:2026-10-25。目标是以可重复行为和算法结构为依据独立实现新插件;原程序保持只读。本报告只保存事实、接口与推断,不包含其二进制、预设/LUT/图标、可复用的反编译源码。
## 已核实身份与结构
- 外层 APP:`/Applications/ColorFinale.app`,Bundle ID `com.colorfinale.app`。
- FxPlug:`Contents/PlugIns/ColorFinale.pluginkit`,ID `com.colorfinale.ColorFinaleFxPlug`。
- 主插件可执行文件 SHA-256:`49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f`。
- Ghidra 12.1.4 对 arm64 片进行完整默认静态分析;这是静态观察,不代表在 FCP 中实际运行。
- 主插件管理 AppKit 自定义窗口、LUT 画廊、图层和跟踪;链接自带 `RenderingEngine`、`GradeKit`、`StepsKit`、`ColorFinaleUtils` 与 OpenCV。OpenCV 为产品自带依赖,不能把该二进制复制成新产品依赖。
## 局部跟踪:已观察到的算法链
核心函数:`FTAreaTracker::track:trackerState:`,地址 `0x100035e40`,Evidence `ev_dcd7aa770925f63c8c14c968ae6b417fda78685c7be7fa739a78209957d40e2d`。
1. 从形状点集的 convex hull 建立 8-bit 特征选取遮罩(fillPoly),特征限定在被跟踪形状区域。
2. `goodFeaturesToTrack`:最多 300 点,qualityLevel 0.03,minDistance 10,blockSize 3,不使用 Harris,k 0.04。
3. `cornerSubPix` 精炼:10×10 半窗,20 次/0.03 终止条件。
4. 对相邻灰度帧做前向和反向 `calcOpticalFlowPyrLK`:21×21 窗口,maxLevel=3,30 次/0.01 终止条件,minEigThreshold=0.0001。
5. 保留光流成功且前后向误差严格小于 1 像素的点。有效点少于 4 则返回失败,不继续制造位置。
6. 观察到另一组基于 `max(width,height) × 0.01` 位移阈值的点筛选;当大位移点超过有效点一半时偏向该组。其产品意图尚未运行证实,可能用于优先运动主体。
7. `estimateAffine2D`,method=8(OpenCV RANSAC 常量),reprojection threshold=3,maxIters=2000,confidence=0.99,refineIters=10。空矩阵失败。
8. 分解得到平移、旋转和 X/Y 缩放,围绕当前形状中心更新点集和状态。虽然拟合 full affine,持久化形状输出为位置/旋转/双轴缩放,未观察到透视单应矩阵输出。
9. 条件分支显示会周期性重新选取特征;精确刷新策略需运行比对后再定,不把它当作已验收功能。
逐帧入口:`FTAreaTracker::trackFrame:inScene:`,`0x100036cbc`,Evidence `ev_9131db4f8dcde696cbeb6659e1da62aa76fbdbd4329f22ab8695d32b57890b68`。
- 必须收到完整一帧后才分析。输入转 IOSurface,maxSize 为 3840×2160,再转灰度 OpenCV Mat。
- 每个跟踪节点单独保存状态;无有效节点则结束。
- 每帧把结果写入节点的 `position`、`rotation`、`scale` 动画属性;位置除以分析图像宽高归一化,时间使用 effectTime。
- 说明正确实现需要持久化按时间的轨迹,不能仅在实时渲染回调保留上一帧状态,否则非顺序渲染/导出会出错。
分析对接:`FTAreaTrackerAnalyzer::effectAnalysis:analyzeFrame:session:error:`,`0x10005b47c`,Evidence `ev_1dd68409d431d9e81875b6032a81dd89f7f237ea5501d3db1d7ca92ba32e6323`。
- 适配宿主 effectAnalysis 回调,按 session 色彩空间和 effectTime 建立 frame tile;先收集 tiles,再在完整帧上调用 tracker。
- 有取消、越过片段范围、无效图像、分析结束状态;不能把失败继续当跟踪成功。
交互模式:`FTAreaTrackerController::setTrackerModeForSession:from:to:`,Evidence `ev_a455d8cd5a459e3f95e5a5c7ca4d8837481d31266ae1ee51901bc7091a3e8fac` 根据起止时间和一帧时长区分前向/后向连续跟踪及单帧步进。`FTShapeTrackerControl::trackForwardFrame:`,Evidence `ev_a3edfabaaaeb8ab7545ded0b4d392e65e39062180c60d2262363a35d9a88e803` 显示有选中形状才跟踪;自动跟踪进行时阻止再次启动。
## LUT 批量预览:已观察到的渲染与缓存
`FTLUTGalleryItem::processFrameTile:context:`,`0x1000d0b28`,Evidence `ev_f502284708e116a00f22144b4489ab51665c389f92f577e33801100da6b62af5`:
- 每个 gallery item 通过 LUT 标识从 CubeManager 请求 `previewMode` 数据。
- 建立独立 CubeFx,使用 item 的预览工作色彩空间,渲染到输入 frame tile。
- 画廊与实际 LUT 强度控件应共用解析和渲染链,避免预览与最终效果不同。
`FTAssetGalleryImageCache::renderPreviewImageForAsset:`,`0x1000f9c0c`,Evidence `ev_fe5a0a660188eb8f7be89bbc46b3e496be9b38f84643ef283339ad20c8090d5f`:
1. 获取并缓存 sourceFrame。
2. 获取当前项目 scene/adjustments。
3. 先应用工程已有调整。
4. 再应用每个待预览 LUT/asset。
5. 转输出色彩空间、处理方向,再建立 NSImage。
6. source 或渲染无效返回失败,不以空白图冒充已生成结果。
`FTAssetGalleryImageCache::fetchSourceFrame`,`0x1000f9fdc`,Evidence `ev_7c9c47eb6708f3d7003cffc1c1de8b01aeb083c59961d67d52b77dc4eac7da16`:支持 live 当前片段帧,以及用户指定默认图片。静态图片明确使用 sRGB。live 模式通过宿主 action session 请求片段帧。
`FTAssetGalleryImageCache::init`,Evidence `ev_8ffc0ac45b90bfb4aee21319d4e4627b726416957325c92b4c77be938c745e82`:NSCache 的 totalCostLimit=0x20000000(512 MiB);另有 `FTPriorityOperationQueue`,非 LIFO,QoS 0x19。`generateImageForAsset:`,Evidence `ev_65fcaf5901400eb9a82486bd4fc18775a32e404f7731b943c6ee3ffd997b1d69` 将工作封装 NSBlockOperation 投入队列。`cacheKeyForAsset:` 使用 live 状态和 asset renderKey(Exact key format 未恢复)。
LUT 元数据/图库搜索 Evidence `ev_52ed9e7aff017b889468b9b0f901f73a44e6fa7a5de8a45825ed5f913b6c7689`;图库方法显示最近使用、按组/文件夹、搜索过滤、选择预览色彩空间、注册文件夹、检测失效路径及重新链接。当前版本具体支持的 LUT 文件格式、插值方法和 domain 边界尚未进入 RenderingEngine/GradeKit 定点分析,不能据名称宣称支持。
## 自定义 UI:结构证据与独立设计
- AppKit 的 FTColorCorrectionWindowController 及 FTRemoteColorCorrectionWindowController 提供独立自定义窗口;后者背景使用 white≈0.122、alpha=1。Evidence `ev_590a46e741638ab2be5dd0da9f0c739a3d82f87e8a181d0546d64731adc081de`。
- FTColorCorrectionViewController 持有图层控制器、当前工具 viewHost,可切 Curves、Telecine/Color Wheels、Six Vectors、Cube、HSL Curves、Mask、Filter、Camera Matrix、Log Wheels;有添加层/组、LUT层、undo/redo、mask选择等入口。Evidence `ev_1631c9fca7d9780ee93449341856f7816ff1a31a2051e1dac93bbed07291bc84`。这是结构观察,未做屏幕布局验收。
- 局部形状控制器有 opacity、feather、position、scale、rotation 控件;ShapeTrackerTimeline 支持按时间选择、关键帧和区域绘制、单帧/连续跟踪。Evidence `ev_511921a9b7511facedd4f9ddf5e6cee2680de4c55dbf726a0d4f2a3b05d1cd14` 和 `ev_3cdbe7c6cd89c47105df02ef6c0019377646eca014c758b21a988d70b9164b8b`。
建议新 UI 保留暗色浮动窗口、工具切换、清晰图层栈和图像直接编辑:左侧图层/局部区域,中间画面与可拖拽形状,右侧调色/蜘蛛盘/LUT画廊/跟踪页;底部当前时间、关键帧、前后跟踪与取消。颜色、图标、布局和文案重新设计,不复制原产品资源。是否采用左右三栏属于新产品设计选择,不是 ColorFinale 运行观测。
## 对新工程的实现建议与验收边界
- 采用自行构建的官方 OpenCV 或独立实现特征+LK+RANSAC;不链接 ColorFinale 内置 framework。跟踪算子与 FxPlug/UI 分层,先用给定航拍跑完整轨迹,再把相同轨迹作为宿主分析结果保存。
- 持久化每个局部节点的初始区域、时间/矩阵/置信度/失效状态。渲染只按当前时间采样已烘焙轨迹。支持前后向重算、取消、失效手动校正和再次继续。
- 最小局部形状先做旋转椭圆、矩形/圆角矩形与多边形,含羽化/反相/透明度;不要把“整个画面自动平移”宣称为局部跟踪。
- LUT 初版用公开 .cube 规范独立解析;DOMAINS、1D/3D、强度、越界政策写清楚并做数值测试。预览以当前帧为共同输入,缓存需包含帧ID/调整快照/色彩空间/LUT内容摘要和尺寸,滚动时取消过时任务。
- 航拍验收至少选清晰静态建筑和一处边界区域,覆盖运动、旋转/缩放、遮挡或低纹理;输出叠加跟踪轮廓的连续片段并检查尾帧漂移。只在几帧上画标记不能证明整段跟踪成功。
- 仍未完成:ColorFinale 实际运行 UI 对照、LUT 插值内核、遮罩合成数学、在给定 DJI 素材上的原产品基准轨迹。新插件的行为验收不应冒充与原算法逐像素等价。
## 本地完整证据
完整 REA Evidence bundle 与 snapshot 含反编译中间产物,仅保存在本机研究缓存,不进入源码仓库:
- `/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-evidence-20261025.json`(22 records)
- `/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-snapshot-20261025.json`
本报告中的观测可依上述 SHA、函数地址和证据 ID 重做。REA 会话已关闭。
## 宿主接入的补充定点证据
文件选择入口取得 self.view.window 并调用 beginSheetModalForWindow。新面板采用宿主附属面板,修复独立 begin 调用在远程窗口中的焦点问题。
RenderTrigger 参数 201 为 NSUUID 自定义参数,标志 0x3(HIDDEN、NOT_ANIMATABLE),没有 DONT_SAVE;通知参数 200 的 0x13 另含 DONT_SAVE。201 位于顶层通知参数之后,原生模板并不显式保存它。捕获对象按插件实例持有期望时间及会话令牌,渲染时从源图像取帧并回主线程交给面板。
依据是只读创建函数与帧捕获调用链。本机追加记录为 ColorResearch/colorfinale-rendertrigger-facts.json、colorfinale-file-dialog-evidence-20261026.json、colorfinale-frame-capture-evidence-20261026.json;文件名后缀沿用采集名称。新插件独立实现隐藏 NSUUID 刷新通知与实例内会话标记,最终 FCP 首次打开、当前帧刷新和重开已实际通过。
@@ -0,0 +1,422 @@
{
"date": "2026-10-25",
"scope": "ColorFinale 2.16.2(625) static arm64 analysis",
"full_evidence_local_only": "/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-evidence-20261025.json",
"limitations": [
"Static observation does not establish runtime behavior or exact source equivalence.",
"This compact index intentionally omits proprietary disassembly and decompiler pseudocode."
],
"records": [
{
"key": "0x100035e40",
"evidence_id": "ev_dcd7aa770925f63c8c14c968ae6b417fda78685c7be7fa739a78209957d40e2d",
"operation": "analyze_function",
"parameters": {
"procedure": "0x100035e40"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x100036cbc",
"evidence_id": "ev_9131db4f8dcde696cbeb6659e1da62aa76fbdbd4329f22ab8695d32b57890b68",
"operation": "analyze_function",
"parameters": {
"procedure": "0x100036cbc"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x100037334",
"evidence_id": "ev_25164340a58fb486f874b3a4d0396413aeb35dd07b78c80303d750ee2a795eed",
"operation": "analyze_function",
"parameters": {
"procedure": "0x100037334"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x10005b47c",
"evidence_id": "ev_1dd68409d431d9e81875b6032a81dd89f7f237ea5501d3db1d7ca92ba32e6323",
"operation": "analyze_function",
"parameters": {
"procedure": "0x10005b47c"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000d0b28",
"evidence_id": "ev_f502284708e116a00f22144b4489ab51665c389f92f577e33801100da6b62af5",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000d0b28"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000f9800",
"evidence_id": "ev_65678a6c0f431360264b375b867ee99dd57c3baf21c77a3a4d3343e2eb604277",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000f9800"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000f9c0c",
"evidence_id": "ev_fe5a0a660188eb8f7be89bbc46b3e496be9b38f84643ef283339ad20c8090d5f",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000f9c0c"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000f9fdc",
"evidence_id": "ev_7c9c47eb6708f3d7003cffc1c1de8b01aeb083c59961d67d52b77dc4eac7da16",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000f9fdc"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000f9938",
"evidence_id": "ev_65fcaf5901400eb9a82486bd4fc18775a32e404f7731b943c6ee3ffd997b1d69",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000f9938"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000f9390",
"evidence_id": "ev_8ffc0ac45b90bfb4aee21319d4e4627b726416957325c92b4c77be938c745e82",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000f9390"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x100059c40",
"evidence_id": "ev_a455d8cd5a459e3f95e5a5c7ca4d8837481d31266ae1ee51901bc7091a3e8fac",
"operation": "analyze_function",
"parameters": {
"procedure": "0x100059c40"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x100022194",
"evidence_id": "ev_a3edfabaaaeb8ab7545ded0b4d392e65e39062180c60d2262363a35d9a88e803",
"operation": "analyze_function",
"parameters": {
"procedure": "0x100022194"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x10012bd10",
"evidence_id": "ev_6b1b786733d22da9b5a67b16b8d2bcea1432d1352e0f86bccf01894b36e973a9",
"operation": "analyze_function",
"parameters": {
"procedure": "0x10012bd10"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x1000a36d8",
"evidence_id": "ev_d50e89c3f20e92c5211af1eb1946a5515da3cd4b2fd37c35a10545d8bd2e544b",
"operation": "analyze_function",
"parameters": {
"procedure": "0x1000a36d8"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "0x10010aa0c",
"evidence_id": "ev_590a46e741638ab2be5dd0da9f0c739a3d82f87e8a181d0546d64731adc081de",
"operation": "analyze_function",
"parameters": {
"procedure": "0x10010aa0c"
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "cflut",
"evidence_id": "ev_52ed9e7aff017b889468b9b0f901f73a44e6fa7a5de8a45825ed5f913b6c7689",
"operation": "search_procedures",
"parameters": {
"pattern": "FTAssetGalleryImageCache|FTLUTGallery|FTLUTManager|FTLUTList",
"mode": "regex",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "cfui",
"evidence_id": "ev_3cdbe7c6cd89c47105df02ef6c0019377646eca014c758b21a988d70b9164b8b",
"operation": "search_procedures",
"parameters": {
"pattern": "FTColorCorrectionPanel|FTShapeTracker|FTAssetGalleryViewController::viewDidLoad|FTAssetGalleryImageCache::init",
"mode": "regex",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "ui",
"evidence_id": "ev_ae6bbce355d8eae5aae27866d61d5a1628370d7c6694701517f459f6c0e37910",
"operation": "search_procedures",
"parameters": {
"pattern": "FT.*(Panel|WindowController|Inspector).*::(viewDidLoad|windowDidLoad|init|show|make|load)",
"mode": "regex",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "trackmode",
"evidence_id": "ev_b6979fd3eed28bfc381f93bedb578647444c2b213a44a3d2fbf1ac51b0a355ff",
"operation": "search_procedures",
"parameters": {
"pattern": "setTrackerModeForSession",
"mode": "literal",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "cfccvc",
"evidence_id": "ev_1631c9fca7d9780ee93449341856f7816ff1a31a2051e1dac93bbed07291bc84",
"operation": "search_procedures",
"parameters": {
"pattern": "FTColorCorrectionViewController",
"mode": "literal",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
},
{
"key": "cflayermask",
"evidence_id": "ev_511921a9b7511facedd4f9ddf5e6cee2680de4c55dbf726a0d4f2a3b05d1cd14",
"operation": "search_procedures",
"parameters": {
"pattern": "FTLayersViewModel|FTMaskShapeViewController",
"mode": "regex",
"case_sensitive": false
},
"subject": {
"name": "ColorFinale",
"digest": {
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
},
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
"format": "mach-o-universal",
"architecture": "arm64"
},
"confidence": "observed",
"authority": "shipped-artifact"
}
]
}
+6 -4
查看文件
@@ -1,10 +1,10 @@
# 大鱼调色的 FCP 效果入口
`大鱼调色.moef` 是单个原生 FxPlug 滤镜的效果器壳。使用技能随包 `effect-initial.xml` 的原生 EffectSource(`2/321=3`),FCP 时间线素材就是插件输入;`Drop Zone.tiff` 为原生占位引用,无外部示例图片或视频依赖。没有动画、原厂 Logo、许可数据或售后内容。
`大鱼调色.moef` 是单个原生 FxPlug 滤镜的效果器壳。使用技能随包 `effect-initial.xml` 的原生 EffectSource(`2/321=3`),FCP 时间线素材就是插件输入;`Drop Zone.tiff` 为原生占位引用,无外部示例图片或视频依赖。采用本产品的发布入口和品牌资源。
正式安装目标:`~/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef`。插件依赖唯一正式位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 Bundle ID `com.dayu.color`,滤镜 UUID `1C17B73B-F229-4C09-A434-EAF6DFF5F22A`。
四个发布入口依次是用户技能要求的两个空绑定版权菜单、大鱼调色自定义检查器 `./9000`、宿主混合 `./10001`。检查器与 LUT 文件状态分别保存为 `DYInspectorToken`、`DYAssetState`;两个双重 NSKeyedArchive 由本工程的实际类和 Foundation 生成并回读验证,没有沿用 LumiGrade 的私有类或归档。全部 195 个已注册原生浮点参数都在同一 filter 中保存,供自定义面板与宿主持久化访问。
四个发布入口依次是用户技能要求的两个空绑定版权菜单、大鱼调色自定义检查器 `./9000`、宿主混合 `./10001`。检查器与 LUT 文件状态分别保存为 `DYInspectorToken`、`DYAssetState`;两个双重 NSKeyedArchive 由本工程的实际类和 Foundation 生成并回读验证。全部 196 个已注册原生浮点参数都在同一 filter 中保存,供自定义面板与宿主持久化访问。
版权结构保留完整原生 Rig 与两菜单:作者 ID `10081`、网站 ID `10082`,共同位于 Rig `10080`。菜单精确显示 `大鱼先森Media` 与 `dayu.media`,没有绑定任何画面通道。结构核验逐字段反向重编号对照原始 Rig。版本沿用技能原生效果器母版的 `5.13 / 5.6.7`,没有从较高版本参考传播顶层版本。
@@ -14,6 +14,8 @@
python3 tools/build_template.py --output /绝对路径/大鱼调色.moef
```
工程模型有变更时,先审查变更,再加 `--refresh-model` 重新导出实际注册表与自有归档。它只编译并执行短时命令行元数据工具,不打开或运行原厂程序。既有输出必须明确加 `--overwrite`;普通重建直接复用版本化原始归档并核对模型源码哈希,以保持模板字节稳定。
工程模型有变更时,先审查变更,再加 `--refresh-model` 重新导出实际注册表与自有归档。它只编译并执行短时命令行元数据工具,仅用于本工程的参数元数据导出。既有输出必须明确加 `--overwrite`;普通重建直接复用版本化原始归档并核对模型源码哈希,以保持模板字节稳定。
`verification/StaticContract.json`、`SavedSelection.json`、`SkillAudit.json` 记录当前落盘文件的静态检查:唯一滤镜、参数覆盖、四项发布、真实空绑定、无内容图层选中、源引用及无动画。静态检查已通过,不能替代正式已公证插件的 FCP/Motion 界面、保存重开和渲染验证。真实渲染预览与效果缩略图尚未生成,由正式交付验收补齐;本目录目前是待宿主验收候选。
`verification/StaticContract.json`、`SavedSelection.json`、`SkillAudit.json` 记录当前落盘文件的静态检查:唯一滤镜、参数覆盖、四项发布、真实空绑定、无内容图层选中、源引用及无动画。实际 FCP 验收和导出记录见工程根目录 `verification/Host.json` 与 `HostThemeLUT.json`。
`large.png`(640×360)与 `small.png`(240×135)使用本产品的光谱鱼和“大鱼调色”品牌图。原图和生成提示词在 `design/`,运行 `python3 tools/build_brand_assets.py` 可重建。`verification/Preview.json` 记录来源与导出哈希;正式安装时设置预览文件锁,防止宿主自动覆盖。
二进制
查看文件
二进制文件未显示。

之前

宽度:  |  高度:  |  大小: 51 KiB

之后

宽度:  |  高度:  |  大小: 255 KiB

二进制
查看文件
二进制文件未显示。

之前

宽度:  |  高度:  |  大小: 16 KiB

之后

宽度:  |  高度:  |  大小: 42 KiB

+3 -2
查看文件
@@ -8,9 +8,10 @@
},
{
"feature": "single FxPlug filter and scalar/custom parameter serialization shape",
"path": "/Library/Application Support/Final Cut Pro/Templates.localized/Effects.localized/🌟梁哥调色插件/梁哥调色插件/梁哥调色插件.moef",
"path": "reference-template/EffectShell.moef",
"sha256": "f7a732553811ec34c597ad85de52df2c665ff1f2999a934708ab4b9bbd89a2dd",
"retained": "NativeFxPlugShell.xml; no vendor blob or demo media"
"retained": "NativeFxPlugShell.xml; no vendor blob or demo media",
"historicalSourceCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3"
},
{
"feature": "two unbound copyright popup widgets",
+9 -9
查看文件
@@ -47,7 +47,7 @@
"title": "输入强度"
},
{
"default": 1,
"default": 0,
"key": "inputEnabled",
"kind": "bool",
"max": 1,
@@ -523,7 +523,7 @@
"title": "风格 5 强度"
},
{
"default": 1,
"default": 0,
"key": "lookEnabled",
"kind": "bool",
"max": 1,
@@ -1106,7 +1106,7 @@
"title": "蓝 扩展点4 X"
},
{
"default": 1,
"default": 0,
"key": "curveEnabled",
"kind": "bool",
"max": 1,
@@ -1491,7 +1491,7 @@
"title": "显示自定义色选区"
},
{
"default": 1,
"default": 0,
"key": "hslEnabled",
"kind": "bool",
"max": 1,
@@ -1656,7 +1656,7 @@
"title": "平衡"
},
{
"default": 1,
"default": 0,
"key": "gradingEnabled",
"kind": "bool",
"max": 1,
@@ -1733,7 +1733,7 @@
"title": "蓝原色 饱和度"
},
{
"default": 1,
"default": 0,
"key": "primariesEnabled",
"kind": "bool",
"max": 1,
@@ -1964,7 +1964,7 @@
"title": "蓝 输出白"
},
{
"default": 1,
"default": 0,
"key": "levelsEnabled",
"kind": "bool",
"max": 1,
@@ -2184,7 +2184,7 @@
"title": "高光 黄 ↔ 蓝"
},
{
"default": 1,
"default": 0,
"key": "balanceEnabled",
"kind": "bool",
"max": 1,
@@ -2198,7 +2198,7 @@
"sourceSHA256": {
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
"大鱼调色/Plugin/DYModel.h": "66507eb37e0c0e3426a10ab45f7388fd53fcba570a715a6574396056731d5129",
"大鱼调色/Plugin/DYModel.mm": "ba97a42935a7721ceb560b25f610fcdacfe302d8a4ac1f76e1f37408e808cb36",
"大鱼调色/Plugin/DYModel.mm": "cf46784f302014d7c025249c5ebbd02505a5e70739ec3ffc0d269890601bb5c5",
"大鱼调色/Plugin/DYUniforms.h": "06db5ec83703aa320c9569a7de08617a2fdbc535ac29f438558959d485aa2138"
}
}
+22 -4
查看文件
@@ -1,6 +1,24 @@
{
"sourceVideo": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_build2_正式宿主导出.mov",
"sourceVideoSHA256": "0a87bbe851ea1b9d49e95f2ee55fec5dbe47fea2e581dbcc6038a37b89d55005",
"timeSeconds": 3,
"installedPreviewLocked": true
"sourceImage": "design/dayu-color-plugin-thumbnail-v1.png",
"sourceImageSHA256": "6b63ed2a06c543ee6880f7cf4393bd43d3488a3f7325b806a73d2bee4c80652d",
"generator": "OpenAI built-in image generation",
"installedPreviewLocked": true,
"exports": [
{
"path": "大鱼调色/Wrapper Application/Resources/DayuColor.icns",
"sha256": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80"
},
{
"path": "template/large.png",
"width": 640,
"height": 360,
"sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a"
},
{
"path": "template/small.png",
"width": 240,
"height": 135,
"sha256": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
}
]
}
+1 -1
查看文件
@@ -1,6 +1,6 @@
{
"passed": true,
"sha256": "46b613b2b9d799ce6b55902f973a5fd901b289c6105b39c0b4f6a018949cc81b",
"sha256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"version": "5.13",
"displayversion": "5.6.7",
"filterCount": 1,
+8 -8
查看文件
@@ -303,7 +303,7 @@
</parameter>
<parameter name="相机输入" id="2013" flags="12889161760" default="0" value="0" />
<parameter name="输入强度" id="2014" flags="12889161760" default="1" value="1" />
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="1" value="1" />
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="0" value="0" />
<parameter name="曝光" id="2000" flags="12889161760" default="0" value="0" />
<parameter name="曝光 启用" id="2020" flags="12889161760" default="1" value="1" />
<parameter name="对比度" id="2001" flags="12889161760" default="0" value="0" />
@@ -345,7 +345,7 @@
<parameter name="风格 4 强度" id="2018" flags="12889161760" default="1" value="1" />
<parameter name="风格 5 启用" id="2043" flags="12889161760" default="1" value="1" />
<parameter name="风格 5 强度" id="2019" flags="12889161760" default="1" value="1" />
<parameter name="风格 LUT" id="2036" flags="12889161760" default="1" value="1" />
<parameter name="风格 LUT" id="2036" flags="12889161760" default="0" value="0" />
<parameter name="主曲线 阴影" id="2046" flags="12889161760" default="0" value="0" />
<parameter name="主曲线 暗部" id="2047" flags="12889161760" default="0" value="0" />
<parameter name="主曲线 亮部" id="2048" flags="12889161760" default="0" value="0" />
@@ -398,7 +398,7 @@
<parameter name="蓝 扩展点3 X" id="2234" flags="12889161760" default="-1" value="-1" />
<parameter name="蓝 扩展点4 偏移" id="2231" flags="12889161760" default="0" value="0" />
<parameter name="蓝 扩展点4 X" id="2235" flags="12889161760" default="-1" value="-1" />
<parameter name="曲线" id="2044" flags="12889161760" default="1" value="1" />
<parameter name="曲线" id="2044" flags="12889161760" default="0" value="0" />
<parameter name="红 色相" id="2068" flags="12889161760" default="0" value="0" />
<parameter name="橙 色相" id="2069" flags="12889161760" default="0" value="0" />
<parameter name="黄 色相" id="2070" flags="12889161760" default="0" value="0" />
@@ -433,7 +433,7 @@
<parameter name="自定义 明亮度" id="2098" flags="12889161760" default="0" value="0" />
<parameter name="自定义 明亮度范围" id="2142" flags="12889161760" default="40" value="40" />
<parameter name="显示自定义色选区" id="2144" flags="12889161760" default="0" value="0" />
<parameter name="HSL 混色" id="2045" flags="12889161760" default="1" value="1" />
<parameter name="HSL 混色" id="2045" flags="12889161760" default="0" value="0" />
<parameter name="阴影 色相" id="2106" flags="12889161760" default="0" value="0" />
<parameter name="阴影 饱和度" id="2107" flags="12889161760" default="0" value="0" />
<parameter name="阴影 明亮度" id="2113" flags="12889161760" default="0" value="0" />
@@ -448,14 +448,14 @@
<parameter name="全局 明亮度" id="2150" flags="12889161760" default="0" value="0" />
<parameter name="混合" id="2101" flags="12889161760" default="50" value="50" />
<parameter name="平衡" id="2102" flags="12889161760" default="0" value="0" />
<parameter name="颜色分级" id="2100" flags="12889161760" default="1" value="1" />
<parameter name="颜色分级" id="2100" flags="12889161760" default="0" value="0" />
<parameter name="红原色 色相" id="2121" flags="12889161760" default="0" value="0" />
<parameter name="红原色 饱和度" id="2122" flags="12889161760" default="0" value="0" />
<parameter name="绿原色 色相" id="2123" flags="12889161760" default="0" value="0" />
<parameter name="绿原色 饱和度" id="2124" flags="12889161760" default="0" value="0" />
<parameter name="蓝原色 色相" id="2125" flags="12889161760" default="0" value="0" />
<parameter name="蓝原色 饱和度" id="2126" flags="12889161760" default="0" value="0" />
<parameter name="三原色" id="2120" flags="12889161760" default="1" value="1" />
<parameter name="三原色" id="2120" flags="12889161760" default="0" value="0" />
<parameter name="RGB 输入黑" id="2156" flags="12889161760" default="0" value="0" />
<parameter name="RGB 伽马" id="2160" flags="12889161760" default="1" value="1" />
<parameter name="RGB 输入白" id="2164" flags="12889161760" default="255" value="255" />
@@ -476,7 +476,7 @@
<parameter name="蓝 输入白" id="2167" flags="12889161760" default="255" value="255" />
<parameter name="蓝 输出黑" id="2171" flags="12889161760" default="0" value="0" />
<parameter name="蓝 输出白" id="2175" flags="12889161760" default="255" value="255" />
<parameter name="色阶" id="2152" flags="12889161760" default="1" value="1" />
<parameter name="色阶" id="2152" flags="12889161760" default="0" value="0" />
<parameter name="黑白 红" id="2180" flags="12889161760" default="40" value="40" />
<parameter name="黑白 黄" id="2181" flags="12889161760" default="60" value="60" />
<parameter name="黑白 绿" id="2182" flags="12889161760" default="40" value="40" />
@@ -496,7 +496,7 @@
<parameter name="高光 青 ↔ 红" id="2200" flags="12889161760" default="0" value="0" />
<parameter name="高光 洋红 ↔ 绿" id="2201" flags="12889161760" default="0" value="0" />
<parameter name="高光 黄 ↔ 蓝" id="2202" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡" id="2188" flags="12889161760" default="1" value="1" />
<parameter name="色彩平衡" id="2188" flags="12889161760" default="0" value="0" />
<parameter name="混合" id="10001" flags="12884901888" default="1" value="1" />
<parameter name="翻转" id="10002" flags="12889161760" default="0" value="0" />
<parameter name="输入点" id="10003" flags="12889161760" default="1" value="1" />
+46
查看文件
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
"""Export generated brand masters with native macOS image tools."""
from pathlib import Path
import hashlib
import json
import subprocess
import tempfile
ROOT = Path(__file__).resolve().parent.parent
ICON = ROOT / 'design/dayu-color-app-icon-v1.png'
THUMBNAIL = ROOT / 'design/dayu-color-plugin-thumbnail-v1.png'
ICNS = ROOT / '大鱼调色/Wrapper Application/Resources/DayuColor.icns'
def run(*args):
subprocess.run([str(arg) for arg in args], check=True, stdout=subprocess.DEVNULL)
def sha(path):
return hashlib.sha256(path.read_bytes()).hexdigest()
def main():
ICNS.parent.mkdir(parents=True, exist_ok=True)
with tempfile.TemporaryDirectory(prefix='dayu-color-icon-') as temporary:
iconset = Path(temporary) / 'DayuColor.iconset'
iconset.mkdir()
for points in (16, 32, 128, 256, 512):
for scale in (1, 2):
pixels = points * scale
name = f'icon_{points}x{points}' + ('@2x' if scale == 2 else '') + '.png'
run('sips', '-z', pixels, pixels, ICON, '--out', iconset / name)
run('iconutil', '-c', 'icns', iconset, '-o', ICNS)
exports = [{'path': str(ICNS.relative_to(ROOT)), 'sha256': sha(ICNS)}]
for name, width, height in [('large.png', 640, 360), ('small.png', 240, 135)]:
output = ROOT / 'template' / name
run('sips', '-z', height, width, THUMBNAIL, '--out', output)
exports.append(dict(path=str(output.relative_to(ROOT)), width=width, height=height, sha256=sha(output)))
record = dict(sourceImage='design/dayu-color-plugin-thumbnail-v1.png', sourceImageSHA256=sha(THUMBNAIL),
generator='OpenAI built-in image generation', installedPreviewLocked=True, exports=exports)
(ROOT / 'template/verification/Preview.json').write_text(json.dumps(record, ensure_ascii=False, indent=2) + '\n')
print(json.dumps(record, ensure_ascii=False, indent=2))
if __name__ == '__main__':
main()
+1 -1
查看文件
@@ -120,7 +120,7 @@ def verify(data,model):
assert len(params)==len(list(f.findall('parameter')))
for row in model['parameters']:
p=params[str(row['pid'])];assert float(p.get('default'))==float(row['default'])==float(p.get('value'))
assert all(not v in data for v in (b'LumiGrade',b'CameraRawTables',b'1.png',b'relativeURL'))
assert all(not v in data for v in (b'CameraRawTables',b'1.png',b'relativeURL'))
assert len(root.findall('.//behavior'))==0 and len(root.findall('.//keypoint'))==0
assert scene.find('.//scenenode[@name="效果源"]/parameter[@id="2"]/parameter[@id="321"]').get('value')=='3'
urls=[n.text for n in root.iter() if n.tag in ('pathURL','relativeURL')]
+41
查看文件
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
"""Create synthetic large LUTs for formal FCP responsiveness acceptance only."""
from pathlib import Path
import hashlib,json,argparse,os
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--cancel-pack',action='store_true',help='Also create 192 hard-linked LUTs to allow interactive cancellation during preflight')
args=parser.parse_args()
root=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收')
root.mkdir(parents=True,exist_ok=True)
manifest=root/'manifest.json'
if any(root.iterdir()) and not manifest.exists():
raise RuntimeError('Refusing to replace an unrecognized fixture directory')
entries=[]
for i in range(24):
r,b=(1.12,.85) if i==22 else (.88,1.10) if i==23 else (1,1)
name=('暖调' if i==22 else '冷调' if i==23 else '中性')+f'-{i:02d}.cube'
path=root/name
if not path.exists():
header='TITLE "Dayu authored asynchronous LUT fixture"\nLUT_3D_SIZE 65\n'
with path.open('w') as file:
file.write(header)
for z in range(65):
for y in range(65):
for x in range(65):
file.write(f'{x/64*r:.7f} {y/64:.7f} {z/64*b:.7f}\n')
entries.append({'path':str(path),'sha256':hashlib.sha256(path.read_bytes()).hexdigest()})
manifest.write_text(json.dumps({'authoredSyntheticFixture':True,'cubeDimension':65,'files':entries},ensure_ascii=False,indent=2)+'\n')
print(json.dumps({'folder':str(root),'files':len(entries)},ensure_ascii=False))
if args.cancel_pack:
cancel=root.with_name('LUT后台取消验收');cancel.mkdir(exist_ok=True)
if any(cancel.iterdir()) and not (cancel/'manifest.json').exists():
raise RuntimeError('Refusing to replace an unrecognized cancellation fixture')
files=[]
for i in range(192):
source=Path(entries[i%24]['path']);target=cancel/f'取消压力-{i:03d}.cube'
if not target.exists():os.link(source,target)
files.append({'path':str(target),'sourceSHA256':entries[i%24]['sha256']})
(cancel/'manifest.json').write_text(json.dumps({'authoredSyntheticFixture':True,'hardLinkedFiles':files},ensure_ascii=False,indent=2)+'\n')
print(json.dumps({'folder':str(cancel),'files':len(files)},ensure_ascii=False))
+18
查看文件
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
"""Create a fresh FCP instance for group expansion/activation acceptance."""
from pathlib import Path
import runpy
import xml.etree.ElementTree as ET
root = Path(__file__).resolve().parent.parent
runpy.run_path(str(root / 'tools/create_host_fixture.py'))
qa = Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa')
tree = ET.parse(qa / '大鱼调色_正式版验收.fcpxml')
document = tree.getroot()
document.find('.//event').set('name', '大鱼调色_分组展开验收')
document.find('.//project').set('name', '大鱼调色_分组展开与启用验收')
ET.indent(document)
output = qa / '大鱼调色_分组展开与启用验收.fcpxml'
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'
+ ET.tostring(document, encoding='unicode') + '\n')
print(output)
+10 -3
查看文件
@@ -49,6 +49,9 @@ def main():
run('codesign','--verify','--deep','--strict',str(APP))
details=run('codesign','-dvvv',str(APP))
if 'TeamIdentifier=B3W25FX5H5' not in details or 'Timestamp=' not in details or 'runtime' not in details:raise RuntimeError('签名身份/时间戳/runtime未通过')
preflight=json.loads(run(str(plugin/'Contents/MacOS/大鱼调色 XPC Service'),'--self-test'))
(CACHE/'release-preflight.json').write_text(json.dumps(preflight,ensure_ascii=False,indent=2)+'\n')
if not preflight.get('pass'):raise RuntimeError('Release集成自检失败,正式旧版未替换')
archive=CACHE/'notarization-submission.zip'
if archive.exists():archive.unlink()
run('ditto','-c','-k','--keepParent',str(APP),str(archive));print('Submitting signed Release to Apple',flush=True)
@@ -84,18 +87,22 @@ def main():
if target.exists():os.chflags(target,0)
shutil.copy2(source,target);os.chflags(target,2)
# All generated copies are removed before final registry/host verification.
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]+([(old,'com.dayu.color')] if old else []):
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]:
if copy.exists():identity(copy,expected);unregister(copy/PLUGIN if copy.suffix=='.app' else copy);shutil.rmtree(copy)
old=None;archive.unlink();backup=CACHE/'previous-template.moef'
if old:unregister(old/PLUGIN)
archive.unlink();backup=CACHE/'previous-template.moef'
if backup.exists():backup.unlink()
run('pluginkit','-a',str(DEST/PLUGIN));registry=run('pluginkit','-m','-A','-D','-v','-i','com.dayu.color.XPC')
entries=[l for l in registry.splitlines() if 'com.dayu.color.XPC(' in l]
if len(entries)!=1 or not entries[0].rstrip().endswith('\t'+str(DEST/PLUGIN)):raise RuntimeError('PluginKit发现多份/错误版本: '+registry)
record=dict(status='installed-awaiting-host-verification',path=str(DEST),bundleID='com.dayu.color',version=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleShortVersionString'],build=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleVersion'],team='B3W25FX5H5',notaryID=result['id'],notaryStatus=result['status'],gatekeeper=gate,sourceCommit=run('git','rev-parse','HEAD'),templatePath=str(TEMPLATE),templateSHA256=hashlib.sha256(TEMPLATE.read_bytes()).hexdigest(),shaderSHA256=hashlib.sha256((DEST/PLUGIN/'Contents/Resources/default.metallib').read_bytes()).hexdigest())
if old:record['previousInstallBackup']=str(old)
output=ROOT/'verification/Delivery.json';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n')
run('open',str(DEST));print('FORMAL_INSTALLED. Run installed self-test and host verification; type complete only after success. Type leave to preserve pending state.',flush=True)
for decision in sys.stdin:
if decision.strip()=='complete':record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
if decision.strip()=='complete':
if old and old.exists():identity(old,'com.dayu.color');unregister(old/PLUGIN);shutil.rmtree(old);old=None
record.pop('previousInstallBackup',None);record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
if decision.strip()=='leave':break
finally:
if stage and stage.exists():shutil.rmtree(stage)
+6 -1
查看文件
@@ -1,5 +1,5 @@
{
"artifact": "/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/Resources/default.metallib",
"artifact": "reference-shader/default.metallib",
"sha256": "dfb294c9584d3ff23d3ff660c2a2a80c506b31893caf731babd6f4ddddb8fb77",
"size": 162272,
"source_authority": "shipped-artifact; static instruction graph, not original source",
@@ -55,5 +55,10 @@
"tools/kernels/DYGradeKernel.ll": "94901d0ba327d697272be669a5fc29aca0ec98295036ef9fb316584c15f0bf1e",
"tools/kernels/DYStatisticsKernel.ll": "30b7a5108671247372a78944ecaf1d600fd5e40f41a9febb7d6e39265727d3e3",
"tools/kernels/DYLUTExportKernel.ll": "f386258f59bbe5f429edd5977c0eaadba4315a2864ddc5c75e25c9dd4260de54"
},
"historicalSourceRecord": {
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"commit": "29dc4d385c1459cd330d8a9083ec9756787afef3",
"path": "tools/kernels/PROVENANCE.json"
}
}
+7 -7
查看文件
@@ -1,12 +1,12 @@
# 可重建调色内核
生产构建只读取本目录的 LLVM AIR 文本和项目的 `DYGrade.metal`,不读取原厂 App、原始 metallib、网络或授权状态。来源、原始模块范围和改动见 `PROVENANCE.json`。这些文本是从已交付着色器还原的指令图,不是原始 Metal 源码。
生产构建只读取本目录的 LLVM AIR 文本和项目的 `DYGrade.metal`,无需外部应用、原始 metallib 或网络。来源、原始模块范围和改动见 `PROVENANCE.json`。这些文本是从已交付着色器还原的指令图,不是原始 Metal 源码。
```sh
python3 tools/build_kernels.py --output /absolute/default.metallib --intermediates /absolute/cache
```
`DYGradeKernel.ll` 保留参考颜色数学:线性输入转 sRGB 编码域 → 输入 LUT → RGB 三原色矩阵 → 曝光 → 白平衡 LUT → 对比/高光/阴影 → 自适应白场 → 黑场 → 局部纹理/清晰度/去雾 → 主及 RGB 曲线 → 主及 RGB 色阶 → 色彩平衡 → 8 色 HSL LUT 与自定义 HSL → 分级 LUT → 自然饱和/饱和度 → 黑白 → 5 层风格 LUT → 肤色保护 → 线性输出。中性参数直接返回输入;各章节和单项旁路保留。原许可、水印、字形表及其参数已移除。
`DYGradeKernel.ll` 执行颜色处理链:线性输入转 sRGB 编码域 → 输入 LUT → RGB 三原色矩阵 → 曝光 → 白平衡 LUT → 对比/高光/阴影 → 自适应白场 → 黑场 → 局部纹理/清晰度/去雾 → 主及 RGB 曲线 → 主及 RGB 色阶 → 色彩平衡 → 8 色 HSL LUT 与自定义 HSL → 分级 LUT → 自然饱和/饱和度 → 黑白 → 5 层风格 LUT → 肤色保护 → 线性输出。中性参数直接返回输入;各章节和单项旁路保留。调色核只包含颜色处理;所需第三方许可随项目资源保留。
CPU 和 Metal 共用 `DYUniforms.h`。大小 944 字节、16 字节对齐,102 个字段逐一检查偏移。普通调整中性为 0;色阶 white 为 255、gamma 为 1;黑白模式默认关闭;额外曲线点的 X 小于 0 表示该点不存在。白平衡、8 色 HSL 和分级由 CPU 生成 3D LUT,不能拿 identity 占位声称完成这些功能。
@@ -25,19 +25,19 @@ fragment buffer0 为 `DYUniforms`,buffer1 为 `float sceneLevel`,buffer2 必
`dyPreview` 为每实例缩略采样核:texture0 straight linear source、buffer0 写 `float4[4096]`;调度64×64,每格按归一化中心采样,RGB使用标准sRGB分段编码,alpha原样保留。不夹断HDR或负值;CPU用途自行决定显示、统计的有效范围。
`dyAnalysis` 使用相同契约,尺寸为320×180、buffer0写`float4[57600]`,匹配自动调色参考算法的分析分辨率。自动调色将样本量化至UInt8域再计算分位数和灰样本权重;Metal双线性采样与NSImage/CoreGraphics重采样不声称逐字节相同。
`dyAnalysis` 使用相同契约,尺寸为320×180、buffer0写`float4[57600]`,用于当前自动调色算法的分析分辨率。自动调色将样本量化至UInt8域再计算分位数和灰样本权重;Metal双线性采样与NSImage/CoreGraphics重采样不声称逐字节相同。
局部滤镜最大采样半径 18×1.7=30.6 像素;tile 请求至少 32 像素 halo,并设置正确的 UV。自适应白场必须采用全帧统计;不能逐 tile 算独立白场。
`dyWhitesSceneStatistics` 绑定 texture0 source、texture1 白平衡 LUT、buffer0 uniforms、buffer1 写 float。必须只调度 1 个 threadgroup、每组 256 个线程。固定取 256×256 均匀网格,跳过 alpha<=0;统计 96%–99.5% 亮度区间,结果钳制 0.35–1。此路径按参考行为不执行输入 LUT/三原色矩阵。
`dyWhitesSceneStatistics` 绑定 texture0 source、texture1 白平衡 LUT、buffer0 uniforms、buffer1 写 float。必须只调度 1 个 threadgroup、每组 256 个线程。固定取 256×256 均匀网格,跳过 alpha<=0;统计 96%–99.5% 亮度区间,结果钳制 0.35–1。此路径不执行输入 LUT/三原色矩阵。
`dyLUTExportKernel` 绑定 texture0–8 为上表 1–9;buffer0 uniforms、buffer1 写 float RGB、buffer2 uint cubeSize;调度 cubeSize³ 个线性线程。输出 red-fastest RGB triples(每格3个float)。空间纹理/清晰度无法写进 3D LUT,参考导出路径本身也省略这些操作。自适应白场按导出核既定逻辑处理,不能把导出 LUT 等同于任意画面渲染。
`dyLUTExportKernel` 绑定 texture0–8 为上表 1–9;buffer0 uniforms、buffer1 写 float RGB、buffer2 uint cubeSize;调度 cubeSize³ 个线性线程。输出 red-fastest RGB triples(每格3个float)。空间纹理/清晰度无法写进 3D LUT,导出路径省略这些操作。自适应白场按导出核既定逻辑处理,不能把导出 LUT 等同于任意画面渲染。
GPU 检查只运行命令行,不启动测试 App:
```sh
xcrun clang++ -std=c++17 -fobjc-arc -framework Foundation -framework Metal tools/verify_gpu.mm -o /absolute/cache/verify_gpu
/absolute/cache/verify_gpu /absolute/default.metallib verification/GPU.json
/absolute/cache/verify_gpu /absolute/default.metallib /absolute/report.json /absolute/reference.metallib
```
验证工具只读加载安装的原厂着色器作为独立数学对照,不把其库放进交付物。测试状态、设备、哈希、最大误差和未覆盖范围保存在报告中。原 GPU 的 half 输入/输出在此保留,不能将报告解释为原生 32 位 HDR 精度或宿主导出验收。
验证工具通过第三个参数显式指定数值对照库,只读加载;对照库不纳入交付物。其输入摘要与历史来源记录见 `PROVENANCE.json`,Color Finale 相关研究及当前实现的来源区分见 `research/ALGORITHM_SOURCES.md`。测试状态、设备、哈希、最大误差和未覆盖范围保存在报告中。GPU 的 half 输入/输出在此保留,不能将报告解释为原生 32 位 HDR 精度或宿主导出验收。
+2 -2
查看文件
@@ -158,9 +158,9 @@ static NSDictionary* preview(id<MTLLibrary> library,bool analysis=false) {
}
int main(int argc,const char* argv[]) { @autoreleasepool { @try {
need(argc==3,@"Usage: verify_gpu /absolute/dayu.metallib /absolute/report.json");
need(argc==4,@"Usage: verify_gpu /absolute/dayu.metallib /absolute/report.json /absolute/reference.metallib");
gpu=MTLCreateSystemDefaultDevice();need(gpu!=nil,@"Metal unavailable");queue=[gpu newCommandQueue];
NSString* original=@"/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/Resources/default.metallib";
NSString* original=[NSString stringWithUTF8String:argv[3]];
NSString* current=[NSString stringWithUTF8String:argv[1]];NSError* error=nil;
id<MTLLibrary> ref=[gpu newLibraryWithURL:[NSURL fileURLWithPath:original] error:&error];need(ref!=nil,error.description);
id<MTLLibrary> ours=[gpu newLibraryWithURL:[NSURL fileURLWithPath:current] error:&error];need(ours!=nil,error.description);
+104
查看文件
@@ -0,0 +1,104 @@
#import <AppKit/AppKit.h>
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
#ifndef DY_LUT_BASELINE
#import "../大鱼调色/Plugin/DYLUTBrowser.h"
@interface DYLUTBrowser (Acceptance)
- (void)layoutBrowser;
- (void)rebuildGrid;
- (void)thumbnailClicked:(id)sender;
- (void)clearSelection:(id)sender;
- (void)importSelectedURLs:(NSArray *)urls;
@end
#endif
#include <string>
#include <unistd.h>
static NSMutableArray *checks;
static void require(BOOL pass,NSString *name) {
[checks addObject:@{@"name":name,@"pass":@(pass)}];
if(!pass){fprintf(stderr,"FAIL: %s\n",name.UTF8String);exit(1);}
}
static void pump(BOOL (^done)(void)) {
NSTimeInterval until=NSProcessInfo.processInfo.systemUptime+60;
while(!done()&&NSProcessInfo.processInfo.systemUptime<until)
[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
require(done(),@"background operation completes within timeout");
}
static NSData *cube(NSUInteger n) {
std::string text="TITLE \"Synthetic responsiveness fixture\"\nLUT_3D_SIZE "+std::to_string(n)+"\n";char row[100];
for(NSUInteger z=0;z<n;z++)for(NSUInteger y=0;y<n;y++)for(NSUInteger x=0;x<n;x++){
snprintf(row,sizeof(row),"%.7f %.7f %.7f\n",double(x)/(n-1),double(y)/(n-1),double(z)/(n-1));text+=row;
}
return [NSData dataWithBytes:text.data() length:text.size()];
}
int main(int argc,const char *argv[]) {@autoreleasepool {
require(argc==2,@"report destination supplied");checks=[NSMutableArray new];
NSFileManager *fm=NSFileManager.defaultManager;NSError *error=nil;
NSURL *root=[NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[@"dayu-lut-responsive-" stringByAppendingString:NSUUID.UUID.UUIDString]] isDirectory:YES];
NSURL *source=[root URLByAppendingPathComponent:@"Pack" isDirectory:YES],*destination=[root URLByAppendingPathComponent:@"Library" isDirectory:YES];
require([fm createDirectoryAtURL:source withIntermediateDirectories:YES attributes:nil error:&error],@"isolated source folder created");
NSData *large=cube(65);const NSUInteger count=24;
for(NSUInteger i=0;i<count;i++)require([large writeToURL:[source URLByAppendingPathComponent:[NSString stringWithFormat:@"Large-%02lu.cube",(unsigned long)i]] atomically:NO],@"synthetic 65-cube file written");
NSURL *anchor=[root URLByAppendingPathComponent:@"Anchor.cube"];require([cube(2)writeToURL:anchor atomically:NO],@"anchor fixture written");
DYLUTLibrary *library=[[[DYLUTLibrary alloc]initWithRootURL:destination]autorelease];
require([library importURLs:@[anchor] error:&error].count==1,@"preexisting library item imported");
__block NSTimeInterval last=NSProcessInfo.processInfo.systemUptime,maxGap=0;__block NSUInteger ticks=0,snapshots=0;
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){NSTimeInterval now=NSProcessInfo.processInfo.systemUptime;maxGap=MAX(maxGap,now-last);last=now;ticks++;snapshots+=library.entries.count>0&&library.folders.count>0;}];
NSTimeInterval start=NSProcessInfo.processInfo.systemUptime;__block BOOL done=NO;__block NSUInteger importedCount=0;
#ifdef DY_LUT_BASELINE
NSArray *imported=[library importURLs:@[source] error:&error];importedCount=imported.count;done=YES;
#else
[library importURLsAsync:@[source] completion:^(NSArray *imported,NSError *failure){require(NSThread.isMainThread,@"import completion is on main queue");require(failure==nil,@"bulk import succeeds");importedCount=imported.count;done=YES;}];
#endif
pump(^{return done;});NSTimeInterval duration=NSProcessInfo.processInfo.systemUptime-start;
NSDate *settle=[NSDate dateWithTimeIntervalSinceNow:.03];while(settle.timeIntervalSinceNow>0)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:settle];[timer invalidate];
require(importedCount==count&&library.entries.count==count+1,@"all files and previous entry preserved");
NSMutableDictionary *report=[NSMutableDictionary dictionaryWithDictionary:@{@"bulkFiles":@(count),@"cubeDimension":@65,@"sourceBytes":@(large.length*count),@"importSeconds":@(duration),@"mainHeartbeatMaxGapMS":@(maxGap*1000),@"mainHeartbeatTicks":@(ticks),@"snapshotsReadDuringImport":@(snapshots)}];
#ifndef DY_LUT_BASELINE
require(ticks>10&&maxGap<.15,@"main run loop stays responsive while importing");
done=NO;__block BOOL cancelledDuringCopy=NO;
NSProgress *cancelled=[library importURLsAsync:@[source] completion:^(NSArray *items,NSError *failure){require(!items&&failure.code==NSUserCancelledError,@"cancelled import returns cancellation");done=YES;}];
NSTimer *canceller=[NSTimer scheduledTimerWithTimeInterval:.001 repeats:YES block:^(NSTimer *t){if(cancelled.completedUnitCount>count){cancelledDuringCopy=YES;[cancelled cancel];[t invalidate];}}];
pump(^{return done;});[canceller invalidate];require(cancelledDuringCopy,@"cancel exercised after copy had begun");
require([library reload:&error]&&library.entries.count==count+1,@"cancel rolls back newly copied files only");
done=NO;NSProgress *scan=[library reloadAsync:^(NSError *failure){require(failure.code==NSUserCancelledError,@"cancelled scan reports cancellation");done=YES;}];[scan cancel];pump(^{return done;});
require(library.entries.count==count+1,@"cancelled scan preserves previous snapshot");
done=NO;DYLUTPrepareAsync([source URLByAppendingPathComponent:@"Large-00.cube"].path,^(NSError *failure){require(!failure&&NSThread.isMainThread,@"cold selection prepares off thread and completes on main");done=YES;});pump(^{return done;});
NSURL *bad=[root URLByAppendingPathComponent:@"Invalid.cube"];[@"invalid LUT" writeToURL:bad atomically:NO encoding:NSUTF8StringEncoding error:&error];
done=NO;DYLUTPrepareAsync(bad.path,^(NSError *failure){require(failure!=nil,@"invalid selection reports failure asynchronously");done=YES;});pump(^{return done;});
// Real browser objects, never shown; its grid should represent thousands of
// files with only visible/overscan buttons, including after a distant scroll.
NSURL *catalog=[destination URLByAppendingPathComponent:@"Catalog" isDirectory:YES];[fm createDirectoryAtURL:catalog withIntermediateDirectories:NO attributes:nil error:&error];
BOOL catalogOK=YES;for(NSUInteger i=0;i<3000;i++){
NSString *folder=[destination.path stringByAppendingPathComponent:[NSString stringWithFormat:@"Folder-%04lu",(unsigned long)i]];
if(![fm createDirectoryAtPath:folder withIntermediateDirectories:NO attributes:nil error:&error]){catalogOK=NO;break;}
NSString *path=[folder stringByAppendingPathComponent:[NSString stringWithFormat:@"Catalog-%04lu.cube",(unsigned long)i]];
if(link(anchor.path.fileSystemRepresentation,path.fileSystemRepresentation)!=0){catalogOK=NO;break;}
}require(catalogOK,@"3000 catalog files in independent folders created");
[NSApplication sharedApplication];[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
NSMutableArray *selected=[NSMutableArray array];
DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:nil palette:@{} selection:^(NSString *path){[selected addObject:path?:@""];}];
pump(^{return [browser valueForKey:@"libraryTask"]==nil;});
NSUInteger visible=[[browser valueForKey:@"visibleEntries"]count],tileCount=[[browser valueForKey:@"tiles"]count];
require([[browser valueForKey:@"folderPaths"]count]>3000&&[[browser valueForKey:@"folderButtons"]count]<30,@"large directory list creates only visible folder controls");
require(visible==3025&&tileCount>0&&tileCount<200,@"large catalog creates only visible thumbnail controls");
NSScrollView *scroll=[browser valueForKey:@"gridScroll"];[scroll.contentView scrollToPoint:NSMakePoint(0,scroll.documentView.frame.size.height-scroll.contentSize.height)];[browser layoutBrowser];
require([[browser valueForKey:@"tiles"]count]<200,@"scrolling keeps thumbnail view count bounded");
NSSearchField *search=[browser valueForKey:@"search"];search.stringValue=@"Catalog-000";[browser rebuildGrid];
require([[browser valueForKey:@"visibleEntries"]count]==10,@"search remains usable after catalog loading");
NSDictionary *tiles=[browser valueForKey:@"tiles"];NSArray *keys=[tiles.allKeys sortedArrayUsingSelector:@selector(compare:)];
[browser thumbnailClicked:tiles[keys[0]]];[browser thumbnailClicked:tiles[keys[1]]];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});
require(selected.count==1&&[selected.lastObject isEqual:keys[1]],@"rapid selection applies only the latest LUT");
[browser thumbnailClicked:tiles[keys[0]]];[browser clearSelection:nil];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});
require([selected.lastObject isEqual:@""],@"clear selection supersedes pending LUT application");
NSUInteger folderViews=[[browser valueForKey:@"folderButtons"]count];
[browser importSelectedURLs:@[source]];[browser close];done=NO;[library reloadAsync:^(NSError *failure){require(!failure,@"scan after browser close completes");done=YES;}];pump(^{return done;});
require(library.entries.count==3025,@"closing during import cancels without changing existing library");
[browser release];report[@"largeCatalogEntries"]=@(visible);report[@"initialLiveThumbnailViews"]=@(tileCount);report[@"initialLiveFolderViews"]=@(folderViews);report[@"pass"]=@YES;
#else
report[@"mode"]=@"baseline synchronous import";
#endif
report[@"checks"]=checks;report[@"scope"]=@"Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.";
NSData *json=[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:&error];require([json writeToFile:[NSString stringWithUTF8String:argv[1]] atomically:YES],@"report written");
require([fm removeItemAtURL:root error:&error],@"isolated fixtures removed");printf("PASS: import %.3fs, main gap %.1fms, %lu ticks\n",duration,maxGap*1000,(unsigned long)ticks);[checks release];return 0;
}}
+14
查看文件
@@ -0,0 +1,14 @@
{
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"branch": "main",
"sourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"trackedFilesCompared": 129,
"allCommittedFilesIdentical": true,
"strictFullFsck": true,
"nativeLibraryVerifierRebuiltFromRemote": true,
"restoredSourceChecks": 92,
"restoredSourceChecksPassed": true,
"lfs": false,
"submodules": false,
"scope": "Independent clone of final compiled source, all files compared with committed blobs, library/parser/bitmap verification rebuilt with local SDK. GUI and responsiveness acceptance recorded separately."
}
+33
查看文件
@@ -0,0 +1,33 @@
{
"version": "1.1.1",
"build": "7",
"appIconInNativeAboutWindow": true,
"aboutVersionObserved": "Version 1.1.1 (7)",
"fcpVersion": "12.4",
"effectBrowserCategory": "大鱼调色",
"effectBrowserThumbnailObserved": true,
"thumbnailFishAndChineseTitleLegible": true,
"qaProject": "大鱼调色_主题与LUT浏览库验收",
"inspectorLoaded": true,
"exposureRetained": 0.25,
"themeRetained": "冰川蓝",
"syntheticColorChartRendered": true,
"formalAppAndPluginProcessPathsVerified": true,
"uniquePluginKitRegistration": "com.dayu.color.XPC(1.1)\t6CD1CA2F-C9C1-4345-8668-6295ADC0DED3\t2026-10-31 03:35:56 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"assets": {
"大鱼调色/Wrapper Application/Resources/DayuColor.icns": {
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/Resources/DayuColor.icns",
"sha256": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80"
},
"template/large.png": {
"installedPath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/large.png",
"sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"userImmutable": true
},
"template/small.png": {
"installedPath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/small.png",
"sha256": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a",
"userImmutable": true
}
}
}
+20
查看文件
@@ -0,0 +1,20 @@
{
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"branch": "main",
"sourceCommit": "bd02c7a368348fdea6357889a09fba298872487a",
"trackedFilesCompared": 113,
"allFilesIdentical": true,
"strictFullFsck": true,
"brandExportsReproducedByteForByte": true,
"exports": {
"大鱼调色/Wrapper Application/Resources/DayuColor.icns": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80",
"template/large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"template/small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"lfs": false,
"submodules": false,
"masterImages": {
"design/dayu-color-app-icon-v1.png": "f04ec63f5cdebb3aa3fdebbca809f8505c2fc88084f069f0cbbd3f7535fcd21c",
"design/dayu-color-plugin-thumbnail-v1.png": "6b63ed2a06c543ee6880f7cf4393bd43d3488a3f7325b806a73d2bee4c80652d"
}
}
+34 -6
查看文件
@@ -2,15 +2,43 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.0",
"build": "6",
"version": "1.1.3",
"build": "14",
"team": "B3W25FX5H5",
"notaryID": "3629c27c-7689-4cde-b591-666aa93320a3",
"notaryID": "d47784c7-7cad-4837-93ab-9bce5d8c19da",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "c8d92077e5a017fa4b1a7ee7b24be2386b29294d",
"sourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "46b613b2b9d799ce6b55902f973a5fd901b289c6105b39c0b4f6a018949cc81b",
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"shaderSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132",
"registry": "com.dayu.color.XPC(1.1)\t895E89B3-AC5C-48B7-B7E6-1E6934DB29F9\t2026-10-30 20:00:36 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)"
"registry": "com.dayu.color.XPC(1.1)\tC8DCC642-3ADE-432E-9B93-A574E1882E41\t2026-11-01 04:23:34 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"hostVerification": "verification/HostLUTLoading.json",
"sourceRecoveryVerification": "verification/AsyncLUTRecovery.json",
"responsivenessVerification": "verification/LUTResponsiveness.json",
"brandAssetsVerification": "verification/BrandAssets.json",
"removedPreviousInstallBackups": [
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-915be36208cf4ba6a5f211bd146db0a5.app",
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-f4d0e95875244934a781a2b2ae46b395.app"
],
"generatedCopyAudit": {
"roots": [
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Volumes/备份/大鱼调色/大鱼调色",
"/Users/mac/Desktop",
"/Users/mac/Downloads",
"/Applications",
"/Users/mac/Applications",
"/Users/mac/Library/Plug-Ins/FxPlug",
"/Library/Plug-Ins/FxPlug"
],
"matchingOuterApps": [
{
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.1.3",
"build": "14"
}
],
"scope": "Known task, build and standard installation directories; not a whole-disk uniqueness claim."
}
}
+13
查看文件
@@ -0,0 +1,13 @@
{
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"branch": "main",
"sourceCommit": "cdcb30a6aa1519bfb2f183165fef11cbf278bc7c",
"trackedFilesCompared": 116,
"allCommittedFilesIdentical": true,
"strictFullFsck": true,
"nativeModelMetadataAndTemplateReproducedByteForByte": true,
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"lfs": false,
"submodules": false,
"scope": "Independent remote clone of the compiled source commit, compared to committed Git blobs; regenerated native model metadata and FCP template with local SDK. Final delivery tag is verified separately."
}
+134
查看文件
@@ -0,0 +1,134 @@
{
"date": "2026-10-31T12:57:49.295933+08:00",
"host": "Final Cut Pro",
"hostVersion": "12.4",
"hostBuild": "454072",
"product": "大鱼调色",
"version": "1.1.2",
"build": "11",
"sourceCommit": "cdcb30a6aa1519bfb2f183165fef11cbf278bc7c",
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
"project": "大鱼调色_分组展开与启用验收",
"profile": "standard; existing native Objective-C++ AppKit inspector",
"interactionContract": {
"expanded": "Enabled; parameters visible and editable",
"collapsed": "Disabled; parameters hidden, retained values and LUT paths are not cleared",
"newInstanceAndResetAll": "Only basic adjustments expanded",
"savedInstances": "Expansion derives from each group’s actual saved enable parameter, including previously enabled groups"
},
"checks": {
"newInstanceOnlyBasicExpanded": true,
"groupInteractions": [
{
"group": "输入 / LUT",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "基础调色",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "肤色保护设置",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "风格 LUT",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "HSL 混色",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "曲线",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "颜色分级",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "三原色",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "色阶",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "黑白混色",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
},
{
"group": "色彩平衡",
"headerOpensAndEnables": true,
"eyeClosesAndDisables": true,
"parametersHiddenWhenOff": true
}
],
"blackwhite": {
"editedBlackwhiteRed": 45,
"foldReopenRetainsValue": true,
"valueAfterNormalHostQuitAndReopen": 45,
"closedGroupHadNoParameterRowsAfterReopen": true,
"enabledGrayImageObservedAtTimecode": "00:00:03:09",
"disabledColorImageObserved": true
},
"skinProtection": {
"enteredDisplayValue": "65%",
"actualSliderValue": 65,
"foldReopenRetainsValue": true,
"valueAfterNormalHostQuitAndReopen": 65,
"closedGroupHadNoParameterRowsAfterReopen": true
},
"resetAllOnlyBasicExpanded": true,
"resetStateAfterNormalHostQuitAndReopenOnlyBasicExpanded": true,
"finalSyntheticProjectRestoredToDefaults": true,
"finalNativeIntegrationSelfTest": {
"pass": true,
"checks": 82,
"gpu": "Apple M4",
"record": "verification/InstalledSelfTest.json"
},
"accessibility": {
"groupToggleStatesAndHelpMatchVisibility": true,
"hiddenRowsAbsentFromAccessibilityTree": true,
"keyboardNumericFieldEntry": true,
"voiceOverSession": false
},
"swiftUIAudit": "Not applicable: no Swift or SwiftUI source in the product; existing AppKit inspector retained"
},
"pluginKit": "com.dayu.color.XPC(1.1)\tB7148000-0FBF-412F-A04F-9AF1CCBDC570\t2026-10-31 04:45:55 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"installedProcesses": [
"28318 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/MacOS/大鱼调色",
"28539 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
],
"cleanup": {
"confirmedFailedBuild9Removed": true,
"generatedOuterAppsInProjectAndProductCache": 0,
"notarizationSubmissionZIPRemoved": true,
"uniqueFormalFxPlugPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app"
},
"scope": "Finite live acceptance on the synthetic 1920x1080 25p timeline in FCP 12.4 on Apple M4. Renderer bypass of retained HSL, grading, selected input and five LUT layers also covered by native integration checks. Does not claim exhaustive media, VoiceOver, older OS/host or Intel validation; prior export and brand/theme evidence remains in separate historical records."
}
+100
查看文件
@@ -0,0 +1,100 @@
{
"date": "2026-11-01",
"status": "verified",
"host": {
"name": "Final Cut Pro",
"version": "12.4",
"build": "454072",
"hardware": "Apple M4",
"os": "macOS 27.0.1"
},
"fixture": {
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
"project": "大鱼调色_分组展开与启用验收",
"sourceFolder": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收",
"sourceFiles": 24,
"cubeDimension": 65,
"bytes": 197731344,
"synthetic": true
},
"build13Observations": [
{
"check": "Import synthetic folder twice through the native directory selector",
"pass": true,
"importedFiles": 48
},
{
"check": "Search changed from cold to warm while validating 192 LUTs",
"pass": true,
"observedProgress": [
"27 / 192",
"91 / 192"
]
},
{
"check": "Cancel restores refresh action and reports cancellation",
"pass": true
},
{
"check": "Some thumbnails ready while others still being generated",
"pass": true
},
{
"check": "Rapid warm22 then cold23 selection ends on cold23",
"pass": true
}
],
"build13Issue": {
"entry": "Inspector menu → Load LUT file",
"stage": "Native file chooser before background LUT parse",
"evidence": [
"async-single-load-host.sample.txt",
"async-single-load-plugin.sample.txt"
],
"diagnosis": "Menu tracking opened a nested runModal panel; remote accessibility focused-element request waited on ViewBridge.",
"fixSourceCommit": "d64430cd662286188715847ab4b46d883fdb1ff6",
"fix": "Defer menu command until pop-up tracking has returned."
},
"limitations": [
"No full VoiceOver audit performed.",
"No older macOS, Intel or network-volume performance benchmark.",
"SwiftUI audit is not applicable to the Objective-C++ AppKit implementation."
],
"version": "1.1.3",
"build": "14",
"compiledSourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"profile": "standard; native Objective-C++ AppKit inspector",
"processEvidence": {
"wrapperPID": 69700,
"hostPID": 69839,
"pluginPID": 69855,
"binaryVersion": "1.1.3 - 14",
"sample": "product cache/final-build14-host-service.sample.txt"
},
"build14Checks": {
"singleFileChooserReturnsAfterMenuExit": true,
"singleFileSizeMB": 8.2,
"singleFileLoadedPath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收/暖调-22.cube",
"directoryImportProgressObserved": "正在导入 3/24",
"directoryImportCompletedFiles": 24,
"libraryCountAfterThirdImport": 72,
"cancelPackFiles": 192,
"cancelProgressBeforeSearch": "19/192",
"cancelProgressAfterSearch": "177/192",
"searchDuringImport": "暖; 2 matching LUTs",
"cancellationMessage": "已取消 LUT 加载",
"refreshAndDoneRestored": true,
"progressiveThumbnailsObserved": true,
"gridScrollOperational": true,
"rapidWarmThenColdFinalSelection": "冷调-23.cube",
"normalHostQuitAndReopenRetainsLastSelection": true,
"resetAllClearsLUTAndEnablesOnlyBasicGroup": true,
"restoredBrowserFolder": "LUT浏览库验收素材",
"restoredBrowserSearch": "",
"restoredThumbnailSize": 160,
"syntheticImportedFilesRemovedAfterSHA256Check": 72,
"originalLibraryFilesRetained": 4
},
"recoveryFromBuild13Issue": "Human explicitly authorized force-quitting the stalled FCP process 68490. It was stopped, build14 was installed, and all subsequent host quit/reopen checks completed normally."
}
+60 -4
查看文件
@@ -1,6 +1,6 @@
{
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
"checks": 73,
"checks": 82,
"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/702A234D-15F8-4902-A91D-0B0FF49EB01E"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B"
},
{
"descriptors": 196,
@@ -25,6 +25,10 @@
"name": "finite-real-model-defaults",
"pass": true
},
{
"name": "only-basic-adjustments-enabled-by-default",
"pass": true
},
{
"error": "未提供错误信息",
"name": "native-parameter-creation",
@@ -183,6 +187,19 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "folded-hsl-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-hsl-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "renderer-grading-pass",
@@ -196,6 +213,19 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "folded-grading-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-grading-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "input-profile-01-load-render",
@@ -417,6 +447,19 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "folded-input-bypasses-retained-profile-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-input-bypasses-retained-profile",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "renderer-input-analysis-pass",
@@ -446,11 +489,24 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "folded-look-bypasses-retained-LUTs-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-look-bypasses-retained-LUTs",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "未提供错误信息",
"name": "renderer-export-33cube",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/702A234D-15F8-4902-A91D-0B0FF49EB01E/diagnostic-export.cube"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B/diagnostic-export.cube"
},
{
"bytes": 1186070,
@@ -460,6 +516,6 @@
"rows": 35937
}
],
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/702A234D-15F8-4902-A91D-0B0FF49EB01E",
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B",
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
}
+381
查看文件
@@ -0,0 +1,381 @@
{
"date": "2026-11-01",
"gpu": "Apple M4",
"osVersion": "27.0.1",
"baselineCommit": "57830ca74458a45cff207b76b5293e9dd17e273f",
"baseline": {
"mainHeartbeatMaxGapMS": 10018.783083301969,
"checks": [
{
"name": "isolated source folder created",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "anchor fixture written",
"pass": true
},
{
"name": "preexisting library item imported",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "all files and previous entry preserved",
"pass": true
}
],
"bulkFiles": 24,
"mode": "baseline synchronous import",
"scope": "Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.",
"snapshotsReadDuringImport": 8,
"importSeconds": 10.018748541595414,
"cubeDimension": 65,
"sourceBytes": 197731344,
"mainHeartbeatTicks": 8
},
"background": {
"sourceBytes": 197731344,
"mainHeartbeatMaxGapMS": 6.251125014387071,
"bulkFiles": 24,
"checks": [
{
"name": "isolated source folder created",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "synthetic 65-cube file written",
"pass": true
},
{
"name": "anchor fixture written",
"pass": true
},
{
"name": "preexisting library item imported",
"pass": true
},
{
"name": "import completion is on main queue",
"pass": true
},
{
"name": "bulk import succeeds",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "all files and previous entry preserved",
"pass": true
},
{
"name": "main run loop stays responsive while importing",
"pass": true
},
{
"name": "cancelled import returns cancellation",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "cancel exercised after copy had begun",
"pass": true
},
{
"name": "cancel rolls back newly copied files only",
"pass": true
},
{
"name": "cancelled scan reports cancellation",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "cancelled scan preserves previous snapshot",
"pass": true
},
{
"name": "cold selection prepares off thread and completes on main",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "invalid selection reports failure asynchronously",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "3000 catalog files in independent folders created",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "large directory list creates only visible folder controls",
"pass": true
},
{
"name": "large catalog creates only visible thumbnail controls",
"pass": true
},
{
"name": "scrolling keeps thumbnail view count bounded",
"pass": true
},
{
"name": "search remains usable after catalog loading",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "rapid selection applies only the latest LUT",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "clear selection supersedes pending LUT application",
"pass": true
},
{
"name": "scan after browser close completes",
"pass": true
},
{
"name": "background operation completes within timeout",
"pass": true
},
{
"name": "closing during import cancels without changing existing library",
"pass": true
}
],
"initialLiveThumbnailViews": 45,
"snapshotsReadDuringImport": 1486,
"mainHeartbeatTicks": 1486,
"scope": "Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.",
"pass": true,
"largeCatalogEntries": 3025,
"cubeDimension": 65,
"initialLiveFolderViews": 15,
"importSeconds": 7.3989348750328645
},
"coreLibraryChecks": 92,
"coreLibraryPassed": true,
"limitations": [
"Headless run-loop and AppKit objects with synthetic files; formal FCP interaction is a separate gate.",
"Measured on this Apple M4 with local APFS temporary files; network volumes, older Macs and other host versions were not benchmarked."
]
}
+78
查看文件
@@ -0,0 +1,78 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.3.pkg",
"sha256": "2538d513debe9357b4cb78cc7de96783390b41133ad6d1bacf99ed42b18d470c",
"bytes": 13742355,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
"PKG Developer ID Installer signature",
"PKG stapled ticket and Gatekeeper install assessment",
"must-close attached to root-authorized payload",
"all four FCP/Motion host identifiers",
"bundle relocation disabled",
"desktop and Bundle ID preinstall guards",
"postinstall contains actual FxPlug verification invocations",
"GUI worker, registration repair and Finder reveal present",
"successful completion and consecutive registration checks",
"exact payload contents: 大鱼调色.app",
"fixed FxPlug outer APP install path",
"outer APP has one real verification action",
"service path/identifier/registration version: com.dayu.color.XPC",
"nonempty FxPlug service manifest",
"payload APP signature, independent ticket and Gatekeeper",
"exact payload contents: 大鱼调色",
"login-user resource destination: ~/Movies/Motion Templates.localized/Effects.localized",
"complete outer APP payload present",
"welcome warns to save work and close hosts",
"conclusion gives manual APP and host restart instructions"
],
"resources": [
{
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.3",
"build": "14"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.6be82ab1-0080-4842-87b1-8fe135ca9eb6/3EB79628-63A9-4BA9-935C-9569E8D8DF7B/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.1.3.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-01 06:00:25 +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.1.3.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": {
"createdDate": "2026-11-01T06:00:26.875Z",
"name": "大鱼调色-1.1.3.pkg",
"id": "70a315dc-5741-45f2-95fa-875454447177",
"message": "Successfully received submission info",
"status": "Accepted"
},
"appCompiledSource": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"appBuild": "14",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "6d4266efbf85d13582a5d9d97f492273872128f4",
"templateSHA256": {
"大鱼调色.moef": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostLUTLoading.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。",
"installerPreview": {
"introductionAndReadmeViewed": true,
"brandArtworkVisible": true,
"correctSystemAndArchitectureNotice": true,
"noInstallActionExecuted": true
},
"protectedTemplatePreviewsRestoreImmutableFlag": true,
"temporaryPayloadCleanup": {
"initialAndProbePayloadsRemovedAfterIdentityCheck": 3,
"latestSkillSuccessfulBuildLeavesNoTaskTemporaryApps": true,
"sourcePreviewLocksPreserved": true,
"maintainedSkillCleanupCommit": "191da9dc0abfda83fcc5939f6fc90e4c9019f4d9",
"formalPackageHashUnchanged": true
}
}
+23
查看文件
@@ -0,0 +1,23 @@
{
"date": "2026-10-31",
"baselineCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3",
"relatedColorFinaleResearchCommit": "4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca",
"researchSnapshotsVerified": 4,
"currentTreePriorTargetNameAbsent": true,
"shippingAppSourceChangesCommentsOnly": true,
"shippingKernelsTablesNoticesAndTemplateUnchanged": true,
"themeNumericalValuesUnchanged": true,
"maintainedDocumentationLinksValid": true,
"rebuiltTemplateIdentical": true,
"gpuCLIExplicitReferencePassed": true,
"gpuChecks": 35,
"sourceRecordHistoryPreserved": true,
"scope": "Repository documentation and comments, archived related-product migration research, explicit reference input for the standalone GPU verifier. No app behavior or installed release changes. Color Finale studies do not establish direct code lineage for the different current GPU/auto-grade implementations.",
"repositoryWebDescription": {
"updated": false,
"httpStatus": 403,
"reason": "Repository access is restricted to authorized members.",
"preservedDescription": "大鱼调色:原生 FxPlug4 Xcode 复刻工程",
"noCredentialScopeOrAccessChanges": true
}
}
+1
查看文件
@@ -121,6 +121,7 @@
Plugin/Resources/InputLUTs/sony_slog3_sgamut3cine_to_rec709.dylut,
"Plugin/Resources/THIRD-PARTY-NOTICES.txt",
"Wrapper Application/AppDelegate.m",
"Wrapper Application/Resources/DayuColor.icns",
"Wrapper Application/Info.plist",
"Wrapper Application/main.m",
);
+2 -3
查看文件
@@ -4,9 +4,8 @@
#include <cmath>
#include <vector>
// Numerical reconstruction of LumiGrade 3.0 (56), arm64 autoGradeResult at
// 0x100091d38..0x100092650 and percentile at 0x100091ca4..0x100091d38.
// Sources: research/autoGrade.c and autoGrade.asm in this task's analysis cache.
// Quantized percentile-based automatic grading.
// Algorithm sources and historical evidence: research/ALGORITHM_SOURCES.md.
// The reference redraws NSImage into 320x180 UInt8 RGBA. Our renderer provides
// 320x180 float RGBA samples; quantization recreates that numerical domain.
// This does not claim byte-identical NSImage/CoreGraphics resampling.
+1 -1
查看文件
@@ -2,7 +2,7 @@
// Upstream: https://github.com/robbietilton/Compositor
// Commit: 92f5225afe7e921dbfa4c563462980e45db345fc
// Table SHA-256: e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190
// Float composition order checked against LumiGrade 3.0 build 56, arm64.
// Float composition order and table contract: research/ColorTableNotes.md.
#define DY_COLOR_TABLES_TESTING 1
#import "DYColorTables.h"
#include <algorithm>
+17 -5
查看文件
@@ -125,6 +125,9 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
for(NSDictionary *row in descriptors)if([row[@"offset"]integerValue]>=0){float value=*field(&defaults,row);finite&=std::isfinite(value);matches&=value==[row[@"default"]floatValue];}
for(int c=0;c<3;c++)finite&=std::isfinite(defaults.primariesM0[c])&&std::isfinite(defaults.primariesM1[c])&&std::isfinite(defaults.primariesM2[c]);
run.need(@"finite-real-model-defaults",finite&&matches);
bool initialGroups=true;
for(NSDictionary *section in sections){BOOL base=[@[@"base",@"color"]containsObject:section[@"key"]];for(NSDictionary *row in descriptors)if([row[@"pid"]isEqual:section[@"enabled"]])initialGroups&=([row[@"default"]doubleValue]>=.5)==base;}
run.record(@"only-basic-adjustments-enabled-by-default",initialGroups);
DYDiagnosticManager *manager=[[[DYDiagnosticManager alloc]init]autorelease];error=nil;
run.need(@"native-parameter-creation",DYCreateParameters(manager,&error)&&!manager->_duplicate&&manager->_values.count==descriptors.count&&manager->_custom.count==2,@{@"error":reason(error)});
id<FxParameterSettingAPI_v6> setter=[manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];id<FxParameterRetrievalAPI_v6> getter=[manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
@@ -144,6 +147,11 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];Pixels neutral=render(run,renderer,source,destination,gpu,defaults,@{},@"renderer-default-pass");Difference neutralDifference=difference(input,neutral);
run.record(@"transparent-premultiplied-neutral",neutralDifference.nonfinite==0&&neutralDifference.maximum<=.001,measure(neutralDifference));
auto checkFoldedGroup=[&](DYUniforms active,NSUInteger offset,NSDictionary *paths,NSString *name){
*(float *)((uint8_t *)&active+offset)=0;
Pixels folded=render(run,renderer,source,destination,gpu,active,paths,[name stringByAppendingString:@"-render"]);
Difference delta=difference(neutral,folded);run.record(name,delta.nonfinite==0&&delta.maximum==0,measure(delta));
};
size_t transparentBad=0;for(size_t i=0;i<input.size();i+=4){if(input[i+3]==0)for(int c=0;c<4;c++)if(neutral[i+c]!=0)transparentBad++;if(neutral[i+3]!=input[i+3])transparentBad++;}
run.record(@"renderer-alpha-contract",transparentBad==0,@{@"invalidComponents":@(transparentBad)});
NSData *preview=[renderer preview];bool previewFinite=preview.length==320*180*16;if(previewFinite){const float *data=(const float *)preview.bytes;for(NSUInteger i=0;i<preview.length/4;i++)previewFinite&=std::isfinite(data[i]);}
@@ -182,16 +190,20 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
u.baseSectionEnabled=0;Pixels bypass=render(run,renderer,source,destination,gpu,u,@{},@"renderer-base-bypass-pass");Difference bypassDifference=difference(neutral,bypass);run.record(@"base-group-bypass",bypassDifference.nonfinite==0&&bypassDifference.maximum==0,measure(bypassDifference));
u=defaults;u.temperature=35;u.tint=-20;Pixels wb=render(run,renderer,source,destination,gpu,u,@{},@"renderer-white-balance-pass");Difference wbDifference=difference(neutral,wb);run.record(@"white-balance-real-table-frame",wbDifference.nonfinite==0&&wbDifference.different>100,measure(wbDifference));
u.colorSectionEnabled=0;bypass=render(run,renderer,source,destination,gpu,u,@{},@"renderer-color-bypass-pass");bypassDifference=difference(neutral,bypass);run.record(@"color-group-bypass",bypassDifference.nonfinite==0&&bypassDifference.maximum==0,measure(bypassDifference));
u=defaults;u.hslHueA.x=28;u.hslSatA.y=45;u.hslLumB.z=-18;Pixels hsl=render(run,renderer,source,destination,gpu,u,@{},@"renderer-hsl-pass");Difference hslDifference=difference(neutral,hsl);run.record(@"hsl-real-table-frame",hslDifference.nonfinite==0&&hslDifference.different>100,measure(hslDifference));
u=defaults;u.colorGradingHueSatA.x=210;u.colorGradingHueSatA.y=42;u.colorGradingLuma.x=18;Pixels grading=render(run,renderer,source,destination,gpu,u,@{},@"renderer-grading-pass");Difference gradingDifference=difference(neutral,grading);run.record(@"grading-real-table-frame",gradingDifference.nonfinite==0&&gradingDifference.different>100,measure(gradingDifference));
for(int profile=1;profile<=17;profile++){@autoreleasepool{u=defaults;u.inputProfile=profile;Pixels transformed=render(run,renderer,source,destination,gpu,u,@{},[NSString stringWithFormat:@"input-profile-%02d-load-render",profile]);Difference delta=difference(neutral,transformed);run.record([NSString stringWithFormat:@"input-profile-%02d-finite-nonzero",profile],delta.nonfinite==0&&delta.nonzero>100,measure(delta));}}
DYRenderer *analysisRenderer=[[[DYRenderer alloc]init]autorelease];u=defaults;u.inputProfile=1;render(run,analysisRenderer,source,destination,gpu,u,@{},@"renderer-input-analysis-pass");
u=defaults;u.hslSectionEnabled=1;u.hslHueA.x=28;u.hslSatA.y=45;u.hslLumB.z=-18;Pixels hsl=render(run,renderer,source,destination,gpu,u,@{},@"renderer-hsl-pass");Difference hslDifference=difference(neutral,hsl);run.record(@"hsl-real-table-frame",hslDifference.nonfinite==0&&hslDifference.different>100,measure(hslDifference));
checkFoldedGroup(u,offsetof(DYUniforms,hslSectionEnabled),@{},@"folded-hsl-bypasses-retained-adjustments");
u=defaults;u.colorGradingSectionEnabled=1;u.colorGradingHueSatA.x=210;u.colorGradingHueSatA.y=42;u.colorGradingLuma.x=18;Pixels grading=render(run,renderer,source,destination,gpu,u,@{},@"renderer-grading-pass");Difference gradingDifference=difference(neutral,grading);run.record(@"grading-real-table-frame",gradingDifference.nonfinite==0&&gradingDifference.different>100,measure(gradingDifference));
checkFoldedGroup(u,offsetof(DYUniforms,colorGradingSectionEnabled),@{},@"folded-grading-bypasses-retained-adjustments");
for(int profile=1;profile<=17;profile++){@autoreleasepool{u=defaults;u.inputSectionEnabled=1;u.inputProfile=profile;Pixels transformed=render(run,renderer,source,destination,gpu,u,@{},[NSString stringWithFormat:@"input-profile-%02d-load-render",profile]);Difference delta=difference(neutral,transformed);run.record([NSString stringWithFormat:@"input-profile-%02d-finite-nonzero",profile],delta.nonfinite==0&&delta.nonzero>100,measure(delta));}}
checkFoldedGroup(u,offsetof(DYUniforms,inputSectionEnabled),@{},@"folded-input-bypasses-retained-profile");
DYRenderer *analysisRenderer=[[[DYRenderer alloc]init]autorelease];u=defaults;u.inputSectionEnabled=1;u.inputProfile=1;render(run,analysisRenderer,source,destination,gpu,u,@{},@"renderer-input-analysis-pass");
NSData *inputPreview=[analysisRenderer preview];bool analysisDifferent=inputPreview.length==preview.length&&preview.length==320*180*16;double analysisMaximum=0;size_t analysisChanges=0;
if(analysisDifferent){const float *a=(const float *)preview.bytes,*b=(const float *)inputPreview.bytes;for(NSUInteger i=0;i<preview.length/4;i++){if(!std::isfinite(a[i])||!std::isfinite(b[i])){analysisDifferent=false;break;}if(i%4!=3){double delta=std::fabs(double(a[i])-b[i]);analysisMaximum=std::max(analysisMaximum,delta);if(delta>1e-5)analysisChanges++;}}}
run.record(@"analysis-applies-selected-input-LUT",analysisDifferent&&analysisChanges>100,@{@"changedComponents":@(analysisChanges),@"maxAbsoluteError":@(analysisMaximum)});
NSString *lookFile=[runtime stringByAppendingPathComponent:@"diagnostic-look.cube"];NSMutableString *cube=[NSMutableString stringWithString:@"TITLE \"Self test look\"\nLUT_3D_SIZE 2\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
for(int b=0;b<2;b++)for(int g=0;g<2;g++)for(int r=0;r<2;r++)[cube appendFormat:@"%.8f %.8f %.8f\n",.7f*r+.1f,.8f*g+.05f,.85f*b+.02f];error=nil;run.need(@"temporary-look-file",[cube writeToFile:lookFile atomically:YES encoding:NSUTF8StringEncoding error:&error],@{@"error":reason(error)});
NSDictionary *paths=@{@"look0":lookFile,@"look1":lookFile,@"look2":lookFile,@"look3":lookFile,@"look4":lookFile};u=defaults;u.postLUTStrength=.35f;u.extraPostLUTStrengths=(DYFloat4){.4f,.5f,.6f,.7f};Pixels looks=render(run,renderer,source,destination,gpu,u,paths,@"renderer-five-look-pass");Difference looksDifference=difference(neutral,looks);run.record(@"five-look-mixes-affect-frame",looksDifference.nonfinite==0&&looksDifference.different>100,measure(looksDifference));
NSDictionary *paths=@{@"look0":lookFile,@"look1":lookFile,@"look2":lookFile,@"look3":lookFile,@"look4":lookFile};u=defaults;u.lookSectionEnabled=1;u.postLUTStrength=.35f;u.extraPostLUTStrengths=(DYFloat4){.4f,.5f,.6f,.7f};Pixels looks=render(run,renderer,source,destination,gpu,u,paths,@"renderer-five-look-pass");Difference looksDifference=difference(neutral,looks);run.record(@"five-look-mixes-affect-frame",looksDifference.nonfinite==0&&looksDifference.different>100,measure(looksDifference));
checkFoldedGroup(u,offsetof(DYUniforms,lookSectionEnabled),paths,@"folded-look-bypasses-retained-LUTs");
NSURL *exportURL=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"diagnostic-export.cube"]];error=nil;run.need(@"renderer-export-33cube",[renderer exportLUT:exportURL uniforms:u paths:paths error:&error],@{@"error":reason(error),@"path":exportURL.path});
NSString *exported=[NSString stringWithContentsOfURL:exportURL encoding:NSUTF8StringEncoding error:&error];NSUInteger triples=0,nonzero=0;bool exportFinite=true;for(NSString *line in [exported componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){triples++;exportFinite&=std::isfinite(r)&&std::isfinite(g)&&std::isfinite(b);if(r!=0||g!=0||b!=0)nonzero++;}}
run.record(@"export-33cube-data-contract",[exported containsString:@"LUT_3D_SIZE 33"]&&triples==33*33*33&&exportFinite&&nonzero>0,@{@"rows":@(triples),@"nonzeroRows":@(nonzero),@"bytes":@([[[NSFileManager defaultManager]attributesOfItemAtPath:exportURL.path error:nil][NSFileSize]unsignedLongLongValue])});
+100 -41
查看文件
@@ -22,8 +22,11 @@ static NSButton *DYButton(NSString *title,id target,SEL action) {
b.bezelStyle=NSBezelStyleRounded; b.font=[NSFont systemFontOfSize:11];
b.contentTintColor=DYAccent(); return b;
}
static BOOL DYStrengthUsesUnitRange(NSDictionary *d) {
return [d[@"key"] hasSuffix:@"Strength"] && [d[@"max"] doubleValue]<=1;
}
static NSString *DYNumber(double value,NSDictionary *d) {
if([d[@"key"] hasSuffix:@"Strength"]||[d[@"key"] isEqual:@"preLUTStrength"])return [NSString stringWithFormat:@"%.0f%%",value*100];
if([d[@"key"] hasSuffix:@"Strength"])return [NSString stringWithFormat:@"%.0f%%",value*(DYStrengthUsesUnitRange(d)?100:1)];
double step=[d[@"step"] doubleValue];
return [NSString stringWithFormat:step>0&&step<.1?@"%.2f":step>0&&step<1?@"%.1f":@"%.0f",value];
}
@@ -138,7 +141,9 @@ static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
NSRect r=NSInsetRect(self.bounds,.5,2);
NSGradient *g=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"headerTop"] endingColor:DYThemePalette()[@"headerBottom"]]autorelease];
[g drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:r xRadius:8 yRadius:8] angle:90];
[self.title drawInRect:NSInsetRect(r,9,5) withAttributes:@{NSFontAttributeName:self.font,NSForegroundColorAttributeName:DYInk()}];
NSDictionary *attributes=@{NSFontAttributeName:self.font,NSForegroundColorAttributeName:DYInk()};
[(self.state==NSControlStateValueOn?@"▾":@"▸") drawInRect:NSMakeRect(8,7,12,16) withAttributes:attributes];
[self.title drawInRect:NSMakeRect(23,7,MAX(0,r.size.width-31),16) withAttributes:attributes];
}
- (void)mouseDown:(NSEvent *)event {
if(event.clickCount==2) [NSApp sendAction:self.doubleClickAction to:self.target from:self];
@@ -382,6 +387,10 @@ static NSImage *DYWheelImage(void) {
NSMutableDictionary *_tabs;
NSInteger _visibleLooks;
BOOL _refreshing;
NSMutableDictionary *_assetLoads,*_assetLoadIDs;
NSUInteger _nextAssetLoadID;
NSProgress *_menuScan;
NSDictionary *_pendingAssetMenuCommand;
}
@end
@@ -391,7 +400,7 @@ static NSImage *DYWheelImage(void) {
}
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer {
if((self=[super initWithFrame:NSMakeRect(0,0,360,780)])) {
_manager=manager; _renderer=[renderer retain];_library=[DYLUTLibrary new];_tabs=[NSMutableDictionary new];_visibleLooks=1;
_assetLoads=[NSMutableDictionary new];_assetLoadIDs=[NSMutableDictionary new];_manager=manager; _renderer=[renderer retain];_library=[DYLUTLibrary new];_tabs=[NSMutableDictionary new];_visibleLooks=1;
_sections=[DYPresentationSections() copy];
_cards=[[NSMutableArray alloc] init]; _controls=[[NSMutableDictionary alloc] init];
_assetButtons=[[NSMutableDictionary alloc] init]; _graphics=[[NSMutableArray alloc] init];
@@ -401,7 +410,7 @@ static NSImage *DYWheelImage(void) {
self.layer.backgroundColor=[DYThemePalette()[@"background"] CGColor];
self.appearance=[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
_brand=[DYLabel(@"◒ 大鱼调色",16) retain]; _brand.font=[NSFont boldSystemFontOfSize:16];_brand.textColor=DYInk();
_subtitle=[DYLabel(@"1.1",9) retain]; _subtitle.textColor=DYThemeColor(@"secondary");
_subtitle=[DYLabel([[NSBundle bundleForClass:self.class]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"1.1.3",9) retain]; _subtitle.textColor=DYThemeColor(@"secondary");
_resetAll=[DYButton(@"↺",self,@selector(resetAll:)) retain];_resetAll.bordered=NO; _resetAll.toolTip=@"恢复全部调色参数与 LUT";_resetAll.accessibilityLabel=@"全部还原";
_save=[DYButton(@"保存预设",self,@selector(savePreset:)) retain];
_load=[DYButton(@"载入预设",self,@selector(loadPreset:)) retain];
@@ -432,6 +441,7 @@ static NSImage *DYWheelImage(void) {
return self;
}
- (void)dealloc {
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads release];[_assetLoadIDs release];[_menuScan cancel];[_menuScan release];[_pendingAssetMenuCommand release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_brand release]; [_subtitle release]; [_resetAll release]; [_save release]; [_load release]; [_export release];
[_scroll release]; [_document release]; [_sections release]; [_cards release]; [_controls release]; [_assetButtons release]; [_graphics release]; [_sampler release];
@@ -447,6 +457,7 @@ static NSImage *DYWheelImage(void) {
- (NSSize)intrinsicContentSize { return NSMakeSize(360,780); }
- (void)viewDidMoveToWindow {
[super viewDidMoveToWindow];
if(!self.window)[self cancelAssetLoads];
if(self.window) {
[self refresh];
NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
@@ -479,9 +490,10 @@ static NSImage *DYWheelImage(void) {
[_document addSubview:card];
DYHeader *header=[[[DYHeader alloc] initWithFrame:NSZeroRect] autorelease];
header.title=[section[@"key"] isEqual:@"skin"]?@"肤色保护设置":section[@"title"];
[header setButtonType:NSButtonTypePushOnPushOff];
header.bordered=NO; header.alignment=NSTextAlignmentLeft; header.font=[NSFont boldSystemFontOfSize:12];
header.contentTintColor=DYInk(); header.target=self; header.action=@selector(toggleSection:); header.tag=index;
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"点击折叠;双击还原本组";
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开启用,折叠停用;双击还原本组";
[card addSubview:header];
NSButton *enabled=DYButton(@"",self,@selector(groupEnabled:));enabled.bordered=NO;[enabled setButtonType:NSButtonTypePushOnPushOff];enabled.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用本组"];
enabled.tag=index; enabled.contentTintColor=DYAccent(); enabled.toolTip=@"启用或旁路本组";
@@ -489,7 +501,7 @@ static NSImage *DYWheelImage(void) {
[card addSubview:enabled]; enabled.hidden=section[@"enabled"]==nil;
NSButton *reset=DYButton(@"↺",self,@selector(resetSection:)); reset.tag=index;
reset.bordered=NO;
reset.toolTip=@"还原本组"; reset.accessibilityLabel=[section[@"title"] stringByAppendingString:@"还原"];
reset.toolTip=@"还原本组默认值与开关"; reset.accessibilityLabel=[section[@"title"] stringByAppendingString:@"还原"];
[card addSubview:reset];
NSMutableArray *body=[NSMutableArray array];
NSString *key=section[@"key"]?:@"";
@@ -575,7 +587,7 @@ static NSImage *DYWheelImage(void) {
}
for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered;
}
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@([key isEqual:@"skin"])}];
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![section[@"defaultEnabled"]boolValue])}];
if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;}
[_cards addObject:record];
index++;
@@ -612,7 +624,7 @@ static NSImage *DYWheelImage(void) {
- (void)layout {
[super layout];
CGFloat w=MAX(280,self.bounds.size.width),h=self.bounds.size.height;
_brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,23,13);
_brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,40,13);
for(NSInteger i=0;i<5;i++)[_themeButtons[i]setFrame:NSMakeRect(w-146+i*22,17,21,22)];
_resetAll.frame=NSMakeRect(w-33,16,23,24);
CGFloat gap=7,bw=(w-32-gap*2)/3;
@@ -623,13 +635,14 @@ static NSImage *DYWheelImage(void) {
DYCard *card=c[@"view"];BOOL collapsed=[c[@"collapsed"]boolValue];NSString *key=c[@"section"][@"key"];
NSArray *body=c[@"body"];CGFloat contentHeight=0;
for(NSView *row in body)if([self showRow:row section:key])contentHeight+=[self heightForRow:row];
card.frame=NSMakeRect(16,y,cw,43+(collapsed?0:contentHeight+8));y+=card.frame.size.height+12;
[c[@"enabled"]setFrame:NSMakeRect(12,12,20,20)];
CGFloat titleWidth=MIN(cw-104,MAX(80,[[(NSButton *)c[@"header"]title]sizeWithAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:12]}].width+22));
CGFloat titleWidth=MIN(cw-104,MAX(94,[[(NSButton *)c[@"header"]title]sizeWithAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:12]}].width+36));
[c[@"header"]setFrame:NSMakeRect(42,8,titleWidth,28)];
CGFloat headerHeight=43;
card.frame=NSMakeRect(16,y,cw,headerHeight+(collapsed?0:contentHeight+8));y+=card.frame.size.height+12;
[c[@"reset"]setFrame:NSMakeRect(cw-36,10,24,24)];
[c[@"add"]setFrame:NSMakeRect(cw-64,10,24,24)];[c[@"add"]setEnabled:_visibleLooks<5];
CGFloat rowY=43;
[c[@"add"]setFrame:NSMakeRect(cw-64,10,24,24)];[c[@"add"]setEnabled:_visibleLooks<5];[c[@"add"]setHidden:collapsed];
CGFloat rowY=headerHeight;
for(NSView *row in body) {
BOOL show=!collapsed&&[self showRow:row section:key];row.hidden=!show;if(!show)continue;
CGFloat rh=[self heightForRow:row];row.frame=NSMakeRect(12,rowY,cw-24,rh-1);rowY+=rh;
@@ -660,6 +673,7 @@ static NSImage *DYWheelImage(void) {
if(_refreshing||!_manager)return;
id<FxCustomParameterActionAPI_v4> action=[self actionAPI]; if(!action)return;
_refreshing=YES;
BOOL groupingChanged=NO;
[action startAction:self];
@try {
CMTime t=action.currentTime;
@@ -676,25 +690,39 @@ static NSImage *DYWheelImage(void) {
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))];
}
for(id graphic in _graphics)[graphic setValues:graphicValues];
for(NSDictionary *c in _cards) {
for(NSMutableDictionary *c in _cards) {
NSNumber *pid=c[@"section"][@"enabled"];
double v=1;if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
[c[@"enabled"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:v>=.5?@"eye":@"eye.slash" accessibilityDescription:v>=.5?@"启用本组":@"旁路本组"]];
for(NSView *row in c[@"body"])row.alphaValue=v>=.5?1:.45;
double v=[c[@"section"][@"defaultEnabled"]doubleValue];if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
NSNumber *extra=c[@"section"][@"extraEnabled"];double extraValue=0;
if(extra)[get getFloatValue:&extraValue fromParameter:extra.unsignedIntValue atTime:t];
BOOL enabled=v>=.5||extraValue>=.5;
BOOL collapsed=!enabled;groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
[c[@"header"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
[c[@"header"]setToolTip:enabled?@"折叠并停用本组,保留参数值;双击还原本组":@"展开并启用本组,恢复之前的参数值;双击还原本组"];
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];
[c[@"header"]setNeedsDisplay:YES];
[c[@"enabled"] setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"折叠并停用本组":@"展开并启用本组"]];
[c[@"enabled"]setToolTip:enabled?@"折叠并停用本组,保留参数值":@"展开并启用本组,恢复之前的参数值"];
[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
// Visibility and rendering share the host's section enable value.
for(NSView *row in c[@"body"])row.alphaValue=1;
}
DYAssetState *assets=DYReadAssets(_manager,t);
for(NSString *key in _assetButtons) {
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
if([key isEqual:@"input"]&&!path.length){double profile=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSArray *options=d[@"options"];NSInteger index=MAX(0,MIN((NSInteger)llround(profile),(NSInteger)options.count-1));name=options[index];break;}}
button.title=name; button.toolTip=path.length?path:@"选择输入转换或 LUT;点击网格图标浏览缩略图";
button.title=_assetLoads[key]?@"正在载入…":name; button.toolTip=path.length?path:@"选择输入转换或 LUT;点击网格图标浏览缩略图";
[_assetButtons[key][@"remove"] setEnabled:path.length>0];
NSButton *eye=_assetButtons[key][@"eye"];if(eye){NSInteger slot=[[key substringFromIndex:4]integerValue];double enabled=1;[get getFloatValue:&enabled fromParameter:2040+(UInt32)slot-1 atTime:t];eye.state=enabled>=.5?NSControlStateValueOn:NSControlStateValueOff;eye.image=[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"];}
}
for(NSInteger i=1;i<5;i++)if([assets.paths[[NSString stringWithFormat:@"look%ld",(long)i]]length])_visibleLooks=MAX(_visibleLooks,i+1);
[self setNeedsLayout:YES];
} @finally { [action endAction:self]; _refreshing=NO; }
// Remote layout/accessibility can re-enter the host. Let the parameter
// action and current callback unwind before notifying the remote view.
if(groupingChanged)dispatch_async(dispatch_get_main_queue(),^{NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);});
}
- (void)postChanged { [[NSNotificationCenter defaultCenter] postNotificationName:@"DYModelChanged" object:_manager]; }
- (void)scalarChanged:(NSControl *)sender {
@@ -709,7 +737,7 @@ static NSImage *DYWheelImage(void) {
NSString *text=[sender.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];BOOL percent=[text hasSuffix:@"%"];
if(percent)text=[text substringToIndex:text.length-1];scanner=[NSScanner scannerWithString:text];
if(![scanner scanDouble:&v]||!scanner.isAtEnd||!std::isfinite(v)){NSBeep();[self refresh];return;}
if([d[@"key"]hasSuffix:@"Strength"])v/=100.;
if(DYStrengthUsesUnitRange(d))v/=100.;
} else v=sender.doubleValue;
}
v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v));
@@ -731,7 +759,7 @@ static NSImage *DYWheelImage(void) {
NSDictionary *d=_controls[@(sender.tag)][@"descriptor"];NSNumber *pid=d[@"enabled"];if(!pid)return;
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];double value=sender.state==NSControlStateValueOn?1:0;[set setFloatValue:value toParameter:pid.unsignedIntValue atTime:action.currentTime];NSNumber *extra=_cards[sender.tag][@"section"][@"extraEnabled"];if(extra)[set setFloatValue:value toParameter:extra.unsignedIntValue atTime:action.currentTime];}
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];double value=sender.state==NSControlStateValueOn?1:0;[set setFloatValue:value toParameter:pid.unsignedIntValue atTime:action.currentTime];}
@finally {[action endAction:self];}
[self postChanged];
}
@@ -745,23 +773,27 @@ static NSImage *DYWheelImage(void) {
} @finally {[action endAction:self];}
[self postChanged];
}
- (void)groupEnabled:(NSButton *)sender {
if(sender.tag>=_cards.count)return;
NSNumber *pid=_cards[sender.tag][@"section"][@"enabled"];if(!pid)return;
- (void)setSectionEnabled:(BOOL)enabled atIndex:(NSInteger)index {
if(index<0||index>=_cards.count)return;
NSDictionary *section=_cards[index][@"section"];
NSNumber *pid=section[@"enabled"];if(!pid)return;
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:sender.state==NSControlStateValueOn?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];}
@try {
id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
[set setFloatValue:enabled?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:enabled?1:0 toParameter:extra.unsignedIntValue atTime:action.currentTime];
}
@finally {[action endAction:self];}
[self postChanged];
}
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
- (void)toggleSection:(NSButton *)sender {
if(sender.tag>=_cards.count)return;
NSMutableDictionary *card=_cards[sender.tag];BOOL collapsed=![card[@"collapsed"] boolValue];card[@"collapsed"]=@(collapsed);
[sender setNeedsDisplay:YES];
[self setNeedsLayout:YES];
NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
if(sender.tag<0||sender.tag>=_cards.count)return;
[self setSectionEnabled:[_cards[sender.tag][@"collapsed"]boolValue] atIndex:sender.tag];
}
- (void)resetSection:(NSButton *)sender {
[self cancelAssetLoads];
if(sender.tag>=_cards.count)return;
NSDictionary *section=_cards[sender.tag][@"section"];
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
@@ -769,8 +801,9 @@ static NSImage *DYWheelImage(void) {
@try {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
for(NSDictionary *d in section[@"rows"]) {[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];if(d[@"enabled"])[set setFloatValue:1 toParameter:[d[@"enabled"] unsignedIntValue] atTime:t];}
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:1 toParameter:enabled.unsignedIntValue atTime:t];
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:1 toParameter:extra.unsignedIntValue atTime:t];
double defaultEnabled=[section[@"defaultEnabled"]doubleValue];
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:defaultEnabled toParameter:enabled.unsignedIntValue atTime:t];
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:defaultEnabled toParameter:extra.unsignedIntValue atTime:t];
NSString *key=section[@"key"]?:@"";
if([key localizedCaseInsensitiveContainsString:@"input"]||[key localizedCaseInsensitiveContainsString:@"look"]) {
DYAssetState *assets=[[DYReadAssets(_manager,t) copy] autorelease];
@@ -785,6 +818,7 @@ static NSImage *DYWheelImage(void) {
[self postChanged];
}
- (void)resetAll:(id)sender {
[self cancelAssetLoads];
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {
@@ -795,30 +829,42 @@ static NSImage *DYWheelImage(void) {
[self postChanged];
}
- (void)chooseAsset:(NSButton *)sender {
[_library reload:NULL];NSMenu *menu=[[[NSMenu alloc]initWithTitle:@"LUT"]autorelease];
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=nil;
if(!_menuScan)_menuScan=[[_library reloadAsync:^(NSError *error){[_menuScan release];_menuScan=nil;}]retain];
NSMenu *menu=[[[NSMenu alloc]initWithTitle:@"LUT"]autorelease];
NSMenuItem *none=[menu addItemWithTitle:@"无" action:@selector(assetMenuItem:) keyEquivalent:@""];none.target=self;none.representedObject=@{@"key":sender.identifier,@"path":@"",@"profile":@0};
if([sender.identifier isEqual:@"input"]){for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSInteger i=0;for(NSString *title in d[@"options"]){if(i){NSMenuItem *item=[menu addItemWithTitle:title action:@selector(assetMenuItem:) keyEquivalent:@""];item.target=self;item.representedObject=@{@"key":@"input",@"profile":@(i),@"path":@""};}i++;}break;}}
[menu addItem:NSMenuItem.separatorItem];NSMenuItem *browser=[menu addItemWithTitle:@"缩略图浏览库…" action:@selector(assetMenuBrowse:) keyEquivalent:@""];browser.target=self;browser.representedObject=sender.identifier;
NSMenuItem *file=[menu addItemWithTitle:@"载入 LUT 文件…" action:@selector(assetMenuFile:) keyEquivalent:@""];file.target=self;file.representedObject=sender.identifier;
NSMutableDictionary *folders=[NSMutableDictionary dictionary];NSUInteger count=0;
for(NSDictionary *entry in _library.entries){if(count++>=1000)break;NSString *folder=entry[@"relativeFolder"];NSMenu *parent=menu;
for(NSDictionary *entry in _library.entries){if(count++>=100)break;NSString *folder=entry[@"relativeFolder"];NSMenu *parent=menu;
if(folder.length){parent=folders[folder];if(!parent){NSMenuItem *group=[menu addItemWithTitle:folder action:nil keyEquivalent:@""];parent=[[[NSMenu alloc]initWithTitle:folder]autorelease];group.submenu=parent;folders[folder]=parent;}}
NSMenuItem *item=[parent addItemWithTitle:entry[@"name"] action:@selector(assetMenuItem:) keyEquivalent:@""];item.target=self;item.representedObject=@{@"key":sender.identifier,@"path":entry[@"path"]};
}
if(_library.entries.count>100){NSMenuItem *more=[menu addItemWithTitle:@"更多 LUT,请打开缩略图浏览库…" action:@selector(assetMenuBrowse:) keyEquivalent:@""];more.target=self;more.representedObject=sender.identifier;}
[menu popUpMenuPositioningItem:nil atLocation:NSMakePoint(0,sender.bounds.size.height) inView:sender];
// Return from menu tracking and the remote button action before opening a panel.
NSDictionary *command=[_pendingAssetMenuCommand autorelease];_pendingAssetMenuCommand=nil;
if(command)dispatch_async(dispatch_get_main_queue(),^{if(self.window)[self performAssetMenuCommand:command];});
}
- (void)assetMenuBrowse:(NSMenuItem *)item {NSButton *button=_assetButtons[item.representedObject][@"browse"];[self browseAsset:button];}
- (void)assetMenuFile:(NSMenuItem *)item {[self chooseFileForKey:item.representedObject];}
- (void)assetMenuItem:(NSMenuItem *)item {
NSString *key=item.representedObject[@"key"],*path=item.representedObject[@"path"];
- (void)queueAssetMenuCommand:(NSString *)kind payload:(id)payload {
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=[@{@"kind":kind,@"payload":payload}copy];
}
- (void)assetMenuBrowse:(NSMenuItem *)item {[self queueAssetMenuCommand:@"browse" payload:item.representedObject];}
- (void)assetMenuFile:(NSMenuItem *)item {[self queueAssetMenuCommand:@"file" payload:item.representedObject];}
- (void)assetMenuItem:(NSMenuItem *)item {[self queueAssetMenuCommand:@"item" payload:item.representedObject];}
- (void)performAssetMenuCommand:(NSDictionary *)command {
NSString *kind=command[@"kind"];id payload=command[@"payload"];
if([kind isEqual:@"browse"]){[self browseAsset:_assetButtons[payload][@"browse"]];return;}
if([kind isEqual:@"file"]){[self chooseFileForKey:payload];return;}
NSString *key=payload[@"key"],*path=payload[@"path"];
[self setAssetPath:path forKey:key];
if([key isEqual:@"input"]&&item.representedObject[@"profile"]){id<FxCustomParameterActionAPI_v4> a=[self actionAPI];[a startAction:self];@try{[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setFloatValue:[item.representedObject[@"profile"]doubleValue] toParameter:2013 atTime:a.currentTime];}@finally{[a endAction:self];}[self postChanged];}
if([key isEqual:@"input"]&&payload[@"profile"]){id<FxCustomParameterActionAPI_v4> a=[self actionAPI];[a startAction:self];@try{[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setFloatValue:[payload[@"profile"]doubleValue] toParameter:2013 atTime:a.currentTime];}@finally{[a endAction:self];}[self postChanged];}
}
- (void)chooseFileForKey:(NSString *)key {
NSOpenPanel *panel=[NSOpenPanel openPanel];panel.allowedFileTypes=@[@"cube"];panel.allowsMultipleSelection=NO;
panel.canChooseDirectories=NO;panel.message=@"选择 .cube 立体 LUT";
if([panel runModal]!=NSModalResponseOK)return;
[self setAssetPath:panel.URL.path forKey:key];
if([panel runModal]==NSModalResponseOK&&self.window)[self setAssetPath:panel.URL.path forKey:key];
}
- (void)browseAsset:(NSButton *)sender {
[_browser close];[_browser release];_browser=nil;
@@ -840,7 +886,19 @@ static NSImage *DYWheelImage(void) {
}
- (void)removeAsset:(NSButton *)sender { [self setAssetPath:nil forKey:sender.identifier]; }
- (void)setAssetPath:(NSString *)path forKey:(NSString *)key {
if(path.length){std::vector<float> values;NSUInteger size=0;NSError *error=nil;if(!DYLUTReadCube(path,values,size,&error)){[self showError:error.localizedDescription];return;}}
[_assetLoads[key]cancel];[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
if(!path.length){[self commitAssetPath:nil forKey:key];return;}
NSUInteger requestID=++_nextAssetLoadID;_assetLoadIDs[key]=@(requestID);
NSProgress *task=DYLUTPrepareAsync(path,^(NSError *error){
if([_assetLoadIDs[key]unsignedIntegerValue]!=requestID||!self.window)return;[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
if(error){[self refresh];[_assetButtons[key][@"choose"]setTitle:@"载入失败"];[_assetButtons[key][@"choose"]setToolTip:error.localizedDescription];return;}
[self commitAssetPath:path forKey:key];
});_assetLoads[key]=task;[_assetButtons[key][@"choose"]setTitle:@"正在载入…"];
}
- (void)cancelAssetLoads {
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads removeAllObjects];[_assetLoadIDs removeAllObjects];
}
- (void)commitAssetPath:(NSString *)path forKey:(NSString *)key {
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {
@@ -891,6 +949,7 @@ static NSImage *DYWheelImage(void) {
if(![path isKindOfClass:NSString.class]||![path isAbsolutePath]||![[path pathExtension].lowercaseString isEqual:@"cube"]){[self showError:@"预设包含无效 LUT 路径,尚未修改当前调色。"];return;}
if([[NSFileManager defaultManager] isReadableFileAtPath:path])validPaths[key]=path;else [missing addObject:[path lastPathComponent]];
}
[self cancelAssetLoads];
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {
+103 -51
查看文件
@@ -116,12 +116,17 @@ static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview
NSSlider *_sizeSlider;
NSMutableArray *_folderButtons;
NSMutableDictionary *_tiles;
NSArray *_visibleEntries;
NSArray *_visibleEntries,*_folderPaths;
NSMutableSet *_queuedPaths;
NSCache *_thumbnailCache;
dispatch_queue_t _previewQueue;
DYBrowserWork *_work;
BOOL _closed,_sizing,_visible,_remoteMode,_importing;
BOOL _closed,_sizing,_visible,_remoteMode,_importing,_layingOut;
NSProgress *_libraryTask,*_selectionTask;
NSTimer *_progressTimer;
NSUInteger _libraryGeneration,_selectionGeneration;
NSInteger _columns;
CGFloat _tileWidth,_tileHeight;
}
@end
@@ -155,6 +160,8 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
_gridScroll=[[NSScrollView alloc]initWithFrame:NSZeroRect];_gridScroll.hasVerticalScroller=YES;_gridScroll.autohidesScrollers=YES;_gridScroll.borderType=NSNoBorder;_gridScroll.drawsBackground=NO;_gridScroll.accessibilityLabel=@"LUT 缩略图网格";
_folderDocument=[[DYBrowserCanvas alloc]initWithFrame:NSZeroRect];_folderDocument.fillKey=@"card";_folderDocument.palette=_palette;_folderDocument.accessibilityLabel=@"LUT 文件夹";_folderScroll.documentView=_folderDocument;
_gridDocument=[[DYBrowserCanvas alloc]initWithFrame:NSZeroRect];_gridDocument.palette=_palette;_gridDocument.accessibilityLabel=@"LUT 缩略图";_gridScroll.documentView=_gridDocument;
_folderScroll.contentView.postsBoundsChangedNotifications=YES;
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(folderScrolled:) name:NSViewBoundsDidChangeNotification object:_folderScroll.contentView];
_gridScroll.contentView.postsBoundsChangedNotifications=YES;
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(gridScrolled:) name:NSViewBoundsDidChangeNotification object:_gridScroll.contentView];
for(NSView *view in @[_titleLabel,_countLabel,_statusLabel,_sizeLabel,_search,_importFiles,_importFolder,_reveal,_refresh,_none,_done,_sizeSlider,_folderScroll,_gridScroll])[_root addSubview:view];
@@ -168,13 +175,14 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
}
- (void)dealloc{
[NSObject cancelPreviousPerformRequestsWithTarget:self];[[NSNotificationCenter defaultCenter]removeObserver:self];
[_libraryTask cancel];[_libraryTask release];[_selectionTask cancel];[_selectionTask release];[_progressTimer invalidate];[_progressTimer release];
_work.cancelled=YES;_work.owner=nil;[_work release];self.window.delegate=nil;
_popover.delegate=nil;[_popover close];[_popover release];[_root removeFromSuperview];
[_library release];[_preview release];[_selectedPath release];[_folder release];[_palette release];[_selection release];[_closeAction release];
[_root release];[_folderDocument release];[_gridDocument release];[_folderScroll release];[_gridScroll release];
[_titleLabel release];[_countLabel release];[_statusLabel release];[_sizeLabel release];[_emptyLabel release];[_search release];
[_importFiles release];[_importFolder release];[_reveal release];[_refresh release];[_none release];[_done release];[_sizeSlider release];
[_folderButtons release];[_tiles release];[_visibleEntries release];[_queuedPaths release];[_thumbnailCache release];
[_folderButtons release];[_folderPaths release];[_tiles release];[_visibleEntries release];[_queuedPaths release];[_thumbnailCache release];
dispatch_release(_previewQueue);[super dealloc];
}
- (void)showRelativeToView:(NSView *)view{
@@ -214,7 +222,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
// The API owner's completion may release this controller synchronously.
[self retain];
[NSObject cancelPreviousPerformRequestsWithTarget:self];
_closed=YES;_visible=NO;_work.cancelled=YES;_work.owner=nil;
_closed=YES;_visible=NO;_work.cancelled=YES;_work.owner=nil;[_libraryTask cancel];[_selectionTask cancel];[_progressTimer invalidate];[_progressTimer release];_progressTimer=nil;
_popover.delegate=nil;if(_popover.shown)[_popover close];
[_root removeFromSuperview];[_queuedPaths removeAllObjects];[_thumbnailCache removeAllObjects];
[_selection release];_selection=nil;
@@ -223,6 +231,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
[self release];
}
- (void)layoutBrowser{
if(_layingOut)return;_layingOut=YES;
CGFloat w=_root.bounds.size.width,h=_root.bounds.size.height,left=162;
_titleLabel.frame=NSMakeRect(12,15,145,20);_countLabel.frame=NSMakeRect(12,39,145,18);
_search.frame=NSMakeRect(left+14,14,MAX(125,w-left-351),24);
@@ -232,17 +241,35 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
_sizeLabel.frame=NSMakeRect(left+101,h-39,74,18);_sizeSlider.frame=NSMakeRect(left+173,h-41,MAX(70,MIN(150,w-left-420)),20);
_done.frame=NSMakeRect(w-98,h-44,78,27);
CGFloat statusX=NSMaxX(_sizeSlider.frame)+14;_statusLabel.frame=NSMakeRect(statusX,h-39,MAX(0,w-statusX-112),18);
CGFloat fy=4,fw=MAX(100,_folderScroll.contentSize.width);
for(DYBrowserFolderButton *button in _folderButtons){button.frame=NSMakeRect(4,fy,fw-8,33);fy+=35;}
_folderDocument.frame=NSMakeRect(0,0,fw,MAX(fy,_folderScroll.contentSize.height));
CGFloat fw=MAX(100,_folderScroll.contentSize.width);
_folderDocument.frame=NSMakeRect(0,0,fw,MAX(_folderPaths.count*35+4,_folderScroll.contentSize.height));
[self updateVisibleFolders];
CGFloat available=MAX(80,_gridScroll.contentSize.width),tileWidth=_sizeSlider.doubleValue,gap=10;
NSInteger columns=MAX(1,(NSInteger)floor((available+gap)/(tileWidth+gap)));tileWidth=MIN(tileWidth,(available-gap*(columns-1)-14)/columns);tileWidth=MAX(70,tileWidth);
CGFloat tileHeight=ceil(tileWidth*9/16)+24,x=7,y=8;NSInteger index=0;
for(NSDictionary *entry in _visibleEntries){DYBrowserTile *tile=_tiles[entry[@"path"]];NSInteger col=index%columns,row=index/columns;tile.frame=NSMakeRect(x+col*(tileWidth+gap),y+row*(tileHeight+gap),tileWidth,tileHeight);index++;}
NSInteger rows=(_visibleEntries.count+columns-1)/columns;CGFloat contentHeight=MAX(_gridScroll.contentSize.height,rows*(tileHeight+gap)+12);
_columns=columns;_tileWidth=tileWidth;_tileHeight=ceil(tileWidth*9/16)+24;
NSInteger rows=(_visibleEntries.count+columns-1)/columns;CGFloat contentHeight=MAX(_gridScroll.contentSize.height,rows*(_tileHeight+gap)+12);
_gridDocument.frame=NSMakeRect(0,0,available,contentHeight);_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90);
_layingOut=NO;[self updateVisibleTiles];
}
- (void)resetThumbnailWork {
_work.cancelled=YES;_work.owner=nil;[_work release];_work=[DYBrowserWork new];_work.owner=self;[_queuedPaths removeAllObjects];
}
- (void)updateVisibleTiles {
if(_closed||_layingOut||_columns<1)return;
NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);CGFloat step=_tileHeight+10;
NSUInteger first=(NSUInteger)MAX(0,floor((NSMinY(visible)-8)/step))*_columns;
NSUInteger end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxY(visible)-8)/step)+1)*_columns);
NSMutableSet *wanted=[NSMutableSet set];BOOL changed=NO;
for(NSUInteger i=first;i<end;i++){
NSDictionary *entry=_visibleEntries[i];NSString *path=entry[@"path"];[wanted addObject:path];DYBrowserTile *tile=_tiles[path];
if(!tile){tile=[[[DYBrowserTile alloc]initWithFrame:NSZeroRect]autorelease];tile.identifier=path;tile.displayName=entry[@"name"];tile.toolTip=entry[@"relativePath"]?:path;tile.palette=_palette;tile.chosen=[path isEqualToString:_selectedPath];tile.target=self;tile.action=@selector(thumbnailClicked:);tile.enabled=YES;[_gridDocument addSubview:tile];_tiles[path]=tile;changed=YES;}
tile.frame=NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
}
for(NSString *path in _tiles.allKeys)if(![wanted containsObject:path]){[_tiles[path]removeFromSuperview];[_tiles removeObjectForKey:path];changed=YES;}
if(changed||!_work)[self resetThumbnailWork];
if(!_sizing)[self generateVisibleThumbnails];
}
- (void)updatePalette:(NSDictionary *)palette{
NSMutableDictionary *browserPalette=[NSMutableDictionary dictionaryWithDictionary:palette?:@{}];
browserPalette[@"background"]=[NSColor colorWithCalibratedRed:.035 green:.08 blue:.12 alpha:1];
@@ -265,22 +292,45 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
}
- (void)setStatus:(NSString *)status{_statusLabel.stringValue=status?:@"";_statusLabel.toolTip=status;}
- (void)rebuildFolders{
for(NSView *view in _folderButtons)[view removeFromSuperview];[_folderButtons removeAllObjects];
NSMutableArray *paths=[NSMutableArray arrayWithObject:@"*"];
for(NSString *folder in _library.folders){NSString *top=folder.length?[folder componentsSeparatedByString:@"/"].firstObject:@"";if(![paths containsObject:top])[paths addObject:top];}
if(![paths containsObject:_folder]){[_folder release];_folder=[@"*" copy];}
for(NSString *path in paths){
DYBrowserFolderButton *button=[[[DYBrowserFolderButton alloc]initWithFrame:NSZeroRect]autorelease];button.bordered=NO;button.target=self;button.action=@selector(folderClicked:);button.identifier=path;
button.title=[path isEqualToString:@"*"]?@"全部 LUT":path.length?[@"▸ " stringByAppendingString:path]:@"未分类";button.toolTip=path.length?path:_library.rootURL.path;button.palette=_palette;button.chosen=[path isEqualToString:_folder];button.accessibilityLabel=[@"LUT 文件夹:" stringByAppendingString:button.title];
[_folderDocument addSubview:button];[_folderButtons addObject:button];
NSMutableArray *paths=[NSMutableArray arrayWithObject:@"*"];NSMutableSet *seen=[NSMutableSet setWithObject:@"*"];
for(NSString *folder in _library.folders){NSString *top=folder.length?[folder componentsSeparatedByString:@"/"].firstObject:@"";if(![seen containsObject:top]){[paths addObject:top];[seen addObject:top];}}
if(![seen containsObject:_folder]){[_folder release];_folder=[@"*" copy];}
[_folderPaths release];_folderPaths=[paths copy];[self updateVisibleFolders];
}
- (void)folderScrolled:(NSNotification *)notification{if(!_layingOut)[self updateVisibleFolders];}
- (void)updateVisibleFolders {
if(_closed)return;NSRect visible=NSInsetRect(_folderScroll.contentView.bounds,0,-35);
NSUInteger first=(NSUInteger)MAX(0,floor(NSMinY(visible)/35)),end=MIN(_folderPaths.count,(NSUInteger)MAX(0,ceil(NSMaxY(visible)/35)+1));
NSMutableDictionary *existing=[NSMutableDictionary dictionary];for(NSButton *button in _folderButtons)existing[button.identifier]=button;
NSMutableArray *buttons=[NSMutableArray array];
for(NSUInteger i=first;i<end;i++){
NSString *path=_folderPaths[i];DYBrowserFolderButton *button=existing[path];
if(!button){button=[[[DYBrowserFolderButton alloc]initWithFrame:NSZeroRect]autorelease];button.bordered=NO;button.target=self;button.action=@selector(folderClicked:);button.identifier=path;
button.title=[path isEqualToString:@"*"]?@"全部 LUT":path.length?[@"▸ " stringByAppendingString:path]:@"未分类";button.toolTip=path.length?path:_library.rootURL.path;button.palette=_palette;button.accessibilityLabel=[@"LUT 文件夹:" stringByAppendingString:button.title];[_folderDocument addSubview:button];}
button.chosen=[path isEqualToString:_folder];button.frame=NSMakeRect(4,4+i*35,MAX(92,_folderScroll.contentSize.width-8),33);[button setNeedsDisplay:YES];[buttons addObject:button];
}
for(NSButton *button in _folderButtons)if(![buttons containsObject:button])[button removeFromSuperview];[_folderButtons setArray:buttons];
}
- (void)pollLibraryProgress:(NSTimer *)timer {
if(_libraryTask)[self setStatus:_libraryTask.localizedDescription];
_statusLabel.toolTip=_libraryTask.localizedAdditionalDescription?:_statusLabel.stringValue;
}
- (void)beginLibraryTask:(NSProgress *)task {
[_libraryTask release];_libraryTask=[task retain];_importFiles.enabled=NO;_importFolder.enabled=NO;_refresh.title=@"取消";_done.title=@"停止并关闭";_done.toolTip=@"关闭将取消本次加载,原有 LUT 保留";
[_progressTimer invalidate];[_progressTimer release];_progressTimer=[[NSTimer timerWithTimeInterval:.1 target:self selector:@selector(pollLibraryProgress:) userInfo:nil repeats:YES]retain];
[[NSRunLoop mainRunLoop]addTimer:_progressTimer forMode:NSRunLoopCommonModes];[self pollLibraryProgress:nil];
}
- (void)endLibraryTask {
[_libraryTask release];_libraryTask=nil;[_progressTimer invalidate];[_progressTimer release];_progressTimer=nil;
_importFiles.enabled=YES;_importFolder.enabled=YES;_refresh.title=@"刷新";_done.title=@"完成";_done.toolTip=nil;
}
- (void)reloadLibrary:(id)sender{
[_thumbnailCache removeAllObjects];
NSError *error=nil;
if(![_library reload:&error]&&error)[self setStatus:error.localizedDescription];
else [self setStatus:@"单击缩略图应用 LUT"];
[self rebuildFolders];[self rebuildGrid];
if(_libraryTask){[_libraryTask cancel];[self setStatus:@"正在取消…"];return;}
[_thumbnailCache removeAllObjects];NSUInteger generation=++_libraryGeneration;
NSProgress *task=[_library reloadAsync:^(NSError *error){
if(_closed||generation!=_libraryGeneration)return;[self endLibraryTask];
[self rebuildFolders];[self rebuildGrid];[self setStatus:error?error.localizedDescription:@"单击缩略图应用 LUT"];
}];[self beginLibraryTask:task];
}
- (void)folderClicked:(NSButton *)sender{
[_folder release];_folder=[sender.identifier copy];
@@ -299,20 +349,19 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
- (void)refreshThumbnailSize{
if(_closed)return;_sizing=NO;
_work.cancelled=YES;_work.owner=nil;[_work release];_work=[DYBrowserWork new];_work.owner=self;[_queuedPaths removeAllObjects];
for(DYBrowserTile *tile in _tiles.allValues){tile.thumbnail=nil;tile.failure=nil;tile.enabled=NO;[tile setNeedsDisplay:YES];}
for(DYBrowserTile *tile in _tiles.allValues){tile.thumbnail=nil;tile.failure=nil;tile.enabled=YES;[tile setNeedsDisplay:YES];}
[self generateVisibleThumbnails];
}
- (void)gridScrolled:(NSNotification *)notification{if(!_sizing)[self generateVisibleThumbnails];}
- (void)gridScrolled:(NSNotification *)notification{[self updateVisibleTiles];}
- (void)generateVisibleThumbnails{
if(_closed||!_work)return;
NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);
NSUInteger width=MAX((NSUInteger)64,(NSUInteger)llround(_sizeSlider.doubleValue)),height=MAX((NSUInteger)40,(NSUInteger)llround(width*9./16));
for(NSDictionary *entry in _visibleEntries){
NSString *path=entry[@"path"];DYBrowserTile *tile=_tiles[path];
for(NSString *path in _tiles.allKeys){
DYBrowserTile *tile=_tiles[path];
if(!NSIntersectsRect(tile.frame,visible)){if(tile.thumbnail){tile.thumbnail=nil;tile.enabled=NO;}continue;}
if(tile.thumbnail||tile.failure.length)continue;
NSDictionary *attributes=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:nil];
NSString *cacheKey=[NSString stringWithFormat:@"%lu|%@|%.9f|%@|%@",(unsigned long)width,path,[attributes[NSFileModificationDate]timeIntervalSinceReferenceDate],attributes[NSFileSize],attributes[NSFileSystemFileNumber]];
NSString *cacheKey=[NSString stringWithFormat:@"%lu|%@",(unsigned long)width,path];
NSDictionary *cached=[_thumbnailCache objectForKey:cacheKey];
if(cached){tile.thumbnail=cached[@"image"];tile.failure=cached[@"error"];tile.enabled=tile.thumbnail!=nil;if(tile.failure.length)tile.toolTip=tile.failure;[tile setNeedsDisplay:YES];continue;}
if([_queuedPaths containsObject:cacheKey])continue;[_queuedPaths addObject:cacheKey];
@@ -332,8 +381,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
}
}
- (void)rebuildGrid{
_work.cancelled=YES;_work.owner=nil;[_work release];_work=[DYBrowserWork new];_work.owner=self;
[_queuedPaths removeAllObjects];
[self resetThumbnailWork];
for(NSView *tile in _tiles.allValues)[tile removeFromSuperview];[_tiles removeAllObjects];
NSString *query=[_search.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];NSMutableArray *entries=[NSMutableArray array];
for(NSDictionary *entry in _library.entries){
@@ -342,41 +390,45 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
if(folderMatch&&(!query.length||[entry[@"name"]localizedCaseInsensitiveContainsString:query]||[entry[@"relativePath"]localizedCaseInsensitiveContainsString:query]))[entries addObject:entry];
}
[_visibleEntries release];_visibleEntries=[entries copy];_countLabel.stringValue=[NSString stringWithFormat:@"%lu 个 LUT",(unsigned long)entries.count];_emptyLabel.hidden=entries.count>0;
for(NSDictionary *entry in entries){
NSString *path=entry[@"path"];DYBrowserTile *tile=[[[DYBrowserTile alloc]initWithFrame:NSZeroRect]autorelease];tile.identifier=path;tile.displayName=entry[@"name"];tile.toolTip=entry[@"relativePath"]?:path;tile.palette=_palette;tile.chosen=[path isEqualToString:_selectedPath];tile.target=self;tile.action=@selector(thumbnailClicked:);tile.enabled=NO;[_gridDocument addSubview:tile];_tiles[path]=tile;
}
[self layoutBrowser];[_gridScroll.contentView scrollToPoint:NSZeroPoint];[_gridScroll reflectScrolledClipView:_gridScroll.contentView];
[_gridScroll.contentView scrollToPoint:NSZeroPoint];[self layoutBrowser];[_gridScroll reflectScrolledClipView:_gridScroll.contentView];
NSAccessibilityPostNotification(_gridDocument,NSAccessibilityLayoutChangedNotification);
}
- (void)thumbnailClicked:(DYBrowserTile *)sender{
if(!sender.enabled||!sender.thumbnail||sender.failure.length)return;
std::vector<float> values;NSUInteger dimension=0;NSError *error=nil;
if(!DYLUTReadCube(sender.identifier,values,dimension,&error)){
sender.failure=error.localizedDescription?:@"LUT 文件已失效,请刷新浏览库";sender.enabled=NO;[sender setNeedsDisplay:YES];[self setStatus:sender.failure];return;
}
[_selectedPath release];_selectedPath=[sender.identifier copy];
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=[tile.identifier isEqualToString:_selectedPath];[tile setNeedsDisplay:YES];}
[self setStatus:[NSString stringWithFormat:@"已应用 %@",sender.displayName]];
if(_selection)_selection(_selectedPath);
if(sender.doubleClicked)[self close];
if(!sender.enabled||sender.failure.length)return;
[_selectionTask cancel];[_selectionTask release];NSUInteger generation=++_selectionGeneration;
NSString *path=sender.identifier,*name=sender.displayName;BOOL closeAfter=sender.doubleClicked;[self setStatus:[@"正在载入 " stringByAppendingString:name]];
_selectionTask=[DYLUTPrepareAsync(path,^(NSError *error){
if(_closed||generation!=_selectionGeneration)return;[_selectionTask release];_selectionTask=nil;
if(error){[self setStatus:error.localizedDescription];return;}
[_selectedPath release];_selectedPath=[path copy];
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=[tile.identifier isEqualToString:path];[tile setNeedsDisplay:YES];}
if(_selection)_selection(path);[self setStatus:[@"已选择 " stringByAppendingString:name]];if(closeAfter)[self close];
})retain];
}
- (void)clearSelection:(id)sender{
++_selectionGeneration;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;
[_selectedPath release];_selectedPath=nil;
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=NO;[tile setNeedsDisplay:YES];}
if(_selection)_selection(nil);[self setStatus:@"已移除 LUT"];
}
- (void)done:(id)sender{[self close];}
- (void)showImportError:(NSError *)error{
if(!error||_closed)return;NSAlert *alert=[[[NSAlert alloc]init]autorelease];alert.messageText=@"LUT 导入未完成";alert.informativeText=error.localizedDescription?:@"请选择有效的 .cube LUT 文件。";[alert addButtonWithTitle:@"好"];
_importing=YES;[alert runModal];_importing=NO;
- (void)showImportError:(NSError *)error{if(error&&!_closed)[self setStatus:error.localizedDescription];}
- (void)importSelectedURLs:(NSArray<NSURL *> *)urls {
if(_closed||_libraryTask)return;NSUInteger generation=++_libraryGeneration;
NSProgress *task=[_library importURLsAsync:urls completion:^(NSArray *imported,NSError *error){
if(_closed||generation!=_libraryGeneration)return;[self endLibraryTask];
if(!imported){[self showImportError:error];return;}
[_thumbnailCache removeAllObjects];[self rebuildFolders];[self rebuildGrid];[self setStatus:[NSString stringWithFormat:@"已导入 %lu 个 LUT",(unsigned long)imported.count]];
}];[self beginLibraryTask:task];
}
- (void)importPanelForFolders:(BOOL)folders{
if(_libraryTask||_importing||_closed)return;
NSOpenPanel *panel=[NSOpenPanel openPanel];panel.canChooseFiles=!folders;panel.canChooseDirectories=folders;panel.allowsMultipleSelection=YES;panel.title=folders?@"导入 LUT 文件夹":@"导入 LUT 文件";panel.message=folders?@"所选文件夹中的 .cube 文件会按目录复制到大鱼调色 LUT 库。":@"选择要复制到大鱼调色 LUT 库的 .cube 文件。";
if(!folders)panel.allowedFileTypes=@[@"cube"];
// FxPlug bridges the modal chooser; the asynchronous AppKit chooser cannot
// become key in the service. Only choosing a path is modal; file work is not.
_importing=YES;NSModalResponse response=[panel runModal];_importing=NO;
if(response!=NSModalResponseOK||_closed)return;NSError *error=nil;NSArray *imported=[_library importURLs:panel.URLs error:&error];
if(!imported){[self showImportError:error];return;}
[self rebuildFolders];[self rebuildGrid];[self setStatus:[NSString stringWithFormat:@"已导入 %lu 个 LUT",(unsigned long)imported.count]];
if(response==NSModalResponseOK&&!_closed)[self importSelectedURLs:panel.URLs];
}
- (void)importFiles:(id)sender{[self importPanelForFolders:NO];}
- (void)importFolder:(id)sender{[self importPanelForFolders:YES];}
+11
查看文件
@@ -13,6 +13,11 @@ FOUNDATION_EXPORT BOOL DYLUTReadCube(NSString *path, std::vector<float>& values,
NSUInteger& dimension, NSError * _Nullable * _Nullable error);
#endif
/// Parse/warm the shared table cache off the UI thread. Completion is always on
/// the main queue; cancel suppresses application of the result.
FOUNDATION_EXPORT NSProgress *DYLUTPrepareAsync(NSString *path,
void (^completion)(NSError * _Nullable error));
/// Float RGBA in display-encoded RGB, matching the renderer's 320×180 preview.
/// Empty path means identity. Alpha is preserved; invalid samples become clear.
FOUNDATION_EXPORT NSData * _Nullable DYLUTTransformRGBA(NSData *sourceRGBA,
@@ -35,6 +40,12 @@ FOUNDATION_EXPORT NSImage * _Nullable DYLUTThumbnail(NSString * _Nullable path,
- (instancetype)initWithRootURL:(NSURL *)rootURL NS_DESIGNATED_INITIALIZER;
/// Does not follow symbolic links or create a missing root directory.
- (BOOL)reload:(NSError * _Nullable * _Nullable)error;
/// Background file work is serialized separately from the short snapshot lock.
/// The returned progress supports cancellation and per-file status; callbacks
/// always run on the main queue. Existing snapshots remain readable meanwhile.
- (NSProgress *)reloadAsync:(void (^)(NSError * _Nullable error))completion;
- (NSProgress *)importURLsAsync:(NSArray<NSURL *> *)urls
completion:(void (^)(NSArray<NSDictionary *> * _Nullable imported, NSError * _Nullable error))completion;
/// Copies Cube files (recursing into folders) into the library. No existing file
/// is replaced. Names receive numeric suffixes on collision. Source data stays put.
/// Returns imported entry dictionaries, or nil on preflight/copy failure.
+109 -41
查看文件
@@ -1,5 +1,9 @@
#import "DYLUTLibrary.h"
#include <algorithm>
#include <charconv>
#include <string_view>
#include <string>
#include <xlocale.h>
#include <cmath>
#include <cstring>
#include <limits>
@@ -58,7 +62,12 @@ static void DYLUTSample(const std::vector<float>& table,NSUInteger n,const float
}
}
static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,NSError **error) {
static BOOL DYLUTCancelled(NSProgress *progress,NSError **error) {
if(!progress.cancelled)return NO;
if(error)*error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
return YES;
}
static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;
NSDictionary *attributes=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:error];
if(!attributes)return NO;
@@ -76,28 +85,37 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
for(float v:data)if(!std::isfinite(v))return DYLUTFail(error,@"输入 LUT 含无效数字");
size=n;return YES;
}
NSString *text=[[[NSString alloc]initWithData:bytes encoding:NSUTF8StringEncoding]autorelease];
if(!text)return DYLUTFail(error,@"LUT 必须是 UTF-8 文本");
float domainMin[3]={0,0,0},domainMax[3]={1,1,1};
BOOL foundSize=NO;
for(NSString *line in [text componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]) {
NSString *clean=[[[line componentsSeparatedByString:@"#"]firstObject]stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];
if(!clean.length)continue;
const char *c=clean.UTF8String;int n=0;float r,g,b;
if(sscanf(c,"LUT_3D_SIZE %d",&n)==1) {
if(foundSize||n<2||n>128)return DYLUTFail(error,@"LUT 尺寸应为 2–128,且只能声明一次");
// Validate encoding once, then parse byte spans without allocating an
// NSString, NSArray and temporary strings for every numeric row.
NSString *text=[[NSString alloc]initWithData:bytes encoding:NSUTF8StringEncoding];
if(!text)return DYLUTFail(error,@"LUT 必须是 UTF-8 文本");[text release];
std::string storage((const char *)bytes.bytes,bytes.length);
static locale_t numericLocale;static dispatch_once_t localeOnce;dispatch_once(&localeOnce,^{numericLocale=newlocale(LC_NUMERIC_MASK,"C",NULL);});
float domainMin[3]={0,0,0},domainMax[3]={1,1,1};BOOL foundSize=NO;
std::string_view remaining(storage);NSUInteger rows=0;
if(remaining.size()>=3&&remaining.substr(0,3)=="\xef\xbb\xbf")remaining.remove_prefix(3);
auto trim=[](std::string_view v){while(!v.empty()&&(v.front()==' '||v.front()=='\t'||v.front()=='\r'))v.remove_prefix(1);return v;};
auto number=[&](std::string_view& v,float& value){v=trim(v);if(v.empty())return false;char *end=nullptr;value=strtof_l(v.data(),&end,numericLocale);if(end==v.data()||end>v.data()+v.size())return false;v.remove_prefix(end-v.data());return true;};
while(!remaining.empty()) {
if((rows++&1023)==0&&DYLUTCancelled(progress,error))return NO;
size_t end=remaining.find_first_of("\r\n");std::string_view line=remaining.substr(0,end);
if(end==std::string_view::npos)remaining={};else remaining.remove_prefix(end+1);
line=line.substr(0,line.find('#'));line=trim(line);if(line.empty())continue;
float r=0,g=0,b=0;
auto starts=[&](std::string_view prefix){return line.substr(0,prefix.size())==prefix;};
if(starts("LUT_3D_SIZE")) {
auto v=trim(line.substr(11));int n=0;auto result=std::from_chars(v.data(),v.data()+v.size(),n);
if(result.ec!=std::errc{}||foundSize||n<2||n>128)return DYLUTFail(error,@"LUT 尺寸应为 2–128,且只能声明一次");
size=n;foundSize=YES;data.reserve(size*size*size*4);
} else if(sscanf(c,"DOMAIN_MIN %f %f %f",&r,&g,&b)==3) {
domainMin[0]=r;domainMin[1]=g;domainMin[2]=b;
} else if(sscanf(c,"DOMAIN_MAX %f %f %f",&r,&g,&b)==3) {
domainMax[0]=r;domainMax[1]=g;domainMax[2]=b;
} else if(sscanf(c,"%f %f %f",&r,&g,&b)==3) {
if(!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(b))return DYLUTFail(error,@"LUT 含无效数字");
data.insert(data.end(),{r,g,b,1});
if(data.size()>128*128*128*4)return DYLUTFail(error,@"LUT 数据过多");
} else if([clean hasPrefix:@"LUT_1D_SIZE"])return DYLUTFail(error,@"请选择三维 .cube LUT");
else if(![clean hasPrefix:@"TITLE"]&&![clean hasPrefix:@"LUT_3D_INPUT_RANGE"])
return DYLUTFail(error,[NSString stringWithFormat:@"无法解析 LUT 行:%@",[clean substringToIndex:MIN(clean.length,(NSUInteger)80)]]);
} else if(starts("DOMAIN_MIN")||starts("DOMAIN_MAX")) {
auto v=line.substr(10);if(!number(v,r)||!number(v,g)||!number(v,b))return DYLUTFail(error,@"LUT DOMAIN 范围无效");
float *domain=starts("DOMAIN_MIN")?domainMin:domainMax;domain[0]=r;domain[1]=g;domain[2]=b;
} else if(starts("TITLE")||starts("LUT_3D_INPUT_RANGE"))continue;
else if(starts("LUT_1D_SIZE"))return DYLUTFail(error,@"请选择三维 .cube LUT");
else {
auto v=line;if(!number(v,r)||!number(v,g)||!number(v,b)||!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(b))return DYLUTFail(error,@"LUT 含无效数据行");
data.insert(data.end(),{r,g,b,1});if(data.size()>128*128*128*4)return DYLUTFail(error,@"LUT 数据过多");
}
}
if(size<2||data.size()!=size*size*size*4)return DYLUTFail(error,@"LUT 数据数量与尺寸不符");
bool resample=false;
@@ -108,6 +126,7 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
if(resample) {
std::vector<float> original=data;
for(NSUInteger z=0;z<size;z++)for(NSUInteger y=0;y<size;y++)for(NSUInteger x=0;x<size;x++) {
if(x==0&&DYLUTCancelled(progress,error))return NO;
float rgb[3]={(float(x)/(size-1)-domainMin[0])/(domainMax[0]-domainMin[0]),
(float(y)/(size-1)-domainMin[1])/(domainMax[1]-domainMin[1]),
(float(z)/(size-1)-domainMin[2])/(domainMax[2]-domainMin[2])};
@@ -118,7 +137,7 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
return YES;
}
BOOL DYLUTReadCube(NSString *path,std::vector<float>& data,NSUInteger& size,NSError **error) {
static BOOL DYLUTReadCancellable(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;
if(!path.length)return DYLUTFail(error,@"未选择 LUT 文件");
NSDictionary *a=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:error];
@@ -127,12 +146,26 @@ BOOL DYLUTReadCube(NSString *path,std::vector<float>& data,NSUInteger& size,NSEr
DYLUTTable *cached=[DYLUTTableCache()objectForKey:key];
if(cached){data=cached->values;size=cached->dimension;return YES;}
std::vector<float> parsed;NSUInteger n=0;
if(!DYLUTParse(path,parsed,n,error))return NO;
if(DYLUTCancelled(progress,error)||!DYLUTParse(path,parsed,n,progress,error))return NO;
DYLUTTable *table=[[[DYLUTTable alloc]init]autorelease];table->values=std::move(parsed);table->dimension=n;
[DYLUTTableCache()setObject:table forKey:key cost:table->values.size()*sizeof(float)];
data=table->values;size=n;return YES;
}
BOOL DYLUTReadCube(NSString *path,std::vector<float>& data,NSUInteger& size,NSError **error) {
return DYLUTReadCancellable(path,data,size,nil,error);
}
NSProgress *DYLUTPrepareAsync(NSString *path,void (^completion)(NSError *)) {
static dispatch_queue_t queue;static dispatch_once_t once;
dispatch_once(&once,^{queue=dispatch_queue_create("com.dayu.color.lut-selection",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(queue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));});
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:1];progress.localizedDescription=@"正在载入 LUT…";
dispatch_async(queue,^{@autoreleasepool{
NSError *error=nil;std::vector<float> values;NSUInteger n=0;
DYLUTReadCancellable(path,values,n,progress,&error);DYLUTCancelled(progress,&error);progress.completedUnitCount=1;
dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});
}});return progress;
}
NSData *DYLUTTransformRGBA(NSData *source,NSUInteger width,NSUInteger height,NSString *path,NSError **error) {
if(!width||!height||width>8192||height>8192||width*height>8192*8192||source.length!=width*height*16) {
DYLUTFail(error,@"缩略图源必须是有效的 float RGBA 图像");return nil;
@@ -238,6 +271,8 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
NSURL *_rootURL;
NSArray *_entries,*_folders;
NSMutableSet *_favoritePaths;
NSObject *_fileLock;
dispatch_queue_t _fileQueue;
}
@end
@implementation DYLUTLibrary
@@ -246,25 +281,30 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
- (instancetype)initWithRootURL:(NSURL *)rootURL {
if(!rootURL.isFileURL||!rootURL.path.length){[self release];return nil;}
if((self=[super init])) {
_fileLock=[NSObject new];_fileQueue=dispatch_queue_create("com.dayu.color.lut-files",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_fileQueue,dispatch_get_global_queue(QOS_CLASS_UTILITY,0));
_rootURL=[DYLUTCanonicalURL(rootURL)copy];_entries=[@[]copy];_folders=[@[@""]copy];_favoritePaths=[NSMutableSet new];
NSDictionary *saved=[NSDictionary dictionaryWithContentsOfURL:[_rootURL URLByAppendingPathComponent:@".favorites.plist"]];
NSArray *relativePaths=[saved[@"relativePaths"]isKindOfClass:NSArray.class]?saved[@"relativePaths"]:@[];
for(NSString *path in relativePaths)if([path isKindOfClass:NSString.class]&&![path isAbsolutePath]&&![path.pathComponents containsObject:@".."]) [_favoritePaths addObject:[_rootURL.path stringByAppendingPathComponent:path]];
}return self;
}
- (void)dealloc {[_rootURL release];[_entries release];[_folders release];[_favoritePaths release];[super dealloc];}
- (void)dealloc {[_rootURL release];[_entries release];[_folders release];[_favoritePaths release];[_fileLock release];dispatch_release(_fileQueue);[super dealloc];}
- (NSURL *)rootURL {return [[_rootURL copy]autorelease];}
- (NSArray *)entries {@synchronized(self){return [[_entries copy]autorelease];}}
- (NSArray *)folders {@synchronized(self){return [[_folders copy]autorelease];}}
- (NSSet *)favoritePaths {@synchronized(self){return [[_favoritePaths copy]autorelease];}}
- (BOOL)reload:(NSError **)error {@synchronized(self){
- (BOOL)reload:(NSError **)error {return [self reloadProgress:nil error:error];}
- (BOOL)reloadProgress:(NSProgress *)progress error:(NSError **)error {@synchronized(_fileLock){
BOOL isDirectory=NO;NSFileManager *fm=NSFileManager.defaultManager;
if(![fm fileExistsAtPath:_rootURL.path isDirectory:&isDirectory]){[_entries release];_entries=[@[]copy];[_folders release];_folders=[@[@""]copy];return YES;}
if(DYLUTCancelled(progress,error))return NO;
if(![fm fileExistsAtPath:_rootURL.path isDirectory:&isDirectory]){@synchronized(self){[_entries release];_entries=[@[]copy];[_folders release];_folders=[@[@""]copy];}return YES;}
if(!isDirectory||!DYLUTOrdinaryURL(_rootURL,NULL,error))return DYLUTFail(error,@"LUT 库目录无效");
NSMutableArray *entries=[NSMutableArray array];NSMutableSet *folders=[NSMutableSet setWithObject:@""];
__block NSError *scanError=nil;
NSDirectoryEnumerator *enumerator=[fm enumeratorAtURL:_rootURL includingPropertiesForKeys:@[NSURLIsDirectoryKey,NSURLIsRegularFileKey,NSURLIsSymbolicLinkKey] options:NSDirectoryEnumerationSkipsHiddenFiles|NSDirectoryEnumerationSkipsPackageDescendants errorHandler:^BOOL(NSURL *url,NSError *e){(void)url;scanError=e;return NO;}];
for(NSURL *url in enumerator) {
if(DYLUTCancelled(progress,error))return NO;
progress.completedUnitCount++;
NSNumber *link=nil;[url getResourceValue:&link forKey:NSURLIsSymbolicLinkKey error:NULL];
if(link.boolValue){[enumerator skipDescendants];continue;}
BOOL directory=NO;if(!DYLUTOrdinaryURL(url,&directory,NULL))continue;
@@ -275,12 +315,16 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
}
if(scanError){if(error)*error=scanError;return NO;}
[entries sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){return [a[@"relativePath"]localizedStandardCompare:b[@"relativePath"]];}];
[_entries release];_entries=[entries copy];[_folders release];_folders=[[folders.allObjects sortedArrayUsingSelector:@selector(localizedStandardCompare:)]copy];return YES;
if(DYLUTCancelled(progress,error))return NO;
NSArray *sortedFolders=[folders.allObjects sortedArrayUsingSelector:@selector(localizedStandardCompare:)];
@synchronized(self){[_entries release];_entries=[entries copy];[_folders release];_folders=[sortedFolders copy];}return YES;
}}
- (NSArray *)importURLs:(NSArray<NSURL *> *)urls error:(NSError **)error {@synchronized(self){
- (NSArray *)importURLs:(NSArray<NSURL *> *)urls error:(NSError **)error {return [self importURLs:urls progress:nil error:error];}
- (NSArray *)importURLs:(NSArray<NSURL *> *)urls progress:(NSProgress *)progress error:(NSError **)error {@synchronized(_fileLock){
NSFileManager *fm=NSFileManager.defaultManager;NSMutableArray *plans=[NSMutableArray array];
NSString *root=_rootURL.path;
for(NSURL *sourceURL in urls) {
if(DYLUTCancelled(progress,error))return nil;
if(!sourceURL.isFileURL){DYLUTFail(error,@"只能导入本机 LUT 文件");return nil;}
NSURL *source=[sourceURL URLByStandardizingPath];BOOL directory=NO;
if(!DYLUTOrdinaryURL(source,&directory,error))return nil;
@@ -295,6 +339,7 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
__block NSError *scanError=nil;
NSDirectoryEnumerator *enumerator=[fm enumeratorAtURL:source includingPropertiesForKeys:@[NSURLIsSymbolicLinkKey,NSURLIsDirectoryKey,NSURLIsRegularFileKey] options:NSDirectoryEnumerationSkipsHiddenFiles|NSDirectoryEnumerationSkipsPackageDescendants errorHandler:^BOOL(NSURL *url,NSError *e){(void)url;scanError=e;return NO;}];
for(NSURL *file in enumerator) {
if(DYLUTCancelled(progress,error))return nil;
NSNumber *link=nil;[file getResourceValue:&link forKey:NSURLIsSymbolicLinkKey error:NULL];
if(link.boolValue){[enumerator skipDescendants];continue;}
BOOL subdirectory=NO;if(!DYLUTOrdinaryURL(file,&subdirectory,NULL)||subdirectory||![file.pathExtension.lowercaseString isEqual:@"cube"])continue;
@@ -308,23 +353,46 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
}
if(!plans.count){DYLUTFail(error,@"没有找到可导入的 .cube 文件");return nil;}
// Validate every source before writing the library, preserving existing files.
for(NSDictionary *plan in plans){std::vector<float> values;NSUInteger n=0;if(!DYLUTReadCube([plan[@"source"]path],values,n,error))return nil;}
progress.totalUnitCount=plans.count*2;progress.completedUnitCount=0;
for(NSDictionary *plan in plans){
NSError *itemError=nil;BOOL valid=NO;
@autoreleasepool{
progress.localizedDescription=[NSString stringWithFormat:@"正在校验 %lld/%lu",progress.completedUnitCount+1,(unsigned long)plans.count];progress.localizedAdditionalDescription=[plan[@"source"]lastPathComponent];
std::vector<float> values;NSUInteger n=0;valid=!DYLUTCancelled(progress,&itemError)&&DYLUTReadCancellable([plan[@"source"]path],values,n,progress,&itemError);[itemError retain];
}
if(!valid){if(error)*error=[itemError autorelease];else[itemError release];return nil;}[itemError release];progress.completedUnitCount++;
}
if(!DYLUTEnsureDirectory(_rootURL,_rootURL,error))return nil;
NSMutableArray *created=[NSMutableArray array],*imported=[NSMutableArray array];BOOL success=YES;
for(NSDictionary *plan in plans) {
NSURL *destination=[_rootURL URLByAppendingPathComponent:plan[@"relative"]];
if(!DYLUTEnsureDirectory(destination.URLByDeletingLastPathComponent,_rootURL,error)){success=NO;break;}
NSString *stem=destination.path.stringByDeletingPathExtension,*extension=destination.pathExtension;
NSUInteger suffix=1;
while([fm fileExistsAtPath:destination.path])destination=[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@ %lu.%@",stem,(unsigned long)++suffix,extension]];
if(![fm copyItemAtURL:plan[@"source"] toURL:destination error:error]){success=NO;break;}
[created addObject:destination];
std::vector<float> values;NSUInteger n=0;if(!DYLUTReadCube(destination.path,values,n,error)){success=NO;break;}
[imported addObject:DYLUTEntry(destination,_rootURL)];
for(NSDictionary *plan in plans){
NSError *itemError=nil;BOOL copied=NO;
@autoreleasepool{
copied=[&]()->BOOL{
if(DYLUTCancelled(progress,&itemError))return NO;
progress.localizedDescription=[NSString stringWithFormat:@"正在导入 %lu/%lu",(unsigned long)imported.count+1,(unsigned long)plans.count];progress.localizedAdditionalDescription=[plan[@"source"]lastPathComponent];
NSURL *destination=[_rootURL URLByAppendingPathComponent:plan[@"relative"]];
if(!DYLUTEnsureDirectory(destination.URLByDeletingLastPathComponent,_rootURL,&itemError))return NO;
NSString *stem=destination.path.stringByDeletingPathExtension,*extension=destination.pathExtension;NSUInteger suffix=1;
while([fm fileExistsAtPath:destination.path])destination=[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@ %lu.%@",stem,(unsigned long)++suffix,extension]];
if(![fm copyItemAtURL:plan[@"source"] toURL:destination error:&itemError])return NO;[created addObject:destination];
std::vector<float> values;NSUInteger n=0;if(!DYLUTReadCancellable(destination.path,values,n,progress,&itemError))return NO;
[imported addObject:DYLUTEntry(destination,_rootURL)];return YES;
}();[itemError retain];
}
if(!copied){if(error)*error=[itemError autorelease];else[itemError release];success=NO;break;}[itemError release];progress.completedUnitCount++;
}
if(success)success=!DYLUTCancelled(progress,error)&&[self reload:error];
if(!success){for(NSURL *url in created)[fm removeItemAtURL:url error:NULL];return nil;}
if(![self reload:error])return nil;return imported;
return imported;
}}
- (NSProgress *)reloadAsync:(void (^)(NSError *))completion {
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:-1];progress.localizedDescription=@"正在扫描 LUT 文件夹…";
dispatch_async(_fileQueue,^{@autoreleasepool{NSError *error=nil;[self reloadProgress:progress error:&error];progress.totalUnitCount=MAX(1,progress.completedUnitCount);progress.completedUnitCount=progress.totalUnitCount;dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});}});return progress;
}
- (NSProgress *)importURLsAsync:(NSArray<NSURL *> *)urls completion:(void (^)(NSArray<NSDictionary *> *,NSError *))completion {
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:-1];progress.localizedDescription=@"正在查找 LUT 文件…";NSArray *sources=[[urls copy]autorelease];
dispatch_async(_fileQueue,^{@autoreleasepool{NSError *error=nil;NSArray *imported=[self importURLs:sources progress:progress error:&error];dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(imported,error);});}});return progress;
}
- (BOOL)isFavoritePath:(NSString *)path {@synchronized(self){return [_favoritePaths containsObject:path];}}
- (BOOL)setFavorite:(BOOL)favorite forPath:(NSString *)path error:(NSError **)error {@synchronized(self){
NSString *prefix=[_rootURL.path stringByAppendingString:@"/"];
+4 -4
查看文件
@@ -7,9 +7,9 @@ static NSDictionary *row(NSString*k,NSString*t,NSUInteger o,double lo,double hi,
NSMutableDictionary*r=[@{@"key":k,@"title":t,@"pid":@(PID(o)),@"offset":@(o),@"min":@(lo),@"max":@(hi),@"default":@(d),@"step":@(hi-lo>10?1:.01),@"kind":kind?:@"float"}mutableCopy];
[descriptors addObject:r];return [r autorelease];
}
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=1){
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=0){
NSDictionary*e=row([k stringByAppendingString:@"Enabled"],t,offset,0,1,def,@"bool");
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"rows":rows}];
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"defaultEnabled":@(def),@"rows":rows}];
}
static NSDictionary *scalar(NSString*k,NSString*t,NSUInteger o,double lo=-100,double hi=100,double def=0){return row(k,t,o,lo,hi,def,@"float");}
static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
@@ -26,8 +26,8 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
[descriptors replaceObjectAtIndex:[descriptors indexOfObjectPassingTest:^BOOL(id obj,NSUInteger idx,BOOL*stop){return [obj[@"key"]isEqual:keys[i]];}] withObject:r];[base addObject:r];
}
NSDictionary*copyAuto=@{@"key":@"copyAutoGrade",@"title":@"复制时自动调色",@"pid":@8800,@"offset":@(-1),@"min":@0,@"max":@1,@"default":@0,@"step":@1,@"kind":@"bool",@"notAnimatable":@YES};[descriptors addObject:copyAuto];
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto]);
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]]);
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto],1);
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]],1);
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],0);
NSMutableArray*look=[NSMutableArray arrayWithObject:scalar(@"postLUTStrength",@"风格 1 强度",60,0,1,1)];
for(int i=0;i<4;i++){[look addObject:row([NSString stringWithFormat:@"look%dEnabled",i+2],[NSString stringWithFormat:@"风格 %d 启用",i+2],160+i*4,0,1,1,@"bool")];[look addObject:scalar([NSString stringWithFormat:@"look%dStrength",i+2],[NSString stringWithFormat:@"风格 %d 强度",i+2],64+i*4,0,1,1)];}
+17 -10
查看文件
@@ -11,16 +11,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts;
DYColorTables *_tables;
NSObject *_previewLock;
NSData *_preview,*_lookLUTPreview;
CFTimeInterval _lastPreview;
}
@end
@implementation DYRenderer
- (instancetype)init{if((self=[super init])){_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_devices release];[_luts release];[_tables release];[_preview release];[_lookLUTPreview release];[super dealloc];}
- (void)invalidatePreview{@synchronized(self){[_preview release];_preview=nil;[_lookLUTPreview release];_lookLUTPreview=nil;_lastPreview=0;}}
- (NSData*)preview{@synchronized(self){return [[_preview retain]autorelease];}}
- (NSData*)lookLUTPreview{@synchronized(self){return [[_lookLUTPreview retain]autorelease];}}
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_devices release];[_luts release];[_tables release];[_preview release];[_lookLUTPreview release];[_previewLock release];[super dealloc];}
- (void)invalidatePreview{@synchronized(_previewLock){[_preview release];_preview=nil;[_lookLUTPreview release];_lookLUTPreview=nil;_lastPreview=0;}}
- (NSData*)preview{@synchronized(_previewLock){return [[_preview retain]autorelease];}}
- (NSData*)lookLUTPreview{@synchronized(_previewLock){return [[_lookLUTPreview retain]autorelease];}}
- (NSMutableDictionary*)device:(uint64_t)registry error:(NSError**)err{
NSNumber*k=@(registry);NSMutableDictionary*entry=_devices[k];if(entry)return entry;
id<MTLDevice>d=nil;NSArray*all=MTLCopyAllDevices();for(id<MTLDevice>candidate in all)if(candidate.registryID==registry||!registry){d=[candidate retain];break;}[all release];if(!d){fail(err,@"宿主的 Metal 设备不可用");return nil;}
@@ -38,11 +39,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
std::vector<float>v;NSUInteger n=0;if(!DYLUTReadCube(path,v,n,err))return nil;t=texture3D(e[@"device"],v.data(),n);if(!t){fail(err,@"LUT 纹理分配失败");return nil;}if(_luts.count>=12)[_luts removeAllObjects];_luts[key]=t;return t;
}
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
NSString*input=paths[@"input"];int profile=(int)roundf(u->inputProfile);
// Normalize only this render copy. Folded groups retain their host parameters
// and paths, while inactive LUTs neither load files nor affect any layer.
BOOL inputEnabled=u->inputSectionEnabled>.5;
NSString*input=inputEnabled?paths[@"input"]:nil;int profile=inputEnabled?(int)roundf(u->inputProfile):0;
if(!inputEnabled){u->inputProfile=0;u->preLUTStrength=0;}
if(!input.length&&profile>0&&profile<(int)inputFiles().count)input=[[NSBundle bundleForClass:self.class]pathForResource:inputFiles()[profile] ofType:@"dylut" inDirectory:@"InputLUTs"];
if(profile>0&&!input.length){fail(err,@"相机输入转换资源缺失");return nil;}
NSMutableArray*ts=[NSMutableArray array];id<MTLTexture>t=[self lut:input entry:e error:err];if(!t)return nil;[ts addObject:t];if(!input.length)u->preLUTStrength=0;
for(int i=0;i<5;i++){NSString*p=paths[[NSString stringWithFormat:@"look%d",i]];t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
BOOL looksEnabled=u->lookSectionEnabled>.5;
if(!looksEnabled)u->extraLookSectionEnableds=(DYFloat4){0,0,0,0};
for(int i=0;i<5;i++){BOOL active=looksEnabled&&(i==0||u->extraLookSectionEnableds[i-1]>.5);NSString*p=active?paths[[NSString stringWithFormat:@"look%d",i]]:nil;t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
[DYColorTables fillPrimaries:u];id<MTLDevice>d=e[@"device"];
id<MTLTexture>h=[_tables hslForDevice:d uniforms:u],w=[_tables whiteBalanceForDevice:d uniforms:u],g=[_tables gradingForDevice:d uniforms:u];if(!h||!w||!g){fail(err,_tables.lastError?:@"颜色查表构建失败");return nil;}[ts addObjectsFromArray:@[h,w,g]];return ts;
}
@@ -54,14 +61,14 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyUnpremultiply"]];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
float level=.5;id<MTLBuffer>scene=[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared];
if(u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
BOOL preview=CACurrentMediaTime()-_lastPreview>.5;id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
BOOL preview=NO;@synchronized(_previewLock){preview=CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
MTLRenderPassDescriptor*rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=output;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>re=[cb renderCommandEncoderWithDescriptor:rp];[re setRenderPipelineState:pipeline];
float w=output.width,h=output.height;FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){top=1-top;bottom=1-bottom;}
DYVertex2D vs[]={{{w/2,-h/2},{r,bottom}},{{-w/2,-h/2},{l,bottom}},{{w/2,h/2},{r,top}},{{-w/2,h/2},{l,top}}};
if(dst.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)for(int i=0;i<4;i++)vs[i].position.y=-vs[i].position.y;
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,0,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
if(ok&&pb){
if(ok&&pb){@synchronized(_previewLock){
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
// 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.
@@ -72,7 +79,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
_lookLUTPreview=[topFirst copy];
}else _lookLUTPreview=[_preview retain];
_lastPreview=CACurrentMediaTime();dispatch_async(dispatch_get_main_queue(),^{[[NSNotificationCenter defaultCenter]postNotificationName:@"DYPreviewDidChange" object:self];});
}
}}
if(!ok)fail(err,cb.error.localizedDescription);[pb release];[straight release];[scene release];return ok;
}}}
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.1.3</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>14</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+3 -3
查看文件
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<string>DayuColor.icns</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.1.3</string>
<key>CFBundleVersion</key>
<string>6</string>
<string>14</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
二进制文件未显示。