比较提交

..
作者 SHA1 备注 提交日期
mac cf5a97cac9 release: publish and fully download-verify the 1.2.0 installer attachment 2026-11-01 18:16:38 +08:00
mac 8074444259 chore: confirm unique formal installation and generated-copy cleanup 2026-11-01 18:13:18 +08:00
mac c2c65aaaff release: deliver 1.2.0 CST and independent module disclosure with verified signed installer 2026-11-01 18:12:49 +08:00
mac 48b00c8579 feat: validate CST primary color pipeline, neutral all-on defaults and saved independent disclosure 2026-11-01 18:03:41 +08:00
mac d2bf0696bd WIP: integrate source CST primary pipeline and independent module disclosure; validation pending 2026-11-01 17:57:33 +08:00
mac 76537da0a6 docs: hand off dayu-color input LUT browser work with explicit project identity 2026-11-01 17:05:05 +08:00
mac 3e25549882 release: publish and verify the 1.1.5 installer Release attachment 2026-11-01 16:23:44 +08:00
mac 1ad9c9d33c docs: record Release publication workflow and pending system authorization 2026-11-01 16:12:43 +08:00
mac e0c18d5a51 build: retain actionable Release API authorization failures 2026-11-01 16:11:00 +08:00
mac d1019e5b99 build: add verified package Release publication entry and 1.1.5 notes 2026-11-01 16:01:25 +08:00
mac 06968514fc release: package notarized 1.1.5 with verified Unicode LUT support 2026-11-01 15:48:08 +08:00
mac de6973f555 release: verify Unicode LUT import and all sixteen encodings in Final Cut Pro 2026-11-01 15:46:53 +08:00
mac 59b058a3c8 perf: keep ASCII LUT parsing fast alongside Unicode decoding 2026-11-01 15:38:52 +08:00
mac 8951725be2 feat: decode UTF-16 and UTF-32 Cube LUTs without rewriting their bytes 2026-11-01 15:37:26 +08:00
mac 6d48b653a5 release: publish notarized 1.1.4 package and final delivery records 2026-11-01 15:28:19 +08:00
mac 93e2157826 release: verify 1.1.4 with real N12 LUTs in Final Cut Pro 2026-11-01 15:27:30 +08:00
mac 497eef29fe fix: import legacy-title Cube folders and verify all 26 supplied LUTs 2026-11-01 15:21:18 +08:00
mac 593aad9ecb fix: prepare and pin external LUT snapshots before acknowledging thumbnail application 2026-11-01 15:05:42 +08:00
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
共修改 55 个文件,包含 12171 行新增和 237 行删除

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

