比较提交
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
3e25549882 | ||
|
|
1ad9c9d33c | ||
|
|
e0c18d5a51 | ||
|
|
d1019e5b99 | ||
|
|
06968514fc | ||
|
|
de6973f555 | ||
|
|
59b058a3c8 | ||
|
|
8951725be2 | ||
|
|
6d48b653a5 | ||
|
|
93e2157826 | ||
|
|
497eef29fe | ||
|
|
593aad9ecb | ||
|
|
a2c8dfafcf | ||
|
|
95fe3019cc | ||
|
|
2bb062c82f | ||
|
|
cd54104b6a | ||
|
|
6452e793f9 | ||
|
|
d64430cd66 | ||
|
|
cc7f9c952a | ||
|
|
875add7adf | ||
|
|
ddcaa821be | ||
|
|
838037a7e0 | ||
|
|
87baa785fd | ||
|
|
57830ca744 | ||
|
|
719229ddd8 | ||
|
|
29dc4d385c | ||
|
|
cdcb30a6aa | ||
|
|
5ff62b9bb3 | ||
|
|
e3635a9831 | ||
|
|
3645119118 | ||
|
|
09321ed524 | ||
|
|
bd02c7a368 | ||
|
|
6899ccf6eb | ||
|
|
c8d92077e5 | ||
|
|
dde98c8836 | ||
|
|
2e7ab4b052 | ||
|
|
61ea1c64a0 | ||
|
|
c5441fab87 |
没有与搜索条件相匹配的文件
@@ -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`
|
||||
@@ -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()
|
||||
@@ -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())
|
||||
@@ -1,17 +1,51 @@
|
||||
# 大鱼调色
|
||||
|
||||
在原初始化 Xcode 工程中完成的原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
|
||||
原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
|
||||
|
||||
支持 17 种相机输入转换、自选输入 LUT、基础光影、白平衡、局部增强、肤色保护、五层风格 LUT、RGB 曲线、8 色与自定义 HSL、四个色轮、三原色、色阶、黑白和色彩平衡。包含自动调色、复制时自动分析、系统吸管、JSON 预设和 Cube 导出。
|
||||
|
||||
- [分析与范围](research/ANALYSIS.md)
|
||||
- [Color Finale 移植研究与算法来源](research/ALGORITHM_SOURCES.md)
|
||||
- [恢复、依赖与正式交付](RECOVERY.md)
|
||||
- [GPU 数学来源与验证](tools/kernels/README.md)
|
||||
- [正式安装记录](verification/Delivery.json)
|
||||
- [FCP 实际验收记录](verification/Host.json)
|
||||
- [LUT 后台加载的 FCP 验收](verification/HostLUTLoading.json)
|
||||
- [N12 外部 LUT 导入与应用验收](verification/HostExternalLUT.json)
|
||||
- [外部 LUT 问题定位及回归](verification/ExternalLUTActivation.json)
|
||||
- [LUT 编码兼容与回归](verification/LUTEncoding.json)
|
||||
- [混合编码 LUT 的 FCP 验收](verification/HostLUTEncoding.json)
|
||||
- [LUT 加载响应压力测试](verification/LUTResponsiveness.json)
|
||||
- [程序图标与插件缩略图验收](verification/BrandAssets.json)
|
||||
- [分组展开与启用验收](verification/HostGroupFolding.json)
|
||||
- [主题与 LUT 库的 FCP 验收](verification/HostThemeLUT.json)
|
||||
- [早期调色链的 FCP 验收](verification/Host.json)
|
||||
|
||||
交付版为 1.0.0(2),源码标签 `v1.0.0-build2-20261031`。已完成 Developer ID 签名、公证、票据、唯一正式路径安装,以及 FCP 参数保存重开和 ProRes 导出验证。界面采用大鱼布局,系统吸管和文件选择替代原版的 Viewer 吸管、缩略图浏览库;主题切换未复刻。
|
||||
当前正式版本为 1.1.5(16),交付标签 `v1.1.5-lut-encoding-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
|
||||
|
||||
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建不读取 LumiGrade 应用。Compositor 数学表的 MIT 许可随资源保留。
|
||||
程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。
|
||||
|
||||
主题与 LUT 浏览库自 1.1.0(6)提供,源码标签 `v1.1.0-theme-lut-20261031`。灰、蓝、紫、绿、橙五套主题切换后跨实例记忆。风格 LUT 左侧网格按钮打开缩略图浏览器,右侧文件夹按钮打开 `~/Movies/大鱼调色LUT/look LUTs`。可导入文件或目录,按目录与名称过滤,单击应用,缩略图大小与目录会保存。
|
||||
|
||||
缩略图使用当前素材先经过输入 LUT 的画面;没有源帧时显示本产品生成的色卡。显示方向与宿主图像原点一致,自动分析保留自己的原始数据。浏览器优先采用 FxPlug 宿主窗口,不能使用时回退为锚定弹出面板。品牌保留大鱼,吸管仍为系统取色器。
|
||||
|
||||
算法背景资料补充了同系列工程的 **Color Finale 移植研究**,涵盖调色工具、LUT 预览、图层与蒙版工作流;归档记录、适用范围及当前实现的来源区分见 [算法说明](research/ALGORITHM_SOURCES.md)。Camera Raw 查表数据与组合行为采用 Compositor 的 MIT 许可实现,许可证随资源保留。
|
||||
|
||||
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建使用仓库中的源码和资源。
|
||||
|
||||
选择自有 LUT 后,预设记录其绝对路径;跨机器搬移时同时保留 LUT 文件并重新选择。LUT 导出只保存逐像素颜色,不包含纹理、清晰度或逐画面分析。
|
||||
|
||||
`tools/create_lut_host_fixture.py` 可重建独立 FCP 验收 XML 和四个合成测试 LUT;它只写产品缓存,不会向用户库自动导入。LUT 核心检查见 `verification/LUTLibrary.json`,主题与浏览库实现说明见 `research/ThemeLUT-analysis.md`。
|
||||
|
||||
`tools/create_group_fold_host_fixture.py` 可创建独立的合成验收时间线,用于检查新实例仅基础调节默认启用、分组展开/折叠与数值保留。风格 LUT 总组停用会旁路全部五层;停用的输入或风格 LUT 不加载其文件。
|
||||
|
||||
LUT 文件夹扫描、逐项校验/复制和选择文件后的解析均在后台执行;导入期间可继续搜索、滚动和选择,刷新按钮临时变为“取消”。失败或取消会移除本次新复制的文件并保留既有库。目录与缩略图只为可见范围创建控件,预览逐项出现;快速切换时仅应用最后一次选择。24个65级合成LUT与3,025项库的响应测试见 [LUTResponsiveness.json](verification/LUTResponsiveness.json)。
|
||||
|
||||
1.1.4 修复外部 Cube 的旧编码标题导致整批导入失败:标题、注释兼容旧编码,尺寸和数值仍严格校验,报错包含文件名。点击缩略图时先在后台解析并准备 GPU 纹理,宿主接受后才确认选择;已选表独立保留,不受缩略图缓存淘汰影响。用户提供的 N12 目录 26 个 LUT 已全部导入、生成缩略图并完成 Metal 渲染,FCP 中两份“青橙色”、64 级 LUT、快速切换和保存重开通过。用户 LUT 不进入源码或安装包。
|
||||
|
||||
1.1.5 增加整份 Cube 的 UTF-16/UTF-32 大小端、有无 BOM 识别,在后台转换工作副本,保留导入文件的原始字节。支持常见换行及 Unicode 空白,标题、注释继续兼容 ASCII 指令下的旧编码。16 份 UTF-8/16/32 与 GB18030、Big5、Shift JIS、Windows-1252、MacRoman、ISO-8859-1 样本已在 FCP 中全部导入、预览和逐项应用,无 BOM UTF-32 保存重开通过。损坏的编码、非法数字仍会报错,不使用有损转码猜测颜色值。
|
||||
|
||||
正式 PKG 打包使用 PKG 工坊源码中的 `pkg-forge` 技能。运行 `python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录`,默认输出到上级“发行包”目录;先使用 `--prepare-only` 可只检查清单。打包使用已验证的正式 APP,并从相同 APP 资源中核对、整理 FCP 模板与缩略图,不重签或重建调色 APP。生成包将要求正常退出四种 FCP/Motion 宿主并在登录用户会话验证注册;签名公证和真实展开验包由该技能的原打包器与校验器完成。已有同名版本包不会覆盖。
|
||||
|
||||
当前正式安装包:[大鱼调色-1.1.5.pkg](../发行包/大鱼调色-1.1.5.pkg),包含1.1.5(16)正式APP及相同版本的FCP模板/预览图;本机Apple Silicon,最低macOS14.6。签名、公证与20项真实展开验包记录见 [Package.json](verification/Package.json)。本轮没有重复执行系统安装;包内APP与已验收的正式安装逐字节一致。
|
||||
|
||||
正式包已保存到[1.1.5 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.1.5-lut-encoding-20261101),完整下载核对大小与 SHA-256 通过。运行 `python3 Packaging/publish_release.py --tag v1.1.5-lut-encoding-20261101 --notes Packaging/Release-1.1.5.md` 可复用 PKG 技能核对同一附件;不会重复上传。安装包不进入普通 Git,发布记录见 [Release.json](verification/Release.json)。
|
||||
+119
-7
@@ -4,26 +4,138 @@
|
||||
初始化基线:10987dd6bcc6986ea321eff75b37d4e8b48e966d;后续节点见git log。
|
||||
产品主ID:com.dayu.color,XPC:com.dayu.color.XPC;唯一正式位置:/Library/Plug-Ins/FxPlug/大鱼调色.app。
|
||||
|
||||
当前交付标签:v1.0.0-build2-20261031。APP 1.0.0(2)编译源码:ce7e0a3371693c84c97267af12ca0f078b0db981;标签另含本次宿主验收记录、缩略图和恢复说明。Apple公证ID:8bfe6f2b-9611-4fac-b014-333b7916f881,Accepted。已安装版的票据、Gatekeeper与70项自检通过;FCP 12.4实际编辑曝光、保存退出重开、参数XML回导及四秒ProRes422导出通过。验收范围见verification/Host.json。
|
||||
当前交付标签: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。
|
||||
|
||||
已从私有远端独立克隆编译节点,85个文件逐字节匹配,strict/full fsck通过。恢复副本重建的Metal库与正式安装版SHA256相同:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。该步骤不依赖原厂APP。
|
||||
外部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范围显示和保存。
|
||||
|
||||
FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红45与肤色65%跨折叠及保存重开保留、全部还原后只展开基础调节的验收见 verification/HostGroupFolding.json。仅在独立合成验收项目中改值,最后恢复默认;用户媒体和其他产品未作改动。
|
||||
|
||||
图标交付标签 v1.1.1-brand-icons-20261031 保留,编译源码 bd02c7a368348fdea6357889a09fba298872487a,原公证ID 352e85a7-f603-4e93-8c1a-43f6c107bea1。正式程序关于窗口的新图标、FCP12.4效果浏览器缩略图与安装资源校验见 verification/BrandAssets.json;本次沿用相同品牌资源。
|
||||
|
||||
主题/LUT交付标签 v1.1.0-theme-lut-20261031 保留,编译源码 c8d92077e5a017fa4b1a7ee7b24be2386b29294d,宿主验收见 verification/HostThemeLUT.json。
|
||||
|
||||
历史交付 v1.0.0-build2-20261031 保留;其编译源码 ce7e0a3371693c84c97267af12ca0f078b0db981,原生调色链及初次 FCP 导出验收见 verification/Host.json。
|
||||
|
||||
本次编译节点的远端独立克隆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送公证前及正式安装后均通过92项原生自检,正式结果见 verification/InstalledSelfTest.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建只使用仓库内的源码与资源。
|
||||
|
||||
## 恢复和构建
|
||||
|
||||
1. 登录大鱼站获取Git令牌,通过系统凭据管理登录;克隆上述私有仓库。
|
||||
1. 登录大鱼站获取Git令牌,通过系统凭据管理登录;克隆上述仓库。
|
||||
2. git switch --detach <完整提交SHA> 恢复任一已保存节点;发布节点见版本标签与verification/Delivery.json。
|
||||
3. 依赖:Xcode27.1 / macOS SDK27,Metal Toolchain,FxPlug SDK4.3.5(/Library/Developer/SDKs/FxPlug.sdk),FxPlug及PluginManager运行框架(/Library/Developer/Frameworks)。最低系统14.6,当前验证Apple M4。
|
||||
4. Xcode打开大鱼调色.xcodeproj,Wrapper Application方案,Release。构建脚本由版本化LLVM文本重建Metal库;不读取参考LumiGrade或网络源。17相机输入、Camera Raw数学表均已入Git,无LFS、无子模块。
|
||||
4. Xcode打开大鱼调色.xcodeproj,Wrapper Application方案,Release。构建脚本由版本化LLVM文本重建Metal库;不读取外部应用或网络源。17相机输入、Camera Raw数学表均已入Git,无LFS、无子模块。
|
||||
5. 更改模型后运行 python3 tools/build_template.py --refresh-model --overwrite,更新FCP原生壳的注册参数与归档。
|
||||
6. 正式交付运行 python3 tools/deliver.py;脚本持有产品锁,Release、逐层Developer ID签名、Apple Accepted、staple/validate、Gatekeeper、原子替换、清理副本、PluginKit唯一登记。等待宿主验收后输入complete才记通过。
|
||||
6. 正式交付运行 python3 tools/deliver.py;脚本持有产品锁,Release、逐层Developer ID签名、自检通过后送Apple Accepted、staple/validate、Gatekeeper、原子替换、正式版自检、清理副本、PluginKit唯一登记。等待宿主验收后输入complete才记通过。
|
||||
7. 固定缓存:/Users/mac/Library/Caches/CodexBuilds/com.dayu.color。正式XPC支持 --self-test 输出原生模型/IOSurface/颜色/LUT集成JSON。请从正式安装路径运行。
|
||||
|
||||
## 证书和数据
|
||||
|
||||
Developer ID团队B3W25FX5H5,公证profile codex-dayu-notary-B3W25FX5H5。证书私钥及钥匙串需独立恢复,不在Git。
|
||||
|
||||
资产预设保存调色数字和用户所选LUT绝对路径;用户自选LUT本身、用户媒体和宿主资料库不属于代码备份。跨机器恢复预设时需同时搬移用户LUT并重新选择。源代码不读取原厂授权、设备凭据或联网服务。
|
||||
资产预设保存调色数字和用户所选LUT绝对路径;用户自选LUT本身、用户媒体和宿主资料库不属于代码备份。跨机器恢复预设时需同时搬移用户LUT并重新选择。运行与构建使用本工程的参数、资源及用户选择的文件。
|
||||
|
||||
原程序版本、SHA、方法证据与局限见research/。GPU/数学/原生集成与实际宿主验证分别记录,单项算法通过不代表所有宿主/GPU/素材完全等同。
|
||||
Color Finale 移植研究、当前算法来源及历史记录入口见 research/ALGORITHM_SOURCES.md。GPU/数学/原生集成与实际宿主验证分别记录,单项算法通过不代表所有宿主/GPU/素材完全等同。
|
||||
|
||||
此工作区在exFAT外置卷,Git元数据位于本机APFS /Users/mac/Library/Application Support/DayuGitMetadata/dayu-color.git,工作区.git为指向文件。远端克隆在新机器会生成正常独立.git;无需复制此本机指向。
|
||||
|
||||
## 主题与 LUT 库
|
||||
|
||||
五套主题通过独立 com.dayu.color.preferences 域保存,并同步其他实例。浏览器目录和缩略图大小使用本产品的独立偏好键。用户库为 ~/Movies/大鱼调色LUT/look LUTs;导入会保留源文件,重名时创建带数字后缀的新副本。用户 LUT、收藏和偏好属于本机用户资料,源码仓库不包含这些内容;换机时单独搬移并按需要重选预设中的绝对路径。
|
||||
|
||||
缩略图捕获输入转换后的源帧,显示层按 FxPlug 的原点单独转换为顶部优先。原分析帧字节序、调色核心和 Metal 数学库未变。当前宿主验收采用原生锚定 Popover;支持 FxRemoteWindow 的宿主也可使用其窗口接口。
|
||||
|
||||
运行 python3 tools/create_lut_host_fixture.py 可重建合成验收图、独立 XML 与四个测试 LUT,输出只在产品缓存。随后从浏览器导入测试目录并在 FCP 验证,不自动写入用户库。
|
||||
|
||||
## 品牌资源
|
||||
|
||||
程序图标与插件缩略图由内置图像生成工具分别生成,采用同一光谱鱼标志。原始 PNG 和完整提示词见 design/ASSETS.json。程序 ICNS 含16至1024像素的标准图标表示;FCP预览为640×360与240×135。恢复后运行 python3 tools/build_brand_assets.py 可使用macOS自带sips/iconutil重建三项资源,不需要联网生成,使用仓库内已保存的资源。大图原始PNG、ICNS及两种FCP缩略图均保存在普通Git对象中,无LFS或子模块。
|
||||
|
||||
## 仓库说明整理(2026-10-31)
|
||||
|
||||
当前主分支增加了来自同系列“大鱼调色盘”工程的 Color Finale 移植研究快照,来源提交4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca与逐文件摘要见 research/color-finale/SOURCES.json。当前算法链、相关研究和MIT查表来源分别在 research/ALGORITHM_SOURCES.md 说明。整理前完整资料保存在提交29dc4d385c1459cd330d8a9083ec9756787afef3,现有历史和发行标签不改写。
|
||||
|
||||
该次整理仅涉及说明、源码注释和验证工具的输入方式,当时正式程序为1.1.2(11);实际功能代码、GPU内核、模型、资源、签名与已公证安装未变。GPU对照工具改为显式传入第三个参数指定对照库,使用方法见 tools/kernels/README.md。
|
||||
|
||||
## LUT 后台加载优化(2026-11-01)
|
||||
|
||||
扫描、逐项校验、复制、LUT 解析和缩略图生成均在后台;主线程只读短锁快照并更新界面。导入可取消,失败或取消回滚本次文件并保留原有库;预览只为可见项创建视图。独立选择队列使当前选中的 LUT 不必等待缩略图,连续选择以最后一次为准。菜单退出后再打开文件选择框,避免在远程检查器中嵌套菜单与文件框。
|
||||
|
||||
verification/LUTResponsiveness.json 记录同一组 24 个 65³ 合成 LUT(197,731,344 字节)导入:旧实现主线程最大空档 10,018.8 毫秒,新实现 6.251 毫秒,耗时从 10.019 秒降为 7.399 秒。3,025 条目/3,000 文件夹仅创建 45 个缩略图视图和 15 个文件夹视图,56 项后台检查及 92 项库检查通过。此数据来自本机 Apple M4、APFS 与真实主运行循环心跳,网络卷和旧机器尚未测量。
|
||||
|
||||
正式 14 版在 FCP12.4 独立合成项目中完成 8.2 MB 单文件载入、24 文件目录导入、192 文件校验期间搜索和取消、渐进缩略图、滚动与快速选择,正常退出重开保留最后一次 LUT。单文件旧问题与各版本的实际验收分别见 verification/HostLUTLoading.json。13 版等待状态按用户明确授权强制退出一次;14 版后续正常退出与重开均通过。
|
||||
|
||||
验收后仅核对合成文件 SHA256 再清理本次 72 个导入副本,原有 4 个 LUT 保留。浏览器恢复原目录、空搜索与160大小,验收项目全部还原后仅基础调节展开、LUT 路径清空。正式安装、启动与宿主检查通过后清理旧12/13候选备份;已检查的构建、工程和标准安装目录只有正式外层 APP。用户资料库与源媒体未用于测试。
|
||||
|
||||
远端编译源码 6452e793f974234b5ffffdfad5dc3ddeee64d53c 独立恢复129个已提交文件逐字节一致、strict/full fsck、从恢复源码重建92项库检查通过,见 verification/AsyncLUTRecovery.json。Release 送公证前与正式安装后82项 Metal/IOSurface原生集成检查通过。无需读取外部目标程序,模型 ABI、模板及 Metal 数学库未变。
|
||||
|
||||
运行 python3 tools/create_async_lut_host_fixture.py --cancel-pack 可在产品缓存重建24个65³导入样本和192个硬链接取消样本,不自动写入用户库;运行 tools/verify_lut_responsiveness.mm 构建出的独立检查器可重测响应。完整 VoiceOver、旧系统、Intel、网络卷未作验收;SwiftUI 专用审查对现有 AppKit 实现不适用。
|
||||
|
||||
## 外部 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。
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"generator": "OpenAI built-in image_gen",
|
||||
"created": "2026-10-31",
|
||||
"brand": "大鱼调色",
|
||||
"assets": [
|
||||
{
|
||||
"path": "design/dayu-color-app-icon-v1.png",
|
||||
"width": 1254,
|
||||
"height": 1254,
|
||||
"alpha": true,
|
||||
"prompt": "Use case: logo-brand.\nAsset type: final macOS application icon for the Chinese color-grading FxPlug product 大鱼调色 (Dayu Color).\nCreate ONE polished square 1024×1024 raster app icon, NOT a presentation board or mockup. A single bold, abstract fish silhouette formed from a smooth continuous spectral ribbon flowing cyan → blue → violet → magenta → warm orange, curving around a dark circular negative space like a color-grading wheel. The fish should read immediately at small Dock sizes, with a clear tail and elegantly tapered head, no eye details. Center it on a deep midnight-navy rounded-square app tile, restrained dimensional glass/enamel shading, clean premium native macOS software aesthetic. The tile occupies about 88% of the canvas, equal safety margins, subtle soft shadow, no extra rings or small controls. Outside the rounded square is genuinely transparent alpha. Crisp silhouette, balanced negative space, vivid color and controlled highlights. No lettering, no words, no badges, no watermark, no borrowed brand marks. This is the standalone icon asset itself, straight-on, not an icon pictured on a device or in a scene."
|
||||
},
|
||||
{
|
||||
"path": "design/dayu-color-plugin-thumbnail-v1.png",
|
||||
"width": 1672,
|
||||
"height": 941,
|
||||
"alpha": false,
|
||||
"reference": "design/dayu-color-app-icon-v1.png",
|
||||
"prompt": "Use case: logo-brand.\nAsset type: final widescreen 16:9 plugin thumbnail for the Final Cut Pro effects browser, for 大鱼调色.\nInput Image 1 is a brand reference, not an edit target. Preserve its recognizable spectral fish silhouette and cyan-blue-violet-magenta-orange enamel material, but generate a NEW horizontal composition. One 16:9 image, preferably 1536×864 or 1920×1080, not a presentation board.\nFull-bleed midnight navy background, very restrained soft chromatic illumination. The same circular spectral fish emblem sits prominently on the left half, WITHOUT a rounded-square app tile around it. On the right half, large perfectly legible white Chinese typography reading exactly \"大鱼调色\" in a modern bold sans-serif, horizontal one-line title. A little breathing room between emblem and title. The emblem and title have equal visual authority; both remain readable when reduced to a small effect thumbnail. Keep all essential content inside an 8% safety margin. Premium native creative-software identity, crisp luminous ribbon edges, controlled highlights and generous negative space. No other words or letters, no version numbers, no fake interface, no devices, no watermark, no extra logos, no additional fish. The final asset fills the entire rectangular canvas, with no outer transparent margin."
|
||||
}
|
||||
],
|
||||
"exportCommand": "python3 tools/build_brand_assets.py",
|
||||
"note": "原始生成图保留;通过 macOS sips 和 iconutil 导出图标与 FCP 的两种预览尺寸。"
|
||||
}
|
||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.5 MiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 1.4 MiB |
@@ -0,0 +1,31 @@
|
||||
# Color Finale 移植研究与算法来源
|
||||
|
||||
整理日期:2026-10-31。依据用户指出的上级工程,已核对 `../大鱼调色盘` 中的 Color Finale 移植研究,并将四份已提交的资料逐字节归档到 [color-finale/](color-finale/)。来源工程为 `dayu/dayu-colorplate`,提交 `4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca`;逐文件摘要见 [SOURCES.json](color-finale/SOURCES.json)。
|
||||
|
||||
## Color Finale 移植背景
|
||||
|
||||
该系列研究涵盖 Color Finale 2.16.2(625)的调色工具、RGB/HSL 曲线、色轮、相机矩阵、LUT 库和当前帧批量预览,以及图层、蒙版、跟踪、色彩管理与胶片处理。资料分别记录了静态观察、独立算法设计、迁移目标和验收边界:
|
||||
|
||||
- [研究记录](color-finale/colorfinale.md):工具结构、LUT 预览与缓存、跟踪流程及证据编号。
|
||||
- [颜色工具设计](color-finale/colorfinale-color-tools-design.md):曲线、Log 色轮、相机矩阵和其他颜色算子的独立实现设计。
|
||||
- [迁移矩阵](color-finale/colorfinale-2.0-matrix.md):功能目标、已实现项和开放项。
|
||||
- [静态证据索引](color-finale/evidence-index/colorfinale-index.json):发行包身份与证据编号。
|
||||
|
||||
这些资料属于“大鱼调色盘”的移植工程。当前“大鱼调色”的 944 字节状态、CPU 查表与 GPU 链路仍按本仓库实现保存;已核对的颜色工具设计使用 1032 字节状态,自动调色的参数、阈值和计算式也不同。现有资料支持将 Color Finale 迁移研究列为相关算法与工作流背景,尚未建立当前这些实现逐段移植自该工程的代码继承关系。
|
||||
|
||||
## 当前实现的来源记录
|
||||
|
||||
| 部分 | 已核实依据 |
|
||||
| --- | --- |
|
||||
| Color Finale 相关研究 | 上述同系列工程的研究、设计和迁移矩阵;其功能范围和验收状态以各原文为准 |
|
||||
| Camera Raw 查表与组合 | Compositor,MIT;提交 `92f5225afe7e921dbfa4c563462980e45db345fc`;数据 SHA-256 `e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190` |
|
||||
| 当前 GPU 调色核 | 从已发行着色器指令图还原的 LLVM AIR 文本;输入摘要、模块范围和改动见 [PROVENANCE.json](../tools/kernels/PROVENANCE.json) |
|
||||
| 当前自动调色与 CPU 数学 | 本工程的数值实现与既有对照检查;详见 [ColorTableNotes.md](ColorTableNotes.md)、`DYAutoGrade.mm` 和 `verification/` |
|
||||
| 17 种输入 LUT | 随工程版本化的压缩采样表;原始采样文件和压缩资源摘要见 `大鱼调色/Plugin/Resources/InputLUTs/manifest.json` |
|
||||
| 界面、主题与浏览库 | 当前 AppKit 实现和大鱼命名空间;说明见 [ThemeLUT-analysis.md](ThemeLUT-analysis.md),正式宿主结果见 `verification/` |
|
||||
|
||||
## 记录保留
|
||||
|
||||
本次清理当前主分支中的旧参考程序介绍和原始分析大文件,保留算法输入摘要、必要的第三方归属、许可证和验证记录。完整整理前资料仍可从提交 `29dc4d385c1459cd330d8a9083ec9756787afef3` 恢复;已有提交和发行标签保持原样。原始分析记录中的地址、函数身份及采样对象不改名为其他产品。
|
||||
|
||||
本次修改为仓库说明、研究资料与验证工具入口整理,正式安装程序仍为已验收的 1.1.2(11)。
|
||||
+9
-18
@@ -1,26 +1,17 @@
|
||||
# LumiGrade → 大鱼调色
|
||||
# 大鱼调色:实现与范围
|
||||
|
||||
参考:/Library/Plug-Ins/FxPlug/LumiGrade.app,3.0 build56,主ID com.quliang.LumiGrade。
|
||||
XPC universal SHA256 33c273d6a58314f5068959fcda911d741884a1937077b41a969a990dd40d0b6d;用于静态分析的arm64切片SHA c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97。
|
||||
本工程提供原生 Wrapper / XPC / FxPlug 4 结构,使用 944 字节、102 字段的 CPU/GPU 状态,Metal 调色、全帧白场统计和 LUT 导出。
|
||||
|
||||
## 已确认与实现
|
||||
支持 17 种相机输入转换、自选 3D Cube、白平衡、光影、局部增强、鲜艳度、饱和度、独立肤色保护;最多五层风格 LUT;主/R/G/B 单调 Hermite 曲线;8 色与自定义 HSL;四区色轮;三原色、RGB/单通道色阶、黑白混色和三向色彩平衡。自动调色、自动白平衡、复制时分析、系统吸管、预设和 33³ Cube 导出均接入原生参数。
|
||||
|
||||
- 原生Wrapper/XPC/FxPlug4,944字节102字段GPU状态,Metal滤镜、全帧白场统计、LUT导出。
|
||||
- 输入17种相机曲线、可自选3D Cube;白平衡、曝光/对比度/高光/阴影/白/黑、纹理/清晰度/去雾、鲜艳/饱和、独立肤色保护。
|
||||
- 最多五层顺序风格LUT;主/R/G/B可加删点的单调Hermite曲线;8色+自定义RGB选区HSL;阴影/中间调/高光/全局色轮及明亮度、混合、平衡;三原色、RGB/单通道色阶、黑白混色、三向色彩平衡。
|
||||
- 自动调色与自动白平衡、复制时自动分析、系统白平衡/自定义色吸管、预设保存加载、33³Cube导出。
|
||||
- 所有调色浮点均由FxPlug原生参数保存,控件按宿主action读写;实例通知以manager对象隔离。资产独立secure coding,渲染状态使用带版本不可变plist。
|
||||
Color Finale 移植研究资料、相关工程和各算法来源分别见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。Camera Raw 数据采用 Compositor 的 MIT 许可数据与组合实现;GPU 指令图输入、模块范围和改动见 `tools/kernels/PROVENANCE.json`。正式构建使用仓库内源码和必要资源。
|
||||
|
||||
## 证据
|
||||
浮点参数由 FxPlug 保存,控件按宿主 action 读写,实例通知按 manager 隔离。LUT 路径状态使用 secure coding,渲染状态采用带版本的不可变 plist。所有分组展开即启用、折叠即停用并隐藏参数;新实例与全部还原仅展开基础调节。旧实例按保存的启用状态显示。
|
||||
|
||||
LumiGrade-analysis.json包含REA/Ghidra返回的20条证据及分析限制;关键CPU行为与地址见ColorTableNotes.md,GPU来源见tools/kernels/PROVENANCE.json及README。CameraRaw数据与MIT的Compositor源码逐字节一致,原许可保留在正式资源中。17张输入LUT由指定参考应用的一次性提取生成,原始和压缩数据SHA见Resources/InputLUTs/manifest.json。构建不依赖原厂应用。
|
||||
界面使用大鱼品牌。基础组汇集白平衡、光影、鲜艳度和饱和度;HSL、色阶和色彩平衡按通道切换。主题偏好和用户 LUT 使用独立大鱼目录与偏好域。浏览器支持菜单、文件选择、缩略图、导入、目录与名称过滤及尺寸记忆;实现说明见 [ThemeLUT-analysis.md](ThemeLUT-analysis.md)。
|
||||
|
||||
35项GPU检查与5,342,405个分量对照通过;CPU查表、83项自动分析边界、70项完整模型/IOSurface/Metal/LUT集成分别验证。正式安装及宿主结果见verification。
|
||||
GPU 数学、CPU 查表、自动分析和真实 Metal/IOSurface 集成分别验证;当前正式版本通过 82 项原生集成检查。FCP 分组展开、数值保留及保存重开见 `verification/HostGroupFolding.json`,主题/LUT 与历史导出结果见 `verification/HostThemeLUT.json`。
|
||||
|
||||
## 适配与边界
|
||||
自动分析使用 320×180 样本,在输入转换后统计;GPU 半精度、缩略采样与图像重采样存在数值边界。局部增强和全帧统计需要完整源帧,超大图受 GPU 纹理与内存限制。Cube 保存逐像素颜色,空间纹理、清晰度和逐画面分析无法完整写入 3D LUT。
|
||||
|
||||
重建的是调色行为与可编辑控件,界面使用大鱼标识;白平衡与颜色归同组、肤色保护独立旁路以对应实际数学依赖。未接原厂许可、售后或联网服务。吸管使用系统取色器,未复用原厂Viewer OSC。用户LUT采用文件选择,未照搬原厂缩略图浏览库和主题切换。
|
||||
|
||||
自动分析同为320×180 RGB8,转换前后量化并先应用输入LUT;Metal双线性缩图与原CoreGraphics缩图可能在边缘产生微小差异。原GPU使用half纹理和输出;32位宿主也遵循这一原精度边界。局部增强/全帧统计需要完整源帧,超大图受GPU纹理/内存限制。Cube仅保存逐像素颜色,无法承载邻域纹理、清晰度或逐画面分析。
|
||||
|
||||
有限状态对照不等于对所有参数/GPU/素材的穷尽证明。自定义LUT绝对路径随预设保存,跨机器需搬移用户LUT并重新选择;用户媒体与预设不在源码备份范围内。
|
||||
有限状态对照不构成所有参数、GPU、素材或宿主的穷尽验证。自定义 LUT 绝对路径随预设保存,跨机器需搬移文件并重新选择;用户媒体和个人预设需独立备份。
|
||||
+18
-81
@@ -1,97 +1,34 @@
|
||||
# 颜色查表与接入核验
|
||||
|
||||
本记录区分发布二进制静态证据、公开源码和本项目的实现验证。没有将静态调用关系当作实际宿主运行结果。
|
||||
|
||||
## 参考身份
|
||||
|
||||
- LumiGrade 3.0,构建 56。
|
||||
- 参考服务:`/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/MacOS/LumiGrade XPC Service`。
|
||||
- 原始 universal Mach-O SHA-256:`33c273d6a58314f5068959fcda911d741884a1937077b41a969a990dd40d0b6d`。
|
||||
- 只读抽取 arm64 SHA-256:`c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97`。
|
||||
- 本记录的地址属于该 arm64 slice,image base 为 `0x100000000`。使用现有 `otool -arch arm64 -tvV` 输出核对具体 ARM 指令,不需要重新打开 REA 会话。
|
||||
- REA/Ghidra 提供的相关函数伪代码属于还原结果,不是原始 Swift 源码。关键结论同时以 ARM 调用或资源字节校验确认。
|
||||
本记录说明当前 CPU/GPU 数学契约和已有核验范围。Color Finale 相关迁移研究、第三方来源及历史记录入口见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。
|
||||
|
||||
## MIT 查表数据
|
||||
|
||||
参考包的 `THIRD-PARTY-NOTICES.txt` 声明,Camera Raw 查表数据与组合行为来自 [Compositor](https://github.com/robbietilton/Compositor),MIT,Copyright 2026 Wonder Assembly LLC。
|
||||
Camera Raw 查表数据和组合行为来自 [Compositor](https://github.com/robbietilton/Compositor),MIT,Copyright 2026 Wonder Assembly LLC。已核对提交 `92f5225afe7e921dbfa4c563462980e45db345fc` 的 `Compositor/Resources/CameraRawTables.bin`;项目资源 `DayuColorTables.bin` 的 SHA-256 为 `e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190`。完整许可位于正式资源 `THIRD-PARTY-NOTICES.txt`。
|
||||
|
||||
核对公开源提交 `92f5225afe7e921dbfa4c563462980e45db345fc` 的 `Compositor/Resources/CameraRawTables.bin`,与参考包文件逐字节相同。项目中的 `DayuColorTables.bin` 保存这份必要数学数据,保留 MIT 许可;没有复制参考应用的图标、品牌、授权代码或原始应用程序。
|
||||
- `CRT3` 头;维度17、763张表、差值量化步长3。10字节头后为LZMA/xz,解压长度11,245,857字节。
|
||||
- 每张表按通道累计有符号Int8差值,还原为 `round(axis * 255 / 16) + signedDelta * 3`,钳制0–255。
|
||||
- 源表红轴最慢、蓝轴最快,RGB8;采用17³三线性插值。组合输出33³ RGBA32Float,Metal纹理红轴最快,alpha固定1。
|
||||
- 白平衡:温度和色调各−100…100、间隔25,四张相邻表双线性混合。
|
||||
- 八色HSL:依次组合明度、饱和度、色相;表起点 `285 + (kind * 8 + color) * 5`;各项−100…100、间隔50。
|
||||
- 分级:先阴影、中间调、高光、全局明度,再组合全局、中间调、高光、阴影色轮;保留公开实现的插值及平衡系数。
|
||||
|
||||
数据 SHA-256:`e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190`。
|
||||
## 字段与旁路
|
||||
|
||||
格式经公开 `Compositor/Document/CameraRawTables.swift` 和参考 `loadSourceTables` / `sample` 核对:
|
||||
CPU/Metal共用944字节 `DYUniforms`,字段偏移由静态断言检查。白平衡、HSL和颜色分级由CPU生成有效或中性3D纹理,停用时不能复用非中性的缓存。基础分组同时控制光影与颜色子组;纹理、清晰度和去雾遵循基础组旁路,肤色保护独立启停。
|
||||
|
||||
- `CRT3` 头;维度 17,763 张表,差值量化步长 3。
|
||||
- 10 字节头之后为 LZMA/xz;解压长度 11,245,857 字节。
|
||||
- 每张表逐通道保存 running delta,累计值按有符号 Int8 解释;还原到 `round(axis * 255 / 16) + signedDelta * 3` 并钳制 0–255。原 ARM `0x10009bf28` 的 `frinta` 确认这里要四舍五入,不能直接截断。
|
||||
- 源表顺序为红轴最慢、蓝轴最快;每格 RGB8。读取采用 17³ 三线性插值。
|
||||
- 组合结果为 33³ RGBA32Float,Metal 纹理红轴最快,alpha 固定 1。
|
||||
- 白平衡:温度、色调各 -100…100、间隔 25,四张相邻表双线性混合。
|
||||
- 8 色 HSL:明亮度、饱和度、色相依次组合;表起点 `285 + (kind * 8 + color) * 5`,每项 -100…100、间隔 50。逐项运算保留 `low + (high - low) * fraction`。
|
||||
- 分级:先阴影、中间调、高光、全局的明度,再全局、中间调、高光、阴影色轮;色轮在相邻色相、饱和度、混合档位间混合。分级 balance 对阴影、高光饱和度份额的系数按公开源及二进制一致恢复。
|
||||
肤色保护开关阈值0.5,保护程度为0–100,内部乘0.01并钳制;中心色相除以360后参与HSL圆周距离。默认保护程度60、中心色相28。黑白六色默认系数依次为 `40,60,40,60,20,80`,着色色相与饱和度默认0。
|
||||
|
||||
## 已确认的字段与旁路依赖
|
||||
三原色矩阵为列向量,GPU使用 `r*M0 + g*M1 + b*M2`。色相沿灰轴旋转,幅度 `hue / 100 * 0.5235987305641174`;饱和度系数 `sat / 100 * 0.55`,矩阵保持D65白点并限制极端偏移。
|
||||
|
||||
944 字节 CPU/GPU ABI 的每字段偏移有 `DYUniforms.h` 的静态断言。
|
||||
## 自动调色与导出
|
||||
|
||||
### 白平衡
|
||||
当前自动调色在320×180、RGB8数值域中计算分位数、饱和度和中性样本权重;先做输入转换和强度混合,再进行统计。阈值与计算式见 `DYAutoGrade.mm`。该实现与同系列 Color Finale 迁移工程的 `Core/DYAuto.hpp` 使用不同参数和公式,来源分别保存。
|
||||
|
||||
原 fragment 无条件读取已生成的白平衡 3D 纹理,因此组旁路必须在 CPU 构造纹理时落实。
|
||||
LUT导出输出 `cubeSize³ * 3` 个float,红轴最快。输入为输入LUT、五层风格LUT、HSL、白平衡及分级纹理;参数、RGB输出和cubeSize分别绑定buffer0/1/2。空间纹理、清晰度及逐画面统计无法完整表达为3D LUT。
|
||||
|
||||
原渲染器 `0x100077054…0x10007708c`:
|
||||
## 验证范围
|
||||
|
||||
1. 从 uniforms `+104/+108` 读取 temperatureEnabled/tintEnabled,分别决定是否使用对应数值。
|
||||
2. 从 uniforms `+140` 读取 colorSectionEnabled,作为 `whiteBalanceTexture(... enabled:)` 的 enabled 参数。
|
||||
3. `0x10007708c` 调用白平衡纹理生成方法;未启用时采用中性 LUT。
|
||||
`tools/verify_color_tables.mm` 覆盖数据摘要、损坏拒绝、独立double三线性对照、白平衡、纹理轴序、24项HSL端点、四色轮、色相环绕、明度端点、三原色控制和D65保持。真实Metal纹理接口与非中性缓存后的组旁路由原生集成检查覆盖。
|
||||
|
||||
`DYColorTables` 已按此处理。为使自定义检查器的组旁路与实际字段含义一致,本项目把白平衡与鲜艳度、饱和度放在“白平衡与颜色”组;这是明确的界面分组适配。
|
||||
|
||||
HSL 与颜色分级分别以 `hslSectionEnabled`、`colorGradingSectionEnabled` 生成有效或中性纹理,旁路不能复用此前非中性的缓存结果。
|
||||
|
||||
纹理、清晰度、去朦胧由原 fragment 的 `baseSectionEnabled` 分支控制,属于基础组。肤色保护 shader 只检查 `skinProtection.x`,应保持独立开关,不能暗示它自动跟随颜色组。
|
||||
|
||||
### 肤色保护
|
||||
|
||||
原 `applySkinProtection`:
|
||||
|
||||
- `.x`:开关,阈值 0.5。
|
||||
- `.y`:保护程度,乘 0.01 后钳制到 0–1。
|
||||
- `.z`:中心色相,除以 360 后与像素 HSL 色相做圆周距离计算。
|
||||
|
||||
原 `addParameters` 对参数 `0x468` 设置默认 60、范围 0–100;对 `0x469` 设置默认 28、范围 0–60。两项不是色相范围和饱和度范围。对应静态伪代码在 `addParameters.c:504…510`,数值十六进制为 `0x404e000000000000`、`0x403c000000000000`。
|
||||
|
||||
### 黑白混色
|
||||
|
||||
原 `addParameters` 从 `DAT_1000dc7e8` 读取黑白参数默认值。该 slice 对应文件偏移的 8 个 double 是:
|
||||
|
||||
`40, 60, 40, 60, 20, 80, 0, 0`
|
||||
|
||||
依次对应红、黄、绿、青、蓝、洋红,以及着色色相、着色饱和度。原 `applyBlackWhite` 直接读取这些六色系数参与灰度计算;六项设成 100 会改变启用黑白后的明度。
|
||||
|
||||
### 分级与三原色
|
||||
|
||||
- `colorGradingHueSatA.xy` 为中间调 H/S,`.zw` 为阴影 H/S;`HueSatB.xy` 为高光 H/S。
|
||||
- `colorGradingLuma` 为中间调、阴影、高光明度;`colorGradingGlobal` 为全局 H/S/L。原包装方法 `0x100083320…0x1000833e8` 的向量重排确认此顺序。
|
||||
- 三原色矩阵是列向量。GPU 将 `r*M0 + g*M1 + b*M2` 相加,无需转置。
|
||||
- 色相沿灰轴旋转,幅度为 `hue / 100 * 0.5235987305641174`;饱和度沿对应原色相对中性灰的轴变化,系数 `sat / 100 * 0.55`。矩阵保持 D65 白点,并沿用原版过大矩阵偏移的限制。
|
||||
|
||||
## 自动调色预览确实应用输入 LUT
|
||||
|
||||
这是已确认的静态调用与数学流程,不再只是从函数名称作推测:
|
||||
|
||||
1. `capturePreviewFrameIfNeeded` 位于 `0x1000833ec`。它缓存原始预览图,并保存输入 LUT、路径、强度;LUT 路径或强度改变时更新版本、清除已转换缓存。此方法本身没有直接转换图像。
|
||||
2. `currentPreviewFrame` 位于 `0x10007f4f4`。缓存不命中且有输入 LUT 时,`0x10007f5ec` 明确调用 `imageByApplyingInputLUT(to:lut:strength:)`;`s0` 在前一条指令从保存的强度装入。
|
||||
3. 自动调色闭包 `0x100075e00` 在 `0x100075e44` 调用 `currentPreviewFrame`,在 `0x100075e54` 把该结果传给 `autoGradeResult`。
|
||||
4. `imageByApplyingInputLUT` 位于 `0x100090a34`。`0x100090a68/6c` 指定 320×180 的 RGB8 缓冲;`0x100090aec…0x100090b0c` 将 RGB8 除以 255;`0x100090b40` 调用 `CubeLUT.sample`;`0x100090b48…0x100090b50` 计算 `original + (sample - original) * strength`;`0x100090b78` 起钳制、四舍五入回 RGB8。
|
||||
|
||||
因此,本项目的自动调色输入应在标准线性→sRGB 编码之后应用输入 LUT 与强度,再进入统计。使用未转换的 Log 原图统计会偏离参考行为。GPU 缩略采样与原版 NSImage/CoreGraphics 320×180 重采样仍可能有量化或重采样差异,不声明逐字节相同。
|
||||
|
||||
## LUT 导出与验证边界
|
||||
|
||||
原 `lutExportKernel` 输出 `cubeSize³ * 3` 个 float,红轴最快;texture0–8 为输入 LUT、五层风格 LUT、HSL、白平衡、分级,buffer0 uniforms、buffer1 RGB 输出、buffer2 cubeSize。当前接入按此布局,不能按 float4 分配后误读。
|
||||
|
||||
导出核接收、输出的是 LUT 的编码域 RGB,空间纹理和清晰度操作不写入 3D LUT。画面相关统计与导出核固定处理也不等同于任意素材的逐帧渲染。
|
||||
|
||||
`tools/verify_color_tables.mm` 已通过严格 `-Wall -Wextra -Werror` 编译。验证覆盖数据 SHA、损坏拒绝、独立 double 三线性对照、四表白平衡、纹理轴顺序、24 项 HSL 端点、4 色轮、色相环绕、4 明度端点、6 个三原色控制及 D65 保持。带资源的 CLI 测试 bundle 另验证真实 Metal 纹理接口与非中性缓存后的 WB/HSL/分级旁路;没有运行未公证 GUI 应用。
|
||||
|
||||
宿主的半透明表示、图像原点、色彩空间和最终视觉结果仍须用正式安装的已公证版本验收;数学和静态结构验证不能替代宿主验证。
|
||||
GPU数学、CPU表、自动分析、宿主交互和实际导出各自保留报告。有限数值检查与静态结构检查不能替代所有宿主、素材、图像原点、alpha和色彩空间的实际验收。
|
||||
@@ -1 +0,0 @@
|
||||
{"binding":{"analysis_profile":{"digest":"3fc72c9b4b78498fb992b938f8f3389dc670244a293c1d40abf5e1d10162ed3b","parameters":{"analyzer_preset":"ghidra-default","annotation_policy":"atomic-function-entry-metadata-v1","architecture":"arm64","available_architectures":["arm64"],"call_relationship_coverage":"function-body-call-coverage-v5","compiler_spec_id":"auto-default","decompiler_jump_loads":true,"function_body_evidence":"complete-inclusive-ranges-v1","function_boundary_observations":"ghidra-function-boundary-limitations-v4","function_dossier_coverage":"observed-facets-and-call-relationships-v1","function_references":"complete-body-and-entry-reference-manager-v2","import_mode":"ephemeral-source-immutable","instruction_flow_evidence":"decoded-return-pcode-v1","instruction_references":"exact-address-incoming-without-synthetic-entry-v2","jump_table_evidence":"typed-case-default-blocks-v1","language_id":"auto-from-header","load_image_observations":"source-mappings-entry-context-v2","loader":"auto-from-header","location_resolution":"explicit-address-exact-entry-symbol-first-v3","no_return_repair":"returning-imports-decoded-return-v2","procedure_file_offset_resolution":"address-first-unique-target-source-mapping-v2","process_launch":"inspected-jvm-launch-support-v1","string_inventory_evidence":"defined-data-coverage-v1","target_format":"mach-o","target_kind":"executable"},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"entries":[],"evidence_bundle":{"artifacts":[{"architecture":"arm64","digest":{"sha256":"c04e911e449e888eb0d8c10f7bcf2b6bc2c4153b9ba86c1952ddf210c96c5e97"},"format":"mach-o"}],"captures":[],"environments":[],"providers":[{"id":"ghidra","name":"Ghidra","version":"12.1.4"}],"records":[{"analysis_profile":{"digest":"3fc72c9b4b78498fb992b938f8f3389dc670244a293c1d40abf5e1d10162ed3b","parameters":{"analyzer_preset":"ghidra-default","annotation_policy":"atomic-function-entry-metadata-v1","architecture":"arm64","available_architectures":["arm64"],"call_relationship_coverage":"function-body-call-coverage-v5","compiler_spec_id":"auto-default","decompiler_jump_loads":true,"function_body_evidence":"complete-inclusive-ranges-v1","function_boundary_observations":"ghidra-function-boundary-limitations-v4","function_dossier_coverage":"observed-facets-and-call-relationships-v1","function_references":"complete-body-and-entry-reference-manager-v2","import_mode":"ephemeral-source-immutable","instruction_flow_evidence":"decoded-return-pcode-v1","instruction_references":"exact-address-incoming-without-synthetic-entry-v2","jump_table_evidence":"typed-case-default-blocks-v1","language_id":"auto-from-header","load_image_observations":"source-mappings-entry-context-v2","loader":"auto-from-header","location_resolution":"explicit-address-exact-entry-symbol-first-v3","no_return_repair":"returning-imports-decoded-return-v2","procedure_file_offset_resolution":"address-first-unique-target-source-mapping-v2","process_launch":"inspected-jvm-launch-support-v1","string_inventory_evidence":"defined-data-coverage-v1","target_format":"mach-o","target_kind":"executable"},"provider":{"id":"ghidra","name":"Ghidra","version":"12.1.4"}},"authority":"shipped-artifact","confidence":"observed","environment":null,"evidence_id":"ev_03d96959bfe24004d31380076ff89441e1486ddbdd69a2c3d636b86b8ac02976","evidence_links":[],"limitations":["The session serves operations only after Ghidra reports default auto-analysis complete; incomplete analysis does not expose partial results.","The imported Program and temporary project are ephemeral and deleted on close. Annotation operations edit session database metadata; original executable bytes are never written.","Cancelling an active Ghidra request terminates its ephemeral database and discards session annotations. The selected target remains open; the next provider query imports the original artifact again.","Default-space addresses use lowercase 0x-prefixed hexadecimal; other address spaces use <percent-encoded-space>:0x<hex>.","Pseudocode is Ghidra decompiler output, not original source and not text-equivalent to Hopper output.","External functions and functions without an analyzable body return null; other decompiler failures remain explicit.","macOS sessions require a matching executable Ghidra native decompiler; REA checks for it but does not build native components or change Gatekeeper quarantine state."],"locations":[],"normalized_result":"\n/* adjustPrimaryHue #1 (_: Swift.SIMD3<Swift.Float>, hueShift: Swift.Float) ->\n Swift.SIMD3<Swift.Float> in static\n LumiGrade_XPC_Service.LumiGradePlugIn.computePrimariesMatrix(redHue: Swift.Float, redSat:\n Swift.Float, greenHue: Swift.Float, greenSat: Swift.Float, blueHue: Swift.Float, blueSat:\n Swift.Float) -> __C.simd_float3x3 */\n\nSIMD3<float> _adjustPrimaryHue_1(SIMD3<float> param_1,float hueShift)\n\n{\n undefined8 uVar1;\n undefined1 auVar2 [16];\n undefined1 auVar3 [16Line truncated
|
||||
@@ -0,0 +1,25 @@
|
||||
# 主题与 LUT 浏览库实现说明
|
||||
|
||||
五套主题、浏览器和预览由本工程的 `DYTheme`、`DYLUTLibrary`、`DYLUTBrowser`、`DYInspector` 与 `DYRenderer` 实现。相关 Color Finale 移植研究与来源边界见 [ALGORITHM_SOURCES.md](ALGORITHM_SOURCES.md)。本文件说明当前产品行为,历史静态观察完整保留在整理前提交中。
|
||||
|
||||
## 主题
|
||||
|
||||
主题顺序为灰、蓝、紫、绿、橙,默认蓝。每套包含 17 个颜色槽,数值快照见 `ThemePalette.json`。色块 RGB 分别为 `(0.30,0.33,0.38)`、`(0.28,0.72,1)`、`(0.58,0.52,1)`、`(0.30,0.86,0.52)`、`(1,0.61,0.28)`。
|
||||
|
||||
整体底色使用槽1,分组底色使用槽3,标题胶囊渐变使用槽6/7,滑条轨道使用槽8/9,活动段使用槽10/11;标题、参数标签和版本分别使用槽14/15/16。灰色工具强调色为 `(0.72,0.77,0.84)`,蓝色为 `(0.22,0.67,1)`。主题保存到独立大鱼偏好域并通知其他实例;主题不属于可动画调色参数。
|
||||
|
||||
## 用户库与浏览器
|
||||
|
||||
用户 LUT 库位于 `~/Movies/大鱼调色LUT/look LUTs`。支持递归发现 `.cube`、目录过滤、名称搜索、收藏、导入和 Finder 打开目录。顶层文件可归入未分类;隐藏项跳过,路径去重。导入保留源文件,重名时产生带数字后缀的副本。
|
||||
|
||||
浏览器采用 760×560 点布局,缩略图比例为16:9,大小默认96、范围70–255;目录和尺寸偏好独立保存。优先使用宿主窗口接口,必要时使用锚定弹出面板。单击应用所选 LUT,目录切换和预览生成不应意外写入调色参数。
|
||||
|
||||
## 真实帧与方向
|
||||
|
||||
缩略图取当前素材经过输入转换后的源帧,再应用候选 LUT;解析和采样使用产品的 LUT 实现。没有源帧时显示合成色卡。分析帧保留物理行序,浏览显示根据 FxPlug 图像原点转换,避免上下翻转。
|
||||
|
||||
图库任务采用缓存、懒加载和失效处理。用户 LUT、收藏与偏好是本机用户资料,换机时需独立搬移;源码中仅包含合成验收 LUT 的生成脚本。
|
||||
|
||||
## 验收
|
||||
|
||||
五主题、导入、目录与名称过滤、尺寸记忆、缩略图方向、单击应用、保存重开和 ProRes 导出见 `verification/HostThemeLUT.json`。当前分组展开与启用规则见 `verification/HostGroupFolding.json`。历史报告对应其记录的版本,不能将其范围自动扩展为所有素材、宿主与系统均已验证。
|
||||
@@ -0,0 +1,598 @@
|
||||
{
|
||||
"sourceAddress": "0x10005a028",
|
||||
"evidenceID": "ev_0a2bea4354863fd7685a919ca6dae83ba5cf582f12cd0592edb24f0816eee35a",
|
||||
"paletteSlotOrder": "Native Palette struct slots 0..16; semantic names require usage confirmation. Slots 0..15 RGBA; slot16 RGB with alpha 1.",
|
||||
"themeIndexOrder": [
|
||||
"gray",
|
||||
"blue",
|
||||
"purple",
|
||||
"green",
|
||||
"orange"
|
||||
],
|
||||
"swatchRGB": [
|
||||
[
|
||||
0.3,
|
||||
0.33,
|
||||
0.38
|
||||
],
|
||||
[
|
||||
0.28,
|
||||
0.72,
|
||||
1
|
||||
],
|
||||
[
|
||||
0.58,
|
||||
0.52,
|
||||
1
|
||||
],
|
||||
[
|
||||
0.3,
|
||||
0.86,
|
||||
0.52
|
||||
],
|
||||
[
|
||||
1,
|
||||
0.61,
|
||||
0.28
|
||||
]
|
||||
],
|
||||
"defaultIndex": 1,
|
||||
"palettes": {
|
||||
"orange": [
|
||||
[
|
||||
0.23,
|
||||
0.15,
|
||||
0.08,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.16,
|
||||
0.1,
|
||||
0.05,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.35,
|
||||
0.22,
|
||||
0.11,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.26,
|
||||
0.16,
|
||||
0.08,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.45,
|
||||
0.28,
|
||||
0.14,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.36,
|
||||
0.22,
|
||||
0.1,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.72,
|
||||
0.44,
|
||||
0.18,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.56,
|
||||
0.32,
|
||||
0.12,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.29,
|
||||
0.18,
|
||||
0.09,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.2,
|
||||
0.12,
|
||||
0.06,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.98,
|
||||
0.67,
|
||||
0.31,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.86,
|
||||
0.47,
|
||||
0.17,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0,
|
||||
0.86,
|
||||
0.57,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.93,
|
||||
0.59,
|
||||
0.22,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0,
|
||||
0.96,
|
||||
0.9,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.97,
|
||||
0.9,
|
||||
0.82,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.8,
|
||||
0.7,
|
||||
0.58
|
||||
]
|
||||
],
|
||||
"purple": [
|
||||
[
|
||||
0.11,
|
||||
0.09,
|
||||
0.17,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.07,
|
||||
0.06,
|
||||
0.12,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.18,
|
||||
0.14,
|
||||
0.28,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.13,
|
||||
0.1,
|
||||
0.21,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.27,
|
||||
0.22,
|
||||
0.42,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.2,
|
||||
0.16,
|
||||
0.31,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.43,
|
||||
0.34,
|
||||
0.68,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.31,
|
||||
0.23,
|
||||
0.52,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.22,
|
||||
0.18,
|
||||
0.31,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.15,
|
||||
0.12,
|
||||
0.23,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.78,
|
||||
0.71,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.5,
|
||||
0.42,
|
||||
0.93,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.95,
|
||||
0.9,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.63,
|
||||
0.5,
|
||||
0.95,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.98,
|
||||
0.95,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.9,
|
||||
0.86,
|
||||
0.97,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.7,
|
||||
0.66,
|
||||
0.82
|
||||
]
|
||||
],
|
||||
"gray": [
|
||||
[
|
||||
0.11,
|
||||
0.12,
|
||||
0.14,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.075,
|
||||
0.08,
|
||||
0.095,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.17,
|
||||
0.18,
|
||||
0.21,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.12,
|
||||
0.13,
|
||||
0.15,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.27,
|
||||
0.29,
|
||||
0.33,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.2,
|
||||
0.22,
|
||||
0.25,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.36,
|
||||
0.39,
|
||||
0.44,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.25,
|
||||
0.28,
|
||||
0.32,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.21,
|
||||
0.23,
|
||||
0.26,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.15,
|
||||
0.17,
|
||||
0.2,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.78,
|
||||
0.83,
|
||||
0.9,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.55,
|
||||
0.61,
|
||||
0.7,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.78,
|
||||
0.82,
|
||||
0.88,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.96,
|
||||
0.97,
|
||||
0.98,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.86,
|
||||
0.89,
|
||||
0.92,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.67,
|
||||
0.72,
|
||||
0.77
|
||||
]
|
||||
],
|
||||
"green": [
|
||||
[
|
||||
0.08,
|
||||
0.17,
|
||||
0.1,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.05,
|
||||
0.12,
|
||||
0.07,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.12,
|
||||
0.27,
|
||||
0.15,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.09,
|
||||
0.2,
|
||||
0.11,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.16,
|
||||
0.35,
|
||||
0.2,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.12,
|
||||
0.27,
|
||||
0.15,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.21,
|
||||
0.57,
|
||||
0.31,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.14,
|
||||
0.4,
|
||||
0.21,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.14,
|
||||
0.27,
|
||||
0.16,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.1,
|
||||
0.2,
|
||||
0.11,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.54,
|
||||
0.96,
|
||||
0.64,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.22,
|
||||
0.75,
|
||||
0.35,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.91,
|
||||
1.0,
|
||||
0.93,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.28,
|
||||
0.8,
|
||||
0.42,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.95,
|
||||
1.0,
|
||||
0.96,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.86,
|
||||
0.96,
|
||||
0.88,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.66,
|
||||
0.8,
|
||||
0.68
|
||||
]
|
||||
],
|
||||
"blue": [
|
||||
[
|
||||
0.031,
|
||||
0.086,
|
||||
0.148,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.025,
|
||||
0.075,
|
||||
0.13,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.07,
|
||||
0.155,
|
||||
0.235,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.045,
|
||||
0.12,
|
||||
0.19,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.115,
|
||||
0.22,
|
||||
0.33,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.07,
|
||||
0.15,
|
||||
0.24,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.15,
|
||||
0.33,
|
||||
0.5,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.08,
|
||||
0.24,
|
||||
0.36,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.23,
|
||||
0.32,
|
||||
0.41,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.18,
|
||||
0.26,
|
||||
0.35,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.38,
|
||||
0.76,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.23,
|
||||
0.64,
|
||||
0.97,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.96,
|
||||
0.98,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.62,
|
||||
0.7,
|
||||
0.76,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.88,
|
||||
0.96,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.82,
|
||||
0.9,
|
||||
0.96,
|
||||
1.0
|
||||
],
|
||||
[
|
||||
0.58,
|
||||
0.7,
|
||||
0.78
|
||||
]
|
||||
]
|
||||
},
|
||||
"chromeAccentRGB": [
|
||||
[
|
||||
0.72,
|
||||
0.77,
|
||||
0.84
|
||||
],
|
||||
[
|
||||
0.22,
|
||||
0.67,
|
||||
1
|
||||
],
|
||||
[
|
||||
0.58,
|
||||
0.52,
|
||||
1
|
||||
],
|
||||
[
|
||||
0.3,
|
||||
0.86,
|
||||
0.52
|
||||
],
|
||||
[
|
||||
1,
|
||||
0.61,
|
||||
0.28
|
||||
]
|
||||
],
|
||||
"confirmedSlotUsages": {
|
||||
"panelBackground": 1,
|
||||
"sectionBackground": 3,
|
||||
"sectionTitleGradientStart": 6,
|
||||
"sectionTitleGradientEnd": 7,
|
||||
"sliderTrackGradientStart": 8,
|
||||
"sliderTrackGradientEnd": 9,
|
||||
"sliderActiveGradientStart": 10,
|
||||
"sliderActiveGradientEnd": 11,
|
||||
"logoAndSectionTitleText": 14,
|
||||
"rowLabelText": 15,
|
||||
"versionText": 16
|
||||
},
|
||||
"historicalEvidenceCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# Color Finale 移植资料快照
|
||||
|
||||
四份资料来自同系列“大鱼调色盘”工程,原文逐字节保留。提交与SHA-256见 [SOURCES.json](SOURCES.json),本仓库的适用范围见 [算法来源说明](../ALGORITHM_SOURCES.md)。
|
||||
|
||||
| 资料 | 本地快照 | 原工程固定版本 |
|
||||
| --- | --- | --- |
|
||||
| 研究记录 | [colorfinale.md](colorfinale.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale.md) |
|
||||
| 颜色工具设计 | [colorfinale-color-tools-design.md](colorfinale-color-tools-design.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-color-tools-design.md) |
|
||||
| 迁移矩阵 | [colorfinale-2.0-matrix.md](colorfinale-2.0-matrix.md) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-2.0-matrix.md) |
|
||||
| 证据索引 | [colorfinale-index.json](evidence-index/colorfinale-index.json) | [查看原文](https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/evidence-index/colorfinale-index.json) |
|
||||
|
||||
快照中的其他相对链接仍指向原工程的文件;使用上表固定版本可继续浏览其完整上下文。设计目标、独立实现与发行验收以各原文的范围说明为准。
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"project": "大鱼调色盘",
|
||||
"remote": "https://dayu.media/git/dayu/dayu-colorplate.git",
|
||||
"commit": "4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca",
|
||||
"verifiedRecordsMatchCommittedFiles": true,
|
||||
"records": [
|
||||
{
|
||||
"sourcePath": "research/colorfinale.md",
|
||||
"path": "research/color-finale/colorfinale.md",
|
||||
"sha256": "f669841b2f0402543ad87522cf23fd17e3eced5ef481f5b0e1b0a489d6e2d70d",
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale.md"
|
||||
},
|
||||
{
|
||||
"sourcePath": "research/colorfinale-color-tools-design.md",
|
||||
"path": "research/color-finale/colorfinale-color-tools-design.md",
|
||||
"sha256": "0b5f75d50cf4427dd74c68e5612d15b8cf7748b63a99bf7101c2945663460d07",
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-color-tools-design.md"
|
||||
},
|
||||
{
|
||||
"sourcePath": "research/colorfinale-2.0-matrix.md",
|
||||
"path": "research/color-finale/colorfinale-2.0-matrix.md",
|
||||
"sha256": "721d50ac0391b515747820632612d56aa34084251e3a347bf16911bdb3f3e7b0",
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/colorfinale-2.0-matrix.md"
|
||||
},
|
||||
{
|
||||
"sourcePath": "research/evidence-index/colorfinale-index.json",
|
||||
"path": "research/color-finale/evidence-index/colorfinale-index.json",
|
||||
"sha256": "fecb1a8e2fa23d664acbc878cc91c9cf7c0dc646212197b0dd68e34a5d2b244a",
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-colorplate/src/commit/4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca/research/evidence-index/colorfinale-index.json"
|
||||
}
|
||||
],
|
||||
"scope": "Related-product Color Finale migration research. These documents distinguish observations, independent implementations, planned work and unverified scope; copying the research does not establish a direct code port in this repository.",
|
||||
"relativeLinkPolicy": "Archived documents retain their original bytes. Relative links inside them resolve against their sourceURL in the original repository."
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
# 大鱼调色盘 2.0:Color Finale 迁移对照
|
||||
|
||||
研究日期:2026-10-26(Asia/Shanghai)。这是功能目标和证据矩阵,**不是已实现清单或发行验收记录**。当前正式安装为大鱼调色盘 2.0.0(56),已完成图层/空间工具、外部输入、CMS、首轮五组胶片处理和Classic24色卡匹配;矩形真实拖动及窗口一次前置已有用户确认。具体范围见verification/release-2.0.0-build56.json。完整迁移尚未完成。
|
||||
|
||||
色卡56进度(2026-10-29):Classic24(2014年11月后)6×4参考、射影四角、三模式、CMS前置线性校正、schema19冻结状态和原生控件已接入并正式验收;实际FCP匹配RMS 0.03309→0.00398,一次Undo/Redo与冷重开2557字节一致。Video/Passport Video仍开放,不能视作本矩阵原厂色卡条目已全部完成。自动指针拖动没有确认参数变化,真实四角手势仍未确认;合同和证据见research/chart-matching-contract.md、verification/release-2.0.0-build56.json。
|
||||
|
||||
CMS开发进度:根schema16/CMS作者v2、实际源/目的ICC、CPU/Metal整帧、浮点主预览/图库/取色/导出约束已接通;根CMS控件1257项和实际HDR媒体导入37950项通过。正式34完成独立PQ/HLG取帧与FCP CMS撤销/重做;35修复说明换行并通过FCP冷重开,完整调色文件141187字节一致。见 `verification/cms-controls-media-development.json` 与正式35报告。HDR显示器EDR亮度及4K实时未认证。
|
||||
|
||||
运动/散景已在正式36验收:方向、光环宽度/强度/柔和度、RGB/HSL、各自参数保留、撤销/重做和冷重开逐字节一致。算法为独立实现,见research/motion-bokeh-contract.md;最大半径4K HSL散景约2.06秒,不承诺实时。
|
||||
|
||||
胶片55进度(2026-10-29):减色/晕光/辉光/暗角/颗粒的独立算法、根级控件、schema18归档、CPU/Metal、精确有理帧保持、Undo及FCP冷重开已验证;完整处理文件重开前后7108字节一致。没有原厂同名八种印片外观,色卡和其他工作流仍开放,详见 [胶片合同](film-processing-contract.md)。
|
||||
|
||||
## 对照版本与证据边界
|
||||
|
||||
本机 `/Applications/ColorFinale.app` 为 **2.16.2(625)**,主插件可执行文件 SHA-256:
|
||||
|
||||
`49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f`
|
||||
|
||||
本次重新计算的摘要与 [已有静态研究](colorfinale.md) 及 [证据索引](evidence-index/colorfinale-index.json) 一致。REA 当前没有打开的目标,无需重复全量分析。已有证据解释的是该发行包的结构,不等于实际 FCP 运行验收。
|
||||
|
||||
本次读取了 Color Finale 官方文档和官方界面截图。文档可能包含比本机版更新的功能;涉及 Tone/Chroma、Texture EQ 频段和 FCP 12 的行为需另做版本核验。未改动用户的 FCP 工程,未将专有资源、图标、LUT 或反编译源码复制到项目。
|
||||
|
||||
## 本轮优先迁移
|
||||
|
||||
| 能力 | 已证实的原产品语义 | 大鱼实现与验收目标 |
|
||||
| --- | --- | --- |
|
||||
| 真正的工具图层 | 顶部工具入口创建工具层;同类工具可多次添加;下旧上新,底至顶处理;可排序、启停、重命名、复制、删除 | 有序、稳定身份、独立参数;选择层不改变输出;禁用层是恒等;复制生成新身份;保存和撤销不串层 |
|
||||
| 图层工具区 | 左侧层列表,主区域显示选中工具,底部为混合量、混合模式、蒙版和删除 | 所有精细工具集中在独立图层编辑器;明确“添加图层”和“编辑当前层”,避免切页意外创建层 |
|
||||
| 图层蒙版 | 蒙版属于层;同层可有多个形状,以 Add/Subtract/Intersect 组合 | 层全部处理受蒙版约束,包括曲线、LUT、六色向量和蜘蛛盘;无蒙版时全画面生效 |
|
||||
| 区域跟踪 | 每个节点保存轨迹;按宿主 effectTime 持久化归一化变换;前后跟踪与关键帧操作 | 冻结实例、层 ID、蒙版 ID、形状修订及参考帧;删除或改形后拒绝旧回调;倒序和随机时间输出一致 |
|
||||
| 六色向量 | RGBCMY 独立 H/S/L;新版另有肤色向量及可调 Skin Target | 六区独立,灰阶不染色,色相首尾连续;肤色扩展单列;不能把全图 HSL 当作六色选择调整 |
|
||||
| 检查器快捷 HSL | 此位置是大鱼的产品要求,不是对原版行为的断言 | 保留原基础调色和蜘蛛盘;快捷 HSL 直接可用,作用范围及与图层关系明确 |
|
||||
| 持久 LUT 目录 | Preferences 登记目录并递归发现 `.cube`;图库支持当前片段 Live Preview | 同产品进程共享配置;目录可添加、移除、重定位;空目录、离线、权限和坏文件有不同提示 |
|
||||
| 当前帧批量预览 | 缓存源帧,应用项目调整,再应用候选 LUT,最终作颜色/方向转换 | 每批冻结同一真实宿主帧及图层快照;旧任务失效;预览不写工程;点击才提交 |
|
||||
| LUT 插入 | 图库双击或 Insert 新建 LUT 层;可叠加不同 LUT | 默认明确新建层;替换现有 LUT 是独立操作,候选预览不能叠加被替换的原 LUT |
|
||||
|
||||
来源:[图层编辑器](https://docs.colorfinale.com/docs/layers/)、[六色向量](https://docs.colorfinale.com/docs/layers/sixvectors/)、[蒙版](https://docs.colorfinale.com/docs/masks/masks/)、[区域跟踪](https://docs.colorfinale.com/docs/masks/tracking/)、[LUT 工作流](https://courses.colorfinale.com/blog/post/cf-lut-management-08-23)、[偏好设置](https://docs.colorfinale.com/docs/preferences/)。
|
||||
|
||||
## 完整功能差距登记
|
||||
|
||||
以下能力不能因为本轮五个重点完成就自动标记为“全部迁移”。没有相应实现和验证时保持未验收。
|
||||
|
||||
| 领域 | 官方能力 | 依据 |
|
||||
| --- | --- | --- |
|
||||
| 色轮 | Lift/Gamma/Gain、RGB 滑块、各区亮度与饱和度、分界范围、CDL 导入导出 | [Color Wheels](https://docs.colorfinale.com/docs/layers/wheels/) |
|
||||
| RGB/Luma 曲线 | Master+RGB、Luma+RGB、Luma Preserving、取色建点、S 曲线捷径 | [Curves](https://docs.colorfinale.com/docs/layers/curves/) |
|
||||
| 六色与肤色 | 六个标准色区及第七肤色向量,H/S/L、肤色中心、Extended 饱和度模式 | [Six Vectors](https://docs.colorfinale.com/docs/layers/sixvectors/) |
|
||||
| HSL 曲线 | 按色相改变色相/饱和度/亮度,按亮度或饱和度调饱和度;单曲线旁路及不同插值形式 | [HSL Curves](https://docs.colorfinale.com/docs/layers/hsl/) |
|
||||
| 滤镜 | Box/Gaussian/Disc 模糊和锐化,RGB/HSL 分通道 | [Filter](https://docs.colorfinale.com/docs/layers/filter-layer/) |
|
||||
| 通道路由与混合 | RGB 路由、直接常量/颜色、通道混合、系数归一化、通道反相 | [Shuffle](https://docs.colorfinale.com/docs/layers/shuffle-layer/) |
|
||||
| 相机矩阵 | RGB 基色独立色相与饱和度,保持整体白平衡 | [Camera Matrix](https://docs.colorfinale.com/docs/layers/camera-matrix/) |
|
||||
| Log 色轮 | 阴影/中间调/高光/Offset;范围分界;位于 Log 转换前处理 | [Log Wheels](https://docs.colorfinale.com/docs/layers/log-wheels/) |
|
||||
| 色调映射 | 最多 11 点 HSLA 渐变、不同亮度来源、取色和预设 | [Color Atlas](https://docs.colorfinale.com/docs/layers/color-atlas/) |
|
||||
| 纹理均衡 | 当前文档列六个尺度频段,基于多尺度模糊分解 | [Texture EQ](https://docs.colorfinale.com/docs/layers/texture-eq/) |
|
||||
| LUT 强度扩展 | 最新文档包含 Tone 和 Chroma 独立强度;本机版对应性尚未逐项核验 | [LUTs](https://docs.colorfinale.com/docs/layers/luts/) |
|
||||
| 图层组 | 多选建组、折叠、混合组与独立层;组默认 Pass-through | [Groups](https://docs.colorfinale.com/docs/layers/groups/)、[Blend Modes](https://docs.colorfinale.com/docs/layers/blend/) |
|
||||
| 形状种类 | 矩形、椭圆、折线、B 样条、Bezier、渐变边缘、图像蒙版 | [Masks](https://docs.colorfinale.com/docs/masks/masks/) |
|
||||
| 内外调色 | 组的父蒙版供多层共用,单层可反转父蒙版 | [Parent Masks](https://docs.colorfinale.com/docs/masks/parent/) |
|
||||
| 形状组 | 形状多选编组、整体移动、组级 Add/Subtract/Intersect | [Grouping Masks](https://docs.colorfinale.com/docs/masks/grouping-mask-shapes/) |
|
||||
| HSL 蒙版 | 选色范围/衰减、取色增减、输入输出阶、模糊、源阶段选择 | [HSL Mask](https://docs.colorfinale.com/docs/masks/hsl-mask/) |
|
||||
| 人物与外部蒙版 | 人物分割、FCP 外部蒙版接入,四种蒙版显示方式 | [Person Mask](https://docs.colorfinale.com/docs/masks/person-mask/)、[External Masks](https://docs.colorfinale.com/docs/masks/external-mask/)、[Display Modes](https://docs.colorfinale.com/docs/masks/fourmaskdisplaymode/) |
|
||||
| 蒙版发布与抠出 | 从图层或组发布蒙版,在外层检查器选择 Mask Output / Cutout,将结果用于时间线合成 | [官方2.9工作流](https://colorfinale.com/blog/post/cf-2-9-masks-09-24);准确组合与alpha语义待本机发行代码核对 |
|
||||
| 色彩管理 | Assume Video/Log、ACES、相机输入变换、输出变换、工作空间 | [Color Management](https://docs.colorfinale.com/docs/inspector/cms/) |
|
||||
| 色卡匹配 | ColorChecker Video/Passport,四角定位、自动匹配和色卡预设 | [Color Chart](https://docs.colorfinale.com/docs/inspector/chart/) |
|
||||
| 胶片模拟 | 减色、晕光、辉光、暗角、颗粒;部分 Film Look 位于 ACES 链路 | [Film Emulation](https://docs.colorfinale.com/docs/inspector/film-emulation/) |
|
||||
| LUT 导出 | 将可用纯颜色处理及已有 LUT 合成为 `.cube`;空间蒙版不可烘焙进 LUT | [Export as LUT](https://docs.colorfinale.com/docs/inspector/export-as-lut/) |
|
||||
| 其他工作流 | 调色预设、跨片段组同步、图像分析、硬件控制面板 | [完整文档目录](https://docs.colorfinale.com/docs/) |
|
||||
|
||||
## 界面观察与独立设计
|
||||
|
||||
官方 [总览截图](https://docs.colorfinale.com/docs/overview/overview.png) 显示检查器一级调整和独立浮动图层面板并存。浮动面板是横向布局:顶部工具图标、左侧层栈、右侧大面积当前工具、左下层混合和蒙版入口。总览截图标示原版 2.15.0,不作为本机 2.16.2 运行证据。
|
||||
|
||||
官方 [六色向量截图](https://docs.colorfinale.com/docs/layers/sixvectors/images/sixvectors.png) 中,七枚颜色按钮横排,下方仅显示当前颜色的 H/S/L 三条滑块;肤色多一条 Target。右侧为可编辑数值,底部为整体和当前向量复位。
|
||||
|
||||
大鱼可借鉴信息层级、选择反馈和直接编辑,但不复制原图标或专有素材。清晰标注“全局快速调节”与“当前层”,比让外层控件随选层暗中改变含义更容易判断。本项目最终采用哪种绑定,以实现记录为准。
|
||||
|
||||
## 尚未确认的数学与运行事项
|
||||
|
||||
- 六色/肤色选择的确切权重、带宽和亮度公式未由公开资料确定,独立实现需自身数值与实际画面验收。
|
||||
- 旧静态跟踪证据观察到仿射拟合及位置/旋转/双轴缩放输出,不能因此宣称有透视、逐节点形变或遮挡重识别。
|
||||
- 官网 2025 年介绍 Texture EQ 为五个频段,当前文档为六个;两者应按版本区分。[旧说明](https://colorfinale.com/blog/post/cf-6-vectors-06-25)
|
||||
- 官方 HSL 页面中“Sat vs Luma”标题与正文轴描述存在命名混淆;大鱼 UI 应使用明确的“亮度 → 饱和度”名称,不照抄含混标签。
|
||||
- 原版区域跟踪的具体失败恢复、图库插入位置、原版完整运行交互尚未实际比较。不能将官方文字与已有静态分析合并声称运行验收通过。
|
||||
|
||||
## 关键验收
|
||||
|
||||
1. 两层分别处理天空和建筑;切层、复制、重排、启停、撤销、保存重开后参数与蒙版归属正确。
|
||||
2. LUT/曲线/六色向量在蒙版外保持该层输入,蒙版中羽化和混合量连续;alpha 不被空间遮罩误裁。
|
||||
3. 跟踪时重排或切层不改变目标;删除目标或改形后拒绝过期结果;取消保留可信段。
|
||||
4. LUT 登记一次后重开可见;递归去重且不跟随目录符号链接;失败目录和坏文件可见,不删除工程中已应用的采样数据。
|
||||
5. 快速切片段、移动播放头、换目标层后,整批卡片最终来自同一当前快照;点击结果与预览的位置、强度一致。
|
||||
6. 六色条和连续色相环验证区域隔离、灰阶安全及首尾连续;旧 schema 归档保持原有输出和轨迹。
|
||||
|
||||
## 2026-10-26 第二阶段实现进度(尚待正式宿主验收)
|
||||
|
||||
- 已接入:Pass-through 图层组、8 种叶子混合、父蒙版内部/外部、HSL 五条曲线及线性/平滑过点插值、RGB Master/Luma/Luma-preserving 自由曲线、相机矩阵、四区 Log 调节、独立 ASC CDL 与 CC/CCC 导入导出、最多 11 点颜色映射、原生调色文件、持久预设及 17³、33³、65³ LUT 导出。
|
||||
- 工具算法为独立实现。B 样条近似、取色创建曲线点、原三色轮的完整 CDL 对应、自动相机输入判定仍未覆盖。
|
||||
- 组只实现 Pass-through;8 种混合用于叶子层,未声称实现所有 Color Finale 组混合模式。颜色映射的渐变显示是空间输出,明确拒绝导出成 3D LUT。
|
||||
- 更多蒙版形状、HSL 与亮度键、人物或外部蒙版、手动形状动画、空间滤镜、纹理、色彩管理、胶片模拟、色卡、硬件及跨片段同步仍是开放项。
|
||||
|
||||
## 2026-10-26 蒙版与羽化进度
|
||||
|
||||
构建23已经正式验收类型蒙版、精确时间关键帧、颜色源阶段与手动/自动轨迹合并;构建24已公证安装内/外羽化双轮廓。主体宽高与羽化拖动独立,保留旧向内效果,轨迹合并保留非几何动画。布局修正版25已公证,待宿主退出后安装;最终冷重开未完成。报告及确切限制见HANDOFF.md,完整目标仍未完成。空间工具、人物/外部蒙版、色彩管理及其他上表未验收项继续保留。
|
||||
|
||||
|
||||
## 2026-10-26 空间工具源码进度(未正式安装)
|
||||
|
||||
`d31b3551ca55f787605279f821c163cf3411cb75` 已接入空间滤镜(均值/高斯/圆盘/锐化柔化)、六频段纹理、逐蒙版独立模糊及可操作图层控件。CPU/Metal完整帧、schema8与原生文件、异步取消和图库预览已联通,独立远程恢复186个文件并重编译通过728项面板测试。实际正式APP/FCP验收仍待完成,不能从源码测试推定正式效果或实时性能。Motion/Bokeh、人物/外部蒙版、色彩管理、胶片、色卡及其它未覆盖细项继续保留。
|
||||
|
||||
## 2026-10-26 帧蒙版开发基础(未接产品界面)
|
||||
|
||||
`1772fd65aac5d9e13b140c82a42705a8faaacbfa` 增加共享标量帧绑定及独立帧Vision人物提供者。CPU/Metal蒙版与父组组合、9次真实人物推理、乱序/同时间换图、均衡/高质量、内存与取消和远程197文件恢复已验证。没有复用Color Finale模型;没有把执行模块当作完整人物功能。作者归档、工作空间/宿主输入适配、人物选择与轮廓细化UI、外部image well/模板和正式验收仍为开放项。见HANDOFF.md和research/colorfinale-frame-mask-design.md。
|
||||
|
||||
## 人物帧来源进入真实渲染的开发检查点
|
||||
|
||||
`b0f3d5f2563aae51fc4573c95ab629634f9b1cbd` 完成人物/外部来源schema9、精确强度动画、运行计划6与逐帧解析。人物已接CPU/Metal位图、宿主纹理和取色;使用来源RGB配置转换分析图像,保留原调色图像。6次实际人物推理、两种图像原点、透明度、失败原子性及734项离屏面板检查通过;远端独立恢复206文件和重新编译测试通过。仍未开放人物添加/质量菜单,外部输入还未接FxPlug调度,轮廓/实例细化、预览与LUT共用全幅人物分析及正式发布验证仍未完成。颜色转换仅服务人物分析,不等于CMS/ACES迁移完成。
|
||||
|
||||
## 2026-10-26 人物控件和 LUT 分析复用开发节点
|
||||
|
||||
`7b3f0ad97321b7801fe19032edd92ad05a7a56d0` 已实现人物添加、质量、公共色阶/模糊/强度动画,隐藏无关的几何和纹理跟踪,修复同名蒙版选择及延迟编辑隔离。LUT批次对完整可用面板源按不同请求分析一次并共享原始覆盖度;真实人物图库换帧/应用、807项离屏面板检查、CPU/Metal蒙版显示及212文件远端重建通过。正式24和待装25未变。面板仍是8位缩略图,主预览与图库尚未共用一次分析;人物实例/轮廓/细节细化、外部输入、四种显示模式及正式界面性能/无障碍验收仍开放,不能称人物功能完整迁移。证据见 `verification/person-mask-ui-development.json`。
|
||||
|
||||
## 2026-10-26 人物轮廓/细化独立模块
|
||||
|
||||
`64a8f56d233d003bb4ab20766c70b18aa78267eb` 完成独立欧氏轮廓、细节与柔和度CPU/Metal模块,提供人物/轮廓/组合及内/中/外位置。修复50%边界浮点分类和软内部覆盖保留问题,177个GPU案例含4K与CPU一致、默认逐位恒等;独立远端224文件恢复和重编译通过。当前仍未接入作者归档、运行计划、产品面板和正式版本,三种处理模式不替代四种显示模式;该条继续标记开发中。
|
||||
|
||||
## 2026-10-26 人物细化接入产品源码
|
||||
|
||||
人物/仅轮廓/人物加轮廓、内/中/外位置、宽度/细节/柔和度已接入schema10、计划7、原生面板及CPU/Metal完整帧。三种处理模式与四种蒙版显示模式分开;后者继续开放。人物推理请求32字节不变,LUT批次复用原始分析;旧缺省保持恒等,外部源不能误用人物细化。离屏归档、真实人物宿主纹理、父组、边缘重采样、撤销和延迟编辑验证见 `verification/person-refinement-integration-development.json`。正式24和待装25仍不变,人物实例、外部输入、完整CMS/ACES、胶片/色卡及正式界面/性能/无障碍验收继续开放。
|
||||
|
||||
## 2026-10-26 四种蒙版显示进入产品源码
|
||||
|
||||
`69fc3712f2322155b10c4ebbe3af3f72bcda2b8b` 已接入结果/输入/输入与蒙版/合成蒙版。实际图层入口、同层组合和父组内部/外部覆盖经独立像素参考及CPU/Metal核对;真实人物细化、精确时间、异步旧结果拒绝和原生下拉菜单已接通。显示方式只在窗口内生效,不写入工程、撤销或LUT;旧输出蒙版标记保持兼容。此节点补齐上节的显示模式源码,正式界面与宿主验收仍开放。详见 `research/mask-display-contract.md` 和 `verification/mask-display-development.json`。
|
||||
|
||||
## 2026-10-26 主预览与 LUT 共享人物分析
|
||||
|
||||
`c281e39a1d6ffbc3b86d18b8783f8e8fc81d072e` 将同一窗口当前精确帧的原始人物覆盖度共享给主预览、蒙版检查和图库。并发请求共用同一覆盖度对象,部分质量命中保留已有结果,颜色/轮廓编辑复用;换源、换时间及同时间上游变化隔离,取消与失败不污染其他消费者。面板仍采用RGBA8缩略图,完整HDR/全分辨率取帧和正式播放性能仍待完成。证据见 `verification/preview-sharing-development.json`。
|
||||
|
||||
|
||||
## 2026-10-26 外部图像调度与配对快照
|
||||
|
||||
`a57576e3bc353f641fbd864fe0d9fa35228fb466` 已接入固定ID4图像槽、EffectClip/Parameter双路调度、冻结时间映射、独立坐标与原点、Alpha/Luma实际GPU渲染,以及主预览和LUT共享的自有外部快照。输入顺序、错帧、缺失、父组、代理范围、宿主纹理变更及精确配对已通过离屏测试;真实插件回调以模拟宿主元数据验证,不能替代FCP验收。远端248文件恢复、两目标Release链接、Address/UB与Metal验证通过。接收模板、添加/通道控件、外部轮廓、实际Drop Zone时间与保存重开仍开放;正式24及冻结25未变。见 `external-input-contract.md` 和 `../verification/external-input-development.json`。
|
||||
|
||||
|
||||
## 外部作者与原生接收模板开发(未正式安装)
|
||||
|
||||
`576add796cf9daa8b74271a83f2b96d7ec3d7adc` 补齐图层/组外部蒙版入口、Alpha/Luma、轮廓位置/宽度/细节/柔和度,schema11和计划9;精确强度动画保持,矩形/椭圆羽化外框与区域跟踪回归通过。独立接收模板连接固定ID4,普通模板不变;未来正式APP安装两个缺失模板,保留用户修改。1,026项面板、19,128项输入/实际GPU、144组人物/外部细化、15项模板结构及259文件远程恢复通过,详见配套verification报告。实际FCP接收、空来源、变速、保存重开、正式UI/性能未验收;本轮不把静态模板或离屏测试视为完整外部功能交付。
|
||||
|
||||
|
||||
## 迁移范围校正:人物实例与蒙版发布
|
||||
|
||||
2026-10-26重新核对:`colorfinale-frame-mask-design.md`中单独人物实例是“第二阶段可评估”的大鱼扩展设想,官方Person Mask当前说明只证明显著人物整体识别、质量和边缘细化。尚未找到单独人物选择是本机2.16.2功能的充分证据;它保留为可选评估项,不作为已证实Color Finale功能缺口。此结论不把缺失证据当作原版不支持的证明,也不减少用户原定的完整迁移范围。
|
||||
|
||||
反而已有明确但此前矩阵漏列的功能是“Publish Mask / Mask Output / Cutout”:官方2.9文章展示图层或组蒙版输出,用于把文字放在人物后面等时间线合成。大鱼现有maskView黑白输出、临时四种检查视图、外部输入三者都不能单独证明这一持久发布流程已完成;该项新增为必需迁移和验收项,正在核对本机发布目标及alpha行为。当前完整目标继续进行。
|
||||
|
||||
### 发布蒙版与抠出开发接入(2026-10-26)
|
||||
|
||||
`bbb4f00bc45170eab1312c6b39989a37f98c02ea` 已实现schema12的唯一图层/组目标与独立输出模式、CPU/Metal节点后发布、真实alpha、外层检查器和图层按钮、透明棋盘格以及归档/撤销/预设/LUT限制。组强度同步插值straight RGB与alpha,旧未发布结果保持。432组独立数值用例(220740断言)最大浮点差8.94069672e-8、8位差0;离屏面板1086项、真实插件回调夹具48项、解析14项通过。详见 `research/published-mask-contract.md`。正式安装、宿主叠层/冷重开及视觉验收仍开放。
|
||||
|
||||
原版静态证据确认发布时序和own mask,并发现其组结果后置蒙版、发布重新取样阶段与当前大鱼规则仍有差别。逐子层父蒙版与完整组混合继续列为待升级,不能因发布功能落地而勾选全等。人物已核实路径为整体分割,单人实例选择保留可选扩展。原版证据和限制见 `research/colorfinale-published-mask-design.md`。
|
||||
|
||||
### 组内外双链与混合开发接入(2026-10-26)
|
||||
|
||||
`b38bc7739f1605e81e0596e4ea942e3b4c7b8ff5` 已实现schema13/计划11的新式组:两链独立从入口开始、直属父蒙版外部路由、组混合和straight RGBA强度、最后按蒙版预乘合成。旧文件仍走旧式逐层覆盖,兼容切换可撤销;嵌套混合版本、空间工具、入口取色、临时监看、发布、LUT候选和导出接入统一流程。54场景/33231断言、1096面板及15解析测试通过,独立远端恢复281文件、两目标Release链接通过,未正式安装。原版证据及独立产品规则见 `colorfinale-group-rendering-v21.md`、`group-compositing-contract.md`。
|
||||
|
||||
当前组仅开放既有0–8共9模式,普通层保持8模式旧算法。底层27模式有真实Core Image独立oracle,但两例Luminosity极低alpha差异、Add的扩展alpha链、叶层版本迁移和工作空间转换尚未全部接入,不能勾选“全部混合完成”。原版真实菜单是组23项、普通层22项;四个非分离颜色枚举未出现在该菜单,不将它们当作已证实菜单必需项。正式UI/键盘/VoiceOver/宿主重开/性能、CMS/ACES、胶片/色卡、Motion/Bokeh和其它矩阵细项仍开放。
|
||||
|
||||
### 完整混合模式开发与正式25验收(2026-10-26)
|
||||
|
||||
schema14/计划12已接入26种叶层、27种组模式及版本化预乘中间链,使用系统CI真实过滤器,不以旧近似数学冒充扩展alpha一致。叶层Add设alpha1、组Add保留扩展alpha;强度和蒙版各自处理,旧节点保留原算法。84完整场景和1160面板断言通过,极端数值安全及4K动态预算修复已验证,尚未正式安装。正式25仅是羽化/布局阶段:FCP冷重开文件逐字节一致,椭圆/旋转矩形实际外框拖动与撤销重做通过,生成副本已清理。完整迁移余项仍按矩阵保持开放。
|
||||
@@ -0,0 +1,147 @@
|
||||
# 后续颜色工具的独立实现设计
|
||||
|
||||
日期:2026-10-26(Asia/Shanghai)。这是下一阶段工程设计,不是已实现清单,也不表示与 Color Finale 逐像素等价。本文件只新增设计文档;没有修改颜色源码、宿主工程或界面。
|
||||
|
||||
审阅基线:`19b3d80039875d09b46f4418e6cfdddf0b0d036a`。审阅时 `Core/DYColorMath.h` 的 SHA-256 为 `4ce03351e3b93b94971e15f8b68d4448c98d8bd5308580595980ef399e5ad7aa`。功能来源和本机版本边界继续见 [迁移矩阵](colorfinale-2.0-matrix.md)。
|
||||
|
||||
## 1. 已有实现与需要保留的约束
|
||||
|
||||
当前 `DYGrade` 为 1032 字节,前 808 字节是旧参数 ABI;新增 224 字节为快捷 HSL、七个向量、RGB 曲线和通道矩阵。当前五点 `curve` 分别作用于 R/G/B,是 Master RGB 语义,不是真正的单独亮度曲线。RGB 曲线随后处理各通道。当前实际顺序是:
|
||||
|
||||
`曝光/白平衡 → lift/gain/midtone → 黑白点/对比/阴影高光/伽马 → Master RGB 曲线 → 各 RGB 曲线 → 饱和度 → 蜘蛛盘 → 快捷 HSL/向量 → 通道混合 → LUT → 局部处理/图层蒙版与混合`。
|
||||
|
||||
这条链已承载保存的用户画面。增加新工具时不得重新排列旧链、把现有曲线改解释为 Luma、把现有三色轮改解释为 CDL,或因图层的显示类型改变旧参数的意义。旧参数的默认旁路、alpha、CPU/Metal 共用数学和保存重开行为继续作为回归基线。
|
||||
|
||||
## 2. 参数、归档与渲染计划
|
||||
|
||||
建议冻结 `DYGrade` 的 1032 字节布局。可变节点和新增模式另存为 `DYAdvancedColorState`,以可安全归档的命名字段编码,挂在每个 `DYSettings` 的可选 `advancedColor` 键下;归档 schema 升为 5。不要把大数组、枚举或可变数量控制点继续追加进现有按整块 float 插值的区域。
|
||||
|
||||
| 项目 | 建议布局与默认值 |
|
||||
| --- | --- |
|
||||
| `DYAdvancedColorState` | `version=1`、`kind`、`enabled=false`,一个与 kind 匹配的工具状态;空值为严格恒等 |
|
||||
| 工具身份 | `hsl_curves`、`log_wheels`、`camera_matrix`、`cdl`、`color_atlas`、`rgb_curves_v2`;复用外层稳定 layer ID |
|
||||
| 曲线作者数据 | 每条曲线独立 ID、enabled、interpolation、domain、点列表;每点稳定 ID、x/y、左右切线或手柄;每条最多 32 点 |
|
||||
| CPU/Metal 渲染头 | 显式 `uint32_t version, kind, flags, payloadIndex`;参数、曲线采样表与节点各自有长度校验;不要持久化平台指针、`BOOL` 或 `simd_float3` padding |
|
||||
| 时间采样 | 固定标量仅在同工具版本间插值;曲线、节点数量、模式为离散快照,或仅在稳定点 ID 完全匹配时插值;禁止将枚举当 float 混合 |
|
||||
| 颜色上下文 | 记录工作 RGB、传递函数/Log 编码、参考白、是否已经过输入变换;未知信息明确为 unknown,不能从画面观感猜测 |
|
||||
|
||||
新建高级工具层把原 `DYGrade` 留在恒等值,先走旧 grade,再执行该层高级算子,再接现有 LUT、局部处理、蒙版与层混合。已有层没有高级块,输出保持原样。高级工具排列由图层栈显式决定;不在后台把 Log 色轮、矩阵或 CDL 自动移动到别处。若同层保留旧参数和高级块,工具区需说明该内部顺序。RGB 曲线 v2 是独立新算子;旧 5 点曲线不被隐式搬移。
|
||||
|
||||
迁移要求:
|
||||
|
||||
1. 808 字节:先 `dyDefaultGrade()`,只拷贝 808 字节,再执行原迁移;新增颜色参数和高级块为恒等。1032 字节:完整保留原值,高级块为空。未知长度必须报错或明确保留原数据,不能按较短长度猜测结构。
|
||||
2. schema 5 仍存 1032 字节 grade 和独立高级块。解码类表、深拷贝、相等比较、撤销、渲染快照、宿主证据读取、恢复工具同时更新。
|
||||
3. 新读者遇到未知但启用的高级工具版本要拒绝静默丢弃。旧已发行程序不会因为新 writer 增加一个版本字段就自动学会拒绝;因此只承诺旧→新迁移,不承诺新文件可被旧程序正确打开。恢复说明标明最低版本。
|
||||
4. 旧 808 与现有 1032 的真实归档、带 LUT/钢笔/轨迹的文档都建立画面对照。新格式保存再重开、随机时间、CPU 与 Metal 必须分别验证。
|
||||
|
||||
## 3. HSL 曲线
|
||||
|
||||
**官方证据。** 文档列出按色相调色相、饱和度、亮度,以及按亮度或饱和度调饱和度的五条曲线;支持独立旁路、取色加点及不同插值。正文中 Sat vs Luma 的横轴实际描述为亮度,大鱼应直接标成“亮度 → 饱和度”。公开页没有给出精确颜色转换、区间外推和样条系数。[官方 HSL Curves](https://docs.colorfinale.com/docs/layers/hsl/)
|
||||
|
||||
**建议参数。** `DYHSLCurvesState` 包含五个 `DYCurveState`、`extendedSaturation=false`、`mathVersion=1`。坐标和输出单位如下:
|
||||
|
||||
| 曲线 | x | y 与中性值 | 建议初始界限 |
|
||||
| --- | --- | --- | --- |
|
||||
| 色相 → 色相 | 周期 hue,0–1 turns | hue 位移,0 | ±0.5 turns |
|
||||
| 色相 → 饱和度 | 周期 hue | 饱和度倍率,1 | 0–4 |
|
||||
| 色相 → 亮度 | 周期 hue | 曝光位移 EV,0 | −4 至 +4 EV |
|
||||
| 亮度 → 饱和度 | 层输入的归一化代码亮度 | 饱和度倍率,1 | 0–4 |
|
||||
| 饱和度 → 饱和度 | 层输入的选定饱和度定义 | 饱和度倍率,1 | 0–4 |
|
||||
|
||||
上述 EV、倍率和界限是大鱼的独立选择,不是对 Color Finale 数值刻度的断言。工具名中的亮度不复用当前快捷 HSL 的 lightness 字段;两者的数学语义不同。
|
||||
|
||||
**建议评估。** 从该算子的同一输入一次性取 hue、saturation、亮度 Y。五条曲线全部以这些原始坐标取值,避免前一条曲线移动后一条的选择区域。色相位移后合成颜色,三个饱和度倍率相乘;在亮度为零的色差子空间缩放色差。最终目标亮度为 `Y × 2^EV(hue)`,通过下节的亮度恢复函数恢复。近中性像素用平滑色度权重抑制色相选择噪声;精确灰色只响应亮度型处理,不凭无定义 hue 生成染色。扩展模式保留额外色度,不在中间强制裁到 SDR;最终有限范围沿用现有渲染策略。
|
||||
|
||||
饱和度轴必须有固定定义并随 `mathVersion` 保存,建议第一版沿用当前 HSL 工具使用的归一化颜色基础;亮度轴明确采用当前工作空间的代码亮度。不要按每帧直方图自动拉伸坐标,否则随机跳帧和图库预览会改变结果。对超出 0–1 的亮度/饱和度选择坐标使用端点值,RGB 输出仍可超范围。
|
||||
|
||||
**曲线表示。** 提供线性、平滑逼近、平滑过点三种明确模式。平滑逼近可独立用三次 B 样条(de Boor),平滑过点可用受限 Hermite/Bezier。它们不是同一个算法的三个名称。x 必须严格递增,Bezier 手柄 x 不跨邻点;周期曲线使用首尾共享约束和虚拟邻点,保证接缝值与斜率连续。作者点原样保存,编辑后后台烘焙 4097 个 float 样本,CPU/Metal 共用相同表和插值。不能把采样表作为唯一可编辑文件。若误差门限未达到,再增加分辨率或改为分段系数。
|
||||
|
||||
**验收。** 连续色相环跨红色接缝;原始色相选择的顺序独立性;全部曲线旁路与中性值严格恒等;色相区间外不变;黑白端去饱和渐变平滑;B 样条不过点与过点模式确实不同;重排/删除点后无重复 x、NaN 或越界。查表与双精度直接求值对照,目标归一化误差 ≤2e−4,并以视觉渐变检查条带。CPU/Metal 允许最后量化误差不超过 1 个 8-bit 色阶,alpha 必须逐位保留。
|
||||
|
||||
## 4. RGB 曲线模式
|
||||
|
||||
**官方证据。** Master + RGB 对各 RGB 值共同套主曲线;Luma + RGB 的主曲线针对亮度;Luma Preserving 在调整 RGB 曲线时保持亮度。还支持取色建点及 S 曲线快捷操作。公开说明没有给出保持亮度的确切公式或 HDR 边界处理。[官方 Curves](https://docs.colorfinale.com/docs/layers/curves/)
|
||||
|
||||
**建议参数。** `DYRGBCurvesState { version, enabled, mode, master, red, green, blue }`。mode 为 `masterRGB / lumaRGB / lumaPreserving`。每条最多 32 点;默认 `(0,0),(1,1)`。所有通道拥有各自旁路状态;原 `curve[5]` 与 `rgbCurve[3][5]` 保留原模式和旧插值。
|
||||
|
||||
令 `Y(c)=dot(w,c)`,w 为当前工作空间亮度权重。定义独立辅助函数 `setLuma(c,target)`:当原 Y 大于正 epsilon 且 target 非负时按 `target/Y` 等比缩放 RGB;其余情况采用 `c + (target−Y)·1`,避免黑色、负值和除零引起色相翻转。此回退边界应连续化并版本固定;它是工程选择,不是原产品公式。
|
||||
|
||||
| 模式 | 明确处理顺序 |
|
||||
| --- | --- |
|
||||
| Master RGB | `m_k=Master(c_k)`,再 `out_k=RGB_k(m_k)` |
|
||||
| Luma RGB | `target=Master(Y(c))`,`m=setLuma(c,target)`,再逐通道 RGB 曲线 |
|
||||
| Luma Preserving | 同上得到 RGB 曲线结果 q,最后 `out=setLuma(q,target)` |
|
||||
|
||||
对黑/负亮度的 `setLuma` 建议最终实现采用有界平滑过渡,而不是在 epsilon 处硬切。要先确定此过渡再固定 mathVersion。曲线的区间外推第一版可采用端点斜率且限制极端斜率;旧五点曲线继续原端点偏移外推。取色只在当前冻结源帧和该层输入上建点,不能从已经过该层输出的屏幕颜色反复反馈。
|
||||
|
||||
**验收。** 同一 S 曲线在 Master RGB 与 Luma 模式具有可解释差异;Luma Preserving 改红曲线后 `dot(w,out)` 保持目标亮度;灰阶、接近黑色、负通道、HDR、同 x 重复点、极陡曲线都保持有限输出;旧归档仍调用旧五点路径。S 曲线快捷操作只建立普通可编辑点,没有额外隐形对比度参数。
|
||||
|
||||
## 5. Log 色轮
|
||||
|
||||
**官方证据。** 原工具有阴影、中间调、高光及 Offset,带亮度控制和范围分界;推荐位于 Log 转视频空间的层之前,并保持传入 Log 状态。文档没有公布具体区域权重或相机编码公式。[官方 Log Wheels](https://docs.colorfinale.com/docs/layers/log-wheels/)
|
||||
|
||||
**建议参数。** `DYLogWheelsState`:四组 `chroma[3]` 和 `brightness`,全部默认 0;`shadowEnd`、`shadowSoftness`、`highlightStart`、`highlightSoftness`;`domain=encodedLog`;独立 mathVersion。参数单位是输入 Log 的代码值偏移,不标作 EV。初始范围可取阴影过渡 `[0.20,0.40]`、高光过渡 `[0.60,0.80]`,但这些只是产品初始值,不代表任何相机标准。
|
||||
|
||||
在层输入的代码亮度 Y 上构造 `ws=1−smoothstep(s0,s1,Y)`、`wh=smoothstep(h0,h1,Y)`、`wm=1−ws−wh`,要求 `s0<s1≤h0<h1`。边界编辑自动保持最小间隔,令权重非负且总和 1。每个色轮的色差向量减去其加权亮度分量;最终:
|
||||
|
||||
`out = input + offsetChroma + offsetBrightness·1 + Σ weight_region × (regionChroma + regionBrightness·1)`。
|
||||
|
||||
四个色轮的二维位置与 RGB 数值是同一参数的两种编辑方式,不能保存两套可能不同步的真值。输入范围外仍使用端区权重,但不裁剪 RGB。中性参数直接返回输入。
|
||||
|
||||
当前宿主请求的是 gamma-video 图像;如果宿主或上游相机 LUT 已把素材转换成视频空间,新增一个叫 Log 的色轮不能恢复原始 Log。应把“输入保持 Log”的上下文条件接入色彩管理和层顺序,支持用户明确指定已有输入编码,不自动检测或偷偷反转换。先完成该前提,才报告 Log 工作流可用。可验证的初版是对明确声明的 Log 代码值做上述算子,不声称具备相机自动识别。
|
||||
|
||||
**验收。** 灰阶 ramp 显示三个区间的局部响应;分界处无阶跃;Offset 对全范围一致;保持 Log 输入、先色轮后 Log→709 LUT 与反向顺序确实不同且可撤销;导出随机帧不依赖播放顺序。用真实指定 Log 素材对照前,不以 SDR 画面“看起来正常”代替验收。
|
||||
|
||||
## 6. 相机矩阵
|
||||
|
||||
**官方证据。** 文档说明可独立调整 R/G/B 基色的 hue/saturation,并保持整体白平衡。它没有给出矩阵构建方式,也没有说明等于某家相机的 IDT 或校准矩阵。[官方 Camera Matrix](https://docs.colorfinale.com/docs/layers/camera-matrix/)
|
||||
|
||||
**建议参数。** `DYCameraMatrixState { enabled, hueTurns[3]={0}, saturation[3]={1}, preserveNeutral=true, mathVersion=1 }`。建议 hue 初始可编辑范围 ±1/6 turns,saturation 0–2;这些与当前九系数 `channelMixer` 是独立工具。保存控件值,在构建渲染计划时生成 3×3 矩阵,不在每个像素重新计算三角函数。
|
||||
|
||||
一个可验证的独立构造:令 `1=(1,1,1)^T`、`w^T·1=1`,e_i 是 R/G/B 基向量。先将每个基色分成 `w_i·1` 与零亮度色差 `q_i=e_i−w_i·1`。在与 w 正交的平面中旋转 q_i,再乘对应饱和度,得到候选列 `A_i=w_i·1+s_i·Rotate(q_i,2πh_i)`。旋转可用绕单位 w 轴的 Rodrigues 公式。最后施加投影:
|
||||
|
||||
`M = A + (1−A·1)·w^T`。
|
||||
|
||||
这个构造满足 `M·1=1`,因此所有中性灰保持;也满足 `w^T·M=w^T`,保持所选代码亮度。默认 A 和 M 均为单位阵。白平衡保持需要对其他基色作补偿,所以“独立控件”不表示其他 RGB 数值永远不变。矩阵可输出负值,不在算子内部硬裁色域;该边界由后续显示/输出处理承担。
|
||||
|
||||
此公式是大鱼设计推导,未从 Color Finale 反编译所得。矩阵的工作域、亮度权重及是否保持亮度须版本固定;后续接入不同 RGB 工作空间时,不能继续无条件使用 Rec.709 系数。
|
||||
|
||||
**验收。** 对随机允许参数验证 `M·1=1` 和 `w^T·M=w^T`;灰阶 −2…16 保持;单个主色控件变化方向稳定;默认严格恒等;CPU/Metal 矩阵排列一致;处理负输入和高亮不产生 NaN。不能把这些数学通过项说成相机色彩科学已校准。
|
||||
|
||||
## 7. CDL 交换
|
||||
|
||||
**官方证据。** Color Finale 色轮提供单个片段/色轮的 CDL 导入导出,交换 slope、offset、power、saturation。公开页没有承诺把整条时间线或任意工具堆栈压成一个 CDL。[官方 Color Wheels](https://docs.colorfinale.com/docs/layers/wheels/)
|
||||
|
||||
采用明确的独立 `DYCDLState { slope[3]={1}, offset[3]={0}, power[3]={1}, saturation=1, style, id, description }`。标准前向与不裁剪前向是不同 style;不能依据数值是否中性擅自改变 style。[ACES CLF 的 ASC_CDL 定义](https://docs.acescentral.com/clf/specification/#asc_cdl) 和 [OpenColorIO CDLTransform](https://opencolorio.readthedocs.io/en/stable/api/transforms.html#cdltransform) 可作为实现/对照依据。
|
||||
|
||||
标准前向按通道 `q=clamp(input×slope+offset,0,1)^power`,再以 Rec.709 权重得到 Y,输出 `clamp(Y+saturation×(q−Y),0,1)`。NoClamp 省略两处 clamp,且对 SOP 的负中间值跳过 power。slope≥0、power>0、saturation≥0,输入必须为有限数。标准 clamp 模式即使数值默认也会裁超范围值,因此不能把它优化成对 HDR 的无条件恒等;NoClamp 的默认值才可直接旁路。
|
||||
|
||||
第一版导入 `.cc`,以及从 `.ccc` 中选择一个明确 ID;若支持 `.cdl` 则解析其中的条目结构,不能仅按扩展名选择第一个 XML 节点。保存 ID/描述与十个数值,使用足够有效位数输出。禁用外部 XML 实体/网络解析,拒绝重复必须字段、非有限值和非法数量。参数读入不写入原文件。NoClamp style 若目标文件格式无法表达,导出界面明确其互操作限制,不用注释伪装标准字段。
|
||||
|
||||
当前三色轮并非直接的 CDL 数据。在其他工具全中性、没有不兼容范围饱和度、LUT、混合或蒙版时,单通道的代数近似可整理为:`slope=(1−lift)×(1+gain)`,`offset=lift×(1+gain)`,`power=1/(1+midtone)`。这只是当前公式的特定条件转换,仍须数值验证并检查非负 slope 等合法性。默认优先新增真正 CDL 工具层,精确保存交换参数。不能把任意调色结果压成十个数并声称无损。
|
||||
|
||||
**验收。** 用公开 CDL/CLF 的固定数值案例和独立 OCIO CPU 参考比较;SDR、负值、>1 输入、power=1、零 slope、零饱和度、非法 power 分别覆盖;导入→导出→再导入十个参数稳定;Unicode 描述和多 ID 选择正确;没有颜色管理上下文时不声称跨应用显示外观必然一致。旧三色轮转换另设输出误差检查,不与直接 CDL 往返混为一项。
|
||||
|
||||
## 8. Color Atlas 色调渐变映射
|
||||
|
||||
**官方证据。** 原工具最多 11 个 HSLA 渐变点,按 Rec.709 亮度、单个 R/G/B 通道或 CIE L* 选取渐变;包含结果、亮度图、渐变输出及取色/本地预设。公开页没有给出渐变插值色彩空间。[官方 Color Atlas](https://docs.colorfinale.com/docs/layers/color-atlas/)
|
||||
|
||||
**建议参数。** `DYColorAtlasState` 包含 `points[2…11]`、`tonalSource`、`outputMode`、`interpolation=RGBPremultiplied` 和 mathVersion。每点存稳定 ID、position、hueTurns、saturation、lightness、alpha。position 单调,端点固定 0/1,重复位置明确拒绝或作为同一次编辑替换;不让排序随机决定结果。默认两点 alpha=0,使新层恒等,这是大鱼的产品选择。
|
||||
|
||||
**建议评估。** 先从该层输入计算 tonal coordinate,范围外夹到端点。HSLA 只作为点颜色的编辑表示;第一版在当前明确工作 RGB 中对预乘色和 alpha 线性插值:`P=lerp(a0·RGB0,a1·RGB1,t)`、`A=lerp(a0,a1,t)`,结果为 `input×(1−A)+P`。这样完全透明的点不会污染相邻颜色。点 alpha 控制颜色覆盖量,仍保留素材的 alpha;之后还要乘图层蒙版/混合量,不能重复把素材 alpha 当点 alpha。原版是否采用同一插值仍未知。
|
||||
|
||||
Rec.709 代码亮度与 CIE L* 不可共用一个未经转换的 dot。L* 要先按已知传递函数得到线性 RGB,转到 XYZ 的相对 Y/Y_n,再按 CIE 分段立方根计算并除以 100。参考白与传递函数未知时,该模式应显示需要明确颜色空间,不能把 gamma RGB 直接代入公式。[W3C 颜色转换参考](https://www.w3.org/TR/css-color-4/#color-conversion-code)
|
||||
|
||||
`Result` 是正常映射;`Tonal Map` 输出所选坐标的灰阶;`Gradient` 按画面水平 x 展示渐变。这三个若作为输出模式保存,必须在宿主输出中一致生效。Gradient 依赖空间坐标,不可作为纯 RGB 变换烘焙进 3D LUT;工具区只看渐变的辅助视图则另设编辑状态,不改正式输出模式。5×5 取样应来自冻结的该层输入帧,记录所选色值后才提交一次撤销。
|
||||
|
||||
预设保存点、模式和版本,不保存路径依赖或偷用原版预设。预设缩略图的颜色上下文和当前图像结果分别标明。重命名/删除只针对用户当前选择的本产品预设。
|
||||
|
||||
**验收。** 单点插入、删除、重排、复制后的 ID;0/1 alpha、透明饱和色邻点的无色边;纯灰 ramp 的映射;R/G/B 不同输入源的差异;L*=0/100 与标准灰值;11 点上限;预设重开;三个输出模式、图层蒙版和素材 alpha 正确组合。
|
||||
|
||||
## 9. 实施顺序与完成门槛
|
||||
|
||||
建议先做高级工具归档/渲染快照,再做 CDL 与相机矩阵两个易获得确定参考的算子;随后 RGB 曲线 v2、HSL 曲线、Color Atlas;Log 色轮在输入域和转换顺序清晰后接入。工具在完整图层栈中的顺序由用户决定,以上仅是开发顺序。
|
||||
|
||||
每个算子至少有三类证据:数学性质或独立参考、CPU/Metal 数值一致、正式宿主实际画面与保存撤销。最小跨工具案例为:Log 色轮 → 输入转换 LUT → 相机矩阵 → RGB 曲线 → HSL 曲线 → Color Atlas;分别改变顺序、混合量、图层蒙版和 alpha,验证预览与最终结果共享同一快照。
|
||||
|
||||
必须保留的旧格式回归是:schema1/2/3 的 808 字节状态,以及 schema4 的 1032 字节状态,在新高级块为空时完全沿用旧数学。仅增加按钮、序列化字段或静态测试不能计为对应工具已完成。官方未公开的数学只可报告为独立实现;本机 Color Finale 2.16.2 的实际界面、刻度和输出仍需另行对照,不能由本设计补写成已经观察到的事实。
|
||||
@@ -0,0 +1,96 @@
|
||||
# ColorFinale 2.16.2 (625) 分析
|
||||
|
||||
分析日期:2026-10-25。目标是以可重复行为和算法结构为依据独立实现新插件;原程序保持只读。本报告只保存事实、接口与推断,不包含其二进制、预设/LUT/图标、可复用的反编译源码。
|
||||
|
||||
## 已核实身份与结构
|
||||
|
||||
- 外层 APP:`/Applications/ColorFinale.app`,Bundle ID `com.colorfinale.app`。
|
||||
- FxPlug:`Contents/PlugIns/ColorFinale.pluginkit`,ID `com.colorfinale.ColorFinaleFxPlug`。
|
||||
- 主插件可执行文件 SHA-256:`49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f`。
|
||||
- Ghidra 12.1.4 对 arm64 片进行完整默认静态分析;这是静态观察,不代表在 FCP 中实际运行。
|
||||
- 主插件管理 AppKit 自定义窗口、LUT 画廊、图层和跟踪;链接自带 `RenderingEngine`、`GradeKit`、`StepsKit`、`ColorFinaleUtils` 与 OpenCV。OpenCV 为产品自带依赖,不能把该二进制复制成新产品依赖。
|
||||
|
||||
## 局部跟踪:已观察到的算法链
|
||||
|
||||
核心函数:`FTAreaTracker::track:trackerState:`,地址 `0x100035e40`,Evidence `ev_dcd7aa770925f63c8c14c968ae6b417fda78685c7be7fa739a78209957d40e2d`。
|
||||
|
||||
1. 从形状点集的 convex hull 建立 8-bit 特征选取遮罩(fillPoly),特征限定在被跟踪形状区域。
|
||||
2. `goodFeaturesToTrack`:最多 300 点,qualityLevel 0.03,minDistance 10,blockSize 3,不使用 Harris,k 0.04。
|
||||
3. `cornerSubPix` 精炼:10×10 半窗,20 次/0.03 终止条件。
|
||||
4. 对相邻灰度帧做前向和反向 `calcOpticalFlowPyrLK`:21×21 窗口,maxLevel=3,30 次/0.01 终止条件,minEigThreshold=0.0001。
|
||||
5. 保留光流成功且前后向误差严格小于 1 像素的点。有效点少于 4 则返回失败,不继续制造位置。
|
||||
6. 观察到另一组基于 `max(width,height) × 0.01` 位移阈值的点筛选;当大位移点超过有效点一半时偏向该组。其产品意图尚未运行证实,可能用于优先运动主体。
|
||||
7. `estimateAffine2D`,method=8(OpenCV RANSAC 常量),reprojection threshold=3,maxIters=2000,confidence=0.99,refineIters=10。空矩阵失败。
|
||||
8. 分解得到平移、旋转和 X/Y 缩放,围绕当前形状中心更新点集和状态。虽然拟合 full affine,持久化形状输出为位置/旋转/双轴缩放,未观察到透视单应矩阵输出。
|
||||
9. 条件分支显示会周期性重新选取特征;精确刷新策略需运行比对后再定,不把它当作已验收功能。
|
||||
|
||||
逐帧入口:`FTAreaTracker::trackFrame:inScene:`,`0x100036cbc`,Evidence `ev_9131db4f8dcde696cbeb6659e1da62aa76fbdbd4329f22ab8695d32b57890b68`。
|
||||
|
||||
- 必须收到完整一帧后才分析。输入转 IOSurface,maxSize 为 3840×2160,再转灰度 OpenCV Mat。
|
||||
- 每个跟踪节点单独保存状态;无有效节点则结束。
|
||||
- 每帧把结果写入节点的 `position`、`rotation`、`scale` 动画属性;位置除以分析图像宽高归一化,时间使用 effectTime。
|
||||
- 说明正确实现需要持久化按时间的轨迹,不能仅在实时渲染回调保留上一帧状态,否则非顺序渲染/导出会出错。
|
||||
|
||||
分析对接:`FTAreaTrackerAnalyzer::effectAnalysis:analyzeFrame:session:error:`,`0x10005b47c`,Evidence `ev_1dd68409d431d9e81875b6032a81dd89f7f237ea5501d3db1d7ca92ba32e6323`。
|
||||
|
||||
- 适配宿主 effectAnalysis 回调,按 session 色彩空间和 effectTime 建立 frame tile;先收集 tiles,再在完整帧上调用 tracker。
|
||||
- 有取消、越过片段范围、无效图像、分析结束状态;不能把失败继续当跟踪成功。
|
||||
|
||||
交互模式:`FTAreaTrackerController::setTrackerModeForSession:from:to:`,Evidence `ev_a455d8cd5a459e3f95e5a5c7ca4d8837481d31266ae1ee51901bc7091a3e8fac` 根据起止时间和一帧时长区分前向/后向连续跟踪及单帧步进。`FTShapeTrackerControl::trackForwardFrame:`,Evidence `ev_a3edfabaaaeb8ab7545ded0b4d392e65e39062180c60d2262363a35d9a88e803` 显示有选中形状才跟踪;自动跟踪进行时阻止再次启动。
|
||||
|
||||
## LUT 批量预览:已观察到的渲染与缓存
|
||||
|
||||
`FTLUTGalleryItem::processFrameTile:context:`,`0x1000d0b28`,Evidence `ev_f502284708e116a00f22144b4489ab51665c389f92f577e33801100da6b62af5`:
|
||||
|
||||
- 每个 gallery item 通过 LUT 标识从 CubeManager 请求 `previewMode` 数据。
|
||||
- 建立独立 CubeFx,使用 item 的预览工作色彩空间,渲染到输入 frame tile。
|
||||
- 画廊与实际 LUT 强度控件应共用解析和渲染链,避免预览与最终效果不同。
|
||||
|
||||
`FTAssetGalleryImageCache::renderPreviewImageForAsset:`,`0x1000f9c0c`,Evidence `ev_fe5a0a660188eb8f7be89bbc46b3e496be9b38f84643ef283339ad20c8090d5f`:
|
||||
|
||||
1. 获取并缓存 sourceFrame。
|
||||
2. 获取当前项目 scene/adjustments。
|
||||
3. 先应用工程已有调整。
|
||||
4. 再应用每个待预览 LUT/asset。
|
||||
5. 转输出色彩空间、处理方向,再建立 NSImage。
|
||||
6. source 或渲染无效返回失败,不以空白图冒充已生成结果。
|
||||
|
||||
`FTAssetGalleryImageCache::fetchSourceFrame`,`0x1000f9fdc`,Evidence `ev_7c9c47eb6708f3d7003cffc1c1de8b01aeb083c59961d67d52b77dc4eac7da16`:支持 live 当前片段帧,以及用户指定默认图片。静态图片明确使用 sRGB。live 模式通过宿主 action session 请求片段帧。
|
||||
|
||||
`FTAssetGalleryImageCache::init`,Evidence `ev_8ffc0ac45b90bfb4aee21319d4e4627b726416957325c92b4c77be938c745e82`:NSCache 的 totalCostLimit=0x20000000(512 MiB);另有 `FTPriorityOperationQueue`,非 LIFO,QoS 0x19。`generateImageForAsset:`,Evidence `ev_65fcaf5901400eb9a82486bd4fc18775a32e404f7731b943c6ee3ffd997b1d69` 将工作封装 NSBlockOperation 投入队列。`cacheKeyForAsset:` 使用 live 状态和 asset renderKey(Exact key format 未恢复)。
|
||||
|
||||
LUT 元数据/图库搜索 Evidence `ev_52ed9e7aff017b889468b9b0f901f73a44e6fa7a5de8a45825ed5f913b6c7689`;图库方法显示最近使用、按组/文件夹、搜索过滤、选择预览色彩空间、注册文件夹、检测失效路径及重新链接。当前版本具体支持的 LUT 文件格式、插值方法和 domain 边界尚未进入 RenderingEngine/GradeKit 定点分析,不能据名称宣称支持。
|
||||
|
||||
## 自定义 UI:结构证据与独立设计
|
||||
|
||||
- AppKit 的 FTColorCorrectionWindowController 及 FTRemoteColorCorrectionWindowController 提供独立自定义窗口;后者背景使用 white≈0.122、alpha=1。Evidence `ev_590a46e741638ab2be5dd0da9f0c739a3d82f87e8a181d0546d64731adc081de`。
|
||||
- FTColorCorrectionViewController 持有图层控制器、当前工具 viewHost,可切 Curves、Telecine/Color Wheels、Six Vectors、Cube、HSL Curves、Mask、Filter、Camera Matrix、Log Wheels;有添加层/组、LUT层、undo/redo、mask选择等入口。Evidence `ev_1631c9fca7d9780ee93449341856f7816ff1a31a2051e1dac93bbed07291bc84`。这是结构观察,未做屏幕布局验收。
|
||||
- 局部形状控制器有 opacity、feather、position、scale、rotation 控件;ShapeTrackerTimeline 支持按时间选择、关键帧和区域绘制、单帧/连续跟踪。Evidence `ev_511921a9b7511facedd4f9ddf5e6cee2680de4c55dbf726a0d4f2a3b05d1cd14` 和 `ev_3cdbe7c6cd89c47105df02ef6c0019377646eca014c758b21a988d70b9164b8b`。
|
||||
|
||||
建议新 UI 保留暗色浮动窗口、工具切换、清晰图层栈和图像直接编辑:左侧图层/局部区域,中间画面与可拖拽形状,右侧调色/蜘蛛盘/LUT画廊/跟踪页;底部当前时间、关键帧、前后跟踪与取消。颜色、图标、布局和文案重新设计,不复制原产品资源。是否采用左右三栏属于新产品设计选择,不是 ColorFinale 运行观测。
|
||||
|
||||
## 对新工程的实现建议与验收边界
|
||||
|
||||
- 采用自行构建的官方 OpenCV 或独立实现特征+LK+RANSAC;不链接 ColorFinale 内置 framework。跟踪算子与 FxPlug/UI 分层,先用给定航拍跑完整轨迹,再把相同轨迹作为宿主分析结果保存。
|
||||
- 持久化每个局部节点的初始区域、时间/矩阵/置信度/失效状态。渲染只按当前时间采样已烘焙轨迹。支持前后向重算、取消、失效手动校正和再次继续。
|
||||
- 最小局部形状先做旋转椭圆、矩形/圆角矩形与多边形,含羽化/反相/透明度;不要把“整个画面自动平移”宣称为局部跟踪。
|
||||
- LUT 初版用公开 .cube 规范独立解析;DOMAINS、1D/3D、强度、越界政策写清楚并做数值测试。预览以当前帧为共同输入,缓存需包含帧ID/调整快照/色彩空间/LUT内容摘要和尺寸,滚动时取消过时任务。
|
||||
- 航拍验收至少选清晰静态建筑和一处边界区域,覆盖运动、旋转/缩放、遮挡或低纹理;输出叠加跟踪轮廓的连续片段并检查尾帧漂移。只在几帧上画标记不能证明整段跟踪成功。
|
||||
- 仍未完成:ColorFinale 实际运行 UI 对照、LUT 插值内核、遮罩合成数学、在给定 DJI 素材上的原产品基准轨迹。新插件的行为验收不应冒充与原算法逐像素等价。
|
||||
|
||||
## 本地完整证据
|
||||
|
||||
完整 REA Evidence bundle 与 snapshot 含反编译中间产物,仅保存在本机研究缓存,不进入源码仓库:
|
||||
|
||||
- `/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-evidence-20261025.json`(22 records)
|
||||
- `/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-snapshot-20261025.json`
|
||||
|
||||
本报告中的观测可依上述 SHA、函数地址和证据 ID 重做。REA 会话已关闭。
|
||||
|
||||
## 宿主接入的补充定点证据
|
||||
|
||||
文件选择入口取得 self.view.window 并调用 beginSheetModalForWindow。新面板采用宿主附属面板,修复独立 begin 调用在远程窗口中的焦点问题。
|
||||
|
||||
RenderTrigger 参数 201 为 NSUUID 自定义参数,标志 0x3(HIDDEN、NOT_ANIMATABLE),没有 DONT_SAVE;通知参数 200 的 0x13 另含 DONT_SAVE。201 位于顶层通知参数之后,原生模板并不显式保存它。捕获对象按插件实例持有期望时间及会话令牌,渲染时从源图像取帧并回主线程交给面板。
|
||||
|
||||
依据是只读创建函数与帧捕获调用链。本机追加记录为 ColorResearch/colorfinale-rendertrigger-facts.json、colorfinale-file-dialog-evidence-20261026.json、colorfinale-frame-capture-evidence-20261026.json;文件名后缀沿用采集名称。新插件独立实现隐藏 NSUUID 刷新通知与实例内会话标记,最终 FCP 首次打开、当前帧刷新和重开已实际通过。
|
||||
@@ -0,0 +1,422 @@
|
||||
{
|
||||
"date": "2026-10-25",
|
||||
"scope": "ColorFinale 2.16.2(625) static arm64 analysis",
|
||||
"full_evidence_local_only": "/Users/mac/Library/Caches/CodexBuilds/ColorResearch/colorfinale-rea-evidence-20261025.json",
|
||||
"limitations": [
|
||||
"Static observation does not establish runtime behavior or exact source equivalence.",
|
||||
"This compact index intentionally omits proprietary disassembly and decompiler pseudocode."
|
||||
],
|
||||
"records": [
|
||||
{
|
||||
"key": "0x100035e40",
|
||||
"evidence_id": "ev_dcd7aa770925f63c8c14c968ae6b417fda78685c7be7fa739a78209957d40e2d",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x100035e40"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x100036cbc",
|
||||
"evidence_id": "ev_9131db4f8dcde696cbeb6659e1da62aa76fbdbd4329f22ab8695d32b57890b68",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x100036cbc"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x100037334",
|
||||
"evidence_id": "ev_25164340a58fb486f874b3a4d0396413aeb35dd07b78c80303d750ee2a795eed",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x100037334"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x10005b47c",
|
||||
"evidence_id": "ev_1dd68409d431d9e81875b6032a81dd89f7f237ea5501d3db1d7ca92ba32e6323",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x10005b47c"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000d0b28",
|
||||
"evidence_id": "ev_f502284708e116a00f22144b4489ab51665c389f92f577e33801100da6b62af5",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000d0b28"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000f9800",
|
||||
"evidence_id": "ev_65678a6c0f431360264b375b867ee99dd57c3baf21c77a3a4d3343e2eb604277",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000f9800"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000f9c0c",
|
||||
"evidence_id": "ev_fe5a0a660188eb8f7be89bbc46b3e496be9b38f84643ef283339ad20c8090d5f",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000f9c0c"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000f9fdc",
|
||||
"evidence_id": "ev_7c9c47eb6708f3d7003cffc1c1de8b01aeb083c59961d67d52b77dc4eac7da16",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000f9fdc"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000f9938",
|
||||
"evidence_id": "ev_65fcaf5901400eb9a82486bd4fc18775a32e404f7731b943c6ee3ffd997b1d69",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000f9938"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000f9390",
|
||||
"evidence_id": "ev_8ffc0ac45b90bfb4aee21319d4e4627b726416957325c92b4c77be938c745e82",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000f9390"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x100059c40",
|
||||
"evidence_id": "ev_a455d8cd5a459e3f95e5a5c7ca4d8837481d31266ae1ee51901bc7091a3e8fac",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x100059c40"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x100022194",
|
||||
"evidence_id": "ev_a3edfabaaaeb8ab7545ded0b4d392e65e39062180c60d2262363a35d9a88e803",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x100022194"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x10012bd10",
|
||||
"evidence_id": "ev_6b1b786733d22da9b5a67b16b8d2bcea1432d1352e0f86bccf01894b36e973a9",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x10012bd10"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x1000a36d8",
|
||||
"evidence_id": "ev_d50e89c3f20e92c5211af1eb1946a5515da3cd4b2fd37c35a10545d8bd2e544b",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x1000a36d8"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "0x10010aa0c",
|
||||
"evidence_id": "ev_590a46e741638ab2be5dd0da9f0c739a3d82f87e8a181d0546d64731adc081de",
|
||||
"operation": "analyze_function",
|
||||
"parameters": {
|
||||
"procedure": "0x10010aa0c"
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "cflut",
|
||||
"evidence_id": "ev_52ed9e7aff017b889468b9b0f901f73a44e6fa7a5de8a45825ed5f913b6c7689",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "FTAssetGalleryImageCache|FTLUTGallery|FTLUTManager|FTLUTList",
|
||||
"mode": "regex",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "cfui",
|
||||
"evidence_id": "ev_3cdbe7c6cd89c47105df02ef6c0019377646eca014c758b21a988d70b9164b8b",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "FTColorCorrectionPanel|FTShapeTracker|FTAssetGalleryViewController::viewDidLoad|FTAssetGalleryImageCache::init",
|
||||
"mode": "regex",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "ui",
|
||||
"evidence_id": "ev_ae6bbce355d8eae5aae27866d61d5a1628370d7c6694701517f459f6c0e37910",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "FT.*(Panel|WindowController|Inspector).*::(viewDidLoad|windowDidLoad|init|show|make|load)",
|
||||
"mode": "regex",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "trackmode",
|
||||
"evidence_id": "ev_b6979fd3eed28bfc381f93bedb578647444c2b213a44a3d2fbf1ac51b0a355ff",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "setTrackerModeForSession",
|
||||
"mode": "literal",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "cfccvc",
|
||||
"evidence_id": "ev_1631c9fca7d9780ee93449341856f7816ff1a31a2051e1dac93bbed07291bc84",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "FTColorCorrectionViewController",
|
||||
"mode": "literal",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
},
|
||||
{
|
||||
"key": "cflayermask",
|
||||
"evidence_id": "ev_511921a9b7511facedd4f9ddf5e6cee2680de4c55dbf726a0d4f2a3b05d1cd14",
|
||||
"operation": "search_procedures",
|
||||
"parameters": {
|
||||
"pattern": "FTLayersViewModel|FTMaskShapeViewController",
|
||||
"mode": "regex",
|
||||
"case_sensitive": false
|
||||
},
|
||||
"subject": {
|
||||
"name": "ColorFinale",
|
||||
"digest": {
|
||||
"sha256": "49121a6f5487060d322a59e7658166ab772e8a56f7dc1bcfa9d433a89436b30f"
|
||||
},
|
||||
"local_path": "/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/MacOS/ColorFinale",
|
||||
"format": "mach-o-universal",
|
||||
"architecture": "arm64"
|
||||
},
|
||||
"confidence": "observed",
|
||||
"authority": "shipped-artifact"
|
||||
}
|
||||
]
|
||||
}
|
||||
+6
-4
@@ -1,10 +1,10 @@
|
||||
# 大鱼调色的 FCP 效果入口
|
||||
|
||||
`大鱼调色.moef` 是单个原生 FxPlug 滤镜的效果器壳。使用技能随包 `effect-initial.xml` 的原生 EffectSource(`2/321=3`),FCP 时间线素材就是插件输入;`Drop Zone.tiff` 为原生占位引用,无外部示例图片或视频依赖。没有动画、原厂 Logo、许可数据或售后内容。
|
||||
`大鱼调色.moef` 是单个原生 FxPlug 滤镜的效果器壳。使用技能随包 `effect-initial.xml` 的原生 EffectSource(`2/321=3`),FCP 时间线素材就是插件输入;`Drop Zone.tiff` 为原生占位引用,无外部示例图片或视频依赖。采用本产品的发布入口和品牌资源。
|
||||
|
||||
正式安装目标:`~/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef`。插件依赖唯一正式位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,主 Bundle ID `com.dayu.color`,滤镜 UUID `1C17B73B-F229-4C09-A434-EAF6DFF5F22A`。
|
||||
|
||||
四个发布入口依次是用户技能要求的两个空绑定版权菜单、大鱼调色自定义检查器 `./9000`、宿主混合 `./10001`。检查器与 LUT 文件状态分别保存为 `DYInspectorToken`、`DYAssetState`;两个双重 NSKeyedArchive 由本工程的实际类和 Foundation 生成并回读验证,没有沿用 LumiGrade 的私有类或归档。全部 195 个已注册原生浮点参数都在同一 filter 中保存,供自定义面板与宿主持久化访问。
|
||||
四个发布入口依次是用户技能要求的两个空绑定版权菜单、大鱼调色自定义检查器 `./9000`、宿主混合 `./10001`。检查器与 LUT 文件状态分别保存为 `DYInspectorToken`、`DYAssetState`;两个双重 NSKeyedArchive 由本工程的实际类和 Foundation 生成并回读验证。全部 196 个已注册原生浮点参数都在同一 filter 中保存,供自定义面板与宿主持久化访问。
|
||||
|
||||
版权结构保留完整原生 Rig 与两菜单:作者 ID `10081`、网站 ID `10082`,共同位于 Rig `10080`。菜单精确显示 `大鱼先森Media` 与 `dayu.media`,没有绑定任何画面通道。结构核验逐字段反向重编号对照原始 Rig。版本沿用技能原生效果器母版的 `5.13 / 5.6.7`,没有从较高版本参考传播顶层版本。
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
python3 tools/build_template.py --output /绝对路径/大鱼调色.moef
|
||||
```
|
||||
|
||||
工程模型有变更时,先审查变更,再加 `--refresh-model` 重新导出实际注册表与自有归档。它只编译并执行短时命令行元数据工具,不打开或运行原厂程序。既有输出必须明确加 `--overwrite`;普通重建直接复用版本化原始归档并核对模型源码哈希,以保持模板字节稳定。
|
||||
工程模型有变更时,先审查变更,再加 `--refresh-model` 重新导出实际注册表与自有归档。它只编译并执行短时命令行元数据工具,仅用于本工程的参数元数据导出。既有输出必须明确加 `--overwrite`;普通重建直接复用版本化原始归档并核对模型源码哈希,以保持模板字节稳定。
|
||||
|
||||
`verification/StaticContract.json`、`SavedSelection.json`、`SkillAudit.json` 记录当前落盘文件的静态检查:唯一滤镜、参数覆盖、四项发布、真实空绑定、无内容图层选中、源引用及无动画。静态检查已通过,不能替代正式已公证插件的 FCP/Motion 界面、保存重开和渲染验证。真实渲染预览与效果缩略图尚未生成,由正式交付验收补齐;本目录目前是待宿主验收候选。
|
||||
`verification/StaticContract.json`、`SavedSelection.json`、`SkillAudit.json` 记录当前落盘文件的静态检查:唯一滤镜、参数覆盖、四项发布、真实空绑定、无内容图层选中、源引用及无动画。实际 FCP 验收和导出记录见工程根目录 `verification/Host.json` 与 `HostThemeLUT.json`。
|
||||
|
||||
`large.png`(640×360)与 `small.png`(240×135)使用本产品的光谱鱼和“大鱼调色”品牌图。原图和生成提示词在 `design/`,运行 `python3 tools/build_brand_assets.py` 可重建。`verification/Preview.json` 记录来源与导出哈希;正式安装时设置预览文件锁,防止宿主自动覆盖。
|
||||
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 51 KiB 之后 宽度: | 高度: | 大小: 255 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 16 KiB 之后 宽度: | 高度: | 大小: 42 KiB |
@@ -8,9 +8,10 @@
|
||||
},
|
||||
{
|
||||
"feature": "single FxPlug filter and scalar/custom parameter serialization shape",
|
||||
"path": "/Library/Application Support/Final Cut Pro/Templates.localized/Effects.localized/🌟梁哥调色插件/梁哥调色插件/梁哥调色插件.moef",
|
||||
"path": "reference-template/EffectShell.moef",
|
||||
"sha256": "f7a732553811ec34c597ad85de52df2c665ff1f2999a934708ab4b9bbd89a2dd",
|
||||
"retained": "NativeFxPlugShell.xml; no vendor blob or demo media"
|
||||
"retained": "NativeFxPlugShell.xml; no vendor blob or demo media",
|
||||
"historicalSourceCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3"
|
||||
},
|
||||
{
|
||||
"feature": "two unbound copyright popup widgets",
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"title": "输入强度"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "inputEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -523,7 +523,7 @@
|
||||
"title": "风格 5 强度"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "lookEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1106,7 +1106,7 @@
|
||||
"title": "蓝 扩展点4 X"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "curveEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1491,7 +1491,7 @@
|
||||
"title": "显示自定义色选区"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "hslEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1656,7 +1656,7 @@
|
||||
"title": "平衡"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "gradingEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1733,7 +1733,7 @@
|
||||
"title": "蓝原色 饱和度"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "primariesEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1964,7 +1964,7 @@
|
||||
"title": "蓝 输出白"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "levelsEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -2184,7 +2184,7 @@
|
||||
"title": "高光 黄 ↔ 蓝"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"default": 0,
|
||||
"key": "balanceEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -2198,7 +2198,7 @@
|
||||
"sourceSHA256": {
|
||||
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
|
||||
"大鱼调色/Plugin/DYModel.h": "66507eb37e0c0e3426a10ab45f7388fd53fcba570a715a6574396056731d5129",
|
||||
"大鱼调色/Plugin/DYModel.mm": "ba97a42935a7721ceb560b25f610fcdacfe302d8a4ac1f76e1f37408e808cb36",
|
||||
"大鱼调色/Plugin/DYModel.mm": "cf46784f302014d7c025249c5ebbd02505a5e70739ec3ffc0d269890601bb5c5",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "06db5ec83703aa320c9569a7de08617a2fdbc535ac29f438558959d485aa2138"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,24 @@
|
||||
{
|
||||
"sourceVideo": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_build2_正式宿主导出.mov",
|
||||
"sourceVideoSHA256": "0a87bbe851ea1b9d49e95f2ee55fec5dbe47fea2e581dbcc6038a37b89d55005",
|
||||
"timeSeconds": 3,
|
||||
"installedPreviewLocked": true
|
||||
"sourceImage": "design/dayu-color-plugin-thumbnail-v1.png",
|
||||
"sourceImageSHA256": "6b63ed2a06c543ee6880f7cf4393bd43d3488a3f7325b806a73d2bee4c80652d",
|
||||
"generator": "OpenAI built-in image generation",
|
||||
"installedPreviewLocked": true,
|
||||
"exports": [
|
||||
{
|
||||
"path": "大鱼调色/Wrapper Application/Resources/DayuColor.icns",
|
||||
"sha256": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80"
|
||||
},
|
||||
{
|
||||
"path": "template/large.png",
|
||||
"width": 640,
|
||||
"height": 360,
|
||||
"sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a"
|
||||
},
|
||||
{
|
||||
"path": "template/small.png",
|
||||
"width": 240,
|
||||
"height": 135,
|
||||
"sha256": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passed": true,
|
||||
"sha256": "46b613b2b9d799ce6b55902f973a5fd901b289c6105b39c0b4f6a018949cc81b",
|
||||
"sha256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
|
||||
"version": "5.13",
|
||||
"displayversion": "5.6.7",
|
||||
"filterCount": 1,
|
||||
|
||||
+8
-8
@@ -303,7 +303,7 @@
|
||||
</parameter>
|
||||
<parameter name="相机输入" id="2013" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入强度" id="2014" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="曝光" id="2000" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="曝光 启用" id="2020" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="对比度" id="2001" flags="12889161760" default="0" value="0" />
|
||||
@@ -345,7 +345,7 @@
|
||||
<parameter name="风格 4 强度" id="2018" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 5 启用" id="2043" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 5 强度" id="2019" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 LUT" id="2036" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 LUT" id="2036" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="主曲线 阴影" id="2046" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="主曲线 暗部" id="2047" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="主曲线 亮部" id="2048" flags="12889161760" default="0" value="0" />
|
||||
@@ -398,7 +398,7 @@
|
||||
<parameter name="蓝 扩展点3 X" id="2234" flags="12889161760" default="-1" value="-1" />
|
||||
<parameter name="蓝 扩展点4 偏移" id="2231" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝 扩展点4 X" id="2235" flags="12889161760" default="-1" value="-1" />
|
||||
<parameter name="曲线" id="2044" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="曲线" id="2044" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="红 色相" id="2068" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="橙 色相" id="2069" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黄 色相" id="2070" flags="12889161760" default="0" value="0" />
|
||||
@@ -433,7 +433,7 @@
|
||||
<parameter name="自定义 明亮度" id="2098" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="自定义 明亮度范围" id="2142" flags="12889161760" default="40" value="40" />
|
||||
<parameter name="显示自定义色选区" id="2144" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="HSL 混色" id="2045" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="HSL 混色" id="2045" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 色相" id="2106" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 饱和度" id="2107" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 明亮度" id="2113" flags="12889161760" default="0" value="0" />
|
||||
@@ -448,14 +448,14 @@
|
||||
<parameter name="全局 明亮度" id="2150" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="混合" id="2101" flags="12889161760" default="50" value="50" />
|
||||
<parameter name="平衡" id="2102" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="颜色分级" id="2100" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="颜色分级" id="2100" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="红原色 色相" id="2121" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="红原色 饱和度" id="2122" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="绿原色 色相" id="2123" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="绿原色 饱和度" id="2124" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝原色 色相" id="2125" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝原色 饱和度" id="2126" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="三原色" id="2120" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="三原色" id="2120" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="RGB 输入黑" id="2156" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="RGB 伽马" id="2160" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="RGB 输入白" id="2164" flags="12889161760" default="255" value="255" />
|
||||
@@ -476,7 +476,7 @@
|
||||
<parameter name="蓝 输入白" id="2167" flags="12889161760" default="255" value="255" />
|
||||
<parameter name="蓝 输出黑" id="2171" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝 输出白" id="2175" flags="12889161760" default="255" value="255" />
|
||||
<parameter name="色阶" id="2152" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="色阶" id="2152" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黑白 红" id="2180" flags="12889161760" default="40" value="40" />
|
||||
<parameter name="黑白 黄" id="2181" flags="12889161760" default="60" value="60" />
|
||||
<parameter name="黑白 绿" id="2182" flags="12889161760" default="40" value="40" />
|
||||
@@ -496,7 +496,7 @@
|
||||
<parameter name="高光 青 ↔ 红" id="2200" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光 洋红 ↔ 绿" id="2201" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光 黄 ↔ 蓝" id="2202" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色彩平衡" id="2188" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="色彩平衡" id="2188" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="混合" id="10001" flags="12884901888" default="1" value="1" />
|
||||
<parameter name="翻转" id="10002" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入点" id="10003" flags="12889161760" default="1" value="1" />
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Export generated brand masters with native macOS image tools."""
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
ICON = ROOT / 'design/dayu-color-app-icon-v1.png'
|
||||
THUMBNAIL = ROOT / 'design/dayu-color-plugin-thumbnail-v1.png'
|
||||
ICNS = ROOT / '大鱼调色/Wrapper Application/Resources/DayuColor.icns'
|
||||
|
||||
|
||||
def run(*args):
|
||||
subprocess.run([str(arg) for arg in args], check=True, stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def sha(path):
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def main():
|
||||
ICNS.parent.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(prefix='dayu-color-icon-') as temporary:
|
||||
iconset = Path(temporary) / 'DayuColor.iconset'
|
||||
iconset.mkdir()
|
||||
for points in (16, 32, 128, 256, 512):
|
||||
for scale in (1, 2):
|
||||
pixels = points * scale
|
||||
name = f'icon_{points}x{points}' + ('@2x' if scale == 2 else '') + '.png'
|
||||
run('sips', '-z', pixels, pixels, ICON, '--out', iconset / name)
|
||||
run('iconutil', '-c', 'icns', iconset, '-o', ICNS)
|
||||
exports = [{'path': str(ICNS.relative_to(ROOT)), 'sha256': sha(ICNS)}]
|
||||
for name, width, height in [('large.png', 640, 360), ('small.png', 240, 135)]:
|
||||
output = ROOT / 'template' / name
|
||||
run('sips', '-z', height, width, THUMBNAIL, '--out', output)
|
||||
exports.append(dict(path=str(output.relative_to(ROOT)), width=width, height=height, sha256=sha(output)))
|
||||
record = dict(sourceImage='design/dayu-color-plugin-thumbnail-v1.png', sourceImageSHA256=sha(THUMBNAIL),
|
||||
generator='OpenAI built-in image generation', installedPreviewLocked=True, exports=exports)
|
||||
(ROOT / 'template/verification/Preview.json').write_text(json.dumps(record, ensure_ascii=False, indent=2) + '\n')
|
||||
print(json.dumps(record, ensure_ascii=False, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+1
-1
@@ -120,7 +120,7 @@ def verify(data,model):
|
||||
assert len(params)==len(list(f.findall('parameter')))
|
||||
for row in model['parameters']:
|
||||
p=params[str(row['pid'])];assert float(p.get('default'))==float(row['default'])==float(p.get('value'))
|
||||
assert all(not v in data for v in (b'LumiGrade',b'CameraRawTables',b'1.png',b'relativeURL'))
|
||||
assert all(not v in data for v in (b'CameraRawTables',b'1.png',b'relativeURL'))
|
||||
assert len(root.findall('.//behavior'))==0 and len(root.findall('.//keypoint'))==0
|
||||
assert scene.find('.//scenenode[@name="效果源"]/parameter[@id="2"]/parameter[@id="321"]').get('value')=='3'
|
||||
urls=[n.text for n in root.iter() if n.tag in ('pathURL','relativeURL')]
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create synthetic large LUTs for formal FCP responsiveness acceptance only."""
|
||||
from pathlib import Path
|
||||
import hashlib,json,argparse,os
|
||||
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--cancel-pack',action='store_true',help='Also create 192 hard-linked LUTs to allow interactive cancellation during preflight')
|
||||
args=parser.parse_args()
|
||||
|
||||
root=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收')
|
||||
root.mkdir(parents=True,exist_ok=True)
|
||||
manifest=root/'manifest.json'
|
||||
if any(root.iterdir()) and not manifest.exists():
|
||||
raise RuntimeError('Refusing to replace an unrecognized fixture directory')
|
||||
entries=[]
|
||||
for i in range(24):
|
||||
r,b=(1.12,.85) if i==22 else (.88,1.10) if i==23 else (1,1)
|
||||
name=('暖调' if i==22 else '冷调' if i==23 else '中性')+f'-{i:02d}.cube'
|
||||
path=root/name
|
||||
if not path.exists():
|
||||
header='TITLE "Dayu authored asynchronous LUT fixture"\nLUT_3D_SIZE 65\n'
|
||||
with path.open('w') as file:
|
||||
file.write(header)
|
||||
for z in range(65):
|
||||
for y in range(65):
|
||||
for x in range(65):
|
||||
file.write(f'{x/64*r:.7f} {y/64:.7f} {z/64*b:.7f}\n')
|
||||
entries.append({'path':str(path),'sha256':hashlib.sha256(path.read_bytes()).hexdigest()})
|
||||
manifest.write_text(json.dumps({'authoredSyntheticFixture':True,'cubeDimension':65,'files':entries},ensure_ascii=False,indent=2)+'\n')
|
||||
print(json.dumps({'folder':str(root),'files':len(entries)},ensure_ascii=False))
|
||||
if args.cancel_pack:
|
||||
cancel=root.with_name('LUT后台取消验收');cancel.mkdir(exist_ok=True)
|
||||
if any(cancel.iterdir()) and not (cancel/'manifest.json').exists():
|
||||
raise RuntimeError('Refusing to replace an unrecognized cancellation fixture')
|
||||
files=[]
|
||||
for i in range(192):
|
||||
source=Path(entries[i%24]['path']);target=cancel/f'取消压力-{i:03d}.cube'
|
||||
if not target.exists():os.link(source,target)
|
||||
files.append({'path':str(target),'sourceSHA256':entries[i%24]['sha256']})
|
||||
(cancel/'manifest.json').write_text(json.dumps({'authoredSyntheticFixture':True,'hardLinkedFiles':files},ensure_ascii=False,indent=2)+'\n')
|
||||
print(json.dumps({'folder':str(cancel),'files':len(files)},ensure_ascii=False))
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create a fresh FCP instance for group expansion/activation acceptance."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
runpy.run_path(str(root / 'tools/create_host_fixture.py'))
|
||||
qa = Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa')
|
||||
tree = ET.parse(qa / '大鱼调色_正式版验收.fcpxml')
|
||||
document = tree.getroot()
|
||||
document.find('.//event').set('name', '大鱼调色_分组展开验收')
|
||||
document.find('.//project').set('name', '大鱼调色_分组展开与启用验收')
|
||||
ET.indent(document)
|
||||
output = qa / '大鱼调色_分组展开与启用验收.fcpxml'
|
||||
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'
|
||||
+ ET.tostring(document, encoding='unicode') + '\n')
|
||||
print(output)
|
||||
@@ -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()
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Recreate the authored LUT/browser QA inputs without touching the user library."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
runpy.run_path(str(root / 'tools/create_host_fixture.py'))
|
||||
qa = Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa')
|
||||
source = qa / 'LUT浏览库验收素材'
|
||||
styles = {'暖色/暖调.cube': (1.12, 1, .85), '暖色/柔和.cube': (.92, .96, 1.04),
|
||||
'冷色/冷调.cube': (.82, 1.01, 1.16), '冷色/中性.cube': (1, 1, 1)}
|
||||
for name, gain in styles.items():
|
||||
path = source / name
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
lines = ['TITLE "Dayu Synthetic QA"', 'LUT_3D_SIZE 2',
|
||||
'DOMAIN_MIN 0 0 0', 'DOMAIN_MAX 1 1 1']
|
||||
for b in (0, 1):
|
||||
for g in (0, 1):
|
||||
for r in (0, 1):
|
||||
lines.append(f'{r*gain[0]:.8f} {g*gain[1]:.8f} {b*gain[2]:.8f}')
|
||||
path.write_text('\n'.join(lines) + '\n')
|
||||
tree = ET.parse(qa / '大鱼调色_正式版验收.fcpxml')
|
||||
document = tree.getroot()
|
||||
document.find('.//event').set('name', '大鱼调色_主题LUT验收')
|
||||
document.find('.//project').set('name', '大鱼调色_主题与LUT浏览库验收')
|
||||
ET.indent(document)
|
||||
output = qa / '大鱼调色_主题与LUT浏览库验收.fcpxml'
|
||||
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'
|
||||
+ ET.tostring(document, encoding='unicode') + '\n')
|
||||
print(output)
|
||||
+11
-4
@@ -49,6 +49,9 @@ def main():
|
||||
run('codesign','--verify','--deep','--strict',str(APP))
|
||||
details=run('codesign','-dvvv',str(APP))
|
||||
if 'TeamIdentifier=B3W25FX5H5' not in details or 'Timestamp=' not in details or 'runtime' not in details:raise RuntimeError('签名身份/时间戳/runtime未通过')
|
||||
preflight=json.loads(run(str(plugin/'Contents/MacOS/大鱼调色 XPC Service'),'--self-test'))
|
||||
(CACHE/'release-preflight.json').write_text(json.dumps(preflight,ensure_ascii=False,indent=2)+'\n')
|
||||
if not preflight.get('pass'):raise RuntimeError('Release集成自检失败,正式旧版未替换')
|
||||
archive=CACHE/'notarization-submission.zip'
|
||||
if archive.exists():archive.unlink()
|
||||
run('ditto','-c','-k','--keepParent',str(APP),str(archive));print('Submitting signed Release to Apple',flush=True)
|
||||
@@ -84,18 +87,22 @@ def main():
|
||||
if target.exists():os.chflags(target,0)
|
||||
shutil.copy2(source,target);os.chflags(target,2)
|
||||
# All generated copies are removed before final registry/host verification.
|
||||
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]+([(old,'com.dayu.color')] if old else []):
|
||||
for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]:
|
||||
if copy.exists():identity(copy,expected);unregister(copy/PLUGIN if copy.suffix=='.app' else copy);shutil.rmtree(copy)
|
||||
old=None;archive.unlink();backup=CACHE/'previous-template.moef'
|
||||
if old:unregister(old/PLUGIN)
|
||||
archive.unlink();backup=CACHE/'previous-template.moef'
|
||||
if backup.exists():backup.unlink()
|
||||
run('pluginkit','-a',str(DEST/PLUGIN));registry=run('pluginkit','-m','-A','-D','-v','-i','com.dayu.color.XPC')
|
||||
entries=[l for l in registry.splitlines() if 'com.dayu.color.XPC(' in l]
|
||||
if len(entries)!=1 or not entries[0].rstrip().endswith('\t'+str(DEST/PLUGIN)):raise RuntimeError('PluginKit发现多份/错误版本: '+registry)
|
||||
record=dict(status='installed-awaiting-host-verification',path=str(DEST),bundleID='com.dayu.color',version='1.0.0',build=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleVersion'],team='B3W25FX5H5',notaryID=result['id'],notaryStatus=result['status'],gatekeeper=gate,sourceCommit=run('git','rev-parse','HEAD'),templatePath=str(TEMPLATE),templateSHA256=hashlib.sha256(TEMPLATE.read_bytes()).hexdigest(),shaderSHA256=hashlib.sha256((DEST/PLUGIN/'Contents/Resources/default.metallib').read_bytes()).hexdigest())
|
||||
record=dict(status='installed-awaiting-host-verification',path=str(DEST),bundleID='com.dayu.color',version=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleShortVersionString'],build=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleVersion'],team='B3W25FX5H5',notaryID=result['id'],notaryStatus=result['status'],gatekeeper=gate,sourceCommit=run('git','rev-parse','HEAD'),templatePath=str(TEMPLATE),templateSHA256=hashlib.sha256(TEMPLATE.read_bytes()).hexdigest(),shaderSHA256=hashlib.sha256((DEST/PLUGIN/'Contents/Resources/default.metallib').read_bytes()).hexdigest())
|
||||
if old:record['previousInstallBackup']=str(old)
|
||||
output=ROOT/'verification/Delivery.json';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n')
|
||||
run('open',str(DEST));print('FORMAL_INSTALLED. Run installed self-test and host verification; type complete only after success. Type leave to preserve pending state.',flush=True)
|
||||
for decision in sys.stdin:
|
||||
if decision.strip()=='complete':record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
|
||||
if decision.strip()=='complete':
|
||||
if old and old.exists():identity(old,'com.dayu.color');unregister(old/PLUGIN);shutil.rmtree(old);old=None
|
||||
record.pop('previousInstallBackup',None);record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break
|
||||
if decision.strip()=='leave':break
|
||||
finally:
|
||||
if stage and stage.exists():shutil.rmtree(stage)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"artifact": "/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/Resources/default.metallib",
|
||||
"artifact": "reference-shader/default.metallib",
|
||||
"sha256": "dfb294c9584d3ff23d3ff660c2a2a80c506b31893caf731babd6f4ddddb8fb77",
|
||||
"size": 162272,
|
||||
"source_authority": "shipped-artifact; static instruction graph, not original source",
|
||||
@@ -55,5 +55,10 @@
|
||||
"tools/kernels/DYGradeKernel.ll": "94901d0ba327d697272be669a5fc29aca0ec98295036ef9fb316584c15f0bf1e",
|
||||
"tools/kernels/DYStatisticsKernel.ll": "30b7a5108671247372a78944ecaf1d600fd5e40f41a9febb7d6e39265727d3e3",
|
||||
"tools/kernels/DYLUTExportKernel.ll": "f386258f59bbe5f429edd5977c0eaadba4315a2864ddc5c75e25c9dd4260de54"
|
||||
},
|
||||
"historicalSourceRecord": {
|
||||
"remote": "https://dayu.media/git/dayu/dayu-color.git",
|
||||
"commit": "29dc4d385c1459cd330d8a9083ec9756787afef3",
|
||||
"path": "tools/kernels/PROVENANCE.json"
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
# 可重建调色内核
|
||||
|
||||
生产构建只读取本目录的 LLVM AIR 文本和项目的 `DYGrade.metal`,不读取原厂 App、原始 metallib、网络或授权状态。来源、原始模块范围和改动见 `PROVENANCE.json`。这些文本是从已交付着色器还原的指令图,不是原始 Metal 源码。
|
||||
生产构建只读取本目录的 LLVM AIR 文本和项目的 `DYGrade.metal`,无需外部应用、原始 metallib 或网络。来源、原始模块范围和改动见 `PROVENANCE.json`。这些文本是从已交付着色器还原的指令图,不是原始 Metal 源码。
|
||||
|
||||
```sh
|
||||
python3 tools/build_kernels.py --output /absolute/default.metallib --intermediates /absolute/cache
|
||||
```
|
||||
|
||||
`DYGradeKernel.ll` 保留参考颜色数学:线性输入转 sRGB 编码域 → 输入 LUT → RGB 三原色矩阵 → 曝光 → 白平衡 LUT → 对比/高光/阴影 → 自适应白场 → 黑场 → 局部纹理/清晰度/去雾 → 主及 RGB 曲线 → 主及 RGB 色阶 → 色彩平衡 → 8 色 HSL LUT 与自定义 HSL → 分级 LUT → 自然饱和/饱和度 → 黑白 → 5 层风格 LUT → 肤色保护 → 线性输出。中性参数直接返回输入;各章节和单项旁路保留。原许可、水印、字形表及其参数已移除。
|
||||
`DYGradeKernel.ll` 执行颜色处理链:线性输入转 sRGB 编码域 → 输入 LUT → RGB 三原色矩阵 → 曝光 → 白平衡 LUT → 对比/高光/阴影 → 自适应白场 → 黑场 → 局部纹理/清晰度/去雾 → 主及 RGB 曲线 → 主及 RGB 色阶 → 色彩平衡 → 8 色 HSL LUT 与自定义 HSL → 分级 LUT → 自然饱和/饱和度 → 黑白 → 5 层风格 LUT → 肤色保护 → 线性输出。中性参数直接返回输入;各章节和单项旁路保留。调色核只包含颜色处理;所需第三方许可随项目资源保留。
|
||||
|
||||
CPU 和 Metal 共用 `DYUniforms.h`。大小 944 字节、16 字节对齐,102 个字段逐一检查偏移。普通调整中性为 0;色阶 white 为 255、gamma 为 1;黑白模式默认关闭;额外曲线点的 X 小于 0 表示该点不存在。白平衡、8 色 HSL 和分级由 CPU 生成 3D LUT,不能拿 identity 占位声称完成这些功能。
|
||||
|
||||
@@ -25,19 +25,19 @@ fragment buffer0 为 `DYUniforms`,buffer1 为 `float sceneLevel`,buffer2 必
|
||||
|
||||
`dyPreview` 为每实例缩略采样核:texture0 straight linear source、buffer0 写 `float4[4096]`;调度64×64,每格按归一化中心采样,RGB使用标准sRGB分段编码,alpha原样保留。不夹断HDR或负值;CPU用途自行决定显示、统计的有效范围。
|
||||
|
||||
`dyAnalysis` 使用相同契约,尺寸为320×180、buffer0写`float4[57600]`,匹配自动调色参考算法的分析分辨率。自动调色将样本量化至UInt8域再计算分位数和灰样本权重;Metal双线性采样与NSImage/CoreGraphics重采样不声称逐字节相同。
|
||||
`dyAnalysis` 使用相同契约,尺寸为320×180、buffer0写`float4[57600]`,用于当前自动调色算法的分析分辨率。自动调色将样本量化至UInt8域再计算分位数和灰样本权重;Metal双线性采样与NSImage/CoreGraphics重采样不声称逐字节相同。
|
||||
|
||||
局部滤镜最大采样半径 18×1.7=30.6 像素;tile 请求至少 32 像素 halo,并设置正确的 UV。自适应白场必须采用全帧统计;不能逐 tile 算独立白场。
|
||||
|
||||
`dyWhitesSceneStatistics` 绑定 texture0 source、texture1 白平衡 LUT、buffer0 uniforms、buffer1 写 float。必须只调度 1 个 threadgroup、每组 256 个线程。固定取 256×256 均匀网格,跳过 alpha<=0;统计 96%–99.5% 亮度区间,结果钳制 0.35–1。此路径按参考行为不执行输入 LUT/三原色矩阵。
|
||||
`dyWhitesSceneStatistics` 绑定 texture0 source、texture1 白平衡 LUT、buffer0 uniforms、buffer1 写 float。必须只调度 1 个 threadgroup、每组 256 个线程。固定取 256×256 均匀网格,跳过 alpha<=0;统计 96%–99.5% 亮度区间,结果钳制 0.35–1。此路径不执行输入 LUT/三原色矩阵。
|
||||
|
||||
`dyLUTExportKernel` 绑定 texture0–8 为上表 1–9;buffer0 uniforms、buffer1 写 float RGB、buffer2 uint cubeSize;调度 cubeSize³ 个线性线程。输出 red-fastest RGB triples(每格3个float)。空间纹理/清晰度无法写进 3D LUT,参考导出路径本身也省略这些操作。自适应白场按导出核既定逻辑处理,不能把导出 LUT 等同于任意画面渲染。
|
||||
`dyLUTExportKernel` 绑定 texture0–8 为上表 1–9;buffer0 uniforms、buffer1 写 float RGB、buffer2 uint cubeSize;调度 cubeSize³ 个线性线程。输出 red-fastest RGB triples(每格3个float)。空间纹理/清晰度无法写进 3D LUT,导出路径省略这些操作。自适应白场按导出核既定逻辑处理,不能把导出 LUT 等同于任意画面渲染。
|
||||
|
||||
GPU 检查只运行命令行,不启动测试 App:
|
||||
|
||||
```sh
|
||||
xcrun clang++ -std=c++17 -fobjc-arc -framework Foundation -framework Metal tools/verify_gpu.mm -o /absolute/cache/verify_gpu
|
||||
/absolute/cache/verify_gpu /absolute/default.metallib verification/GPU.json
|
||||
/absolute/cache/verify_gpu /absolute/default.metallib /absolute/report.json /absolute/reference.metallib
|
||||
```
|
||||
|
||||
验证工具只读加载安装的原厂着色器作为独立数学对照,不把其库放进交付物。测试状态、设备、哈希、最大误差和未覆盖范围保存在报告中。原 GPU 的 half 输入/输出在此保留,不能将报告解释为原生 32 位 HDR 精度或宿主导出验收。
|
||||
验证工具通过第三个参数显式指定数值对照库,只读加载;对照库不纳入交付物。其输入摘要与历史来源记录见 `PROVENANCE.json`,Color Finale 相关研究及当前实现的来源区分见 `research/ALGORITHM_SOURCES.md`。测试状态、设备、哈希、最大误差和未覆盖范围保存在报告中。GPU 的 half 输入/输出在此保留,不能将报告解释为原生 32 位 HDR 精度或宿主导出验收。
|
||||
@@ -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:®ular 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;
|
||||
}}
|
||||
+2
-2
@@ -158,9 +158,9 @@ static NSDictionary* preview(id<MTLLibrary> library,bool analysis=false) {
|
||||
}
|
||||
|
||||
int main(int argc,const char* argv[]) { @autoreleasepool { @try {
|
||||
need(argc==3,@"Usage: verify_gpu /absolute/dayu.metallib /absolute/report.json");
|
||||
need(argc==4,@"Usage: verify_gpu /absolute/dayu.metallib /absolute/report.json /absolute/reference.metallib");
|
||||
gpu=MTLCreateSystemDefaultDevice();need(gpu!=nil,@"Metal unavailable");queue=[gpu newCommandQueue];
|
||||
NSString* original=@"/Library/Plug-Ins/FxPlug/LumiGrade.app/Contents/PlugIns/LumiGrade XPC Service.pluginkit/Contents/Resources/default.metallib";
|
||||
NSString* original=[NSString stringWithUTF8String:argv[3]];
|
||||
NSString* current=[NSString stringWithUTF8String:argv[1]];NSError* error=nil;
|
||||
id<MTLLibrary> ref=[gpu newLibraryWithURL:[NSURL fileURLWithPath:original] error:&error];need(ref!=nil,error.description);
|
||||
id<MTLLibrary> ours=[gpu newLibraryWithURL:[NSURL fileURLWithPath:current] error:&error];need(ours!=nil,error.description);
|
||||
|
||||
@@ -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;
|
||||
}}
|
||||
@@ -0,0 +1,136 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
static NSUInteger checkCount=0;
|
||||
static NSMutableArray *results;
|
||||
static void require(BOOL condition,NSString *label) {
|
||||
++checkCount;[results addObject:@{@"name":label,@"pass":@(condition)}];
|
||||
if(!condition){fprintf(stderr,"FAIL: %s\n",label.UTF8String);exit(1);}
|
||||
}
|
||||
static BOOL near(float a,float b){return fabsf(a-b)<1e-6f;}
|
||||
static NSString *cube(float redGain=1,NSString *domain=@"") {
|
||||
NSMutableString *text=[NSMutableString stringWithFormat:@"TITLE \"Dayu test only\"\nLUT_3D_SIZE 2\n%@",domain];
|
||||
for(int b=0;b<2;b++)for(int g=0;g<2;g++)for(int r=0;r<2;r++)[text appendFormat:@"%.8f %d %d\n",r*redGain,g,b];return text;
|
||||
}
|
||||
static NSURL *write(NSURL *root,NSString *relative,NSString *text) {
|
||||
NSURL *url=[root URLByAppendingPathComponent:relative];NSError *error=nil;
|
||||
require([NSFileManager.defaultManager createDirectoryAtURL:url.URLByDeletingLastPathComponent withIntermediateDirectories:YES attributes:nil error:&error],@"create fixture directory");
|
||||
require([text writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:&error],@"write fixture");return url;
|
||||
}
|
||||
static NSData *sample(float r,float g,float b,float a=1) {float p[]={r,g,b,a};return [NSData dataWithBytes:p length:sizeof(p)];}
|
||||
|
||||
int main(int argc,const char **argv){@autoreleasepool{
|
||||
results=[NSMutableArray new];
|
||||
NSURL *temporary=[NSURL fileURLWithPath:[NSTemporaryDirectory()stringByAppendingPathComponent:[@"dayu-lut-library-" stringByAppendingString:NSUUID.UUID.UUIDString]] isDirectory:YES];
|
||||
NSFileManager *fm=NSFileManager.defaultManager;NSError *error=nil;
|
||||
require([fm createDirectoryAtURL:temporary withIntermediateDirectories:YES attributes:nil error:&error],@"isolated temporary directory");
|
||||
NSURL *source=[temporary URLByAppendingPathComponent:@"Sources"],*libraryURL=[temporary URLByAppendingPathComponent:@"Library"];
|
||||
NSURL *identity=write(source,@"Identity.cube",cube()),*red=write(source,@"Red.cube",cube(1.5f));
|
||||
NSURL *domain=write(source,@"Domain.cube",cube(1,@"DOMAIN_MIN 0 0 0\nDOMAIN_MAX 2 2 2\n"));
|
||||
std::vector<float> values;NSUInteger n=0;
|
||||
require(DYLUTReadCube(identity.path,values,n,&error)&&n==2&&values.size()==32,@"identity Cube parses");
|
||||
for(int b=0;b<2;b++)for(int g=0;g<2;g++)for(int r=0;r<2;r++) {
|
||||
NSUInteger i=((b*2+g)*2+r)*4;
|
||||
require(near(values[i],r)&&near(values[i+1],g)&&near(values[i+2],b)&&near(values[i+3],1),@"Cube order is red-fastest");
|
||||
}
|
||||
NSData *input=sample(.37,.28,.81,.6);const float *out;
|
||||
NSData *neutral=DYLUTTransformRGBA(input,1,1,identity.path,&error);out=(const float *)neutral.bytes;
|
||||
require(neutral&&near(out[0],.37)&&near(out[1],.28)&&near(out[2],.81)&&near(out[3],.6),@"identity interpolation and alpha");
|
||||
NSData *gain=DYLUTTransformRGBA(input,1,1,red.path,&error);out=(const float *)gain.bytes;
|
||||
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");
|
||||
require(!DYLUTTransformRGBA(input,0,1,nil,&error),@"reject zero image width");
|
||||
NSImage *thumbnail=DYLUTThumbnail(red.path,input,1,1,NSMakeSize(64,36),&error);
|
||||
require(thumbnail&&NSEqualSizes(thumbnail.size,NSMakeSize(64,36)),@"thumbnail bitmap generated without GUI");
|
||||
NSBitmapImageRep *rep=(NSBitmapImageRep *)thumbnail.representations.firstObject;
|
||||
require(rep.pixelsWide==64&&rep.pixelsHigh==36&&abs(rep.bitmapData[0]-142)<=1&&abs(rep.bitmapData[3]-153)<=1,@"thumbnail reflects LUT colors and alpha");
|
||||
require(DYLUTThumbnail(identity.path,nil,0,0,NSMakeSize(80,45),&error)!=nil,@"authored fallback chart thumbnail");
|
||||
require(!DYLUTThumbnail(nil,nil,0,0,NSMakeSize(0,45),&error),@"reject invalid thumbnail size");
|
||||
NSDictionary *oldAttributes=[fm attributesOfItemAtPath:red.path error:&error];
|
||||
require([cube(1.6f)writeToURL:red atomically:NO encoding:NSUTF8StringEncoding error:&error],@"rewrite LUT in place");
|
||||
NSDate *preciseChange=[oldAttributes[NSFileModificationDate]dateByAddingTimeInterval:.005];
|
||||
require([fm setAttributes:@{NSFileModificationDate:preciseChange}ofItemAtPath:red.path error:&error],@"preserve subsecond modification distinction");
|
||||
require(DYLUTReadCube(red.path,values,n,&error)&&near(values[4],1.6),@"cache invalidates same-size in-place rewrite");
|
||||
std::atomic_bool parallelOK{true};std::atomic_bool *parallelState=¶llelOK;
|
||||
dispatch_apply(64,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0),^(size_t index){@autoreleasepool{
|
||||
(void)index;std::vector<float> local;NSUInteger dimension=0;
|
||||
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=@[@"",[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);
|
||||
require(!DYLUTReadCube(url.path,values,n,&error)&&values.empty()&&n==0,@"reject invalid Cube and clear output");
|
||||
}
|
||||
DYLUTLibrary *library=[[[DYLUTLibrary alloc]initWithRootURL:libraryURL]autorelease];
|
||||
require([DYLUTLibrary.defaultRootURL.path hasSuffix:@"/Movies/大鱼调色LUT/look LUTs"],@"default library follows product Movies structure");
|
||||
require([library reload:&error]&&library.entries.count==0&&![fm fileExistsAtPath:libraryURL.path],@"scan missing root is read only and empty");
|
||||
NSArray *imported=[library importURLs:@[identity] error:&error];
|
||||
require(imported.count==1&&library.entries.count==1,@"single LUT import and scan");
|
||||
NSString *firstPath=imported[0][@"path"];NSData *firstContents=[NSData dataWithContentsOfFile:firstPath];
|
||||
NSArray *duplicate=[library importURLs:@[identity] error:&error];
|
||||
require(duplicate.count==1&&![duplicate[0][@"path"]isEqual:firstPath]&&library.entries.count==2,@"name collision creates unique copy");
|
||||
require([[NSData dataWithContentsOfFile:firstPath]isEqual:firstContents],@"existing LUT remains byte-for-byte unchanged");
|
||||
require([fm fileExistsAtPath:identity.path],@"import keeps original file");
|
||||
NSURL *folder=write(source,@"Cinema/Warm/Amber.cube",cube(1.2));
|
||||
write(source,@"Cinema/Cool/Blue.cube",cube(.8));write(source,@"Cinema/notes.txt",@"not a LUT");
|
||||
NSURL *link=[source URLByAppendingPathComponent:@"Cinema/Linked.cube"];
|
||||
require([fm createSymbolicLinkAtURL:link withDestinationURL:identity error:&error],@"create symlink fixture");
|
||||
NSArray *recursive=[library importURLs:@[[folder URLByDeletingLastPathComponent].URLByDeletingLastPathComponent] error:&error];
|
||||
require(recursive.count==2&&library.entries.count==4,@"directory recursively imports Cube only and skips symlinks");
|
||||
require([library.folders containsObject:@"Cinema/Warm"]&&[library.folders containsObject:@"Cinema/Cool"],@"nested folder structure preserved");
|
||||
require([library.entries[2][@"name"]length]>0&&[library.entries[2][@"relativeFolder"]isKindOfClass:NSString.class],@"entry has browser metadata");
|
||||
require(![library importURLs:@[link] error:&error],@"direct symbolic link import rejected");
|
||||
require(![library importURLs:@[[NSURL fileURLWithPath:firstPath]] error:&error],@"self library import rejected");
|
||||
require(![library importURLs:@[[NSURL URLWithString:@"https://example.com/a.cube"]] error:&error],@"remote URL import rejected");
|
||||
NSURL *invalidFolder=[temporary URLByAppendingPathComponent:@"InvalidPack"];
|
||||
write(invalidFolder,@"Good.cube",cube());write(invalidFolder,@"Bad.cube",@"invalid");
|
||||
NSUInteger before=library.entries.count;
|
||||
require(![library importURLs:@[invalidFolder] error:&error]&&library.entries.count==before,@"invalid folder preflight prevents partial imports");
|
||||
NSURL *blocked=write(source,@"Blocked/One.cube",cube());
|
||||
NSURL *outside=[temporary URLByAppendingPathComponent:@"Outside" isDirectory:YES];
|
||||
require([fm createDirectoryAtURL:outside withIntermediateDirectories:YES attributes:nil error:&error],@"create outside destination fixture");
|
||||
NSURL *destinationLink=[library.rootURL URLByAppendingPathComponent:@"Blocked"];
|
||||
require([fm createSymbolicLinkAtURL:destinationLink withDestinationURL:outside error:&error],@"create destination directory symlink fixture");
|
||||
require(![library importURLs:@[red,blocked.URLByDeletingLastPathComponent] error:&error],@"linked destination rejected and new files rolled back");
|
||||
require(![fm fileExistsAtPath:[[outside URLByAppendingPathComponent:@"One.cube"]path]],@"import cannot escape via existing directory link");
|
||||
require([library reload:&error]&&library.entries.count==before,@"rollback preserves previous library contents");
|
||||
require([library setFavorite:YES forPath:firstPath error:&error]&&[library isFavoritePath:firstPath],@"favorite is persisted");
|
||||
DYLUTLibrary *second=[[[DYLUTLibrary alloc]initWithRootURL:libraryURL]autorelease];
|
||||
require([second isFavoritePath:firstPath],@"favorite survives library recreation");
|
||||
require([second setFavorite:NO forPath:firstPath error:&error]&&![second isFavoritePath:firstPath],@"favorite removal persists");
|
||||
require(![second setFavorite:YES forPath:identity.path error:&error],@"favorite outside root rejected");
|
||||
NSDictionary *report=@{@"pass":@YES,@"checks":@(checkCount),@"results":results,@"scope":@"Standalone library/parser/bitmap checks on synthetic LUT files in an isolated temporary directory. No GUI or user library modified."};
|
||||
NSData *json=[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:&error];
|
||||
if(argc>1)require([json writeToFile:[NSString stringWithUTF8String:argv[1]] atomically:YES],@"write test report");
|
||||
fwrite(json.bytes,1,json.length,stdout);puts("");
|
||||
require([fm removeItemAtURL:temporary error:&error],@"clean isolated temporary fixtures");[results release];return 0;
|
||||
}}
|
||||
@@ -0,0 +1,129 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
|
||||
#ifndef DY_LUT_BASELINE
|
||||
#import "../大鱼调色/Plugin/DYLUTBrowser.h"
|
||||
@interface DYLUTBrowser (Acceptance)
|
||||
- (void)layoutBrowser;
|
||||
- (void)rebuildGrid;
|
||||
- (void)thumbnailClicked:(id)sender;
|
||||
- (void)clearSelection:(id)sender;
|
||||
- (void)importSelectedURLs:(NSArray *)urls;
|
||||
@end
|
||||
#endif
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
static NSMutableArray *checks;
|
||||
static void require(BOOL pass,NSString *name) {
|
||||
[checks addObject:@{@"name":name,@"pass":@(pass)}];
|
||||
if(!pass){fprintf(stderr,"FAIL: %s\n",name.UTF8String);exit(1);}
|
||||
}
|
||||
static void pump(BOOL (^done)(void)) {
|
||||
NSTimeInterval until=NSProcessInfo.processInfo.systemUptime+60;
|
||||
while(!done()&&NSProcessInfo.processInfo.systemUptime<until)
|
||||
[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
|
||||
require(done(),@"background operation completes within timeout");
|
||||
}
|
||||
static NSData *cube(NSUInteger n) {
|
||||
std::string text="TITLE \"Synthetic responsiveness fixture\"\nLUT_3D_SIZE "+std::to_string(n)+"\n";char row[100];
|
||||
for(NSUInteger z=0;z<n;z++)for(NSUInteger y=0;y<n;y++)for(NSUInteger x=0;x<n;x++){
|
||||
snprintf(row,sizeof(row),"%.7f %.7f %.7f\n",double(x)/(n-1),double(y)/(n-1),double(z)/(n-1));text+=row;
|
||||
}
|
||||
return [NSData dataWithBytes:text.data() length:text.size()];
|
||||
}
|
||||
int main(int argc,const char *argv[]) {@autoreleasepool {
|
||||
require(argc==2,@"report destination supplied");checks=[NSMutableArray new];
|
||||
NSFileManager *fm=NSFileManager.defaultManager;NSError *error=nil;
|
||||
NSURL *root=[NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[@"dayu-lut-responsive-" stringByAppendingString:NSUUID.UUID.UUIDString]] isDirectory:YES];
|
||||
NSURL *source=[root URLByAppendingPathComponent:@"Pack" isDirectory:YES],*destination=[root URLByAppendingPathComponent:@"Library" isDirectory:YES];
|
||||
require([fm createDirectoryAtURL:source withIntermediateDirectories:YES attributes:nil error:&error],@"isolated source folder created");
|
||||
NSData *large=cube(65);const NSUInteger count=24;
|
||||
for(NSUInteger i=0;i<count;i++)require([large writeToURL:[source URLByAppendingPathComponent:[NSString stringWithFormat:@"Large-%02lu.cube",(unsigned long)i]] atomically:NO],@"synthetic 65-cube file written");
|
||||
NSURL *anchor=[root URLByAppendingPathComponent:@"Anchor.cube"];require([cube(2)writeToURL:anchor atomically:NO],@"anchor fixture written");
|
||||
DYLUTLibrary *library=[[[DYLUTLibrary alloc]initWithRootURL:destination]autorelease];
|
||||
require([library importURLs:@[anchor] error:&error].count==1,@"preexisting library item imported");
|
||||
__block NSTimeInterval last=NSProcessInfo.processInfo.systemUptime,maxGap=0;__block NSUInteger ticks=0,snapshots=0;
|
||||
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){NSTimeInterval now=NSProcessInfo.processInfo.systemUptime;maxGap=MAX(maxGap,now-last);last=now;ticks++;snapshots+=library.entries.count>0&&library.folders.count>0;}];
|
||||
NSTimeInterval start=NSProcessInfo.processInfo.systemUptime;__block BOOL done=NO;__block NSUInteger importedCount=0;
|
||||
#ifdef DY_LUT_BASELINE
|
||||
NSArray *imported=[library importURLs:@[source] error:&error];importedCount=imported.count;done=YES;
|
||||
#else
|
||||
[library importURLsAsync:@[source] completion:^(NSArray *imported,NSError *failure){require(NSThread.isMainThread,@"import completion is on main queue");require(failure==nil,@"bulk import succeeds");importedCount=imported.count;done=YES;}];
|
||||
#endif
|
||||
pump(^{return done;});NSTimeInterval duration=NSProcessInfo.processInfo.systemUptime-start;
|
||||
NSDate *settle=[NSDate dateWithTimeIntervalSinceNow:.03];while(settle.timeIntervalSinceNow>0)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:settle];[timer invalidate];
|
||||
require(importedCount==count&&library.entries.count==count+1,@"all files and previous entry preserved");
|
||||
NSMutableDictionary *report=[NSMutableDictionary dictionaryWithDictionary:@{@"bulkFiles":@(count),@"cubeDimension":@65,@"sourceBytes":@(large.length*count),@"importSeconds":@(duration),@"mainHeartbeatMaxGapMS":@(maxGap*1000),@"mainHeartbeatTicks":@(ticks),@"snapshotsReadDuringImport":@(snapshots)}];
|
||||
#ifndef DY_LUT_BASELINE
|
||||
require(ticks>10&&maxGap<.15,@"main run loop stays responsive while importing");
|
||||
done=NO;__block BOOL cancelledDuringCopy=NO;
|
||||
NSProgress *cancelled=[library importURLsAsync:@[source] completion:^(NSArray *items,NSError *failure){require(!items&&failure.code==NSUserCancelledError,@"cancelled import returns cancellation");done=YES;}];
|
||||
NSTimer *canceller=[NSTimer scheduledTimerWithTimeInterval:.001 repeats:YES block:^(NSTimer *t){if(cancelled.completedUnitCount>count){cancelledDuringCopy=YES;[cancelled cancel];[t invalidate];}}];
|
||||
pump(^{return done;});[canceller invalidate];require(cancelledDuringCopy,@"cancel exercised after copy had begun");
|
||||
require([library reload:&error]&&library.entries.count==count+1,@"cancel rolls back newly copied files only");
|
||||
done=NO;NSProgress *scan=[library reloadAsync:^(NSError *failure){require(failure.code==NSUserCancelledError,@"cancelled scan reports cancellation");done=YES;}];[scan cancel];pump(^{return done;});
|
||||
require(library.entries.count==count+1,@"cancelled scan preserves previous snapshot");
|
||||
done=NO;DYLUTPrepareAsync([source URLByAppendingPathComponent:@"Large-00.cube"].path,^(NSError *failure){require(!failure&&NSThread.isMainThread,@"cold selection prepares off thread and completes on main");done=YES;});pump(^{return done;});
|
||||
NSURL *bad=[root URLByAppendingPathComponent:@"Invalid.cube"];[@"invalid LUT" writeToURL:bad atomically:NO encoding:NSUTF8StringEncoding error:&error];
|
||||
done=NO;DYLUTPrepareAsync(bad.path,^(NSError *failure){require(failure!=nil,@"invalid selection reports failure asynchronously");done=YES;});pump(^{return done;});
|
||||
// Real browser objects, never shown; its grid should represent thousands of
|
||||
// files with only visible/overscan buttons, including after a distant scroll.
|
||||
NSURL *catalog=[destination URLByAppendingPathComponent:@"Catalog" isDirectory:YES];[fm createDirectoryAtURL:catalog withIntermediateDirectories:NO attributes:nil error:&error];
|
||||
BOOL catalogOK=YES;for(NSUInteger i=0;i<3000;i++){
|
||||
NSString *folder=[destination.path stringByAppendingPathComponent:[NSString stringWithFormat:@"Folder-%04lu",(unsigned long)i]];
|
||||
if(![fm createDirectoryAtPath:folder withIntermediateDirectories:NO attributes:nil error:&error]){catalogOK=NO;break;}
|
||||
NSString *path=[folder stringByAppendingPathComponent:[NSString stringWithFormat:@"Catalog-%04lu.cube",(unsigned long)i]];
|
||||
if(link(anchor.path.fileSystemRepresentation,path.fileSystemRepresentation)!=0){catalogOK=NO;break;}
|
||||
}require(catalogOK,@"3000 catalog files in independent folders created");
|
||||
[NSApplication sharedApplication];[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
|
||||
NSMutableArray *selected=[NSMutableArray array];
|
||||
DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:nil palette:@{} selection:^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");
|
||||
require(visible==3025&&tileCount>0&&tileCount<200,@"large catalog creates only visible thumbnail controls");
|
||||
NSScrollView *scroll=[browser valueForKey:@"gridScroll"];[scroll.contentView scrollToPoint:NSMakePoint(0,scroll.documentView.frame.size.height-scroll.contentSize.height)];[browser layoutBrowser];
|
||||
require([[browser valueForKey:@"tiles"]count]<200,@"scrolling keeps thumbnail view count bounded");
|
||||
NSSearchField *search=[browser valueForKey:@"search"];search.stringValue=@"Catalog-000";[browser rebuildGrid];
|
||||
require([[browser valueForKey:@"visibleEntries"]count]==10,@"search remains usable after catalog loading");
|
||||
NSDictionary *tiles=[browser valueForKey:@"tiles"];NSArray *keys=[tiles.allKeys sortedArrayUsingSelector:@selector(compare:)];
|
||||
[browser thumbnailClicked:tiles[keys[0]]];[browser thumbnailClicked:tiles[keys[1]]];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});
|
||||
require(selected.count==1&&[selected.lastObject isEqual:keys[1]],@"rapid selection applies only the latest LUT");
|
||||
[browser thumbnailClicked:tiles[keys[0]]];[browser clearSelection:nil];pump(^{return [browser valueForKey:@"selectionTask"]==nil;});
|
||||
require([selected.lastObject isEqual:@""],@"clear selection supersedes pending LUT application");
|
||||
NSUInteger folderViews=[[browser valueForKey:@"folderButtons"]count];
|
||||
[browser importSelectedURLs:@[source]];[browser close];done=NO;[library reloadAsync:^(NSError *failure){require(!failure,@"scan after browser close completes");done=YES;}];pump(^{return done;});
|
||||
require(library.entries.count==3025,@"closing during import cancels without changing existing library");
|
||||
// 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";
|
||||
#endif
|
||||
report[@"checks"]=checks;report[@"scope"]=@"Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.";
|
||||
NSData *json=[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:&error];require([json writeToFile:[NSString stringWithUTF8String:argv[1]] atomically:YES],@"report written");
|
||||
require([fm removeItemAtURL:root error:&error],@"isolated fixtures removed");printf("PASS: import %.3fs, main gap %.1fms, %lu ticks\n",duration,maxGap*1000,(unsigned long)ticks);[checks release];return 0;
|
||||
}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"remote": "https://dayu.media/git/dayu/dayu-color.git",
|
||||
"branch": "main",
|
||||
"sourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
|
||||
"trackedFilesCompared": 129,
|
||||
"allCommittedFilesIdentical": true,
|
||||
"strictFullFsck": true,
|
||||
"nativeLibraryVerifierRebuiltFromRemote": true,
|
||||
"restoredSourceChecks": 92,
|
||||
"restoredSourceChecksPassed": true,
|
||||
"lfs": false,
|
||||
"submodules": false,
|
||||
"scope": "Independent clone of final compiled source, all files compared with committed blobs, library/parser/bitmap verification rebuilt with local SDK. GUI and responsiveness acceptance recorded separately."
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"version": "1.1.1",
|
||||
"build": "7",
|
||||
"appIconInNativeAboutWindow": true,
|
||||
"aboutVersionObserved": "Version 1.1.1 (7)",
|
||||
"fcpVersion": "12.4",
|
||||
"effectBrowserCategory": "大鱼调色",
|
||||
"effectBrowserThumbnailObserved": true,
|
||||
"thumbnailFishAndChineseTitleLegible": true,
|
||||
"qaProject": "大鱼调色_主题与LUT浏览库验收",
|
||||
"inspectorLoaded": true,
|
||||
"exposureRetained": 0.25,
|
||||
"themeRetained": "冰川蓝",
|
||||
"syntheticColorChartRendered": true,
|
||||
"formalAppAndPluginProcessPathsVerified": true,
|
||||
"uniquePluginKitRegistration": "com.dayu.color.XPC(1.1)\t6CD1CA2F-C9C1-4345-8668-6295ADC0DED3\t2026-10-31 03:35:56 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
|
||||
"assets": {
|
||||
"大鱼调色/Wrapper Application/Resources/DayuColor.icns": {
|
||||
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/Resources/DayuColor.icns",
|
||||
"sha256": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80"
|
||||
},
|
||||
"template/large.png": {
|
||||
"installedPath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/large.png",
|
||||
"sha256": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
|
||||
"userImmutable": true
|
||||
},
|
||||
"template/small.png": {
|
||||
"installedPath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/small.png",
|
||||
"sha256": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a",
|
||||
"userImmutable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"remote": "https://dayu.media/git/dayu/dayu-color.git",
|
||||
"branch": "main",
|
||||
"sourceCommit": "bd02c7a368348fdea6357889a09fba298872487a",
|
||||
"trackedFilesCompared": 113,
|
||||
"allFilesIdentical": true,
|
||||
"strictFullFsck": true,
|
||||
"brandExportsReproducedByteForByte": true,
|
||||
"exports": {
|
||||
"大鱼调色/Wrapper Application/Resources/DayuColor.icns": "9811ee6b0cefcec94ff6d717fd17f9fcedd6954048d2efea35f6f86764804f80",
|
||||
"template/large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
|
||||
"template/small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
|
||||
},
|
||||
"lfs": false,
|
||||
"submodules": false,
|
||||
"masterImages": {
|
||||
"design/dayu-color-app-icon-v1.png": "f04ec63f5cdebb3aa3fdebbca809f8505c2fc88084f069f0cbbd3f7535fcd21c",
|
||||
"design/dayu-color-plugin-thumbnail-v1.png": "6b63ed2a06c543ee6880f7cf4393bd43d3488a3f7325b806a73d2bee4c80652d"
|
||||
}
|
||||
}
|
||||
+27
-6
@@ -2,14 +2,35 @@
|
||||
"status": "verified",
|
||||
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"bundleID": "com.dayu.color",
|
||||
"version": "1.0.0",
|
||||
"build": "2",
|
||||
"version": "1.1.5",
|
||||
"build": "16",
|
||||
"team": "B3W25FX5H5",
|
||||
"notaryID": "8bfe6f2b-9611-4fac-b014-333b7916f881",
|
||||
"notaryID": "b47b6fe8-b7a9-4112-93b9-de85b03ca598",
|
||||
"notaryStatus": "Accepted",
|
||||
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
|
||||
"sourceCommit": "ce7e0a3371693c84c97267af12ca0f078b0db981",
|
||||
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
|
||||
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
|
||||
"templateSHA256": "46b613b2b9d799ce6b55902f973a5fd901b289c6105b39c0b4f6a018949cc81b",
|
||||
"shaderSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132"
|
||||
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
|
||||
"shaderSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132",
|
||||
"hostVerification": "verification/HostLUTEncoding.json",
|
||||
"sourceRecoveryVerification": "verification/LUTEncodingRecovery.json",
|
||||
"responsivenessVerification": "verification/LUTEncoding.json",
|
||||
"registry": "com.dayu.color.XPC(1.1)\t78D73EB2-7FCE-41CD-8E6A-6AABC8ACACDB\t2026-11-01 07:39:57 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
|
||||
"appInventory": [
|
||||
{
|
||||
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"version": "1.1.5",
|
||||
"build": "16"
|
||||
}
|
||||
],
|
||||
"inventoryScope": [
|
||||
"project and fixed product cache",
|
||||
"system FxPlug and Applications",
|
||||
"user FxPlug, Downloads and Desktop"
|
||||
],
|
||||
"packageVerification": "verification/Package.json",
|
||||
"packageStagingCleanup": {
|
||||
"identifier": "com.dayu.color.installer.c8d19ea6-1117-4621-ae47-48a41ea4ca10",
|
||||
"remainingMatchedDirectories": []
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"remote": "https://dayu.media/git/dayu/dayu-color.git",
|
||||
"branch": "main",
|
||||
"sourceCommit": "cdcb30a6aa1519bfb2f183165fef11cbf278bc7c",
|
||||
"trackedFilesCompared": 116,
|
||||
"allCommittedFilesIdentical": true,
|
||||
"strictFullFsck": true,
|
||||
"nativeModelMetadataAndTemplateReproducedByteForByte": true,
|
||||
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
|
||||
"lfs": false,
|
||||
"submodules": false,
|
||||
"scope": "Independent remote clone of the compiled source commit, compared to committed Git blobs; regenerated native model metadata and FCP template with local SDK. Final delivery tag is verified separately."
|
||||
}
|
||||
@@ -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."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"date": "2026-10-31T12:57:49.295933+08:00",
|
||||
"host": "Final Cut Pro",
|
||||
"hostVersion": "12.4",
|
||||
"hostBuild": "454072",
|
||||
"product": "大鱼调色",
|
||||
"version": "1.1.2",
|
||||
"build": "11",
|
||||
"sourceCommit": "cdcb30a6aa1519bfb2f183165fef11cbf278bc7c",
|
||||
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
|
||||
"project": "大鱼调色_分组展开与启用验收",
|
||||
"profile": "standard; existing native Objective-C++ AppKit inspector",
|
||||
"interactionContract": {
|
||||
"expanded": "Enabled; parameters visible and editable",
|
||||
"collapsed": "Disabled; parameters hidden, retained values and LUT paths are not cleared",
|
||||
"newInstanceAndResetAll": "Only basic adjustments expanded",
|
||||
"savedInstances": "Expansion derives from each group’s actual saved enable parameter, including previously enabled groups"
|
||||
},
|
||||
"checks": {
|
||||
"newInstanceOnlyBasicExpanded": true,
|
||||
"groupInteractions": [
|
||||
{
|
||||
"group": "输入 / LUT",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "基础调色",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "肤色保护设置",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "风格 LUT",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "HSL 混色",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "曲线",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "颜色分级",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "三原色",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "色阶",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "黑白混色",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
},
|
||||
{
|
||||
"group": "色彩平衡",
|
||||
"headerOpensAndEnables": true,
|
||||
"eyeClosesAndDisables": true,
|
||||
"parametersHiddenWhenOff": true
|
||||
}
|
||||
],
|
||||
"blackwhite": {
|
||||
"editedBlackwhiteRed": 45,
|
||||
"foldReopenRetainsValue": true,
|
||||
"valueAfterNormalHostQuitAndReopen": 45,
|
||||
"closedGroupHadNoParameterRowsAfterReopen": true,
|
||||
"enabledGrayImageObservedAtTimecode": "00:00:03:09",
|
||||
"disabledColorImageObserved": true
|
||||
},
|
||||
"skinProtection": {
|
||||
"enteredDisplayValue": "65%",
|
||||
"actualSliderValue": 65,
|
||||
"foldReopenRetainsValue": true,
|
||||
"valueAfterNormalHostQuitAndReopen": 65,
|
||||
"closedGroupHadNoParameterRowsAfterReopen": true
|
||||
},
|
||||
"resetAllOnlyBasicExpanded": true,
|
||||
"resetStateAfterNormalHostQuitAndReopenOnlyBasicExpanded": true,
|
||||
"finalSyntheticProjectRestoredToDefaults": true,
|
||||
"finalNativeIntegrationSelfTest": {
|
||||
"pass": true,
|
||||
"checks": 82,
|
||||
"gpu": "Apple M4",
|
||||
"record": "verification/InstalledSelfTest.json"
|
||||
},
|
||||
"accessibility": {
|
||||
"groupToggleStatesAndHelpMatchVisibility": true,
|
||||
"hiddenRowsAbsentFromAccessibilityTree": true,
|
||||
"keyboardNumericFieldEntry": true,
|
||||
"voiceOverSession": false
|
||||
},
|
||||
"swiftUIAudit": "Not applicable: no Swift or SwiftUI source in the product; existing AppKit inspector retained"
|
||||
},
|
||||
"pluginKit": "com.dayu.color.XPC(1.1)\tB7148000-0FBF-412F-A04F-9AF1CCBDC570\t2026-10-31 04:45:55 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
|
||||
"installedProcesses": [
|
||||
"28318 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/MacOS/大鱼调色",
|
||||
"28539 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
|
||||
],
|
||||
"cleanup": {
|
||||
"confirmedFailedBuild9Removed": true,
|
||||
"generatedOuterAppsInProjectAndProductCache": 0,
|
||||
"notarizationSubmissionZIPRemoved": true,
|
||||
"uniqueFormalFxPlugPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app"
|
||||
},
|
||||
"scope": "Finite live acceptance on the synthetic 1920x1080 25p timeline in FCP 12.4 on Apple M4. Renderer bypass of retained HSL, grading, selected input and five LUT layers also covered by native integration checks. Does not claim exhaustive media, VoiceOver, older OS/host or Intel validation; prior export and brand/theme evidence remains in separate historical records."
|
||||
}
|
||||
@@ -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."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"date": "2026-11-01",
|
||||
"status": "verified",
|
||||
"host": {
|
||||
"name": "Final Cut Pro",
|
||||
"version": "12.4",
|
||||
"build": "454072",
|
||||
"hardware": "Apple M4",
|
||||
"os": "macOS 27.0.1"
|
||||
},
|
||||
"fixture": {
|
||||
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
|
||||
"project": "大鱼调色_分组展开与启用验收",
|
||||
"sourceFolder": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收",
|
||||
"sourceFiles": 24,
|
||||
"cubeDimension": 65,
|
||||
"bytes": 197731344,
|
||||
"synthetic": true
|
||||
},
|
||||
"build13Observations": [
|
||||
{
|
||||
"check": "Import synthetic folder twice through the native directory selector",
|
||||
"pass": true,
|
||||
"importedFiles": 48
|
||||
},
|
||||
{
|
||||
"check": "Search changed from cold to warm while validating 192 LUTs",
|
||||
"pass": true,
|
||||
"observedProgress": [
|
||||
"27 / 192",
|
||||
"91 / 192"
|
||||
]
|
||||
},
|
||||
{
|
||||
"check": "Cancel restores refresh action and reports cancellation",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"check": "Some thumbnails ready while others still being generated",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"check": "Rapid warm22 then cold23 selection ends on cold23",
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"build13Issue": {
|
||||
"entry": "Inspector menu → Load LUT file",
|
||||
"stage": "Native file chooser before background LUT parse",
|
||||
"evidence": [
|
||||
"async-single-load-host.sample.txt",
|
||||
"async-single-load-plugin.sample.txt"
|
||||
],
|
||||
"diagnosis": "Menu tracking opened a nested runModal panel; remote accessibility focused-element request waited on ViewBridge.",
|
||||
"fixSourceCommit": "d64430cd662286188715847ab4b46d883fdb1ff6",
|
||||
"fix": "Defer menu command until pop-up tracking has returned."
|
||||
},
|
||||
"limitations": [
|
||||
"No full VoiceOver audit performed.",
|
||||
"No older macOS, Intel or network-volume performance benchmark.",
|
||||
"SwiftUI audit is not applicable to the Objective-C++ AppKit implementation."
|
||||
],
|
||||
"version": "1.1.3",
|
||||
"build": "14",
|
||||
"compiledSourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
|
||||
"installedPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"profile": "standard; native Objective-C++ AppKit inspector",
|
||||
"processEvidence": {
|
||||
"wrapperPID": 69700,
|
||||
"hostPID": 69839,
|
||||
"pluginPID": 69855,
|
||||
"binaryVersion": "1.1.3 - 14",
|
||||
"sample": "product cache/final-build14-host-service.sample.txt"
|
||||
},
|
||||
"build14Checks": {
|
||||
"singleFileChooserReturnsAfterMenuExit": true,
|
||||
"singleFileSizeMB": 8.2,
|
||||
"singleFileLoadedPath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/LUT后台加载验收/暖调-22.cube",
|
||||
"directoryImportProgressObserved": "正在导入 3/24",
|
||||
"directoryImportCompletedFiles": 24,
|
||||
"libraryCountAfterThirdImport": 72,
|
||||
"cancelPackFiles": 192,
|
||||
"cancelProgressBeforeSearch": "19/192",
|
||||
"cancelProgressAfterSearch": "177/192",
|
||||
"searchDuringImport": "暖; 2 matching LUTs",
|
||||
"cancellationMessage": "已取消 LUT 加载",
|
||||
"refreshAndDoneRestored": true,
|
||||
"progressiveThumbnailsObserved": true,
|
||||
"gridScrollOperational": true,
|
||||
"rapidWarmThenColdFinalSelection": "冷调-23.cube",
|
||||
"normalHostQuitAndReopenRetainsLastSelection": true,
|
||||
"resetAllClearsLUTAndEnablesOnlyBasicGroup": true,
|
||||
"restoredBrowserFolder": "LUT浏览库验收素材",
|
||||
"restoredBrowserSearch": "",
|
||||
"restoredThumbnailSize": 160,
|
||||
"syntheticImportedFilesRemovedAfterSHA256Check": 72,
|
||||
"originalLibraryFilesRetained": 4
|
||||
},
|
||||
"recoveryFromBuild13Issue": "Human explicitly authorized force-quitting the stalled FCP process 68490. It was stopped, build14 was installed, and all subsequent host quit/reopen checks completed normally."
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"date": "2026-10-31T04:04:44.093059+08:00",
|
||||
"host": "Final Cut Pro",
|
||||
"hostVersion": "12.4",
|
||||
"hostBuild": "454072",
|
||||
"product": "大鱼调色 1.1.0 (6)",
|
||||
"sourceCommit": "c8d92077e5a017fa4b1a7ee7b24be2386b29294d",
|
||||
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
|
||||
"project": "大鱼调色_主题与LUT浏览库验收",
|
||||
"checks": {
|
||||
"themeAfterQuitAndReopen": "blue",
|
||||
"folderImport": {
|
||||
"pass": true,
|
||||
"syntheticFiles": 4,
|
||||
"executedOnBuild": "4"
|
||||
},
|
||||
"folderFilter": {
|
||||
"pass": true,
|
||||
"uncategorizedCount": 0,
|
||||
"testFolderCount": 4
|
||||
},
|
||||
"searchFilter": {
|
||||
"query": "暖",
|
||||
"matchingFiles": 2
|
||||
},
|
||||
"thumbnailSizeAfterQuitAndReopen": 160,
|
||||
"selectedFolderAfterReopen": "LUT浏览库验收素材",
|
||||
"singleClickApplicationFinalBuild": [
|
||||
"冷调",
|
||||
"暖调"
|
||||
],
|
||||
"thumbnailOrientation": {
|
||||
"pass": true,
|
||||
"visualCheckedOnBuild": "5",
|
||||
"unchangedOrientationImplementationInFinalBuild": true,
|
||||
"nativeActualIOSurfaceTestsFinalBuild": true
|
||||
},
|
||||
"numericFieldEditableInFinalBuild": true,
|
||||
"exposureEnteredAndReadBackFinalBuild": 0.25,
|
||||
"exposureAfterQuitAndReopenFinalBuild": 0.25,
|
||||
"selectedLUTAfterQuitAndReopenFinalBuild": "暖调",
|
||||
"sourceFramePreviewUpdatedThroughActualHostRender": true,
|
||||
"exportedVideo": true,
|
||||
"fiveThemeStates": {
|
||||
"pass": true,
|
||||
"executedOnBuild": "4",
|
||||
"unchangedThemeImplementationInFinalBuild": true,
|
||||
"observedStates": [
|
||||
"purple",
|
||||
"gray",
|
||||
"green",
|
||||
"orange",
|
||||
"blue"
|
||||
]
|
||||
},
|
||||
"unchangedLibraryAndBrowserImplementationInFinalBuild": true
|
||||
},
|
||||
"video": {
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_1.1.0_主题LUT_正式宿主导出.mov",
|
||||
"sha256": "b14724e57f541bfcfa11f6fd76cab36f7ff6a8d9262eae3fbb51519344f93a60",
|
||||
"probe": {
|
||||
"programs": [],
|
||||
"stream_groups": [
|
||||
{
|
||||
"streams": [
|
||||
{
|
||||
"codec_name": "prores",
|
||||
"codec_type": "video",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"pix_fmt": "yuv422p10le",
|
||||
"r_frame_rate": "25/1"
|
||||
},
|
||||
{
|
||||
"codec_type": "data",
|
||||
"r_frame_rate": "0/0"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"streams": [
|
||||
{
|
||||
"codec_name": "prores",
|
||||
"codec_type": "video",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"pix_fmt": "yuv422p10le",
|
||||
"r_frame_rate": "25/1"
|
||||
},
|
||||
{
|
||||
"codec_type": "data",
|
||||
"r_frame_rate": "0/0"
|
||||
}
|
||||
],
|
||||
"format": {
|
||||
"duration": "4.000000",
|
||||
"size": "15814504"
|
||||
}
|
||||
},
|
||||
"fullDecodePassed": true,
|
||||
"neutralPatchMeanRGB": {
|
||||
"original": [
|
||||
93.3625,
|
||||
93.3625,
|
||||
93.3625
|
||||
],
|
||||
"warm": [
|
||||
118.6625,
|
||||
106.075,
|
||||
87.4875
|
||||
]
|
||||
},
|
||||
"warmLookVisible": true
|
||||
},
|
||||
"pluginKit": "com.dayu.color.XPC(1.1)\t895E89B3-AC5C-48B7-B7E6-1E6934DB29F9\t2026-10-30 20:00:36 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
|
||||
"installedProcesses": [
|
||||
"23201 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/MacOS/大鱼调色",
|
||||
"23470 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
|
||||
],
|
||||
"scope": "Finite FCP acceptance on authored 1920×1080 25p, 4-second chart and synthetic Cube LUTs. Does not claim exhaustive footage, older OS/host, Intel, or pixel-identical reconstruction of every original interface detail."
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
|
||||
"checks": 70,
|
||||
"checks": 92,
|
||||
"gpu": "Apple M4",
|
||||
"limitations": [
|
||||
"Finite states and a 64x48 frame; live FCP discovery, inspector interaction, timeline persistence and real host export require separate acceptance.",
|
||||
@@ -12,7 +12,7 @@
|
||||
"error": "未提供错误信息",
|
||||
"name": "runtime-directory",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/89458B5D-B506-455A-8BB2-F412CDC2F098"
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69"
|
||||
},
|
||||
{
|
||||
"descriptors": 196,
|
||||
@@ -25,6 +25,10 @@
|
||||
"name": "finite-real-model-defaults",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "only-basic-adjustments-enabled-by-default",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "native-parameter-creation",
|
||||
@@ -101,6 +105,23 @@
|
||||
"vibrance": -6,
|
||||
"whites": 6
|
||||
},
|
||||
{
|
||||
"bytes": 921600,
|
||||
"error": "",
|
||||
"name": "look-preview-top-left-is-original-analysis",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"all180RowsCompared": true,
|
||||
"analysisKeepsPhysicalRowOrder": true,
|
||||
"error": "",
|
||||
"name": "look-preview-bottom-left-flips-only-browser-rows",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "preview-invalidation-clears-analysis-and-browser",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "renderer-exposure-pass",
|
||||
@@ -166,6 +187,19 @@
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "folded-hsl-bypasses-retained-adjustments-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"changedComponents": 0,
|
||||
"maxAbsoluteError": 0,
|
||||
"name": "folded-hsl-bypasses-retained-adjustments",
|
||||
"nonfiniteComponents": 0,
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "renderer-grading-pass",
|
||||
@@ -179,6 +213,19 @@
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "folded-grading-bypasses-retained-adjustments-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"changedComponents": 0,
|
||||
"maxAbsoluteError": 0,
|
||||
"name": "folded-grading-bypasses-retained-adjustments",
|
||||
"nonfiniteComponents": 0,
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "input-profile-01-load-render",
|
||||
@@ -400,6 +447,19 @@
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "folded-input-bypasses-retained-profile-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"changedComponents": 0,
|
||||
"maxAbsoluteError": 0,
|
||||
"name": "folded-input-bypasses-retained-profile",
|
||||
"nonfiniteComponents": 0,
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "renderer-input-analysis-pass",
|
||||
@@ -429,11 +489,24 @@
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "",
|
||||
"name": "folded-look-bypasses-retained-LUTs-render",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"changedComponents": 0,
|
||||
"maxAbsoluteError": 0,
|
||||
"name": "folded-look-bypasses-retained-LUTs",
|
||||
"nonfiniteComponents": 0,
|
||||
"nonzeroComponents": 9832,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"error": "未提供错误信息",
|
||||
"name": "renderer-export-33cube",
|
||||
"pass": true,
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/89458B5D-B506-455A-8BB2-F412CDC2F098/diagnostic-export.cube"
|
||||
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69/diagnostic-export.cube"
|
||||
},
|
||||
{
|
||||
"bytes": 1186070,
|
||||
@@ -441,8 +514,57 @@
|
||||
"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.919541465118527,
|
||||
"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/89458B5D-B506-455A-8BB2-F412CDC2F098",
|
||||
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69",
|
||||
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
|
||||
}
|
||||
文件差异过大,未显示。
加载差异
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"passResult": true,
|
||||
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
|
||||
"filesCompared": 138,
|
||||
"fsck": "strict/full passed",
|
||||
"restoredChecks": {
|
||||
"library": 112,
|
||||
"encoding": 179
|
||||
},
|
||||
"lfs": false,
|
||||
"submodules": false
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
{
|
||||
"results" : [
|
||||
{
|
||||
"name" : "isolated temporary directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "identity Cube parses",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "Cube order is red-fastest",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "identity interpolation and alpha",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "red gain trilinear interpolation",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "DOMAIN normalization resamples Cube",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "invalid float samples become clear",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject malformed float RGBA length",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject zero image width",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "thumbnail bitmap generated without GUI",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "thumbnail reflects LUT colors and alpha",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "authored fallback chart thumbnail",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid thumbnail size",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "rewrite LUT in place",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "preserve subsecond modification distinction",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "cache invalidates same-size in-place rewrite",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "concurrent table cache reads stay consistent",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "reject invalid Cube and clear output",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "default library follows product Movies structure",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "scan missing root is read only and empty",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "single LUT import and scan",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "name collision creates unique copy",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "existing LUT remains byte-for-byte unchanged",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "import keeps original file",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create symlink fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "directory recursively imports Cube only and skips symlinks",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "nested folder structure preserved",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "entry has browser metadata",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "direct symbolic link import rejected",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "self library import rejected",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "remote URL import rejected",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "invalid folder preflight prevents partial imports",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create fixture directory",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "write fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create outside destination fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "create destination directory symlink fixture",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "linked destination rejected and new files rolled back",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "import cannot escape via existing directory link",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "rollback preserves previous library contents",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "favorite is persisted",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "favorite survives library recreation",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "favorite removal persists",
|
||||
"pass" : true
|
||||
},
|
||||
{
|
||||
"name" : "favorite outside root rejected",
|
||||
"pass" : true
|
||||
}
|
||||
],
|
||||
"scope" : "Standalone library\/parser\/bitmap checks on synthetic LUT files in an isolated temporary directory. No GUI or user library modified.",
|
||||
"pass" : true,
|
||||
"checks" : 92
|
||||
}
|
||||
@@ -0,0 +1,381 @@
|
||||
{
|
||||
"date": "2026-11-01",
|
||||
"gpu": "Apple M4",
|
||||
"osVersion": "27.0.1",
|
||||
"baselineCommit": "57830ca74458a45cff207b76b5293e9dd17e273f",
|
||||
"baseline": {
|
||||
"mainHeartbeatMaxGapMS": 10018.783083301969,
|
||||
"checks": [
|
||||
{
|
||||
"name": "isolated source folder created",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "anchor fixture written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "preexisting library item imported",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "all files and previous entry preserved",
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"bulkFiles": 24,
|
||||
"mode": "baseline synchronous import",
|
||||
"scope": "Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.",
|
||||
"snapshotsReadDuringImport": 8,
|
||||
"importSeconds": 10.018748541595414,
|
||||
"cubeDimension": 65,
|
||||
"sourceBytes": 197731344,
|
||||
"mainHeartbeatTicks": 8
|
||||
},
|
||||
"background": {
|
||||
"sourceBytes": 197731344,
|
||||
"mainHeartbeatMaxGapMS": 6.251125014387071,
|
||||
"bulkFiles": 24,
|
||||
"checks": [
|
||||
{
|
||||
"name": "isolated source folder created",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "synthetic 65-cube file written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "anchor fixture written",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "preexisting library item imported",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "import completion is on main queue",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "bulk import succeeds",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "all files and previous entry preserved",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "main run loop stays responsive while importing",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cancelled import returns cancellation",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cancel exercised after copy had begun",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cancel rolls back newly copied files only",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cancelled scan reports cancellation",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cancelled scan preserves previous snapshot",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "cold selection prepares off thread and completes on main",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "invalid selection reports failure asynchronously",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "3000 catalog files in independent folders created",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "large directory list creates only visible folder controls",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "large catalog creates only visible thumbnail controls",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "scrolling keeps thumbnail view count bounded",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "search remains usable after catalog loading",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "rapid selection applies only the latest LUT",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "clear selection supersedes pending LUT application",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "scan after browser close completes",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "background operation completes within timeout",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"name": "closing during import cancels without changing existing library",
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"initialLiveThumbnailViews": 45,
|
||||
"snapshotsReadDuringImport": 1486,
|
||||
"mainHeartbeatTicks": 1486,
|
||||
"scope": "Synthetic 24 x 65-cube import with real main-run-loop heartbeat and snapshot reads; headless browser cancellation, latest selection and 3,025-entry virtualization. No user library or visible test app.",
|
||||
"pass": true,
|
||||
"largeCatalogEntries": 3025,
|
||||
"cubeDimension": 65,
|
||||
"initialLiveFolderViews": 15,
|
||||
"importSeconds": 7.3989348750328645
|
||||
},
|
||||
"coreLibraryChecks": 92,
|
||||
"coreLibraryPassed": true,
|
||||
"limitations": [
|
||||
"Headless run-loop and AppKit objects with synthetic files; formal FCP interaction is a separate gate.",
|
||||
"Measured on this Apple M4 with local APFS temporary files; network volumes, older Macs and other host versions were not benchmarked."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.5.pkg",
|
||||
"sha256": "bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071",
|
||||
"bytes": 13752153,
|
||||
"testUnsigned": false,
|
||||
"installationExecuted": false,
|
||||
"checks": [
|
||||
"PKG Developer ID Installer signature",
|
||||
"PKG stapled ticket and Gatekeeper install assessment",
|
||||
"must-close attached to root-authorized payload",
|
||||
"all four FCP/Motion host identifiers",
|
||||
"bundle relocation disabled",
|
||||
"desktop and Bundle ID preinstall guards",
|
||||
"postinstall contains actual FxPlug verification invocations",
|
||||
"GUI worker, registration repair and Finder reveal present",
|
||||
"successful completion and consecutive registration checks",
|
||||
"exact payload contents: 大鱼调色.app",
|
||||
"fixed FxPlug outer APP install path",
|
||||
"outer APP has one real verification action",
|
||||
"service path/identifier/registration version: com.dayu.color.XPC",
|
||||
"nonempty FxPlug service manifest",
|
||||
"payload APP signature, independent ticket and Gatekeeper",
|
||||
"exact payload contents: 大鱼调色",
|
||||
"login-user resource destination: ~/Movies/Motion Templates.localized/Effects.localized",
|
||||
"complete outer APP payload present",
|
||||
"welcome warns to save work and close hosts",
|
||||
"conclusion gives manual APP and host restart instructions"
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
|
||||
"bundleID": "com.dayu.color",
|
||||
"version": "1.1.5",
|
||||
"build": "16"
|
||||
},
|
||||
{
|
||||
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
|
||||
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.c8d19ea6-1117-4621-ae47-48a41ea4ca10/1F33731D-2B0E-486C-8F6B-88E78433618D/大鱼调色"
|
||||
}
|
||||
],
|
||||
"signature": "Package \"大鱼调色-1.1.5.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 07:46:31 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
|
||||
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.5.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": {
|
||||
"message": "Successfully received submission info",
|
||||
"name": "大鱼调色-1.1.5.pkg",
|
||||
"status": "Accepted",
|
||||
"createdDate": "2026-11-01T07:46:33.136Z",
|
||||
"id": "90a38636-93bb-4693-8db2-16b9a815e409"
|
||||
},
|
||||
"appCompiledSource": "59b058a3c8b9e5387381574da6bbc05af437527c",
|
||||
"appBuild": "16",
|
||||
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
|
||||
"packageBuilderCommit": "191da9dc0abfda83fcc5939f6fc90e4c9019f4d9",
|
||||
"templateSHA256": {
|
||||
"大鱼调色.moef": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
|
||||
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
|
||||
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
|
||||
},
|
||||
"installedAppHostAcceptance": "verification/HostLUTEncoding.json",
|
||||
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"passResult": true,
|
||||
"repository": "dayu/dayu-color",
|
||||
"repositoryID": 52,
|
||||
"private": false,
|
||||
"tag": "v1.1.5-lut-encoding-20261101",
|
||||
"releaseCommit": "06968514fc5205a83fbf3c5a3dbb1be0f6f3e79b",
|
||||
"releaseID": 355,
|
||||
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.1.5-lut-encoding-20261101",
|
||||
"assetID": 8,
|
||||
"assetName": "大鱼调色-1.1.5.pkg",
|
||||
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.1.5-lut-encoding-20261101/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.1.5.pkg",
|
||||
"bytes": 13752153,
|
||||
"sha256": "bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071",
|
||||
"existingAssetReused": true,
|
||||
"verification": "Authenticated full download SHA-256 and byte count, then release/asset read-back.",
|
||||
"credentialSource": "macOS Keychain: dayu-git-api",
|
||||
"verifiedAt": "2026-11-01T08:23:02.166677+00:00",
|
||||
"status": "published-and-download-verified",
|
||||
"packageVerification": "verification/Package.json",
|
||||
"prePublishDraftDownload": {
|
||||
"passResult": true,
|
||||
"path": "/Volumes/备份/大鱼调色-1.1.5.pkg",
|
||||
"bytes": 13752153,
|
||||
"sha256": "bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071",
|
||||
"sourceURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.1.5-lut-encoding-20261101/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.1.5.pkg",
|
||||
"source": "Completed authenticated Microsoft Edge download from the draft release asset URL, located through its Open containing folder action.",
|
||||
"whereFromsPresent": false,
|
||||
"whereFromsMatches": false,
|
||||
"birthtime": 1793521155.9,
|
||||
"releaseID": 355,
|
||||
"assetID": 8,
|
||||
"temporaryCopyRemoved": true
|
||||
},
|
||||
"publisherSourceCommit": "557bea72d68dde09db2c40ae220b12fc68db87a7",
|
||||
"actualAppCompiledSource": "59b058a3c8b9e5387381574da6bbc05af437527c",
|
||||
"assetUploads": 1,
|
||||
"credentialValueRecorded": false
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"date": "2026-10-31",
|
||||
"baselineCommit": "29dc4d385c1459cd330d8a9083ec9756787afef3",
|
||||
"relatedColorFinaleResearchCommit": "4458dc0c0ae7f51046b8cfa4b19626e80f7cf6ca",
|
||||
"researchSnapshotsVerified": 4,
|
||||
"currentTreePriorTargetNameAbsent": true,
|
||||
"shippingAppSourceChangesCommentsOnly": true,
|
||||
"shippingKernelsTablesNoticesAndTemplateUnchanged": true,
|
||||
"themeNumericalValuesUnchanged": true,
|
||||
"maintainedDocumentationLinksValid": true,
|
||||
"rebuiltTemplateIdentical": true,
|
||||
"gpuCLIExplicitReferencePassed": true,
|
||||
"gpuChecks": 35,
|
||||
"sourceRecordHistoryPreserved": true,
|
||||
"scope": "Repository documentation and comments, archived related-product migration research, explicit reference input for the standalone GPU verifier. No app behavior or installed release changes. Color Finale studies do not establish direct code lineage for the different current GPU/auto-grade implementations.",
|
||||
"repositoryWebDescription": {
|
||||
"updated": false,
|
||||
"httpStatus": 403,
|
||||
"reason": "Repository access is restricted to authorized members.",
|
||||
"preservedDescription": "大鱼调色:原生 FxPlug4 Xcode 复刻工程",
|
||||
"noCredentialScopeOrAccessChanges": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"remote": "https://dayu.media/git/dayu/dayu-color.git",
|
||||
"sourceCommit": "c8d92077e5a017fa4b1a7ee7b24be2386b29294d",
|
||||
"filesComparedToCommittedBlobs": 106,
|
||||
"strictFullFsck": true,
|
||||
"remoteXcodeReleaseBuild": true,
|
||||
"remoteNativeChecks": 73,
|
||||
"remoteNativePass": true,
|
||||
"rebuiltMetalSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132",
|
||||
"noLFS": true,
|
||||
"noSubmodules": true
|
||||
}
|
||||
@@ -53,13 +53,16 @@
|
||||
04962E923095058F009952AA /* Exceptions for "大鱼调色" folder in "Wrapper Application" target */ = {
|
||||
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
|
||||
membershipExceptions = (
|
||||
"Plugin/DYDiagnostics.mm",
|
||||
"/Localized: Plugin/InfoPlist.strings",
|
||||
"/Localized: Plugin/Localizable.strings",
|
||||
Plugin/DYAutoGrade.mm,
|
||||
Plugin/DYColorTables.mm,
|
||||
Plugin/DYDiagnostics.mm,
|
||||
Plugin/DYGrade.metal,
|
||||
Plugin/DYInspector.mm,
|
||||
Plugin/DYTheme.mm,
|
||||
Plugin/DYLUTLibrary.mm,
|
||||
Plugin/DYLUTBrowser.mm,
|
||||
Plugin/DYModel.mm,
|
||||
Plugin/DYPlugIn.mm,
|
||||
Plugin/DYRenderer.mm,
|
||||
@@ -118,6 +121,7 @@
|
||||
Plugin/Resources/InputLUTs/sony_slog3_sgamut3cine_to_rec709.dylut,
|
||||
"Plugin/Resources/THIRD-PARTY-NOTICES.txt",
|
||||
"Wrapper Application/AppDelegate.m",
|
||||
"Wrapper Application/Resources/DayuColor.icns",
|
||||
"Wrapper Application/Info.plist",
|
||||
"Wrapper Application/main.m",
|
||||
);
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
// Numerical reconstruction of LumiGrade 3.0 (56), arm64 autoGradeResult at
|
||||
// 0x100091d38..0x100092650 and percentile at 0x100091ca4..0x100091d38.
|
||||
// Sources: research/autoGrade.c and autoGrade.asm in this task's analysis cache.
|
||||
// Quantized percentile-based automatic grading.
|
||||
// Algorithm sources and historical evidence: research/ALGORITHM_SOURCES.md.
|
||||
// The reference redraws NSImage into 320x180 UInt8 RGBA. Our renderer provides
|
||||
// 320x180 float RGBA samples; quantization recreates that numerical domain.
|
||||
// This does not claim byte-identical NSImage/CoreGraphics resampling.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Upstream: https://github.com/robbietilton/Compositor
|
||||
// Commit: 92f5225afe7e921dbfa4c563462980e45db345fc
|
||||
// Table SHA-256: e67ff4dbcce35cb7765752acff4405be5c934d913ef1396b2ca3fc6dc8a85190
|
||||
// Float composition order checked against LumiGrade 3.0 build 56, arm64.
|
||||
// Float composition order and table contract: research/ColorTableNotes.md.
|
||||
#define DY_COLOR_TABLES_TESTING 1
|
||||
#import "DYColorTables.h"
|
||||
#include <algorithm>
|
||||
|
||||
+111
-7
@@ -2,6 +2,8 @@
|
||||
#import "DYModel.h"
|
||||
#import "DYRenderer.h"
|
||||
#import "DYAutoGrade.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#include <string>
|
||||
#import <CoreVideo/CoreVideo.h>
|
||||
#import <IOSurface/IOSurface.h>
|
||||
#include <algorithm>
|
||||
@@ -50,8 +52,10 @@
|
||||
IOSurfaceRef _surface;
|
||||
FxRect _bounds;
|
||||
uint64_t _registry;
|
||||
FxImageOrigin _diagnosticOrigin;
|
||||
}
|
||||
- (instancetype)initWithDevice:(id<MTLDevice>)device width:(NSUInteger)width height:(NSUInteger)height;
|
||||
- (void)setDiagnosticImageOrigin:(FxImageOrigin)origin;
|
||||
@end
|
||||
@implementation DYDiagnosticTile
|
||||
- (instancetype)initWithDevice:(id<MTLDevice>)device width:(NSUInteger)width height:(NSUInteger)height {
|
||||
@@ -63,7 +67,7 @@
|
||||
MTLTextureDescriptor *d=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];
|
||||
d.storageMode=MTLStorageModeShared;d.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
|
||||
if(_surface)_texture=[device newTextureWithDescriptor:d iosurface:_surface plane:0];
|
||||
_bounds=(FxRect){0,0,(SInt32)width,(SInt32)height};_registry=device.registryID;
|
||||
_bounds=(FxRect){0,0,(SInt32)width,(SInt32)height};_registry=device.registryID;_diagnosticOrigin=kFxImageOrigin_TOP_LEFT;
|
||||
if(!_surface||!_texture){[self release];return nil;}
|
||||
}return self;
|
||||
}
|
||||
@@ -73,7 +77,8 @@
|
||||
- (FxRect)tilePixelBounds {return _bounds;}
|
||||
- (FxRect)imagePixelBounds {return _bounds;}
|
||||
- (uint64_t)deviceRegistryID {return _registry;}
|
||||
- (FxImageOrigin)imageOrigin {return kFxImageOrigin_TOP_LEFT;}
|
||||
- (FxImageOrigin)imageOrigin {return _diagnosticOrigin;}
|
||||
- (void)setDiagnosticImageOrigin:(FxImageOrigin)origin {_diagnosticOrigin=origin;}
|
||||
@end
|
||||
|
||||
namespace {
|
||||
@@ -122,6 +127,9 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
for(NSDictionary *row in descriptors)if([row[@"offset"]integerValue]>=0){float value=*field(&defaults,row);finite&=std::isfinite(value);matches&=value==[row[@"default"]floatValue];}
|
||||
for(int c=0;c<3;c++)finite&=std::isfinite(defaults.primariesM0[c])&&std::isfinite(defaults.primariesM1[c])&&std::isfinite(defaults.primariesM2[c]);
|
||||
run.need(@"finite-real-model-defaults",finite&&matches);
|
||||
bool initialGroups=true;
|
||||
for(NSDictionary *section in sections){BOOL base=[@[@"base",@"color"]containsObject:section[@"key"]];for(NSDictionary *row in descriptors)if([row[@"pid"]isEqual:section[@"enabled"]])initialGroups&=([row[@"default"]doubleValue]>=.5)==base;}
|
||||
run.record(@"only-basic-adjustments-enabled-by-default",initialGroups);
|
||||
DYDiagnosticManager *manager=[[[DYDiagnosticManager alloc]init]autorelease];error=nil;
|
||||
run.need(@"native-parameter-creation",DYCreateParameters(manager,&error)&&!manager->_duplicate&&manager->_values.count==descriptors.count&&manager->_custom.count==2,@{@"error":reason(error)});
|
||||
id<FxParameterSettingAPI_v6> setter=[manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];id<FxParameterRetrievalAPI_v6> getter=[manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
|
||||
@@ -141,28 +149,124 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
|
||||
DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];Pixels neutral=render(run,renderer,source,destination,gpu,defaults,@{},@"renderer-default-pass");Difference neutralDifference=difference(input,neutral);
|
||||
run.record(@"transparent-premultiplied-neutral",neutralDifference.nonfinite==0&&neutralDifference.maximum<=.001,measure(neutralDifference));
|
||||
auto checkFoldedGroup=[&](DYUniforms active,NSUInteger offset,NSDictionary *paths,NSString *name){
|
||||
*(float *)((uint8_t *)&active+offset)=0;
|
||||
Pixels folded=render(run,renderer,source,destination,gpu,active,paths,[name stringByAppendingString:@"-render"]);
|
||||
Difference delta=difference(neutral,folded);run.record(name,delta.nonfinite==0&&delta.maximum==0,measure(delta));
|
||||
};
|
||||
size_t transparentBad=0;for(size_t i=0;i<input.size();i+=4){if(input[i+3]==0)for(int c=0;c<4;c++)if(neutral[i+c]!=0)transparentBad++;if(neutral[i+3]!=input[i+3])transparentBad++;}
|
||||
run.record(@"renderer-alpha-contract",transparentBad==0,@{@"invalidComponents":@(transparentBad)});
|
||||
NSData *preview=[renderer preview];bool previewFinite=preview.length==320*180*16;if(previewFinite){const float *data=(const float *)preview.bytes;for(NSUInteger i=0;i<preview.length/4;i++)previewFinite&=std::isfinite(data[i]);}
|
||||
run.record(@"renderer-analysis-320x180",previewFinite,@{@"bytes":@(preview.length)});
|
||||
NSDictionary *autoGrade=DYAutoGrade(preview);run.record(@"renderer-auto-grade-integration",autoGrade.count==10,autoGrade?:@{});
|
||||
// Vertical red/blue markers establish actual Metal texture row order.
|
||||
// Browser bitmaps need top-first rows; the auto-analysis bytes must not
|
||||
// be changed even when FxPlug supplies a bottom-left source texture.
|
||||
Pixels marker(width*height*4),bottomFirst(marker.size());
|
||||
for(NSUInteger y=0;y<height;y++)for(NSUInteger x=0;x<width;x++){
|
||||
size_t p=(y*width+x)*4;marker[p]=y<height/2?.8f:.03f;marker[p+1]=.04f+.1f*float(x)/(width-1);marker[p+2]=y<height/2?.02f:.7f;marker[p+3]=1;
|
||||
}
|
||||
for(NSUInteger y=0;y<height;y++)memcpy(bottomFirst.data()+y*width*4,marker.data()+(height-1-y)*width*4,width*8);
|
||||
DYRenderer *orientationRenderer=[[[DYRenderer alloc]init]autorelease];
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:marker.data() bytesPerRow:width*8];
|
||||
error=nil;BOOL topRendered=[orientationRenderer renderSource:source destination:destination uniforms:defaults paths:@{} error:&error];
|
||||
NSData *topAnalysis=[orientationRenderer preview],*topLook=[orientationRenderer lookLUTPreview];
|
||||
bool topOrientation=topRendered&&topLook.length==320*180*16&&[topLook isEqualToData:topAnalysis];
|
||||
if(topOrientation){const float*p=(const float*)topLook.bytes;topOrientation=p[0]>p[2]&&p[(179*320)*4+2]>p[(179*320)*4];}
|
||||
run.record(@"look-preview-top-left-is-original-analysis",topOrientation,@{@"error":topRendered?@"":reason(error),@"bytes":@(topLook.length)});
|
||||
[orientationRenderer invalidatePreview];[source setDiagnosticImageOrigin:kFxImageOrigin_BOTTOM_LEFT];
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:bottomFirst.data() bytesPerRow:width*8];
|
||||
error=nil;BOOL bottomRendered=[orientationRenderer renderSource:source destination:destination uniforms:defaults paths:@{} error:&error];
|
||||
NSData *bottomAnalysis=[orientationRenderer preview],*bottomLook=[orientationRenderer lookLUTPreview];
|
||||
bool bottomOrientation=bottomRendered&&bottomAnalysis.length==320*180*16&&bottomLook.length==bottomAnalysis.length;
|
||||
if(bottomOrientation){
|
||||
const float*a=(const float*)bottomAnalysis.bytes,*b=(const float*)bottomLook.bytes;
|
||||
bottomOrientation=a[2]>a[0]&&a[(179*320)*4]>a[(179*320)*4+2]&&b[0]>b[2]&&b[(179*320)*4+2]>b[(179*320)*4];
|
||||
for(NSUInteger y=0;y<180&&bottomOrientation;y++)bottomOrientation=memcmp((const uint8_t*)bottomLook.bytes+y*320*16,(const uint8_t*)bottomAnalysis.bytes+(179-y)*320*16,320*16)==0;
|
||||
}
|
||||
run.record(@"look-preview-bottom-left-flips-only-browser-rows",bottomOrientation,@{@"error":bottomRendered?@"":reason(error),@"analysisKeepsPhysicalRowOrder":@(bottomOrientation),@"all180RowsCompared":@(bottomOrientation)});
|
||||
[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 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.hslHueA.x=28;u.hslSatA.y=45;u.hslLumB.z=-18;Pixels hsl=render(run,renderer,source,destination,gpu,u,@{},@"renderer-hsl-pass");Difference hslDifference=difference(neutral,hsl);run.record(@"hsl-real-table-frame",hslDifference.nonfinite==0&&hslDifference.different>100,measure(hslDifference));
|
||||
u=defaults;u.colorGradingHueSatA.x=210;u.colorGradingHueSatA.y=42;u.colorGradingLuma.x=18;Pixels grading=render(run,renderer,source,destination,gpu,u,@{},@"renderer-grading-pass");Difference gradingDifference=difference(neutral,grading);run.record(@"grading-real-table-frame",gradingDifference.nonfinite==0&&gradingDifference.different>100,measure(gradingDifference));
|
||||
for(int profile=1;profile<=17;profile++){@autoreleasepool{u=defaults;u.inputProfile=profile;Pixels transformed=render(run,renderer,source,destination,gpu,u,@{},[NSString stringWithFormat:@"input-profile-%02d-load-render",profile]);Difference delta=difference(neutral,transformed);run.record([NSString stringWithFormat:@"input-profile-%02d-finite-nonzero",profile],delta.nonfinite==0&&delta.nonzero>100,measure(delta));}}
|
||||
DYRenderer *analysisRenderer=[[[DYRenderer alloc]init]autorelease];u=defaults;u.inputProfile=1;render(run,analysisRenderer,source,destination,gpu,u,@{},@"renderer-input-analysis-pass");
|
||||
u=defaults;u.hslSectionEnabled=1;u.hslHueA.x=28;u.hslSatA.y=45;u.hslLumB.z=-18;Pixels hsl=render(run,renderer,source,destination,gpu,u,@{},@"renderer-hsl-pass");Difference hslDifference=difference(neutral,hsl);run.record(@"hsl-real-table-frame",hslDifference.nonfinite==0&&hslDifference.different>100,measure(hslDifference));
|
||||
checkFoldedGroup(u,offsetof(DYUniforms,hslSectionEnabled),@{},@"folded-hsl-bypasses-retained-adjustments");
|
||||
u=defaults;u.colorGradingSectionEnabled=1;u.colorGradingHueSatA.x=210;u.colorGradingHueSatA.y=42;u.colorGradingLuma.x=18;Pixels grading=render(run,renderer,source,destination,gpu,u,@{},@"renderer-grading-pass");Difference gradingDifference=difference(neutral,grading);run.record(@"grading-real-table-frame",gradingDifference.nonfinite==0&&gradingDifference.different>100,measure(gradingDifference));
|
||||
checkFoldedGroup(u,offsetof(DYUniforms,colorGradingSectionEnabled),@{},@"folded-grading-bypasses-retained-adjustments");
|
||||
for(int profile=1;profile<=17;profile++){@autoreleasepool{u=defaults;u.inputSectionEnabled=1;u.inputProfile=profile;Pixels transformed=render(run,renderer,source,destination,gpu,u,@{},[NSString stringWithFormat:@"input-profile-%02d-load-render",profile]);Difference delta=difference(neutral,transformed);run.record([NSString stringWithFormat:@"input-profile-%02d-finite-nonzero",profile],delta.nonfinite==0&&delta.nonzero>100,measure(delta));}}
|
||||
checkFoldedGroup(u,offsetof(DYUniforms,inputSectionEnabled),@{},@"folded-input-bypasses-retained-profile");
|
||||
DYRenderer *analysisRenderer=[[[DYRenderer alloc]init]autorelease];u=defaults;u.inputSectionEnabled=1;u.inputProfile=1;render(run,analysisRenderer,source,destination,gpu,u,@{},@"renderer-input-analysis-pass");
|
||||
NSData *inputPreview=[analysisRenderer preview];bool analysisDifferent=inputPreview.length==preview.length&&preview.length==320*180*16;double analysisMaximum=0;size_t analysisChanges=0;
|
||||
if(analysisDifferent){const float *a=(const float *)preview.bytes,*b=(const float *)inputPreview.bytes;for(NSUInteger i=0;i<preview.length/4;i++){if(!std::isfinite(a[i])||!std::isfinite(b[i])){analysisDifferent=false;break;}if(i%4!=3){double delta=std::fabs(double(a[i])-b[i]);analysisMaximum=std::max(analysisMaximum,delta);if(delta>1e-5)analysisChanges++;}}}
|
||||
run.record(@"analysis-applies-selected-input-LUT",analysisDifferent&&analysisChanges>100,@{@"changedComponents":@(analysisChanges),@"maxAbsoluteError":@(analysisMaximum)});
|
||||
NSString *lookFile=[runtime stringByAppendingPathComponent:@"diagnostic-look.cube"];NSMutableString *cube=[NSMutableString stringWithString:@"TITLE \"Self test look\"\nLUT_3D_SIZE 2\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
|
||||
for(int b=0;b<2;b++)for(int g=0;g<2;g++)for(int r=0;r<2;r++)[cube appendFormat:@"%.8f %.8f %.8f\n",.7f*r+.1f,.8f*g+.05f,.85f*b+.02f];error=nil;run.need(@"temporary-look-file",[cube writeToFile:lookFile atomically:YES encoding:NSUTF8StringEncoding error:&error],@{@"error":reason(error)});
|
||||
NSDictionary *paths=@{@"look0":lookFile,@"look1":lookFile,@"look2":lookFile,@"look3":lookFile,@"look4":lookFile};u=defaults;u.postLUTStrength=.35f;u.extraPostLUTStrengths=(DYFloat4){.4f,.5f,.6f,.7f};Pixels looks=render(run,renderer,source,destination,gpu,u,paths,@"renderer-five-look-pass");Difference looksDifference=difference(neutral,looks);run.record(@"five-look-mixes-affect-frame",looksDifference.nonfinite==0&&looksDifference.different>100,measure(looksDifference));
|
||||
NSDictionary *paths=@{@"look0":lookFile,@"look1":lookFile,@"look2":lookFile,@"look3":lookFile,@"look4":lookFile};u=defaults;u.lookSectionEnabled=1;u.postLUTStrength=.35f;u.extraPostLUTStrengths=(DYFloat4){.4f,.5f,.6f,.7f};Pixels looks=render(run,renderer,source,destination,gpu,u,paths,@"renderer-five-look-pass");Difference looksDifference=difference(neutral,looks);run.record(@"five-look-mixes-affect-frame",looksDifference.nonfinite==0&&looksDifference.different>100,measure(looksDifference));
|
||||
checkFoldedGroup(u,offsetof(DYUniforms,lookSectionEnabled),paths,@"folded-look-bypasses-retained-LUTs");
|
||||
NSURL *exportURL=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"diagnostic-export.cube"]];error=nil;run.need(@"renderer-export-33cube",[renderer exportLUT:exportURL uniforms:u paths:paths error:&error],@{@"error":reason(error),@"path":exportURL.path});
|
||||
NSString *exported=[NSString stringWithContentsOfURL:exportURL encoding:NSUTF8StringEncoding error:&error];NSUInteger triples=0,nonzero=0;bool exportFinite=true;for(NSString *line in [exported componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){triples++;exportFinite&=std::isfinite(r)&&std::isfinite(g)&&std::isfinite(b);if(r!=0||g!=0||b!=0)nonzero++;}}
|
||||
run.record(@"export-33cube-data-contract",[exported containsString:@"LUT_3D_SIZE 33"]&&triples==33*33*33&&exportFinite&&nonzero>0,@{@"rows":@(triples),@"nonzeroRows":@(nonzero),@"bytes":@([[[NSFileManager defaultManager]attributesOfItemAtPath:exportURL.path error:nil][NSFileSize]unsignedLongLongValue])});
|
||||
// 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:®ular 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"});
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <FxPlug/FxPlugSDK.h>
|
||||
@class DYRenderer;
|
||||
|
||||
/// Per-instance custom inspector. All host reads and edits are bracketed actions.
|
||||
@interface DYInspector : NSView
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager;
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer;
|
||||
- (void)refresh;
|
||||
@end
|
||||
+338
-87
@@ -1,15 +1,19 @@
|
||||
#import "DYInspector.h"
|
||||
#import "DYModel.h"
|
||||
#import "DYTheme.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#import "DYLUTBrowser.h"
|
||||
#import "DYRenderer.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
static NSColor *DYAccent(void) { return [NSColor colorWithSRGBRed:.26 green:.73 blue:.98 alpha:1]; }
|
||||
static NSColor *DYInk(void) { return [NSColor colorWithSRGBRed:.83 green:.91 blue:.97 alpha:1]; }
|
||||
static NSColor *DYAccent(void) { return DYThemeColor(@"accent"); }
|
||||
static NSColor *DYInk(void) { return DYThemeColor(@"text"); }
|
||||
static NSTextField *DYLabel(NSString *text, CGFloat size) {
|
||||
NSTextField *v=[NSTextField labelWithString:text?:@""];
|
||||
v.font=[NSFont systemFontOfSize:size]; v.textColor=DYInk();
|
||||
v.font=[NSFont systemFontOfSize:size weight:size==11?NSFontWeightMedium:NSFontWeightRegular]; v.textColor=DYThemeColor(@"slot15");
|
||||
v.lineBreakMode=NSLineBreakByTruncatingTail;
|
||||
return v;
|
||||
}
|
||||
@@ -18,27 +22,56 @@ static NSButton *DYButton(NSString *title,id target,SEL action) {
|
||||
b.bezelStyle=NSBezelStyleRounded; b.font=[NSFont systemFontOfSize:11];
|
||||
b.contentTintColor=DYAccent(); return b;
|
||||
}
|
||||
static BOOL DYStrengthUsesUnitRange(NSDictionary *d) {
|
||||
return [d[@"key"] hasSuffix:@"Strength"] && [d[@"max"] doubleValue]<=1;
|
||||
}
|
||||
static NSString *DYNumber(double value,NSDictionary *d) {
|
||||
if([d[@"key"] hasSuffix:@"Strength"])return [NSString stringWithFormat:@"%.0f%%",value*(DYStrengthUsesUnitRange(d)?100:1)];
|
||||
double step=[d[@"step"] doubleValue];
|
||||
return [NSString stringWithFormat:step>0&&step<.1?@"%.2f":step>0&&step<1?@"%.1f":@"%.0f",value];
|
||||
}
|
||||
|
||||
|
||||
@interface DYBlueSliderCell : NSSliderCell @end
|
||||
@interface DYBlueSliderCell : NSSliderCell
|
||||
@property(copy) NSString *colorKey;
|
||||
@end
|
||||
@implementation DYBlueSliderCell
|
||||
- (void)dealloc {[_colorKey release];[super dealloc];}
|
||||
- (NSArray *)trackColors {
|
||||
if([_colorKey isEqual:@"temperature"])return @[[NSColor colorWithSRGBRed:.21 green:.45 blue:1 alpha:1],[NSColor colorWithSRGBRed:1 green:.78 blue:.27 alpha:1]];
|
||||
if([_colorKey isEqual:@"tint"])return @[[NSColor colorWithSRGBRed:.2 green:.85 blue:.36 alpha:1],[NSColor colorWithSRGBRed:.95 green:.23 blue:.88 alpha:1]];
|
||||
if([_colorKey isEqual:@"vibrance"]||[_colorKey isEqual:@"saturation"])return @[[NSColor colorWithWhite:.45 alpha:1],NSColor.systemYellowColor,NSColor.systemGreenColor,NSColor.systemBlueColor,NSColor.systemPinkColor];
|
||||
int axis=0,color=0;if(sscanf(_colorKey.UTF8String?:"","hsl%d_%d",&axis,&color)==2){
|
||||
double hue=((double[]){0,.08,.16,.33,.5,.61,.76,.9})[MAX(0,MIN(7,color))];NSColor *center=[NSColor colorWithCalibratedHue:hue saturation:.85 brightness:1 alpha:1];
|
||||
if(axis==0)return @[[NSColor colorWithCalibratedHue:fmod(hue+.9,1) saturation:.9 brightness:1 alpha:1],center,[NSColor colorWithCalibratedHue:fmod(hue+.1,1) saturation:.9 brightness:1 alpha:1]];
|
||||
if(axis==1)return @[[NSColor colorWithWhite:.45 alpha:1],center];
|
||||
return @[[NSColor blackColor],center,[center blendedColorWithFraction:.65 ofColor:NSColor.whiteColor]];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped {
|
||||
NSRect track=NSMakeRect(rect.origin.x,NSMidY(rect)-2,rect.size.width,4);
|
||||
[[NSColor colorWithSRGBRed:.19 green:.30 blue:.37 alpha:1] setFill];[[NSBezierPath bezierPathWithRoundedRect:track xRadius:2 yRadius:2] fill];
|
||||
NSRect track=NSMakeRect(rect.origin.x,NSMidY(rect)-2.5,rect.size.width,5);
|
||||
NSArray *colors=[self trackColors];if(colors){NSGradient *g=[[[NSGradient alloc]initWithColors:colors]autorelease];[g drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:track xRadius:2.5 yRadius:2.5] angle:0];return;}
|
||||
NSBezierPath *bar=[NSBezierPath bezierPathWithRoundedRect:track xRadius:2.5 yRadius:2.5];NSGradient *base=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"slot8"] endingColor:DYThemePalette()[@"slot9"]]autorelease];[base drawInBezierPath:bar angle:90];[[NSColor colorWithWhite:0 alpha:.28]setStroke];bar.lineWidth=.6;[bar stroke];
|
||||
double fraction=(self.doubleValue-self.minValue)/fmax(.000001,self.maxValue-self.minValue);
|
||||
NSRect active=track;active.size.width*=fmax(0,fmin(1,fraction));[DYAccent() setFill];[[NSBezierPath bezierPathWithRoundedRect:active xRadius:2 yRadius:2] fill];
|
||||
NSRect active=track;active.size.width*=fmax(0,fmin(1,fraction));NSGradient *g=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"activeTop"] endingColor:DYThemePalette()[@"activeBottom"]]autorelease];[g drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:active xRadius:2 yRadius:2] angle:90];
|
||||
}
|
||||
- (void)drawKnob:(NSRect)knobRect {
|
||||
NSRect circle=NSInsetRect(knobRect,1,1);
|
||||
[[NSColor colorWithSRGBRed:.69 green:.88 blue:1 alpha:1] setFill];[[NSBezierPath bezierPathWithOvalInRect:circle] fill];
|
||||
[DYThemeColor(@"knob") setFill];[[NSBezierPath bezierPathWithOvalInRect:circle] fill];
|
||||
[DYAccent() setStroke];NSBezierPath *ring=[NSBezierPath bezierPathWithOvalInRect:circle];ring.lineWidth=.7;[ring stroke];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface DYNumberFieldCell : NSTextFieldCell @end
|
||||
@implementation DYNumberFieldCell
|
||||
- (void)drawWithFrame:(NSRect)frame inView:(NSView *)view {
|
||||
NSRect rect=NSInsetRect(frame,.5,.5);NSBezierPath *p=[NSBezierPath bezierPathWithRoundedRect:rect xRadius:2.5 yRadius:2.5];
|
||||
NSGradient *gradient=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"slot5"] endingColor:DYThemePalette()[@"slot4"]]autorelease];[gradient drawInBezierPath:p angle:90];[[DYThemePalette()[@"accent"]colorWithAlphaComponent:.65]setStroke];p.lineWidth=.9;[p stroke];
|
||||
[self drawInteriorWithFrame:NSInsetRect(frame,4,3) inView:view];
|
||||
}
|
||||
@end
|
||||
|
||||
// FxPlug's remote view bridge needs an explicit container tree; an ignored
|
||||
// NSView document can otherwise make a populated NSScrollView appear empty.
|
||||
static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
|
||||
@@ -92,10 +125,11 @@ static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
|
||||
@interface DYCard : DYFlippedView @end
|
||||
@implementation DYCard
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
[[NSColor colorWithSRGBRed:.045 green:.135 blue:.20 alpha:1] setFill];
|
||||
[DYThemeColor(@"card") setFill];
|
||||
NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds,.5,.5) xRadius:11 yRadius:11];
|
||||
[path fill]; [[NSColor colorWithSRGBRed:.16 green:.34 blue:.45 alpha:1] setStroke];
|
||||
[path fill]; [DYThemeColor(@"border") setStroke];
|
||||
path.lineWidth=1; [path stroke];
|
||||
[[NSColor colorWithWhite:.52 alpha:1]setFill];[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(32,19,5,5)]fill];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -103,12 +137,43 @@ static NSArray *DYAccessibleSubviews(NSView *view, BOOL visibleOnly) {
|
||||
@property SEL doubleClickAction;
|
||||
@end
|
||||
@implementation DYHeader
|
||||
- (void)drawRect:(NSRect)dirtyRect {
|
||||
NSRect r=NSInsetRect(self.bounds,.5,2);
|
||||
NSGradient *g=[[[NSGradient alloc]initWithStartingColor:DYThemePalette()[@"headerTop"] endingColor:DYThemePalette()[@"headerBottom"]]autorelease];
|
||||
[g drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:r xRadius:8 yRadius:8] angle:90];
|
||||
NSDictionary *attributes=@{NSFontAttributeName:self.font,NSForegroundColorAttributeName:DYInk()};
|
||||
[(self.state==NSControlStateValueOn?@"▾":@"▸") drawInRect:NSMakeRect(8,7,12,16) withAttributes:attributes];
|
||||
[self.title drawInRect:NSMakeRect(23,7,MAX(0,r.size.width-31),16) withAttributes:attributes];
|
||||
}
|
||||
- (void)mouseDown:(NSEvent *)event {
|
||||
if(event.clickCount==2) [NSApp sendAction:self.doubleClickAction to:self.target from:self];
|
||||
else [super mouseDown:event];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface DYSwatchButton : NSButton
|
||||
@property(nonatomic,retain) NSColor *swatch;
|
||||
@end
|
||||
@implementation DYSwatchButton
|
||||
- (void)dealloc {[_swatch release];[super dealloc];}
|
||||
- (void)drawRect:(NSRect)dirtyRect {
|
||||
NSRect r=NSInsetRect(self.bounds,3,3);[_swatch setFill];NSBezierPath *p=[NSBezierPath bezierPathWithRoundedRect:r xRadius:5 yRadius:5];[p fill];
|
||||
if([self.identifier isEqual:@"customColorSwatch"]){NSGradient *g=[[[NSGradient alloc]initWithColors:@[NSColor.systemRedColor,NSColor.systemYellowColor,NSColor.systemGreenColor,NSColor.systemCyanColor,NSColor.systemBlueColor,NSColor.systemPurpleColor]]autorelease];[g drawInBezierPath:p angle:45];[@"⌾" drawInRect:NSInsetRect(r,3,1) withAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:16],NSForegroundColorAttributeName:NSColor.whiteColor}];}
|
||||
if(self.state==NSControlStateValueOn){[DYInk() setStroke];p.lineWidth=2;[p stroke];}
|
||||
}
|
||||
@end
|
||||
|
||||
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 *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"]];
|
||||
}
|
||||
|
||||
|
||||
@protocol DYGraphicDelegate <NSObject>
|
||||
- (void)writeGraphicValues:(NSDictionary *)values;
|
||||
@@ -315,27 +380,48 @@ static NSImage *DYWheelImage(void) {
|
||||
NSMutableDictionary *_assetButtons;
|
||||
NSMutableArray *_graphics;
|
||||
NSColorSampler *_sampler;
|
||||
DYRenderer *_renderer;
|
||||
DYLUTLibrary *_library;
|
||||
DYLUTBrowser *_browser;
|
||||
NSArray *_themeButtons;
|
||||
NSMutableDictionary *_tabs;
|
||||
NSInteger _visibleLooks;
|
||||
BOOL _refreshing;
|
||||
NSMutableDictionary *_assetLoads,*_assetLoadIDs;
|
||||
NSUInteger _nextAssetLoadID;
|
||||
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
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager {
|
||||
return [self initWithAPIManager:manager renderer:nil];
|
||||
}
|
||||
- (instancetype)initWithAPIManager:(id<PROAPIAccessing>)manager renderer:(DYRenderer *)renderer {
|
||||
if((self=[super initWithFrame:NSMakeRect(0,0,360,780)])) {
|
||||
_manager=manager; _sections=[DYSections() copy];
|
||||
_assetLoads=[NSMutableDictionary new];_assetLoadIDs=[NSMutableDictionary new];_manager=manager; _renderer=[renderer retain];_library=[DYLUTLibrary new];_tabs=[NSMutableDictionary new];_visibleLooks=1;
|
||||
_sections=[DYPresentationSections() copy];
|
||||
_cards=[[NSMutableArray alloc] init]; _controls=[[NSMutableDictionary alloc] init];
|
||||
_assetButtons=[[NSMutableDictionary alloc] init]; _graphics=[[NSMutableArray alloc] init];
|
||||
self.autoresizingMask=NSViewWidthSizable;
|
||||
self.clipsToBounds=YES;
|
||||
self.wantsLayer=YES; self.layer.masksToBounds=YES;
|
||||
self.layer.backgroundColor=[[NSColor colorWithSRGBRed:.018 green:.074 blue:.12 alpha:1] CGColor];
|
||||
_brand=[DYLabel(@"大鱼调色",20) retain]; _brand.font=[NSFont boldSystemFontOfSize:20];
|
||||
_subtitle=[DYLabel(@"颜色 · 光影 · 风格",10) retain]; _subtitle.textColor=DYAccent();
|
||||
_resetAll=[DYButton(@"全部还原",self,@selector(resetAll:)) retain]; _resetAll.toolTip=@"恢复全部调色参数与 LUT";
|
||||
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.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];
|
||||
_export=[DYButton(@"导出 LUT",self,@selector(exportLUT:)) retain];
|
||||
for(NSView *v in @[_brand,_subtitle,_resetAll,_save,_load,_export]) [self addSubview:v];
|
||||
NSMutableArray *themes=[NSMutableArray array];for(NSInteger i=0;i<5;i++){
|
||||
DYSwatchButton *b=[[[DYSwatchButton alloc]initWithFrame:NSZeroRect]autorelease];[b setButtonType:NSButtonTypePushOnPushOff];b.swatch=DYThemeSwatch(i);b.tag=i;b.target=self;b.action=@selector(selectTheme:);b.title=@"";b.bordered=NO;
|
||||
b.toolTip=[DYThemeNames()[i] stringByAppendingString:@"主题"];b.accessibilityLabel=b.toolTip;[self addSubview:b];[themes addObject:b];
|
||||
}_themeButtons=[themes copy];
|
||||
_scroll=[[DYInspectorScrollView alloc] initWithFrame:NSZeroRect];
|
||||
_scroll.hasVerticalScroller=YES; _scroll.hasHorizontalScroller=NO; _scroll.drawsBackground=NO;
|
||||
_scroll.autohidesScrollers=YES; _scroll.borderType=NSNoBorder;
|
||||
@@ -348,15 +434,20 @@ static NSImage *DYWheelImage(void) {
|
||||
_scroll.documentView=_document; [self addSubview:_scroll];
|
||||
[self buildCards];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modelChanged:) name:@"DYModelChanged" object:_manager];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(themeChanged:) name:DYThemeDidChange object:nil];
|
||||
if(_renderer)[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(previewChanged:) name:@"DYPreviewDidChange" object:_renderer];
|
||||
[self themeChanged:nil];
|
||||
[self setAccessibilityLabel:@"大鱼调色检查器"];
|
||||
[self setNeedsLayout:YES];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads release];[_assetLoadIDs release];[_menuScan cancel];[_menuScan release];[_pendingAssetMenuCommand release];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[_brand release]; [_subtitle release]; [_resetAll release]; [_save release]; [_load release]; [_export release];
|
||||
[_scroll release]; [_document release]; [_sections release]; [_cards release]; [_controls release]; [_assetButtons release]; [_graphics release]; [_sampler release];
|
||||
[_browser close];[_browser release];[_renderer release];[_library release];[_themeButtons release];[_tabs release];
|
||||
[super dealloc];
|
||||
}
|
||||
- (BOOL)isFlipped { return YES; }
|
||||
@@ -368,6 +459,7 @@ static NSImage *DYWheelImage(void) {
|
||||
- (NSSize)intrinsicContentSize { return NSMakeSize(360,780); }
|
||||
- (void)viewDidMoveToWindow {
|
||||
[super viewDidMoveToWindow];
|
||||
if(!self.window)[self cancelAssetLoads];
|
||||
if(self.window) {
|
||||
[self refresh];
|
||||
NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
|
||||
@@ -377,6 +469,21 @@ static NSImage *DYWheelImage(void) {
|
||||
if([NSThread isMainThread]) [self refresh];
|
||||
else dispatch_async(dispatch_get_main_queue(),^{ [self refresh]; });
|
||||
}
|
||||
- (void)selectTheme:(NSButton *)button {DYSetThemeIndex(button.tag);}
|
||||
- (void)redrawTree:(NSView *)view { [view setNeedsDisplay:YES];for(NSView *child in view.subviews)[self redrawTree:child]; }
|
||||
- (void)themeChanged:(NSNotification *)notification {
|
||||
self.layer.backgroundColor=[DYThemePalette()[@"background"] CGColor];
|
||||
for(NSButton *b in _themeButtons)b.state=b.tag==DYThemeIndex()?NSControlStateValueOn:NSControlStateValueOff;
|
||||
for(NSDictionary *r in _controls.allValues)[r[@"field"] setBackgroundColor:DYThemeColor(@"field")];
|
||||
[_browser updatePalette:DYThemePalette()];[self redrawTree:self];
|
||||
}
|
||||
- (void)tabChanged:(NSControl *)sender {
|
||||
if([sender isKindOfClass:NSSegmentedControl.class])_tabs[sender.identifier]=@([(NSSegmentedControl *)sender selectedSegment]);
|
||||
else {_tabs[@"hsl"]=@(sender.tag);for(NSView *v in sender.superview.subviews)if([v isKindOfClass:DYSwatchButton.class])[(NSButton *)v setState:v.tag==sender.tag?NSControlStateValueOn:NSControlStateValueOff];}
|
||||
[self setNeedsLayout:YES];NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
|
||||
}
|
||||
- (void)addLook:(id)sender {_visibleLooks=MIN(5,_visibleLooks+1);[self setNeedsLayout:YES];}
|
||||
- (void)previewChanged:(NSNotification *)note {if(_browser.visible)[_browser updatePreview:[_renderer lookLUTPreview]];}
|
||||
- (void)buildCards {
|
||||
NSInteger index=0;
|
||||
for(NSDictionary *section in _sections) {
|
||||
@@ -384,22 +491,24 @@ static NSImage *DYWheelImage(void) {
|
||||
card.accessibilityLabel=section[@"title"];
|
||||
[_document addSubview:card];
|
||||
DYHeader *header=[[[DYHeader alloc] initWithFrame:NSZeroRect] autorelease];
|
||||
header.title=[@"▾ " stringByAppendingString:section[@"title"]?:@""];
|
||||
header.title=[section[@"key"] isEqual:@"skin"]?@"肤色保护设置":section[@"title"];
|
||||
[header setButtonType:NSButtonTypePushOnPushOff];
|
||||
header.bordered=NO; header.alignment=NSTextAlignmentLeft; header.font=[NSFont boldSystemFontOfSize:12];
|
||||
header.contentTintColor=DYInk(); header.target=self; header.action=@selector(toggleSection:); header.tag=index;
|
||||
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"点击折叠;双击还原本组";
|
||||
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开启用,折叠停用;双击还原本组";
|
||||
[card addSubview:header];
|
||||
NSButton *enabled=[NSButton checkboxWithTitle:@"" target:self action:@selector(groupEnabled:)];
|
||||
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=@"启用或旁路本组";
|
||||
enabled.accessibilityLabel=[section[@"title"] stringByAppendingString:@"启用"];
|
||||
[card addSubview:enabled]; enabled.hidden=section[@"enabled"]==nil;
|
||||
NSButton *reset=DYButton(@"↺",self,@selector(resetSection:)); reset.tag=index;
|
||||
reset.toolTip=@"还原本组"; reset.accessibilityLabel=[section[@"title"] stringByAppendingString:@"还原"];
|
||||
reset.bordered=NO;
|
||||
reset.toolTip=@"还原本组默认值与开关"; reset.accessibilityLabel=[section[@"title"] stringByAppendingString:@"还原"];
|
||||
[card addSubview:reset];
|
||||
NSMutableArray *body=[NSMutableArray array];
|
||||
NSString *key=section[@"key"]?:@"";
|
||||
if([key localizedCaseInsensitiveContainsString:@"input"]) {
|
||||
[body addObject:[self assetRowForKey:@"input" title:@"输入 LUT" inCard:card]];
|
||||
[body addObject:[self assetRowForKey:@"input" title:@"输入色彩" inCard:card]];
|
||||
}
|
||||
if([key localizedCaseInsensitiveContainsString:@"look"]) {
|
||||
for(NSInteger i=0;i<5;i++) {
|
||||
@@ -415,9 +524,15 @@ static NSImage *DYWheelImage(void) {
|
||||
[card addSubview:actions];[body addObject:actions];
|
||||
}
|
||||
if([key isEqual:@"hsl"]) {
|
||||
DYFlippedView *tabs=[[[DYFlippedView alloc]initWithFrame:NSZeroRect]autorelease];tabs.identifier=@"hslTabs";
|
||||
for(NSInteger i=0;i<9;i++){DYSwatchButton *b=[[[DYSwatchButton alloc]initWithFrame:NSZeroRect]autorelease];[b setButtonType:NSButtonTypePushOnPushOff];b.swatch=i<8?[NSColor colorWithSRGBRed:((double[]){1,1,1,.15,0,0,.75,1})[i] green:((double[]){.2,.55,.84,.76,.76,.47,.15,.15})[i] blue:((double[]){.25,.12,0,.25,.8,1,.9,.65})[i] alpha:1]:DYAccent();b.title=@"";if(i==8)b.identifier=@"customColorSwatch";b.tag=i;b.target=self;b.action=@selector(tabChanged:);b.state=i==0?NSControlStateValueOn:NSControlStateValueOff;b.accessibilityLabel=[@[@"红",@"橙",@"黄",@"绿",@"青",@"蓝",@"紫",@"洋红",@"自定义"][i] stringByAppendingString:@" HSL"];[tabs addSubview:b];}
|
||||
[card addSubview:tabs];[body addObject:tabs];
|
||||
DYFlippedView *actions=[[[DYFlippedView alloc]initWithFrame:NSZeroRect]autorelease];actions.identifier=@"sampleControls";
|
||||
NSButton *picker=DYButton(@"吸取自定义 HSL 颜色",self,@selector(sampleCustomColor:));[actions addSubview:picker];[card addSubview:actions];[body addObject:actions];
|
||||
}
|
||||
if([key isEqual:@"levels"]||[key isEqual:@"balance"]) {
|
||||
NSSegmentedControl *tabs=[NSSegmentedControl segmentedControlWithLabels:[key isEqual:@"levels"]?@[@"RGB",@"红",@"绿",@"蓝"]:@[@"阴影",@"中间调",@"高光"] trackingMode:NSSegmentSwitchTrackingSelectOne target:self action:@selector(tabChanged:)];tabs.identifier=key;tabs.selectedSegment=0;tabs.controlSize=NSControlSizeSmall;tabs.accessibilityLabel=[section[@"title"] stringByAppendingString:@"通道"];[card addSubview:tabs];[body addObject:tabs];
|
||||
}
|
||||
if([key isEqual:@"curve"]) {
|
||||
DYCurvePanel *graph=[[[DYCurvePanel alloc]initWithFrame:NSZeroRect]autorelease];graph.delegate=self;graph.identifier=@"curveGraph";[card addSubview:graph];[body addObject:graph];[_graphics addObject:graph];
|
||||
}
|
||||
@@ -426,6 +541,7 @@ static NSImage *DYWheelImage(void) {
|
||||
}
|
||||
for(NSDictionary *d in section[@"rows"]) {
|
||||
DYFlippedView *row=[[[DYFlippedView alloc] initWithFrame:NSZeroRect] autorelease];
|
||||
row.identifier=d[@"key"];
|
||||
row.accessibilityLabel=d[@"title"];
|
||||
[card addSubview:row]; [body addObject:row];
|
||||
NSNumber *pid=d[@"pid"]; if(!pid)continue;
|
||||
@@ -447,84 +563,110 @@ static NSImage *DYWheelImage(void) {
|
||||
popup.accessibilityLabel=d[@"title"]; [row addSubview:popup]; record[@"popup"]=popup;
|
||||
} else {
|
||||
NSSlider *slider=[[[NSSlider alloc]initWithFrame:NSZeroRect]autorelease];
|
||||
DYBlueSliderCell *sliderCell=[[[DYBlueSliderCell alloc]init]autorelease];slider.cell=sliderCell;
|
||||
DYBlueSliderCell *sliderCell=[[[DYBlueSliderCell alloc]init]autorelease];sliderCell.colorKey=d[@"key"];slider.cell=sliderCell;
|
||||
slider.minValue=[d[@"min"]doubleValue];slider.maxValue=[d[@"max"]doubleValue];slider.doubleValue=[d[@"default"]doubleValue];slider.target=self;slider.action=@selector(scalarChanged:);
|
||||
slider.tag=[pid integerValue]; slider.continuous=YES; slider.controlSize=NSControlSizeSmall;
|
||||
slider.accessibilityLabel=d[@"title"]; [row addSubview:slider]; record[@"slider"]=slider;
|
||||
NSTextField *field=[[[NSTextField alloc] initWithFrame:NSZeroRect] autorelease];
|
||||
NSTextField *field=[[[NSTextField alloc] initWithFrame:NSZeroRect] autorelease];field.cell=[[[DYNumberFieldCell alloc]initTextCell:@"0"]autorelease];
|
||||
field.font=[NSFont monospacedDigitSystemFontOfSize:11 weight:NSFontWeightMedium];
|
||||
field.textColor=DYInk(); field.backgroundColor=[NSColor colorWithSRGBRed:.08 green:.20 blue:.28 alpha:1];
|
||||
field.bezeled=YES; field.bezelStyle=NSTextFieldRoundedBezel;
|
||||
field.alignment=NSTextAlignmentRight; field.target=self; field.action=@selector(scalarChanged:);
|
||||
field.textColor=DYInk(); field.backgroundColor=DYThemeColor(@"field");
|
||||
field.bezeled=NO;field.bordered=NO;field.drawsBackground=NO;field.editable=YES;field.selectable=YES;
|
||||
field.alignment=NSTextAlignmentCenter; field.target=self; field.action=@selector(scalarChanged:);
|
||||
field.tag=[pid integerValue]; field.accessibilityLabel=[d[@"title"] stringByAppendingString:@"数值"];
|
||||
[row addSubview:field]; record[@"field"]=field;
|
||||
}
|
||||
NSButton *itemReset=DYButton(@"↺",self,@selector(resetScalar:));
|
||||
itemReset.bordered=NO;
|
||||
itemReset.tag=[pid integerValue]; itemReset.toolTip=@"还原此项";
|
||||
itemReset.accessibilityLabel=[d[@"title"] stringByAppendingString:@"还原"];
|
||||
[row addSubview:itemReset]; record[@"reset"]=itemReset;
|
||||
_controls[pid]=record;
|
||||
}
|
||||
[_cards addObject:[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@NO}]];
|
||||
if([key isEqual:@"look"]){
|
||||
NSMutableArray *ordered=[NSMutableArray array];for(NSInteger slot=0;slot<5;slot++){
|
||||
[ordered addObject:_assetButtons[[NSString stringWithFormat:@"look%ld",(long)slot]][@"row"]];NSString *strength=slot==0?@"postLUTStrength":[NSString stringWithFormat:@"look%ldStrength",(long)slot+1];
|
||||
for(NSView *row in body)if([row.identifier isEqual:strength])[ordered addObject:row];
|
||||
}
|
||||
for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered;
|
||||
}
|
||||
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![section[@"defaultEnabled"]boolValue])}];
|
||||
if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;}
|
||||
[_cards addObject:record];
|
||||
index++;
|
||||
}
|
||||
}
|
||||
- (NSView *)assetRowForKey:(NSString *)key title:(NSString *)title inCard:(NSView *)card {
|
||||
DYFlippedView *row=[[[DYFlippedView alloc] initWithFrame:NSZeroRect] autorelease]; [card addSubview:row];
|
||||
DYFlippedView *row=[[[DYFlippedView alloc] initWithFrame:NSZeroRect] autorelease];row.identifier=[@"asset:" stringByAppendingString:key]; [card addSubview:row];
|
||||
NSTextField *label=DYLabel(title,11); [row addSubview:label];
|
||||
NSButton *choose=DYButton(@"无 · 点击选择…",self,@selector(chooseAsset:)); choose.identifier=key;
|
||||
NSButton *browse=DYButton(@"▦",self,@selector(browseAsset:));browse.identifier=key;browse.bordered=NO;browse.font=[NSFont systemFontOfSize:19];browse.accessibilityLabel=[title stringByAppendingString:@"缩略图浏览库"];[row addSubview:browse];
|
||||
NSButton *choose=DYButton(@"无",self,@selector(chooseAsset:)); choose.identifier=key;
|
||||
choose.alignment=NSTextAlignmentLeft; choose.accessibilityLabel=title; [row addSubview:choose];
|
||||
NSButton *remove=DYButton(@"×",self,@selector(removeAsset:)); remove.identifier=key;
|
||||
remove.toolTip=@"移除此 LUT"; remove.accessibilityLabel=[title stringByAppendingString:@"移除"]; [row addSubview:remove];
|
||||
_assetButtons[key]=@{@"row":row,@"label":label,@"choose":choose,@"remove":remove};
|
||||
NSButton *folder=DYButton(@"",self,@selector(openLibraryFolder:));folder.identifier=key;folder.bordered=NO;folder.image=[NSImage imageWithSystemSymbolName:@"folder" accessibilityDescription:@"LUT文件夹"];folder.accessibilityLabel=[title stringByAppendingString:@"文件夹"];[row addSubview:folder];
|
||||
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"row":row,@"label":label,@"choose":choose,@"remove":remove,@"browse":browse,@"folder":folder}];
|
||||
if([key hasPrefix:@"look"]&&[[key substringFromIndex:4]integerValue]>0){NSButton *eye=DYButton(@"",self,@selector(lookEnabled:));eye.identifier=key;eye.bordered=NO;[eye setButtonType:NSButtonTypePushOnPushOff];eye.accessibilityLabel=[title stringByAppendingString:@"启用"];[row addSubview:eye];record[@"eye"]=eye;}
|
||||
_assetButtons[key]=record;
|
||||
return row;
|
||||
}
|
||||
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
|
||||
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
|
||||
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;
|
||||
if([key hasPrefix:@"sample"]||[key hasPrefix:@"custom"]||[key hasPrefix:@"range"]||[key isEqual:@"hslVisualize"])return tab==8;
|
||||
}
|
||||
if([section isEqual:@"grading"]){int wheel=0,axis=0;if(sscanf(key.UTF8String,"grade%d_%d",&wheel,&axis)==2)return axis==2;}
|
||||
if([section isEqual:@"levels"]){int channel=0,axis=0;if(sscanf(key.UTF8String,"level%d_%d",&channel,&axis)==2)return channel==tab;}
|
||||
if([section isEqual:@"balance"]){int channel=0,axis=0;if(sscanf(key.UTF8String,"balance%d_%d",&channel,&axis)==2)return channel==tab;}
|
||||
if([section isEqual:@"look"]){int slot=0;if(sscanf(key.UTF8String,"asset:look%d",&slot)==1)return slot<_visibleLooks;if([key isEqual:@"postLUTStrength"])return YES;int number=0;if(sscanf(key.UTF8String,"look%dStrength",&number)==1)return number-1<_visibleLooks;return NO;}
|
||||
return YES;
|
||||
}
|
||||
- (CGFloat)heightForRow:(NSView *)row {return [row.identifier isEqual:@"curveGraph"]?240:[row.identifier isEqual:@"gradingWheels"]?292:32;}
|
||||
- (void)layout {
|
||||
[super layout];
|
||||
CGFloat w=MAX(240,self.bounds.size.width),h=self.bounds.size.height;
|
||||
_brand.frame=NSMakeRect(16,13,w-124,28); _subtitle.frame=NSMakeRect(17,43,w-124,16);
|
||||
_resetAll.frame=NSMakeRect(w-101,23,86,28);
|
||||
CGFloat gap=6,bw=(w-32-gap*2)/3;
|
||||
_save.frame=NSMakeRect(16,66,bw,27); _load.frame=NSMakeRect(16+bw+gap,66,bw,27); _export.frame=NSMakeRect(16+(bw+gap)*2,66,bw,27);
|
||||
_scroll.frame=NSMakeRect(0,104,w,MAX(80,h-104));
|
||||
CGFloat cw=MAX(220,_scroll.contentSize.width-24),y=7;
|
||||
CGFloat w=MAX(280,self.bounds.size.width),h=self.bounds.size.height;
|
||||
_brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,40,13);
|
||||
for(NSInteger i=0;i<5;i++)[_themeButtons[i]setFrame:NSMakeRect(w-146+i*22,17,21,22)];
|
||||
_resetAll.frame=NSMakeRect(w-33,16,23,24);
|
||||
CGFloat gap=7,bw=(w-32-gap*2)/3;
|
||||
_save.frame=NSMakeRect(16,50,bw,27); _load.frame=NSMakeRect(16+bw+gap,50,bw,27); _export.frame=NSMakeRect(16+(bw+gap)*2,50,bw,27);
|
||||
_scroll.frame=NSMakeRect(0,88,w,MAX(80,h-88));
|
||||
CGFloat cw=MAX(244,_scroll.contentSize.width-32),y=8;
|
||||
for(NSMutableDictionary *c in _cards) {
|
||||
DYCard *card=c[@"view"]; BOOL collapsed=[c[@"collapsed"] boolValue];
|
||||
DYCard *card=c[@"view"];BOOL collapsed=[c[@"collapsed"]boolValue];NSString *key=c[@"section"][@"key"];
|
||||
NSArray *body=c[@"body"];CGFloat contentHeight=0;
|
||||
for(NSView *row in body)contentHeight+=[row.identifier isEqual:@"curveGraph"]?240:[row.identifier isEqual:@"gradingWheels"]?292:35;
|
||||
CGFloat bh=collapsed?0:contentHeight+9;
|
||||
card.frame=NSMakeRect(12,y,cw,43+bh); y+=card.frame.size.height+12;
|
||||
[c[@"enabled"] setFrame:NSMakeRect(12,12,20,20)];
|
||||
[c[@"header"] setFrame:NSMakeRect(36,8,cw-82,28)];
|
||||
[c[@"reset"] setFrame:NSMakeRect(cw-39,10,27,24)];
|
||||
CGFloat rowY=43;
|
||||
for(NSView *row in body)if([self showRow:row section:key])contentHeight+=[self heightForRow:row];
|
||||
[c[@"enabled"]setFrame:NSMakeRect(12,12,20,20)];
|
||||
CGFloat titleWidth=MIN(cw-104,MAX(94,[[(NSButton *)c[@"header"]title]sizeWithAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:12]}].width+36));
|
||||
[c[@"header"]setFrame:NSMakeRect(42,8,titleWidth,28)];
|
||||
CGFloat headerHeight=43;
|
||||
card.frame=NSMakeRect(16,y,cw,headerHeight+(collapsed?0:contentHeight+8));y+=card.frame.size.height+12;
|
||||
[c[@"reset"]setFrame:NSMakeRect(cw-36,10,24,24)];
|
||||
[c[@"add"]setFrame:NSMakeRect(cw-64,10,24,24)];[c[@"add"]setEnabled:_visibleLooks<5];[c[@"add"]setHidden:collapsed];
|
||||
CGFloat rowY=headerHeight;
|
||||
for(NSView *row in body) {
|
||||
CGFloat rh=[row.identifier isEqual:@"curveGraph"]?240:[row.identifier isEqual:@"gradingWheels"]?292:35;row.hidden=collapsed;row.frame=NSMakeRect(10,rowY,cw-20,rh-2);rowY+=rh;
|
||||
BOOL show=!collapsed&&[self showRow:row section:key];row.hidden=!show;if(!show)continue;
|
||||
CGFloat rh=[self heightForRow:row];row.frame=NSMakeRect(12,rowY,cw-24,rh-1);rowY+=rh;
|
||||
if([row.identifier isEqual:@"autoControls"]||[row.identifier isEqual:@"sampleControls"]) {
|
||||
CGFloat buttonWidth=(row.bounds.size.width-8-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger buttonIndex=0;
|
||||
for(NSView *button in row.subviews)[button setFrame:NSMakeRect(4+(buttonWidth+4)*buttonIndex++,4,buttonWidth,26)];
|
||||
CGFloat buttonWidth=(row.bounds.size.width-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger i=0;
|
||||
for(NSView *button in row.subviews)[button setFrame:NSMakeRect((buttonWidth+4)*i++,3,buttonWidth,25)];
|
||||
}
|
||||
if([row.identifier isEqual:@"hslTabs"]){CGFloat width=row.bounds.size.width/9;NSInteger i=0;for(NSView *button in row.subviews)[button setFrame:NSMakeRect(i++*width,1,width-1,27)];}
|
||||
}
|
||||
}
|
||||
for(NSDictionary *record in _controls.allValues) {
|
||||
CGFloat rw=[record[@"row"] bounds].size.width;
|
||||
CGFloat lw=MIN(111,MAX(76,rw*.34));
|
||||
CGFloat eyeWidth=record[@"itemEnabled"]?20:0;
|
||||
[record[@"itemEnabled"] setFrame:NSMakeRect(0,6,20,20)];
|
||||
[record[@"label"] setFrame:NSMakeRect(5+eyeWidth,8,lw-eyeWidth,18)];
|
||||
[record[@"reset"] setFrame:NSMakeRect(rw-27,5,25,24)];
|
||||
if(record[@"toggle"]) [record[@"toggle"] setFrame:NSMakeRect(lw+12,6,45,22)];
|
||||
if(record[@"popup"]) [record[@"popup"] setFrame:NSMakeRect(lw+8,5,rw-lw-41,25)];
|
||||
if(record[@"slider"]) {
|
||||
[record[@"slider"] setFrame:NSMakeRect(lw+8,8,MAX(25,rw-lw-103),18)];
|
||||
[record[@"field"] setFrame:NSMakeRect(rw-88,5,57,24)];
|
||||
}
|
||||
CGFloat rw=[record[@"row"]bounds].size.width,lw=MIN(103,MAX(77,rw*.34)),eyeWidth=record[@"itemEnabled"]?20:0;
|
||||
[record[@"itemEnabled"]setFrame:NSMakeRect(0,6,18,18)];
|
||||
[record[@"label"]setFrame:NSMakeRect(2+eyeWidth,7,lw-eyeWidth,18)];
|
||||
[record[@"reset"]setFrame:NSMakeRect(rw-23,4,22,24)];
|
||||
if(record[@"toggle"])[record[@"toggle"]setFrame:NSMakeRect(lw+8,5,45,22)];
|
||||
if(record[@"popup"])[record[@"popup"]setFrame:NSMakeRect(lw+7,3,rw-lw-34,25)];
|
||||
if(record[@"slider"]){[record[@"slider"]setFrame:NSMakeRect(lw+7,7,MAX(25,rw-lw-94),18)];[record[@"field"]setFrame:NSMakeRect(rw-81,4,54,24)];}
|
||||
}
|
||||
for(NSDictionary *record in _assetButtons.allValues) {
|
||||
CGFloat rw=[record[@"row"] bounds].size.width;
|
||||
[record[@"label"] setFrame:NSMakeRect(5,8,88,18)];
|
||||
[record[@"choose"] setFrame:NSMakeRect(95,4,MAX(80,rw-127),26)];
|
||||
[record[@"remove"] setFrame:NSMakeRect(rw-27,5,25,24)];
|
||||
for(NSString *key in _assetButtons){NSDictionary *r=_assetButtons[key];CGFloat rw=[r[@"row"]bounds].size.width;BOOL input=[key isEqual:@"input"];
|
||||
[r[@"browse"]setHidden:input];[r[@"eye"]setFrame:NSMakeRect(0,5,18,20)];[r[@"browse"]setFrame:NSMakeRect(r[@"eye"]?20:0,4,20,24)];[r[@"label"]setFrame:NSMakeRect(input?2:r[@"eye"]?43:25,7,input?86:r[@"eye"]?51:69,18)];
|
||||
[r[@"choose"]setFrame:NSMakeRect(97,3,MAX(65,rw-152),26)];[r[@"folder"]setFrame:NSMakeRect(rw-51,4,24,24)];[r[@"remove"]setFrame:NSMakeRect(rw-23,4,22,24)];
|
||||
}
|
||||
[_document setFrameSize:NSMakeSize(_scroll.contentSize.width,MAX(y,_scroll.contentSize.height))];
|
||||
}
|
||||
@@ -533,6 +675,7 @@ static NSImage *DYWheelImage(void) {
|
||||
if(_refreshing||!_manager)return;
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI]; if(!action)return;
|
||||
_refreshing=YES;
|
||||
BOOL groupingChanged=NO;
|
||||
[action startAction:self];
|
||||
@try {
|
||||
CMTime t=action.currentTime;
|
||||
@@ -549,19 +692,39 @@ static NSImage *DYWheelImage(void) {
|
||||
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))];
|
||||
}
|
||||
for(id graphic in _graphics)[graphic setValues:graphicValues];
|
||||
for(NSDictionary *c in _cards) {
|
||||
for(NSMutableDictionary *c in _cards) {
|
||||
NSNumber *pid=c[@"section"][@"enabled"];
|
||||
double v=1;if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
|
||||
[c[@"enabled"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
|
||||
for(NSView *row in c[@"body"])row.alphaValue=v>=.5?1:.45;
|
||||
double v=[c[@"section"][@"defaultEnabled"]doubleValue];if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
|
||||
NSNumber *extra=c[@"section"][@"extraEnabled"];double extraValue=0;
|
||||
if(extra)[get getFloatValue:&extraValue fromParameter:extra.unsignedIntValue atTime:t];
|
||||
BOOL enabled=v>=.5||extraValue>=.5;
|
||||
BOOL collapsed=!enabled;groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
|
||||
[c[@"header"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
|
||||
[c[@"header"]setToolTip:enabled?@"折叠并停用本组,保留参数值;双击还原本组":@"展开并启用本组,恢复之前的参数值;双击还原本组"];
|
||||
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];
|
||||
[c[@"header"]setNeedsDisplay:YES];
|
||||
[c[@"enabled"] setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
|
||||
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"折叠并停用本组":@"展开并启用本组"]];
|
||||
[c[@"enabled"]setToolTip:enabled?@"折叠并停用本组,保留参数值":@"展开并启用本组,恢复之前的参数值"];
|
||||
[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
|
||||
// Visibility and rendering share the host's section enable value.
|
||||
for(NSView *row in c[@"body"])row.alphaValue=1;
|
||||
}
|
||||
DYAssetState *assets=DYReadAssets(_manager,t);
|
||||
for(NSString *key in _assetButtons) {
|
||||
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
|
||||
button.title=path.length?path.lastPathComponent:@"无 · 点击选择…"; button.toolTip=path.length?path:@"选择 .cube 立体 LUT";
|
||||
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
|
||||
if([key isEqual:@"input"]&&!path.length){double profile=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSArray *options=d[@"options"];NSInteger index=MAX(0,MIN((NSInteger)llround(profile),(NSInteger)options.count-1));name=options[index];break;}}
|
||||
button.title=_assetLoads[key]?@"正在载入…":name; button.toolTip=path.length?path:@"选择输入转换或 LUT;点击网格图标浏览缩略图";
|
||||
[_assetButtons[key][@"remove"] setEnabled:path.length>0];
|
||||
NSButton *eye=_assetButtons[key][@"eye"];if(eye){NSInteger slot=[[key substringFromIndex:4]integerValue];double enabled=1;[get getFloatValue:&enabled fromParameter:2040+(UInt32)slot-1 atTime:t];eye.state=enabled>=.5?NSControlStateValueOn:NSControlStateValueOff;eye.image=[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"];}
|
||||
}
|
||||
for(NSInteger i=1;i<5;i++)if([assets.paths[[NSString stringWithFormat:@"look%ld",(long)i]]length])_visibleLooks=MAX(_visibleLooks,i+1);
|
||||
[self setNeedsLayout:YES];
|
||||
} @finally { [action endAction:self]; _refreshing=NO; }
|
||||
// Remote layout/accessibility can re-enter the host. Let the parameter
|
||||
// action and current callback unwind before notifying the remote view.
|
||||
if(groupingChanged)dispatch_async(dispatch_get_main_queue(),^{NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);});
|
||||
}
|
||||
- (void)postChanged { [[NSNotificationCenter defaultCenter] postNotificationName:@"DYModelChanged" object:_manager]; }
|
||||
- (void)scalarChanged:(NSControl *)sender {
|
||||
@@ -573,7 +736,10 @@ static NSImage *DYWheelImage(void) {
|
||||
else {
|
||||
if([sender isKindOfClass:[NSTextField class]]) {
|
||||
NSScanner *scanner=[NSScanner scannerWithString:sender.stringValue];
|
||||
NSString *text=[sender.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];BOOL percent=[text hasSuffix:@"%"];
|
||||
if(percent)text=[text substringToIndex:text.length-1];scanner=[NSScanner scannerWithString:text];
|
||||
if(![scanner scanDouble:&v]||!scanner.isAtEnd||!std::isfinite(v)){NSBeep();[self refresh];return;}
|
||||
if(DYStrengthUsesUnitRange(d))v/=100.;
|
||||
} else v=sender.doubleValue;
|
||||
}
|
||||
v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v));
|
||||
@@ -595,7 +761,7 @@ static NSImage *DYWheelImage(void) {
|
||||
NSDictionary *d=_controls[@(sender.tag)][@"descriptor"];NSNumber *pid=d[@"enabled"];if(!pid)return;
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:sender.state==NSControlStateValueOn?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];}
|
||||
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];double value=sender.state==NSControlStateValueOn?1:0;[set setFloatValue:value toParameter:pid.unsignedIntValue atTime:action.currentTime];}
|
||||
@finally {[action endAction:self];}
|
||||
[self postChanged];
|
||||
}
|
||||
@@ -609,23 +775,27 @@ static NSImage *DYWheelImage(void) {
|
||||
} @finally {[action endAction:self];}
|
||||
[self postChanged];
|
||||
}
|
||||
- (void)groupEnabled:(NSButton *)sender {
|
||||
if(sender.tag>=_cards.count)return;
|
||||
NSNumber *pid=_cards[sender.tag][@"section"][@"enabled"];if(!pid)return;
|
||||
- (void)setSectionEnabled:(BOOL)enabled atIndex:(NSInteger)index {
|
||||
if(index<0||index>=_cards.count)return;
|
||||
NSDictionary *section=_cards[index][@"section"];
|
||||
NSNumber *pid=section[@"enabled"];if(!pid)return;
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:sender.state==NSControlStateValueOn?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];}
|
||||
@try {
|
||||
id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
|
||||
[set setFloatValue:enabled?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];
|
||||
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:enabled?1:0 toParameter:extra.unsignedIntValue atTime:action.currentTime];
|
||||
}
|
||||
@finally {[action endAction:self];}
|
||||
[self postChanged];
|
||||
}
|
||||
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
|
||||
- (void)toggleSection:(NSButton *)sender {
|
||||
if(sender.tag>=_cards.count)return;
|
||||
NSMutableDictionary *card=_cards[sender.tag];BOOL collapsed=![card[@"collapsed"] boolValue];card[@"collapsed"]=@(collapsed);
|
||||
sender.title=[(collapsed?@"▸ ":@"▾ ") stringByAppendingString:card[@"section"][@"title"]?:@""];
|
||||
[self setNeedsLayout:YES];
|
||||
NSAccessibilityPostNotification(self,NSAccessibilityLayoutChangedNotification);
|
||||
if(sender.tag<0||sender.tag>=_cards.count)return;
|
||||
[self setSectionEnabled:[_cards[sender.tag][@"collapsed"]boolValue] atIndex:sender.tag];
|
||||
}
|
||||
- (void)resetSection:(NSButton *)sender {
|
||||
[self cancelAssetLoads];
|
||||
if(sender.tag>=_cards.count)return;
|
||||
NSDictionary *section=_cards[sender.tag][@"section"];
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
@@ -633,7 +803,9 @@ static NSImage *DYWheelImage(void) {
|
||||
@try {
|
||||
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
|
||||
for(NSDictionary *d in section[@"rows"]) {[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];if(d[@"enabled"])[set setFloatValue:1 toParameter:[d[@"enabled"] unsignedIntValue] atTime:t];}
|
||||
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:1 toParameter:enabled.unsignedIntValue atTime:t];
|
||||
double defaultEnabled=[section[@"defaultEnabled"]doubleValue];
|
||||
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:defaultEnabled toParameter:enabled.unsignedIntValue atTime:t];
|
||||
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:defaultEnabled toParameter:extra.unsignedIntValue atTime:t];
|
||||
NSString *key=section[@"key"]?:@"";
|
||||
if([key localizedCaseInsensitiveContainsString:@"input"]||[key localizedCaseInsensitiveContainsString:@"look"]) {
|
||||
DYAssetState *assets=[[DYReadAssets(_manager,t) copy] autorelease];
|
||||
@@ -648,6 +820,7 @@ static NSImage *DYWheelImage(void) {
|
||||
[self postChanged];
|
||||
}
|
||||
- (void)resetAll:(id)sender {
|
||||
[self cancelAssetLoads];
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
@try {
|
||||
@@ -658,23 +831,100 @@ static NSImage *DYWheelImage(void) {
|
||||
[self postChanged];
|
||||
}
|
||||
- (void)chooseAsset:(NSButton *)sender {
|
||||
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=nil;
|
||||
if(!_menuScan)_menuScan=[[_library reloadAsync:^(NSError *error){[_menuScan release];_menuScan=nil;}]retain];
|
||||
NSMenu *menu=[[[NSMenu alloc]initWithTitle:@"LUT"]autorelease];
|
||||
NSMenuItem *none=[menu addItemWithTitle:@"无" action:@selector(assetMenuItem:) keyEquivalent:@""];none.target=self;none.representedObject=@{@"key":sender.identifier,@"path":@"",@"profile":@0};
|
||||
if([sender.identifier isEqual:@"input"]){for(NSDictionary *d in DYDescriptors())if([d[@"key"]isEqual:@"inputProfile"]){NSInteger i=0;for(NSString *title in d[@"options"]){if(i){NSMenuItem *item=[menu addItemWithTitle:title action:@selector(assetMenuItem:) keyEquivalent:@""];item.target=self;item.representedObject=@{@"key":@"input",@"profile":@(i),@"path":@""};}i++;}break;}}
|
||||
[menu addItem:NSMenuItem.separatorItem];NSMenuItem *browser=[menu addItemWithTitle:@"缩略图浏览库…" action:@selector(assetMenuBrowse:) keyEquivalent:@""];browser.target=self;browser.representedObject=sender.identifier;
|
||||
NSMenuItem *file=[menu addItemWithTitle:@"载入 LUT 文件…" action:@selector(assetMenuFile:) keyEquivalent:@""];file.target=self;file.representedObject=sender.identifier;
|
||||
NSMutableDictionary *folders=[NSMutableDictionary dictionary];NSUInteger count=0;
|
||||
for(NSDictionary *entry in _library.entries){if(count++>=100)break;NSString *folder=entry[@"relativeFolder"];NSMenu *parent=menu;
|
||||
if(folder.length){parent=folders[folder];if(!parent){NSMenuItem *group=[menu addItemWithTitle:folder action:nil keyEquivalent:@""];parent=[[[NSMenu alloc]initWithTitle:folder]autorelease];group.submenu=parent;folders[folder]=parent;}}
|
||||
NSMenuItem *item=[parent addItemWithTitle:entry[@"name"] action:@selector(assetMenuItem:) keyEquivalent:@""];item.target=self;item.representedObject=@{@"key":sender.identifier,@"path":entry[@"path"]};
|
||||
}
|
||||
if(_library.entries.count>100){NSMenuItem *more=[menu addItemWithTitle:@"更多 LUT,请打开缩略图浏览库…" action:@selector(assetMenuBrowse:) keyEquivalent:@""];more.target=self;more.representedObject=sender.identifier;}
|
||||
[menu popUpMenuPositioningItem:nil atLocation:NSMakePoint(0,sender.bounds.size.height) inView:sender];
|
||||
// Return from menu tracking and the remote button action before opening a panel.
|
||||
NSDictionary *command=[_pendingAssetMenuCommand autorelease];_pendingAssetMenuCommand=nil;
|
||||
if(command)dispatch_async(dispatch_get_main_queue(),^{if(self.window)[self performAssetMenuCommand:command];});
|
||||
}
|
||||
- (void)queueAssetMenuCommand:(NSString *)kind payload:(id)payload {
|
||||
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=[@{@"kind":kind,@"payload":payload}copy];
|
||||
}
|
||||
- (void)assetMenuBrowse:(NSMenuItem *)item {[self queueAssetMenuCommand:@"browse" payload:item.representedObject];}
|
||||
- (void)assetMenuFile:(NSMenuItem *)item {[self queueAssetMenuCommand:@"file" payload:item.representedObject];}
|
||||
- (void)assetMenuItem:(NSMenuItem *)item {[self queueAssetMenuCommand:@"item" payload:item.representedObject];}
|
||||
- (void)performAssetMenuCommand:(NSDictionary *)command {
|
||||
NSString *kind=command[@"kind"];id payload=command[@"payload"];
|
||||
if([kind isEqual:@"browse"]){[self browseAsset:_assetButtons[payload][@"browse"]];return;}
|
||||
if([kind isEqual:@"file"]){[self chooseFileForKey:payload];return;}
|
||||
NSString *key=payload[@"key"],*path=payload[@"path"];
|
||||
[self setAssetPath:path forKey:key];
|
||||
if([key isEqual:@"input"]&&payload[@"profile"]){id<FxCustomParameterActionAPI_v4> a=[self actionAPI];[a startAction:self];@try{[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setFloatValue:[payload[@"profile"]doubleValue] toParameter:2013 atTime:a.currentTime];}@finally{[a endAction:self];}[self postChanged];}
|
||||
}
|
||||
- (void)chooseFileForKey:(NSString *)key {
|
||||
NSOpenPanel *panel=[NSOpenPanel openPanel];panel.allowedFileTypes=@[@"cube"];panel.allowsMultipleSelection=NO;
|
||||
panel.canChooseDirectories=NO;panel.message=@"选择 .cube 立体 LUT";
|
||||
if([panel runModal]!=NSModalResponseOK)return;
|
||||
[self setAssetPath:panel.URL.path forKey:sender.identifier];
|
||||
if([panel runModal]==NSModalResponseOK&&self.window)[self setAssetPath:panel.URL.path forKey:key];
|
||||
}
|
||||
- (void)browseAsset:(NSButton *)sender {
|
||||
[_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:^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)];
|
||||
if(remote){[remote remoteWindowOfSize:CGSizeMake(760,560) reply:^(FxXPView *parent,NSError *error){dispatch_async(dispatch_get_main_queue(),^{
|
||||
if(_browser!=browser)return;
|
||||
if(parent){[browser showInRemoteParent:parent close:^{[closer closeRemoteWindow];}];}
|
||||
else [browser showRelativeToView:sender];
|
||||
});}];}else [browser showRelativeToView:sender];
|
||||
}
|
||||
- (void)lookEnabled:(NSButton *)sender {NSInteger slot=[[sender.identifier substringFromIndex:4]integerValue];if(slot<1||slot>4)return;[self writeGraphicValues:@{[NSString stringWithFormat:@"look%ldEnabled",(long)slot+1]:@(sender.state==NSControlStateValueOn)}];}
|
||||
- (void)openLibraryFolder:(id)sender {
|
||||
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 {
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
- (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){
|
||||
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);
|
||||
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];
|
||||
}
|
||||
- (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];
|
||||
@@ -715,6 +965,7 @@ static NSImage *DYWheelImage(void) {
|
||||
if(![path isKindOfClass:NSString.class]||![path isAbsolutePath]||![[path pathExtension].lowercaseString isEqual:@"cube"]){[self showError:@"预设包含无效 LUT 路径,尚未修改当前调色。"];return;}
|
||||
if([[NSFileManager defaultManager] isReadableFileAtPath:path])validPaths[key]=path;else [missing addObject:[path lastPathComponent]];
|
||||
}
|
||||
[self cancelAssetLoads];
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
@try {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
@class DYLUTLibrary;
|
||||
|
||||
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:(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.
|
||||
- (void)showInRemoteParent:(NSView *)parent close:(void (^)(void))closeAction;
|
||||
- (void)updatePalette:(NSDictionary *)palette;
|
||||
/// Replace the source frame after the renderer captures a new playhead image.
|
||||
/// Passing identical bytes keeps the current thumbnail jobs and cache intact.
|
||||
- (void)updatePreview:(NSData *)rgba;
|
||||
@end
|
||||
@@ -0,0 +1,447 @@
|
||||
#import "DYLUTBrowser.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#include <cmath>
|
||||
|
||||
static NSColor *DYBrowserColor(NSDictionary *palette, NSString *key) {
|
||||
NSColor *color=palette[key];
|
||||
if([color isKindOfClass:NSColor.class])return color;
|
||||
if([key isEqualToString:@"text"])return [NSColor colorWithWhite:.92 alpha:1];
|
||||
if([key isEqualToString:@"secondary"])return [NSColor colorWithWhite:.65 alpha:1];
|
||||
if([key isEqualToString:@"accent"])return [NSColor colorWithSRGBRed:.32 green:.75 blue:.97 alpha:1];
|
||||
if([key isEqualToString:@"border"])return [NSColor colorWithWhite:.30 alpha:1];
|
||||
return [NSColor colorWithWhite:.12 alpha:1];
|
||||
}
|
||||
|
||||
static NSString *const DYBrowserSizePreference=@"com.dayu.color.lookLUTPreview.thumbnailSize";
|
||||
static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview.selectedFolder";
|
||||
|
||||
@interface DYBrowserCanvas : NSView
|
||||
@property(copy) NSDictionary *palette;
|
||||
@property(copy) NSString *fillKey;
|
||||
@end
|
||||
@implementation DYBrowserCanvas
|
||||
- (BOOL)isFlipped{return YES;}
|
||||
- (BOOL)isAccessibilityElement{return YES;}
|
||||
- (NSAccessibilityRole)accessibilityRole{return NSAccessibilityGroupRole;}
|
||||
- (NSArray *)accessibilityChildren{return NSAccessibilityUnignoredChildren(self.subviews);}
|
||||
- (NSArray *)accessibilityVisibleChildren{
|
||||
NSMutableArray *result=[NSMutableArray array];
|
||||
for(NSView *child in self.subviews)if(!child.hidden&&NSIntersectsRect(child.frame,self.visibleRect))[result addObject:child];
|
||||
return NSAccessibilityUnignoredChildren(result);
|
||||
}
|
||||
- (void)drawRect:(NSRect)dirty{[DYBrowserColor(_palette,_fillKey?:@"background") setFill];NSRectFill(self.bounds);}
|
||||
- (void)dealloc{[_palette release];[_fillKey release];[super dealloc];}
|
||||
@end
|
||||
|
||||
@interface DYBrowserTile : NSButton
|
||||
@property(retain) NSImage *thumbnail;
|
||||
@property(copy) NSString *displayName;
|
||||
@property(copy) NSString *failure;
|
||||
@property(copy) NSDictionary *palette;
|
||||
@property BOOL chosen;
|
||||
@property BOOL doubleClicked;
|
||||
@end
|
||||
@implementation DYBrowserTile
|
||||
- (BOOL)isFlipped{return YES;}
|
||||
- (instancetype)initWithFrame:(NSRect)frame{
|
||||
if((self=[super initWithFrame:frame])){self.bordered=NO;self.title=@"";self.imagePosition=NSNoImage;self.focusRingType=NSFocusRingTypeExterior;}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc{[_thumbnail release];[_displayName release];[_failure release];[_palette release];[super dealloc];}
|
||||
- (NSString *)accessibilityLabel{return _displayName?:@"LUT";}
|
||||
- (id)accessibilityValue{return _chosen?@"已选择":_failure.length?@"LUT 无效":_thumbnail?@"可应用":@"正在生成缩略图";}
|
||||
- (NSString *)accessibilityHelp{return _failure?:@"单击应用此 LUT,双击应用并关闭浏览器";}
|
||||
- (void)drawRect:(NSRect)dirty{
|
||||
NSRect bounds=NSInsetRect(self.bounds,1,1);
|
||||
NSBezierPath *outline=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:7 yRadius:7];
|
||||
[DYBrowserColor(_palette,_chosen?@"field":@"card") setFill];[outline fill];
|
||||
NSRect imageRect=NSMakeRect(2,2,MAX(1,bounds.size.width-2),MAX(1,bounds.size.height-25));
|
||||
if(_thumbnail){
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
[[NSBezierPath bezierPathWithRoundedRect:imageRect xRadius:4 yRadius:4]addClip];
|
||||
NSSize size=_thumbnail.size;CGFloat scale=MAX(imageRect.size.width/MAX(1,size.width),imageRect.size.height/MAX(1,size.height));
|
||||
NSRect dest=NSMakeRect(NSMidX(imageRect)-size.width*scale/2,NSMidY(imageRect)-size.height*scale/2,size.width*scale,size.height*scale);
|
||||
[_thumbnail drawInRect:dest fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil];
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
}else{
|
||||
[DYBrowserColor(_palette,@"background")setFill];NSRectFill(imageRect);
|
||||
NSString *message=_failure.length?@"无法预览":@"生成预览…";
|
||||
NSDictionary *attributes=@{NSFontAttributeName:[NSFont systemFontOfSize:11],NSForegroundColorAttributeName:DYBrowserColor(_palette,@"secondary")};
|
||||
NSSize size=[message sizeWithAttributes:attributes];
|
||||
[message drawAtPoint:NSMakePoint(NSMidX(imageRect)-size.width/2,NSMidY(imageRect)-size.height/2) withAttributes:attributes];
|
||||
}
|
||||
NSMutableParagraphStyle *paragraph=[[[NSMutableParagraphStyle alloc]init]autorelease];paragraph.alignment=NSTextAlignmentCenter;paragraph.lineBreakMode=NSLineBreakByTruncatingMiddle;
|
||||
[_displayName drawInRect:NSMakeRect(7,NSMaxY(bounds)-24,bounds.size.width-14,18) withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:11 weight:_chosen?NSFontWeightSemibold:NSFontWeightRegular],NSForegroundColorAttributeName:DYBrowserColor(_palette,@"text"),NSParagraphStyleAttributeName:paragraph}];
|
||||
[DYBrowserColor(_palette,_chosen?@"accent":@"border")setStroke];outline.lineWidth=_chosen?2:1;[outline stroke];
|
||||
}
|
||||
- (void)mouseDown:(NSEvent *)event{self.doubleClicked=event.clickCount>1;[super mouseDown:event];}
|
||||
@end
|
||||
|
||||
@interface DYBrowserFolderButton : NSButton
|
||||
@property(copy) NSDictionary *palette;
|
||||
@property BOOL chosen;
|
||||
@end
|
||||
@implementation DYBrowserFolderButton
|
||||
- (BOOL)isFlipped{return YES;}
|
||||
- (void)dealloc{[_palette release];[super dealloc];}
|
||||
- (void)drawRect:(NSRect)dirty{
|
||||
if(_chosen){[DYBrowserColor(_palette,@"field")setFill];[[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds,1,1) xRadius:5 yRadius:5]fill];}
|
||||
NSMutableParagraphStyle *paragraph=[[[NSMutableParagraphStyle alloc]init]autorelease];paragraph.lineBreakMode=NSLineBreakByTruncatingMiddle;
|
||||
[self.title drawInRect:NSInsetRect(self.bounds,9,8) withAttributes:@{NSFontAttributeName:[NSFont systemFontOfSize:11 weight:_chosen?NSFontWeightSemibold:NSFontWeightRegular],NSForegroundColorAttributeName:DYBrowserColor(_palette,_chosen?@"accent":@"text"),NSParagraphStyleAttributeName:paragraph}];
|
||||
}
|
||||
@end
|
||||
|
||||
@class DYLUTBrowser;
|
||||
/// The jobs own this token, never the browser or its host selection block.
|
||||
@interface DYBrowserWork : NSObject
|
||||
@property(assign) DYLUTBrowser *owner;
|
||||
@property BOOL cancelled;
|
||||
@end
|
||||
@implementation DYBrowserWork @end
|
||||
|
||||
@interface DYLUTBrowser () <NSWindowDelegate,NSPopoverDelegate,NSSearchFieldDelegate> {
|
||||
DYLUTLibrary *_library;
|
||||
NSData *_preview;
|
||||
NSString *_selectedPath,*_folder;
|
||||
NSDictionary *_palette;
|
||||
DYLUTSelectionHandler _selection;
|
||||
void (^_closeAction)(void);
|
||||
NSPopover *_popover;
|
||||
DYBrowserCanvas *_root,*_folderDocument,*_gridDocument;
|
||||
NSScrollView *_folderScroll,*_gridScroll;
|
||||
NSTextField *_titleLabel,*_countLabel,*_statusLabel,*_sizeLabel,*_emptyLabel;
|
||||
NSSearchField *_search;
|
||||
NSButton *_importFiles,*_importFolder,*_reveal,*_refresh,*_none,*_done;
|
||||
NSSlider *_sizeSlider;
|
||||
NSMutableArray *_folderButtons;
|
||||
NSMutableDictionary *_tiles;
|
||||
NSArray *_visibleEntries,*_folderPaths;
|
||||
NSMutableSet *_queuedPaths;
|
||||
NSCache *_thumbnailCache;
|
||||
dispatch_queue_t _previewQueue;
|
||||
DYBrowserWork *_work;
|
||||
BOOL _closed,_sizing,_visible,_remoteMode,_importing,_layingOut;
|
||||
NSProgress *_libraryTask,*_selectionTask;
|
||||
NSTimer *_progressTimer;
|
||||
NSUInteger _libraryGeneration,_selectionGeneration;
|
||||
NSInteger _columns;
|
||||
CGFloat _tileWidth,_tileHeight;
|
||||
}
|
||||
@end
|
||||
|
||||
@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:(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);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];
|
||||
_countLabel=[BrowserLabel(@"0 个 LUT",11)retain];
|
||||
_statusLabel=[BrowserLabel(@"单击缩略图应用 LUT",11)retain];
|
||||
_sizeLabel=[BrowserLabel(@"缩略图大小",11)retain];
|
||||
_emptyLabel=[BrowserLabel(@"此文件夹还没有 LUT。\n点“导入文件”或“导入文件夹”添加 .cube 文件。",13)retain];_emptyLabel.maximumNumberOfLines=3;_emptyLabel.alignment=NSTextAlignmentCenter;
|
||||
_search=[[NSSearchField alloc]initWithFrame:NSZeroRect];_search.placeholderString=@"搜索 LUT";_search.accessibilityLabel=@"搜索 LUT";_search.delegate=self;_search.target=self;_search.action=@selector(searchChanged:);
|
||||
_importFiles=[BrowserButton(@"导入文件…",self,@selector(importFiles:))retain];_importFiles.accessibilityLabel=@"导入 LUT 文件";
|
||||
_importFolder=[BrowserButton(@"导入文件夹…",self,@selector(importFolder:))retain];_importFolder.accessibilityLabel=@"导入 LUT 文件夹";
|
||||
_reveal=[BrowserButton(@"打开文件夹",self,@selector(revealLibrary:))retain];
|
||||
_refresh=[BrowserButton(@"刷新",self,@selector(reloadLibrary:))retain];
|
||||
_none=[BrowserButton(@"无 LUT",self,@selector(clearSelection:))retain];
|
||||
_done=[BrowserButton(@"完成",self,@selector(done:))retain];_done.keyEquivalent=@"\r";
|
||||
double size=[[NSUserDefaults standardUserDefaults]objectForKey:DYBrowserSizePreference]?[[NSUserDefaults standardUserDefaults]doubleForKey:DYBrowserSizePreference]:96;
|
||||
if(!std::isfinite(size))size=96;
|
||||
_sizeSlider=[[NSSlider alloc]initWithFrame:NSZeroRect];_sizeSlider.minValue=70;_sizeSlider.maxValue=255;_sizeSlider.doubleValue=fmax(70,fmin(255,size));_sizeSlider.continuous=YES;_sizeSlider.target=self;_sizeSlider.action=@selector(sizeChanged:);_sizeSlider.accessibilityLabel=@"LUT 缩略图大小";
|
||||
_folderScroll=[[NSScrollView alloc]initWithFrame:NSZeroRect];_folderScroll.hasVerticalScroller=YES;_folderScroll.autohidesScrollers=YES;_folderScroll.borderType=NSNoBorder;_folderScroll.drawsBackground=NO;_folderScroll.accessibilityLabel=@"LUT 文件夹列表";
|
||||
_gridScroll=[[NSScrollView alloc]initWithFrame:NSZeroRect];_gridScroll.hasVerticalScroller=YES;_gridScroll.autohidesScrollers=YES;_gridScroll.borderType=NSNoBorder;_gridScroll.drawsBackground=NO;_gridScroll.accessibilityLabel=@"LUT 缩略图网格";
|
||||
_folderDocument=[[DYBrowserCanvas alloc]initWithFrame:NSZeroRect];_folderDocument.fillKey=@"card";_folderDocument.palette=_palette;_folderDocument.accessibilityLabel=@"LUT 文件夹";_folderScroll.documentView=_folderDocument;
|
||||
_gridDocument=[[DYBrowserCanvas alloc]initWithFrame:NSZeroRect];_gridDocument.palette=_palette;_gridDocument.accessibilityLabel=@"LUT 缩略图";_gridScroll.documentView=_gridDocument;
|
||||
_folderScroll.contentView.postsBoundsChangedNotifications=YES;
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(folderScrolled:) name:NSViewBoundsDidChangeNotification object:_folderScroll.contentView];
|
||||
_gridScroll.contentView.postsBoundsChangedNotifications=YES;
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(gridScrolled:) name:NSViewBoundsDidChangeNotification object:_gridScroll.contentView];
|
||||
for(NSView *view in @[_titleLabel,_countLabel,_statusLabel,_sizeLabel,_search,_importFiles,_importFolder,_reveal,_refresh,_none,_done,_sizeSlider,_folderScroll,_gridScroll])[_root addSubview:view];
|
||||
[_gridDocument addSubview:_emptyLabel];
|
||||
_root.postsFrameChangedNotifications=YES;_root.postsBoundsChangedNotifications=YES;
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(browserRootResized:) name:NSViewFrameDidChangeNotification object:_root];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(browserRootResized:) name:NSViewBoundsDidChangeNotification object:_root];
|
||||
[self reloadLibrary:nil];[self updatePalette:palette];[self layoutBrowser];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc{
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
[_libraryTask cancel];[_libraryTask release];[_selectionTask cancel];[_selectionTask release];[_progressTimer invalidate];[_progressTimer release];
|
||||
_work.cancelled=YES;_work.owner=nil;[_work release];self.window.delegate=nil;
|
||||
_popover.delegate=nil;[_popover close];[_popover release];[_root removeFromSuperview];
|
||||
[_library release];[_preview release];[_selectedPath release];[_folder release];[_palette release];[_selection release];[_closeAction release];
|
||||
[_root release];[_folderDocument release];[_gridDocument release];[_folderScroll release];[_gridScroll release];
|
||||
[_titleLabel release];[_countLabel release];[_statusLabel release];[_sizeLabel release];[_emptyLabel release];[_search release];
|
||||
[_importFiles release];[_importFolder release];[_reveal release];[_refresh release];[_none release];[_done release];[_sizeSlider release];
|
||||
[_folderButtons release];[_folderPaths release];[_tiles release];[_visibleEntries release];[_queuedPaths release];[_thumbnailCache release];
|
||||
dispatch_release(_previewQueue);[super dealloc];
|
||||
}
|
||||
- (void)showRelativeToView:(NSView *)view{
|
||||
if(_closed||_remoteMode||!view.window)return;
|
||||
if(_popover.shown)return;
|
||||
// A plug-in process is prohibited from making its own NSPanel key. Only
|
||||
// FxRemoteWindow or a host-anchored popover may present this content.
|
||||
self.window.contentView=[[[NSView alloc]initWithFrame:NSMakeRect(0,0,1,1)]autorelease];
|
||||
[_root removeFromSuperview];_root.frame=NSMakeRect(0,0,760,560);_root.autoresizingMask=NSViewWidthSizable|NSViewHeightSizable;
|
||||
_popover=[[NSPopover alloc]init];_popover.behavior=NSPopoverBehaviorTransient;_popover.animates=YES;_popover.delegate=self;_popover.contentSize=NSMakeSize(760,560);
|
||||
NSViewController *controller=[[[NSViewController alloc]init]autorelease];controller.view=_root;_popover.contentViewController=controller;
|
||||
[self layoutBrowser];
|
||||
@try {[_popover showRelativeToRect:view.bounds ofView:view preferredEdge:NSRectEdgeMaxX];_visible=_popover.shown;}
|
||||
@catch(NSException *exception){[self finishClosing];}
|
||||
}
|
||||
- (BOOL)visible{return !_closed&&(_remoteMode?_visible:_popover.shown);}
|
||||
- (void)showInRemoteParent:(NSView *)parent close:(void (^)(void))closeAction{
|
||||
if(_closed||!parent||self.visible)return;
|
||||
_remoteMode=YES;_visible=YES;[_closeAction release];_closeAction=[closeAction copy];
|
||||
self.window.contentView=[[[NSView alloc]initWithFrame:NSMakeRect(0,0,1,1)]autorelease];
|
||||
[_root removeFromSuperview];_root.frame=parent.bounds;_root.autoresizingMask=NSViewWidthSizable|NSViewHeightSizable;parent.autoresizesSubviews=YES;_root.hidden=NO;
|
||||
[parent addSubview:_root];[self layoutBrowser];[_root setNeedsDisplay:YES];
|
||||
NSAccessibilityPostNotification(parent,NSAccessibilityLayoutChangedNotification);
|
||||
}
|
||||
- (void)browserRootResized:(NSNotification *)notification{if(!_closed)[self layoutBrowser];}
|
||||
- (void)windowDidResize:(NSNotification *)notification{[self layoutBrowser];}
|
||||
- (void)windowWillClose:(NSNotification *)notification{[self finishClosing];}
|
||||
- (BOOL)popoverShouldClose:(NSPopover *)popover{return !_importing;}
|
||||
- (void)popoverDidClose:(NSNotification *)notification{[self finishClosing];}
|
||||
- (void)close{
|
||||
if(_closed)return;
|
||||
if(_popover.shown){[_popover close];if(!_closed)[self finishClosing];}
|
||||
else [self finishClosing];
|
||||
}
|
||||
- (void)finishClosing{
|
||||
if(_closed)return;
|
||||
// The API owner's completion may release this controller synchronously.
|
||||
[self retain];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
_closed=YES;_visible=NO;_work.cancelled=YES;_work.owner=nil;[_libraryTask cancel];[_selectionTask cancel];[_progressTimer invalidate];[_progressTimer release];_progressTimer=nil;
|
||||
_popover.delegate=nil;if(_popover.shown)[_popover close];
|
||||
[_root removeFromSuperview];[_queuedPaths removeAllObjects];[_thumbnailCache removeAllObjects];
|
||||
[_selection release];_selection=nil;
|
||||
void (^closeAction)(void)=[_closeAction copy];[_closeAction release];_closeAction=nil;
|
||||
if(closeAction)closeAction();[closeAction release];
|
||||
[self release];
|
||||
}
|
||||
- (void)layoutBrowser{
|
||||
if(_layingOut)return;_layingOut=YES;
|
||||
CGFloat w=_root.bounds.size.width,h=_root.bounds.size.height,left=162;
|
||||
_titleLabel.frame=NSMakeRect(12,15,145,20);_countLabel.frame=NSMakeRect(12,39,145,18);
|
||||
_search.frame=NSMakeRect(left+14,14,MAX(125,w-left-351),24);
|
||||
_importFiles.frame=NSMakeRect(w-322,12,100,28);_importFolder.frame=NSMakeRect(w-218,12,113,28);_refresh.frame=NSMakeRect(w-101,12,82,28);
|
||||
_folderScroll.frame=NSMakeRect(12,66,150,MAX(80,h-121));_gridScroll.frame=NSMakeRect(left+12,50,MAX(80,w-left-26),MAX(80,h-105));
|
||||
_reveal.frame=NSMakeRect(14,h-44,left-23,27);_none.frame=NSMakeRect(left+13,h-44,75,27);
|
||||
_sizeLabel.frame=NSMakeRect(left+101,h-39,74,18);_sizeSlider.frame=NSMakeRect(left+173,h-41,MAX(70,MIN(150,w-left-420)),20);
|
||||
_done.frame=NSMakeRect(w-98,h-44,78,27);
|
||||
CGFloat statusX=NSMaxX(_sizeSlider.frame)+14;_statusLabel.frame=NSMakeRect(statusX,h-39,MAX(0,w-statusX-112),18);
|
||||
CGFloat fw=MAX(100,_folderScroll.contentSize.width);
|
||||
_folderDocument.frame=NSMakeRect(0,0,fw,MAX(_folderPaths.count*35+4,_folderScroll.contentSize.height));
|
||||
[self updateVisibleFolders];
|
||||
CGFloat available=MAX(80,_gridScroll.contentSize.width),tileWidth=_sizeSlider.doubleValue,gap=10;
|
||||
NSInteger columns=MAX(1,(NSInteger)floor((available+gap)/(tileWidth+gap)));tileWidth=MIN(tileWidth,(available-gap*(columns-1)-14)/columns);tileWidth=MAX(70,tileWidth);
|
||||
_columns=columns;_tileWidth=tileWidth;_tileHeight=ceil(tileWidth*9/16)+24;
|
||||
NSInteger rows=(_visibleEntries.count+columns-1)/columns;CGFloat contentHeight=MAX(_gridScroll.contentSize.height,rows*(_tileHeight+gap)+12);
|
||||
_gridDocument.frame=NSMakeRect(0,0,available,contentHeight);_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90);
|
||||
_layingOut=NO;[self updateVisibleTiles];
|
||||
}
|
||||
- (void)resetThumbnailWork {
|
||||
_work.cancelled=YES;_work.owner=nil;[_work release];_work=[DYBrowserWork new];_work.owner=self;[_queuedPaths removeAllObjects];
|
||||
}
|
||||
- (void)updateVisibleTiles {
|
||||
if(_closed||_layingOut||_columns<1)return;
|
||||
NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);CGFloat step=_tileHeight+10;
|
||||
NSUInteger first=(NSUInteger)MAX(0,floor((NSMinY(visible)-8)/step))*_columns;
|
||||
NSUInteger end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxY(visible)-8)/step)+1)*_columns);
|
||||
NSMutableSet *wanted=[NSMutableSet set];BOOL changed=NO;
|
||||
for(NSUInteger i=first;i<end;i++){
|
||||
NSDictionary *entry=_visibleEntries[i];NSString *path=entry[@"path"];[wanted addObject:path];DYBrowserTile *tile=_tiles[path];
|
||||
if(!tile){tile=[[[DYBrowserTile alloc]initWithFrame:NSZeroRect]autorelease];tile.identifier=path;tile.displayName=entry[@"name"];tile.toolTip=entry[@"relativePath"]?:path;tile.palette=_palette;tile.chosen=[path isEqualToString:_selectedPath];tile.target=self;tile.action=@selector(thumbnailClicked:);tile.enabled=YES;[_gridDocument addSubview:tile];_tiles[path]=tile;changed=YES;}
|
||||
tile.frame=NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
|
||||
}
|
||||
for(NSString *path in _tiles.allKeys)if(![wanted containsObject:path]){[_tiles[path]removeFromSuperview];[_tiles removeObjectForKey:path];changed=YES;}
|
||||
if(changed||!_work)[self resetThumbnailWork];
|
||||
if(!_sizing)[self generateVisibleThumbnails];
|
||||
}
|
||||
|
||||
- (void)updatePalette:(NSDictionary *)palette{
|
||||
NSMutableDictionary *browserPalette=[NSMutableDictionary dictionaryWithDictionary:palette?:@{}];
|
||||
browserPalette[@"background"]=[NSColor colorWithCalibratedRed:.035 green:.08 blue:.12 alpha:1];
|
||||
[_palette release];_palette=[browserPalette copy];_root.palette=_palette;_folderDocument.palette=_palette;_gridDocument.palette=_palette;
|
||||
self.window.backgroundColor=DYBrowserColor(_palette,@"background");self.window.appearance=[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||
_root.appearance=[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||
for(NSTextField *label in @[_titleLabel,_countLabel,_statusLabel,_sizeLabel,_emptyLabel])label.textColor=DYBrowserColor(_palette,label==_titleLabel?@"text":@"secondary");
|
||||
for(NSButton *button in @[_importFiles,_importFolder,_reveal,_refresh,_none,_done])button.contentTintColor=DYBrowserColor(_palette,@"accent");
|
||||
_search.textColor=DYBrowserColor(_palette,@"text");_search.backgroundColor=DYBrowserColor(_palette,@"field");
|
||||
for(DYBrowserFolderButton *button in _folderButtons){button.palette=_palette;[button setNeedsDisplay:YES];}
|
||||
for(DYBrowserTile *tile in _tiles.allValues){tile.palette=_palette;[tile setNeedsDisplay:YES];}
|
||||
[_root setNeedsDisplay:YES];[_folderDocument setNeedsDisplay:YES];[_gridDocument setNeedsDisplay:YES];
|
||||
}
|
||||
- (void)updatePreview:(NSData *)rgba{
|
||||
if(_closed||_preview==rgba||[_preview isEqualToData:rgba])return;
|
||||
if(rgba&&rgba.length!=320*180*16)return;
|
||||
[_preview release];_preview=[rgba copy];[_thumbnailCache removeAllObjects];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(refreshThumbnailSize) object:nil];
|
||||
[self refreshThumbnailSize];
|
||||
}
|
||||
- (void)setStatus:(NSString *)status{_statusLabel.stringValue=status?:@"";_statusLabel.toolTip=status;}
|
||||
- (void)rebuildFolders{
|
||||
NSMutableArray *paths=[NSMutableArray arrayWithObject:@"*"];NSMutableSet *seen=[NSMutableSet setWithObject:@"*"];
|
||||
for(NSString *folder in _library.folders){NSString *top=folder.length?[folder componentsSeparatedByString:@"/"].firstObject:@"";if(![seen containsObject:top]){[paths addObject:top];[seen addObject:top];}}
|
||||
if(![seen containsObject:_folder]){[_folder release];_folder=[@"*" copy];}
|
||||
[_folderPaths release];_folderPaths=[paths copy];[self updateVisibleFolders];
|
||||
}
|
||||
- (void)folderScrolled:(NSNotification *)notification{if(!_layingOut)[self updateVisibleFolders];}
|
||||
- (void)updateVisibleFolders {
|
||||
if(_closed)return;NSRect visible=NSInsetRect(_folderScroll.contentView.bounds,0,-35);
|
||||
NSUInteger first=(NSUInteger)MAX(0,floor(NSMinY(visible)/35)),end=MIN(_folderPaths.count,(NSUInteger)MAX(0,ceil(NSMaxY(visible)/35)+1));
|
||||
NSMutableDictionary *existing=[NSMutableDictionary dictionary];for(NSButton *button in _folderButtons)existing[button.identifier]=button;
|
||||
NSMutableArray *buttons=[NSMutableArray array];
|
||||
for(NSUInteger i=first;i<end;i++){
|
||||
NSString *path=_folderPaths[i];DYBrowserFolderButton *button=existing[path];
|
||||
if(!button){button=[[[DYBrowserFolderButton alloc]initWithFrame:NSZeroRect]autorelease];button.bordered=NO;button.target=self;button.action=@selector(folderClicked:);button.identifier=path;
|
||||
button.title=[path isEqualToString:@"*"]?@"全部 LUT":path.length?[@"▸ " stringByAppendingString:path]:@"未分类";button.toolTip=path.length?path:_library.rootURL.path;button.palette=_palette;button.accessibilityLabel=[@"LUT 文件夹:" stringByAppendingString:button.title];[_folderDocument addSubview:button];}
|
||||
button.chosen=[path isEqualToString:_folder];button.frame=NSMakeRect(4,4+i*35,MAX(92,_folderScroll.contentSize.width-8),33);[button setNeedsDisplay:YES];[buttons addObject:button];
|
||||
}
|
||||
for(NSButton *button in _folderButtons)if(![buttons containsObject:button])[button removeFromSuperview];[_folderButtons setArray:buttons];
|
||||
}
|
||||
- (void)pollLibraryProgress:(NSTimer *)timer {
|
||||
if(_libraryTask)[self setStatus:_libraryTask.localizedDescription];
|
||||
_statusLabel.toolTip=_libraryTask.localizedAdditionalDescription?:_statusLabel.stringValue;
|
||||
}
|
||||
- (void)beginLibraryTask:(NSProgress *)task {
|
||||
[_libraryTask release];_libraryTask=[task retain];_importFiles.enabled=NO;_importFolder.enabled=NO;_refresh.title=@"取消";_done.title=@"停止并关闭";_done.toolTip=@"关闭将取消本次加载,原有 LUT 保留";
|
||||
[_progressTimer invalidate];[_progressTimer release];_progressTimer=[[NSTimer timerWithTimeInterval:.1 target:self selector:@selector(pollLibraryProgress:) userInfo:nil repeats:YES]retain];
|
||||
[[NSRunLoop mainRunLoop]addTimer:_progressTimer forMode:NSRunLoopCommonModes];[self pollLibraryProgress:nil];
|
||||
}
|
||||
- (void)endLibraryTask {
|
||||
[_libraryTask release];_libraryTask=nil;[_progressTimer invalidate];[_progressTimer release];_progressTimer=nil;
|
||||
_importFiles.enabled=YES;_importFolder.enabled=YES;_refresh.title=@"刷新";_done.title=@"完成";_done.toolTip=nil;
|
||||
}
|
||||
- (void)reloadLibrary:(id)sender{
|
||||
if(_libraryTask){[_libraryTask cancel];[self setStatus:@"正在取消…"];return;}
|
||||
[_thumbnailCache removeAllObjects];NSUInteger generation=++_libraryGeneration;
|
||||
NSProgress *task=[_library reloadAsync:^(NSError *error){
|
||||
if(_closed||generation!=_libraryGeneration)return;[self endLibraryTask];
|
||||
[self rebuildFolders];[self rebuildGrid];[self setStatus:error?error.localizedDescription:@"单击缩略图应用 LUT"];
|
||||
}];[self beginLibraryTask:task];
|
||||
}
|
||||
- (void)folderClicked:(NSButton *)sender{
|
||||
[_folder release];_folder=[sender.identifier copy];
|
||||
[[NSUserDefaults standardUserDefaults]setObject:_folder forKey:DYBrowserFolderPreference];
|
||||
for(DYBrowserFolderButton *button in _folderButtons){button.chosen=[button.identifier isEqualToString:_folder];[button setNeedsDisplay:YES];}
|
||||
[self rebuildGrid];
|
||||
}
|
||||
- (void)searchChanged:(id)sender{[self rebuildGrid];}
|
||||
- (void)controlTextDidChange:(NSNotification *)notification{if(notification.object==_search)[self rebuildGrid];}
|
||||
- (void)sizeChanged:(id)sender{
|
||||
[[NSUserDefaults standardUserDefaults]setDouble:_sizeSlider.doubleValue forKey:DYBrowserSizePreference];
|
||||
_sizing=YES;[self layoutBrowser];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(refreshThumbnailSize) object:nil];
|
||||
[self performSelector:@selector(refreshThumbnailSize) withObject:nil afterDelay:.22];
|
||||
}
|
||||
- (void)refreshThumbnailSize{
|
||||
if(_closed)return;_sizing=NO;
|
||||
_work.cancelled=YES;_work.owner=nil;[_work release];_work=[DYBrowserWork new];_work.owner=self;[_queuedPaths removeAllObjects];
|
||||
for(DYBrowserTile *tile in _tiles.allValues){tile.thumbnail=nil;tile.failure=nil;tile.enabled=YES;[tile setNeedsDisplay:YES];}
|
||||
[self generateVisibleThumbnails];
|
||||
}
|
||||
- (void)gridScrolled:(NSNotification *)notification{[self updateVisibleTiles];}
|
||||
- (void)generateVisibleThumbnails{
|
||||
if(_closed||!_work)return;
|
||||
NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);
|
||||
NSUInteger width=MAX((NSUInteger)64,(NSUInteger)llround(_sizeSlider.doubleValue)),height=MAX((NSUInteger)40,(NSUInteger)llround(width*9./16));
|
||||
for(NSString *path in _tiles.allKeys){
|
||||
DYBrowserTile *tile=_tiles[path];
|
||||
if(!NSIntersectsRect(tile.frame,visible)){if(tile.thumbnail){tile.thumbnail=nil;tile.enabled=NO;}continue;}
|
||||
if(tile.thumbnail||tile.failure.length)continue;
|
||||
NSString *cacheKey=[NSString stringWithFormat:@"%lu|%@",(unsigned long)width,path];
|
||||
NSDictionary *cached=[_thumbnailCache objectForKey:cacheKey];
|
||||
if(cached){tile.thumbnail=cached[@"image"];tile.failure=cached[@"error"];tile.enabled=tile.thumbnail!=nil;if(tile.failure.length)tile.toolTip=tile.failure;[tile setNeedsDisplay:YES];continue;}
|
||||
if([_queuedPaths containsObject:cacheKey])continue;[_queuedPaths addObject:cacheKey];
|
||||
DYBrowserWork *work=_work;NSData *preview=_preview;
|
||||
dispatch_async(_previewQueue,^{@autoreleasepool{
|
||||
if(work.cancelled)return;
|
||||
NSError *error=nil;NSImage *image=DYLUTThumbnail(path,preview,320,180,NSMakeSize(width,height),&error);NSString *failure=error.localizedDescription;
|
||||
dispatch_async(dispatch_get_main_queue(),^{
|
||||
DYLUTBrowser *owner=work.owner;if(work.cancelled||!owner)return;
|
||||
[owner->_queuedPaths removeObject:cacheKey];
|
||||
NSDictionary *result=image?@{@"image":image}:@{@"error":failure?:@"无法预览此 LUT"};
|
||||
[owner->_thumbnailCache setObject:result forKey:cacheKey cost:image?width*height*4:128];
|
||||
DYBrowserTile *current=owner->_tiles[path];if(!current||!NSIntersectsRect(current.frame,NSInsetRect(owner->_gridScroll.contentView.bounds,-30,-180)))return;
|
||||
current.thumbnail=image;current.failure=failure;current.enabled=image!=nil;if(failure.length)current.toolTip=failure;[current setNeedsDisplay:YES];
|
||||
});
|
||||
}});
|
||||
}
|
||||
}
|
||||
- (void)rebuildGrid{
|
||||
[self resetThumbnailWork];
|
||||
for(NSView *tile in _tiles.allValues)[tile removeFromSuperview];[_tiles removeAllObjects];
|
||||
NSString *query=[_search.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];NSMutableArray *entries=[NSMutableArray array];
|
||||
for(NSDictionary *entry in _library.entries){
|
||||
NSString *folder=entry[@"relativeFolder"]?:@"";
|
||||
BOOL folderMatch=[_folder isEqualToString:@"*"]||[folder isEqualToString:_folder]||(_folder.length&&[folder hasPrefix:[_folder stringByAppendingString:@"/"]]);
|
||||
if(folderMatch&&(!query.length||[entry[@"name"]localizedCaseInsensitiveContainsString:query]||[entry[@"relativePath"]localizedCaseInsensitiveContainsString:query]))[entries addObject:entry];
|
||||
}
|
||||
[_visibleEntries release];_visibleEntries=[entries copy];_countLabel.stringValue=[NSString stringWithFormat:@"%lu 个 LUT",(unsigned long)entries.count];_emptyLabel.hidden=entries.count>0;
|
||||
[_gridScroll.contentView scrollToPoint:NSZeroPoint];[self layoutBrowser];[_gridScroll reflectScrolledClipView:_gridScroll.contentView];
|
||||
NSAccessibilityPostNotification(_gridDocument,NSAccessibilityLayoutChangedNotification);
|
||||
}
|
||||
- (void)thumbnailClicked:(DYBrowserTile *)sender{
|
||||
if(!sender.enabled||sender.failure.length)return;
|
||||
[_selectionTask cancel];[_selectionTask release];NSUInteger generation=++_selectionGeneration;
|
||||
NSString *path=sender.identifier,*name=sender.displayName;BOOL closeAfter=sender.doubleClicked;[self setStatus:[@"正在载入 " stringByAppendingString:name]];
|
||||
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];}
|
||||
[self setStatus:[@"已选择 " stringByAppendingString:name]];if(closeAfter)[self close];
|
||||
};
|
||||
_selectionTask=[(_selection?_selection(path,applied):DYLUTPrepareAsync(path,applied))retain];
|
||||
}
|
||||
- (void)clearSelection:(id)sender{
|
||||
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];}
|
||||
- (void)importSelectedURLs:(NSArray<NSURL *> *)urls {
|
||||
if(_closed||_libraryTask)return;NSUInteger generation=++_libraryGeneration;
|
||||
NSProgress *task=[_library importURLsAsync:urls completion:^(NSArray *imported,NSError *error){
|
||||
if(_closed||generation!=_libraryGeneration)return;[self endLibraryTask];
|
||||
if(!imported){[self showImportError:error];return;}
|
||||
[_thumbnailCache removeAllObjects];[self rebuildFolders];[self rebuildGrid];[self setStatus:[NSString stringWithFormat:@"已导入 %lu 个 LUT",(unsigned long)imported.count]];
|
||||
}];[self beginLibraryTask:task];
|
||||
}
|
||||
- (void)importPanelForFolders:(BOOL)folders{
|
||||
if(_libraryTask||_importing||_closed)return;
|
||||
NSOpenPanel *panel=[NSOpenPanel openPanel];panel.canChooseFiles=!folders;panel.canChooseDirectories=folders;panel.allowsMultipleSelection=YES;panel.title=folders?@"导入 LUT 文件夹":@"导入 LUT 文件";panel.message=folders?@"所选文件夹中的 .cube 文件会按目录复制到大鱼调色 LUT 库。":@"选择要复制到大鱼调色 LUT 库的 .cube 文件。";
|
||||
if(!folders)panel.allowedFileTypes=@[@"cube"];
|
||||
// FxPlug bridges the modal chooser; the asynchronous AppKit chooser cannot
|
||||
// become key in the service. Only choosing a path is modal; file work is not.
|
||||
_importing=YES;NSModalResponse response=[panel runModal];_importing=NO;
|
||||
if(response==NSModalResponseOK&&!_closed)[self importSelectedURLs:panel.URLs];
|
||||
}
|
||||
- (void)importFiles:(id)sender{[self importPanelForFolders:NO];}
|
||||
- (void)importFolder:(id)sender{[self importPanelForFolders:YES];}
|
||||
- (void)revealLibrary:(id)sender{
|
||||
NSError *error=nil;
|
||||
if(![[NSFileManager defaultManager]createDirectoryAtURL:_library.rootURL withIntermediateDirectories:YES attributes:nil error:&error]){[self showImportError:error];return;}
|
||||
if(![[NSWorkspace sharedWorkspace]openURL:_library.rootURL])[self setStatus:@"无法打开 LUT 文件夹"];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,71 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
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.
|
||||
FOUNDATION_EXPORT BOOL DYLUTReadCube(NSString *path, std::vector<float>& values,
|
||||
NSUInteger& dimension, NSError * _Nullable * _Nullable error);
|
||||
#endif
|
||||
|
||||
/// Parse/warm the shared table cache off the UI thread. Completion is always on
|
||||
/// the main queue; cancel suppresses application of the result.
|
||||
FOUNDATION_EXPORT NSProgress *DYLUTPrepareAsync(NSString *path,
|
||||
void (^completion)(NSError * _Nullable error));
|
||||
|
||||
/// Float RGBA in display-encoded RGB, matching the renderer's 320×180 preview.
|
||||
/// Empty path means identity. Alpha is preserved; invalid samples become clear.
|
||||
FOUNDATION_EXPORT NSData * _Nullable DYLUTTransformRGBA(NSData *sourceRGBA,
|
||||
NSUInteger width, NSUInteger height, NSString * _Nullable path, NSError * _Nullable * _Nullable error);
|
||||
/// Uses sourceRGBA when supplied. Otherwise draws an authored neutral test chart.
|
||||
/// The bitmap is safe to prepare on the browser's background preview queue.
|
||||
FOUNDATION_EXPORT NSImage * _Nullable DYLUTThumbnail(NSString * _Nullable path,
|
||||
NSData * _Nullable sourceRGBA, NSUInteger sourceWidth, NSUInteger sourceHeight,
|
||||
NSSize outputSize, NSError * _Nullable * _Nullable error);
|
||||
|
||||
@interface DYLUTLibrary : NSObject
|
||||
@property(nonatomic,readonly,copy) NSURL *rootURL;
|
||||
/// Each item has name (without extension), path, relativeFolder, relativePath.
|
||||
@property(nonatomic,readonly,copy) NSArray<NSDictionary<NSString *,NSString *> *> *entries;
|
||||
/// Relative folder names, including the root empty string; sorted naturally.
|
||||
@property(nonatomic,readonly,copy) NSArray<NSString *> *folders;
|
||||
@property(nonatomic,readonly,copy) NSSet<NSString *> *favoritePaths;
|
||||
+ (NSURL *)defaultRootURL;
|
||||
- (instancetype)init;
|
||||
- (instancetype)initWithRootURL:(NSURL *)rootURL NS_DESIGNATED_INITIALIZER;
|
||||
/// Does not follow symbolic links or create a missing root directory.
|
||||
- (BOOL)reload:(NSError * _Nullable * _Nullable)error;
|
||||
/// Background file work is serialized separately from the short snapshot lock.
|
||||
/// The returned progress supports cancellation and per-file status; callbacks
|
||||
/// always run on the main queue. Existing snapshots remain readable meanwhile.
|
||||
- (NSProgress *)reloadAsync:(void (^)(NSError * _Nullable error))completion;
|
||||
- (NSProgress *)importURLsAsync:(NSArray<NSURL *> *)urls
|
||||
completion:(void (^)(NSArray<NSDictionary *> * _Nullable imported, NSError * _Nullable error))completion;
|
||||
/// Copies Cube files (recursing into folders) into the library. No existing file
|
||||
/// is replaced. Names receive numeric suffixes on collision. Source data stays put.
|
||||
/// Returns imported entry dictionaries, or nil on preflight/copy failure.
|
||||
- (NSArray<NSDictionary<NSString *,NSString *> *> * _Nullable)importURLs:(NSArray<NSURL *> *)urls
|
||||
error:(NSError * _Nullable * _Nullable)error;
|
||||
- (BOOL)isFavoritePath:(NSString *)path;
|
||||
- (BOOL)setFavorite:(BOOL)favorite forPath:(NSString *)path error:(NSError * _Nullable * _Nullable)error;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,488 @@
|
||||
#import "DYLUTLibrary.h"
|
||||
#include <algorithm>
|
||||
#include <charconv>
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <xlocale.h>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <zlib.h>
|
||||
|
||||
static NSString *const DYLUTLibraryErrorDomain=@"com.dayu.color.LUTLibrary";
|
||||
static NSURL *DYLUTCanonicalURL(NSURL *url) {
|
||||
// Foundation deliberately abbreviates /private/var back to /var in some
|
||||
// URL normalization APIs; its enumerator returns the POSIX canonical path.
|
||||
NSString *path=url.path.stringByStandardizingPath;
|
||||
NSMutableArray *missing=[NSMutableArray array];char resolved[PATH_MAX];
|
||||
while(path.length&&!realpath(path.fileSystemRepresentation,resolved)) {
|
||||
NSString *parent=path.stringByDeletingLastPathComponent;
|
||||
if([parent isEqual:path])return [NSURL fileURLWithPath:url.path.stringByStandardizingPath];
|
||||
[missing insertObject:path.lastPathComponent atIndex:0];path=parent;
|
||||
}
|
||||
NSString *canonical=[[NSFileManager defaultManager]stringWithFileSystemRepresentation:resolved length:strlen(resolved)];
|
||||
for(NSString *component in missing)canonical=[canonical stringByAppendingPathComponent:component];
|
||||
return [NSURL fileURLWithPath:canonical];
|
||||
}
|
||||
static BOOL DYLUTFail(NSError **error,NSString *message) {
|
||||
if(error)*error=[NSError errorWithDomain:DYLUTLibraryErrorDomain code:1
|
||||
userInfo:@{NSLocalizedDescriptionKey:message?:@"LUT 操作未完成"}];
|
||||
return NO;
|
||||
}
|
||||
|
||||
@interface DYLUTPreparedTable () {
|
||||
@public std::vector<float> values;
|
||||
@public NSUInteger _dimension;
|
||||
@public NSString *_path,*_revision;
|
||||
}
|
||||
@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;
|
||||
dispatch_once(&once,^{cache=[NSCache new];cache.countLimit=12;cache.totalCostLimit=96*1024*1024;});
|
||||
return cache;
|
||||
}
|
||||
|
||||
static void DYLUTSample(const std::vector<float>& table,NSUInteger n,const float rgb[3],float out[3]) {
|
||||
float fraction[3];NSUInteger index[3];
|
||||
for(int c=0;c<3;c++) {
|
||||
float scaled=std::min(1.f,std::max(0.f,rgb[c]))*float(n-1);
|
||||
index[c]=std::min(n-2,(NSUInteger)scaled);fraction[c]=scaled-float(index[c]);
|
||||
}
|
||||
for(int c=0;c<3;c++) {
|
||||
float sum=0;
|
||||
for(int k=0;k<8;k++) {
|
||||
int x=k&1,y=(k>>1)&1,z=(k>>2)&1;
|
||||
sum+=table[(((index[2]+z)*n+index[1]+y)*n+index[0]+x)*4+c]
|
||||
*(x?fraction[0]:1-fraction[0])*(y?fraction[1]:1-fraction[1])*(z?fraction[2]:1-fraction[2]);
|
||||
}
|
||||
out[c]=sum;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL DYLUTCancelled(NSProgress *progress,NSError **error) {
|
||||
if(!progress.cancelled)return NO;
|
||||
if(error)*error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
|
||||
return YES;
|
||||
}
|
||||
static 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];
|
||||
if(!attributes)return NO;
|
||||
if(![attributes[NSFileType]isEqual:NSFileTypeRegular])return DYLUTFail(error,@"LUT 必须是普通文件");
|
||||
if([attributes[NSFileSize]unsignedLongLongValue]>256ULL*1024*1024)return DYLUTFail(error,@"LUT 文件超过 256 MB 限制");
|
||||
NSData *bytes=[NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:error];
|
||||
if(!bytes)return NO;
|
||||
if([path.pathExtension.lowercaseString isEqual:@"dylut"]) {
|
||||
if(bytes.length<36||memcmp(bytes.bytes,"DYLT",4))return DYLUTFail(error,@"输入 LUT 格式损坏");
|
||||
uint32_t n=0,count=0;memcpy(&n,(const uint8_t *)bytes.bytes+4,4);memcpy(&count,(const uint8_t *)bytes.bytes+8,4);
|
||||
if(n<2||n>128||count!=n*n*n*16)return DYLUTFail(error,@"输入 LUT 尺寸无效");
|
||||
data.resize(count/4);uLongf length=count;
|
||||
if(uncompress((Bytef *)data.data(),&length,(const Bytef *)bytes.bytes+36,bytes.length-36)!=Z_OK||length!=count)
|
||||
return DYLUTFail(error,@"输入 LUT 解压失败");
|
||||
for(float v:data)if(!std::isfinite(v))return DYLUTFail(error,@"输入 LUT 含无效数字");
|
||||
size=n;return YES;
|
||||
}
|
||||
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=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 {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{}||!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)||!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)||!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 数据过多");
|
||||
}
|
||||
}
|
||||
if(size<2||data.size()!=size*size*size*4)return DYLUTFail(error,@"LUT 数据数量与尺寸不符");
|
||||
bool resample=false;
|
||||
for(int c=0;c<3;c++) {
|
||||
if(!std::isfinite(domainMin[c])||!std::isfinite(domainMax[c])||domainMax[c]<=domainMin[c])return DYLUTFail(error,@"LUT DOMAIN 范围无效");
|
||||
resample|=domainMin[c]!=0||domainMax[c]!=1;
|
||||
}
|
||||
if(resample) {
|
||||
std::vector<float> original=data;
|
||||
for(NSUInteger z=0;z<size;z++)for(NSUInteger y=0;y<size;y++)for(NSUInteger x=0;x<size;x++) {
|
||||
if(x==0&&DYLUTCancelled(progress,error))return NO;
|
||||
float rgb[3]={(float(x)/(size-1)-domainMin[0])/(domainMax[0]-domainMin[0]),
|
||||
(float(y)/(size-1)-domainMin[1])/(domainMax[1]-domainMin[1]),
|
||||
(float(z)/(size-1)-domainMin[2])/(domainMax[2]-domainMin[2])};
|
||||
float sample[3];DYLUTSample(original,size,rgb,sample);
|
||||
size_t dest=((z*size+y)*size+x)*4;for(int c=0;c<3;c++)data[dest+c]=sample[c];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
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 nil;
|
||||
NSString *key=[NSString stringWithFormat:@"%@|%.9f|%@|%@",path.stringByStandardizingPath,[a[NSFileModificationDate]timeIntervalSinceReferenceDate],a[NSFileSize],a[NSFileSystemFileNumber]];
|
||||
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 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)];
|
||||
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) {
|
||||
return DYLUTReadCancellable(path,data,size,nil,error);
|
||||
}
|
||||
NSProgress *DYLUTPrepareAsync(NSString *path,void (^completion)(NSError *)) {
|
||||
static dispatch_queue_t queue;static dispatch_once_t once;
|
||||
dispatch_once(&once,^{queue=dispatch_queue_create("com.dayu.color.lut-selection",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(queue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));});
|
||||
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:1];progress.localizedDescription=@"正在载入 LUT…";
|
||||
dispatch_async(queue,^{@autoreleasepool{
|
||||
NSError *error=nil;std::vector<float> values;NSUInteger n=0;
|
||||
DYLUTReadCancellable(path,values,n,progress,&error);DYLUTCancelled(progress,&error);progress.completedUnitCount=1;
|
||||
dispatch_async(dispatch_get_main_queue(),^{NSError *result=error;DYLUTCancelled(progress,&result);if(completion)completion(result);});
|
||||
}});return progress;
|
||||
}
|
||||
|
||||
NSData *DYLUTTransformRGBA(NSData *source,NSUInteger width,NSUInteger height,NSString *path,NSError **error) {
|
||||
if(!width||!height||width>8192||height>8192||width*height>8192*8192||source.length!=width*height*16) {
|
||||
DYLUTFail(error,@"缩略图源必须是有效的 float RGBA 图像");return nil;
|
||||
}
|
||||
std::vector<float> table;NSUInteger n=0;
|
||||
if(path.length&&!DYLUTReadCube(path,table,n,error))return nil;
|
||||
NSMutableData *result=[NSMutableData dataWithLength:source.length];
|
||||
const float *input=(const float *)source.bytes;float *output=(float *)result.mutableBytes;
|
||||
for(NSUInteger i=0;i<width*height;i++) {
|
||||
const float *p=input+i*4;float *q=output+i*4;
|
||||
if(!std::isfinite(p[0])||!std::isfinite(p[1])||!std::isfinite(p[2])||!std::isfinite(p[3])||p[3]<=0)continue;
|
||||
if(n)DYLUTSample(table,n,p,q);else for(int c=0;c<3;c++)q[c]=p[c];
|
||||
q[3]=std::min(1.f,std::max(0.f,p[3]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static NSData *DYLUTFallback(void) {
|
||||
static NSData *chart;static dispatch_once_t once;
|
||||
dispatch_once(&once,^{
|
||||
NSMutableData *data=[NSMutableData dataWithLength:320*180*16];float *p=(float *)data.mutableBytes;
|
||||
const float swatches[][3]={{.74,.43,.33},{.49,.31,.25},{.95,.80,.67},{.82,.71,.51},{.16,.51,.75},{.24,.67,.35},{.94,.22,.18},{.14,.18,.33}};
|
||||
for(NSUInteger y=0;y<180;y++)for(NSUInteger x=0;x<320;x++) {
|
||||
float t=float(x)/319;float *q=p+(y*320+x)*4;
|
||||
if(y<45)q[0]=q[1]=q[2]=t;
|
||||
else if(y<90){q[0]=t;q[1]=1-t;q[2]=.31;}
|
||||
else if(y<135){for(int c=0;c<3;c++)q[c]=swatches[std::min((NSUInteger)7,x*8/320)][c];}
|
||||
else{q[0]=t;q[1]=t*t;q[2]=sqrtf(t);}
|
||||
q[3]=1;
|
||||
}
|
||||
chart=[data copy];
|
||||
});return chart;
|
||||
}
|
||||
|
||||
NSImage *DYLUTThumbnail(NSString *path,NSData *source,NSUInteger sourceWidth,NSUInteger sourceHeight,NSSize outputSize,NSError **error) {
|
||||
if(!std::isfinite(outputSize.width)||!std::isfinite(outputSize.height)||outputSize.width<1||outputSize.height<1||outputSize.width>2048||outputSize.height>2048) {
|
||||
DYLUTFail(error,@"缩略图尺寸无效");return nil;
|
||||
}
|
||||
if(!source){source=DYLUTFallback();sourceWidth=320;sourceHeight=180;}
|
||||
NSData *transformed=DYLUTTransformRGBA(source,sourceWidth,sourceHeight,path,error);if(!transformed)return nil;
|
||||
NSUInteger width=(NSUInteger)llround(outputSize.width),height=(NSUInteger)llround(outputSize.height);
|
||||
NSBitmapImageRep *bitmap=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:NULL pixelsWide:width pixelsHigh:height
|
||||
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace
|
||||
bitmapFormat:NSBitmapFormatAlphaNonpremultiplied bytesPerRow:width*4 bitsPerPixel:32]autorelease];
|
||||
if(!bitmap){DYLUTFail(error,@"无法分配缩略图位图");return nil;}
|
||||
const float *p=(const float *)transformed.bytes;uint8_t *q=bitmap.bitmapData;
|
||||
for(NSUInteger y=0;y<height;y++)for(NSUInteger x=0;x<width;x++) {
|
||||
// Center-aligned bilinear scaling, independent of NSGraphicsContext.
|
||||
float fx=(float(x)+.5f)*sourceWidth/width-.5f,fy=(float(y)+.5f)*sourceHeight/height-.5f;
|
||||
fx=std::max(0.f,std::min(float(sourceWidth-1),fx));fy=std::max(0.f,std::min(float(sourceHeight-1),fy));
|
||||
NSUInteger x0=(NSUInteger)fx,y0=(NSUInteger)fy,x1=std::min(sourceWidth-1,x0+1),y1=std::min(sourceHeight-1,y0+1);
|
||||
float tx=fx-x0,ty=fy-y0;
|
||||
for(int c=0;c<4;c++) {
|
||||
float v=(p[(y0*sourceWidth+x0)*4+c]*(1-tx)+p[(y0*sourceWidth+x1)*4+c]*tx)*(1-ty)
|
||||
+(p[(y1*sourceWidth+x0)*4+c]*(1-tx)+p[(y1*sourceWidth+x1)*4+c]*tx)*ty;
|
||||
q[(y*width+x)*4+c]=(uint8_t)lroundf(std::max(0.f,std::min(1.f,v))*255);
|
||||
}
|
||||
}
|
||||
NSImage *image=[[[NSImage alloc]initWithSize:NSMakeSize(width,height)]autorelease];[image addRepresentation:bitmap];return image;
|
||||
}
|
||||
|
||||
static NSString *DYLUTRelativeFolder(NSString *path,NSString *root) {
|
||||
NSString *parent=path.stringByDeletingLastPathComponent;
|
||||
if([parent isEqual:root])return @"";
|
||||
NSString *prefix=[root stringByAppendingString:@"/"];
|
||||
return [parent hasPrefix:prefix]?[parent substringFromIndex:prefix.length]:@"";
|
||||
}
|
||||
static NSDictionary *DYLUTEntry(NSURL *url,NSURL *root) {
|
||||
NSString *path=url.path,*base=root.path;
|
||||
NSString *relative=[path hasPrefix:[base stringByAppendingString:@"/"]]?[path substringFromIndex:base.length+1]:path.lastPathComponent;
|
||||
return @{@"name":path.lastPathComponent.stringByDeletingPathExtension,@"path":path,
|
||||
@"relativeFolder":DYLUTRelativeFolder(path,base),@"relativePath":relative};
|
||||
}
|
||||
static BOOL DYLUTOrdinaryURL(NSURL *url,BOOL *directory,NSError **error) {
|
||||
NSNumber *isDirectory=nil,*isRegular=nil,*isLink=nil;
|
||||
if(![url getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:error]||
|
||||
![url getResourceValue:&isRegular forKey:NSURLIsRegularFileKey error:error]||
|
||||
![url getResourceValue:&isLink forKey:NSURLIsSymbolicLinkKey error:error])return NO;
|
||||
if(isLink.boolValue||(!isDirectory.boolValue&&!isRegular.boolValue))return DYLUTFail(error,@"不导入符号链接或特殊文件");
|
||||
if(directory)*directory=isDirectory.boolValue;return YES;
|
||||
}
|
||||
static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
|
||||
NSString *prefix=[root.path stringByAppendingString:@"/"];
|
||||
if(![directory.path isEqual:root.path]&&![directory.path hasPrefix:prefix])return DYLUTFail(error,@"LUT 目标路径超出目录边界");
|
||||
NSFileManager *fm=NSFileManager.defaultManager;
|
||||
if(![fm fileExistsAtPath:root.path]&&![fm createDirectoryAtURL:root withIntermediateDirectories:YES attributes:nil error:error])return NO;
|
||||
NSDictionary *attributes=[fm attributesOfItemAtPath:root.path error:error];
|
||||
if(![attributes[NSFileType]isEqual:NSFileTypeDirectory])return DYLUTFail(error,@"LUT 库根目录不是普通文件夹");
|
||||
NSString *relative=[directory.path isEqual:root.path]?@"":[directory.path substringFromIndex:prefix.length];
|
||||
NSURL *current=root;
|
||||
for(NSString *component in relative.pathComponents) {
|
||||
if(!component.length)continue;
|
||||
current=[current URLByAppendingPathComponent:component isDirectory:YES];
|
||||
NSDictionary *existing=[fm attributesOfItemAtPath:current.path error:NULL];
|
||||
if(existing) {
|
||||
if(![existing[NSFileType]isEqual:NSFileTypeDirectory])return DYLUTFail(error,@"LUT 目标文件夹含符号链接或非目录项");
|
||||
} else if(![fm createDirectoryAtURL:current withIntermediateDirectories:NO attributes:nil error:error])return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@interface DYLUTLibrary () {
|
||||
NSURL *_rootURL;
|
||||
NSArray *_entries,*_folders;
|
||||
NSMutableSet *_favoritePaths;
|
||||
NSObject *_fileLock;
|
||||
dispatch_queue_t _fileQueue;
|
||||
}
|
||||
@end
|
||||
@implementation DYLUTLibrary
|
||||
+ (NSURL *)defaultRootURL {return [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Movies/大鱼调色LUT/look LUTs"] isDirectory:YES];}
|
||||
- (instancetype)init {return [self initWithRootURL:self.class.defaultRootURL];}
|
||||
- (instancetype)initWithRootURL:(NSURL *)rootURL {
|
||||
if(!rootURL.isFileURL||!rootURL.path.length){[self release];return nil;}
|
||||
if((self=[super init])) {
|
||||
_fileLock=[NSObject new];_fileQueue=dispatch_queue_create("com.dayu.color.lut-files",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_fileQueue,dispatch_get_global_queue(QOS_CLASS_UTILITY,0));
|
||||
_rootURL=[DYLUTCanonicalURL(rootURL)copy];_entries=[@[]copy];_folders=[@[@""]copy];_favoritePaths=[NSMutableSet new];
|
||||
NSDictionary *saved=[NSDictionary dictionaryWithContentsOfURL:[_rootURL URLByAppendingPathComponent:@".favorites.plist"]];
|
||||
NSArray *relativePaths=[saved[@"relativePaths"]isKindOfClass:NSArray.class]?saved[@"relativePaths"]:@[];
|
||||
for(NSString *path in relativePaths)if([path isKindOfClass:NSString.class]&&![path isAbsolutePath]&&![path.pathComponents containsObject:@".."]) [_favoritePaths addObject:[_rootURL.path stringByAppendingPathComponent:path]];
|
||||
}return self;
|
||||
}
|
||||
- (void)dealloc {[_rootURL release];[_entries release];[_folders release];[_favoritePaths release];[_fileLock release];dispatch_release(_fileQueue);[super dealloc];}
|
||||
- (NSURL *)rootURL {return [[_rootURL copy]autorelease];}
|
||||
- (NSArray *)entries {@synchronized(self){return [[_entries copy]autorelease];}}
|
||||
- (NSArray *)folders {@synchronized(self){return [[_folders copy]autorelease];}}
|
||||
- (NSSet *)favoritePaths {@synchronized(self){return [[_favoritePaths copy]autorelease];}}
|
||||
- (BOOL)reload:(NSError **)error {return [self reloadProgress:nil error:error];}
|
||||
- (BOOL)reloadProgress:(NSProgress *)progress error:(NSError **)error {@synchronized(_fileLock){
|
||||
BOOL isDirectory=NO;NSFileManager *fm=NSFileManager.defaultManager;
|
||||
if(DYLUTCancelled(progress,error))return NO;
|
||||
if(![fm fileExistsAtPath:_rootURL.path isDirectory:&isDirectory]){@synchronized(self){[_entries release];_entries=[@[]copy];[_folders release];_folders=[@[@""]copy];}return YES;}
|
||||
if(!isDirectory||!DYLUTOrdinaryURL(_rootURL,NULL,error))return DYLUTFail(error,@"LUT 库目录无效");
|
||||
NSMutableArray *entries=[NSMutableArray array];NSMutableSet *folders=[NSMutableSet setWithObject:@""];
|
||||
__block NSError *scanError=nil;
|
||||
NSDirectoryEnumerator *enumerator=[fm enumeratorAtURL:_rootURL includingPropertiesForKeys:@[NSURLIsDirectoryKey,NSURLIsRegularFileKey,NSURLIsSymbolicLinkKey] options:NSDirectoryEnumerationSkipsHiddenFiles|NSDirectoryEnumerationSkipsPackageDescendants errorHandler:^BOOL(NSURL *url,NSError *e){(void)url;scanError=e;return NO;}];
|
||||
for(NSURL *url in enumerator) {
|
||||
if(DYLUTCancelled(progress,error))return NO;
|
||||
progress.completedUnitCount++;
|
||||
NSNumber *link=nil;[url getResourceValue:&link forKey:NSURLIsSymbolicLinkKey error:NULL];
|
||||
if(link.boolValue){[enumerator skipDescendants];continue;}
|
||||
BOOL directory=NO;if(!DYLUTOrdinaryURL(url,&directory,NULL))continue;
|
||||
if(![url.path hasPrefix:[_rootURL.path stringByAppendingString:@"/"]])return DYLUTFail(error,@"LUT 库文件路径超出目录边界");
|
||||
if(directory){NSString *relative=[url.path substringFromIndex:_rootURL.path.length+1];[folders addObject:relative];continue;}
|
||||
if([url.pathExtension.lowercaseString isEqual:@"cube"])[entries addObject:DYLUTEntry(url,_rootURL)];
|
||||
if(entries.count>10000)return DYLUTFail(error,@"LUT 库超过 10,000 个文件限制");
|
||||
}
|
||||
if(scanError){if(error)*error=scanError;return NO;}
|
||||
[entries sortUsingComparator:^NSComparisonResult(NSDictionary *a,NSDictionary *b){return [a[@"relativePath"]localizedStandardCompare:b[@"relativePath"]];}];
|
||||
if(DYLUTCancelled(progress,error))return NO;
|
||||
NSArray *sortedFolders=[folders.allObjects sortedArrayUsingSelector:@selector(localizedStandardCompare:)];
|
||||
@synchronized(self){[_entries release];_entries=[entries copy];[_folders release];_folders=[sortedFolders copy];}return YES;
|
||||
}}
|
||||
- (NSArray *)importURLs:(NSArray<NSURL *> *)urls error:(NSError **)error {return [self importURLs:urls progress:nil error:error];}
|
||||
- (NSArray *)importURLs:(NSArray<NSURL *> *)urls progress:(NSProgress *)progress error:(NSError **)error {@synchronized(_fileLock){
|
||||
NSFileManager *fm=NSFileManager.defaultManager;NSMutableArray *plans=[NSMutableArray array];
|
||||
NSString *root=_rootURL.path;
|
||||
for(NSURL *sourceURL in urls) {
|
||||
if(DYLUTCancelled(progress,error))return nil;
|
||||
if(!sourceURL.isFileURL){DYLUTFail(error,@"只能导入本机 LUT 文件");return nil;}
|
||||
NSURL *source=[sourceURL URLByStandardizingPath];BOOL directory=NO;
|
||||
if(!DYLUTOrdinaryURL(source,&directory,error))return nil;
|
||||
// NSDirectoryEnumerator canonicalizes /var to /private/var on macOS.
|
||||
// Canonicalize both sides before calculating a relative path.
|
||||
source=DYLUTCanonicalURL(source);
|
||||
if([source.path isEqual:root]||[source.path hasPrefix:[root stringByAppendingString:@"/"]]){DYLUTFail(error,@"此 LUT 已位于浏览库中");return nil;}
|
||||
if(!directory) {
|
||||
if(![source.pathExtension.lowercaseString isEqual:@"cube"]){DYLUTFail(error,@"请选择 .cube 文件或包含它们的文件夹");return nil;}
|
||||
[plans addObject:@{@"source":source,@"relative":source.lastPathComponent}];
|
||||
} else {
|
||||
__block NSError *scanError=nil;
|
||||
NSDirectoryEnumerator *enumerator=[fm enumeratorAtURL:source includingPropertiesForKeys:@[NSURLIsSymbolicLinkKey,NSURLIsDirectoryKey,NSURLIsRegularFileKey] options:NSDirectoryEnumerationSkipsHiddenFiles|NSDirectoryEnumerationSkipsPackageDescendants errorHandler:^BOOL(NSURL *url,NSError *e){(void)url;scanError=e;return NO;}];
|
||||
for(NSURL *file in enumerator) {
|
||||
if(DYLUTCancelled(progress,error))return nil;
|
||||
NSNumber *link=nil;[file getResourceValue:&link forKey:NSURLIsSymbolicLinkKey error:NULL];
|
||||
if(link.boolValue){[enumerator skipDescendants];continue;}
|
||||
BOOL subdirectory=NO;if(!DYLUTOrdinaryURL(file,&subdirectory,NULL)||subdirectory||![file.pathExtension.lowercaseString isEqual:@"cube"])continue;
|
||||
if(![file.path hasPrefix:[source.path stringByAppendingString:@"/"]]){DYLUTFail(error,@"导入文件路径超出目录边界");return nil;}
|
||||
NSString *relative=[source.lastPathComponent stringByAppendingPathComponent:[file.path substringFromIndex:source.path.length+1]];
|
||||
[plans addObject:@{@"source":file,@"relative":relative}];
|
||||
if(plans.count>10000){DYLUTFail(error,@"单次导入超过 10,000 个 LUT 限制");return nil;}
|
||||
}
|
||||
if(scanError){if(error)*error=scanError;return nil;}
|
||||
}
|
||||
}
|
||||
if(!plans.count){DYLUTFail(error,@"没有找到可导入的 .cube 文件");return nil;}
|
||||
// Validate every source before writing the library, preserving existing files.
|
||||
progress.totalUnitCount=plans.count*2;progress.completedUnitCount=0;
|
||||
for(NSDictionary *plan in plans){
|
||||
NSError *itemError=nil;BOOL valid=NO;
|
||||
@autoreleasepool{
|
||||
progress.localizedDescription=[NSString stringWithFormat:@"正在校验 %lld/%lu",progress.completedUnitCount+1,(unsigned long)plans.count];progress.localizedAdditionalDescription=[plan[@"source"]lastPathComponent];
|
||||
std::vector<float> values;NSUInteger n=0;valid=!DYLUTCancelled(progress,&itemError)&&DYLUTReadCancellable([plan[@"source"]path],values,n,progress,&itemError);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++;
|
||||
}
|
||||
if(!DYLUTEnsureDirectory(_rootURL,_rootURL,error))return nil;
|
||||
NSMutableArray *created=[NSMutableArray array],*imported=[NSMutableArray array];BOOL success=YES;
|
||||
for(NSDictionary *plan in plans){
|
||||
NSError *itemError=nil;BOOL copied=NO;
|
||||
@autoreleasepool{
|
||||
copied=[&]()->BOOL{
|
||||
if(DYLUTCancelled(progress,&itemError))return NO;
|
||||
progress.localizedDescription=[NSString stringWithFormat:@"正在导入 %lu/%lu",(unsigned long)imported.count+1,(unsigned long)plans.count];progress.localizedAdditionalDescription=[plan[@"source"]lastPathComponent];
|
||||
NSURL *destination=[_rootURL URLByAppendingPathComponent:plan[@"relative"]];
|
||||
if(!DYLUTEnsureDirectory(destination.URLByDeletingLastPathComponent,_rootURL,&itemError))return NO;
|
||||
NSString *stem=destination.path.stringByDeletingPathExtension,*extension=destination.pathExtension;NSUInteger suffix=1;
|
||||
while([fm fileExistsAtPath:destination.path])destination=[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@ %lu.%@",stem,(unsigned long)++suffix,extension]];
|
||||
if(![fm copyItemAtURL:plan[@"source"] toURL:destination error:&itemError])return NO;[created addObject:destination];
|
||||
std::vector<float> values;NSUInteger n=0;if(!DYLUTReadCancellable(destination.path,values,n,progress,&itemError))return NO;
|
||||
[imported addObject:DYLUTEntry(destination,_rootURL)];return YES;
|
||||
}();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++;
|
||||
}
|
||||
if(success)success=!DYLUTCancelled(progress,error)&&[self reload:error];
|
||||
if(!success){for(NSURL *url in created)[fm removeItemAtURL:url error:NULL];return nil;}
|
||||
return imported;
|
||||
}}
|
||||
- (NSProgress *)reloadAsync:(void (^)(NSError *))completion {
|
||||
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:-1];progress.localizedDescription=@"正在扫描 LUT 文件夹…";
|
||||
dispatch_async(_fileQueue,^{@autoreleasepool{NSError *error=nil;[self reloadProgress:progress error:&error];progress.totalUnitCount=MAX(1,progress.completedUnitCount);progress.completedUnitCount=progress.totalUnitCount;dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});}});return progress;
|
||||
}
|
||||
- (NSProgress *)importURLsAsync:(NSArray<NSURL *> *)urls completion:(void (^)(NSArray<NSDictionary *> *,NSError *))completion {
|
||||
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:-1];progress.localizedDescription=@"正在查找 LUT 文件…";NSArray *sources=[[urls copy]autorelease];
|
||||
dispatch_async(_fileQueue,^{@autoreleasepool{NSError *error=nil;NSArray *imported=[self importURLs:sources progress:progress error:&error];dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(imported,error);});}});return progress;
|
||||
}
|
||||
- (BOOL)isFavoritePath:(NSString *)path {@synchronized(self){return [_favoritePaths containsObject:path];}}
|
||||
- (BOOL)setFavorite:(BOOL)favorite forPath:(NSString *)path error:(NSError **)error {@synchronized(self){
|
||||
NSString *prefix=[_rootURL.path stringByAppendingString:@"/"];
|
||||
if(![path hasPrefix:prefix]||[path.pathComponents containsObject:@".."])return DYLUTFail(error,@"只能收藏浏览库中的 LUT");
|
||||
NSMutableSet *next=[[_favoritePaths mutableCopy]autorelease];if(favorite)[next addObject:path];else[next removeObject:path];
|
||||
NSMutableArray *relative=[NSMutableArray array];for(NSString *p in next)[relative addObject:[p substringFromIndex:prefix.length]];
|
||||
[relative sortUsingSelector:@selector(localizedStandardCompare:)];
|
||||
if(!DYLUTEnsureDirectory(_rootURL,_rootURL,error))return NO;
|
||||
NSData *data=[NSPropertyListSerialization dataWithPropertyList:@{@"relativePaths":relative} format:NSPropertyListXMLFormat_v1_0 options:0 error:error];
|
||||
if(!data||![data writeToURL:[_rootURL URLByAppendingPathComponent:@".favorites.plist"] options:NSDataWritingAtomic error:error])return NO;
|
||||
[_favoritePaths release];_favoritePaths=[next mutableCopy];return YES;
|
||||
}}
|
||||
@end
|
||||
+4
-4
@@ -7,9 +7,9 @@ static NSDictionary *row(NSString*k,NSString*t,NSUInteger o,double lo,double hi,
|
||||
NSMutableDictionary*r=[@{@"key":k,@"title":t,@"pid":@(PID(o)),@"offset":@(o),@"min":@(lo),@"max":@(hi),@"default":@(d),@"step":@(hi-lo>10?1:.01),@"kind":kind?:@"float"}mutableCopy];
|
||||
[descriptors addObject:r];return [r autorelease];
|
||||
}
|
||||
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=1){
|
||||
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=0){
|
||||
NSDictionary*e=row([k stringByAppendingString:@"Enabled"],t,offset,0,1,def,@"bool");
|
||||
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"rows":rows}];
|
||||
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"defaultEnabled":@(def),@"rows":rows}];
|
||||
}
|
||||
static NSDictionary *scalar(NSString*k,NSString*t,NSUInteger o,double lo=-100,double hi=100,double def=0){return row(k,t,o,lo,hi,def,@"float");}
|
||||
static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
@@ -26,8 +26,8 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
[descriptors replaceObjectAtIndex:[descriptors indexOfObjectPassingTest:^BOOL(id obj,NSUInteger idx,BOOL*stop){return [obj[@"key"]isEqual:keys[i]];}] withObject:r];[base addObject:r];
|
||||
}
|
||||
NSDictionary*copyAuto=@{@"key":@"copyAutoGrade",@"title":@"复制时自动调色",@"pid":@8800,@"offset":@(-1),@"min":@0,@"max":@1,@"default":@0,@"step":@1,@"kind":@"bool",@"notAnimatable":@YES};[descriptors addObject:copyAuto];
|
||||
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto]);
|
||||
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]]);
|
||||
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto],1);
|
||||
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]],1);
|
||||
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],0);
|
||||
NSMutableArray*look=[NSMutableArray arrayWithObject:scalar(@"postLUTStrength",@"风格 1 强度",60,0,1,1)];
|
||||
for(int i=0;i<4;i++){[look addObject:row([NSString stringWithFormat:@"look%dEnabled",i+2],[NSString stringWithFormat:@"风格 %d 启用",i+2],160+i*4,0,1,1,@"bool")];[look addObject:scalar([NSString stringWithFormat:@"look%dStrength",i+2],[NSString stringWithFormat:@"风格 %d 强度",i+2],64+i*4,0,1,1)];}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
- (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];}
|
||||
- (NSView*)createViewForParameterID:(UInt32)pid{return pid==DYInspectorParameterID?[[DYInspector alloc]initWithAPIManager:_apiManager]:[[NSView alloc]initWithFrame:NSZeroRect];}
|
||||
- (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)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:©Auto 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,8 +3,14 @@
|
||||
#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;
|
||||
/// Display-encoded float RGBA, 320×180, with the visually top row first.
|
||||
/// Analysis preview retains the host texture's original row order separately.
|
||||
- (NSData*)lookLUTPreview;
|
||||
- (void)invalidatePreview;
|
||||
@end
|
||||
+63
-35
@@ -1,5 +1,6 @@
|
||||
#import "DYRenderer.h"
|
||||
#import "DYColorTables.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#include <zlib.h>
|
||||
#include <vector>
|
||||
@@ -7,39 +8,44 @@
|
||||
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];}
|
||||
static BOOL loadCube(NSString*path,std::vector<float>&data,NSUInteger&size,NSError**err){
|
||||
NSData*b=[NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:err];if(!b)return NO;
|
||||
if([path.pathExtension.lowercaseString isEqual:@"dylut"]){
|
||||
if(b.length<36||memcmp(b.bytes,"DYLT",4))return fail(err,@"输入 LUT 格式损坏");uint32_t n=0,bytes=0;memcpy(&n,(uint8_t*)b.bytes+4,4);memcpy(&bytes,(uint8_t*)b.bytes+8,4);if(n<2||n>128||bytes!=n*n*n*16)return fail(err,@"输入 LUT 尺寸无效");data.resize(bytes/4);uLongf len=bytes;if(uncompress((Bytef*)data.data(),&len,(Bytef*)b.bytes+36,b.length-36)!=Z_OK||len!=bytes)return fail(err,@"输入 LUT 解压失败");size=n;return YES;
|
||||
}
|
||||
NSString*s=[[[NSString alloc]initWithData:b encoding:NSUTF8StringEncoding]autorelease];if(!s)return fail(err,@"LUT 必须是 UTF-8 文本");
|
||||
size=0;float domainMin[3]={0,0,0},domainMax[3]={1,1,1};
|
||||
for(NSString*line in [s componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){
|
||||
NSString*clean=[[[line componentsSeparatedByString:@"#"]firstObject]stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];if(!clean.length)continue;
|
||||
const char*c=clean.UTF8String;int n=0;float r,g,bl;
|
||||
if(sscanf(c,"LUT_3D_SIZE %d",&n)==1){if(n<2||n>128)return fail(err,@"LUT 尺寸应为 2–128");size=n;}
|
||||
else if(sscanf(c,"DOMAIN_MIN %f %f %f",&r,&g,&bl)==3){domainMin[0]=r;domainMin[1]=g;domainMin[2]=bl;}
|
||||
else if(sscanf(c,"DOMAIN_MAX %f %f %f",&r,&g,&bl)==3){domainMax[0]=r;domainMax[1]=g;domainMax[2]=bl;}
|
||||
else if(sscanf(c,"%f %f %f",&r,&g,&bl)==3){if(!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(bl))return fail(err,@"LUT 含无效数字");data.insert(data.end(),{r,g,bl,1});if(data.size()>128*128*128*4)return fail(err,@"LUT 数据过多");}
|
||||
else if([clean hasPrefix:@"LUT_1D_SIZE"])return fail(err,@"请选择三维 .cube LUT");
|
||||
}
|
||||
if(size<2||data.size()!=size*size*size*4)return fail(err,@"LUT 数据数量与尺寸不符");
|
||||
bool resample=false;for(int c=0;c<3;c++){if(!std::isfinite(domainMin[c])||!std::isfinite(domainMax[c])||domainMax[c]<=domainMin[c])return fail(err,@"LUT DOMAIN 范围无效");resample|=domainMin[c]!=0||domainMax[c]!=1;}
|
||||
if(resample){std::vector<float>src=data;for(NSUInteger z=0;z<size;z++)for(NSUInteger y=0;y<size;y++)for(NSUInteger x=0;x<size;x++){float v[3];NSUInteger i[3];NSUInteger pos[3]={x,y,z};for(int c=0;c<3;c++){v[c]=fminf(1,fmaxf(0,(float(pos[c])/(size-1)-domainMin[c])/(domainMax[c]-domainMin[c])))*(size-1);i[c]=fmin(size-2,(NSUInteger)v[c]);v[c]-=i[c];}size_t dest=((z*size+y)*size+x)*4;for(int c=0;c<3;c++){float sum=0;for(int k=0;k<8;k++){int a=k&1,b=(k>>1)&1,d=(k>>2)&1;sum+=src[(((i[2]+d)*size+i[1]+b)*size+i[0]+a)*4+c]*(a?v[0]:1-v[0])*(b?v[1]:1-v[1])*(d?v[2]:1-v[2]);}data[dest+c]=sum;}}}
|
||||
return YES;
|
||||
}
|
||||
@interface DYRenderer(){
|
||||
NSMutableDictionary *_devices,*_luts;
|
||||
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
|
||||
NSSet *_activeLUTPaths;
|
||||
dispatch_queue_t _lutPreparationQueue;
|
||||
DYColorTables *_tables;
|
||||
NSData *_preview;
|
||||
NSObject *_previewLock;
|
||||
NSData *_preview,*_lookLUTPreview;
|
||||
CFTimeInterval _lastPreview;
|
||||
}
|
||||
@end
|
||||
@implementation DYRenderer
|
||||
- (instancetype)init{if((self=[super init])){_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_tables=[DYColorTables new];}return self;}
|
||||
- (void)dealloc{[_devices release];[_luts release];[_tables release];[_preview release];[super dealloc];}
|
||||
- (void)invalidatePreview{@synchronized(self){[_preview release];_preview=nil;_lastPreview=0;}}
|
||||
- (NSData*)preview{@synchronized(self){return [[_preview retain]autorelease];}}
|
||||
- (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];}}
|
||||
- (NSMutableDictionary*)device:(uint64_t)registry error:(NSError**)err{
|
||||
NSNumber*k=@(registry);NSMutableDictionary*entry=_devices[k];if(entry)return entry;
|
||||
id<MTLDevice>d=nil;NSArray*all=MTLCopyAllDevices();for(id<MTLDevice>candidate in all)if(candidate.registryID==registry||!registry){d=[candidate retain];break;}[all release];if(!d){fail(err,@"宿主的 Metal 设备不可用");return nil;}
|
||||
@@ -48,24 +54,35 @@ static BOOL loadCube(NSString*path,std::vector<float>&data,NSUInteger&size,NSErr
|
||||
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];}
|
||||
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|%@|%@|%@",[e[@"device"]registryID],path,attrs[NSFileModificationDate],attrs[NSFileSize]];id<MTLTexture>t=_luts[key];if(t)return t;
|
||||
std::vector<float>v;NSUInteger n=0;if(!loadCube(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{
|
||||
NSString*input=paths[@"input"];int profile=(int)roundf(u->inputProfile);
|
||||
// Normalize only this render copy. Folded groups retain their host parameters
|
||||
// and paths, while inactive LUTs neither load files nor affect any layer.
|
||||
BOOL inputEnabled=u->inputSectionEnabled>.5;
|
||||
NSString*input=inputEnabled?paths[@"input"]:nil;int profile=inputEnabled?(int)roundf(u->inputProfile):0;
|
||||
if(!inputEnabled){u->inputProfile=0;u->preLUTStrength=0;}
|
||||
if(!input.length&&profile>0&&profile<(int)inputFiles().count)input=[[NSBundle bundleForClass:self.class]pathForResource:inputFiles()[profile] ofType:@"dylut" inDirectory:@"InputLUTs"];
|
||||
if(profile>0&&!input.length){fail(err,@"相机输入转换资源缺失");return nil;}
|
||||
NSMutableArray*ts=[NSMutableArray array];id<MTLTexture>t=[self lut:input entry:e error:err];if(!t)return nil;[ts addObject:t];if(!input.length)u->preLUTStrength=0;
|
||||
for(int i=0;i<5;i++){NSString*p=paths[[NSString stringWithFormat:@"look%d",i]];t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
|
||||
BOOL looksEnabled=u->lookSectionEnabled>.5;
|
||||
if(!looksEnabled)u->extraLookSectionEnableds=(DYFloat4){0,0,0,0};
|
||||
for(int i=0;i<5;i++){BOOL active=looksEnabled&&(i==0||u->extraLookSectionEnableds[i-1]>.5);NSString*p=active?paths[[NSString stringWithFormat:@"look%d",i]]:nil;t=[self lut:p entry:e error:err];if(!t)return nil;[ts addObject:t];if(!p.length){if(i==0)u->postLUTStrength=0;else u->extraPostLUTStrengths[i-1]=0;}}
|
||||
[DYColorTables fillPrimaries:u];id<MTLDevice>d=e[@"device"];
|
||||
id<MTLTexture>h=[_tables hslForDevice:d uniforms:u],w=[_tables whiteBalanceForDevice:d uniforms:u],g=[_tables gradingForDevice:d uniforms:u];if(!h||!w||!g){fail(err,_tables.lastError?:@"颜色查表构建失败");return nil;}[ts addObjectsFromArray:@[h,w,g]];return ts;
|
||||
}
|
||||
- (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;
|
||||
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];}
|
||||
@@ -73,14 +90,25 @@ static BOOL loadCube(NSString*path,std::vector<float>&data,NSUInteger&size,NSErr
|
||||
id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyUnpremultiply"]];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
|
||||
float level=.5;id<MTLBuffer>scene=[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared];
|
||||
if(u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
|
||||
BOOL preview=CACurrentMediaTime()-_lastPreview>.5;id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
|
||||
BOOL preview=NO;@synchronized(_previewLock){preview=CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
|
||||
MTLRenderPassDescriptor*rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=output;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>re=[cb renderCommandEncoderWithDescriptor:rp];[re setRenderPipelineState:pipeline];
|
||||
float w=output.width,h=output.height;FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
|
||||
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){top=1-top;bottom=1-bottom;}
|
||||
DYVertex2D vs[]={{{w/2,-h/2},{r,bottom}},{{-w/2,-h/2},{l,bottom}},{{w/2,h/2},{r,top}},{{-w/2,h/2},{l,top}}};
|
||||
if(dst.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)for(int i=0;i<4;i++)vs[i].position.y=-vs[i].position.y;
|
||||
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,0,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
|
||||
if(ok&&pb){[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];_lastPreview=CACurrentMediaTime();}
|
||||
if(ok&&pb){@synchronized(_previewLock){
|
||||
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
|
||||
// The analysis kernel reads physical texture rows. Its result remains intact
|
||||
// for auto grade; only the browser copy is normalized to top-first bitmap rows.
|
||||
[_lookLUTPreview release];
|
||||
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){
|
||||
const NSUInteger rowBytes=320*16;NSMutableData*topFirst=[NSMutableData dataWithLength:_preview.length];
|
||||
for(NSUInteger y=0;y<180;y++)memcpy((uint8_t*)topFirst.mutableBytes+y*rowBytes,(const uint8_t*)_preview.bytes+(179-y)*rowBytes,rowBytes);
|
||||
_lookLUTPreview=[topFirst copy];
|
||||
}else _lookLUTPreview=[_preview retain];
|
||||
_lastPreview=CACurrentMediaTime();dispatch_async(dispatch_get_main_queue(),^{[[NSNotificationCenter defaultCenter]postNotificationName:@"DYPreviewDidChange" object:self];});
|
||||
}}
|
||||
if(!ok)fail(err,cb.error.localizedDescription);[pb release];[straight release];[scene release];return ok;
|
||||
}}}
|
||||
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
FOUNDATION_EXPORT NSString *const DYThemeDidChange;
|
||||
FOUNDATION_EXPORT NSArray<NSString *> *DYThemeNames(void);
|
||||
FOUNDATION_EXPORT NSInteger DYThemeIndex(void);
|
||||
FOUNDATION_EXPORT void DYSetThemeIndex(NSInteger index);
|
||||
FOUNDATION_EXPORT NSDictionary<NSString *, NSColor *> *DYThemePalette(void);
|
||||
FOUNDATION_EXPORT NSColor *DYThemeColor(NSString *role);
|
||||
FOUNDATION_EXPORT NSColor *DYThemeSwatch(NSInteger index);
|
||||
@@ -0,0 +1,52 @@
|
||||
#import "DYTheme.h"
|
||||
|
||||
NSString *const DYThemeDidChange=@"DYThemeDidChange";
|
||||
static NSString *const preferenceDomain=@"com.dayu.color.preferences";
|
||||
static NSString *const distributedChange=@"com.dayu.color.theme.changed";
|
||||
static NSColor *rgb(double r,double g,double b){return [NSColor colorWithCalibratedRed:r green:g blue:b alpha:1];}
|
||||
@interface DYThemeStore : NSObject
|
||||
@property(nonatomic,retain) NSUserDefaults *defaults;
|
||||
@end
|
||||
@implementation DYThemeStore
|
||||
- (instancetype)init {
|
||||
if((self=[super init])) {
|
||||
_defaults=[[NSUserDefaults alloc]initWithSuiteName:preferenceDomain];
|
||||
[_defaults registerDefaults:@{@"themeIndex":@1}];
|
||||
[[NSDistributedNotificationCenter defaultCenter]addObserver:self selector:@selector(externalChange:) name:distributedChange object:preferenceDomain suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {[[NSDistributedNotificationCenter defaultCenter]removeObserver:self];[_defaults release];[super dealloc];}
|
||||
- (void)externalChange:(NSNotification *)note {
|
||||
[_defaults synchronize];
|
||||
dispatch_async(dispatch_get_main_queue(),^{[[NSNotificationCenter defaultCenter]postNotificationName:DYThemeDidChange object:nil];});
|
||||
}
|
||||
@end
|
||||
static DYThemeStore *store(void){static DYThemeStore *s;static dispatch_once_t once;dispatch_once(&once,^{s=[DYThemeStore new];});return s;}
|
||||
NSArray<NSString *> *DYThemeNames(void){return @[@"深空灰",@"冰川蓝",@"薰衣草紫",@"翡翠绿",@"琥珀橙"];}
|
||||
NSInteger DYThemeIndex(void){NSInteger i=[store().defaults integerForKey:@"themeIndex"];return i>=0&&i<5?i:1;}
|
||||
static const double paletteRGB[5][17][3]={
|
||||
{{0.11,0.12,0.14},{0.075,0.08,0.095},{0.17,0.18,0.21},{0.12,0.13,0.15},{0.27,0.29,0.33},{0.2,0.22,0.25},{0.36,0.39,0.44},{0.25,0.28,0.32},{0.21,0.23,0.26},{0.15,0.17,0.2},{0.78,0.83,0.9},{0.55,0.61,0.7},{1.0,1.0,1.0},{0.78,0.82,0.88},{0.96,0.97,0.98},{0.86,0.89,0.92},{0.67,0.72,0.77}},
|
||||
{{0.031,0.086,0.148},{0.025,0.075,0.13},{0.07,0.155,0.235},{0.045,0.12,0.19},{0.115,0.22,0.33},{0.07,0.15,0.24},{0.15,0.33,0.5},{0.08,0.24,0.36},{0.23,0.32,0.41},{0.18,0.26,0.35},{0.38,0.76,1.0},{0.23,0.64,0.97},{0.96,0.98,1.0},{0.62,0.7,0.76},{0.88,0.96,1.0},{0.82,0.9,0.96},{0.58,0.7,0.78}},
|
||||
{{0.11,0.09,0.17},{0.07,0.06,0.12},{0.18,0.14,0.28},{0.13,0.1,0.21},{0.27,0.22,0.42},{0.2,0.16,0.31},{0.43,0.34,0.68},{0.31,0.23,0.52},{0.22,0.18,0.31},{0.15,0.12,0.23},{0.78,0.71,1.0},{0.5,0.42,0.93},{0.95,0.9,1.0},{0.63,0.5,0.95},{0.98,0.95,1.0},{0.9,0.86,0.97},{0.7,0.66,0.82}},
|
||||
{{0.08,0.17,0.1},{0.05,0.12,0.07},{0.12,0.27,0.15},{0.09,0.2,0.11},{0.16,0.35,0.2},{0.12,0.27,0.15},{0.21,0.57,0.31},{0.14,0.4,0.21},{0.14,0.27,0.16},{0.1,0.2,0.11},{0.54,0.96,0.64},{0.22,0.75,0.35},{0.91,1.0,0.93},{0.28,0.8,0.42},{0.95,1.0,0.96},{0.86,0.96,0.88},{0.66,0.8,0.68}},
|
||||
{{0.23,0.15,0.08},{0.16,0.1,0.05},{0.35,0.22,0.11},{0.26,0.16,0.08},{0.45,0.28,0.14},{0.36,0.22,0.1},{0.72,0.44,0.18},{0.56,0.32,0.12},{0.29,0.18,0.09},{0.2,0.12,0.06},{0.98,0.67,0.31},{0.86,0.47,0.17},{1.0,0.86,0.57},{0.93,0.59,0.22},{1.0,0.96,0.9},{0.97,0.9,0.82},{0.8,0.7,0.58}}
|
||||
};
|
||||
NSColor *DYThemeSwatch(NSInteger index){static const double values[5][3]={{.30,.33,.38},{.28,.72,1},{.58,.52,1},{.30,.86,.52},{1,.61,.28}};index=MAX(0,MIN(4,index));return rgb(values[index][0],values[index][1],values[index][2]);}
|
||||
void DYSetThemeIndex(NSInteger index){if(index<0||index>4)return;[store().defaults setInteger:index forKey:@"themeIndex"];[store().defaults synchronize];[[NSNotificationCenter defaultCenter]postNotificationName:DYThemeDidChange object:nil];[[NSDistributedNotificationCenter defaultCenter]postNotificationName:distributedChange object:preferenceDomain userInfo:nil deliverImmediately:YES];}
|
||||
NSDictionary<NSString *,NSColor *> *DYThemePalette(void){
|
||||
static NSArray *palettes;static dispatch_once_t once;dispatch_once(&once,^{
|
||||
NSMutableArray *all=[NSMutableArray array];
|
||||
for(NSInteger index=0;index<5;index++){
|
||||
const double (*p)[3]=paletteRGB[index];NSMutableDictionary *d=[NSMutableDictionary dictionary];
|
||||
for(int i=0;i<17;i++)d[[NSString stringWithFormat:@"slot%d",i]]=rgb(p[i][0],p[i][1],p[i][2]);
|
||||
NSColor *accent=index==0?rgb(.72,.77,.84):index==1?rgb(.22,.67,1):DYThemeSwatch(index);
|
||||
[d addEntriesFromDictionary:@{@"background":d[@"slot1"],@"card":d[@"slot3"],@"border":[accent colorWithAlphaComponent:.38],@"text":d[@"slot14"],@"secondary":d[@"slot16"],@"accent":accent,@"field":d[@"slot4"],@"headerTop":d[@"slot6"],@"headerBottom":d[@"slot7"],@"track":d[@"slot8"],@"activeTop":d[@"slot10"],@"activeBottom":d[@"slot11"],@"knob":d[@"slot12"]}];[all addObject:[[d copy]autorelease]];
|
||||
}palettes=[all copy];
|
||||
});return palettes[DYThemeIndex()];
|
||||
}
|
||||
NSColor *DYThemeColor(NSString *role){
|
||||
static NSDictionary *colors;static dispatch_once_t once;dispatch_once(&once,^{
|
||||
NSMutableDictionary *all=[NSMutableDictionary dictionary];for(NSString *key in DYThemePalette())all[key]=[NSColor colorWithName:[@"Dayu." stringByAppendingString:key] dynamicProvider:^NSColor *(NSAppearance *appearance){return DYThemePalette()[key];}];colors=[all copy];
|
||||
});return colors[role]?:NSColor.whiteColor;
|
||||
}
|
||||
+2
-2
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.1.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2</string>
|
||||
<string>16</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<string>DayuColor.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.1.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2</string>
|
||||
<string>16</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
二进制文件未显示。
在新工单中引用
屏蔽一个用户