+18
查看文件
@@ -0,0 +1,18 @@
大鱼调色 1.1.5(16),适用于 Apple Silicon Mac,最低 macOS 14.6。
- 新增 UTF-16、UTF-32 大小端及有无 BOM 的 Cube LUT 读取。
- 兼容 UTF-8 和常见旧编码的标题、注释,以及常见换行和 Unicode 空白。
- LUT 在后台解析、准备和导入,保留原文件及导入副本的原始字节。
- 16 种编码样本已在 Final Cut Pro 12.4 中完成导入、缩略图、逐项应用和保存重开验收;原生渲染与编码回归通过。
安装包包含原生 FxPlug 程序和 FCP 效果模板,不含用户 LUT、预设或媒体。安装前保存工作并正常退出 Final Cut Pro / Motion;完成安装后重新打开宿主。
安装包已由 Developer ID Installer 签名,通过 Apple 公证并粘附票据;20 项展开验包通过。包内程序与正式安装版本一致。本轮未再次执行该 PKG 的系统安装。
版本标签:`v1.1.5-lut-encoding-20261101`
交付记录提交:`06968514fc5205a83fbf3c5a3dbb1be0f6f3e79b`
APP 实际编译源码:`59b058a3c8b9e5387381574da6bbc05af437527c`
附件:`大鱼调色-1.1.5.pkg`
大小:13,752,153 字节
SHA-256:`bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071`
+18
查看文件
@@ -0,0 +1,18 @@
大鱼调色 1.2.0(17),适用于 Apple Silicon Mac,最低 macOS 14.6。
- 输入还原改为大鱼 CST 的输入转换、工作空间一级调色和输出转换,曲线与色域独立选择。
- 标题只展开/折叠,小眼睛只启用/旁路,独立保存。默认一级调色与基础调整展开,其余折叠,所有眼睛开启。
- 保留旧工程输入 LUT/相机档位兼容;风格 LUT、编码兼容、后台加载及自动分析继续可用。
- Cube 导出包含 CST 与一级调色;黑白新增默认 0% 混合,默认画面中性。
- 153 项原生检查及 21 组独立 CST 像素对照通过;FCP 12.4 默认、独立开关、参数保留、Sony/ACES 选择、保存重开及风格库应用验收通过。
安装包包含原生 FxPlug APP 和 FCP 模板,不含用户 LUT、预设或媒体。安装前保存工作并正常退出 Final Cut Pro/Motion。APP 和 PKG 均完成正式签名、公证、票据与 Gatekeeper 核验,20 项展开验包通过;本轮未重复执行 PKG 安装。
版本标签:`v1.2.0-cst-fold-20261101`
APP 实际编译源码:`48b00c85799b0226ba32aba3f2e5397aa0e509ed`
APP 公证:`f25ae46e-92da-4470-842e-128bdb232aa8`,Accepted
PKG 公证:`c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted
附件:`大鱼调色-1.2.0.pkg`
大小:13,818,397 字节
SHA-256:`9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`
+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=delivery.get("hostVerification", "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()
+42
查看文件
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
"""Upload the exact verified package recorded by an existing release tag."""
import argparse
import json
from pathlib import Path
import subprocess
ROOT = Path(__file__).resolve().parent.parent
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--tag", required=True)
parser.add_argument("--notes", required=True, type=Path)
parser.add_argument("--pkg-forge-repo", type=Path,
default=Path.home() / "Documents/dayu-git/repositories/pkg-forge")
args = parser.parse_args()
report = json.loads((ROOT / "verification/Package.json").read_text())
assert report["pass"] and not report["testUnsigned"] and report["notarization"]["status"] == "Accepted"
tag_report = json.loads(subprocess.check_output(
["git", "show", args.tag + ":verification/Package.json"], cwd=ROOT, text=True))
for key in ["sha256", "bytes", "appCompiledSource", "appBuild"]:
assert tag_report[key] == report[key], "所选标签与当前已验包记录不一致:" + key
app = report["resources"][0]
assert app["bundleID"] == "com.dayu.color" and app["version"] == tag_report["resources"][0]["version"]
package = Path(report["package"])
signature = subprocess.check_output(["pkgutil", "--check-signature", str(package)], text=True)
assert "Developer ID Installer: zhong luo (B3W25FX5H5)" in signature
subprocess.run(["xcrun", "stapler", "validate", str(package)], check=True, capture_output=True)
subprocess.run(["spctl", "--assess", "--type", "install", str(package)], check=True, capture_output=True)
commit = subprocess.check_output(["git", "rev-parse", args.tag + "^{commit}"], cwd=ROOT, text=True).strip()
helper = args.pkg_forge_repo / "skills/pkg-forge/scripts/publish_release.py"
result = subprocess.run(["python3", str(helper), "--repository", "dayu/dayu-color", "--repo-root", str(ROOT),
"--tag", args.tag, "--commit", commit, "--title", "大鱼调色 " + app["version"] + "(" + app["build"] + ")",
"--body-file", str(args.notes.resolve()), "--asset", str(package), "--sha256", report["sha256"],
"--bytes", str(report["bytes"]), "--account", "dayu",
"--report", str(ROOT / "verification/Release.json")])
return result.returncode
if __name__ == "__main__":
raise SystemExit(main())
+23 -23
查看文件
@@ -1,37 +1,37 @@
# 大鱼调色
原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
原生 FxPlug 4 调色器,当前正式版本 **1.2.0(17)**。唯一安装位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;Final Cut Pro 中从“效果 → 大鱼调色”添加。
支持 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)
前段已改为 **输入转换 → 工作空间一级调色 → 输出转换**,复用大鱼 CST 仓库的固定源码与原生 GPU 数学。曲线和色域独立选择,工作空间统一供一级调色及输出使用,不经相机还原 LUT 近似。
当前正式版本为 1.1.3(14),交付标签 `v1.1.3-async-lut-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
新实例输入与输出均为 Gamma 2.4 / Rec.709,工作空间为 DaVinci Intermediate / DaVinci Wide Gamut,自动色调映射关闭。请按素材实际编码选择相机输入;不会根据片段或曲线名称猜测、覆盖手选色域。一级调色包含曝光、色彩平衡、饱和度、对比度与轴心、分区影调、黑白点、趾部/肩部压缩和旁路。
程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。
CST 后的基础调整、HSL、曲线、色轮、五层风格 LUT 等仍属于既有显示域调色链。保留肤色保护、三原色、色阶、黑白、自动调色、吸管、预设和 Cube 导出。Cube 导出包含 CST 和一级调色,不包含空间细节或逐画面统计。
主题与 LUT 浏览库自 1.1.0(6)提供,源码标签 `v1.1.0-theme-lut-20261031`。灰、蓝、紫、绿、橙五套主题切换后跨实例记忆。风格 LUT 左侧网格按钮打开缩略图浏览器,右侧文件夹按钮打开 `~/Movies/大鱼调色LUT/look LUTs`。可导入文件或目录,按目录与名称过滤,单击应用,缩略图大小与目录会保存。
旧工程的输入 LUT / 相机档位和原画面保持兼容;在输入组看到“旧版输入 → 改用 CST”时,可明确切换。编辑 CST 参数也会启用新链路。旧参数 ID、LUT 路径与预设读取保留。
缩略图使用当前素材先经过输入 LUT 的画面;没有源帧时显示本产品生成的色卡。显示方向与宿主图像原点一致,自动分析保留自己的原始数据。浏览器优先采用 FxPlug 宿主窗口,不能使用时回退为锚定弹出面板。品牌保留大鱼,吸管仍为系统取色器。
## 模块界面
算法背景资料补充了同系列工程的 **Color Finale 移植研究**,涵盖调色工具、LUT 预览、图层与蒙版工作流;归档记录、适用范围及当前实现的来源区分见 [算法说明](research/ALGORITHM_SOURCES.md)。Camera Raw 查表数据与组合行为采用 Compositor 的 MIT 许可实现,许可证随资源保留。
新实例和“全部还原”默认展开 **一级调色、基础调整**,其余折叠,所有眼睛开启。标题只控制展开;眼睛只负责启用/旁路,两者分别保存,正常重开仍保留。折叠保留参数、LUT 选择和效果。黑白混合默认 0%,避免全眼睛开启时直接变成黑白。
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建使用仓库中的源码和资源。
五套主题跨实例记忆。风格 LUT 网格打开缩略图浏览库;用户库为 `~/Movies/大鱼调色LUT/look LUTs`。后台扫描、导入、解析、预览、取消和最后一次选择生效的机制保留;支持既有 UTF-8/16/32 与旧编码 Cube 兼容。用户文件不进入源码或安装包。
选择自有 LUT 后,预设记录其绝对路径;跨机器搬移时同时保留 LUT 文件并重新选择。LUT 导出只保存逐像素颜色,不包含纹理、清晰度或逐画面分析。
## 验证与恢复
`tools/create_lut_host_fixture.py` 可重建独立 FCP 验收 XML 和四个合成测试 LUT;它只写产品缓存,不会向用户库自动导入。LUT 核心检查见 `verification/LUTLibrary.json`,主题与浏览库实现说明见 `research/ThemeLUT-analysis.md`。
- [本轮交接](大鱼调色FxPlug4交接.md)
- [CST 来源与集成边界](research/CSTIntegration.md)
- [CST 固定源码节点与摘要](research/CSTIntegration.json)
- [153 项原生与独立像素对照](verification/CSTIntegration.json)
- [正式 FCP 界面与保存重开](verification/HostCSTAndDisclosure.json)
- [正式安装与公证](verification/Delivery.json)
- [远端独立恢复与着色器重建](verification/CSTRecovery.json)
- [完整恢复说明和历史](RECOVERY.md)
- [原有算法来源](research/ALGORITHM_SOURCES.md)
`tools/create_group_fold_host_fixture.py` 可创建独立的合成验收时间线,用于检查新实例仅基础调节默认启用、分组展开/折叠与数值保留。风格 LUT 总组停用会旁路全部五层;停用的输入或风格 LUT 不加载其文件。
构建使用 `Wrapper Application` 方案、Release。运行 `python3 tools/deliver.py` 完成签名、公证、唯一安装和正式宿主验收;更改模型后运行 `python3 tools/build_template.py --refresh-model --overwrite`。`tools/create_cst_host_fixture.py` 重建独立合成验收 XML,不写用户 LUT 库。
LUT 文件夹扫描、逐项校验/复制和选择文件后的解析均在后台执行;导入期间可继续搜索、滚动和选择,刷新按钮临时变为“取消”。失败或取消会移除本次新复制的文件并保留既有库。目录与缩略图只为可见范围创建控件,预览逐项出现;快速切换时仅应用最后一次选择。24个65级合成LUT与3,025项库的响应测试见 [LUTResponsiveness.json](verification/LUTResponsiveness.json)。
正式发行包由 PKG 工坊技能生成,包含 APP 与 FCP 模板,不含用户 LUT、预设或媒体。安装与发布证据分别保存在 [Package.json](verification/Package.json) 和 [Release.json](verification/Release.json);以其中记录的版本和成功状态为准。
正式安装包:[大鱼调色-1.2.0.pkg](../发行包/大鱼调色-1.2.0.pkg);已发布至 [1.2.0 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.2.0-cst-fold-20261101),完整下载字节数和 SHA-256 校验通过。
+90 -3
查看文件
@@ -1,14 +1,33 @@
# 大鱼调色恢复说明
## 当前 1.2.0(17)交付
版本标签 `v1.2.0-cst-fold-20261101`;实际编译源码 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`。正式 APP 公证 `f25ae46e-92da-4470-842e-128bdb232aa8`,Accepted,票据和 Gatekeeper 通过;唯一安装路径及服务进程已在 FCP 12.4 核对。签名团队 B3W25FX5H5,固定缓存和公证配置不变。
前段复用 `dayu/dayu-cst` 的 `973766b51dbcab3ab5092f1955d753575cd32d89` 源码:输入曲线/色域 → 工作空间一级 → 输出曲线/色域,源码副本与摘要均在本仓库,不依赖另一份 CST APP 才能生产运行。原始 944 字节调色 ABI 前缀保留,新增控制追加其后。来源见 research/CSTIntegration.json。
一级调色与基础调整默认展开,其他模块折叠,全部眼睛开启;折叠独立写入 InspectorToken,不修改渲染参数。新 InspectorToken schema 2,旧 schema 1 及旧输入 LUT/预设继续读取。旧工程默认旁路新 CST,直到明确迁移;黑白新增混合,旧工程保留原黑白效果。新默认 Rec.709/Gamma 2.4 往返保持中性。
153 项原生检查通过,21 组独立 CST 像素对照最大分量误差 0.0000152587890625,正式路径常规自检 110 项通过;FCP 新实例默认、折叠、眼睛、0.70 曝光、Sony/ACES 选择及保存重开通过。风格库 N12 的 26 项可见并可应用。宿主观察不冒充逐像素导出一致,Motion/Intel/旧系统未验收。
远端独立克隆实际编译节点,151 个提交文件校核、full/strict fsck,以及着色器重建均通过,重建 SHA 与正式库一致。详见 verification/CSTRecovery.json。无 LFS、无子模块。签名私钥和用户 LUT 仍须独立恢复。
安装包/Release 的版本、摘要、标签、附件下载校验分别见 verification/Package.json 和 verification/Release.json;尚未产生本版本成功记录时不能据历史记录宣称发布完成。本轮 APP 已完成唯一安装,PKG 只展开验包,不重复运行安装脚本。
远程:https://dayu.media/git/dayu/dayu-color.git,分支main。
初始化基线:10987dd6bcc6986ea321eff75b37d4e8b48e966d;后续节点见git log。
产品主ID:com.dayu.color,XPC:com.dayu.color.XPC;唯一正式位置:/Library/Plug-Ins/FxPlug/大鱼调色.app。
当前交付标签:v1.1.3-async-lut-20261101。APP 1.1.3(14)编译源码:6452e793f974234b5ffffdfad5dc3ddeee64d53c;标签另含最终宿主验收与恢复记录。Apple 公证 ID d47784c7-7cad-4837-93ab-9bce5d8c19da,Accepted;正式签名、票据、Gatekeeper 与唯一安装均通过,见 verification/Delivery.json。
历史 1.1.5 交付标签:v1.1.5-lut-encoding-20261101。APP 1.1.5(16)编译源码:59b058a3c8b9e5387381574da6bbc05af437527c;标签另含最终宿主验收与恢复记录。Apple 公证 ID b47b6fe8-b7a9-4112-93b9-de85b03ca598,Accepted;正式签名、票据、Gatekeeper 与宿主重开均通过,见 verification/Delivery.json 和 verification/HostLUTEncoding.json。
外部LUT版本 v1.1.4-external-lut-20261101 保留,编译源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14,原公证ID d9d9b05a-58b5-4a7a-aac2-6433b87d901d。
后台加载版本 v1.1.3-async-lut-20261101 保留,编译源码6452e793f974234b5ffffdfad5dc3ddeee64d53c,原公证ID d47784c7-7cad-4837-93ab-9bce5d8c19da。
分组折叠版本 v1.1.2-group-fold-20261031 保留,编译源码 cdcb30a6aa1519bfb2f183165fef11cbf278bc7c,原公证 ID 398b020c-9e1e-4c2b-b637-e8e3af2a8f59。
所有调色分组展开即启用、折叠即停用,关闭时参数不可见;仅基础调节在新实例和全部还原后默认展开。折叠保留数值和 LUT 路径;打开已保存实例时按其实际启用状态展开。基础调节同时控制原光影与颜色两个子组。风格 LUT 总组停用时全部五层均旁路,关闭的输入或风格 LUT 不加载文件。肤色保护的百分比字段按0–100范围显示和保存。
历史 1.1.2–1.1.5 行为(已由 1.2.0 取代):所有调色分组展开即启用、折叠即停用,关闭时参数不可见;仅基础调节在新实例和全部还原后默认展开。折叠保留数值和 LUT 路径;打开已保存实例时按其实际启用状态展开。基础调节同时控制原光影与颜色两个子组。风格 LUT 总组停用时全部五层均旁路,关闭的输入或风格 LUT 不加载文件。肤色保护的百分比字段按0–100范围显示和保存。
FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红45与肤色65%跨折叠及保存重开保留、全部还原后只展开基础调节的验收见 verification/HostGroupFolding.json。仅在独立合成验收项目中改值,最后恢复默认;用户媒体和其他产品未作改动。
@@ -20,7 +39,7 @@ FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红4
本次编译节点的远端独立克隆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。构建只使用仓库内的源码与资源。
图标版本的远端独立克隆113文件比对、strict/full fsck和三种导出资源逐字节重建见 verification/BrandRecovery.json。主题/LUT源码的完整 XPC Release 重建和73项原生自检见 verification/ThemeLUTRecovery.json;当前Release送公证前及正式安装后均通过92项原生自检,正式结果见 verification/InstalledSelfTest.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建只使用仓库内的源码与资源。
## 恢复和构建
@@ -73,3 +92,71 @@ verification/LUTResponsiveness.json 记录同一组 24 个 65³ 合成 LUT(197
远端编译源码 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 实现不适用。
## 外部 LUT 与旧编码目录修复(2026-11-01)
1.1.4(15)先在后台解码并上传 GPU,宿主写入成功后才确认缩略图选择。不可变表独立于缩略图缓存保留;测试中删除已选65³源文件、再加载14个其他表淘汰缓存,仍可输出逐像素一致的画面。预览采用 utility 优先级,当前选择采用 user-initiated 优先级;GPU 设备0和真实 registry ID复用相同设备资源。恢复旧工程时未准备的路径仍可能在渲染工作线程首次加载,不能把此结果解释为任何恢复场景都不读文件。
实际 N12精选luts 包含26个真实Cube、91,960,032字节,维度16/17/32/33/64。“青橙色.cube”和“青橙色2.cube”含非UTF-8描述性TITLE,旧版因此将整批导入中止。修复只放宽标题/注释编码,尺寸、DOMAIN和数字尾部继续校验;原文件和导入副本逐字节一致。文件系统另有AppleDouble元数据,Foundation枚举未把它们作为本次LUT输入,它们不是此次故障原因。
真实目录隔离导入26/26、全部缩略图通过,主循环最大空档6.275毫秒;真实原目录及正式安装后用户库副本分别通过171项Metal/IOSurface检查。合成库回归112项通过;浏览器与宿主确认状态、取消、快速切换等67项通过,24个65³文件导入7.681秒,主循环最大空档6.696毫秒。量化数据是本机运行循环测试,不能当作所有机器和存储的性能承诺。结果见verification/ExternalLUTActivation.json。
正式安装的FCP12.4中已看到N12目录完整26项,全部导入副本核对一致;实际应用青橙色两份及64³文件、搜索、连续切换、清除、正常退出重开均通过。验收开始时目录已在用户操作后导入,未重复导入。原有4个LUT保留,N12的26个导入副本保留;恢复验收前用户选中的“复古-大白鲨”、空搜索及N12目录,不改第一段其他插件效果。未捕获先前未指定文件的卡死现场,因此仅就这些实际文件和已检查路径报告通过。
源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14从远端独立恢复133个已提交文件、strict/full fsck、恢复源码重编译112项库检查通过,见verification/ExternalLUTRecovery.json。LUT文件未进入Git或PKG,新机器须另行搬移用户库。
真实目录复测可用tools/verify_external_lut_folder.mm与DYLUTLibrary.mm,链接Foundation、AppKit和zlib构建;调用参数为源目录及报告JSON。该工具只读源文件并使用独立临时库,完成后清理。正式XPC的--self-test可选环境变量DY_DIAGNOSTIC_LUT_FOLDER指向实际LUT目录,逐文件准备和渲染;正常插件运行不读取这个诊断变量。
## Cube 文本编码兼容(2026-11-01)
1.1.5(16)支持 UTF-8 BOM/无BOM、UTF-16 LE/BE 与 UTF-32 LE/BE 的有无BOM文件。无BOM时只根据可识别的Cube起始内容判断字节序,不任意删除NUL字节。宽字符解码在后台进行,每约16KB检查取消;合法字符转换为工作副本,导入仍逐字节复制原文件。中文、日文与非BMP标题已覆盖。ASCII兼容的GB18030、Big5、Shift JIS、Windows-1252、MacRoman和ISO-8859-1标题/注释不要求UTF-8;无需为了显示标题而猜测这些编码。
LF、CRLF、CR、Unicode横向空白和宽字符文本中的Unicode换行已覆盖。截断单元、非法UTF-16代理对、UTF-32越界/代理值、宽字符NUL和非法数值不会通过有损转换绕过校验;维度2–128与单文件256MB限制保持。未增加其他LUT文件格式或承诺所有历史字符集。模型、GPU数学和二进制dylut未变。
独立编码回归报告179项通过,混合编码40文件异步导入含54,925,360字节UTF-32 65³样本,主循环最大空档6.283毫秒;核心库112项、浏览器67项通过。ASCII快速路径保留普通LUT速度:24个65³合成文件导入7.526秒,主循环最大空档6.3毫秒。N12原26个实际LUT导入与缩略图回归通过。正式APP自检92项通过,16份33³编码样本的实际Metal渲染检查141项通过。详见verification/LUTEncoding.json。
FCP12.4通过原生文件夹选择框导入全部16个UTF-8/16/32与旧编码样本,缩略图和逐项应用全部通过;UTF-32 BE无BOM路径保存、正常退出重开仍生效。验收后恢复用户原“复古-大白鲨”、N12目录和空搜索,仅按清单摘要删除16个测试导入副本;原有30个LUT逐字节不变,N12的26项保留。详情见verification/HostLUTEncoding.json。本轮未强制退出宿主或改动第一片段的其他插件。
源码59b058a3c8b9e5387381574da6bbc05af437527c已从远端独立恢复138文件、strict/full fsck,恢复源码重建112项库及179项编码回归通过,见verification/LUTEncodingRecovery.json。tools/create_lut_encoding_fixture.py在固定产品缓存重建16个合成宿主样本,不自动导入用户库;tools/verify_lut_encoding.mm与DYLUTLibrary.mm链接Foundation、AppKit和zlib可重测编码/取消/字节保留。正式XPC的DY_DIAGNOSTIC_LUT_FOLDER诊断方式同前。
## 正式 PKG(2026-11-01)
当前安装包:上级发行包/大鱼调色-1.1.5.pkg,13,752,153字节,SHA256 bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071。Apple公证ID 90a38636-93bb-4693-8db2-16b9a815e409,Accepted;Installer团队B3W25FX5H5、可信时间戳、票据、Gatekeeper和20项真实展开验包通过。包内APP与1.1.5(16)正式安装逐字节一致,宿主验收为verification/HostLUTEncoding.json。源码技能采用191da9dc0abfda83fcc5939f6fc90e4c9019f4d9,发行标签v1.1.5-lut-encoding-20261101同时包含应用和PKG记录。
APP编译源码59b058a3c8b9e5387381574da6bbc05af437527c;恢复后先完成APP正式交付,再运行Packaging/build_pkg.py。没有再次执行本PKG的系统安装。当前包不含用户LUT、测试LUT、媒体或偏好;本轮生成的APP、旧版备份、解包/打包暂存和公证ZIP均已核对清理。历史包保留。
### 历史 1.1.4 安装包
安装包:上级发行包/大鱼调色-1.1.4.pkg,13,750,251字节,SHA256 b078fc5a86763edeab07002eb00dd13355d28a5c61bb4bed487eb93c0a8b316d。Apple公证ID 1b7bbefe-956c-45bd-8a68-cd6720a9c00d,Accepted;Installer团队B3W25FX5H5、可信时间戳、票据、Gatekeeper和20项真实展开验包通过。包内APP与1.1.4(15)正式安装逐字节一致,宿主验收为verification/HostExternalLUT.json。源码技能采用191da9dc0abfda83fcc5939f6fc90e4c9019f4d9,发行标签v1.1.4-external-lut-20261101同时包含应用和PKG记录。
APP编译源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14;恢复后先完成APP正式交付,再运行Packaging/build_pkg.py。没有再次执行本PKG的系统安装,不能将结构验包描述为安装脚本已经实际运行。原1.1.3安装包与历史标签保留;当前包不含N12 LUT、用户媒体或偏好。旧版14备份由管理员所有,已在系统管理员授权后清理;本轮生成的APP、解包/打包暂存和公证ZIP均已核对清理。
### 历史 1.1.3 安装包
安装包:上级发行包/大鱼调色-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标签保留。
## Release 附件发布(2026-11-01)
全局AGENTS规则负责源码/标签推送及正式发行包Release保存;pkg-forge技能提供上传入口。产品入口Packaging/publish_release.py只接受已签名公证、验包通过且与所选版本标签中记录一致的安装包;版本说明在Packaging/Release-1.1.5.md。新Release先草稿,完整下载附件核对大小/SHA-256后再发布;同名一致附件复用,冲突停止,不移动原版本标签。记录在verification/Release.json,发布成功前不能把源码推送或本地包存在描述为附件已经上传。
最初浏览器Git凭据的POST Release请求被会员网关按设计拒绝403,回读未创建Release。用户随后授权独立API发布凭据,并通知线上权限已更新;专用API凭据已通过系统钥匙串确认。其范围为read:user与write:repository,不包含管理员权限;未修改原Git凭据。授权信息和令牌不随源码恢复,新机器通过正常网站与系统钥匙串重新配置。
正式Release:https://dayu.media/git/dayu/dayu-color/releases/tag/v1.1.5-lut-encoding-20261101;Release ID355,附件ID8,关联原标签06968514fc5205a83fbf3c5a3dbb1be0f6f3e79b,标签未移动。仅上传一次大鱼调色-1.1.5.pkg,13,752,153字节,SHA256 bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071。
草稿Web下载对令牌请求返回404,但正常登录会话可下载。通过Edge实际下载草稿附件、核对全部字节和SHA后才由API发布;发布后再次用上传器完整下载正式链接并回读Release/附件,复用同一个附件且校验通过。草稿下载的临时副本按来源、创建时间和摘要核实后清理,本地正式发行包保留。详见verification/Release.json;此过程没有重新构建或改动已验包安装包,也未再次安装PKG。
## 1.2.0 正式 PKG
正式包 `../发行包/大鱼调色-1.2.0.pkg`,13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。PKG 公证 `c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted;Installer 团队 B3W25FX5H5、票据、Gatekeeper 及 20 项展开验包通过。包内 APP 与已验收正式安装一致,未重复运行安装器。
正式 Release 已发布并完整下载校验:[1.2.0 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.2.0-cst-fold-20261101),Release ID 363,附件 ID 10。关联标签完整提交 `8074444259fbacc758ec003aa91a6331b6224a85`,APP 实际编译 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`;附件 13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。草稿下载验证后才发布,发布后再次用上传器完整下载并回读核对;仅一次附件上传,未覆盖历史附件或移动标签。浏览器临时下载副本已按大小、摘要和来源核实清理,本地正式发行包保留。
+21
查看文件
@@ -0,0 +1,21 @@
{
"repository": "https://dayu.media/git/dayu/dayu-cst.git",
"commit": "973766b51dbcab3ab5092f1955d753575cd32d89",
"files": [
{
"source": "tools/kernels/CSTKernel.ll",
"destination": "tools/kernels/CSTKernel.ll",
"sha256": "78c2414d1c086dc7eaa043308f0febd32691b1ad49629febdcc1138b232cefc8"
},
{
"source": "tools/kernels/BasisKernel.ll",
"destination": "tools/kernels/BasisKernel.ll",
"sha256": "221ca94c52a997aa8cb2b2155bb8c7ad57bf0829b0241857664a75e78329a4b3"
},
{
"source": "大鱼CST/Plugin/DayuShaderTypes.h",
"destination": "大鱼调色/Plugin/DYCSTTypes.h",
"sha256": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696"
}
]
}
+17
查看文件
@@ -0,0 +1,17 @@
# CST 色彩管理集成
本轮以 dayu-cst 的固定源码节点复用 CSTKernel / BasisKernel;原路径和摘要见 CSTIntegration.json,参考仓库保持只读。新处理顺序为输入转换 → 工作空间一级调色 → 输出转换 → 原有基础调整与风格链。曲线和色域独立选择,工作曲线由同一个参数供一级与输出使用,不通过跨实例通知同步。
沿用大鱼调色的宿主线性 RGB 边界:CST 前恢复编码值,三个阶段内部不使用 3D LUT、不裁切至 0–1;返回宿主线性后再进入原有显示域调色链。此版本的后续 HSL、曲线与风格 LUT 仍是既有显示域工具,不宣称全链路改造成场景线性调色。CST 源内核使用 half 输入,保留其原生精度边界。
新实例默认输入/输出 Gamma 2.4、Rec.709,工作 DaVinci Intermediate / DaVinci Wide Gamut;自动色调映射默认关闭。按实际素材选择相机曲线/色域。选择自动映射时复用参考代码的场景/显示映射标志。一级默认参数直接沿用 CST 源码。
一级调色、基础调整默认展开;其余折叠;所有模块眼睛开启。黑白模块增加混合(默认 0),保证眼睛开启不强制把初始画面变成黑白。折叠写入独立的 InspectorToken,仅保存界面状态,不修改任何调色参数、启用位或 LUT 路径。眼睛只修改启用位。
旧 InspectorToken schema 1 仍可读取:默认跳过新 CST,并保留旧版黑白强度。旧输入 LUT / 相机输入也维持原路径,直到用户明确编辑 CST 参数或选择“旧版输入 → 改用 CST”。新旧模型的前 944 字节 ABI 与所有旧参数 ID 保留。
Cube 导出改用生产渲染路径生成 33³ 色格,包含新的 CST 与一级参数;关闭不可写入 Cube 的空间细节工具和逐画面统计。用户 LUT 和宿主资料不进入仓库。
原生模型、真实 AppKit 折叠动作、IOSurface/Metal 和 Cube 导出已通过 153 项检查,其中 21 组参数与正式大鱼 CST 着色器直接逐像素对照(包含 17 个相机输入组合、ACEScct/Linear/新增曲线/显示曲线工作空间)。本机 Apple M4 的最大线性预乘分量误差为 0.0000152587890625。具体输入、原库摘要与边界见 verification/CSTIntegration.json。正式宿主与发行由独立记录确认。
为避免全眼睛开启让中性查表裁切 HDR,未调整的曲线/HSL/色轮/三原色/色阶/色彩平衡在渲染副本旁路;无其他实际调整时肤色保护也无需执行。原参数、眼睛和界面数值不变。默认输入与输出相同、一级中性且映射关闭时跳过可证明为恒等的往返,避免累积 half 量化误差。
+851 -14
查看文件
@@ -1,6 +1,6 @@
{
"archivesBase64": {
"9000": "AAAAAAAAAb0qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxD+YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVtDdXN0b20gRGF0YYABowsMEVUkbnVsbNINDg8QVnNjaGVtYVYkY2xhc3MQAYAC0hITFBVaJGNsYXNzbmFtZVgkY2xhc3Nlc18QEERZSW5zcGVjdG9yVG9rZW6iFhdfEBBEWUluc3BlY3RvclRva2VuWE5TT2JqZWN0CBEaJCkyN0lMWFpeZGlwd3l7gIuUp6q9AAAAAAAAAQEAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAMYIAAgAEQAaACQAKQAyADcASQBOAFsAbQBvAHEAdQB7AXwAAAAAAAACAQAAAAAAAAAQAAAAAAAAAAAAAAAAAAABfQA=",
"9000": "AAAAAAAAAisqYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBa2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBMZH1UkbnVsbNMNDg8QERJVZm9sZHNWc2NoZW1hViRjbGFzc4ACEAKABNMUFQ8WFxhXTlMua2V5c1pOUy5vYmplY3RzoKCAA9IaGxwdWiRjbGFzc25hbWVYJGNsYXNzZXNcTlNEaWN0aW9uYXJ5ohweWE5TT2JqZWN00hobICFfEBBEWUluc3BlY3RvclRva2VuoiIeXxAQRFlJbnNwZWN0b3JUb2tlbgAIABEAGgAkACkAMgA3AEkATABYAFoAYABmAG0AcwB6AIEAgwCFAIcAjgCWAKEAogCjAKUAqgC1AL4AywDOANcA3ADvAPIAAAAAAAACAQAAAAAAAAAjAAAAAAAAAAAAAAAAAAABBQgACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsB6gAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAHrAA==",
"9001": "AAAAAAAAAe8qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBL2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBEXHVUkbnVsbNINDg8QVXBhdGhzViRjbGFzc4ACgATTEhMOFBUWV05TLmtleXNaTlMub2JqZWN0c6CggAPSGBkaG1okY2xhc3NuYW1lWCRjbGFzc2VzXE5TRGljdGlvbmFyeaIaHFhOU09iamVjdNIYGR4fXERZQXNzZXRTdGF0ZaIgHFxEWUFzc2V0U3RhdGUIERokKTI3SUxYWmBma3F4enyDi5aXmJqfqrPAw8zR3uEAAAAAAAABAQAAAAAAAAAhAAAAAAAAAAAAAAAAAAAA7ggACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsBrgAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAGvAA=="
},
"parameters": [
@@ -44,10 +44,834 @@
"offset": 56,
"pid": 2014,
"step": 0.01,
"title": "输入强度"
"title": "旧版输入强度"
},
{
"default": 0,
"key": "cmConfigured",
"kind": "bool",
"max": 1,
"min": -1,
"offset": 944,
"pid": 2236,
"step": 0.01,
"title": "CST 配置版本"
},
{
"cmTab": 0,
"default": 1,
"key": "cminputEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 964,
"pid": 2241,
"step": 0.01,
"title": "输入转换启用"
},
{
"cmTab": 0,
"default": 1002,
"key": "cminputTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 948,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2237,
"step": 1,
"title": "输入曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 0,
"default": 22,
"key": "cminputGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 952,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2238,
"step": 1,
"title": "输入色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 0,
"default": 10,
"key": "cmworkingTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 956,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2239,
"step": 1,
"title": "工作曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 0,
"default": 16,
"key": "cmworkingGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 960,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2240,
"step": 1,
"title": "工作色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 0,
"default": 1,
"key": "cmmix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1076,
"pid": 2269,
"step": 0.01,
"title": "CST 混合"
},
{
"cmTab": 1,
"default": 1,
"key": "cmbasisEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 968,
"pid": 2242,
"step": 0.01,
"title": "一级调色启用"
},
{
"cmTab": 1,
"default": 0,
"key": "cmexposure",
"kind": "float",
"max": 5,
"min": -5,
"offset": 988,
"pid": 2247,
"step": 0.01,
"title": "一级曝光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbalanceAngle",
"kind": "float",
"max": 1,
"min": 0,
"offset": 992,
"pid": 2248,
"step": 0.01,
"title": "色彩平衡方向"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbalanceStrength",
"kind": "float",
"max": 1,
"min": 0,
"offset": 996,
"pid": 2249,
"step": 0.01,
"title": "色彩平衡强度"
},
{
"cmTab": 1,
"default": 1,
"key": "cmsaturation",
"kind": "float",
"max": 2,
"min": 0,
"offset": 1000,
"pid": 2250,
"step": 0.01,
"title": "一级饱和度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmcontrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1004,
"pid": 2251,
"step": 0.01,
"title": "一级对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmpivot",
"kind": "float",
"max": 3,
"min": -3,
"offset": 1008,
"pid": 2252,
"step": 0.01,
"title": "对比度轴心"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhiContrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1012,
"pid": 2253,
"step": 0.01,
"title": "高光对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhiPivot",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1016,
"pid": 2254,
"step": 0.01,
"title": "高光轴心"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadowContrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1020,
"pid": 2255,
"step": 0.01,
"title": "阴影对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadowPivot",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1024,
"pid": 2256,
"step": 0.01,
"title": "阴影轴心"
},
{
"cmTab": 1,
"default": 1,
"key": "cmwhite",
"kind": "float",
"max": 1.5,
"min": 0.5,
"offset": 1028,
"pid": 2257,
"step": 0.01,
"title": "白点"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmshoulder",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1032,
"pid": 2258,
"step": 0.01,
"title": "肩部压缩"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhighlights",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1036,
"pid": 2259,
"step": 0.01,
"title": "一级高光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmmidtones",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1040,
"pid": 2260,
"step": 0.01,
"title": "一级中间调"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadows",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1044,
"pid": 2261,
"step": 0.01,
"title": "一级阴影"
},
{
"cmTab": 1,
"default": 0,
"key": "cmblack",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1048,
"pid": 2262,
"step": 0.01,
"title": "黑点"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmtoe",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1052,
"pid": 2263,
"step": 0.01,
"title": "趾部压缩"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmchromaMix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1056,
"pid": 2264,
"step": 0.01,
"title": "色度混合"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassExposure",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1060,
"pid": 2265,
"step": 0.01,
"title": "旁路一级曝光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassBalance",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1064,
"pid": 2266,
"step": 0.01,
"title": "旁路一级色彩"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassContrast",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1068,
"pid": 2267,
"step": 0.01,
"title": "旁路一级对比"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassTone",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1072,
"pid": 2268,
"step": 0.01,
"title": "旁路一级影调"
},
{
"cmTab": 2,
"default": 1,
"key": "cmoutputEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 972,
"pid": 2243,
"step": 0.01,
"title": "输出转换启用"
},
{
"cmTab": 2,
"default": 1002,
"key": "cmoutputTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 976,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2244,
"step": 1,
"title": "输出曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 2,
"default": 22,
"key": "cmoutputGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 980,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2245,
"step": 1,
"title": "输出色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 2,
"default": 0,
"key": "cmtoneMapping",
"kind": "popup",
"max": 1,
"min": 0,
"notAnimatable": true,
"offset": 984,
"options": [
"关闭",
"开启"
],
"pid": 2246,
"step": 0.01,
"title": "自动色调映射",
"values": [
0,
1
]
},
{
"default": 1,
"key": "inputEnabled",
"kind": "bool",
"max": 1,
@@ -55,7 +879,7 @@
"offset": 132,
"pid": 2033,
"step": 0.01,
"title": "输入 / LUT"
"title": "输入转换 / CST"
},
{
"default": 0,
@@ -413,7 +1237,7 @@
"title": "肤色色相"
},
{
"default": 0,
"default": 1,
"key": "skinEnabled",
"kind": "bool",
"max": 1,
@@ -523,7 +1347,7 @@
"title": "风格 5 强度"
},
{
"default": 0,
"default": 1,
"key": "lookEnabled",
"kind": "bool",
"max": 1,
@@ -1106,7 +1930,7 @@
"title": "蓝 扩展点4 X"
},
{
"default": 0,
"default": 1,
"key": "curveEnabled",
"kind": "bool",
"max": 1,
@@ -1491,7 +2315,7 @@
"title": "显示自定义色选区"
},
{
"default": 0,
"default": 1,
"key": "hslEnabled",
"kind": "bool",
"max": 1,
@@ -1656,7 +2480,7 @@
"title": "平衡"
},
{
"default": 0,
"default": 1,
"key": "gradingEnabled",
"kind": "bool",
"max": 1,
@@ -1733,7 +2557,7 @@
"title": "蓝原色 饱和度"
},
{
"default": 0,
"default": 1,
"key": "primariesEnabled",
"kind": "bool",
"max": 1,
@@ -1964,7 +2788,7 @@
"title": "蓝 输出白"
},
{
"default": 0,
"default": 1,
"key": "levelsEnabled",
"kind": "bool",
"max": 1,
@@ -2064,6 +2888,17 @@
},
{
"default": 0,
"key": "blackWhiteMix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1080,
"pid": 2270,
"step": 0.01,
"title": "黑白混合"
},
{
"default": 1,
"key": "blackwhiteEnabled",
"kind": "bool",
"max": 1,
@@ -2184,7 +3019,7 @@
"title": "高光 黄 ↔ 蓝"
},
{
"default": 0,
"default": 1,
"key": "balanceEnabled",
"kind": "bool",
"max": 1,
@@ -2197,8 +3032,10 @@
],
"sourceSHA256": {
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
"大鱼调色/Plugin/DYModel.h": "66507eb37e0c0e3426a10ab45f7388fd53fcba570a715a6574396056731d5129",
"大鱼调色/Plugin/DYModel.mm": "cf46784f302014d7c025249c5ebbd02505a5e70739ec3ffc0d269890601bb5c5",
"大鱼调色/Plugin/DYUniforms.h": "06db5ec83703aa320c9569a7de08617a2fdbc535ac29f438558959d485aa2138"
"大鱼调色/Plugin/DYCSTTypes.h": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696",
"大鱼调色/Plugin/DYColorManagement.h": "b0a4cd1b8c45dbce90a7b4f30f72ebf95ecd382895e74e3bfeda0f7cdb185157",
"大鱼调色/Plugin/DYModel.h": "2a1b3064d2c1179347412ad44981aad384165c2238aac06d936a496976d52e63",
"大鱼调色/Plugin/DYModel.mm": "9478a6ec39a3d61946cd1687db7043df29c9f7185fd04ec7b1c4c57fe52ebc5d",
"大鱼调色/Plugin/DYUniforms.h": "d56fd7de758afaca1478fd0ecbb7347cf9986730d7becc998a6ea6233a98f381"
}
}
+2 -2
查看文件
@@ -1,10 +1,10 @@
{
"passed": true,
"sha256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"sha256": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"version": "5.13",
"displayversion": "5.6.7",
"filterCount": 1,
"nativeFloatParameters": 196,
"nativeFloatParameters": 231,
"customParameters": 2,
"publications": [
{
+49 -14
查看文件
@@ -293,8 +293,8 @@
<baseFlags>8589934608</baseFlags>
<parameter name="大鱼调色" id="9000" flags="12884901888">
<numberOfKeypoints>0</numberOfKeypoints>
<defaultVal>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</defaultVal>
<dataValue>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</dataValue>
<defaultVal>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</defaultVal>
<dataValue>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</dataValue>
</parameter>
<parameter name="LUT 文件" id="9001" flags="12889161776">
<numberOfKeypoints>0</numberOfKeypoints>
@@ -302,8 +302,42 @@
<dataValue>*********SweMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-9q7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-2L5JIYPbJgPB6B1UwEJL-VR4VnJWFXP43nQs*0U*HH2VAC3-IKJotH9ahZSLBOHZAiPq7eNKBoQu0UU*DG4-YO4pcYMqlVQrBiMKpZK0FXP43nQqJnL2tHF4ZXR4ZjPa3mSO6O53VCIoxWOaJXRB6M4FsTL2FNELBnNLFHR43oNO6U53l2KI3nQqJoIrFVR4I62FcY8H6rGIlMKa-aOr3sSbm1WtOLa7eTefD*kwnFri2********-*E*********V********************vUU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-fU********6-*********-********************4j**</dataValue>
</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="0" value="0" />
<parameter name="旧版输入强度" id="2014" flags="12889161760" default="1" value="1" />
<parameter name="CST 配置版本" id="2236" flags="12889161760" default="0" value="0" />
<parameter name="输入转换启用" id="2241" flags="12889161760" default="1" value="1" />
<parameter name="输入曲线" id="2237" flags="12889161776" default="1002" value="1002" />
<parameter name="输入色域" id="2238" flags="12889161776" default="22" value="22" />
<parameter name="工作曲线" id="2239" flags="12889161776" default="10" value="10" />
<parameter name="工作色域" id="2240" flags="12889161776" default="16" value="16" />
<parameter name="CST 混合" id="2269" flags="12889161760" default="1" value="1" />
<parameter name="一级调色启用" id="2242" flags="12889161760" default="1" value="1" />
<parameter name="一级曝光" id="2247" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡方向" id="2248" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡强度" id="2249" flags="12889161760" default="0" value="0" />
<parameter name="一级饱和度" id="2250" flags="12889161760" default="1" value="1" />
<parameter name="一级对比度" id="2251" flags="12889161760" default="0" value="0" />
<parameter name="对比度轴心" id="2252" flags="12889161760" default="0" value="0" />
<parameter name="高光对比度" id="2253" flags="12889161760" default="0" value="0" />
<parameter name="高光轴心" id="2254" flags="12889161760" default="0" value="0" />
<parameter name="阴影对比度" id="2255" flags="12889161760" default="0" value="0" />
<parameter name="阴影轴心" id="2256" flags="12889161760" default="0" value="0" />
<parameter name="白点" id="2257" flags="12889161760" default="1" value="1" />
<parameter name="肩部压缩" id="2258" flags="12889161760" default="0.5" value="0.5" />
<parameter name="一级高光" id="2259" flags="12889161760" default="0" value="0" />
<parameter name="一级中间调" id="2260" flags="12889161760" default="0" value="0" />
<parameter name="一级阴影" id="2261" flags="12889161760" default="0" value="0" />
<parameter name="黑点" id="2262" flags="12889161760" default="0" value="0" />
<parameter name="趾部压缩" id="2263" flags="12889161760" default="0.5" value="0.5" />
<parameter name="色度混合" id="2264" flags="12889161760" default="0.5" value="0.5" />
<parameter name="旁路一级曝光" id="2265" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级色彩" id="2266" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级对比" id="2267" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级影调" id="2268" flags="12889161760" default="0" value="0" />
<parameter name="输出转换启用" id="2243" flags="12889161760" default="1" value="1" />
<parameter name="输出曲线" id="2244" flags="12889161776" default="1002" value="1002" />
<parameter name="输出色域" id="2245" flags="12889161776" default="22" value="22" />
<parameter name="自动色调映射" id="2246" flags="12889161776" default="0" value="0" />
<parameter name="输入转换 / CST" id="2033" flags="12889161760" default="1" value="1" />
<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" />
@@ -330,12 +364,12 @@
<parameter name="清晰度 启用" id="2031" flags="12889161760" default="1" value="1" />
<parameter name="去朦胧" id="2012" flags="12889161760" default="0" value="0" />
<parameter name="去朦胧 启用" id="2032" flags="12889161760" default="1" value="1" />
<parameter name="复制时自动调色" id="8800" flags="12889161760" default="0" value="0" />
<parameter name="复制时自动调色" id="8800" flags="12889161776" default="0" value="0" />
<parameter name="基础调色" id="2034" flags="12889161760" default="1" value="1" />
<parameter name="白平衡与颜色" id="2035" flags="12889161760" default="1" value="1" />
<parameter name="保护程度" id="2117" flags="12889161760" default="60" value="60" />
<parameter name="肤色色相" id="2118" flags="12889161760" default="28" value="28" />
<parameter name="肤色保护" id="2116" flags="12889161760" default="0" value="0" />
<parameter name="肤色保护" id="2116" flags="12889161760" default="1" value="1" />
<parameter name="风格 1 强度" id="2015" flags="12889161760" default="1" value="1" />
<parameter name="风格 2 启用" id="2040" flags="12889161760" default="1" value="1" />
<parameter name="风格 2 强度" id="2016" flags="12889161760" default="1" value="1" />
@@ -345,7 +379,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="0" value="0" />
<parameter name="风格 LUT" id="2036" flags="12889161760" default="1" value="1" />
<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 +432,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="0" value="0" />
<parameter name="曲线" id="2044" flags="12889161760" default="1" value="1" />
<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 +467,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="0" value="0" />
<parameter name="HSL 混色" id="2045" flags="12889161760" default="1" value="1" />
<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 +482,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="0" value="0" />
<parameter name="颜色分级" id="2100" flags="12889161760" default="1" value="1" />
<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="0" value="0" />
<parameter name="三原色" id="2120" flags="12889161760" default="1" value="1" />
<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 +510,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="0" value="0" />
<parameter name="色阶" id="2152" flags="12889161760" default="1" value="1" />
<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" />
@@ -485,7 +519,8 @@
<parameter name="黑白 洋红" id="2185" flags="12889161760" default="80" value="80" />
<parameter name="着色色相" id="2186" flags="12889161760" default="0" value="0" />
<parameter name="着色饱和度" id="2187" flags="12889161760" default="0" value="0" />
<parameter name="黑白混色" id="2176" flags="12889161760" default="0" value="0" />
<parameter name="黑白混合" id="2270" flags="12889161760" default="0" value="0" />
<parameter name="黑白混色" id="2176" flags="12889161760" default="1" value="1" />
<parameter name="保持明度" id="2189" flags="12889161760" default="1" value="1" />
<parameter name="阴影 青 ↔ 红" id="2192" flags="12889161760" default="0" value="0" />
<parameter name="阴影 洋红 ↔ 绿" id="2193" flags="12889161760" default="0" value="0" />
@@ -496,7 +531,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="0" value="0" />
<parameter name="色彩平衡" id="2188" flags="12889161760" default="1" value="1" />
<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" />
+1 -1
查看文件
@@ -15,7 +15,7 @@ def main():
work.mkdir(parents=True, exist_ok=True)
args.output.parent.mkdir(parents=True, exist_ok=True)
objects = []
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel'):
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel', 'CSTKernel', 'BasisKernel'):
target = work / (name + '.air')
subprocess.run(['xcrun', 'metal-opt', str(root / 'tools/kernels' / (name + '.ll')),
'-o', str(target)], check=True)
+2 -2
查看文件
@@ -20,7 +20,7 @@ CONTENT_TAGS={'scenenode','layer','group','filter','behavior','mask'}
def sha(data):return hashlib.sha256(data).hexdigest()
def model_identity():
files=['大鱼调色/Plugin/DYModel.h','大鱼调色/Plugin/DYModel.mm','大鱼调色/Plugin/DYUniforms.h','template/tools/dump_model.mm']
files=['大鱼调色/Plugin/DYModel.h','大鱼调色/Plugin/DYModel.mm','大鱼调色/Plugin/DYUniforms.h','大鱼调色/Plugin/DYColorManagement.h','大鱼调色/Plugin/DYCSTTypes.h','template/tools/dump_model.mm']
return {name:sha((ROOT/name).read_bytes()) for name in files}
def refresh_metadata():
@@ -82,7 +82,7 @@ def build(model):
E.SubElement(param,'defaultVal').text=text;E.SubElement(param,'dataValue').text=text
for row in model['parameters']:
value=format(float(row['default']),'.17g')
E.SubElement(filt,'parameter',name=row['title'],id=str(row['pid']),flags='12889161760',default=value,value=value)
E.SubElement(filt,'parameter',name=row['title'],id=str(row['pid']),flags='12889161776' if row.get('notAnimatable') else '12889161760',default=value,value=value)
for node in host:filt.append(node)
source.append(filt)
copyright=E.parse(SOURCES/'CopyrightRig.xml').getroot()
+15
查看文件
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Generate the isolated synthetic CST/disclosure acceptance timeline."""
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.home() / 'Library/Caches/CodexBuilds/com.dayu.color/fcp-qa'
tree = ET.parse(qa / '大鱼调色_正式版验收.fcpxml')
tree.find('.//event').set('name', '大鱼调色_CST与独立折叠验收')
tree.find('.//project').set('name', '大鱼调色_1.2_CST与独立折叠')
output = qa / '大鱼调色_1.2_CST与独立折叠.fcpxml'
ET.indent(tree)
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n' + ET.tostring(tree.getroot(), encoding='unicode') + '\n')
print(output)
+40
查看文件
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""Rebuild synthetic encoding fixtures in the fixed product cache, never user LUTs."""
from pathlib import Path
import hashlib
import json
ROOT = Path.home() / "Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/编码兼容验收"
def main():
ROOT.mkdir(parents=True, exist_ok=True)
matrix = [("utf-8", False), ("utf-8", True)]
matrix += [(codec, bom) for codec in ("utf-16-le", "utf-16-be", "utf-32-le", "utf-32-be") for bom in (False, True)]
matrix += [(codec, False) for codec in ("gb18030", "big5", "shift_jis", "cp1252", "mac_roman", "iso8859-1")]
marks = {"utf-8": b"\xef\xbb\xbf", "utf-16-le": b"\xff\xfe", "utf-16-be": b"\xfe\xff",
"utf-32-le": b"\xff\xfe\0\0", "utf-32-be": b"\0\0\xfe\xff"}
previous = ROOT / "fixtures.json"
known = json.loads(previous.read_text())["files"] if previous.exists() else []
known = {item["file"]: item["sha256"] for item in known}
rows = []
for index, (codec, bom) in enumerate(matrix):
title = "Unicode 中文 🎬" if codec.startswith("utf-") else "中文標題" if codec in ("gb18030", "big5") else "日本語" if codec == "shift_jis" else "Café"
newline = ("\n", "\r\n", "\r")[index % 3]
name = codec.upper() + ("-BOM" if bom else "-NoBOM") + ".cube"
text = [f'TITLE "{title}"', '# Encoding compatibility fixture only', 'LUT_3D_SIZE 33', 'DOMAIN_MIN 0 0 0', 'DOMAIN_MAX 1 1 1']
gain = .7 + .04 * index
text.extend(f"{x/32*gain:.7f} {y/32:.7f} {z/32:.7f}" for z in range(33) for y in range(33) for x in range(33))
data = (marks[codec] if bom else b"") + (newline.join(text) + newline).encode(codec)
target = ROOT / name
if target.exists():
assert hashlib.sha256(target.read_bytes()).hexdigest() == known.get(name), f"Existing fixture changed; preserve it: {target}"
target.write_bytes(data)
rows.append(dict(file=name, codec=codec, bom=bom, sha256=hashlib.sha256(data).hexdigest(), bytes=len(data), dimension=33))
report = dict(synthetic=True, sourceFolder=str(ROOT), files=rows, count=len(rows), bytes=sum(x["bytes"] for x in rows))
previous.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
print(json.dumps({k: v for k, v in report.items() if k != "files"}, ensure_ascii=False))
if __name__ == "__main__":
main()
文件差异过大,未显示。 加载差异
文件差异过大,未显示。 加载差异
+51
查看文件
@@ -0,0 +1,51 @@
#import <AppKit/AppKit.h>
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
#include <CommonCrypto/CommonDigest.h>
// Read user-provided files in place; only import into a unique disposable library.
static NSString *digest(NSURL *url) {
NSData *data=[NSData dataWithContentsOfURL:url];if(!data)return @"unreadable";
unsigned char bytes[CC_SHA256_DIGEST_LENGTH];CC_SHA256(data.bytes,(CC_LONG)data.length,bytes);
NSMutableString *hex=[NSMutableString string];for(unsigned char byte:bytes)[hex appendFormat:@"%02x",byte];return hex;
}
int main(int argc,const char **argv){@autoreleasepool{
if(argc!=3){fprintf(stderr,"usage: verify-external-lut-folder <folder> <report.json>\n");return 2;}
NSFileManager *fm=NSFileManager.defaultManager;NSURL *source=[NSURL fileURLWithPath:[NSString stringWithUTF8String:argv[1]]];
NSMutableArray *files=[NSMutableArray array],*rows=[NSMutableArray array];NSUInteger sidecars=0;
for(NSURL *url in [fm enumeratorAtURL:source includingPropertiesForKeys:@[NSURLIsRegularFileKey] options:0 errorHandler:nil]){
if([url.lastPathComponent hasPrefix:@"._"]){sidecars++;continue;}
NSNumber *regular=nil;[url getResourceValue:&regular forKey:NSURLIsRegularFileKey error:nil];
if(regular.boolValue&&[url.pathExtension.lowercaseString isEqual:@"cube"])[files addObject:url];
}
[files sortUsingComparator:^NSComparisonResult(NSURL *a,NSURL *b){return [a.path localizedStandardCompare:b.path];}];
BOOL parsedAll=files.count>0;NSMutableDictionary *originalHashes=[NSMutableDictionary dictionary];
for(NSURL *url in files){@autoreleasepool{
NSError *error=nil;std::vector<float> values;NSUInteger size=0;BOOL parsed=DYLUTReadCube(url.path,values,size,&error);parsedAll&=parsed;
originalHashes[url.lastPathComponent]=digest(url);
[rows addObject:@{@"file":url.lastPathComponent,@"dimension":@(size),@"parsed":@(parsed),@"error":error.localizedDescription?:@""}];
}}
NSURL *temporary=[NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[@"dayu-external-lut-folder-" stringByAppendingString:NSUUID.UUID.UUIDString]]];
DYLUTLibrary *library=[[DYLUTLibrary alloc]initWithRootURL:[temporary URLByAppendingPathComponent:@"library"]];
__block BOOL done=NO;__block NSUInteger importedCount=0;__block NSError *importError=nil;
__block double last=NSProcessInfo.processInfo.systemUptime,maxGap=0;__block NSUInteger ticks=0;
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){double now=NSProcessInfo.processInfo.systemUptime;maxGap=MAX(maxGap,now-last);last=now;ticks++;(void)library.entries;}];
NSProgress *task=[library importURLsAsync:@[source] completion:^(NSArray *imported,NSError *error){importedCount=imported.count;importError=[error retain];done=YES;}];
double deadline=NSProcessInfo.processInfo.systemUptime+120;
while(!done&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
[timer invalidate];if(!done)[task cancel];
BOOL thumbnails=done&&!importError&&importedCount==files.count,identical=thumbnails;
if(done&&!importError)for(NSDictionary *entry in library.entries){@autoreleasepool{
NSError *error=nil;thumbnails&=DYLUTThumbnail(entry[@"path"],nil,0,0,NSMakeSize(64,36),&error)!=nil;
identical&=[digest([NSURL fileURLWithPath:entry[@"path"]])isEqual:originalHashes[[entry[@"path"]lastPathComponent]]];
}}
BOOL originalUnchanged=YES;for(NSURL *url in files)originalUnchanged&=[digest(url)isEqual:originalHashes[url.lastPathComponent]];
BOOL pass=done&&parsedAll&&!importError&&importedCount==files.count&&thumbnails&&identical&&originalUnchanged&&maxGap<.15;
NSDictionary *report=@{@"pass":@(pass),@"sourceFolder":source.path,@"sourceFiles":@(files.count),@"appleDoubleSidecars":@(sidecars),@"files":rows,
@"plannedFiles":@(MAX((int64_t)0,task.totalUnitCount)/2),@"importedFiles":@(importedCount),@"importError":importError.localizedDescription?:@"",
@"allThumbnailsGenerated":@(thumbnails),@"importedContentsIdentical":@(identical),@"sourceFilesUnchanged":@(originalUnchanged),
@"mainHeartbeatMaxGapMS":@(maxGap*1000),@"mainHeartbeatTicks":@(ticks),@"userLibraryModified":@NO,
@"scope":@"User-supplied LUTs read only; isolated library import and thumbnail generation. No LUT data redistributed, no GUI or host parameter edits."};
NSData *json=[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:nil];[json writeToFile:[NSString stringWithUTF8String:argv[2]] atomically:YES];
if(done&&[fm fileExistsAtPath:temporary.path])[fm removeItemAtURL:temporary error:nil];[library release];[importError release];
printf("%s: %lu sources, %lu imported\n",pass?"PASS":"FAIL",(unsigned long)files.count,(unsigned long)importedCount);return pass?0:1;
}}
+1 -1
查看文件
@@ -93,7 +93,7 @@ static Pixels render(id<MTLRenderPipelineState> pipeline, bool dayu, id<MTLTextu
[e setFragmentTexture:source atIndex:0];
for (NSUInteger i=0;i<textures.count;++i) [e setFragmentTexture:textures[i] atIndex:i+1];
[e setFragmentBytes:&u length:sizeof(u) atIndex:0]; float scene=.73f; [e setFragmentBytes:&scene length:4 atIndex:1];
if(dayu) { DYRenderOptions options={}; options.outputPremultiplied=premultiplied; [e setFragmentBytes:&options length:sizeof(options) atIndex:2]; }
if(dayu) { DYRenderOptions options={}; options.outputPremultiplied=premultiplied; [e setFragmentBytes:&options length:sizeof(options) atIndex:2];[e setFragmentBytes:&u length:sizeof(u) atIndex:3]; }
else { float disabledWatermark[8]={}; [e setFragmentBytes:disabledWatermark length:sizeof(disabledWatermark) atIndex:2]; }
[e drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4]; [e endEncoding]; finish(commands);
Pixels output(width*height*4); [destination getBytes:output.data() bytesPerRow:width*8 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0]; return output;
+56
查看文件
@@ -0,0 +1,56 @@
#import <AppKit/AppKit.h>
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
#include <cmath>
static NSMutableArray *checks;
static void need(BOOL pass,NSString *name){[checks addObject:@{@"name":name,@"pass":@(pass)}];if(!pass){fprintf(stderr,"FAIL %s\n",name.UTF8String);exit(1);}}
static NSString *cube(NSUInteger n){
NSMutableString *s=[NSMutableString stringWithString:@"# 中文 / 日本語 / café / 🎨\nTITLE \"Unicode 🎬\"\nLUT_3D_SIZE "];[s appendFormat:@"%lu\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n",(unsigned long)n];
for(NSUInteger z=0;z<n;z++)for(NSUInteger y=0;y<n;y++)for(NSUInteger x=0;x<n;x++)[s appendFormat:@"%.7e %.7e %.7e # value\n",double(x)/(n-1)*.8,double(y)/(n-1),double(z)/(n-1)];return s;
}
static NSData *encoded(NSString *text,NSStringEncoding encoding,BOOL bom){
NSMutableData *d=[NSMutableData data];
if(bom){const uint8_t le16[]={0xff,0xfe},be16[]={0xfe,0xff},le32[]={0xff,0xfe,0,0},be32[]={0,0,0xfe,0xff},utf8[]={0xef,0xbb,0xbf};
if(encoding==NSUTF16LittleEndianStringEncoding)[d appendBytes:le16 length:2];else if(encoding==NSUTF16BigEndianStringEncoding)[d appendBytes:be16 length:2];
else if(encoding==NSUTF32LittleEndianStringEncoding)[d appendBytes:le32 length:4];else if(encoding==NSUTF32BigEndianStringEncoding)[d appendBytes:be32 length:4];else [d appendBytes:utf8 length:3];}
[d appendData:[text dataUsingEncoding:encoding]];return d;
}
static void pump(BOOL (^done)(void)){double end=NSProcessInfo.processInfo.systemUptime+90;while(!done()&&NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];need(done(),@"asynchronous operation completes");}
int main(int argc,const char **argv){@autoreleasepool{
if(argc!=2)return 2;checks=[NSMutableArray new];NSFileManager *fm=NSFileManager.defaultManager;NSError *error=nil;
NSURL *root=[NSURL fileURLWithPath:[NSTemporaryDirectory()stringByAppendingPathComponent:[@"dayu-lut-encoding-" stringByAppendingString:NSUUID.UUID.UUIDString]]];NSURL *valid=[root URLByAppendingPathComponent:@"Valid"];
need([fm createDirectoryAtURL:valid withIntermediateDirectories:YES attributes:nil error:&error],@"create isolated encoding fixtures");
NSString *base=cube(2);float pixel[]={.37,.28,.81,1};NSData *input=[NSData dataWithBytes:pixel length:sizeof(pixel)];
NSURL *baseline=[root URLByAppendingPathComponent:@"Baseline.cube"];need([base writeToURL:baseline atomically:YES encoding:NSUTF8StringEncoding error:&error],@"write independent UTF-8 baseline");NSData *reference=DYLUTTransformRGBA(input,1,1,baseline.path,&error);need(reference!=nil,@"baseline color result");
NSArray *encodings=@[@(NSUTF8StringEncoding),@(NSUTF16LittleEndianStringEncoding),@(NSUTF16BigEndianStringEncoding),@(NSUTF32LittleEndianStringEncoding),@(NSUTF32BigEndianStringEncoding)];
NSUInteger count=0;NSMutableDictionary *originals=[NSMutableDictionary dictionary];
for(NSNumber *e in encodings)for(NSNumber *bom in @[@NO,@YES])for(NSString *newline in @[@"\n",@"\r\n",@"\r"]){@autoreleasepool{
NSString *name=[NSString stringWithFormat:@"Encoding-%02lu.cube",(unsigned long)count++];NSURL *url=[valid URLByAppendingPathComponent:name];NSData *data=encoded([base stringByReplacingOccurrencesOfString:@"\n" withString:newline],e.unsignedIntegerValue,bom.boolValue);
need([data writeToURL:url atomically:YES],name);originals[name]=data;
need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" exact numeric equivalence"]);
need(DYLUTThumbnail(url.path,nil,0,0,NSMakeSize(32,18),&error)!=nil,[name stringByAppendingString:@" thumbnail"]);
}}
// Unicode horizontal spacing is valid around commands and numeric tokens.
NSString *spaced=[base stringByReplacingOccurrencesOfString:@" " withString:@"\u00a0"];
for(NSNumber *e in encodings){NSString *name=[NSString stringWithFormat:@"Spacing-%lu.cube",(unsigned long)e.unsignedIntegerValue];NSData *data=encoded(spaced,e.unsignedIntegerValue,NO);NSURL *url=[valid URLByAppendingPathComponent:name];need([data writeToURL:url atomically:YES],name);originals[name]=data;need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" nonbreaking spaces"]);}
for(NSNumber *e in [encodings subarrayWithRange:NSMakeRange(1,4)]){NSString *name=[NSString stringWithFormat:@"UnicodeLines-%lu.cube",(unsigned long)e.unsignedIntegerValue];NSString *text=[base stringByReplacingOccurrencesOfString:@"\n" withString:@"\u2028"];NSData *data=encoded(text,e.unsignedIntegerValue,YES);NSURL *url=[valid URLByAppendingPathComponent:name];need([data writeToURL:url atomically:YES],name);originals[name]=data;need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" Unicode line separators"]);}
// Explicit bytes keep this independent of the decoder being exercised.
NSArray *bad=@[[NSData dataWithBytes:"\xff\xfe\x54" length:3],[NSData dataWithBytes:"\xfe\xff\x54" length:3],
[NSData dataWithBytes:"\xff\xfe\x00\xd8" length:4],[NSData dataWithBytes:"\xff\xfe\x00\xdc" length:4],
[NSData dataWithBytes:"\xff\xfe\x00\xd8\x41\x00" length:6],
[NSData dataWithBytes:"\x00\x00\xfe\xff\x00\x11\x00\x00" length:8],
[NSData dataWithBytes:"\xff\xfe\x00\x00\x00\xd8\x00\x00" length:8],
[NSData dataWithBytes:"\x00\x00\xfe\xff\x00\x00\x00" length:7],
[NSData dataWithBytes:"\xff\xfe\x00\x00\x00\x00\x00\x00" length:8]];
NSUInteger badIndex=0;for(NSData *data in bad){NSURL *url=[root URLByAppendingPathComponent:[NSString stringWithFormat:@"Malformed-%lu.cube",(unsigned long)badIndex++]];need([data writeToURL:url atomically:YES],@"write malformed Unicode fixture");std::vector<float> v;NSUInteger n=0;need(!DYLUTReadCube(url.path,v,n,&error)&&v.empty()&&n==0&&[error.localizedDescription containsString:@"编码损坏"],@"reject malformed Unicode without a lossy fallback");}
NSURL *invalid=[root URLByAppendingPathComponent:@"BadNumbers.cube"];need([encoded([base stringByAppendingString:@"NaN 0 0\n"],NSUTF32BigEndianStringEncoding,YES)writeToURL:invalid atomically:YES],@"write encoded invalid numbers");std::vector<float> v;NSUInteger n=0;need(!DYLUTReadCube(invalid.path,v,n,&error)&&v.empty()&&n==0,@"Unicode decoding does not weaken numeric validation");
// Cold large UTF-32 file exercises background conversion and cancellation.
NSURL *large=[valid URLByAppendingPathComponent:@"Large-UTF32BE.cube"];NSData *largeBytes=encoded(cube(65),NSUTF32BigEndianStringEncoding,YES);need([largeBytes writeToURL:large atomically:YES],@"write cold 65-cube UTF-32 fixture");originals[large.lastPathComponent]=largeBytes;
DYLUTLibrary *library=[[DYLUTLibrary alloc]initWithRootURL:[root URLByAppendingPathComponent:@"Library"]];__block BOOL done=NO;__block double last=NSProcessInfo.processInfo.systemUptime,gap=0;__block NSUInteger ticks=0,imported=0;
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){double now=NSProcessInfo.processInfo.systemUptime;gap=MAX(gap,now-last);last=now;ticks++;(void)library.entries;}];
[library importURLsAsync:@[valid] completion:^(NSArray *items,NSError *failure){need(!failure,@"mixed encoding folder imports asynchronously");imported=items.count;done=YES;}];pump(^{return done;});[timer invalidate];need(imported==originals.count,@"all encoded files imported");need(ticks>0&&gap<.15,@"main loop remains responsive during Unicode conversion");
for(NSDictionary *entry in library.entries)need([[NSData dataWithContentsOfFile:entry[@"path"]]isEqual:originals[[entry[@"path"]lastPathComponent]]],@"import preserves exact encoded bytes");
NSURL *cancelURL=[root URLByAppendingPathComponent:@"Cancel-UTF32BE.cube"];need([largeBytes writeToURL:cancelURL atomically:YES],@"write uncached cancellation fixture");done=NO;NSProgress *task=DYLUTPrepareAsync(cancelURL.path,^(NSError *failure){need(failure.code==NSUserCancelledError,@"cancelled Unicode conversion reports cancellation");done=YES;});NSTimer *cancel=[NSTimer scheduledTimerWithTimeInterval:.001 repeats:NO block:^(NSTimer *t){[task cancel];}];pump(^{return done;});[cancel invalidate];
NSDictionary *report=@{@"pass":@YES,@"checks":@(checks.count),@"results":checks,@"encodedImportFiles":@(imported),@"mainHeartbeatMaxGapMS":@(gap*1000),@"mainHeartbeatTicks":@(ticks),@"largeEncodedBytes":@(largeBytes.length),@"scope":@"Synthetic isolated UTF-8/16/32 LE/BE BOM/no-BOM, line endings, Unicode spacing, exact colors, corruption, async import and cancellation. No user files modified."};
need([[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:nil]writeToFile:[NSString stringWithUTF8String:argv[1]] atomically:YES],@"write encoding report");[library release];need([fm removeItemAtURL:root error:nil],@"clean encoding fixtures");printf("PASS %lu checks, main gap %.3f ms\n",(unsigned long)checks.count,gap*1000);return 0;
}}
+19 -1
查看文件
@@ -45,6 +45,24 @@ int main(int argc,const char **argv){@autoreleasepool{
require(gain&&near(out[0],.555)&&near(out[1],.28)&&near(out[2],.81),@"red gain trilinear interpolation");
NSData *ranged=DYLUTTransformRGBA(input,1,1,domain.path,&error);out=(const float *)ranged.bytes;
require(ranged&&near(out[0],.185)&&near(out[1],.14)&&near(out[2],.405),@"DOMAIN normalization resamples Cube");
NSURL *legacy=write(temporary,@"LegacyMetadata/Legacy.cube",@"");
NSMutableData *legacyBytes=[NSMutableData dataWithBytes:"TITLE \"" length:7];
const unsigned char titleBytes[]={0xc7,0xe0,0xb3,0xc8};[legacyBytes appendBytes:titleBytes length:sizeof(titleBytes)];
[legacyBytes appendData:[@"\"\n# legacy comment " dataUsingEncoding:NSUTF8StringEncoding]];[legacyBytes appendBytes:titleBytes length:sizeof(titleBytes)];
[legacyBytes appendData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];[legacyBytes appendData:[cube()dataUsingEncoding:NSUTF8StringEncoding]];
require([legacyBytes writeToURL:legacy atomically:YES],@"write legacy-encoded descriptive metadata fixture");
require(DYLUTReadCube(legacy.path,values,n,&error)&&n==2,@"legacy TITLE and comments do not invalidate ASCII numeric payload");
require([DYLUTTransformRGBA(input,1,1,legacy.path,&error)isEqual:neutral],@"legacy descriptive encoding leaves numeric colors unchanged");
NSURL *invalidNumeric=write(temporary,@"LegacyMetadata/InvalidNumeric.cube",@"");
NSMutableData *invalidBytes=[NSMutableData dataWithData:[@"LUT_3D_SIZE 2\n0 0 0" dataUsingEncoding:NSUTF8StringEncoding]];
const unsigned char invalidByte=0xff;[invalidBytes appendBytes:&invalidByte length:1];
[invalidBytes appendData:[@"\n1 0 0\n0 1 0\n1 1 0\n0 0 1\n1 0 1\n0 1 1\n1 1 1\n" dataUsingEncoding:NSUTF8StringEncoding]];
require([invalidBytes writeToURL:invalidNumeric atomically:YES],@"write corrupt numeric suffix fixture");
require(!DYLUTReadCube(invalidNumeric.path,values,n,&error)&&values.empty()&&n==0,@"non-ASCII numeric suffix remains invalid");
DYLUTLibrary *metadataLibrary=[[[DYLUTLibrary alloc]initWithRootURL:[temporary URLByAppendingPathComponent:@"MetadataLibrary"]]autorelease];
NSArray *metadataImported=[metadataLibrary importURLs:@[legacy] error:&error];
require(metadataImported.count==1&&[[NSData dataWithContentsOfFile:metadataImported[0][@"path"]]isEqual:legacyBytes],@"legacy metadata imports without rewriting source bytes");
require(![metadataLibrary importURLs:@[invalidNumeric] error:&error]&&[error.localizedDescription containsString:@"InvalidNumeric.cube"]&&metadataLibrary.entries.count==1,@"failed import names the file and preserves previous library");
NSData *clear=DYLUTTransformRGBA(sample(NAN,.2,.3),1,1,nil,&error);out=(const float *)clear.bytes;
require(clear&&out[0]==0&&out[1]==0&&out[2]==0&&out[3]==0,@"invalid float samples become clear");
require(!DYLUTTransformRGBA([NSData data],1,1,nil,&error),@"reject malformed float RGBA length");
@@ -66,7 +84,7 @@ int main(int argc,const char **argv){@autoreleasepool{
if(!DYLUTReadCube(red.path,local,dimension,NULL)||dimension!=2||!near(local[4],1.6))parallelState->store(false);
}});
require(parallelOK,@"concurrent table cache reads stay consistent");
NSArray *invalid=@[@"LUT_3D_SIZE 1\n0 0 0\n",@"LUT_3D_SIZE 129\n",@"LUT_3D_SIZE 2\n0 0 0\n",@"LUT_1D_SIZE 2\n0 0 0\n1 1 1\n",@"LUT_3D_SIZE 2\nNaN 0 0\n",[cube() stringByAppendingString:@"0 0 0\n"],[cube() stringByAppendingString:@"DOMAIN_MAX 0 1 1\n"],[cube() stringByAppendingString:@"garbage\n"],[cube() stringByAppendingString:@"LUT_3D_SIZE 2\n"]];
NSArray *invalid=@[@"",[cube()stringByReplacingOccurrencesOfString:@"LUT_3D_SIZE 2" withString:@"LUT_3D_SIZE 2junk"],[cube()stringByAppendingString:@"DOMAIN_MAX 1 1 1 junk\n"],@"LUT_3D_SIZE 1\n0 0 0\n",@"LUT_3D_SIZE 129\n",@"LUT_3D_SIZE 2\n0 0 0\n",@"LUT_1D_SIZE 2\n0 0 0\n1 1 1\n",@"LUT_3D_SIZE 2\nNaN 0 0\n",[cube() stringByAppendingString:@"0 0 0\n"],[cube() stringByAppendingString:@"DOMAIN_MAX 0 1 1\n"],[cube() stringByAppendingString:@"garbage\n"],[cube() stringByAppendingString:@"LUT_3D_SIZE 2\n"]];
NSUInteger invalidIndex=0;
for(NSString *text in invalid) {
NSURL *url=write(temporary,[NSString stringWithFormat:@"Invalid%lu.cube",(unsigned long)invalidIndex++],text);
+26 -1
查看文件
@@ -77,7 +77,7 @@ int main(int argc,const char *argv[]) {@autoreleasepool {
}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?:@""];}];
DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:nil palette:@{} selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){if(path.length)return DYLUTPrepareAsync(path,^(NSError *error){if(!error)[selected addObject:path];completion(error);});[selected addObject:@""];dispatch_async(dispatch_get_main_queue(),^{completion(nil);});return [NSProgress discreteProgressWithTotalUnitCount:1];}];
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");
@@ -94,6 +94,31 @@ int main(int argc,const char *argv[]) {@autoreleasepool {
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");
// Host acknowledgement is the selection boundary, including rejection,
// cancellation and an older completion arriving after a newer click.
NSMutableArray *acknowledgements=[NSMutableArray array],*applyTasks=[NSMutableArray array];
DYLUTBrowser *ackBrowser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:anchor.path palette:@{} selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){
[acknowledgements addObject:[[completion copy]autorelease]];NSProgress *task=[NSProgress discreteProgressWithTotalUnitCount:1];[applyTasks addObject:task];return task;
}];
pump(^{return [ackBrowser valueForKey:@"libraryTask"]==nil;});
NSDictionary *ackTiles=[ackBrowser valueForKey:@"tiles"];NSArray *ackPaths=ackTiles.allKeys;require(ackPaths.count>=2,@"acknowledgement fixture has selectable thumbnails");
id firstTile=ackTiles[ackPaths[0]],secondTile=ackTiles[ackPaths[1]];[firstTile setEnabled:YES];[secondTile setEnabled:YES];
[ackBrowser thumbnailClicked:firstTile];
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path]&&[[[ackBrowser valueForKey:@"statusLabel"]stringValue]hasPrefix:@"正在载入"],@"thumbnail stays loading until host application acknowledges");
void (^rejected)(NSError *)=acknowledgements[0];rejected([NSError errorWithDomain:@"test.host" code:1 userInfo:@{NSLocalizedDescriptionKey:@"Host rejected this edit"}]);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path]&&[[[ackBrowser valueForKey:@"statusLabel"]stringValue]isEqual:@"Host rejected this edit"],@"host rejection preserves previous selection and reports the error");
[ackBrowser thumbnailClicked:firstTile];[ackBrowser thumbnailClicked:secondTile];
require([applyTasks[1]isCancelled],@"new thumbnail click cancels previous application task");
void (^older)(NSError *)=acknowledgements[1];older(nil);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path],@"late older acknowledgement cannot mark a stale LUT selected");
void (^latest)(NSError *)=acknowledgements[2];latest(nil);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:ackPaths[1]],@"only acknowledged latest thumbnail becomes selected");
[ackBrowser clearSelection:nil];
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:ackPaths[1]],@"removal also waits for host acknowledgement");
void (^removed)(NSError *)=acknowledgements[3];removed(nil);require([ackBrowser valueForKey:@"selectedPath"]==nil,@"acknowledged removal clears selection");
[ackBrowser thumbnailClicked:firstTile];[ackBrowser close];require([applyTasks.lastObject isCancelled],@"closing the browser cancels pending host application");
void (^afterClose)(NSError *)=acknowledgements[4];afterClose(nil);require([ackBrowser valueForKey:@"selectedPath"]==nil,@"completion after close cannot change the selection");
[acknowledgements removeAllObjects];[ackBrowser release];
[browser release];report[@"largeCatalogEntries"]=@(visible);report[@"initialLiveThumbnailViews"]=@(tileCount);report[@"initialLiveFolderViews"]=@(folderViews);report[@"pass"]=@YES;
#else
report[@"mode"]=@"baseline synchronous import";
+24
查看文件
@@ -0,0 +1,24 @@
{
"pass": true,
"productBundleID": "com.dayu.color",
"checkedRoots": [
"/Volumes/备份/大鱼调色/大鱼调色",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Library/Plug-Ins/FxPlug",
"/Applications",
"/Users/mac/Library/Plug-Ins/FxPlug",
"/Users/mac/Desktop",
"/Users/mac/Downloads"
],
"outerApps": [
{
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.2.0",
"build": "17"
}
],
"scope": "Bounded current-product inventory; unrelated products and user archives not deleted.",
"deliveryGeneratedCopiesRemoved": true,
"recoveryCloneRemoved": true,
"formalPackageRetained": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg"
}
文件差异过大,未显示。 加载差异
+11
查看文件
@@ -0,0 +1,11 @@
{
"pass": true,
"repository": "https://dayu.media/git/dayu/dayu-color.git",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"restoredFiles": 151,
"fsck": "full strict passed",
"rebuiltShaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"formalShaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"clone": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/cst-remote-restore-0tb5r75b",
"cloneCleaned": true
}
+9
查看文件
@@ -0,0 +1,9 @@
{
"pass": true,
"tag": "v1.2.0-cst-fold-20261101",
"tagCommit": "8074444259fbacc758ec003aa91a6331b6224a85",
"restoredFiles": 156,
"fsck": "strict full passed",
"packageRecordMatches": true,
"cloneCleaned": true
}
+7 -35
查看文件
@@ -2,43 +2,15 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.3",
"build": "14",
"version": "1.2.0",
"build": "17",
"team": "B3W25FX5H5",
"notaryID": "d47784c7-7cad-4837-93ab-9bce5d8c19da",
"notaryID": "f25ae46e-92da-4470-842e-128bdb232aa8",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"shaderSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132",
"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."
}
"templateSHA256": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"shaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"hostVerification": "verification/HostCSTAndDisclosure.json"
}
+278
查看文件
@@ -0,0 +1,278 @@
{
"date": "2026-11-01",
"status": "verified-formal-release-and-live-fcp",
"version": "1.1.4",
"build": "15",
"reportedTrigger": [
"External LUT thumbnail application hangs after successful import",
"N12精选luts folder import fails"
],
"baselineCommit": "a2c8dfafcfe8c1974ec560b9586b78052356a0e4",
"finding": "A preview-cache preheat did not pin the selected table or GPU texture; frame rendering still performed path metadata queries and could parse external text again. Browser acknowledged selection before the inspector finished application.",
"changes": [
"Decode and upload on the renderer preparation queue before committing the host path.",
"Retain immutable selected snapshots independently of preview caches; no file metadata or parsing on prepared frame paths.",
"Acknowledge browser selection only after preparation and accepted host write.",
"Cancel stale requests before they can overwrite a newer host selection.",
"Keep preview work at utility priority and selected LUT preparation at user-initiated priority.",
"Reuse prepared GPU device pipelines when the host supplies the actual registry ID.",
"Allow legacy-encoded TITLE/comments while strictly validating ASCII numeric data and include the failing filename in import errors."
],
"nativeChecks": 171,
"nativePassed": true,
"externalChecks": [
{
"name": "external-large-cube-written",
"pass": true
},
{
"error": "未提供错误信息",
"name": "external-decode-and-gpu-upload-complete",
"pass": true
},
{
"heartbeats": 4,
"maximumGapMS": 5.996874999254942,
"name": "external-activation-main-loop-responsive",
"pass": true
},
{
"error": "",
"name": "external-first-frame-after-preparation",
"pass": true
},
{
"name": "external-lut-affects-frame",
"pass": true
},
{
"name": "external-source-removed-for-no-io-check",
"pass": true
},
{
"name": "external-preview-and-gpu-cache-churn",
"pass": true
},
{
"error": "",
"name": "external-render-with-source-unavailable-after-cache-churn",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "external-snapshot-is-independent-of-file-and-preview-cache",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"name": "external-preparation-cancellation",
"pass": true
}
],
"browserChecks": 67,
"browserPassed": true,
"browserMainMaxGapMS": 6.6957916133105755,
"libraryChecks": 112,
"libraryPassed": true,
"limitations": [
"The supplied folder failure was reproduced; the earlier unspecified thumbnail hang was not captured while occurring. These supplied files now pass the actual host checks.",
"No Intel, older macOS or network-volume performance benchmark; no full VoiceOver audit."
],
"realFolder": {
"sourceFolder": "/Volumes/备份/N12精选luts",
"baseline": {
"importedFiles": 0,
"error": "LUT 必须是 UTF-8 文本",
"failedFiles": [
"青橙色.cube",
"青橙色2.cube"
]
},
"fixedImport": {
"importError": "",
"sourceFilesUnchanged": true,
"mainHeartbeatMaxGapMS": 6.27491669729352,
"userLibraryModified": false,
"importedContentsIdentical": true,
"mainHeartbeatTicks": 794,
"allThumbnailsGenerated": true,
"scope": "User-supplied LUTs read only; isolated library import and thumbnail generation. No LUT data redistributed, no GUI or host parameter edits.",
"files": [
{
"parsed": true,
"file": "超强质感高对比.cube",
"error": "",
"dimension": 17
},
{
"parsed": true,
"file": "城市莫兰迪灰2 加亮.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古-大白鲨.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "复古胶片风.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古清新干净1.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "复古清新干净2.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古清新干净3.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "感性内敛色调.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "户外森林2.cube",
"error": "",
"dimension": 16
},
{
"parsed": true,
"file": "绿转白.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "绿转粉.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "绿转紫.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "内景(柔皮肤).cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "青橙色.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "青橙色2.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "清新亮调.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "万能青橙色.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感超高对比.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感低对比.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感高对比1.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感高对比2.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感高对比暗部发红.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感中对比.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "自然高对比高饱和.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "自然清新.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "AAChangyong1.cube",
"error": "",
"dimension": 64
}
],
"sourceFolder": "/Volumes/备份/N12精选luts",
"pass": true,
"importedFiles": 26,
"sourceFiles": 26,
"appleDoubleSidecars": 0,
"plannedFiles": 26
},
"metal": {
"checks": 171,
"pass": true,
"files": 26,
"scope": "Every supplied LUT prepared asynchronously and rendered through actual Metal/IOSurface. No user file changes or LUT redistribution."
}
},
"hostVerification": "verification/HostExternalLUT.json",
"browserImportSeconds": 7.68114308337681,
"installedMetalChecks": 171,
"installedMetalPassed": true
}
+14
查看文件
@@ -0,0 +1,14 @@
{
"passResult": true,
"sourceCommit": "497eef29fe8eaa5fb7025aa045b6dfa46a9acc14",
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"filesCompared": 133,
"gitFsck": "strict/full passed",
"restoredLibraryChecks": 112,
"restoredLibraryPass": true,
"lfs": false,
"submodules": false,
"userLUTsIncluded": false,
"date": "2026-11-01T07:25:42.831321+00:00",
"hostVerification": "verification/HostExternalLUT.json"
}
+65
查看文件
@@ -0,0 +1,65 @@
{
"pass": true,
"date": "2026-11-01",
"hostVersion": "12.4",
"version": "1.2.0",
"build": "17",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"shaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"formalServiceProcesses": [
"91273 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
],
"checks": [
{
"name": "formal-version-loaded",
"pass": true,
"observed": "Inspector 1.2.0; XPC executable at the formal installation"
},
{
"name": "new-instance-defaults",
"pass": true,
"observed": "13 module eyes on; primary and basic expanded; all other modules collapsed"
},
{
"name": "fold-independent-of-enable",
"pass": true,
"observed": "Primary exposure 0.70 retained across collapse, eye off and expand; expansion did not re-enable"
},
{
"name": "separate-transfer-gamut",
"pass": true,
"observed": "Sony S-Log3 selected without overwriting gamut; S-Gamut3.Cine selected separately"
},
{
"name": "working-space",
"pass": true,
"observed": "ACEScct and ACES AP1 selected independently"
},
{
"name": "normal-reopen",
"pass": true,
"observed": "Normal quit and reopen retained Sony input, ACES working space, exposure 0.70, primary collapsed and eye off"
},
{
"name": "reset-defaults",
"pass": true,
"observed": "Reset all restored neutral controls, all eyes on, primary/basic expanded and others collapsed"
},
{
"name": "style-library",
"pass": true,
"observed": "N12 folder 26 entries; previews populated; selected look confirmed by host"
},
{
"name": "legacy-document",
"pass": true,
"observed": "Old acceptance project opened with its selected look and original enable values retained; no old-project edits"
}
],
"testData": "Synthetic chart in a new acceptance project; user LUT files only read, never imported or deleted.",
"finalState": "Acceptance instance reset to defaults. Old project values unchanged.",
"limitations": [
"CST numeric comparisons are recorded separately in CSTIntegration.json; no claim of pixel-exact live-host export equivalence.",
"Motion, Intel and older macOS not tested. PKG installation not repeated."
]
}
+256
查看文件
@@ -0,0 +1,256 @@
{
"date": "2026-11-01T07:25:42.831321+00:00",
"status": "verified",
"version": "1.1.4",
"build": "15",
"compiledSourceCommit": "497eef29fe8eaa5fb7025aa045b6dfa46a9acc14",
"formalApp": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": {
"name": "Final Cut Pro",
"version": "12.4",
"build": "454072",
"process": 76603,
"pluginProcess": 76607,
"pluginExecutable": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
},
"fixture": {
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
"project": "大鱼调色_分组展开与启用验收",
"playhead": "00:00:02:18",
"sourceFolder": "/Volumes/备份/N12精选luts",
"importedFolder": "/Users/mac/Movies/大鱼调色LUT/look LUTs/N12精选luts",
"files": 26,
"sourceBytes": 91960032,
"synthetic": false
},
"observations": [
{
"check": "Official 1.1.4 inspector and plugin loaded from the single formal path",
"pass": true
},
{
"check": "N12 directory contains all 26 imported real LUTs and original library retains its four items",
"pass": true,
"note": "Directory was already imported when the live UI changed during acceptance; no duplicate import was performed."
},
{
"check": "Imported copies match all source files byte for byte",
"pass": true
},
{
"check": "Both legacy TITLE LUTs apply and browser/inspector agree after acknowledgement",
"pass": true,
"files": [
"青橙色.cube",
"青橙色2.cube"
]
},
{
"check": "64-cube external LUT applies successfully",
"pass": true,
"file": "复古清新干净3.cube"
},
{
"check": "Search remains responsive and returns three matching real LUTs",
"pass": true
},
{
"check": "Rapid first/second selection ends on the second LUT",
"pass": true,
"last": "复古清新干净2.cube"
},
{
"check": "Clear synchronizes browser and inspector to no LUT",
"pass": true
},
{
"check": "Restore original user selection, normal quit and reopen retains path/enabled group and all 26 library items",
"pass": true,
"last": "复古-大白鲨.cube"
},
{
"check": "Progressive visible thumbnails coexist with ready/applicable thumbnails",
"pass": true
}
],
"importedFileVerification": {
"pass": true,
"files": 26,
"bytes": 91960032,
"totalLibraryCubes": 30,
"records": [
{
"file": "AAChangyong1.cube",
"sha256": "976240cb0787ace83603e345b79dff4584a8076c5ef9b53d3bd513910890fe71",
"installed": true,
"identical": true
},
{
"file": "万能青橙色.cube",
"sha256": "8f237931811754c40d26764d2b2553f3a07960833c16147d13f658f481a3aaa9",
"installed": true,
"identical": true
},
{
"file": "内景(柔皮肤).cube",
"sha256": "1710719e2096087d80c21c0f25bbda06d5d1402acaac12a87cb66a65bd233c2a",
"installed": true,
"identical": true
},
{
"file": "城市莫兰迪灰2 加亮.cube",
"sha256": "b0165e2f603d3eca15d01e9fd16878ce279be72674318d532de17799bb638ddd",
"installed": true,
"identical": true
},
{
"file": "复古-大白鲨.cube",
"sha256": "68961a83fbdebce27b51b779dfcb3ed23edfe885cb6fd804c7f5bedc3c55d92f",
"installed": true,
"identical": true
},
{
"file": "复古清新干净1.cube",
"sha256": "bd1fe33027092632a37cddb7b461a5260d9123ae1de1924fa0b7df8132c4e3e0",
"installed": true,
"identical": true
},
{
"file": "复古清新干净2.cube",
"sha256": "6f07a956922a2269616be6ad8e4b1719b5d811cc3ada43693c9342e24de016a8",
"installed": true,
"identical": true
},
{
"file": "复古清新干净3.cube",
"sha256": "a2addc8b672b3bc210c3d206fe9860284e89c80c81016e043f060c3b72fa45e4",
"installed": true,
"identical": true
},
{
"file": "复古胶片风.cube",
"sha256": "65e79ba7611f8d75b82c29e2bed75a2785e260bc6ef2b4e464b575101df6fc66",
"installed": true,
"identical": true
},
{
"file": "感性内敛色调.cube",
"sha256": "9169af70620e972c6d030e1b88b61adc40801cf23b7706a986212c2d6cae82c1",
"installed": true,
"identical": true
},
{
"file": "户外森林2.cube",
"sha256": "55f64e6a62d8db8b65331a7b207d99e339a14e00602b8a025555b293c62f75b8",
"installed": true,
"identical": true
},
{
"file": "清新亮调.cube",
"sha256": "213c15702ebeae606b081d45ad28879fe048ecb458acae2c7c4610e3a9be3e04",
"installed": true,
"identical": true
},
{
"file": "绿转白.cube",
"sha256": "ff09e5b1afda53ca8ce909283b4ef86d1b8d4c32cd21959a6ca2863a3933e665",
"installed": true,
"identical": true
},
{
"file": "绿转粉.cube",
"sha256": "b3bd35d4f49e5894ad9b029904bd137bf46b9fb5509822ddff977256bfa0617e",
"installed": true,
"identical": true
},
{
"file": "绿转紫.cube",
"sha256": "ced2642062da92c1b5fa31fa02ebcae24c46b5ee815b1e958b314f0b2d141b0f",
"installed": true,
"identical": true
},
{
"file": "自然清新.cube",
"sha256": "5fc57742076417151f2bac44a4459bfd0694191c301cf3bf855be0516af7e2a2",
"installed": true,
"identical": true
},
{
"file": "自然高对比高饱和.cube",
"sha256": "212c8a1358e751e6ef644450db46e9e2fd16e591438716e755f8f9f743c849e2",
"installed": true,
"identical": true
},
{
"file": "质感中对比.cube",
"sha256": "d82c12ac309dbf10ff368c8bf3407312a1432eea321e83a3501bacb35f17e165",
"installed": true,
"identical": true
},
{
"file": "质感低对比.cube",
"sha256": "6c42c73de72f91cb61526103ad4486a7880ce8281c5996c37a10f8ef079f5ce3",
"installed": true,
"identical": true
},
{
"file": "质感超高对比.cube",
"sha256": "7e38fcede4532a81d53d9441dc9c2b5f6d8f234ee88db7f2d731d376728b7c42",
"installed": true,
"identical": true
},
{
"file": "质感高对比1.cube",
"sha256": "195968667bbd4fad90fe595b6e1564a7d4bda8a19ba94ab3e49ee203a4c69e38",
"installed": true,
"identical": true
},
{
"file": "质感高对比2.cube",
"sha256": "346c0ccee28d9f551310046e6961a0ad7145c3795d19c8b8ad7a4b82cf63c73d",
"installed": true,
"identical": true
},
{
"file": "质感高对比暗部发红.cube",
"sha256": "be109ad99cfd249d99bd6b32d0a4dadee869bee98c497687a08722e897c9f4fe",
"installed": true,
"identical": true
},
{
"file": "超强质感高对比.cube",
"sha256": "a9c8e9b92643f22ea382d5c3fd535c6474108b52ce67eb7b0d45926d31f03bef",
"installed": true,
"identical": true
},
{
"file": "青橙色.cube",
"sha256": "0422f0820e146244ea1aa05ad68677121d4a68251675252395acd4d2ae93b457",
"installed": true,
"identical": true
},
{
"file": "青橙色2.cube",
"sha256": "238b79dfbd6a499e7acc367bc71d86ae661d73bd4890554834629f94ecbfeb91",
"installed": true,
"identical": true
}
]
},
"installedMetalChecks": 171,
"installedMetalPassed": true,
"preservation": {
"sourceFilesUnchanged": true,
"keptAllN12Imports": true,
"keptOriginalFourLUTs": true,
"restoredInitialUserSelection": "复古-大白鲨.cube",
"search": "",
"folder": "N12精选luts",
"firstClipOtherEffectsEdited": false,
"forcedQuit": false
},
"limitations": [
"The supplied folder failure was reproduced; the earlier unspecified thumbnail hang was not captured while occurring. These supplied files now pass the actual host checks.",
"No Intel, older macOS or network-volume performance benchmark; no full VoiceOver audit."
]
}
+213
查看文件
@@ -0,0 +1,213 @@
{
"date": "2026-11-01T07:46:11.571597+00:00",
"status": "verified",
"version": "1.1.5",
"build": "16",
"compiledSourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"formalApp": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": {
"name": "Final Cut Pro",
"version": "12.4",
"build": "454072"
},
"project": "大鱼调色_分组展开与启用验收",
"playhead": "00:00:02:18",
"fixture": {
"synthetic": true,
"sourceFolder": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/编码兼容验收",
"files": [
{
"file": "UTF-8-NoBOM.cube",
"codec": "utf-8",
"bom": false,
"sha256": "0ccd6767407545c141d38d8233e57a57e0fc40078c8371f55786800de204003f",
"bytes": 1078225,
"dimension": 33
},
{
"file": "UTF-8-BOM.cube",
"codec": "utf-8",
"bom": true,
"sha256": "b98c9e163a0ab33b7c7d3af477a335810846dfc82af0ae6a713bfdade88cb7db",
"bytes": 1114170,
"dimension": 33
},
{
"file": "UTF-16-LE-NoBOM.cube",
"codec": "utf-16-le",
"bom": false,
"sha256": "76deea4650a01fdbe57b9cd4fca06b0fa47c78d544bde9104959b7416bc67ed6",
"bytes": 2156438,
"dimension": 33
},
{
"file": "UTF-16-LE-BOM.cube",
"codec": "utf-16-le",
"bom": true,
"sha256": "c5151d57a58acd6751e014d19c7073ce50a1151f0701943c13497f0c0a21a42d",
"bytes": 2156440,
"dimension": 33
},
{
"file": "UTF-16-BE-NoBOM.cube",
"codec": "utf-16-be",
"bom": false,
"sha256": "59cf2d07c31532a209efc432f2ed139856221cb47704473b9b2ce7344476594f",
"bytes": 2228322,
"dimension": 33
},
{
"file": "UTF-16-BE-BOM.cube",
"codec": "utf-16-be",
"bom": true,
"sha256": "8d58a8e67a2cd1e3a33c354a7751f65c31790f086a249976da0d7783b25e49c7",
"bytes": 2156440,
"dimension": 33
},
{
"file": "UTF-32-LE-NoBOM.cube",
"codec": "utf-32-le",
"bom": false,
"sha256": "5104b4235e0d86c73444b82642904d9bd779ce0cf4a22d4cb9fcab8ecbfed99e",
"bytes": 4312872,
"dimension": 33
},
{
"file": "UTF-32-LE-BOM.cube",
"codec": "utf-32-le",
"bom": true,
"sha256": "0ef0fbdc899575385f4a05b1bdb8a8b17664af6c0ce9c3474b9927831ea94ba1",
"bytes": 4456644,
"dimension": 33
},
{
"file": "UTF-32-BE-NoBOM.cube",
"codec": "utf-32-be",
"bom": false,
"sha256": "8e99c713412b02cef3056427a3e10a4a8979a1ff8387d7f5beef568252825295",
"bytes": 4312872,
"dimension": 33
},
{
"file": "UTF-32-BE-BOM.cube",
"codec": "utf-32-be",
"bom": true,
"sha256": "fc011e3ff28c0b4834a37cf4ee617133db730d37cf07f8bfd9303c4f6dc0df96",
"bytes": 4312876,
"dimension": 33
},
{
"file": "GB18030-NoBOM.cube",
"codec": "gb18030",
"bom": false,
"sha256": "c0dc4012b06798fd4d8ddedeb125edc5512652a5292b70f54e40197e2a028c8d",
"bytes": 1114156,
"dimension": 33
},
{
"file": "BIG5-NoBOM.cube",
"codec": "big5",
"bom": false,
"sha256": "39de3cd6272e852fbc25e309364cc0b0f9cc745e6b2b1e3d412c0dacb7fac53f",
"bytes": 1078214,
"dimension": 33
},
{
"file": "SHIFT_JIS-NoBOM.cube",
"codec": "shift_jis",
"bom": false,
"sha256": "adb4615709ef54a992dfa05a016748ada5642f110a3456f01329b55a55a5241e",
"bytes": 1078212,
"dimension": 33
},
{
"file": "CP1252-NoBOM.cube",
"codec": "cp1252",
"bom": false,
"sha256": "fb37195b5ed916f291e2f32db1f3d69df79afef73f3967cc238e6ae3c2a1167f",
"bytes": 1114152,
"dimension": 33
},
{
"file": "MAC_ROMAN-NoBOM.cube",
"codec": "mac_roman",
"bom": false,
"sha256": "4ebefb24fa47faabbc34c135287b9bd74852b30fe812c85927c697028dd35cf4",
"bytes": 1078210,
"dimension": 33
},
{
"file": "ISO8859-1-NoBOM.cube",
"codec": "iso8859-1",
"bom": false,
"sha256": "ff3bb7cab36c4f4366f098bde199885671a6364b20481e99e81cda8e2c72a5f9",
"bytes": 1078210,
"dimension": 33
}
],
"count": 16,
"bytes": 34826453
},
"observations": [
{
"check": "Native folder selector imports all 16 mixed-encoding LUTs",
"pass": true
},
{
"check": "All sixteen thumbnails generated and individually applied; browser and inspector acknowledge the same path",
"pass": true,
"names": [
"UTF-8-NoBOM",
"UTF-8-BOM",
"UTF-16-LE-NoBOM",
"UTF-16-LE-BOM",
"UTF-16-BE-NoBOM",
"UTF-16-BE-BOM",
"UTF-32-LE-NoBOM",
"UTF-32-LE-BOM",
"UTF-32-BE-NoBOM",
"UTF-32-BE-BOM",
"GB18030-NoBOM",
"BIG5-NoBOM",
"SHIFT_JIS-NoBOM",
"CP1252-NoBOM",
"MAC_ROMAN-NoBOM",
"ISO8859-1-NoBOM"
]
},
{
"check": "UTF-32 BE without BOM retained after normal quit and reopen, group remains enabled",
"pass": true
},
{
"check": "Original user selection restored to 复古-大白鲨, N12 folder, empty search",
"pass": true
}
],
"importedBytes": {
"passResult": true,
"files": 16,
"byteIdentical": 16,
"originalLibraryFiles": 30,
"originalLibraryPreserved": true,
"installedMetalChecks": 141,
"installedMetalPass": true
},
"installedMetal": {
"checks": 141,
"pass": true,
"files": 16
},
"cleanup": {
"removedSyntheticImports": 16,
"originalLibraryFiles": 30,
"originalLibraryHashesUnchanged": true,
"keptN12Imports": 26,
"firstClipOtherEffectsEdited": false,
"forcedQuit": false
},
"limitations": [
"No older macOS, Intel or network-storage benchmark; no full VoiceOver audit.",
"Encoding support covers the documented Cube cases, not every historical charset or unrelated LUT format."
]
}
+153 -20
查看文件
@@ -1,6 +1,6 @@
{
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
"checks": 82,
"checks": 110,
"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,21 +12,21 @@
"error": "未提供错误信息",
"name": "runtime-directory",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17"
},
{
"descriptors": 196,
"descriptors": 231,
"name": "descriptor-unique-id-offset-key",
"pass": true,
"sections": 12,
"uniformBytes": 944
"sections": 14,
"uniformBytes": 1088
},
{
"name": "finite-real-model-defaults",
"pass": true
},
{
"name": "only-basic-adjustments-enabled-by-default",
"name": "all-module-eyes-enabled-by-default",
"pass": true
},
{
@@ -60,6 +60,48 @@
"name": "asset-copy-is-independent",
"pass": true
},
{
"modules": 13,
"name": "default-primary-base-expanded-all-eyes-on",
"pass": true
},
{
"name": "all-disclosure-actions-preserve-every-render-parameter",
"pass": true
},
{
"name": "eye-only-toggles-enable-retains-disclosure",
"pass": true
},
{
"name": "expanding-disabled-module-keeps-it-disabled",
"pass": true
},
{
"name": "inspector-recreation-restores-independent-disclosure",
"pass": true
},
{
"error": "未提供错误信息",
"name": "secure-disclosure-archive-roundtrip",
"pass": true
},
{
"name": "legacy-inspector-retains-input-and-blackwhite-behavior",
"pass": true
},
{
"name": "working-space-shared-by-primary-and-output",
"pass": true
},
{
"name": "basis-raw-controls-use-reference-conversion",
"pass": true
},
{
"name": "unsupported-basis-curve-adapts-through-intermediate",
"pass": true
},
{
"name": "metal-device",
"pass": true
@@ -81,6 +123,37 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "blackwhite-full-render",
"pass": true
},
{
"changedComponents": 7368,
"maxAbsoluteError": 0.5289306640625,
"name": "blackwhite-mix-100-affects-frame",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "blackwhite-half-render",
"pass": true
},
{
"name": "blackwhite-half-mix-is-continuous",
"pass": true
},
{
"error": "",
"name": "blackwhite-eye-off-render",
"pass": true
},
{
"name": "blackwhite-eye-bypasses-retained-mix",
"pass": true
},
{
"invalidComponents": 0,
"name": "renderer-alpha-contract",
@@ -122,6 +195,17 @@
"name": "preview-invalidation-clears-analysis-and-browser",
"pass": true
},
{
"error": "",
"name": "cst-export-production-sample",
"pass": true
},
{
"error": "未提供错误信息",
"name": "cube-export-includes-cst-primary-and-matches-production",
"pass": true,
"triples": 35937
},
{
"error": "",
"name": "renderer-exposure-pass",
@@ -180,7 +264,7 @@
"pass": true
},
{
"changedComponents": 7354,
"changedComponents": 7347,
"maxAbsoluteError": 0.13134765625,
"name": "hsl-real-table-frame",
"nonfiniteComponents": 0,
@@ -189,13 +273,13 @@
},
{
"error": "",
"name": "folded-hsl-bypasses-retained-adjustments-render",
"name": "disabled-hsl-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-hsl-bypasses-retained-adjustments",
"name": "disabled-hsl-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -206,8 +290,8 @@
"pass": true
},
{
"changedComponents": 7357,
"maxAbsoluteError": 0.094482421875,
"changedComponents": 7347,
"maxAbsoluteError": 0.09033203125,
"name": "grading-real-table-frame",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
@@ -215,13 +299,13 @@
},
{
"error": "",
"name": "folded-grading-bypasses-retained-adjustments-render",
"name": "disabled-grading-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-grading-bypasses-retained-adjustments",
"name": "disabled-grading-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -449,13 +533,13 @@
},
{
"error": "",
"name": "folded-input-bypasses-retained-profile-render",
"name": "disabled-input-bypasses-retained-profile-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-input-bypasses-retained-profile",
"name": "disabled-input-bypasses-retained-profile",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -491,13 +575,13 @@
},
{
"error": "",
"name": "folded-look-bypasses-retained-LUTs-render",
"name": "disabled-look-bypasses-retained-LUTs-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-look-bypasses-retained-LUTs",
"name": "disabled-look-bypasses-retained-LUTs",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -506,16 +590,65 @@
"error": "未提供错误信息",
"name": "renderer-export-33cube",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B/diagnostic-export.cube"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17/diagnostic-export.cube"
},
{
"bytes": 1186070,
"bytes": 1186074,
"name": "export-33cube-data-contract",
"nonzeroRows": 35937,
"pass": true,
"rows": 35937
},
{
"name": "external-large-cube-written",
"pass": true
},
{
"error": "未提供错误信息",
"name": "external-decode-and-gpu-upload-complete",
"pass": true
},
{
"heartbeats": 4,
"maximumGapMS": 5.9790832456201315,
"name": "external-activation-main-loop-responsive",
"pass": true
},
{
"error": "",
"name": "external-first-frame-after-preparation",
"pass": true
},
{
"name": "external-lut-affects-frame",
"pass": true
},
{
"name": "external-source-removed-for-no-io-check",
"pass": true
},
{
"name": "external-preview-and-gpu-cache-churn",
"pass": true
},
{
"error": "",
"name": "external-render-with-source-unavailable-after-cache-churn",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "external-snapshot-is-independent-of-file-and-preview-cache",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"name": "external-preparation-cancellation",
"pass": true
}
],
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B",
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17",
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
}
文件差异过大,未显示。 加载差异
+12
查看文件
@@ -0,0 +1,12 @@
{
"passResult": true,
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"filesCompared": 138,
"fsck": "strict/full passed",
"restoredChecks": {
"library": 112,
"encoding": 179
},
"lfs": false,
"submodules": false
}
+64
查看文件
@@ -0,0 +1,64 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg",
"sha256": "9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1",
"bytes": 13818397,
"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.2.0",
"build": "17"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.ee9fb852-21c9-4f09-bdd1-e8d3a02b501a/A7F44CB1-4C2B-49A4-8FEB-BD99E683EA34/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.2.0.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-01 10:11:21 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"name": "大鱼调色-1.2.0.pkg",
"id": "c7b97b0f-57c8-45d3-a4d7-7db8e8694487",
"message": "Successfully received submission info",
"createdDate": "2026-11-01T10:11:23.075Z",
"status": "Accepted"
},
"appCompiledSource": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"appBuild": "17",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"templateSHA256": {
"大鱼调色.moef": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostCSTAndDisclosure.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
+35
查看文件
@@ -0,0 +1,35 @@
{
"passResult": true,
"repository": "dayu/dayu-color",
"repositoryID": 52,
"private": false,
"tag": "v1.2.0-cst-fold-20261101",
"releaseCommit": "8074444259fbacc758ec003aa91a6331b6224a85",
"releaseID": 363,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.2.0-cst-fold-20261101",
"assetID": 10,
"assetName": "大鱼调色-1.2.0.pkg",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.2.0-cst-fold-20261101/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.2.0.pkg",
"bytes": 13818397,
"sha256": "9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1",
"existingAssetReused": true,
"verification": "Authenticated full download SHA-256 and byte count, then release/asset read-back.",
"credentialSource": "macOS Keychain: dayu-git-api",
"status": "published-and-download-verified",
"verifiedAt": "2026-11-01T10:16:38.477109+00:00",
"prePublishDraftDownload": {
"passResult": true,
"path": "/Volumes/备份/大鱼调色-1.2.0.pkg",
"bytes": 13818397,
"sha256": "9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1",
"sourceURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.2.0-cst-fold-20261101/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.2.0.pkg",
"source": "Completed authenticated Microsoft Edge draft download; UI confirmed completion and opened containing folder.",
"birthtime": 1793528060.58,
"releaseID": 363,
"assetID": 10,
"temporaryCopyRemoved": true
},
"actualAppCompiledSource": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"assetUploads": 1,
"credentialValueRecorded": false
}
+29
查看文件
@@ -0,0 +1,29 @@
#ifndef DAYU_SHADER_TYPES_H
#define DAYU_SHADER_TYPES_H
#include <simd/simd.h>
typedef struct CSTParams { int inputGamut, inputTransfer, outputGamut, outputTransfer, toneMapping; } CSTParams;
typedef struct BasisParams {
int colorspace;
float exposure, balanceTarget, balanceStrength, contrast, pivot, highlights, midtones, shadows;
float trimLow, trimHigh, trimToeStrength, trimShoulderStrength, shadowContrast, shadowPivot, hiContrast, hiPivot, chromaMix;
unsigned char bypassBalance, bypassTone, bypassExposure, bypassContrast;
float saturation;
} BasisParams;
typedef struct DayuRenderParams {
CSTParams input;
CSTParams output;
BasisParams basis;
int stages;
int sourceLinear;
int destinationLinear;
int reserved;
// Additional curve-only adapters for working encodings absent from original BASIS.
CSTParams basisInput;
CSTParams basisOutput;
} DayuRenderParams;
#ifndef __METAL_VERSION__
_Static_assert(sizeof(CSTParams)==20, "CST target layout");
_Static_assert(sizeof(BasisParams)==80, "BASIS target layout");
_Static_assert(sizeof(DayuRenderParams)==176, "Integrated layout; legacy prefix remains 136 bytes");
#endif
#endif
+63
查看文件
@@ -0,0 +1,63 @@
// Raw, animatable CST controls. The first 944 bytes of DYUniforms stay unchanged.
#pragma once
#include "DYCSTTypes.h"
typedef struct DYCMSettings {
float configured;
float inputTransfer;
float inputGamut;
float workingTransfer;
float workingGamut;
float inputEnabled;
float basisEnabled;
float outputEnabled;
float outputTransfer;
float outputGamut;
float toneMapping;
float exposure;
float balanceAngle;
float balanceStrength;
float saturation;
float contrast;
float pivot;
float hiContrast;
float hiPivot;
float shadowContrast;
float shadowPivot;
float white;
float shoulder;
float highlights;
float midtones;
float shadows;
float black;
float toe;
float chromaMix;
float bypassExposure;
float bypassBalance;
float bypassContrast;
float bypassTone;
float mix;
float blackWhiteMix;
} DYCMSettings;
#ifndef __METAL_VERSION__
#include <math.h>
static inline int DYBasisMode(int c) {
if(c==99)return 0;if(c>=1&&c<=11)return c;
switch(c){case 14:return 12;case 15:return 13;case 16:return 14;case 19:return 15;case 20:return 16;case 21:return 17;case 22:return 18;case 25:return 19;case 27:return 20;case 28:return 21;default:return -1;}
}
static inline DayuRenderParams DYCMRender(DYCMSettings s) {
DayuRenderParams p={0};
p.input=(CSTParams){(int)lroundf(s.inputGamut),(int)lroundf(s.inputTransfer),(int)lroundf(s.workingGamut),(int)lroundf(s.workingTransfer),0};
p.output=(CSTParams){p.input.outputGamut,p.input.outputTransfer,(int)lroundf(s.outputGamut),(int)lroundf(s.outputTransfer),(int)lroundf(s.toneMapping)};
p.stages=(s.inputEnabled>.5?1:0)|(s.basisEnabled>.5?2:0)|(s.outputEnabled>.5?4:0);
if(s.toneMapping>.5){p.input.toneMapping=(p.input.inputTransfer>1000?2:0)+(p.input.outputTransfer>1000?1:0);p.output.toneMapping=(p.output.inputTransfer>1000?2:0)+(p.output.outputTransfer>1000?1:0);}
int mode=DYBasisMode(p.input.outputTransfer);p.basis.colorspace=mode<0?10:mode;
if(mode<0){p.reserved|=8;p.basisInput=(CSTParams){p.input.outputGamut,p.input.outputTransfer,p.input.outputGamut,10,0};p.basisOutput=(CSTParams){p.input.outputGamut,10,p.input.outputGamut,p.input.outputTransfer,0};}
BasisParams *b=&p.basis;
b->exposure=exp2f(s.exposure);b->balanceTarget=s.balanceAngle;b->balanceStrength=s.balanceStrength*s.balanceStrength*4;
b->contrast=exp2f(s.contrast);b->pivot=exp2f(s.pivot);b->highlights=s.highlights;b->midtones=s.midtones*.3330000042915344f;b->shadows=s.shadows*1.5f;
b->trimLow=1.0+(double)s.black*-.5;b->trimHigh=s.white;b->trimToeStrength=1+15*s.toe;b->trimShoulderStrength=1+7*s.shoulder;
b->shadowContrast=(double)s.shadowContrast*-1.3;b->shadowPivot=exp2f(.20000000298023224f*s.shadowPivot);b->hiContrast=s.hiContrast*2;b->hiPivot=exp2f(-.20000000298023224f*s.hiPivot);b->chromaMix=s.chromaMix;
b->bypassExposure=s.bypassExposure>.5;b->bypassBalance=s.bypassBalance>.5;b->bypassContrast=s.bypassContrast>.5;b->bypassTone=s.bypassTone>.5;b->saturation=s.saturation;
return p;
}
#endif
+138 -7
查看文件
@@ -2,6 +2,9 @@
#import "DYModel.h"
#import "DYRenderer.h"
#import "DYAutoGrade.h"
#import "DYLUTLibrary.h"
#import "DYInspector.h"
#include <string>
#import <CoreVideo/CoreVideo.h>
#import <IOSurface/IOSurface.h>
#include <algorithm>
@@ -18,13 +21,19 @@
BOOL _duplicate;
}
@end
@interface DYInspector (DiagnosticActions)
- (void)refresh;
@end
@implementation DYDiagnosticManager
- (instancetype)init {if((self=[super init])){_values=[NSMutableDictionary new];_custom=[NSMutableDictionary new];}return self;}
- (void)dealloc {[_values release];[_custom release];[super dealloc];}
- (id)apiForProtocol:(Protocol *)protocol {
NSString *name=NSStringFromProtocol(protocol);
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6"]containsObject:name]?self:nil;
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6",@"FxCustomParameterActionAPI_v4"]containsObject:name]?self:nil;
}
- (void)startAction:(id)sender{}
- (void)endAction:(id)sender{}
- (CMTime)currentTime{return kCMTimeZero;}
- (BOOL)addFloatSliderWithName:(NSString *)name parameterID:(UInt32)pid defaultValue:(double)value parameterMin:(double)minimum parameterMax:(double)maximum sliderMin:(double)sliderMinimum sliderMax:(double)sliderMaximum delta:(double)delta parameterFlags:(FxParameterFlags)flags {
if(_values[@(pid)]||_custom[@(pid)]){_duplicate=YES;return NO;}_values[@(pid)]=@(value);return YES;
}
@@ -107,6 +116,21 @@ static Pixels render(Run& run,DYRenderer *renderer,DYDiagnosticTile *source,DYDi
NSError *error=nil;BOOL ok=[renderer renderSource:source destination:destination uniforms:uniforms paths:paths error:&error];
run.need(name,ok,@{@"error":ok?@"":reason(error)});return read(destination,gpu);
}
static Pixels referenceFrame(id<MTLDevice> gpu,id<MTLLibrary> library,const Pixels &premult,NSUInteger width,NSUInteger height,DayuRenderParams params,NSError **error){
MTLTextureDescriptor *td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];td.storageMode=MTLStorageModeShared;td.usage=MTLTextureUsageShaderRead;
id<MTLTexture>source=[gpu newTextureWithDescriptor:td];td.pixelFormat=MTLPixelFormatRGBA32Float;td.usage=MTLTextureUsageRenderTarget;id<MTLTexture>dest=[gpu newTextureWithDescriptor:td];
Pixels encoded(premult.size());for(NSUInteger i=0;i<width*height;i++){float alpha=premult[i*4+3];for(int c=0;c<3;c++){float v=alpha>0?(float)(__fp16)((float)premult[i*4+c]/alpha):0;encoded[i*4+c]=v<=.0031308f?v*12.92f:1.055f*powf(v,1/2.4f)-.055f;}encoded[i*4+3]=alpha;}
[source replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:encoded.data() bytesPerRow:width*8];
MTLRenderPipelineDescriptor *pd=[MTLRenderPipelineDescriptor new];pd.vertexFunction=[library newFunctionWithName:@"vertexShader"];pd.fragmentFunction=[library newFunctionWithName:@"fragmentShader"];pd.colorAttachments[0].pixelFormat=MTLPixelFormatRGBA32Float;
id<MTLRenderPipelineState>pipeline=[gpu newRenderPipelineStateWithDescriptor:pd error:error];[pd.vertexFunction release];[pd.fragmentFunction release];[pd release];
Pixels result;if(pipeline){id<MTLCommandQueue>q=[gpu newCommandQueue];id<MTLCommandBuffer>cb=[q commandBuffer];MTLRenderPassDescriptor *rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=dest;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>e=[cb renderCommandEncoderWithDescriptor:rp];
float w=width,h=height;DYVertex2D vertices[]={{{w/2,-h/2},{1,1}},{{-w/2,-h/2},{0,1}},{{w/2,h/2},{1,0}},{{-w/2,h/2},{0,0}}};vector_uint2 vp={(unsigned)width,(unsigned)height};id<MTLBuffer>hist=[gpu newBufferWithLength:800 options:MTLResourceStorageModeShared];
[e setRenderPipelineState:pipeline];[e setVertexBytes:vertices length:sizeof(vertices) atIndex:0];[e setVertexBytes:&vp length:sizeof(vp) atIndex:1];[e setFragmentTexture:source atIndex:0];[e setFragmentTexture:source atIndex:1];[e setFragmentBytes:&params length:sizeof(params) atIndex:0];[e setFragmentBuffer:hist offset:0 atIndex:1];[e drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[e endEncoding];[cb commit];[cb waitUntilCompleted];
if(cb.status==MTLCommandBufferStatusCompleted){std::vector<float>pixels(width*height*4);[dest getBytes:pixels.data() bytesPerRow:width*16 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0];result.resize(premult.size());for(NSUInteger i=0;i<width*height;i++){float a=premult[i*4+3];for(int c=0;c<3;c++){float v=pixels[i*4+c];float linear=v<=.04045f?v/12.92f:powf((v+.055f)/1.055f,2.4f);result[i*4+c]=a>0?(__fp16)((float)(__fp16)linear*a):0;}result[i*4+3]=a;}}
[hist release];[q release];
}
[pipeline release];[source release];[dest release];return result;
}
static float *field(DYUniforms *u,NSDictionary *row){return (float *)((uint8_t *)u+[row[@"offset"]unsignedIntegerValue]);}
}
@@ -126,8 +150,8 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
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);
for(NSDictionary *section in sections){BOOL base=YES;for(NSDictionary *row in descriptors)if([row[@"pid"]isEqual:section[@"enabled"]])initialGroups&=([row[@"default"]doubleValue]>=.5)==base;}
run.record(@"all-module-eyes-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)];
@@ -140,6 +164,30 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
run.record(@"secure-asset-archive-roundtrip",decoded&&[assets isEqual:decoded],@{@"archiveBytes":@(archive.length),@"error":reason(error)});
BOOL wrote=DYWriteAssets(manager,assets,kCMTimeZero);DYAssetState *readBack=DYReadAssets(manager,kCMTimeZero);run.record(@"native-custom-asset-get-set",wrote&&[readBack isEqual:assets]);
DYAssetState *copy=[[assets copy]autorelease];copy.paths=@{};run.record(@"asset-copy-is-independent",assets.paths.count==2&&copy.paths.count==0);
// Exercise the real AppKit actions against a separate, in-memory host.
[NSApplication sharedApplication];
DYDiagnosticManager *uiHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(uiHost,nil);
DYInspector *inspector=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[inspector refresh];
NSArray *cards=[inspector valueForKey:@"cards"];BOOL initialUI=YES;
for(NSDictionary *card in cards)initialUI&=([card[@"collapsed"]boolValue]!=[@[@"primary",@"base"]containsObject:card[@"section"][@"key"]])&&[(NSButton*)card[@"enabled"]state]==NSControlStateValueOn;
run.record(@"default-primary-base-expanded-all-eyes-on",initialUI,@{@"modules":@(cards.count)});
DYUniforms uiBefore,uiAfter;DYReadUniforms(uiHost,kCMTimeZero,&uiBefore);BOOL foldingIndependent=YES;
for(NSDictionary *card in cards){NSButton *header=card[@"header"];BOOL was=[card[@"collapsed"]boolValue];[header performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);foldingIndependent&=[card[@"collapsed"]boolValue]!=was&&memcmp(&uiBefore,&uiAfter,sizeof(uiBefore))==0;[header performClick:nil];[inspector refresh];}
run.record(@"all-disclosure-actions-preserve-every-render-parameter",foldingIndependent);
NSDictionary *first=cards[0];BOOL wasFolded=[first[@"collapsed"]boolValue];[(NSButton*)first[@"enabled"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"eye-only-toggles-enable-retains-disclosure",[first[@"collapsed"]boolValue]==wasFolded&&uiAfter.inputSectionEnabled==0);
[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"expanding-disabled-module-keeps-it-disabled",uiAfter.inputSectionEnabled==0&&![first[@"collapsed"]boolValue]);
DYInspector *reopened=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[reopened refresh];NSArray *reopenedCards=[reopened valueForKey:@"cards"];
run.record(@"inspector-recreation-restores-independent-disclosure",![reopenedCards[0][@"collapsed"]boolValue]&&[(NSButton*)reopenedCards[0][@"enabled"]state]==NSControlStateValueOff);
DYInspectorToken *uiToken=uiHost->_custom[@(DYInspectorParameterID)];error=nil;NSData *foldArchive=[NSKeyedArchiver archivedDataWithRootObject:uiToken requiringSecureCoding:YES error:&error];DYInspectorToken *foldDecoded=[NSKeyedUnarchiver unarchivedObjectOfClass:DYInspectorToken.class fromData:foldArchive error:&error];
run.record(@"secure-disclosure-archive-roundtrip",[foldDecoded isEqual:uiToken],@{@"error":reason(error)});
DYInspectorToken *old=[[[DYInspectorToken alloc]init]autorelease];old.schema=1;uiHost->_custom[@(DYInspectorParameterID)]=old;DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"legacy-inspector-retains-input-and-blackwhite-behavior",uiAfter.cm.configured==-1&&uiAfter.cm.blackWhiteMix==1);
DayuRenderParams cp=DYCMRender(defaults.cm);run.record(@"working-space-shared-by-primary-and-output",cp.input.outputTransfer==cp.output.inputTransfer&&cp.input.outputGamut==cp.output.inputGamut&&cp.basis.colorspace==10);
DYCMSettings converted=defaults.cm;converted.exposure=1.25;converted.contrast=.4;converted.balanceStrength=.3;converted.midtones=.6;converted.shadows=-.4;converted.black=.2;converted.shadowContrast=.3;converted.hiContrast=-.2;DayuRenderParams mapped=DYCMRender(converted);
run.record(@"basis-raw-controls-use-reference-conversion",fabs(mapped.basis.exposure-exp2f(1.25))<1e-6&&fabs(mapped.basis.contrast-exp2f(.4))<1e-6&&fabs(mapped.basis.balanceStrength-.36)<1e-6&&fabs(mapped.basis.midtones-.1998)<1e-5&&fabs(mapped.basis.shadows+.6)<1e-6&&fabs(mapped.basis.trimLow-.9)<1e-6&&fabs(mapped.basis.shadowContrast+.39)<1e-6&&fabs(mapped.basis.hiContrast+.4)<1e-6);
converted.workingTransfer=30;mapped=DYCMRender(converted);run.record(@"unsupported-basis-curve-adapts-through-intermediate",(mapped.reserved&8)&&mapped.basis.colorspace==10&&mapped.basisInput.inputTransfer==30&&mapped.basisOutput.outputTransfer==30);
id<MTLDevice> gpu=MTLCreateSystemDefaultDevice();run.need(@"metal-device",gpu!=nil);gpuName=gpu.name;
const NSUInteger width=64,height=48;DYDiagnosticTile *source=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease],*destination=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease];
run.need(@"real-iosurface-image-tiles",source&&destination&&source.ioSurface&&destination.ioSurface);
@@ -147,6 +195,22 @@ 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));
NSString *cstReference=NSProcessInfo.processInfo.environment[@"DY_DIAGNOSTIC_CST_REFERENCE"];
if(cstReference.length){
error=nil;id<MTLLibrary>oracle=[gpu newLibraryWithURL:[NSURL fileURLWithPath:cstReference] error:&error];run.need(@"independent-installed-cst-reference-loaded",oracle!=nil,@{@"path":cstReference,@"error":reason(error)});
const int cases[][3]={{28,27,10},{2,23,10},{4,4,10},{5,5,10},{6,6,10},{8,7,10},{9,7,10},{11,10,10},{12,28,10},{15,23,10},{16,17,10},{21,23,10},{22,21,10},{25,24,10},{27,25,10},{30,23,10},{29,23,10},{28,27,1},{28,27,20},{28,27,30},{28,27,1002}};
for(unsigned index=0;index<sizeof(cases)/sizeof(cases[0]);index++){@autoreleasepool{
DYUniforms candidate=defaults;candidate.cm.configured=1;candidate.cm.inputTransfer=cases[index][0];candidate.cm.inputGamut=cases[index][1];candidate.cm.workingTransfer=cases[index][2];candidate.cm.toneMapping=1;candidate.cm.exposure=.35;candidate.cm.contrast=.15;candidate.cm.saturation=1.1;candidate.cm.balanceAngle=.12;candidate.cm.balanceStrength=.03;
DayuRenderParams p=DYCMRender(candidate.cm);Pixels expected=referenceFrame(gpu,oracle,input,width,height,p,&error);Pixels actual=render(run,renderer,source,destination,gpu,candidate,@{},[NSString stringWithFormat:@"cst-case-%02u-render",index]);
BOOL same=expected.size()==actual.size();double worst=0;float refValue=0,gotValue=0;NSUInteger nonfinite=0;for(NSUInteger i=0;i<expected.size()&&same;i++){float a=expected[i],b=actual[i];if(!std::isfinite(a)||!std::isfinite(b)){nonfinite++;same=NO;break;}double delta=fabs(a-b);worst=fmax(worst,delta);same&=delta<=.004+.003*fabs(a);if(!same){refValue=a;gotValue=b;}}
run.record([NSString stringWithFormat:@"cst-case-%02u-independent-pixels",index],same,@{@"inputCurve":@(p.input.inputTransfer),@"inputGamut":@(p.input.inputGamut),@"workingCurve":@(p.input.outputTransfer),@"maximumError":@(worst),@"referenceValue":@(refValue),@"actualValue":@(gotValue),@"nonfinite":@(nonfinite),@"components":@(actual.size())});
}}[oracle release];
}
DYUniforms monochrome=defaults;monochrome.cm.blackWhiteMix=1;Pixels mono=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-full-render");
Difference monoDiff=difference(neutral,mono);run.record(@"blackwhite-mix-100-affects-frame",monoDiff.different>100&&monoDiff.nonfinite==0,measure(monoDiff));
monochrome.cm.blackWhiteMix=.5;Pixels halfMono=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-half-render");BOOL smooth=YES;for(NSUInteger i=0;i<mono.size();i++)smooth&=fabs((float)halfMono[i]-.5f*((float)mono[i]+(float)neutral[i]))<.001;
run.record(@"blackwhite-half-mix-is-continuous",smooth);
monochrome.blackWhiteSectionEnabled=0;Pixels monoOff=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-eye-off-render");run.record(@"blackwhite-eye-bypasses-retained-mix",difference(neutral,monoOff).maximum==0);
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"]);
@@ -186,16 +250,25 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[orientationRenderer invalidatePreview];run.record(@"preview-invalidation-clears-analysis-and-browser",![orientationRenderer preview]&&![orientationRenderer lookLUTPreview]);
[source setDiagnosticImageOrigin:kFxImageOrigin_TOP_LEFT];
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYUniforms cstExport=defaults;cstExport.cm.configured=1;cstExport.cm.exposure=.7f;
NSURL *cstCube=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"cst-export.cube"]];error=nil;BOOL cstExported=[renderer exportLUT:cstCube uniforms:cstExport paths:@{} error:&error];
NSString *cubeText=cstExported?[NSString stringWithContentsOfURL:cstCube encoding:NSUTF8StringEncoding error:&error]:nil;std::vector<float>cubeValues;
for(NSString *line in [cubeText componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){cubeValues.push_back(r);cubeValues.push_back(g);cubeValues.push_back(b);}}
Pixels gray(input.size());float grayLinear=powf((.5f+.055f)/1.055f,2.4f);for(NSUInteger i=0;i<width*height;i++){for(int c=0;c<3;c++)gray[i*4+c]=grayLinear;gray[i*4+3]=1;}
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:gray.data() bytesPerRow:width*8];Pixels grayRendered=render(run,renderer,source,destination,gpu,cstExport,@{},@"cst-export-production-sample");
BOOL cstCubeMatches=cstExported&&cubeValues.size()==33*33*33*3;for(int c=0;c<3&&cstCubeMatches;c++){float code=cubeValues[((16*33+16)*33+16)*3+c];float linear=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);cstCubeMatches&=fabs(linear-(float)grayRendered[c])<.002&&fabs(code-.5f)>.01;}
run.record(@"cube-export-includes-cst-primary-and-matches-production",cstCubeMatches,@{@"error":reason(error),@"triples":@(cubeValues.size()/3)});
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYUniforms u=defaults;u.exposure=.8f;Pixels exposed=render(run,renderer,source,destination,gpu,u,@{},@"renderer-exposure-pass");Difference exposureDifference=difference(neutral,exposed);run.record(@"exposure-affects-actual-frame",exposureDifference.nonfinite==0&&exposureDifference.different>100,measure(exposureDifference));
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.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");
checkFoldedGroup(u,offsetof(DYUniforms,hslSectionEnabled),@{},@"disabled-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");
checkFoldedGroup(u,offsetof(DYUniforms,colorGradingSectionEnabled),@{},@"disabled-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");
checkFoldedGroup(u,offsetof(DYUniforms,inputSectionEnabled),@{},@"disabled-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++;}}}
@@ -203,10 +276,68 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
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.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");
checkFoldedGroup(u,offsetof(DYUniforms,lookSectionEnabled),paths,@"disabled-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])});
// A selected external table must outlive preview-cache churn and must
// not consult the file system again on the frame-render path.
NSString *external=[runtime stringByAppendingPathComponent:@"external-65.cube"];
std::string externalCube="TITLE \"External activation fixture\"\nLUT_3D_SIZE 65\n";char row[128];
for(int z=0;z<65;z++)for(int y=0;y<65;y++)for(int x=0;x<65;x++){snprintf(row,sizeof(row),"%.8f %.8f %.8f\n",x/64.f*.82f,y/64.f,z/64.f*1.12f);externalCube+=row;}
run.need(@"external-large-cube-written",[[NSData dataWithBytes:externalCube.data() length:externalCube.size()]writeToFile:external options:NSDataWritingAtomic error:&error]);
DYRenderer *externalRenderer=[[[DYRenderer alloc]init]autorelease];
__block BOOL prepared=NO;__block NSError *preparationError=nil;__block NSUInteger beats=0;__block double last=NSProcessInfo.processInfo.systemUptime,maxGap=0;
NSTimer *heartbeat=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *timer){double now=NSProcessInfo.processInfo.systemUptime;maxGap=std::max(maxGap,now-last);last=now;beats++;}];
[externalRenderer prepareLUTPath:external completion:^(NSError *failure){preparationError=[failure retain];prepared=YES;}];
double deadline=NSProcessInfo.processInfo.systemUptime+30;
while(!prepared&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
[heartbeat invalidate];
run.need(@"external-decode-and-gpu-upload-complete",prepared&&!preparationError,@{@"error":reason(preparationError)});[preparationError release];
run.record(@"external-activation-main-loop-responsive",beats>0&&maxGap<.15,@{@"heartbeats":@(beats),@"maximumGapMS":@(maxGap*1000)});
DYUniforms externalUniforms=defaults;externalUniforms.lookSectionEnabled=1;externalUniforms.postLUTStrength=1;
NSDictionary *externalPaths=@{@"look0":external};
Pixels externalFrame=render(run,externalRenderer,source,destination,gpu,externalUniforms,externalPaths,@"external-first-frame-after-preparation");
run.record(@"external-lut-affects-frame",difference(neutral,externalFrame).different>100);
run.need(@"external-source-removed-for-no-io-check",[[NSFileManager defaultManager]removeItemAtPath:external error:&error]);
BOOL churnOK=YES;
for(int i=0;i<14;i++){@autoreleasepool{
NSString *other=[runtime stringByAppendingPathComponent:[NSString stringWithFormat:@"eviction-%02d.cube",i]];
NSString *text=@"LUT_3D_SIZE 2\n0 0 0\n1 0 0\n0 1 0\n1 1 0\n0 0 1\n1 0 1\n0 1 1\n1 1 1\n";
churnOK&=[text writeToFile:other atomically:YES encoding:NSUTF8StringEncoding error:&error];
__block BOOL ready=NO;__block BOOL success=NO;
[externalRenderer prepareLUTPath:other completion:^(NSError *failure){success=failure==nil;ready=YES;}];
double until=NSProcessInfo.processInfo.systemUptime+10;
while(!ready&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
churnOK&=ready&&success;
}}
run.need(@"external-preview-and-gpu-cache-churn",churnOK);
Pixels retainedFrame=render(run,externalRenderer,source,destination,gpu,externalUniforms,externalPaths,@"external-render-with-source-unavailable-after-cache-churn");
Difference retainedDifference=difference(externalFrame,retainedFrame);
run.record(@"external-snapshot-is-independent-of-file-and-preview-cache",retainedDifference.maximum==0&&retainedDifference.nonfinite==0,measure(retainedDifference));
__block BOOL cancelledDone=NO;__block BOOL cancellationReported=NO;
NSProgress *cancelled=[externalRenderer prepareLUTPath:[runtime stringByAppendingPathComponent:@"eviction-00.cube"] completion:^(NSError *failure){cancellationReported=failure.code==NSUserCancelledError;cancelledDone=YES;}];[cancelled cancel];
deadline=NSProcessInfo.processInfo.systemUptime+10;
while(!cancelledDone&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.record(@"external-preparation-cancellation",cancelledDone&&cancellationReported);
NSString *userFolder=NSProcessInfo.processInfo.environment[@"DY_DIAGNOSTIC_LUT_FOLDER"];
if(userFolder.length){
NSUInteger userCount=0;BOOL allUserFrames=YES;
NSURL *folder=[NSURL fileURLWithPath:userFolder];
for(NSURL *file in [NSFileManager.defaultManager enumeratorAtURL:folder includingPropertiesForKeys:@[NSURLIsRegularFileKey] options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:nil]){@autoreleasepool{
NSNumber *regular=nil;[file getResourceValue:&regular forKey:NSURLIsRegularFileKey error:nil];
if(!regular.boolValue||![file.pathExtension.lowercaseString isEqual:@"cube"])continue;
__block BOOL ready=NO;__block NSError *failure=nil;
[externalRenderer prepareLUTPath:file.path completion:^(NSError *result){failure=[result retain];ready=YES;}];
double until=NSProcessInfo.processInfo.systemUptime+30;
while(!ready&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.need([@"user-lut-preparation:" stringByAppendingString:file.lastPathComponent],ready&&!failure,@{@"error":reason(failure)});[failure release];
Pixels frame=render(run,externalRenderer,source,destination,gpu,externalUniforms,@{@"look0":file.path},[@"user-lut-render:" stringByAppendingString:file.lastPathComponent]);
Difference delta=difference(neutral,frame);BOOL good=delta.nonfinite==0;allUserFrames&=good;userCount++;
run.record([@"user-lut-finite-frame:" stringByAppendingString:file.lastPathComponent],good,measure(delta));
}}
run.record(@"user-folder-all-luts-prepared-and-rendered",userCount>0&&allUserFrames,@{@"files":@(userCount),@"sourceFolder":userFolder,@"sourceFilesModified":@NO});
}
[gpu release];
} @catch(NSException *exception) {
run.record(@"diagnostic-exception",false,@{@"exception":exception.name?:@"unknown",@"message":exception.reason?:@"unknown"});
+28 -1
查看文件
@@ -38,12 +38,17 @@ fragment half4 dyFragment(DYRaster in [[stage_in]],
texture3d<float> colorGrading [[texture(9)]],
constant DYUniforms& uniforms [[buffer(0)]],
constant float& sceneLevel [[buffer(1)]],
constant DYRenderOptions& options [[buffer(2)]]) {
constant DYRenderOptions& options [[buffer(2)]],
constant DYUniforms& colorUniforms [[buffer(3)]]) {
constexpr sampler sampleFilter(coord::normalized, address::clamp_to_edge, filter::linear);
half4 sample = source.sample(sampleFilter, in.uv);
if (!(sample.a > half(0.0))) return half4(0.0h);
half4 result = dy_grade(sample, in.uv, source, preLUT, look1, look2, look3,
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel);
if(options.blackWhiteMix>0.0f && options.blackWhiteMix<1.0f) {
half4 color=dy_grade(sample,in.uv,source,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel);
result.rgb=mix(color.rgb,result.rgb,half(options.blackWhiteMix));
}
result.a = sample.a;
if (options.outputPremultiplied) result.rgb *= result.a;
return result;
@@ -110,3 +115,25 @@ kernel void dyInputAnalysis(texture2d<half> source [[texture(0)]],
encoded=round(clamp(encoded,0.0f,1.0f)*255.0f)/255.0f;
outRGBA[pixel.y*320+pixel.x]=float4(encoded,float(sample.a));
}
// CST/BASIS arithmetic is reused verbatim from the versioned dayu-cst source.
float4 cst_air(half4 sample, constant CSTParams& params);
float4 basis_air(half4 sample, constant BasisParams& params);
inline float3 dyEncode(float3 linear) {
return select(1.055f*pow(max(linear,float3(0)),float3(1.0f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);
}
inline float3 dyDecode(float3 encoded) {
return select(pow(max((encoded+.055f)/1.055f,float3(0)),float3(2.4f)),encoded/12.92f,encoded<=.04045f);
}
kernel void dyColorManagement(texture2d<float,access::read> source [[texture(0)]],
texture2d<half,access::write> destination [[texture(1)]],
constant DayuRenderParams& p [[buffer(0)]],constant float& amount [[buffer(1)]],uint2 pos [[thread_position_in_grid]]) {
if(pos.x>=source.get_width()||pos.y>=source.get_height())return;
float4 sample=source.read(pos);if(!(sample.a>0)){destination.write(half4(0),pos);return;}
float4 raw=float4(dyEncode(sample.rgb),sample.a),c=raw;
if(p.stages&1)c=cst_air(half4(c),p.input);
if(p.stages&2){if(p.reserved&8)c=cst_air(half4(c),p.basisInput);c=basis_air(half4(c),p.basis);if(p.reserved&8)c=cst_air(half4(c),p.basisOutput);}
if(p.stages&4)c=cst_air(half4(c),p.output);
c.rgb=mix(raw.rgb,c.rgb,amount);
destination.write(half4(half3(dyDecode(c.rgb)),half(sample.a)),pos);
}
+85 -40
查看文件
@@ -167,11 +167,12 @@ static NSArray *DYPresentationSections(void) {
NSMutableDictionary *bySection=[NSMutableDictionary dictionary],*byKey=[NSMutableDictionary dictionary];
for(NSDictionary *s in DYSections())bySection[s[@"key"]]=s;
for(NSDictionary *d in DYDescriptors())byKey[d[@"key"]]=d;
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];input[@"rows"]=@[byKey[@"preLUTStrength"]];
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];
NSMutableDictionary *base=[[bySection[@"base"] mutableCopy]autorelease];NSMutableArray *rows=[NSMutableArray array];
for(NSString *key in @[@"temperature",@"tint",@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"texture",@"clarity",@"dehaze",@"vibrance",@"saturation",@"skinEnabled",@"copyAutoGrade"]){NSDictionary*d=byKey[key];if(d)[rows addObject:d];}
base[@"rows"]=rows;base[@"extraEnabled"]=bySection[@"color"][@"enabled"];
return @[input,base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
base[@"title"]=@"基础调整";
return @[input,bySection[@"primary"],bySection[@"output"],base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
}
@@ -392,6 +393,8 @@ static NSImage *DYWheelImage(void) {
NSProgress *_menuScan;
NSDictionary *_pendingAssetMenuCommand;
}
- (NSProgress *)setAssetPath:(NSString *)path forKey:(NSString *)key completion:(void (^)(NSError *))completion;
- (BOOL)commitAssetPath:(NSString *)path forKey:(NSString *)key error:(NSError **)error;
@end
@implementation DYInspector
@@ -410,7 +413,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([[NSBundle bundleForClass:self.class]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"1.1.3",9) retain]; _subtitle.textColor=DYThemeColor(@"secondary");
_subtitle=[DYLabel([[NSBundle bundleForClass:self.class]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"1.1.5",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];
@@ -493,7 +496,7 @@ static NSImage *DYWheelImage(void) {
[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=@"启用或旁路本组";
@@ -505,8 +508,8 @@ static NSImage *DYWheelImage(void) {
[card addSubview:reset];
NSMutableArray *body=[NSMutableArray array];
NSString *key=section[@"key"]?:@"";
if([key localizedCaseInsensitiveContainsString:@"input"]) {
[body addObject:[self assetRowForKey:@"input" title:@"输入色彩" inCard:card]];
if([key isEqual:@"input"]) {
NSButton *migrate=DYButton(@"旧版输入 → 改用 CST",self,@selector(useCST:));migrate.identifier=@"legacyInput";migrate.toolTip=@"保留旧工程输入效果;点击后改用上方 CST 设置,可撤销";[card addSubview:migrate];[body addObject:migrate];
}
if([key localizedCaseInsensitiveContainsString:@"look"]) {
for(NSInteger i=0;i<5;i++) {
@@ -550,7 +553,7 @@ static NSImage *DYWheelImage(void) {
NSButton *eye=DYButton(@"",self,@selector(itemEnabled:));eye.bordered=NO;[eye setButtonType:NSButtonTypePushOnPushOff];eye.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用"];eye.tag=[pid integerValue];eye.contentTintColor=DYAccent();eye.accessibilityLabel=[d[@"title"] stringByAppendingString:@"启用"];eye.toolTip=@"启用或旁路此项";[row addSubview:eye];record[@"itemEnabled"]=eye;
}
NSString *kind=d[@"kind"]?:@"float";
if([kind isEqualToString:@"bool"]) {
if([kind isEqualToString:@"bool"]||[d[@"key"]hasPrefix:@"cmbypass"]) {
NSButton *toggle=[NSButton checkboxWithTitle:@"" target:self action:@selector(scalarChanged:)];
toggle.tag=[pid integerValue]; toggle.contentTintColor=DYAccent(); toggle.accessibilityLabel=d[@"title"];
[row addSubview:toggle]; record[@"toggle"]=toggle;
@@ -587,7 +590,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":@(![section[@"defaultEnabled"]boolValue])}];
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![@[@"primary",@"base"]containsObject:key])}];
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++;
@@ -609,6 +612,7 @@ static NSImage *DYWheelImage(void) {
}
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
if([key isEqual:@"legacyInput"])return [_tabs[@"legacyInput"]boolValue];
if([section isEqual:@"curve"] && ![key isEqual:@"curveGraph"])return NO;
if([section isEqual:@"hsl"]) {
int axis=0,color=0;if(sscanf(key.UTF8String,"hsl%d_%d",&axis,&color)==2)return color==tab;
@@ -687,7 +691,7 @@ static NSImage *DYWheelImage(void) {
if(d[@"enabled"]) {double enabled=1;[get getFloatValue:&enabled fromParameter:[d[@"enabled"] unsignedIntValue] atTime:t];[r[@"itemEnabled"] setState:enabled>=.5?NSControlStateValueOn:NSControlStateValueOff];[r[@"itemEnabled"] setImage:[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"]];for(NSString *control in @[@"slider",@"field",@"popup"]) [r[control] setAlphaValue:enabled>=.5?1:.45];}
[r[@"slider"] setDoubleValue:v]; [r[@"field"] setStringValue:DYNumber(v,d)];
[r[@"toggle"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))];
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0){NSArray *values=d[@"values"];NSInteger index=values?[values indexOfObject:@((int)llround(v))]:(NSInteger)llround(v);[popup selectItemAtIndex:index==NSNotFound?0:MAX(0,MIN(index,popup.numberOfItems-1))];}
}
for(id graphic in _graphics)[graphic setValues:graphicValues];
for(NSMutableDictionary *c in _cards) {
@@ -696,19 +700,21 @@ static NSImage *DYWheelImage(void) {
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;
DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
NSNumber *saved=[token isKindOfClass:DYInspectorToken.class]?token.folds[c[@"section"][@"key"]]:nil;
BOOL collapsed=saved?saved.boolValue:[c[@"collapsed"]boolValue];groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
[c[@"header"]setState:collapsed?NSControlStateValueOff:NSControlStateValueOn];
[c[@"header"]setToolTip:collapsed?@"展开界面,不改变启用状态;双击还原本组":@"折叠界面,保持当前效果;双击还原本组"];
[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]];
for(NSView *row in c[@"body"])row.alphaValue=enabled?1:.45;
}
DYAssetState *assets=DYReadAssets(_manager,t);
double profile=0,configured=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];[get getFloatValue:&configured fromParameter:2236 atTime:t];
DYInspectorToken *oldToken=nil;[get getCustomParameterValue:&oldToken fromParameter:DYInspectorParameterID atTime:t];
_tabs[@"legacyInput"]=@(configured<.5&&(configured<0||profile>.5||[assets.paths[@"input"]length]||oldToken.schema<2));
for(NSString *key in _assetButtons) {
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
@@ -729,7 +735,7 @@ static NSImage *DYWheelImage(void) {
if(_refreshing)return;
NSNumber *pid=@(sender.tag); NSDictionary *r=_controls[pid],*d=r[@"descriptor"]; if(!d)return;
double v;
if([sender isKindOfClass:[NSPopUpButton class]])v=[(NSPopUpButton *)sender indexOfSelectedItem];
if([sender isKindOfClass:[NSPopUpButton class]]){NSInteger i=[(NSPopUpButton *)sender indexOfSelectedItem];v=d[@"values"]?[d[@"values"][i]doubleValue]:i;}
else if([sender isKindOfClass:[NSButton class]])v=[(NSButton *)sender state]==NSControlStateValueOn?1:0;
else {
if([sender isKindOfClass:[NSTextField class]]) {
@@ -743,7 +749,12 @@ static NSImage *DYWheelImage(void) {
v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v));
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime]; }
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"]||[d[@"key"]isEqual:@"blackWhiteMix"]){
id<FxParameterRetrievalAPI_v6>get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];DYInspectorToken *old=nil;[get getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:action.currentTime];
if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];
else if(old.schema<2){double cfg=0;[get getFloatValue:&cfg fromParameter:2236 atTime:action.currentTime];if(cfg<.5)[set setFloatValue:-1 toParameter:2236 atTime:action.currentTime];}
if(old.schema<2){DYInspectorToken *token=[[old copy]autorelease];token.schema=2;[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];}
} }
@finally { [action endAction:self]; }
[self postChanged];
}
@@ -751,7 +762,7 @@ static NSImage *DYWheelImage(void) {
NSDictionary *r=_controls[@(sender.tag)],*d=r[@"descriptor"];if(!d)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:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];}
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];}
@finally {[action endAction:self];}
[self postChanged];
}
@@ -783,6 +794,7 @@ static NSImage *DYWheelImage(void) {
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];
@@ -790,7 +802,19 @@ static NSImage *DYWheelImage(void) {
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
- (void)toggleSection:(NSButton *)sender {
if(sender.tag<0||sender.tag>=_cards.count)return;
[self setSectionEnabled:[_cards[sender.tag][@"collapsed"]boolValue] atIndex:sender.tag];
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;[action startAction:self];
@try {
id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
DYInspectorToken *old=nil;[get getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:action.currentTime];DYInspectorToken *token=[old isKindOfClass:DYInspectorToken.class]?[[old copy]autorelease]:[[[DYInspectorToken alloc]init]autorelease];
NSMutableDictionary *folds=[[token.folds mutableCopy]autorelease];
for(NSDictionary *card in _cards)folds[card[@"section"][@"key"]]=card[@"collapsed"];
NSString *key=_cards[sender.tag][@"section"][@"key"];folds[key]=@(![_cards[sender.tag][@"collapsed"]boolValue]);token.folds=folds;
[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];
}@finally{[action endAction:self];}[self postChanged];
}
- (void)useCST:(id)sender {
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];
@try{id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:1 toParameter:2236 atTime:a.currentTime];} @finally{[a endAction:self];}[self postChanged];
}
- (void)resetSection:(NSButton *)sender {
[self cancelAssetLoads];
@@ -803,6 +827,9 @@ static NSImage *DYWheelImage(void) {
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];}
double defaultEnabled=[section[@"defaultEnabled"]doubleValue];
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:defaultEnabled toParameter:enabled.unsignedIntValue atTime:t];
if([@[@"input",@"primary",@"output"]containsObject:section[@"key"]])[set setFloatValue:1 toParameter:2236 atTime:t];
if([section[@"key"]isEqual:@"blackwhite"]){DYInspectorToken *old=nil;[[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:t];if(old.schema<2){DYInspectorToken *current=[[old copy]autorelease];current.schema=2;[set setCustomParameterValue:current toParameter:DYInspectorParameterID atTime:t];[set setFloatValue:-1 toParameter:2236 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"]) {
@@ -825,6 +852,8 @@ static NSImage *DYWheelImage(void) {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
for(NSDictionary *d in DYDescriptors())[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=@{};DYWriteAssets(_manager,assets,t);
[set setCustomParameterValue:[[[DYInspectorToken alloc]init]autorelease] toParameter:DYInspectorParameterID atTime:t];
for(NSMutableDictionary *card in _cards)card[@"collapsed"]=@(![@[@"primary",@"base"]containsObject:card[@"section"][@"key"]]);
} @finally {[action endAction:self];}
[self postChanged];
}
@@ -870,7 +899,7 @@ static NSImage *DYWheelImage(void) {
[_browser close];[_browser release];_browser=nil;
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];NSString *selected=nil;@try{selected=[DYReadAssets(_manager,a.currentTime).paths[sender.identifier]copy];}@finally{[a endAction:self];}
__block DYInspector *owner=self;NSString *key=[[sender.identifier copy]autorelease];
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYThemePalette() selection:^(NSString *path){[owner setAssetPath:path forKey:key];}];[selected release];
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYThemePalette() selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){return [owner setAssetPath:path forKey:key completion:completion];}];[selected release];
id<FxRemoteWindowAPI> remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];
if(!remote)remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v2)];if(!remote)remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI)];
DYLUTBrowser *browser=_browser;id<FxRemoteWindowAPI_v3> closer=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];
@@ -885,30 +914,44 @@ static NSImage *DYWheelImage(void) {
NSError *error=nil;if(![[NSFileManager defaultManager]createDirectoryAtURL:_library.rootURL withIntermediateDirectories:YES attributes:nil error:&error]){[self showError:error.localizedDescription];return;}[[NSWorkspace sharedWorkspace]openURL:_library.rootURL];
}
- (void)removeAsset:(NSButton *)sender { [self setAssetPath:nil forKey:sender.identifier]; }
- (void)setAssetPath:(NSString *)path forKey:(NSString *)key {
- (void)setAssetPath:(NSString *)path forKey:(NSString *)key {[self setAssetPath:path forKey:key completion:nil];}
- (NSProgress *)setAssetPath:(NSString *)path forKey:(NSString *)key completion:(void (^)(NSError *))completion {
[_assetLoads[key]cancel];[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
if(!path.length){[self commitAssetPath:nil forKey:key];return;}
if(!path.length){
NSError *error=nil;[self commitAssetPath:nil forKey:key error:&error];
NSProgress *done=[NSProgress discreteProgressWithTotalUnitCount:1];done.completedUnitCount=1;
dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});return done;
}
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 (^prepared)(NSError *)=^(NSError *error){
if([_assetLoadIDs[key]unsignedIntegerValue]!=requestID||!self.window){
if(completion)completion([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]);return;
}
[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
NSError *result=error;
if(!result)[self commitAssetPath:path forKey:key error:&result];
if(result){[self refresh];[_assetButtons[key][@"choose"]setTitle:@"载入失败"];[_assetButtons[key][@"choose"]setToolTip:result.localizedDescription];}
if(completion)completion(result);
};
NSProgress *task=_renderer?[_renderer prepareLUTPath:path completion:prepared]:DYLUTPrepareAsync(path,prepared);
_assetLoads[key]=task;[_assetButtons[key][@"choose"]setTitle:@"正在载入…"];return task;
}
- (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];
- (BOOL)commitAssetPath:(NSString *)path forKey:(NSString *)key error:(NSError **)error {
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];
if(!action){if(error)*error=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:@"宿主暂时无法应用 LUT,请重试"}];return NO;}
BOOL written=NO;[action startAction:self];
@try {
CMTime t=action.currentTime;DYAssetState *assets=[[DYReadAssets(_manager,t) copy] autorelease];
if(!assets)assets=[[[DYAssetState alloc] init] autorelease];
NSMutableDictionary *paths=[[assets.paths mutableCopy] autorelease];if(!paths)paths=[NSMutableDictionary dictionary];
if(path.length)paths[key]=path;else [paths removeObjectForKey:key];
assets.paths=paths;DYWriteAssets(_manager,assets,t);
assets.paths=paths;written=DYWriteAssets(_manager,assets,t);
} @finally {[action endAction:self];}
[self postChanged];
if(written)[self postChanged];else if(error)*error=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:@"宿主未接受此 LUT,原来的选择已保留"}];
return written;
}
- (void)showError:(NSString *)message {
NSAlert *a=[[[NSAlert alloc] init] autorelease];a.messageText=@"大鱼调色";a.informativeText=message?:@"操作未完成";[a addButtonWithTitle:@"好"];[a runModal];
@@ -920,9 +963,10 @@ static NSImage *DYWheelImage(void) {
@try {
CMTime t=action.currentTime;id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
for(NSDictionary *d in DYDescriptors()) {double v=[d[@"default"] doubleValue];[get getFloatValue:&v fromParameter:[d[@"pid"] unsignedIntValue] atTime:t];if(std::isfinite(v))values[d[@"key"]]=@(v);}
DYUniforms effective;DYReadUniforms(_manager,t,&effective);values[@"cmConfigured"]=@(effective.cm.configured);values[@"blackWhiteMix"]=@(effective.cm.blackWhiteMix);
paths=[[DYReadAssets(_manager,t).paths copy] autorelease]?:@{};
} @finally {[action endAction:self];}
return @{@"format":@"com.dayu.color.preset",@"version":@1,@"values":values,@"paths":paths};
return @{@"format":@"com.dayu.color.preset",@"version":@2,@"values":values,@"paths":paths};
}
- (void)savePreset:(id)sender {
NSDictionary *snapshot=[self presetSnapshot];if(!snapshot)return;
@@ -937,11 +981,11 @@ static NSImage *DYWheelImage(void) {
NSError *error=nil;NSData *data=[NSData dataWithContentsOfURL:panel.URL options:0 error:&error];
if(!data||data.length>2*1024*1024){[self showError:error.localizedDescription?:@"预设文件过大"];return;}
id json=[NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
if(![json isKindOfClass:NSDictionary.class]||![json[@"format"] isEqual:@"com.dayu.color.preset"]||![json[@"version"] isEqual:@1]||![json[@"values"] isKindOfClass:NSDictionary.class]||![json[@"paths"] isKindOfClass:NSDictionary.class]){[self showError:@"这不是有效的大鱼调色预设。"];return;}
if(![json isKindOfClass:NSDictionary.class]||![json[@"format"] isEqual:@"com.dayu.color.preset"]||![@[@1,@2]containsObject:json[@"version"]]||![json[@"values"] isKindOfClass:NSDictionary.class]||![json[@"paths"] isKindOfClass:NSDictionary.class]){[self showError:@"这不是有效的大鱼调色预设。"];return;}
NSDictionary *values=json[@"values"],*paths=json[@"paths"];
for(NSDictionary *d in DYDescriptors()) {
id v=values[d[@"key"]];if(!v)continue;
if(![v isKindOfClass:NSNumber.class]||!std::isfinite([v doubleValue])||[v doubleValue]<[d[@"min"] doubleValue]||[v doubleValue]>[d[@"max"] doubleValue]){[self showError:@"预设包含无效参数,尚未修改当前调色。"];return;}
if(![v isKindOfClass:NSNumber.class]||!std::isfinite([v doubleValue])||[v doubleValue]<[d[@"min"] doubleValue]||[v doubleValue]>[d[@"max"] doubleValue]||(d[@"values"]&&![d[@"values"]containsObject:v])){[self showError:@"预设包含无效参数,尚未修改当前调色。"];return;}
}
NSMutableDictionary *validPaths=[NSMutableDictionary dictionary];NSMutableArray *missing=[NSMutableArray array];
for(NSString *key in @[@"input",@"look0",@"look1",@"look2",@"look3",@"look4"]) {
@@ -955,6 +999,7 @@ static NSImage *DYWheelImage(void) {
@try {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
for(NSDictionary *d in DYDescriptors())if(values[d[@"key"]])[set setFloatValue:[values[d[@"key"]] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];
if([json[@"version"]isEqual:@1]&&!values[@"cmConfigured"]){[set setFloatValue:-1 toParameter:2236 atTime:t];[set setFloatValue:1 toParameter:2270 atTime:t];}
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=validPaths;DYWriteAssets(_manager,assets,t);
} @finally {[action endAction:self];}
[self postChanged];
+4 -3
查看文件
@@ -2,15 +2,16 @@
@class DYLUTLibrary;
/// A nonmodal browser. Selecting a validated thumbnail applies that LUT.
/// All UI and selection callbacks run on the main thread.
typedef NSProgress * (^DYLUTSelectionHandler)(NSString *path,void (^completion)(NSError *error));
/// A nonmodal browser. The handler finishes asynchronously on the main thread
/// after decoding, GPU preparation and the host edit have actually succeeded.
@interface DYLUTBrowser : NSWindowController
@property(nonatomic,readonly) BOOL visible;
- (instancetype)initWithLibrary:(DYLUTLibrary *)library
preview:(NSData *)rgba
selectedPath:(NSString *)path
palette:(NSDictionary *)palette
selection:(void (^)(NSString *path))selection;
selection:(DYLUTSelectionHandler)selection;
- (void)showRelativeToView:(NSView *)view;
/// Attach to the FxRemoteWindow API's supplied parent; the caller owns that API.
/// Completion, double-click and close dismiss through closeAction exactly once.
+17 -10
查看文件
@@ -105,7 +105,7 @@ static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview
NSData *_preview;
NSString *_selectedPath,*_folder;
NSDictionary *_palette;
void (^_selection)(NSString *);
DYLUTSelectionHandler _selection;
void (^_closeAction)(void);
NSPopover *_popover;
DYBrowserCanvas *_root,*_folderDocument,*_gridDocument;
@@ -133,12 +133,12 @@ static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview
@implementation DYLUTBrowser
static NSTextField *BrowserLabel(NSString *title,CGFloat size){NSTextField *label=[NSTextField labelWithString:title];label.font=[NSFont systemFontOfSize:size];label.lineBreakMode=NSLineBreakByTruncatingTail;return label;}
static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *button=[NSButton buttonWithTitle:title target:target action:action];button.font=[NSFont systemFontOfSize:11];button.bezelStyle=NSBezelStyleRounded;return button;}
- (instancetype)initWithLibrary:(DYLUTLibrary *)library preview:(NSData *)rgba selectedPath:(NSString *)path palette:(NSDictionary *)palette selection:(void (^)(NSString *))selection{
- (instancetype)initWithLibrary:(DYLUTLibrary *)library preview:(NSData *)rgba selectedPath:(NSString *)path palette:(NSDictionary *)palette selection:(DYLUTSelectionHandler)selection{
NSPanel *panel=[[[NSPanel alloc]initWithContentRect:NSMakeRect(0,0,760,560) styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO]autorelease];
if((self=[super initWithWindow:panel])){
NSString *savedFolder=[[NSUserDefaults standardUserDefaults]stringForKey:DYBrowserFolderPreference];
_library=[library retain];_preview=[rgba copy];_selectedPath=[path copy];_folder=[(savedFolder?:@"*") copy];_selection=[selection copy];
_folderButtons=[NSMutableArray new];_tiles=[NSMutableDictionary new];_queuedPaths=[NSMutableSet new];_thumbnailCache=[NSCache new];_thumbnailCache.countLimit=600;_thumbnailCache.totalCostLimit=64*1024*1024;_previewQueue=dispatch_queue_create("com.dayu.color.lut-thumbnails",DISPATCH_QUEUE_SERIAL);
_folderButtons=[NSMutableArray new];_tiles=[NSMutableDictionary new];_queuedPaths=[NSMutableSet new];_thumbnailCache=[NSCache new];_thumbnailCache.countLimit=600;_thumbnailCache.totalCostLimit=64*1024*1024;_previewQueue=dispatch_queue_create("com.dayu.color.lut-thumbnails",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_previewQueue,dispatch_get_global_queue(QOS_CLASS_UTILITY,0));
panel.title=@"风格 LUT";panel.minSize=NSMakeSize(760,420);panel.releasedWhenClosed=NO;panel.hidesOnDeactivate=NO;panel.delegate=self;
_root=[[DYBrowserCanvas alloc]initWithFrame:NSMakeRect(0,0,760,560)];_root.accessibilityLabel=@"LUT 缩略图浏览库";panel.contentView=_root;
_titleLabel=[BrowserLabel(@"LUT 文件夹",14)retain];_titleLabel.font=[NSFont systemFontOfSize:14 weight:NSFontWeightSemibold];
@@ -397,19 +397,26 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
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){
void (^applied)(NSError *)=^(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];
[self setStatus:[@"已选择 " stringByAppendingString:name]];if(closeAfter)[self close];
};
_selectionTask=[(_selection?_selection(path,applied):DYLUTPrepareAsync(path,applied))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"];
NSUInteger generation=++_selectionGeneration;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;
[self setStatus:@"正在移除 LUT…"];
void (^cleared)(NSError *)=^(NSError *error){
if(_closed||generation!=_selectionGeneration)return;[_selectionTask release];_selectionTask=nil;
if(error){[self setStatus:error.localizedDescription];return;}
[_selectedPath release];_selectedPath=nil;
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=NO;[tile setNeedsDisplay:YES];}
[self setStatus:@"已移除 LUT"];
};
if(_selection)_selectionTask=[_selection(nil,cleared)retain];else cleared(nil);
}
- (void)done:(id)sender{[self close];}
- (void)showImportError:(NSError *)error{if(error&&!_closed)[self setStatus:error.localizedDescription];}
+13
查看文件
@@ -6,6 +6,19 @@
NS_ASSUME_NONNULL_BEGIN
/// Immutable decoded contents. A retained snapshot survives preview-cache
/// eviction and does not consult the source file while a frame is rendered.
@interface DYLUTPreparedTable : NSObject
@property(nonatomic,readonly) NSUInteger dimension;
@property(nonatomic,readonly,copy) NSString *path;
@property(nonatomic,readonly,copy) NSString *revision;
- (const float *)rgbaValues;
@end
/// Synchronous worker-only entry; do not call it from an inspector action.
FOUNDATION_EXPORT DYLUTPreparedTable * _Nullable DYLUTReadPreparedTable(NSString *path,
NSProgress * _Nullable progress, NSError * _Nullable * _Nullable error);
#ifdef __cplusplus
/// Same red-fastest 3D Cube table and DOMAIN resampling used by the renderer.
/// Output is cleared on failure. Built-in .dylut tables are also supported.
+105 -25
查看文件
@@ -32,12 +32,19 @@ static BOOL DYLUTFail(NSError **error,NSString *message) {
return NO;
}
@interface DYLUTTable : NSObject {
@interface DYLUTPreparedTable () {
@public std::vector<float> values;
@public NSUInteger dimension;
@public NSUInteger _dimension;
@public NSString *_path,*_revision;
}
@end
@implementation DYLUTTable @end
@implementation DYLUTPreparedTable
- (void)dealloc {[_path release];[_revision release];[super dealloc];}
- (NSUInteger)dimension {return _dimension;}
- (NSString *)path {return _path;}
- (NSString *)revision {return _revision;}
- (const float *)rgbaValues {return values.data();}
@end
static NSCache *DYLUTTableCache(void) {
static NSCache *cache;static dispatch_once_t once;
@@ -67,6 +74,78 @@ static BOOL DYLUTCancelled(NSProgress *progress,NSError **error) {
if(error)*error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
return YES;
}
static NSError *DYLUTFileError(NSError *error,NSURL *url) {
if(error.code==NSUserCancelledError&&[error.domain isEqual:NSCocoaErrorDomain])return error;
NSMutableDictionary *info=[NSMutableDictionary dictionaryWithDictionary:error.userInfo?:@{}];
info[NSLocalizedDescriptionKey]=[NSString stringWithFormat:@"%@:%@",url.lastPathComponent,error.localizedDescription?:@"无法读取此 LUT"];
info[NSFilePathErrorKey]=url.path;if(error)info[NSUnderlyingErrorKey]=error;
return [NSError errorWithDomain:error.domain?:DYLUTLibraryErrorDomain code:error?error.code:1 userInfo:info];
}
static bool DYLUTUnicodeSpace(uint32_t c) {
return c==0x20||(c>=9&&c<=13)||c==0x85||c==0xa0||c==0x1680||
(c>=0x2000&&c<=0x200a)||c==0x2028||c==0x2029||c==0x202f||c==0x205f||c==0x3000;
}
static void DYLUTAppendScalar(std::string& text,uint32_t c) {
if(DYLUTUnicodeSpace(c)) {
text+=char(c==13?'\r':c==10||c==0x85||c==0x2028||c==0x2029?'\n':' ');return;
}
if(c<0x80)text+=char(c);
else if(c<0x800){text+=char(0xc0|(c>>6));text+=char(0x80|(c&63));}
else if(c<0x10000){text+=char(0xe0|(c>>12));text+=char(0x80|((c>>6)&63));text+=char(0x80|(c&63));}
else {text+=char(0xf0|(c>>18));text+=char(0x80|((c>>12)&63));text+=char(0x80|((c>>6)&63));text+=char(0x80|(c&63));}
}
// Normalize only the working copy. Imports retain their original bytes. Narrow
// files remain byte-transparent so legacy TITLE/comment encodings still work.
static BOOL DYLUTText(NSData *bytes,std::string& text,NSProgress *progress,NSError **error) {
const uint8_t *p=(const uint8_t *)bytes.bytes;size_t length=bytes.length,offset=0,width=1;bool little=true;
if(!length)return DYLUTFail(error,@"LUT 文件为空");
auto unit=[&](size_t at,size_t w,bool le){uint32_t c=0;for(size_t k=0;k<w;k++)c|=uint32_t(p[at+k])<<(8*(le?k:w-1-k));return c;};
if(length>=4&&unit(0,4,true)==0x0000feff){width=4;offset=4;}
else if(length>=4&&unit(0,4,false)==0x0000feff){width=4;offset=4;little=false;}
else if(length>=2&&unit(0,2,true)==0xfeff){width=2;offset=2;}
else if(length>=2&&unit(0,2,false)==0xfeff){width=2;offset=2;little=false;}
else if(length>=3&&!memcmp(p,"\xef\xbb\xbf",3))offset=3;
else {
// Without a BOM, infer byte order only from a recognizable Cube prefix.
// Never remove arbitrary NUL bytes or guess an encoding from the title.
auto prefix=[&](size_t w,bool le){bool whitespace=false;
for(size_t at=0;at+w<=length&&at<128;at+=w){uint32_t c=unit(at,w,le);
if(DYLUTUnicodeSpace(c)||c==0xfeff){whitespace=true;continue;}
return c=='#'||(c>='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||c=='+'||c=='-'||c=='.';
}return whitespace;
};
for(size_t w:{size_t(4),size_t(2)}) {
if(prefix(w,true)){width=w;break;}
if(prefix(w,false)){width=w;little=false;break;}
}
}
if(width==1){text.assign((const char *)p+offset,length-offset);return !DYLUTCancelled(progress,error);}
NSString *encoding=[NSString stringWithFormat:@"UTF-%lu%@",(unsigned long)(width*8),little?@"LE":@"BE"];
auto invalid=[&](NSString *detail){return DYLUTFail(error,[NSString stringWithFormat:@"%@ 编码损坏:%@",encoding,detail]);};
if((length-offset)%width)return invalid(@"文件结尾不完整");
text.clear();text.reserve((length-offset)/width);
size_t nextCancellationCheck=offset;
for(size_t at=offset;at<length;at+=width){
if(at>=nextCancellationCheck){if(DYLUTCancelled(progress,error))return NO;nextCancellationCheck=at+16384;}
uint32_t c=unit(at,width,little);
if(width==2&&c>=0xd800&&c<=0xdbff){
if(at+4>length)return invalid(@"缺少配对字符");uint32_t next=unit(at+2,2,little);
if(next<0xdc00||next>0xdfff)return invalid(@"字符配对无效");c=0x10000+((c-0xd800)<<10)+(next-0xdc00);at+=2;
}else if(c>=0xd800&&c<=0xdfff)return invalid(@"孤立的配对字符");
if(c>0x10ffff||c==0)return invalid(@"含无效字符");
DYLUTAppendScalar(text,c);
}
return !DYLUTCancelled(progress,error);
}
static std::string_view DYLUTTrim(std::string_view v) {
while(!v.empty()) {
unsigned char c=v.front();size_t count=0;
if(c<0x80){if(c==' '||(c>=9&&c<=13))count=1;else break;}
else if(c==0xc2&&v.size()>=2&&v[1]=='\xa0')count=2;
else if((c==0xe1||c==0xe2||c==0xe3)&&v.size()>=3&&(v.substr(0,3)=="\xe1\x9a\x80"||v.substr(0,3)=="\xe2\x80\xaf"||v.substr(0,3)=="\xe2\x81\x9f"||v.substr(0,3)=="\xe3\x80\x80"||(v.substr(0,2)=="\xe2\x80"&&(unsigned char)v[2]>=0x80&&(unsigned char)v[2]<=0x8a)))count=3;
if(!count)break;v.remove_prefix(count);
}return v;
}
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];
@@ -85,35 +164,31 @@ 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;
}
// 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);
std::string storage;if(!DYLUTText(bytes,storage,progress,error))return NO;
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 trim=DYLUTTrim;
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);
if(end==std::string_view::npos)remaining={};else {size_t count=end+1;if(remaining[end]=='\r'&&count<remaining.size()&&remaining[count]=='\n')count++;remaining.remove_prefix(count);}
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,且只能声明一次");
if(result.ec!=std::errc{}||!trim(v.substr(result.ptr-v.data())).empty()||foundSize||n<2||n>128)return DYLUTFail(error,@"LUT 尺寸应为 2–128,且只能声明一次");
size=n;foundSize=YES;data.reserve(size*size*size*4);
} 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 范围无效");
auto v=line.substr(10);if(!number(v,r)||!number(v,g)||!number(v,b)||!trim(v).empty())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 含无效数据行");
auto v=line;if(!number(v,r)||!number(v,g)||!number(v,b)||!trim(v).empty()||!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(b))return DYLUTFail(error,[NSString stringWithFormat:@"LUT 第 %lu 行含无效数字或多余内容",(unsigned long)rows]);
data.insert(data.end(),{r,g,b,1});if(data.size()>128*128*128*4)return DYLUTFail(error,@"LUT 数据过多");
}
}
@@ -137,19 +212,24 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
return YES;
}
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 文件");
DYLUTPreparedTable *DYLUTReadPreparedTable(NSString *path,NSProgress *progress,NSError **error) {
if(DYLUTCancelled(progress,error))return nil;
if(!path.length){DYLUTFail(error,@"未选择 LUT 文件");return nil;}
NSDictionary *a=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:error];
if(!a)return NO;
if(!a)return nil;
NSString *key=[NSString stringWithFormat:@"%@|%.9f|%@|%@",path.stringByStandardizingPath,[a[NSFileModificationDate]timeIntervalSinceReferenceDate],a[NSFileSize],a[NSFileSystemFileNumber]];
DYLUTTable *cached=[DYLUTTableCache()objectForKey:key];
if(cached){data=cached->values;size=cached->dimension;return YES;}
DYLUTPreparedTable *cached=[DYLUTTableCache()objectForKey:key];
if(cached)return cached;
std::vector<float> parsed;NSUInteger n=0;
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;
if(DYLUTCancelled(progress,error)||!DYLUTParse(path,parsed,n,progress,error))return nil;
DYLUTPreparedTable *table=[[[DYLUTPreparedTable alloc]init]autorelease];table->values=std::move(parsed);table->_dimension=n;
table->_path=[path copy];table->_revision=[key copy];
[DYLUTTableCache()setObject:table forKey:key cost:table->values.size()*sizeof(float)];
data=table->values;size=n;return YES;
return table;
}
static BOOL DYLUTReadCancellable(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;DYLUTPreparedTable *table=DYLUTReadPreparedTable(path,progress,error);
if(!table)return NO;data=table->values;size=table.dimension;return YES;
}
BOOL DYLUTReadCube(NSString *path,std::vector<float>& data,NSUInteger& size,NSError **error) {
@@ -162,7 +242,7 @@ NSProgress *DYLUTPrepareAsync(NSString *path,void (^completion)(NSError *)) {
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);});
dispatch_async(dispatch_get_main_queue(),^{NSError *result=error;DYLUTCancelled(progress,&result);if(completion)completion(result);});
}});return progress;
}
@@ -358,7 +438,7 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
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];
std::vector<float> values;NSUInteger n=0;valid=!DYLUTCancelled(progress,&itemError)&&DYLUTReadCancellable([plan[@"source"]path],values,n,progress,&itemError);if(!valid)itemError=DYLUTFileError(itemError,plan[@"source"]);[itemError retain];
}
if(!valid){if(error)*error=[itemError autorelease];else[itemError release];return nil;}[itemError release];progress.completedUnitCount++;
}
@@ -377,7 +457,7 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
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)itemError=DYLUTFileError(itemError,plan[@"source"]);[itemError retain];
}
if(!copied){if(error)*error=[itemError autorelease];else[itemError release];success=NO;break;}[itemError release];progress.completedUnitCount++;
}
+2
查看文件
@@ -14,6 +14,8 @@ FOUNDATION_EXPORT void DYReadUniforms(id<PROAPIAccessing> manager,CMTime time,DY
@property(copy) NSDictionary *paths;
@end
@interface DYInspectorToken : NSObject<NSSecureCoding,NSCopying,FxCustomParameterInterpolation_v2>
@property(copy) NSDictionary *folds;
@property NSInteger schema;
@end
FOUNDATION_EXPORT DYAssetState *DYReadAssets(id<PROAPIAccessing> manager,CMTime time);
FOUNDATION_EXPORT BOOL DYWriteAssets(id<PROAPIAccessing> manager,DYAssetState *assets,CMTime time);
+114 -10
查看文件
@@ -7,16 +7,116 @@ 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=0){
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=1){
NSDictionary*e=row([k stringByAppendingString:@"Enabled"],t,offset,0,1,def,@"bool");
[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");}
NSArray<NSDictionary *> *DYCMSceneSpaces(void) { return @[
@{ @"id":@99, @"name":@"KOLOR Default" },
@{ @"id":@1, @"name":@"ACEScct" },
@{ @"id":@2, @"name":@"Apple Log" },
@{ @"id":@3, @"name":@"Apple Log 2" },
@{ @"id":@4, @"name":@"ARRI LogC3" },
@{ @"id":@5, @"name":@"ARRI LogC4" },
@{ @"id":@6, @"name":@"Blackmagic Film Gen 5" },
@{ @"id":@7, @"name":@"Canon C-Log" },
@{ @"id":@8, @"name":@"Canon C-Log 2" },
@{ @"id":@9, @"name":@"Canon C-Log 3" },
@{ @"id":@10, @"name":@"DaVinci Intermediate" },
@{ @"id":@11, @"name":@"DJI D-Log" },
@{ @"id":@12, @"name":@"DJI D-Log 2" },
@{ @"id":@13, @"name":@"DJI D-Log M" },
@{ @"id":@14, @"name":@"Fujifilm F-Log" },
@{ @"id":@15, @"name":@"Fujifilm F-Log2" },
@{ @"id":@16, @"name":@"Fujifilm F-Log2 C" },
@{ @"id":@17, @"name":@"GoPro GP-Log" },
@{ @"id":@18, @"name":@"GoPro GP-Log2" },
@{ @"id":@30, @"name":@"GoPro GP-Log2 (Official, 0 EV)" },
@{ @"id":@29, @"name":@"Insta I-Log" },
@{ @"id":@19, @"name":@"Leica L-Log" },
@{ @"id":@20, @"name":@"Linear" },
@{ @"id":@21, @"name":@"Nikon N-Log" },
@{ @"id":@22, @"name":@"Panasonic V-Log" },
@{ @"id":@23, @"name":@"Phantom Log 1" },
@{ @"id":@24, @"name":@"Phantom Log 2" },
@{ @"id":@25, @"name":@"REDLog3G10" },
@{ @"id":@26, @"name":@"Samsung Log" },
@{ @"id":@27, @"name":@"Sony S-Log2" },
@{ @"id":@28, @"name":@"Sony S-Log3" }
]; }
NSArray<NSDictionary *> *DYCMDisplaySpaces(void) { return @[
@{ @"id":@1001, @"name":@"Gamma 2.2" },
@{ @"id":@1002, @"name":@"Gamma 2.4" },
@{ @"id":@1003, @"name":@"Gamma 2.6" }
]; }
NSArray<NSDictionary *> *DYCMGamuts(void) { return @[
@{ @"id":@99, @"name":@"KOLOR Default" },
@{ @"id":@1, @"name":@"ACES AP0" },
@{ @"id":@2, @"name":@"ACES AP1" },
@{ @"id":@3, @"name":@"Apple Log 2" },
@{ @"id":@4, @"name":@"ARRI WG3" },
@{ @"id":@5, @"name":@"ARRI WG4" },
@{ @"id":@6, @"name":@"Blackmagic Wide Gamut" },
@{ @"id":@7, @"name":@"Canon Cinema Gamut" },
@{ @"id":@16, @"name":@"DaVinci Wide Gamut" },
@{ @"id":@8, @"name":@"DJI Action 5" },
@{ @"id":@9, @"name":@"DJI Air 2S" },
@{ @"id":@10, @"name":@"DJI D-Gamut" },
@{ @"id":@28, @"name":@"DJI D-Gamut 2" },
@{ @"id":@11, @"name":@"DJI Mavic2 Pro" },
@{ @"id":@12, @"name":@"DJI Mavic 3 Pro" },
@{ @"id":@13, @"name":@"DJI Mini 4 Pro" },
@{ @"id":@14, @"name":@"DJI Mini 5 Pro" },
@{ @"id":@15, @"name":@"DJI Pocket 3" },
@{ @"id":@17, @"name":@"Fujifilm F-GamutC" },
@{ @"id":@18, @"name":@"GoPro GP-Log" },
@{ @"id":@19, @"name":@"P3-DCI" },
@{ @"id":@20, @"name":@"P3 D65" },
@{ @"id":@21, @"name":@"Panasonic V-Gamut" },
@{ @"id":@22, @"name":@"Rec.709 / BT.709" },
@{ @"id":@23, @"name":@"Rec.2020 / BT.2020" },
@{ @"id":@24, @"name":@"RED Wide Gamut RGB" },
@{ @"id":@25, @"name":@"Sony S-Gamut" },
@{ @"id":@26, @"name":@"Sony S-Gamut3" },
@{ @"id":@27, @"name":@"Sony S-Gamut3.Cine" }
]; }
static NSDictionary *cmRow(NSString*k,NSString*t,NSUInteger o,double lo,double hi,double def,int tab,NSArray *choices=nil){
NSMutableDictionary *d=[[row(k,t,offsetof(DYUniforms,cm)+o,lo,hi,def,choices?@"popup":@"float")mutableCopy]autorelease];d[@"cmTab"]=@(tab);
if(choices){d[@"notAnimatable"]=@YES;d[@"options"]=[choices valueForKey:@"name"];d[@"values"]=[choices valueForKey:@"id"];}
[descriptors replaceObjectAtIndex:descriptors.count-1 withObject:d];return d;
}
static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
sections=[[NSMutableArray alloc]init];descriptors=[[NSMutableArray alloc]init];
NSMutableDictionary*profile=[[scalar(@"inputProfile",@"相机输入",52,0,17)mutableCopy]autorelease];profile[@"kind"]=@"popup";profile[@"options"]=@[@"无",@"Apple Log",@"ARRI LogC3",@"ARRI LogC4",@"Blackmagic Film Gen5",@"Canon C-Log",@"Canon C-Log2",@"Canon C-Log3",@"DJI D-Log",@"DJI D-Log M",@"Fujifilm F-Log",@"Fujifilm F-Log2",@"Nikon N-Log",@"Panasonic V-Log",@"RED Log3G10",@"Sony S-Log2",@"Sony S-Log3",@"Sony HLG"];
[descriptors replaceObjectAtIndex:0 withObject:profile];
section(@"input",@"输入 / LUT",132,@[profile,scalar(@"preLUTStrength",@"输入强度",56,0,1,1)]);
// Legacy IDs remain registered for existing FCP documents and presets.
scalar(@"preLUTStrength",@"旧版输入强度",56,0,1,1);
row(@"cmConfigured",@"CST 配置版本",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,configured),-1,1,0,@"bool");
NSArray *transfers=[DYCMSceneSpaces() arrayByAddingObjectsFromArray:DYCMDisplaySpaces()];
NSMutableArray *cm=[NSMutableArray array];
#define CM(f,t,lo,hi,def,tab) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),lo,hi,def,tab)]
#define CH(f,t,def,tab,list) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),0,1003,def,tab,list)]
CM(inputEnabled,@"输入转换启用",0,1,1,0);
CH(inputTransfer,@"输入曲线",1002,0,transfers);CH(inputGamut,@"输入色域",22,0,DYCMGamuts());
CH(workingTransfer,@"工作曲线",10,0,transfers);CH(workingGamut,@"工作色域",16,0,DYCMGamuts());
CM(mix,@"CST 混合",0,1,1,0);
CM(basisEnabled,@"一级调色启用",0,1,1,1);
CM(exposure,@"一级曝光",-5,5,0,1);CM(balanceAngle,@"色彩平衡方向",0,1,0,1);CM(balanceStrength,@"色彩平衡强度",0,1,0,1);CM(saturation,@"一级饱和度",0,2,1,1);
CM(contrast,@"一级对比度",-1,1,0,1);CM(pivot,@"对比度轴心",-3,3,0,1);CM(hiContrast,@"高光对比度",-1,1,0,1);CM(hiPivot,@"高光轴心",-1,1,0,1);CM(shadowContrast,@"阴影对比度",-1,1,0,1);CM(shadowPivot,@"阴影轴心",-1,1,0,1);
CM(white,@"白点",.5,1.5,1,1);CM(shoulder,@"肩部压缩",0,1,.5,1);CM(highlights,@"一级高光",-1,1,0,1);CM(midtones,@"一级中间调",-1,1,0,1);CM(shadows,@"一级阴影",-1,1,0,1);CM(black,@"黑点",-1,1,0,1);CM(toe,@"趾部压缩",0,1,.5,1);CM(chromaMix,@"色度混合",0,1,.5,1);
CM(bypassExposure,@"旁路一级曝光",0,1,0,1);CM(bypassBalance,@"旁路一级色彩",0,1,0,1);CM(bypassContrast,@"旁路一级对比",0,1,0,1);CM(bypassTone,@"旁路一级影调",0,1,0,1);
CM(outputEnabled,@"输出转换启用",0,1,1,2);CH(outputTransfer,@"输出曲线",1002,2,transfers);CH(outputGamut,@"输出色域",22,2,DYCMGamuts());
[cm addObject:cmRow(@"cmtoneMapping",@"自动色调映射",offsetof(DYCMSettings,toneMapping),0,1,0,2,@[@{@"id":@0,@"name":@"关闭"},@{@"id":@1,@"name":@"开启"}])];
#undef CM
#undef CH
NSMutableArray *input=[NSMutableArray array],*primary=[NSMutableArray array],*output=[NSMutableArray array];
for(NSDictionary *d in cm){NSString *key=d[@"key"];if([@[@"cminputEnabled",@"cmbasisEnabled",@"cmoutputEnabled"]containsObject:key])continue;[([d[@"cmTab"]intValue]==0?input:[d[@"cmTab"]intValue]==1?primary:output) addObject:d];}
section(@"input",@"输入转换 / CST",132,input);
// Enable descriptors already exist; do not register the same offset twice.
[sections addObject:@{@"key":@"primary",@"title":@"一级调色",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,basisEnabled))),@"defaultEnabled":@1,@"rows":primary}];
[sections addObject:@{@"key":@"output",@"title":@"输出转换 / CST",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,outputEnabled))),@"defaultEnabled":@1,@"rows":output}];
NSMutableArray*base=[NSMutableArray array];
NSArray*names=@[@"曝光",@"对比度",@"高光",@"阴影",@"白色色阶",@"黑色色阶",@"色温",@"色调",@"饱和度",@"鲜艳度",@"纹理",@"清晰度",@"去朦胧"];
NSArray*keys=@[@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"temperature",@"tint",@"saturation",@"vibrance",@"texture",@"clarity",@"dehaze"];
@@ -28,7 +128,7 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
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],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);
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],1);
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)];}
section(@"look",@"风格 LUT",144,look);
@@ -49,12 +149,14 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
[grade addObject:scalar(@"gradingBlending",@"混合",404,0,100,50)];[grade addObject:scalar(@"gradingBalance",@"平衡",408)];section(@"grading",@"颜色分级",400,grade);
NSMutableArray*prim=[NSMutableArray array];for(int c=0;c<3;c++)for(int a=0;a<2;a++)[prim addObject:scalar([NSString stringWithFormat:@"primary%d_%d",c,a],[NSString stringWithFormat:@"%@原色 %@",@[@"红",@"绿",@"蓝"][c],a?@"饱和度":@"色相"],484+c*8+a*4)];section(@"primaries",@"三原色",480,prim);
NSMutableArray*levels=[NSMutableArray array];for(int c=0;c<4;c++)for(int a=0;a<5;a++)[levels addObject:scalar([NSString stringWithFormat:@"level%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"RGB",@"红",@"绿",@"蓝"][c],@[@"输入黑",@"伽马",@"输入白",@"输出黑",@"输出白"][a]],624+a*16+c*4,a==1?.1:0,a==1?10:255,a==1?1:(a==2||a==4)?255:0)];section(@"levels",@"色阶",608,levels);
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];section(@"blackwhite",@"黑白混色",704,bw,0);
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];[bw insertObject:scalar(@"blackWhiteMix",@"黑白混合",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,blackWhiteMix),0,1,0) atIndex:0];section(@"blackwhite",@"黑白混色",704,bw,1);
NSMutableArray*balance=[NSMutableArray arrayWithObject:row(@"preserveLuma",@"保持明度",756,0,1,1,@"bool")];for(int c=0;c<3;c++)for(int a=0;a<3;a++)[balance addObject:scalar([NSString stringWithFormat:@"balance%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"阴影",@"中间调",@"高光"][c],@[@"青 ↔ 红",@"洋红 ↔ 绿",@"黄 ↔ 蓝"][a]],768+c*16+a*4)];section(@"balance",@"色彩平衡",752,balance);
});}
NSArray<NSDictionary*> *DYSections(void){initialize();return sections;} NSArray<NSDictionary*> *DYDescriptors(void){initialize();return descriptors;}
void DYDefaultUniforms(DYUniforms*u){memset(u,0,sizeof(*u));for(NSDictionary*r in DYDescriptors())if([r[@"offset"]integerValue]>=0)*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=[r[@"default"]floatValue];u->primariesM0=(DYFloat3){1,0,0};u->primariesM1=(DYFloat3){0,1,0};u->primariesM2=(DYFloat3){0,0,1};}
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v))*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}}
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v)){if(r[@"values"]&&![r[@"values"]containsObject:@((int)llround(v))])v=[r[@"default"]doubleValue];*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}}NSObject<NSSecureCoding,NSCopying> *token=nil;[g getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
if([token isKindOfClass:DYInspectorToken.class]&&[(DYInspectorToken*)token schema]<2){if(u->cm.configured<.5)u->cm.configured=-1;u->cm.blackWhiteMix=1;}
}
BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreationAPI_v5>a=[m apiForProtocol:@protocol(FxParameterCreationAPI_v5)];BOOL ok=a!=nil;
ok=[a addCustomParameterWithName:@"大鱼调色" parameterID:DYInspectorParameterID defaultValue:[[[DYInspectorToken alloc]init]autorelease] parameterFlags:kFxParameterFlag_CUSTOM_UI|kFxParameterFlag_USE_FULL_VIEW_WIDTH|kFxParameterFlag_DONT_DISPLAY_IN_DASHBOARD|kFxParameterFlag_NOT_ANIMATABLE]&&ok;
for(NSDictionary*r in DYDescriptors())ok=[a addFloatSliderWithName:r[@"title"] parameterID:[r[@"pid"]unsignedIntValue] defaultValue:[r[@"default"]doubleValue] parameterMin:[r[@"min"]doubleValue] parameterMax:[r[@"max"]doubleValue] sliderMin:[r[@"min"]doubleValue] sliderMax:[r[@"max"]doubleValue] delta:[r[@"step"]doubleValue] parameterFlags:kFxParameterFlag_HIDDEN|([r[@"notAnimatable"]boolValue]?kFxParameterFlag_NOT_ANIMATABLE:0)]&&ok;
@@ -73,12 +175,14 @@ BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreat
@end
@implementation DYInspectorToken
+ (BOOL)supportsSecureCoding{return YES;}
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInt:1 forKey:@"schema"];}
- (instancetype)initWithCoder:(NSCoder*)c{return [self init];}
- (id)copyWithZone:(NSZone*)z{return [[[self class]allocWithZone:z]init];}
- (instancetype)init{if((self=[super init])){_folds=[@{} copy];_schema=2;}return self;}
- (void)dealloc{[_folds release];[super dealloc];}
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInteger:_schema forKey:@"schema"];[c encodeObject:_folds forKey:@"folds"];}
- (instancetype)initWithCoder:(NSCoder*)c{if((self=[self init])){NSDictionary *v=[c containsValueForKey:@"folds"]?[c decodeObjectOfClasses:[NSSet setWithObjects:NSDictionary.class,NSString.class,NSNumber.class,nil] forKey:@"folds"]:nil;if(v)self.folds=v;_schema=[c decodeIntegerForKey:@"schema"];}return self;}
- (id)copyWithZone:(NSZone*)z{DYInspectorToken *v=[[[self class]allocWithZone:z]init];v.folds=_folds;v.schema=_schema;return v;}
- (id)interpolateBetween:(id)r withWeight:(float)w{return [[self copy]autorelease];}
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class];}
- (NSUInteger)hash{return 1;}
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class]&&_schema==[o schema]&&[_folds isEqual:[o folds]];}
- (NSUInteger)hash{return _folds.hash;}
@end
DYAssetState*DYReadAssets(id<PROAPIAccessing>m,CMTime t){DYAssetState*v=nil;id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];[g getCustomParameterValue:&v fromParameter:DYAssetsParameterID atTime:t];return [v isKindOfClass:DYAssetState.class]?v:[[[DYAssetState alloc]init]autorelease];}
BOOL DYWriteAssets(id<PROAPIAccessing>m,DYAssetState*v,CMTime t){id<FxParameterSettingAPI_v6>s=[m apiForProtocol:@protocol(FxParameterSettingAPI_v6)];return [s setCustomParameterValue:v toParameter:DYAssetsParameterID atTime:t];}
+2 -2
查看文件
@@ -12,9 +12,9 @@
- (void)dealloc{[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[super dealloc];}
- (BOOL)properties:(NSDictionary**)p error:(NSError**)e{*p=@{kFxPropertyKey_MayRemapTime:@NO,kFxPropertyKey_PixelTransformSupport:@(kFxPixelTransform_ScaleTranslate),kFxPropertyKey_VariesWhenParamsAreStatic:@NO,kFxPropertyKey_DesiredProcessingColorInfo:@(kFxImageColorInfo_RGB_LINEAR),kFxPropertyKey_NeedsFullBuffer:@YES};return YES;}
- (BOOL)addParametersWithError:(NSError**)e{return DYCreateParameters(_apiManager,e);}
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObject:DYInspectorToken.class];}
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObjects:DYInspectorToken.class,NSDictionary.class,NSString.class,NSNumber.class,nil];}
- (NSView*)createViewForParameterID:(UInt32)pid{return pid==DYInspectorParameterID?[[DYInspector alloc]initWithAPIManager:_apiManager renderer:_renderer]:[[NSView alloc]initWithFrame:NSZeroRect];}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
- (BOOL)pluginState:(NSData**)state atTime:(CMTime)t quality:(FxQuality)q error:(NSError**)e{
DYUniforms u;DYReadUniforms(_apiManager,t,&u);DYAssetState*a=DYReadAssets(_apiManager,t);double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];NSDictionary*s=@{@"schema":@1,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{}};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
}
+3
查看文件
@@ -3,6 +3,9 @@
#import <FxPlug/FxPlugSDK.h>
#import "DYUniforms.h"
@interface DYRenderer : NSObject
/// Decode and upload before committing a host parameter. The renderer retains
/// the immutable selected contents independently of the thumbnail cache.
- (NSProgress *)prepareLUTPath:(NSString *)path completion:(void (^)(NSError *error))completion;
- (BOOL)renderSource:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths error:(NSError**)error;
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths error:(NSError**)error;
- (NSData*)preview;
+100 -16
查看文件
@@ -1,4 +1,5 @@
#import "DYRenderer.h"
#import "DYModel.h"
#import "DYColorTables.h"
#import "DYLUTLibrary.h"
#import <QuartzCore/QuartzCore.h>
@@ -8,17 +9,78 @@
static BOOL fail(NSError**e,NSString*m){if(e)*e=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:m?:@"Metal 调色失败"}];return NO;}
static NSArray *inputFiles(){return @[@"",@"apple_log_to_rec709",@"arri_logc3_to_rec709",@"arri_logc4_to_rec709",@"blackmagic_film_gen5_to_rec709",@"canon_clog_bt709_to_rec709",@"canon_clog2_cinema_gamut_to_rec709",@"canon_clog3_cinema_gamut_to_rec709",@"dji_dlog_to_rec709",@"dji_dlog_m_to_rec709",@"fujifilm_flog_to_rec709",@"fujifilm_flog2_to_rec709",@"nikon_nlog_to_rec709",@"panasonic_vlog_vgamut_to_rec709",@"red_log3g10_rwg_to_rec709",@"sony_slog2_sgamut_to_rec709",@"sony_slog3_sgamut3cine_to_rec709",@"sony_hlg_bt2020_to_rec709"];}
static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){MTLTextureDescriptor*t=[MTLTextureDescriptor new];t.textureType=MTLTextureType3D;t.pixelFormat=MTLPixelFormatRGBA32Float;t.width=n;t.height=n;t.depth=n;t.storageMode=MTLStorageModeShared;t.usage=MTLTextureUsageShaderRead;id<MTLTexture>x=[d newTextureWithDescriptor:t];[t release];if(x)[x replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:values bytesPerRow:n*16 bytesPerImage:n*n*16];return [x autorelease];}
// A synthetic texture lattice uses exactly the production render path for Cube export.
@interface DYExportTile : FxImageTile { id<MTLTexture> _tex; uint64_t _registry; }
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry;
@end
@implementation DYExportTile
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry{if((self=[super init])){_tex=[texture retain];_registry=registry;}return self;}
- (void)dealloc{[_tex release];[super dealloc];}
- (id<MTLTexture>)metalTextureForDevice:(id<MTLDevice>)d{return d.registryID==_registry?_tex:nil;}
- (FxRect)tilePixelBounds{return (FxRect){0,0,(SInt32)_tex.width,(SInt32)_tex.height};}
- (FxRect)imagePixelBounds{return self.tilePixelBounds;}
- (uint64_t)deviceRegistryID{return _registry;}
- (FxImageOrigin)imageOrigin{return kFxImageOrigin_TOP_LEFT;}
@end
static BOOL managed(DYUniforms u,NSDictionary *paths){return u.cm.configured>=0&&(u.cm.configured>.5||(![paths[@"input"]length]&&u.inputProfile<.5));}
static BOOL identityCM(DYUniforms u){
DYCMSettings s=u.cm;
BOOL neutral=s.basisEnabled<.5||(s.exposure==0&&s.balanceStrength==0&&s.saturation==1&&s.contrast==0&&s.hiContrast==0&&s.shadowContrast==0&&s.white==1&&s.highlights==0&&s.midtones==0&&s.shadows==0&&s.black==0&&s.toe==.5f&&s.shoulder==.5f&&s.chromaMix==.5f);
BOOL transforms=(u.inputSectionEnabled>.5)==(s.outputEnabled>.5)&&((u.inputSectionEnabled<.5)||(s.inputTransfer==s.outputTransfer&&s.inputGamut==s.outputGamut&&s.toneMapping<.5));
return neutral&&transforms;
}
// An enabled but untouched display tool is mathematically neutral. Bypass its
// finite-domain lookup so that the default "all eyes on" does not clip CST HDR.
static void bypassNeutralTools(DYUniforms *u){
for(NSDictionary *section in DYSections()){
if(![@[@"curve",@"hsl",@"grading",@"primaries",@"levels",@"balance"]containsObject:section[@"key"]])continue;
BOOL neutral=YES;for(NSDictionary *row in section[@"rows"]){NSInteger offset=[row[@"offset"]integerValue];if(offset<0)continue;if(*(float*)((uint8_t*)u+offset)!=[row[@"default"]floatValue]){neutral=NO;break;}}
if(neutral)for(NSDictionary *row in DYDescriptors())if([row[@"pid"]isEqual:section[@"enabled"]])*(float*)((uint8_t*)u+[row[@"offset"]unsignedIntegerValue])=0;
}
}
static void bypassIdleSkin(DYUniforms *u){
if(u->curveSectionEnabled>.5||u->hslSectionEnabled>.5||u->colorGradingSectionEnabled>.5||u->primariesSectionEnabled>.5||u->levelsSectionEnabled>.5||u->blackWhiteSectionEnabled>.5||u->colorBalanceSectionEnabled>.5)return;
if(u->preLUTStrength!=0||u->postLUTStrength!=0||simd_any(u->extraPostLUTStrengths!=0))return;
const float *values=&u->exposure,*enabled=&u->exposureEnabled;
for(int i=0;i<13;i++){BOOL group=(i>=6&&i<=9)?u->colorSectionEnabled>.5:u->baseSectionEnabled>.5;if(group&&enabled[i]>.5&&values[i]!=0)return;}
u->skinProtection.x=0;
}
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts;
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
NSSet *_activeLUTPaths;
dispatch_queue_t _lutPreparationQueue;
DYColorTables *_tables;
NSObject *_previewLock;
NSData *_preview,*_lookLUTPreview;
CFTimeInterval _lastPreview;
BOOL _exporting;
}
@end
@implementation DYRenderer
- (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];}
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_preparedLUTs=[NSMutableDictionary new];_activeLUTPaths=[NSSet new];_lutPreparationQueue=dispatch_queue_create("com.dayu.color.lut-upload",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_lutPreparationQueue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_devices release];[_luts release];[_preparedLUTs release];[_activeLUTPaths release];dispatch_release(_lutPreparationQueue);[_tables release];[_preview release];[_lookLUTPreview release];[_previewLock release];[super dealloc];}
- (void)trimPreparedLUTsKeeping:(NSString *)path {
if(_preparedLUTs.count<=12)return;
for(NSString *key in _preparedLUTs.allKeys)if(![_activeLUTPaths containsObject:key]&&![key isEqualToString:path])[_preparedLUTs removeObjectForKey:key];
}
- (id<MTLTexture>)textureForTable:(DYLUTPreparedTable *)table entry:(NSDictionary *)entry error:(NSError **)error {
NSString *key=[NSString stringWithFormat:@"%llu|%@",[entry[@"device"]registryID],table.revision];id<MTLTexture>texture=_luts[key];
if(!texture){texture=texture3D(entry[@"device"],table.rgbaValues,table.dimension);if(!texture){fail(error,@"LUT 纹理分配失败");return nil;}if(_luts.count>=12)[_luts removeAllObjects];_luts[key]=texture;}return texture;
}
- (NSProgress *)prepareLUTPath:(NSString *)path completion:(void (^)(NSError *))completion {
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:2];progress.localizedDescription=@"正在载入 LUT…";path=[[path copy]autorelease];
dispatch_async(_lutPreparationQueue,^{@autoreleasepool{
NSError *error=nil;DYLUTPreparedTable *table=progress.cancelled?nil:DYLUTReadPreparedTable(path,progress,&error);progress.completedUnitCount=1;
if(table&&!progress.cancelled){@synchronized(self){
if(!_devices.count)[self device:0 error:&error];
if(!_devices.count&&!error)fail(&error,@"没有可用的 LUT 渲染设备");
BOOL ready=error==nil;for(NSDictionary *entry in _devices.allValues)if(!progress.cancelled&&![self textureForTable:table entry:entry error:&error]){ready=NO;break;}
if(ready&&!progress.cancelled){_preparedLUTs[path]=table;[self trimPreparedLUTsKeeping:path];}
}}
if(progress.cancelled)error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
progress.completedUnitCount=2;dispatch_async(dispatch_get_main_queue(),^{NSError *result=progress.cancelled?[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]:error;if(completion)completion(result);});
}});return progress;
}
- (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];}}
@@ -28,20 +90,24 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyColorManagement"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
_devices[k]=entry;[d release];[lib release];[q release];return entry;
// Preparing before the first frame may use registry 0. Reuse those pipelines
// when the host subsequently supplies that device's actual registry ID.
_devices[k]=entry;_devices[@(d.registryID)]=entry;[d release];[lib release];[q release];return entry;
}
- (id<MTLTexture>)lut:(NSString*)path entry:(NSDictionary*)e error:(NSError**)err{
if(!path.length)return e[@"identity"];
NSDictionary*attrs=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:err];if(!attrs)return nil;
NSString*key=[NSString stringWithFormat:@"%llu|%@|%.9f|%@|%@",[e[@"device"]registryID],path,[attrs[NSFileModificationDate]timeIntervalSinceReferenceDate],attrs[NSFileSize],attrs[NSFileSystemFileNumber]];id<MTLTexture>t=_luts[key];if(t)return t;
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;
DYLUTPreparedTable *table=_preparedLUTs[path];
// Restored projects load once on their render worker. Explicit selections
// arrive prepared, so neither metadata I/O nor text parsing occurs here.
if(!table){table=DYLUTReadPreparedTable(path,nil,err);if(!table)return nil;_preparedLUTs[path]=table;[self trimPreparedLUTsKeeping:path];}
return [self textureForTable:table entry:e error:err];
}
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
// Normalize only this render copy. Folded groups retain their host parameters
// Normalize only this render copy. Disabled groups retain their host parameters
// and paths, while inactive LUTs neither load files nor affect any layer.
BOOL inputEnabled=u->inputSectionEnabled>.5;
BOOL inputEnabled=u->inputSectionEnabled>.5&&!managed(*u,paths);
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"];
@@ -54,20 +120,28 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
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;
}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){@autoreleasepool{
[_activeLUTPaths release];_activeLUTPaths=[[NSSet alloc]initWithArray:paths.allValues?:@[]];
NSMutableDictionary*e=[self device:dst.deviceRegistryID error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d],output=[dst metalTextureForDevice:d];if(!input||!output)return fail(err,@"宿主图像纹理不可用");
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;
BOOL useCM=managed(u,paths);bypassNeutralTools(&u);float bwMix=fmaxf(0,fminf(1,u.cm.blackWhiteMix));if(bwMix<=0)u.blackWhiteSectionEnabled=0;
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;bypassIdleSkin(&u);
NSMutableDictionary*ps=e[@"pipelines"];NSNumber*format=@(output.pixelFormat);id<MTLRenderPipelineState>pipeline=ps[format];if(!pipeline){MTLRenderPipelineDescriptor*p=[MTLRenderPipelineDescriptor new];p.vertexFunction=[e[@"library"]newFunctionWithName:@"dyVertex"];p.fragmentFunction=[e[@"library"]newFunctionWithName:@"dyFragment"];p.colorAttachments[0].pixelFormat=output.pixelFormat;pipeline=[d newRenderPipelineStateWithDescriptor:p error:err];[p.vertexFunction release];[p.fragmentFunction release];[p release];if(!pipeline)return NO;ps[format]=pipeline;[pipeline release];}
MTLTextureDescriptor*td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;id<MTLTexture>straight=[d newTextureWithDescriptor:td];if(!straight)return fail(err,@"无法分配调色缓冲区");
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];
if(useCM&&!identityCM(u)&&u.cm.mix>0){
DayuRenderParams cm=DYCMRender(u.cm);cm.stages=(cm.stages&~1)|(u.inputSectionEnabled>.5?1:0);
if(cm.stages){id<MTLTexture>converted=[d newTextureWithDescriptor:td];if(!converted){[straight release];return fail(err,@"无法分配 CST 缓冲区");}
ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyColorManagement"]];[ce setTexture:straight atIndex:0];[ce setTexture:converted atIndex:1];[ce setBytes:&cm length:sizeof(cm) atIndex:0];[ce setBytes:&u.cm.mix length:4 atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[straight release];straight=converted;
}
}
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=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];}
if(!_exporting&&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=NO;@synchronized(_previewLock){preview=!_exporting&&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;
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
if(ok&&pb){@synchronized(_previewLock){
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
// The analysis kernel reads physical texture rows. Its result remains intact
@@ -83,7 +157,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
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){
NSMutableDictionary*e=[self device:0 error:err];if(!e)return NO;NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;id<MTLDevice>d=e[@"device"];uint32_t n=33;NSUInteger count=n*n*n;id<MTLBuffer>out=[d newBufferWithLength:count*3*4 options:MTLResourceStorageModeShared];if(!out)return fail(err,@"无法分配 LUT 输出");id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyLUTExportKernel"]];for(NSUInteger i=0;i<ts.count;i++)[ce setTexture:ts[i] atIndex:i];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:out offset:0 atIndex:1];[ce setBytes:&n length:4 atIndex:2];[ce dispatchThreads:MTLSizeMake(count,1,1) threadsPerThreadgroup:MTLSizeMake(64,1,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted){[out release];return fail(err,cb.error.localizedDescription);}
NSMutableString*s=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 仅包含逐像素颜色;纹理、清晰度和画面分析不写入 LUT。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];float*v=(float*)out.contents;for(NSUInteger i=0;i<count;i++){if(!std::isfinite(v[i*3])||!std::isfinite(v[i*3+1])||!std::isfinite(v[i*3+2])){[out release];return fail(err,@"LUT GPU 输出含无效值");}[s appendFormat:@"%.8f %.8f %.8f\n",v[i*3],v[i*3+1],v[i*3+2]];}[out release];return [s writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
NSMutableDictionary *e=[self device:0 error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];const NSUInteger n=33,count=n*n*n,width=n*n,height=n;
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
id<MTLTexture>input=[d newTextureWithDescriptor:desc],output=[d newTextureWithDescriptor:desc];if(!input||!output){[input release];[output release];return fail(err,@"无法分配 LUT 色格");}
std::vector<__fp16>values(count*4);for(NSUInteger i=0;i<count;i++){float v[3]={(float)(i%n)/(n-1),(float)((i/n)%n)/(n-1),(float)(i/(n*n))/(n-1)};for(int c=0;c<3;c++)values[i*4+c]=v[c]<=.04045f?v[c]/12.92f:powf((v[c]+.055f)/1.055f,2.4f);values[i*4+3]=1;}
[input replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:values.data() bytesPerRow:width*8];
DYExportTile *source=[[[DYExportTile alloc]initWithTexture:input registry:d.registryID]autorelease],*dest=[[[DYExportTile alloc]initWithTexture:output registry:d.registryID]autorelease];
u.textureEnabled=0;u.clarityEnabled=0;u.dehazeEnabled=0;BOOL ok=NO;_exporting=YES;
@try{ok=[self renderSource:source destination:dest uniforms:u paths:paths error:err];}@finally{_exporting=NO;}
if(ok)[output getBytes:values.data() bytesPerRow:width*8 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0];[input release];[output release];if(!ok)return NO;
NSMutableString *text=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 包含 CST 与逐像素颜色;不包含纹理、清晰度和逐画面分析。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
for(NSUInteger i=0;i<count;i++){float rgb[3];for(int c=0;c<3;c++){float v=values[i*4+c];rgb[c]=v<=.0031308f?v*12.92f:1.055f*powf(v,1/2.4f)-.055f;if(!std::isfinite(rgb[c]))return fail(err,@"LUT 输出含无效值");}[text appendFormat:@"%.8f %.8f %.8f\n",rgb[0],rgb[1],rgb[2]];}
return [text writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
}}
@end
+6 -2
查看文件
@@ -16,6 +16,8 @@ typedef vector_float4 DYFloat4;
typedef uint32_t DYUInt;
#endif
#include "DYColorManagement.h"
typedef struct DYUniforms {
float exposure; // offset 0
float contrast; // offset 4
@@ -119,12 +121,14 @@ typedef struct DYUniforms {
DYFloat4 greenCurveExtraX; // offset 896
DYFloat4 blueCurveExtra; // offset 912
DYFloat4 blueCurveExtraX; // offset 928
DYCMSettings cm; // appended; recovered color arithmetic reads only the stable prefix
} DYUniforms;
typedef struct DYVertex2D { DYFloat2 position; DYFloat2 textureCoordinate; } DYVertex2D;
typedef struct DYRenderOptions {
DYUInt outputPremultiplied;
DYUInt reserved[3];
float blackWhiteMix;
DYUInt reserved[2];
} DYRenderOptions;
#ifndef __METAL_VERSION__
@@ -133,7 +137,7 @@ typedef struct DYRenderOptions {
#else
#define DY_ABI_ASSERT _Static_assert
#endif
DY_ABI_ASSERT(sizeof(DYUniforms) == 944, "DYUniforms must match recovered GPU ABI");
DY_ABI_ASSERT(offsetof(DYUniforms, cm) == 944, "DYUniforms must match recovered GPU ABI");
DY_ABI_ASSERT(offsetof(DYUniforms, exposure) == 0, "exposure offset");
DY_ABI_ASSERT(offsetof(DYUniforms, contrast) == 4, "contrast offset");
DY_ABI_ASSERT(offsetof(DYUniforms, highlights) == 8, "highlights offset");
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>17</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>17</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
+58
查看文件
@@ -0,0 +1,58 @@
# 大鱼调色 FxPlug4:CST 与独立折叠交接
更新时间:2026-11-01,Asia/Shanghai。
当前正式 APP 为 **1.2.0(17)**,已通过公证、唯一安装及 FCP 宿主验收。实际编译源码 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`,公证 `f25ae46e-92da-4470-842e-128bdb232aa8`。后续文档、打包和 Release 记录不改变 APP 编译来源。
## 项目身份
- 当前源码:`/Volumes/备份/大鱼调色/大鱼调色`
- 远程:`https://dayu.media/git/dayu/dayu-color.git`,main
- 主 Bundle ID:`com.dayu.color`;插件:`com.dayu.color.XPC`
- 唯一正式 APP:`/Library/Plug-Ins/FxPlug/大鱼调色.app`
- 固定缓存:`/Users/mac/Library/Caches/CodexBuilds/com.dayu.color`
- Xcode 方案:`Wrapper Application`,AppKit 检查器与独立 XPC
父目录中的大鱼调色盘、CST、一级调色还原均为独立仓库;本轮仅只读参考 CST,没有改动其他产品。
## 最新用户要求与已实现行为
1. 输入相机 LUT 改为大鱼 CST 的输入转换 → 工作空间一级 → 输出转换。曲线和色域独立,工作选择由一级和输出共享。新默认输入/输出 Gamma 2.4 / Rec.709,工作 DaVinci Intermediate / Wide Gamut,自动色调映射关闭。
2. **一级调色与基础调整默认展开,其他模块折叠,所有小眼睛默认开启。** 标题只折叠/展开,小眼睛只启用/旁路;按实例保存,正常退出重开保持独立状态。全部还原恢复上述默认。
3. 全眼睛开启时保持默认画面中性:黑白混合默认 0%;未调整的显示域工具在渲染副本中旁路其有限域查表;无实际调色时不运行肤色保护,避免裁切 CST 的 HDR 输出。UI 参数和眼睛不被改写。
4. 旧 schema 1 工程和旧输入 LUT/档位保留原解释;输入组提供“旧版输入 → 改用 CST”,显式编辑 CST 参数也会迁移。旧预设可读,新预设记录有效兼容模式。
5. 原基础、HSL、色轮、曲线及五层风格 LUT 继续在 CST 输出之后工作。后台 LUT 加载、编码兼容与预览机制保留。Cube 导出复用生产路径,包含 CST/一级,不包含空间细节和逐画面统计。
## 关键实现
`DYColorManagement.h` 保存原始控制与 CST/BASIS 参数换算;`DYCSTTypes.h` 是参考布局;`tools/kernels/CSTKernel.ll`、`BasisKernel.ll` 来自固定 CST 源码节点,摘要见 `research/CSTIntegration.json`。生产构建使用仓库内文件。
`DYUniforms` 保留前 944 字节,末尾追加控制。旧参数 ID 不变,新增从 2236 开始。`DYRenderer.mm` 在直通 RGB 缓冲上运行 CST,再进入原有调色链;未加载的旧输入 LUT 不参与新 CST。`DYGrade.metal` 包含新边界,CPU/Metal 都保留透明度与预乘处理。
`DYInspectorToken` schema 2 新增 folds 字典;`toggleSection:` 只写字典,`groupEnabled:` 只写启用参数。`DYModel.mm` 定义 3 个 CST 阶段和所有新默认。输入与工作/输出的曲线、色域按稳定数学 ID 保存,不使用菜单位置代替 ID,选择参数不插值。
## 本轮验证
- `verification/CSTIntegration.json`:正式安装路径 153 项检查,含真实 AppKit 折叠动作、模型/归档、IOSurface/Metal、黑白混合、Cube 与 21 组独立 CST 像素对照。
- `verification/HostCSTAndDisclosure.json`:FCP 12.4,独立合成验收项目;默认、折叠/眼睛、曝光 0.70、Sony 输入、ACES 工作空间及正常保存重开通过。旧验收工程仅打开观察,没有改值。
- `verification/InstalledSelfTest.json`:正式安装常规自检 110 项。
- `verification/CSTRecovery.json`:远端独立恢复编译提交,151 文件和 strict/full fsck;重建 Metal 与正式库摘要一致。
- `verification/Delivery.json`:APP 签名、公证、票据、Gatekeeper、唯一登记与宿主路径。
像素对照是指定 GPU/样本的原生运算检查,宿主记录是实际界面与保存检查;没有宣称所有宿主逐像素等同。未验收 Motion、Intel 和旧系统。
## 后续交付与数据保护
本版本标签 `v1.2.0-cst-fold-20261101`;正式包位置为上级“发行包/大鱼调色-1.2.0.pkg”。最终 PKG 公证/验包与 Release 下载结果以 `verification/Package.json`、`verification/Release.json` 的本版本记录为准;生成或更新时不得引用旧版结果冒充新版本。
源码检查点:`python3 tools/checkpoint.py '<说明>' <已审查路径...>`,入口自带 Git 锁。APP:`python3 tools/deliver.py`,持有产品交付锁至宿主验收。PKG:`python3 Packaging/build_pkg.py --pkg-forge-repo /Users/mac/Documents/dayu-git/repositories/pkg-forge`。Release:`python3 Packaging/publish_release.py --tag v1.2.0-cst-fold-20261101 --notes Packaging/Release-1.2.0.md`。各脚本已管理适用锁,外层不要重复获取。
用户 LUT 在 `~/Movies/大鱼调色LUT/look LUTs`;本轮读取 N12 的 26 项测试选择,无新导入、无删除,验收实例最后全部还原。用户媒体、原有项目、收藏和偏好不进入 Git/包。`tools/create_cst_host_fixture.py` 只生成产品缓存中的合成验收资源;FCPXML 技能校验使用精确 1.12 DTD,通过无警告。
恢复完整步骤及历史节点见 `RECOVERY.md`。当前 AppKit 项目无需引入 SwiftUI 或改变产品固定身份。
## 1.2.0 正式 PKG
正式包 `../发行包/大鱼调色-1.2.0.pkg`,13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。PKG 公证 `c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted;Installer 团队 B3W25FX5H5、票据、Gatekeeper 及 20 项展开验包通过。包内 APP 与已验收正式安装一致,未重复运行安装器。
正式 Release 已发布并完整下载校验:[1.2.0 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.2.0-cst-fold-20261101),Release ID 363,附件 ID 10。关联标签完整提交 `8074444259fbacc758ec003aa91a6331b6224a85`,APP 实际编译 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`;附件 13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。草稿下载验证后才发布,发布后再次用上传器完整下载并回读核对;仅一次附件上传,未覆盖历史附件或移动标签。浏览器临时下载副本已按大小、摘要和来源核实清理,本地正式发行包保留。