比较提交

..
共修改 37 个文件,包含 9592 行新增和 197 行删除

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

+18
查看文件
@@ -0,0 +1,18 @@
大鱼调色 1.1.5(16),适用于 Apple Silicon Mac,最低 macOS 14.6。
- 新增 UTF-16、UTF-32 大小端及有无 BOM 的 Cube LUT 读取。
- 兼容 UTF-8 和常见旧编码的标题、注释,以及常见换行和 Unicode 空白。
- LUT 在后台解析、准备和导入,保留原文件及导入副本的原始字节。
- 16 种编码样本已在 Final Cut Pro 12.4 中完成导入、缩略图、逐项应用和保存重开验收;原生渲染与编码回归通过。
安装包包含原生 FxPlug 程序和 FCP 效果模板,不含用户 LUT、预设或媒体。安装前保存工作并正常退出 Final Cut Pro / Motion;完成安装后重新打开宿主。
安装包已由 Developer ID Installer 签名,通过 Apple 公证并粘附票据;20 项展开验包通过。包内程序与正式安装版本一致。本轮未再次执行该 PKG 的系统安装。
版本标签:`v1.1.5-lut-encoding-20261101`
交付记录提交:`06968514fc5205a83fbf3c5a3dbb1be0f6f3e79b`
APP 实际编译源码:`59b058a3c8b9e5387381574da6bbc05af437527c`
附件:`大鱼调色-1.1.5.pkg`
大小:13,752,153 字节
SHA-256:`bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071`
+18
查看文件
@@ -0,0 +1,18 @@
大鱼调色 1.2.0(17),适用于 Apple Silicon Mac,最低 macOS 14.6。
- 输入还原改为大鱼 CST 的输入转换、工作空间一级调色和输出转换,曲线与色域独立选择。
- 标题只展开/折叠,小眼睛只启用/旁路,独立保存。默认一级调色与基础调整展开,其余折叠,所有眼睛开启。
- 保留旧工程输入 LUT/相机档位兼容;风格 LUT、编码兼容、后台加载及自动分析继续可用。
- Cube 导出包含 CST 与一级调色;黑白新增默认 0% 混合,默认画面中性。
- 153 项原生检查及 21 组独立 CST 像素对照通过;FCP 12.4 默认、独立开关、参数保留、Sony/ACES 选择、保存重开及风格库应用验收通过。
安装包包含原生 FxPlug APP 和 FCP 模板,不含用户 LUT、预设或媒体。安装前保存工作并正常退出 Final Cut Pro/Motion。APP 和 PKG 均完成正式签名、公证、票据与 Gatekeeper 核验,20 项展开验包通过;本轮未重复执行 PKG 安装。
版本标签:`v1.2.0-cst-fold-20261101`
APP 实际编译源码:`48b00c85799b0226ba32aba3f2e5397aa0e509ed`
APP 公证:`f25ae46e-92da-4470-842e-128bdb232aa8`,Accepted
PKG 公证:`c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted
附件:`大鱼调色-1.2.0.pkg`
大小:13,818,397 字节
SHA-256:`9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`
+42
查看文件
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
"""Upload the exact verified package recorded by an existing release tag."""
import argparse
import json
from pathlib import Path
import subprocess
ROOT = Path(__file__).resolve().parent.parent
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--tag", required=True)
parser.add_argument("--notes", required=True, type=Path)
parser.add_argument("--pkg-forge-repo", type=Path,
default=Path.home() / "Documents/dayu-git/repositories/pkg-forge")
args = parser.parse_args()
report = json.loads((ROOT / "verification/Package.json").read_text())
assert report["pass"] and not report["testUnsigned"] and report["notarization"]["status"] == "Accepted"
tag_report = json.loads(subprocess.check_output(
["git", "show", args.tag + ":verification/Package.json"], cwd=ROOT, text=True))
for key in ["sha256", "bytes", "appCompiledSource", "appBuild"]:
assert tag_report[key] == report[key], "所选标签与当前已验包记录不一致:" + key
app = report["resources"][0]
assert app["bundleID"] == "com.dayu.color" and app["version"] == tag_report["resources"][0]["version"]
package = Path(report["package"])
signature = subprocess.check_output(["pkgutil", "--check-signature", str(package)], text=True)
assert "Developer ID Installer: zhong luo (B3W25FX5H5)" in signature
subprocess.run(["xcrun", "stapler", "validate", str(package)], check=True, capture_output=True)
subprocess.run(["spctl", "--assess", "--type", "install", str(package)], check=True, capture_output=True)
commit = subprocess.check_output(["git", "rev-parse", args.tag + "^{commit}"], cwd=ROOT, text=True).strip()
helper = args.pkg_forge_repo / "skills/pkg-forge/scripts/publish_release.py"
result = subprocess.run(["python3", str(helper), "--repository", "dayu/dayu-color", "--repo-root", str(ROOT),
"--tag", args.tag, "--commit", commit, "--title", "大鱼调色 " + app["version"] + "(" + app["build"] + ")",
"--body-file", str(args.notes.resolve()), "--asset", str(package), "--sha256", report["sha256"],
"--bytes", str(report["bytes"]), "--account", "dayu",
"--report", str(ROOT / "verification/Release.json")])
return result.returncode
if __name__ == "__main__":
raise SystemExit(main())
+21 -35
查看文件
@@ -1,49 +1,35 @@
# 大鱼调色
原生 FxPlug 4 调色器。主方案为 **Wrapper Application**,包含独立 XPC 插件,正式安装在 `/Library/Plug-Ins/FxPlug/大鱼调色.app`。
原生 FxPlug 4 调色器,当前正式版本 **1.2.0(17)**。唯一安装位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;Final Cut Pro 中从“效果 → 大鱼调色”添加。
支持 17 种相机输入转换、自选输入 LUT、基础光影、白平衡、局部增强、肤色保护、五层风格 LUT、RGB 曲线、8 色与自定义 HSL、四个色轮、三原色、色阶、黑白和色彩平衡。包含自动调色、复制时自动分析、系统吸管、JSON 预设和 Cube 导出。
## 色彩管理与一级调色
- [分析与范围](research/ANALYSIS.md)
- [Color Finale 移植研究与算法来源](research/ALGORITHM_SOURCES.md)
- [恢复、依赖与正式交付](RECOVERY.md)
- [GPU 数学来源与验证](tools/kernels/README.md)
- [正式安装记录](verification/Delivery.json)
- [LUT 后台加载的 FCP 验收](verification/HostLUTLoading.json)
- [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)
前段已改为 **输入转换 → 工作空间一级调色 → 输出转换**,复用大鱼 CST 仓库的固定源码与原生 GPU 数学。曲线和色域独立选择,工作空间统一供一级调色及输出使用,不经相机还原 LUT 近似。
当前正式版本为 1.1.5(16),交付标签 `v1.1.5-lut-encoding-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
新实例输入与输出均为 Gamma 2.4 / Rec.709,工作空间为 DaVinci Intermediate / DaVinci Wide Gamut,自动色调映射关闭。请按素材实际编码选择相机输入;不会根据片段或曲线名称猜测、覆盖手选色域。一级调色包含曝光、色彩平衡、饱和度、对比度与轴心、分区影调、黑白点、趾部/肩部压缩和旁路。
程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。
CST 后的基础调整、HSL、曲线、色轮、五层风格 LUT 等仍属于既有显示域调色链。保留肤色保护、三原色、色阶、黑白、自动调色、吸管、预设和 Cube 导出。Cube 导出包含 CST 和一级调色,不包含空间细节或逐画面统计。
主题与 LUT 浏览库自 1.1.0(6)提供,源码标签 `v1.1.0-theme-lut-20261031`。灰、蓝、紫、绿、橙五套主题切换后跨实例记忆。风格 LUT 左侧网格按钮打开缩略图浏览器,右侧文件夹按钮打开 `~/Movies/大鱼调色LUT/look LUTs`。可导入文件或目录,按目录与名称过滤,单击应用,缩略图大小与目录会保存。
旧工程的输入 LUT / 相机档位和原画面保持兼容;在输入组看到“旧版输入 → 改用 CST”时,可明确切换。编辑 CST 参数也会启用新链路。旧参数 ID、LUT 路径与预设读取保留。
缩略图使用当前素材先经过输入 LUT 的画面;没有源帧时显示本产品生成的色卡。显示方向与宿主图像原点一致,自动分析保留自己的原始数据。浏览器优先采用 FxPlug 宿主窗口,不能使用时回退为锚定弹出面板。品牌保留大鱼,吸管仍为系统取色器。
## 模块界面
算法背景资料补充了同系列工程的 **Color Finale 移植研究**,涵盖调色工具、LUT 预览、图层与蒙版工作流;归档记录、适用范围及当前实现的来源区分见 [算法说明](research/ALGORITHM_SOURCES.md)。Camera Raw 查表数据与组合行为采用 Compositor 的 MIT 许可实现,许可证随资源保留。
新实例和“全部还原”默认展开 **一级调色、基础调整**,其余折叠,所有眼睛开启。标题只控制展开;眼睛只负责启用/旁路,两者分别保存,正常重开仍保留。折叠保留参数、LUT 选择和效果。黑白混合默认 0%,避免全眼睛开启时直接变成黑白。
`大鱼调色/Plugin` 保存模型、AppKit 检查器、IOSurface/Metal 渲染与 CPU 查表;`tools/kernels` 保存可重建的 GPU 数学文本;`template` 是 FCP 效果入口。正式构建使用仓库中的源码和资源。
五套主题跨实例记忆。风格 LUT 网格打开缩略图浏览库;用户库为 `~/Movies/大鱼调色LUT/look LUTs`。后台扫描、导入、解析、预览、取消和最后一次选择生效的机制保留;支持既有 UTF-8/16/32 与旧编码 Cube 兼容。用户文件不进入源码或安装包。
选择自有 LUT 后,预设记录其绝对路径;跨机器搬移时同时保留 LUT 文件并重新选择。LUT 导出只保存逐像素颜色,不包含纹理、清晰度或逐画面分析。
## 验证与恢复
`tools/create_lut_host_fixture.py` 可重建独立 FCP 验收 XML 和四个合成测试 LUT;它只写产品缓存,不会向用户库自动导入。LUT 核心检查见 `verification/LUTLibrary.json`,主题与浏览库实现说明见 `research/ThemeLUT-analysis.md`。
- [本轮交接](大鱼调色FxPlug4交接.md)
- [CST 来源与集成边界](research/CSTIntegration.md)
- [CST 固定源码节点与摘要](research/CSTIntegration.json)
- [153 项原生与独立像素对照](verification/CSTIntegration.json)
- [正式 FCP 界面与保存重开](verification/HostCSTAndDisclosure.json)
- [正式安装与公证](verification/Delivery.json)
- [远端独立恢复与着色器重建](verification/CSTRecovery.json)
- [完整恢复说明和历史](RECOVERY.md)
- [原有算法来源](research/ALGORITHM_SOURCES.md)
`tools/create_group_fold_host_fixture.py` 可创建独立的合成验收时间线,用于检查新实例仅基础调节默认启用、分组展开/折叠与数值保留。风格 LUT 总组停用会旁路全部五层;停用的输入或风格 LUT 不加载其文件。
构建使用 `Wrapper Application` 方案、Release。运行 `python3 tools/deliver.py` 完成签名、公证、唯一安装和正式宿主验收;更改模型后运行 `python3 tools/build_template.py --refresh-model --overwrite`。`tools/create_cst_host_fixture.py` 重建独立合成验收 XML,不写用户 LUT 库。
LUT 文件夹扫描、逐项校验/复制和选择文件后的解析均在后台执行;导入期间可继续搜索、滚动和选择,刷新按钮临时变为“取消”。失败或取消会移除本次新复制的文件并保留既有库。目录与缩略图只为可见范围创建控件,预览逐项出现;快速切换时仅应用最后一次选择。24个65级合成LUT与3,025项库的响应测试见 [LUTResponsiveness.json](verification/LUTResponsiveness.json)。
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与已验收的正式安装逐字节一致。
正式发行包由 PKG 工坊技能生成,包含 APP 与 FCP 模板,不含用户 LUT、预设或媒体。安装与发布证据分别保存在 [Package.json](verification/Package.json) 和 [Release.json](verification/Release.json);以其中记录的版本和成功状态为准。
+31 -2
查看文件
@@ -1,10 +1,25 @@
# 大鱼调色恢复说明
## 当前 1.2.0(17)交付
版本标签 `v1.2.0-cst-fold-20261101`;实际编译源码 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`。正式 APP 公证 `f25ae46e-92da-4470-842e-128bdb232aa8`,Accepted,票据和 Gatekeeper 通过;唯一安装路径及服务进程已在 FCP 12.4 核对。签名团队 B3W25FX5H5,固定缓存和公证配置不变。
前段复用 `dayu/dayu-cst` 的 `973766b51dbcab3ab5092f1955d753575cd32d89` 源码:输入曲线/色域 → 工作空间一级 → 输出曲线/色域,源码副本与摘要均在本仓库,不依赖另一份 CST APP 才能生产运行。原始 944 字节调色 ABI 前缀保留,新增控制追加其后。来源见 research/CSTIntegration.json。
一级调色与基础调整默认展开,其他模块折叠,全部眼睛开启;折叠独立写入 InspectorToken,不修改渲染参数。新 InspectorToken schema 2,旧 schema 1 及旧输入 LUT/预设继续读取。旧工程默认旁路新 CST,直到明确迁移;黑白新增混合,旧工程保留原黑白效果。新默认 Rec.709/Gamma 2.4 往返保持中性。
153 项原生检查通过,21 组独立 CST 像素对照最大分量误差 0.0000152587890625,正式路径常规自检 110 项通过;FCP 新实例默认、折叠、眼睛、0.70 曝光、Sony/ACES 选择及保存重开通过。风格库 N12 的 26 项可见并可应用。宿主观察不冒充逐像素导出一致,Motion/Intel/旧系统未验收。
远端独立克隆实际编译节点,151 个提交文件校核、full/strict fsck,以及着色器重建均通过,重建 SHA 与正式库一致。详见 verification/CSTRecovery.json。无 LFS、无子模块。签名私钥和用户 LUT 仍须独立恢复。
安装包/Release 的版本、摘要、标签、附件下载校验分别见 verification/Package.json 和 verification/Release.json;尚未产生本版本成功记录时不能据历史记录宣称发布完成。本轮 APP 已完成唯一安装,PKG 只展开验包,不重复运行安装脚本。
远程:https://dayu.media/git/dayu/dayu-color.git,分支main。
初始化基线:10987dd6bcc6986ea321eff75b37d4e8b48e966d;后续节点见git log。
产品主ID:com.dayu.color,XPC:com.dayu.color.XPC;唯一正式位置:/Library/Plug-Ins/FxPlug/大鱼调色.app。
当前交付标签:v1.1.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。
历史 1.1.5 交付标签:v1.1.5-lut-encoding-20261101。APP 1.1.5(16)编译源码:59b058a3c8b9e5387381574da6bbc05af437527c;标签另含最终宿主验收与恢复记录。Apple 公证 ID b47b6fe8-b7a9-4112-93b9-de85b03ca598,Accepted;正式签名、票据、Gatekeeper 与宿主重开均通过,见 verification/Delivery.json 和 verification/HostLUTEncoding.json。
外部LUT版本 v1.1.4-external-lut-20261101 保留,编译源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14,原公证ID d9d9b05a-58b5-4a7a-aac2-6433b87d901d。
@@ -12,7 +27,7 @@
分组折叠版本 v1.1.2-group-fold-20261031 保留,编译源码 cdcb30a6aa1519bfb2f183165fef11cbf278bc7c,原公证 ID 398b020c-9e1e-4c2b-b637-e8e3af2a8f59。
所有调色分组展开即启用、折叠即停用,关闭时参数不可见;仅基础调节在新实例和全部还原后默认展开。折叠保留数值和 LUT 路径;打开已保存实例时按其实际启用状态展开。基础调节同时控制原光影与颜色两个子组。风格 LUT 总组停用时全部五层均旁路,关闭的输入或风格 LUT 不加载文件。肤色保护的百分比字段按0–100范围显示和保存。
历史 1.1.2–1.1.5 行为(已由 1.2.0 取代):所有调色分组展开即启用、折叠即停用,关闭时参数不可见;仅基础调节在新实例和全部还原后默认展开。折叠保留数值和 LUT 路径;打开已保存实例时按其实际启用状态展开。基础调节同时控制原光影与颜色两个子组。风格 LUT 总组停用时全部五层均旁路,关闭的输入或风格 LUT 不加载文件。肤色保护的百分比字段按0–100范围显示和保存。
FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红45与肤色65%跨折叠及保存重开保留、全部还原后只展开基础调节的验收见 verification/HostGroupFolding.json。仅在独立合成验收项目中改值,最后恢复默认;用户媒体和其他产品未作改动。
@@ -129,3 +144,17 @@ python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录 --
系统安装器介绍页、说明页及光谱鱼角标已预览;没有执行安装动作,不宣称本PKG实际安装流程/注册或旧系统已验收。已有正式APP的FCP保存重开等验收仍见HostLUTLoading.json。包、用户媒体和凭据不进入源码Git;重建的签名时间戳、随机组件ID与公证票据会使PKG摘要不同。完整验包结果见verification/Package.json。
打包技能清理修正:当前推荐技能标签skill-pkg-forge-20261101-r2,节点191da9dc0abfda83fcc5939f6fc90e4c9019f4d9。最初生成正式包所用6d4266e保留为真实来源;修正版只增加唯一组件ID关联的暂存清理,不改原PackageBuilder或正式包内容。旧版打包器因保护预览留下的两份载荷及本次探针副本已按任务ID核实清理;修正版真实测试完成后无本任务APP暂存,源预览锁保留。补充交付记录标签v1.1.3-pkg-20261101-r2;初次PKG标签保留。
## Release 附件发布(2026-11-01)
全局AGENTS规则负责源码/标签推送及正式发行包Release保存;pkg-forge技能提供上传入口。产品入口Packaging/publish_release.py只接受已签名公证、验包通过且与所选版本标签中记录一致的安装包;版本说明在Packaging/Release-1.1.5.md。新Release先草稿,完整下载附件核对大小/SHA-256后再发布;同名一致附件复用,冲突停止,不移动原版本标签。记录在verification/Release.json,发布成功前不能把源码推送或本地包存在描述为附件已经上传。
最初浏览器Git凭据的POST Release请求被会员网关按设计拒绝403,回读未创建Release。用户随后授权独立API发布凭据,并通知线上权限已更新;专用API凭据已通过系统钥匙串确认。其范围为read:user与write:repository,不包含管理员权限;未修改原Git凭据。授权信息和令牌不随源码恢复,新机器通过正常网站与系统钥匙串重新配置。
正式Release:https://dayu.media/git/dayu/dayu-color/releases/tag/v1.1.5-lut-encoding-20261101;Release ID355,附件ID8,关联原标签06968514fc5205a83fbf3c5a3dbb1be0f6f3e79b,标签未移动。仅上传一次大鱼调色-1.1.5.pkg,13,752,153字节,SHA256 bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071。
草稿Web下载对令牌请求返回404,但正常登录会话可下载。通过Edge实际下载草稿附件、核对全部字节和SHA后才由API发布;发布后再次用上传器完整下载正式链接并回读Release/附件,复用同一个附件且校验通过。草稿下载的临时副本按来源、创建时间和摘要核实后清理,本地正式发行包保留。详见verification/Release.json;此过程没有重新构建或改动已验包安装包,也未再次安装PKG。
## 1.2.0 正式 PKG
正式包 `../发行包/大鱼调色-1.2.0.pkg`,13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。PKG 公证 `c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted;Installer 团队 B3W25FX5H5、票据、Gatekeeper 及 20 项展开验包通过。包内 APP 与已验收正式安装一致,未重复运行安装器。
+21
查看文件
@@ -0,0 +1,21 @@
{
"repository": "https://dayu.media/git/dayu/dayu-cst.git",
"commit": "973766b51dbcab3ab5092f1955d753575cd32d89",
"files": [
{
"source": "tools/kernels/CSTKernel.ll",
"destination": "tools/kernels/CSTKernel.ll",
"sha256": "78c2414d1c086dc7eaa043308f0febd32691b1ad49629febdcc1138b232cefc8"
},
{
"source": "tools/kernels/BasisKernel.ll",
"destination": "tools/kernels/BasisKernel.ll",
"sha256": "221ca94c52a997aa8cb2b2155bb8c7ad57bf0829b0241857664a75e78329a4b3"
},
{
"source": "大鱼CST/Plugin/DayuShaderTypes.h",
"destination": "大鱼调色/Plugin/DYCSTTypes.h",
"sha256": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696"
}
]
}
+17
查看文件
@@ -0,0 +1,17 @@
# CST 色彩管理集成
本轮以 dayu-cst 的固定源码节点复用 CSTKernel / BasisKernel;原路径和摘要见 CSTIntegration.json,参考仓库保持只读。新处理顺序为输入转换 → 工作空间一级调色 → 输出转换 → 原有基础调整与风格链。曲线和色域独立选择,工作曲线由同一个参数供一级与输出使用,不通过跨实例通知同步。
沿用大鱼调色的宿主线性 RGB 边界:CST 前恢复编码值,三个阶段内部不使用 3D LUT、不裁切至 0–1;返回宿主线性后再进入原有显示域调色链。此版本的后续 HSL、曲线与风格 LUT 仍是既有显示域工具,不宣称全链路改造成场景线性调色。CST 源内核使用 half 输入,保留其原生精度边界。
新实例默认输入/输出 Gamma 2.4、Rec.709,工作 DaVinci Intermediate / DaVinci Wide Gamut;自动色调映射默认关闭。按实际素材选择相机曲线/色域。选择自动映射时复用参考代码的场景/显示映射标志。一级默认参数直接沿用 CST 源码。
一级调色、基础调整默认展开;其余折叠;所有模块眼睛开启。黑白模块增加混合(默认 0),保证眼睛开启不强制把初始画面变成黑白。折叠写入独立的 InspectorToken,仅保存界面状态,不修改任何调色参数、启用位或 LUT 路径。眼睛只修改启用位。
旧 InspectorToken schema 1 仍可读取:默认跳过新 CST,并保留旧版黑白强度。旧输入 LUT / 相机输入也维持原路径,直到用户明确编辑 CST 参数或选择“旧版输入 → 改用 CST”。新旧模型的前 944 字节 ABI 与所有旧参数 ID 保留。
Cube 导出改用生产渲染路径生成 33³ 色格,包含新的 CST 与一级参数;关闭不可写入 Cube 的空间细节工具和逐画面统计。用户 LUT 和宿主资料不进入仓库。
原生模型、真实 AppKit 折叠动作、IOSurface/Metal 和 Cube 导出已通过 153 项检查,其中 21 组参数与正式大鱼 CST 着色器直接逐像素对照(包含 17 个相机输入组合、ACEScct/Linear/新增曲线/显示曲线工作空间)。本机 Apple M4 的最大线性预乘分量误差为 0.0000152587890625。具体输入、原库摘要与边界见 verification/CSTIntegration.json。正式宿主与发行由独立记录确认。
为避免全眼睛开启让中性查表裁切 HDR,未调整的曲线/HSL/色轮/三原色/色阶/色彩平衡在渲染副本旁路;无其他实际调整时肤色保护也无需执行。原参数、眼睛和界面数值不变。默认输入与输出相同、一级中性且映射关闭时跳过可证明为恒等的往返,避免累积 half 量化误差。
+851 -14
查看文件
@@ -1,6 +1,6 @@
{
"archivesBase64": {
"9000": "AAAAAAAAAb0qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxD+YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVtDdXN0b20gRGF0YYABowsMEVUkbnVsbNINDg8QVnNjaGVtYVYkY2xhc3MQAYAC0hITFBVaJGNsYXNzbmFtZVgkY2xhc3Nlc18QEERZSW5zcGVjdG9yVG9rZW6iFhdfEBBEWUluc3BlY3RvclRva2VuWE5TT2JqZWN0CBEaJCkyN0lMWFpeZGlwd3l7gIuUp6q9AAAAAAAAAQEAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAMYIAAgAEQAaACQAKQAyADcASQBOAFsAbQBvAHEAdQB7AXwAAAAAAAACAQAAAAAAAAAQAAAAAAAAAAAAAAAAAAABfQA=",
"9000": "AAAAAAAAAisqYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBa2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBMZH1UkbnVsbNMNDg8QERJVZm9sZHNWc2NoZW1hViRjbGFzc4ACEAKABNMUFQ8WFxhXTlMua2V5c1pOUy5vYmplY3RzoKCAA9IaGxwdWiRjbGFzc25hbWVYJGNsYXNzZXNcTlNEaWN0aW9uYXJ5ohweWE5TT2JqZWN00hobICFfEBBEWUluc3BlY3RvclRva2VuoiIeXxAQRFlJbnNwZWN0b3JUb2tlbgAIABEAGgAkACkAMgA3AEkATABYAFoAYABmAG0AcwB6AIEAgwCFAIcAjgCWAKEAogCjAKUAqgC1AL4AywDOANcA3ADvAPIAAAAAAAACAQAAAAAAAAAjAAAAAAAAAAAAAAAAAAABBQgACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsB6gAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAHrAA==",
"9001": "AAAAAAAAAe8qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBL2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBEXHVUkbnVsbNINDg8QVXBhdGhzViRjbGFzc4ACgATTEhMOFBUWV05TLmtleXNaTlMub2JqZWN0c6CggAPSGBkaG1okY2xhc3NuYW1lWCRjbGFzc2VzXE5TRGljdGlvbmFyeaIaHFhOU09iamVjdNIYGR4fXERZQXNzZXRTdGF0ZaIgHFxEWUFzc2V0U3RhdGUIERokKTI3SUxYWmBma3F4enyDi5aXmJqfqrPAw8zR3uEAAAAAAAABAQAAAAAAAAAhAAAAAAAAAAAAAAAAAAAA7ggACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsBrgAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAGvAA=="
},
"parameters": [
@@ -44,10 +44,834 @@
"offset": 56,
"pid": 2014,
"step": 0.01,
"title": "输入强度"
"title": "旧版输入强度"
},
{
"default": 0,
"key": "cmConfigured",
"kind": "bool",
"max": 1,
"min": -1,
"offset": 944,
"pid": 2236,
"step": 0.01,
"title": "CST 配置版本"
},
{
"cmTab": 0,
"default": 1,
"key": "cminputEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 964,
"pid": 2241,
"step": 0.01,
"title": "输入转换启用"
},
{
"cmTab": 0,
"default": 1002,
"key": "cminputTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 948,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2237,
"step": 1,
"title": "输入曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 0,
"default": 22,
"key": "cminputGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 952,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2238,
"step": 1,
"title": "输入色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 0,
"default": 10,
"key": "cmworkingTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 956,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2239,
"step": 1,
"title": "工作曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 0,
"default": 16,
"key": "cmworkingGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 960,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2240,
"step": 1,
"title": "工作色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 0,
"default": 1,
"key": "cmmix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1076,
"pid": 2269,
"step": 0.01,
"title": "CST 混合"
},
{
"cmTab": 1,
"default": 1,
"key": "cmbasisEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 968,
"pid": 2242,
"step": 0.01,
"title": "一级调色启用"
},
{
"cmTab": 1,
"default": 0,
"key": "cmexposure",
"kind": "float",
"max": 5,
"min": -5,
"offset": 988,
"pid": 2247,
"step": 0.01,
"title": "一级曝光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbalanceAngle",
"kind": "float",
"max": 1,
"min": 0,
"offset": 992,
"pid": 2248,
"step": 0.01,
"title": "色彩平衡方向"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbalanceStrength",
"kind": "float",
"max": 1,
"min": 0,
"offset": 996,
"pid": 2249,
"step": 0.01,
"title": "色彩平衡强度"
},
{
"cmTab": 1,
"default": 1,
"key": "cmsaturation",
"kind": "float",
"max": 2,
"min": 0,
"offset": 1000,
"pid": 2250,
"step": 0.01,
"title": "一级饱和度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmcontrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1004,
"pid": 2251,
"step": 0.01,
"title": "一级对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmpivot",
"kind": "float",
"max": 3,
"min": -3,
"offset": 1008,
"pid": 2252,
"step": 0.01,
"title": "对比度轴心"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhiContrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1012,
"pid": 2253,
"step": 0.01,
"title": "高光对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhiPivot",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1016,
"pid": 2254,
"step": 0.01,
"title": "高光轴心"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadowContrast",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1020,
"pid": 2255,
"step": 0.01,
"title": "阴影对比度"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadowPivot",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1024,
"pid": 2256,
"step": 0.01,
"title": "阴影轴心"
},
{
"cmTab": 1,
"default": 1,
"key": "cmwhite",
"kind": "float",
"max": 1.5,
"min": 0.5,
"offset": 1028,
"pid": 2257,
"step": 0.01,
"title": "白点"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmshoulder",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1032,
"pid": 2258,
"step": 0.01,
"title": "肩部压缩"
},
{
"cmTab": 1,
"default": 0,
"key": "cmhighlights",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1036,
"pid": 2259,
"step": 0.01,
"title": "一级高光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmmidtones",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1040,
"pid": 2260,
"step": 0.01,
"title": "一级中间调"
},
{
"cmTab": 1,
"default": 0,
"key": "cmshadows",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1044,
"pid": 2261,
"step": 0.01,
"title": "一级阴影"
},
{
"cmTab": 1,
"default": 0,
"key": "cmblack",
"kind": "float",
"max": 1,
"min": -1,
"offset": 1048,
"pid": 2262,
"step": 0.01,
"title": "黑点"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmtoe",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1052,
"pid": 2263,
"step": 0.01,
"title": "趾部压缩"
},
{
"cmTab": 1,
"default": 0.5,
"key": "cmchromaMix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1056,
"pid": 2264,
"step": 0.01,
"title": "色度混合"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassExposure",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1060,
"pid": 2265,
"step": 0.01,
"title": "旁路一级曝光"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassBalance",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1064,
"pid": 2266,
"step": 0.01,
"title": "旁路一级色彩"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassContrast",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1068,
"pid": 2267,
"step": 0.01,
"title": "旁路一级对比"
},
{
"cmTab": 1,
"default": 0,
"key": "cmbypassTone",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1072,
"pid": 2268,
"step": 0.01,
"title": "旁路一级影调"
},
{
"cmTab": 2,
"default": 1,
"key": "cmoutputEnabled",
"kind": "float",
"max": 1,
"min": 0,
"offset": 972,
"pid": 2243,
"step": 0.01,
"title": "输出转换启用"
},
{
"cmTab": 2,
"default": 1002,
"key": "cmoutputTransfer",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 976,
"options": [
"KOLOR Default",
"ACEScct",
"Apple Log",
"Apple Log 2",
"ARRI LogC3",
"ARRI LogC4",
"Blackmagic Film Gen 5",
"Canon C-Log",
"Canon C-Log 2",
"Canon C-Log 3",
"DaVinci Intermediate",
"DJI D-Log",
"DJI D-Log 2",
"DJI D-Log M",
"Fujifilm F-Log",
"Fujifilm F-Log2",
"Fujifilm F-Log2 C",
"GoPro GP-Log",
"GoPro GP-Log2",
"GoPro GP-Log2 (Official, 0 EV)",
"Insta I-Log",
"Leica L-Log",
"Linear",
"Nikon N-Log",
"Panasonic V-Log",
"Phantom Log 1",
"Phantom Log 2",
"REDLog3G10",
"Samsung Log",
"Sony S-Log2",
"Sony S-Log3",
"Gamma 2.2",
"Gamma 2.4",
"Gamma 2.6"
],
"pid": 2244,
"step": 1,
"title": "输出曲线",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
30,
29,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
1001,
1002,
1003
]
},
{
"cmTab": 2,
"default": 22,
"key": "cmoutputGamut",
"kind": "popup",
"max": 1003,
"min": 0,
"notAnimatable": true,
"offset": 980,
"options": [
"KOLOR Default",
"ACES AP0",
"ACES AP1",
"Apple Log 2",
"ARRI WG3",
"ARRI WG4",
"Blackmagic Wide Gamut",
"Canon Cinema Gamut",
"DaVinci Wide Gamut",
"DJI Action 5",
"DJI Air 2S",
"DJI D-Gamut",
"DJI D-Gamut 2",
"DJI Mavic2 Pro",
"DJI Mavic 3 Pro",
"DJI Mini 4 Pro",
"DJI Mini 5 Pro",
"DJI Pocket 3",
"Fujifilm F-GamutC",
"GoPro GP-Log",
"P3-DCI",
"P3 D65",
"Panasonic V-Gamut",
"Rec.709 / BT.709",
"Rec.2020 / BT.2020",
"RED Wide Gamut RGB",
"Sony S-Gamut",
"Sony S-Gamut3",
"Sony S-Gamut3.Cine"
],
"pid": 2245,
"step": 1,
"title": "输出色域",
"values": [
99,
1,
2,
3,
4,
5,
6,
7,
16,
8,
9,
10,
28,
11,
12,
13,
14,
15,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27
]
},
{
"cmTab": 2,
"default": 0,
"key": "cmtoneMapping",
"kind": "popup",
"max": 1,
"min": 0,
"notAnimatable": true,
"offset": 984,
"options": [
"关闭",
"开启"
],
"pid": 2246,
"step": 0.01,
"title": "自动色调映射",
"values": [
0,
1
]
},
{
"default": 1,
"key": "inputEnabled",
"kind": "bool",
"max": 1,
@@ -55,7 +879,7 @@
"offset": 132,
"pid": 2033,
"step": 0.01,
"title": "输入 / LUT"
"title": "输入转换 / CST"
},
{
"default": 0,
@@ -413,7 +1237,7 @@
"title": "肤色色相"
},
{
"default": 0,
"default": 1,
"key": "skinEnabled",
"kind": "bool",
"max": 1,
@@ -523,7 +1347,7 @@
"title": "风格 5 强度"
},
{
"default": 0,
"default": 1,
"key": "lookEnabled",
"kind": "bool",
"max": 1,
@@ -1106,7 +1930,7 @@
"title": "蓝 扩展点4 X"
},
{
"default": 0,
"default": 1,
"key": "curveEnabled",
"kind": "bool",
"max": 1,
@@ -1491,7 +2315,7 @@
"title": "显示自定义色选区"
},
{
"default": 0,
"default": 1,
"key": "hslEnabled",
"kind": "bool",
"max": 1,
@@ -1656,7 +2480,7 @@
"title": "平衡"
},
{
"default": 0,
"default": 1,
"key": "gradingEnabled",
"kind": "bool",
"max": 1,
@@ -1733,7 +2557,7 @@
"title": "蓝原色 饱和度"
},
{
"default": 0,
"default": 1,
"key": "primariesEnabled",
"kind": "bool",
"max": 1,
@@ -1964,7 +2788,7 @@
"title": "蓝 输出白"
},
{
"default": 0,
"default": 1,
"key": "levelsEnabled",
"kind": "bool",
"max": 1,
@@ -2064,6 +2888,17 @@
},
{
"default": 0,
"key": "blackWhiteMix",
"kind": "float",
"max": 1,
"min": 0,
"offset": 1080,
"pid": 2270,
"step": 0.01,
"title": "黑白混合"
},
{
"default": 1,
"key": "blackwhiteEnabled",
"kind": "bool",
"max": 1,
@@ -2184,7 +3019,7 @@
"title": "高光 黄 ↔ 蓝"
},
{
"default": 0,
"default": 1,
"key": "balanceEnabled",
"kind": "bool",
"max": 1,
@@ -2197,8 +3032,10 @@
],
"sourceSHA256": {
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
"大鱼调色/Plugin/DYModel.h": "66507eb37e0c0e3426a10ab45f7388fd53fcba570a715a6574396056731d5129",
"大鱼调色/Plugin/DYModel.mm": "cf46784f302014d7c025249c5ebbd02505a5e70739ec3ffc0d269890601bb5c5",
"大鱼调色/Plugin/DYUniforms.h": "06db5ec83703aa320c9569a7de08617a2fdbc535ac29f438558959d485aa2138"
"大鱼调色/Plugin/DYCSTTypes.h": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696",
"大鱼调色/Plugin/DYColorManagement.h": "b0a4cd1b8c45dbce90a7b4f30f72ebf95ecd382895e74e3bfeda0f7cdb185157",
"大鱼调色/Plugin/DYModel.h": "2a1b3064d2c1179347412ad44981aad384165c2238aac06d936a496976d52e63",
"大鱼调色/Plugin/DYModel.mm": "9478a6ec39a3d61946cd1687db7043df29c9f7185fd04ec7b1c4c57fe52ebc5d",
"大鱼调色/Plugin/DYUniforms.h": "d56fd7de758afaca1478fd0ecbb7347cf9986730d7becc998a6ea6233a98f381"
}
}
+2 -2
查看文件
@@ -1,10 +1,10 @@
{
"passed": true,
"sha256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"sha256": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"version": "5.13",
"displayversion": "5.6.7",
"filterCount": 1,
"nativeFloatParameters": 196,
"nativeFloatParameters": 231,
"customParameters": 2,
"publications": [
{
+49 -14
查看文件
@@ -293,8 +293,8 @@
<baseFlags>8589934608</baseFlags>
<parameter name="大鱼调色" id="9000" flags="12884901888">
<numberOfKeypoints>0</numberOfKeypoints>
<defaultVal>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</defaultVal>
<dataValue>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</dataValue>
<defaultVal>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</defaultVal>
<dataValue>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</dataValue>
</parameter>
<parameter name="LUT 文件" id="9001" flags="12889161776">
<numberOfKeypoints>0</numberOfKeypoints>
@@ -302,8 +302,42 @@
<dataValue>*********SweMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-9q7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-2L5JIYPbJgPB6B1UwEJL-VR4VnJWFXP43nQs*0U*HH2VAC3-IKJotH9ahZSLBOHZAiPq7eNKBoQu0UU*DG4-YO4pcYMqlVQrBiMKpZK0FXP43nQqJnL2tHF4ZXR4ZjPa3mSO6O53VCIoxWOaJXRB6M4FsTL2FNELBnNLFHR43oNO6U53l2KI3nQqJoIrFVR4I62FcY8H6rGIlMKa-aOr3sSbm1WtOLa7eTefD*kwnFri2********-*E*********V********************vUU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-fU********6-*********-********************4j**</dataValue>
</parameter>
<parameter name="相机输入" id="2013" flags="12889161760" default="0" value="0" />
<parameter name="输入强度" id="2014" flags="12889161760" default="1" value="1" />
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="0" value="0" />
<parameter name="旧版输入强度" id="2014" flags="12889161760" default="1" value="1" />
<parameter name="CST 配置版本" id="2236" flags="12889161760" default="0" value="0" />
<parameter name="输入转换启用" id="2241" flags="12889161760" default="1" value="1" />
<parameter name="输入曲线" id="2237" flags="12889161776" default="1002" value="1002" />
<parameter name="输入色域" id="2238" flags="12889161776" default="22" value="22" />
<parameter name="工作曲线" id="2239" flags="12889161776" default="10" value="10" />
<parameter name="工作色域" id="2240" flags="12889161776" default="16" value="16" />
<parameter name="CST 混合" id="2269" flags="12889161760" default="1" value="1" />
<parameter name="一级调色启用" id="2242" flags="12889161760" default="1" value="1" />
<parameter name="一级曝光" id="2247" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡方向" id="2248" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡强度" id="2249" flags="12889161760" default="0" value="0" />
<parameter name="一级饱和度" id="2250" flags="12889161760" default="1" value="1" />
<parameter name="一级对比度" id="2251" flags="12889161760" default="0" value="0" />
<parameter name="对比度轴心" id="2252" flags="12889161760" default="0" value="0" />
<parameter name="高光对比度" id="2253" flags="12889161760" default="0" value="0" />
<parameter name="高光轴心" id="2254" flags="12889161760" default="0" value="0" />
<parameter name="阴影对比度" id="2255" flags="12889161760" default="0" value="0" />
<parameter name="阴影轴心" id="2256" flags="12889161760" default="0" value="0" />
<parameter name="白点" id="2257" flags="12889161760" default="1" value="1" />
<parameter name="肩部压缩" id="2258" flags="12889161760" default="0.5" value="0.5" />
<parameter name="一级高光" id="2259" flags="12889161760" default="0" value="0" />
<parameter name="一级中间调" id="2260" flags="12889161760" default="0" value="0" />
<parameter name="一级阴影" id="2261" flags="12889161760" default="0" value="0" />
<parameter name="黑点" id="2262" flags="12889161760" default="0" value="0" />
<parameter name="趾部压缩" id="2263" flags="12889161760" default="0.5" value="0.5" />
<parameter name="色度混合" id="2264" flags="12889161760" default="0.5" value="0.5" />
<parameter name="旁路一级曝光" id="2265" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级色彩" id="2266" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级对比" id="2267" flags="12889161760" default="0" value="0" />
<parameter name="旁路一级影调" id="2268" flags="12889161760" default="0" value="0" />
<parameter name="输出转换启用" id="2243" flags="12889161760" default="1" value="1" />
<parameter name="输出曲线" id="2244" flags="12889161776" default="1002" value="1002" />
<parameter name="输出色域" id="2245" flags="12889161776" default="22" value="22" />
<parameter name="自动色调映射" id="2246" flags="12889161776" default="0" value="0" />
<parameter name="输入转换 / CST" id="2033" flags="12889161760" default="1" value="1" />
<parameter name="曝光" id="2000" flags="12889161760" default="0" value="0" />
<parameter name="曝光 启用" id="2020" flags="12889161760" default="1" value="1" />
<parameter name="对比度" id="2001" flags="12889161760" default="0" value="0" />
@@ -330,12 +364,12 @@
<parameter name="清晰度 启用" id="2031" flags="12889161760" default="1" value="1" />
<parameter name="去朦胧" id="2012" flags="12889161760" default="0" value="0" />
<parameter name="去朦胧 启用" id="2032" flags="12889161760" default="1" value="1" />
<parameter name="复制时自动调色" id="8800" flags="12889161760" default="0" value="0" />
<parameter name="复制时自动调色" id="8800" flags="12889161776" default="0" value="0" />
<parameter name="基础调色" id="2034" flags="12889161760" default="1" value="1" />
<parameter name="白平衡与颜色" id="2035" flags="12889161760" default="1" value="1" />
<parameter name="保护程度" id="2117" flags="12889161760" default="60" value="60" />
<parameter name="肤色色相" id="2118" flags="12889161760" default="28" value="28" />
<parameter name="肤色保护" id="2116" flags="12889161760" default="0" value="0" />
<parameter name="肤色保护" id="2116" flags="12889161760" default="1" value="1" />
<parameter name="风格 1 强度" id="2015" flags="12889161760" default="1" value="1" />
<parameter name="风格 2 启用" id="2040" flags="12889161760" default="1" value="1" />
<parameter name="风格 2 强度" id="2016" flags="12889161760" default="1" value="1" />
@@ -345,7 +379,7 @@
<parameter name="风格 4 强度" id="2018" flags="12889161760" default="1" value="1" />
<parameter name="风格 5 启用" id="2043" flags="12889161760" default="1" value="1" />
<parameter name="风格 5 强度" id="2019" flags="12889161760" default="1" value="1" />
<parameter name="风格 LUT" id="2036" flags="12889161760" default="0" value="0" />
<parameter name="风格 LUT" id="2036" flags="12889161760" default="1" value="1" />
<parameter name="主曲线 阴影" id="2046" flags="12889161760" default="0" value="0" />
<parameter name="主曲线 暗部" id="2047" flags="12889161760" default="0" value="0" />
<parameter name="主曲线 亮部" id="2048" flags="12889161760" default="0" value="0" />
@@ -398,7 +432,7 @@
<parameter name="蓝 扩展点3 X" id="2234" flags="12889161760" default="-1" value="-1" />
<parameter name="蓝 扩展点4 偏移" id="2231" flags="12889161760" default="0" value="0" />
<parameter name="蓝 扩展点4 X" id="2235" flags="12889161760" default="-1" value="-1" />
<parameter name="曲线" id="2044" flags="12889161760" default="0" value="0" />
<parameter name="曲线" id="2044" flags="12889161760" default="1" value="1" />
<parameter name="红 色相" id="2068" flags="12889161760" default="0" value="0" />
<parameter name="橙 色相" id="2069" flags="12889161760" default="0" value="0" />
<parameter name="黄 色相" id="2070" flags="12889161760" default="0" value="0" />
@@ -433,7 +467,7 @@
<parameter name="自定义 明亮度" id="2098" flags="12889161760" default="0" value="0" />
<parameter name="自定义 明亮度范围" id="2142" flags="12889161760" default="40" value="40" />
<parameter name="显示自定义色选区" id="2144" flags="12889161760" default="0" value="0" />
<parameter name="HSL 混色" id="2045" flags="12889161760" default="0" value="0" />
<parameter name="HSL 混色" id="2045" flags="12889161760" default="1" value="1" />
<parameter name="阴影 色相" id="2106" flags="12889161760" default="0" value="0" />
<parameter name="阴影 饱和度" id="2107" flags="12889161760" default="0" value="0" />
<parameter name="阴影 明亮度" id="2113" flags="12889161760" default="0" value="0" />
@@ -448,14 +482,14 @@
<parameter name="全局 明亮度" id="2150" flags="12889161760" default="0" value="0" />
<parameter name="混合" id="2101" flags="12889161760" default="50" value="50" />
<parameter name="平衡" id="2102" flags="12889161760" default="0" value="0" />
<parameter name="颜色分级" id="2100" flags="12889161760" default="0" value="0" />
<parameter name="颜色分级" id="2100" flags="12889161760" default="1" value="1" />
<parameter name="红原色 色相" id="2121" flags="12889161760" default="0" value="0" />
<parameter name="红原色 饱和度" id="2122" flags="12889161760" default="0" value="0" />
<parameter name="绿原色 色相" id="2123" flags="12889161760" default="0" value="0" />
<parameter name="绿原色 饱和度" id="2124" flags="12889161760" default="0" value="0" />
<parameter name="蓝原色 色相" id="2125" flags="12889161760" default="0" value="0" />
<parameter name="蓝原色 饱和度" id="2126" flags="12889161760" default="0" value="0" />
<parameter name="三原色" id="2120" flags="12889161760" default="0" value="0" />
<parameter name="三原色" id="2120" flags="12889161760" default="1" value="1" />
<parameter name="RGB 输入黑" id="2156" flags="12889161760" default="0" value="0" />
<parameter name="RGB 伽马" id="2160" flags="12889161760" default="1" value="1" />
<parameter name="RGB 输入白" id="2164" flags="12889161760" default="255" value="255" />
@@ -476,7 +510,7 @@
<parameter name="蓝 输入白" id="2167" flags="12889161760" default="255" value="255" />
<parameter name="蓝 输出黑" id="2171" flags="12889161760" default="0" value="0" />
<parameter name="蓝 输出白" id="2175" flags="12889161760" default="255" value="255" />
<parameter name="色阶" id="2152" flags="12889161760" default="0" value="0" />
<parameter name="色阶" id="2152" flags="12889161760" default="1" value="1" />
<parameter name="黑白 红" id="2180" flags="12889161760" default="40" value="40" />
<parameter name="黑白 黄" id="2181" flags="12889161760" default="60" value="60" />
<parameter name="黑白 绿" id="2182" flags="12889161760" default="40" value="40" />
@@ -485,7 +519,8 @@
<parameter name="黑白 洋红" id="2185" flags="12889161760" default="80" value="80" />
<parameter name="着色色相" id="2186" flags="12889161760" default="0" value="0" />
<parameter name="着色饱和度" id="2187" flags="12889161760" default="0" value="0" />
<parameter name="黑白混色" id="2176" flags="12889161760" default="0" value="0" />
<parameter name="黑白混合" id="2270" flags="12889161760" default="0" value="0" />
<parameter name="黑白混色" id="2176" flags="12889161760" default="1" value="1" />
<parameter name="保持明度" id="2189" flags="12889161760" default="1" value="1" />
<parameter name="阴影 青 ↔ 红" id="2192" flags="12889161760" default="0" value="0" />
<parameter name="阴影 洋红 ↔ 绿" id="2193" flags="12889161760" default="0" value="0" />
@@ -496,7 +531,7 @@
<parameter name="高光 青 ↔ 红" id="2200" flags="12889161760" default="0" value="0" />
<parameter name="高光 洋红 ↔ 绿" id="2201" flags="12889161760" default="0" value="0" />
<parameter name="高光 黄 ↔ 蓝" id="2202" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡" id="2188" flags="12889161760" default="0" value="0" />
<parameter name="色彩平衡" id="2188" flags="12889161760" default="1" value="1" />
<parameter name="混合" id="10001" flags="12884901888" default="1" value="1" />
<parameter name="翻转" id="10002" flags="12889161760" default="0" value="0" />
<parameter name="输入点" id="10003" flags="12889161760" default="1" value="1" />
+1 -1
查看文件
@@ -15,7 +15,7 @@ def main():
work.mkdir(parents=True, exist_ok=True)
args.output.parent.mkdir(parents=True, exist_ok=True)
objects = []
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel'):
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel', 'CSTKernel', 'BasisKernel'):
target = work / (name + '.air')
subprocess.run(['xcrun', 'metal-opt', str(root / 'tools/kernels' / (name + '.ll')),
'-o', str(target)], check=True)
+2 -2
查看文件
@@ -20,7 +20,7 @@ CONTENT_TAGS={'scenenode','layer','group','filter','behavior','mask'}
def sha(data):return hashlib.sha256(data).hexdigest()
def model_identity():
files=['大鱼调色/Plugin/DYModel.h','大鱼调色/Plugin/DYModel.mm','大鱼调色/Plugin/DYUniforms.h','template/tools/dump_model.mm']
files=['大鱼调色/Plugin/DYModel.h','大鱼调色/Plugin/DYModel.mm','大鱼调色/Plugin/DYUniforms.h','大鱼调色/Plugin/DYColorManagement.h','大鱼调色/Plugin/DYCSTTypes.h','template/tools/dump_model.mm']
return {name:sha((ROOT/name).read_bytes()) for name in files}
def refresh_metadata():
@@ -82,7 +82,7 @@ def build(model):
E.SubElement(param,'defaultVal').text=text;E.SubElement(param,'dataValue').text=text
for row in model['parameters']:
value=format(float(row['default']),'.17g')
E.SubElement(filt,'parameter',name=row['title'],id=str(row['pid']),flags='12889161760',default=value,value=value)
E.SubElement(filt,'parameter',name=row['title'],id=str(row['pid']),flags='12889161776' if row.get('notAnimatable') else '12889161760',default=value,value=value)
for node in host:filt.append(node)
source.append(filt)
copyright=E.parse(SOURCES/'CopyrightRig.xml').getroot()
+15
查看文件
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Generate the isolated synthetic CST/disclosure acceptance timeline."""
from pathlib import Path
import runpy
import xml.etree.ElementTree as ET
root = Path(__file__).resolve().parent.parent
runpy.run_path(str(root / 'tools/create_host_fixture.py'))
qa = Path.home() / 'Library/Caches/CodexBuilds/com.dayu.color/fcp-qa'
tree = ET.parse(qa / '大鱼调色_正式版验收.fcpxml')
tree.find('.//event').set('name', '大鱼调色_CST与独立折叠验收')
tree.find('.//project').set('name', '大鱼调色_1.2_CST与独立折叠')
output = qa / '大鱼调色_1.2_CST与独立折叠.fcpxml'
ET.indent(tree)
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n' + ET.tostring(tree.getroot(), encoding='unicode') + '\n')
print(output)
文件差异过大,未显示。 加载差异
文件差异过大,未显示。 加载差异
+1 -1
查看文件
@@ -93,7 +93,7 @@ static Pixels render(id<MTLRenderPipelineState> pipeline, bool dayu, id<MTLTextu
[e setFragmentTexture:source atIndex:0];
for (NSUInteger i=0;i<textures.count;++i) [e setFragmentTexture:textures[i] atIndex:i+1];
[e setFragmentBytes:&u length:sizeof(u) atIndex:0]; float scene=.73f; [e setFragmentBytes:&scene length:4 atIndex:1];
if(dayu) { DYRenderOptions options={}; options.outputPremultiplied=premultiplied; [e setFragmentBytes:&options length:sizeof(options) atIndex:2]; }
if(dayu) { DYRenderOptions options={}; options.outputPremultiplied=premultiplied; [e setFragmentBytes:&options length:sizeof(options) atIndex:2];[e setFragmentBytes:&u length:sizeof(u) atIndex:3]; }
else { float disabledWatermark[8]={}; [e setFragmentBytes:disabledWatermark length:sizeof(disabledWatermark) atIndex:2]; }
[e drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4]; [e endEncoding]; finish(commands);
Pixels output(width*height*4); [destination getBytes:output.data() bytesPerRow:width*8 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0]; return output;
+24
查看文件
@@ -0,0 +1,24 @@
{
"pass": true,
"productBundleID": "com.dayu.color",
"checkedRoots": [
"/Volumes/备份/大鱼调色/大鱼调色",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Library/Plug-Ins/FxPlug",
"/Applications",
"/Users/mac/Library/Plug-Ins/FxPlug",
"/Users/mac/Desktop",
"/Users/mac/Downloads"
],
"outerApps": [
{
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.2.0",
"build": "17"
}
],
"scope": "Bounded current-product inventory; unrelated products and user archives not deleted.",
"deliveryGeneratedCopiesRemoved": true,
"recoveryCloneRemoved": true,
"formalPackageRetained": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg"
}
文件差异过大,未显示。 加载差异
+11
查看文件
@@ -0,0 +1,11 @@
{
"pass": true,
"repository": "https://dayu.media/git/dayu/dayu-color.git",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"restoredFiles": 151,
"fsck": "full strict passed",
"rebuiltShaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"formalShaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"clone": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/cst-remote-restore-0tb5r75b",
"cloneCleaned": true
}
+7 -27
查看文件
@@ -2,35 +2,15 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.5",
"build": "16",
"version": "1.2.0",
"build": "17",
"team": "B3W25FX5H5",
"notaryID": "b47b6fe8-b7a9-4112-93b9-de85b03ca598",
"notaryID": "f25ae46e-92da-4470-842e-128bdb232aa8",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"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": []
}
"templateSHA256": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"shaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"hostVerification": "verification/HostCSTAndDisclosure.json"
}
+65
查看文件
@@ -0,0 +1,65 @@
{
"pass": true,
"date": "2026-11-01",
"hostVersion": "12.4",
"version": "1.2.0",
"build": "17",
"sourceCommit": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"shaderSHA256": "47b7c184e6f243406f0482b1a4a0312f0d0700a0b51196e51ab17a90ef0f29cc",
"formalServiceProcesses": [
"91273 /Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
],
"checks": [
{
"name": "formal-version-loaded",
"pass": true,
"observed": "Inspector 1.2.0; XPC executable at the formal installation"
},
{
"name": "new-instance-defaults",
"pass": true,
"observed": "13 module eyes on; primary and basic expanded; all other modules collapsed"
},
{
"name": "fold-independent-of-enable",
"pass": true,
"observed": "Primary exposure 0.70 retained across collapse, eye off and expand; expansion did not re-enable"
},
{
"name": "separate-transfer-gamut",
"pass": true,
"observed": "Sony S-Log3 selected without overwriting gamut; S-Gamut3.Cine selected separately"
},
{
"name": "working-space",
"pass": true,
"observed": "ACEScct and ACES AP1 selected independently"
},
{
"name": "normal-reopen",
"pass": true,
"observed": "Normal quit and reopen retained Sony input, ACES working space, exposure 0.70, primary collapsed and eye off"
},
{
"name": "reset-defaults",
"pass": true,
"observed": "Reset all restored neutral controls, all eyes on, primary/basic expanded and others collapsed"
},
{
"name": "style-library",
"pass": true,
"observed": "N12 folder 26 entries; previews populated; selected look confirmed by host"
},
{
"name": "legacy-document",
"pass": true,
"observed": "Old acceptance project opened with its selected look and original enable values retained; no old-project edits"
}
],
"testData": "Synthetic chart in a new acceptance project; user LUT files only read, never imported or deleted.",
"finalState": "Acceptance instance reset to defaults. Old project values unchanged.",
"limitations": [
"CST numeric comparisons are recorded separately in CSTIntegration.json; no claim of pixel-exact live-host export equivalence.",
"Motion, Intel and older macOS not tested. PKG installation not repeated."
]
}
+105 -21
查看文件
@@ -1,6 +1,6 @@
{
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
"checks": 92,
"checks": 110,
"gpu": "Apple M4",
"limitations": [
"Finite states and a 64x48 frame; live FCP discovery, inspector interaction, timeline persistence and real host export require separate acceptance.",
@@ -12,21 +12,21 @@
"error": "未提供错误信息",
"name": "runtime-directory",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17"
},
{
"descriptors": 196,
"descriptors": 231,
"name": "descriptor-unique-id-offset-key",
"pass": true,
"sections": 12,
"uniformBytes": 944
"sections": 14,
"uniformBytes": 1088
},
{
"name": "finite-real-model-defaults",
"pass": true
},
{
"name": "only-basic-adjustments-enabled-by-default",
"name": "all-module-eyes-enabled-by-default",
"pass": true
},
{
@@ -60,6 +60,48 @@
"name": "asset-copy-is-independent",
"pass": true
},
{
"modules": 13,
"name": "default-primary-base-expanded-all-eyes-on",
"pass": true
},
{
"name": "all-disclosure-actions-preserve-every-render-parameter",
"pass": true
},
{
"name": "eye-only-toggles-enable-retains-disclosure",
"pass": true
},
{
"name": "expanding-disabled-module-keeps-it-disabled",
"pass": true
},
{
"name": "inspector-recreation-restores-independent-disclosure",
"pass": true
},
{
"error": "未提供错误信息",
"name": "secure-disclosure-archive-roundtrip",
"pass": true
},
{
"name": "legacy-inspector-retains-input-and-blackwhite-behavior",
"pass": true
},
{
"name": "working-space-shared-by-primary-and-output",
"pass": true
},
{
"name": "basis-raw-controls-use-reference-conversion",
"pass": true
},
{
"name": "unsupported-basis-curve-adapts-through-intermediate",
"pass": true
},
{
"name": "metal-device",
"pass": true
@@ -81,6 +123,37 @@
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "blackwhite-full-render",
"pass": true
},
{
"changedComponents": 7368,
"maxAbsoluteError": 0.5289306640625,
"name": "blackwhite-mix-100-affects-frame",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"error": "",
"name": "blackwhite-half-render",
"pass": true
},
{
"name": "blackwhite-half-mix-is-continuous",
"pass": true
},
{
"error": "",
"name": "blackwhite-eye-off-render",
"pass": true
},
{
"name": "blackwhite-eye-bypasses-retained-mix",
"pass": true
},
{
"invalidComponents": 0,
"name": "renderer-alpha-contract",
@@ -122,6 +195,17 @@
"name": "preview-invalidation-clears-analysis-and-browser",
"pass": true
},
{
"error": "",
"name": "cst-export-production-sample",
"pass": true
},
{
"error": "未提供错误信息",
"name": "cube-export-includes-cst-primary-and-matches-production",
"pass": true,
"triples": 35937
},
{
"error": "",
"name": "renderer-exposure-pass",
@@ -180,7 +264,7 @@
"pass": true
},
{
"changedComponents": 7354,
"changedComponents": 7347,
"maxAbsoluteError": 0.13134765625,
"name": "hsl-real-table-frame",
"nonfiniteComponents": 0,
@@ -189,13 +273,13 @@
},
{
"error": "",
"name": "folded-hsl-bypasses-retained-adjustments-render",
"name": "disabled-hsl-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-hsl-bypasses-retained-adjustments",
"name": "disabled-hsl-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -206,8 +290,8 @@
"pass": true
},
{
"changedComponents": 7357,
"maxAbsoluteError": 0.094482421875,
"changedComponents": 7347,
"maxAbsoluteError": 0.09033203125,
"name": "grading-real-table-frame",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
@@ -215,13 +299,13 @@
},
{
"error": "",
"name": "folded-grading-bypasses-retained-adjustments-render",
"name": "disabled-grading-bypasses-retained-adjustments-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-grading-bypasses-retained-adjustments",
"name": "disabled-grading-bypasses-retained-adjustments",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -449,13 +533,13 @@
},
{
"error": "",
"name": "folded-input-bypasses-retained-profile-render",
"name": "disabled-input-bypasses-retained-profile-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-input-bypasses-retained-profile",
"name": "disabled-input-bypasses-retained-profile",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -491,13 +575,13 @@
},
{
"error": "",
"name": "folded-look-bypasses-retained-LUTs-render",
"name": "disabled-look-bypasses-retained-LUTs-render",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "folded-look-bypasses-retained-LUTs",
"name": "disabled-look-bypasses-retained-LUTs",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
@@ -506,10 +590,10 @@
"error": "未提供错误信息",
"name": "renderer-export-33cube",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69/diagnostic-export.cube"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17/diagnostic-export.cube"
},
{
"bytes": 1186070,
"bytes": 1186074,
"name": "export-33cube-data-contract",
"nonzeroRows": 35937,
"pass": true,
@@ -526,7 +610,7 @@
},
{
"heartbeats": 4,
"maximumGapMS": 5.919541465118527,
"maximumGapMS": 5.9790832456201315,
"name": "external-activation-main-loop-responsive",
"pass": true
},
@@ -565,6 +649,6 @@
"pass": true
}
],
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69",
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/AEC0E670-35B5-4811-8CF0-0EB517E6BE17",
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
}
+17 -17
查看文件
@@ -1,7 +1,7 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.5.pkg",
"sha256": "bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071",
"bytes": 13752153,
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg",
"sha256": "9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1",
"bytes": 13818397,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
@@ -31,34 +31,34 @@
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.5",
"build": "16"
"version": "1.2.0",
"build": "17"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.c8d19ea6-1117-4621-ae47-48a41ea4ca10/1F33731D-2B0E-486C-8F6B-88E78433618D/大鱼调色"
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.ee9fb852-21c9-4f09-bdd1-e8d3a02b501a/A7F44CB1-4C2B-49A4-8FEB-BD99E683EA34/大鱼调色"
}
],
"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",
"signature": "Package \"大鱼调色-1.2.0.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-01 10:11:21 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.2.0.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"name": "大鱼调色-1.2.0.pkg",
"id": "c7b97b0f-57c8-45d3-a4d7-7db8e8694487",
"message": "Successfully received submission info",
"name": "大鱼调色-1.1.5.pkg",
"status": "Accepted",
"createdDate": "2026-11-01T07:46:33.136Z",
"id": "90a38636-93bb-4693-8db2-16b9a815e409"
"createdDate": "2026-11-01T10:11:23.075Z",
"status": "Accepted"
},
"appCompiledSource": "59b058a3c8b9e5387381574da6bbc05af437527c",
"appBuild": "16",
"appCompiledSource": "48b00c85799b0226ba32aba3f2e5397aa0e509ed",
"appBuild": "17",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "191da9dc0abfda83fcc5939f6fc90e4c9019f4d9",
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"templateSHA256": {
"大鱼调色.moef": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"大鱼调色.moef": "f245f1543b6ae4b8ce9dbdf899ee436b73aec44e3d9f2fbae8a1eb524aac97e5",
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostLUTEncoding.json",
"installedAppHostAcceptance": "verification/HostCSTAndDisclosure.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
+39
查看文件
@@ -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
}
+29
查看文件
@@ -0,0 +1,29 @@
#ifndef DAYU_SHADER_TYPES_H
#define DAYU_SHADER_TYPES_H
#include <simd/simd.h>
typedef struct CSTParams { int inputGamut, inputTransfer, outputGamut, outputTransfer, toneMapping; } CSTParams;
typedef struct BasisParams {
int colorspace;
float exposure, balanceTarget, balanceStrength, contrast, pivot, highlights, midtones, shadows;
float trimLow, trimHigh, trimToeStrength, trimShoulderStrength, shadowContrast, shadowPivot, hiContrast, hiPivot, chromaMix;
unsigned char bypassBalance, bypassTone, bypassExposure, bypassContrast;
float saturation;
} BasisParams;
typedef struct DayuRenderParams {
CSTParams input;
CSTParams output;
BasisParams basis;
int stages;
int sourceLinear;
int destinationLinear;
int reserved;
// Additional curve-only adapters for working encodings absent from original BASIS.
CSTParams basisInput;
CSTParams basisOutput;
} DayuRenderParams;
#ifndef __METAL_VERSION__
_Static_assert(sizeof(CSTParams)==20, "CST target layout");
_Static_assert(sizeof(BasisParams)==80, "BASIS target layout");
_Static_assert(sizeof(DayuRenderParams)==176, "Integrated layout; legacy prefix remains 136 bytes");
#endif
#endif
+63
查看文件
@@ -0,0 +1,63 @@
// Raw, animatable CST controls. The first 944 bytes of DYUniforms stay unchanged.
#pragma once
#include "DYCSTTypes.h"
typedef struct DYCMSettings {
float configured;
float inputTransfer;
float inputGamut;
float workingTransfer;
float workingGamut;
float inputEnabled;
float basisEnabled;
float outputEnabled;
float outputTransfer;
float outputGamut;
float toneMapping;
float exposure;
float balanceAngle;
float balanceStrength;
float saturation;
float contrast;
float pivot;
float hiContrast;
float hiPivot;
float shadowContrast;
float shadowPivot;
float white;
float shoulder;
float highlights;
float midtones;
float shadows;
float black;
float toe;
float chromaMix;
float bypassExposure;
float bypassBalance;
float bypassContrast;
float bypassTone;
float mix;
float blackWhiteMix;
} DYCMSettings;
#ifndef __METAL_VERSION__
#include <math.h>
static inline int DYBasisMode(int c) {
if(c==99)return 0;if(c>=1&&c<=11)return c;
switch(c){case 14:return 12;case 15:return 13;case 16:return 14;case 19:return 15;case 20:return 16;case 21:return 17;case 22:return 18;case 25:return 19;case 27:return 20;case 28:return 21;default:return -1;}
}
static inline DayuRenderParams DYCMRender(DYCMSettings s) {
DayuRenderParams p={0};
p.input=(CSTParams){(int)lroundf(s.inputGamut),(int)lroundf(s.inputTransfer),(int)lroundf(s.workingGamut),(int)lroundf(s.workingTransfer),0};
p.output=(CSTParams){p.input.outputGamut,p.input.outputTransfer,(int)lroundf(s.outputGamut),(int)lroundf(s.outputTransfer),(int)lroundf(s.toneMapping)};
p.stages=(s.inputEnabled>.5?1:0)|(s.basisEnabled>.5?2:0)|(s.outputEnabled>.5?4:0);
if(s.toneMapping>.5){p.input.toneMapping=(p.input.inputTransfer>1000?2:0)+(p.input.outputTransfer>1000?1:0);p.output.toneMapping=(p.output.inputTransfer>1000?2:0)+(p.output.outputTransfer>1000?1:0);}
int mode=DYBasisMode(p.input.outputTransfer);p.basis.colorspace=mode<0?10:mode;
if(mode<0){p.reserved|=8;p.basisInput=(CSTParams){p.input.outputGamut,p.input.outputTransfer,p.input.outputGamut,10,0};p.basisOutput=(CSTParams){p.input.outputGamut,10,p.input.outputGamut,p.input.outputTransfer,0};}
BasisParams *b=&p.basis;
b->exposure=exp2f(s.exposure);b->balanceTarget=s.balanceAngle;b->balanceStrength=s.balanceStrength*s.balanceStrength*4;
b->contrast=exp2f(s.contrast);b->pivot=exp2f(s.pivot);b->highlights=s.highlights;b->midtones=s.midtones*.3330000042915344f;b->shadows=s.shadows*1.5f;
b->trimLow=1.0+(double)s.black*-.5;b->trimHigh=s.white;b->trimToeStrength=1+15*s.toe;b->trimShoulderStrength=1+7*s.shoulder;
b->shadowContrast=(double)s.shadowContrast*-1.3;b->shadowPivot=exp2f(.20000000298023224f*s.shadowPivot);b->hiContrast=s.hiContrast*2;b->hiPivot=exp2f(-.20000000298023224f*s.hiPivot);b->chromaMix=s.chromaMix;
b->bypassExposure=s.bypassExposure>.5;b->bypassBalance=s.bypassBalance>.5;b->bypassContrast=s.bypassContrast>.5;b->bypassTone=s.bypassTone>.5;b->saturation=s.saturation;
return p;
}
#endif
+78 -7
查看文件
@@ -3,6 +3,7 @@
#import "DYRenderer.h"
#import "DYAutoGrade.h"
#import "DYLUTLibrary.h"
#import "DYInspector.h"
#include <string>
#import <CoreVideo/CoreVideo.h>
#import <IOSurface/IOSurface.h>
@@ -20,13 +21,19 @@
BOOL _duplicate;
}
@end
@interface DYInspector (DiagnosticActions)
- (void)refresh;
@end
@implementation DYDiagnosticManager
- (instancetype)init {if((self=[super init])){_values=[NSMutableDictionary new];_custom=[NSMutableDictionary new];}return self;}
- (void)dealloc {[_values release];[_custom release];[super dealloc];}
- (id)apiForProtocol:(Protocol *)protocol {
NSString *name=NSStringFromProtocol(protocol);
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6"]containsObject:name]?self:nil;
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6",@"FxCustomParameterActionAPI_v4"]containsObject:name]?self:nil;
}
- (void)startAction:(id)sender{}
- (void)endAction:(id)sender{}
- (CMTime)currentTime{return kCMTimeZero;}
- (BOOL)addFloatSliderWithName:(NSString *)name parameterID:(UInt32)pid defaultValue:(double)value parameterMin:(double)minimum parameterMax:(double)maximum sliderMin:(double)sliderMinimum sliderMax:(double)sliderMaximum delta:(double)delta parameterFlags:(FxParameterFlags)flags {
if(_values[@(pid)]||_custom[@(pid)]){_duplicate=YES;return NO;}_values[@(pid)]=@(value);return YES;
}
@@ -109,6 +116,21 @@ static Pixels render(Run& run,DYRenderer *renderer,DYDiagnosticTile *source,DYDi
NSError *error=nil;BOOL ok=[renderer renderSource:source destination:destination uniforms:uniforms paths:paths error:&error];
run.need(name,ok,@{@"error":ok?@"":reason(error)});return read(destination,gpu);
}
static Pixels referenceFrame(id<MTLDevice> gpu,id<MTLLibrary> library,const Pixels &premult,NSUInteger width,NSUInteger height,DayuRenderParams params,NSError **error){
MTLTextureDescriptor *td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];td.storageMode=MTLStorageModeShared;td.usage=MTLTextureUsageShaderRead;
id<MTLTexture>source=[gpu newTextureWithDescriptor:td];td.pixelFormat=MTLPixelFormatRGBA32Float;td.usage=MTLTextureUsageRenderTarget;id<MTLTexture>dest=[gpu newTextureWithDescriptor:td];
Pixels encoded(premult.size());for(NSUInteger i=0;i<width*height;i++){float alpha=premult[i*4+3];for(int c=0;c<3;c++){float v=alpha>0?(float)(__fp16)((float)premult[i*4+c]/alpha):0;encoded[i*4+c]=v<=.0031308f?v*12.92f:1.055f*powf(v,1/2.4f)-.055f;}encoded[i*4+3]=alpha;}
[source replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:encoded.data() bytesPerRow:width*8];
MTLRenderPipelineDescriptor *pd=[MTLRenderPipelineDescriptor new];pd.vertexFunction=[library newFunctionWithName:@"vertexShader"];pd.fragmentFunction=[library newFunctionWithName:@"fragmentShader"];pd.colorAttachments[0].pixelFormat=MTLPixelFormatRGBA32Float;
id<MTLRenderPipelineState>pipeline=[gpu newRenderPipelineStateWithDescriptor:pd error:error];[pd.vertexFunction release];[pd.fragmentFunction release];[pd release];
Pixels result;if(pipeline){id<MTLCommandQueue>q=[gpu newCommandQueue];id<MTLCommandBuffer>cb=[q commandBuffer];MTLRenderPassDescriptor *rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=dest;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>e=[cb renderCommandEncoderWithDescriptor:rp];
float w=width,h=height;DYVertex2D vertices[]={{{w/2,-h/2},{1,1}},{{-w/2,-h/2},{0,1}},{{w/2,h/2},{1,0}},{{-w/2,h/2},{0,0}}};vector_uint2 vp={(unsigned)width,(unsigned)height};id<MTLBuffer>hist=[gpu newBufferWithLength:800 options:MTLResourceStorageModeShared];
[e setRenderPipelineState:pipeline];[e setVertexBytes:vertices length:sizeof(vertices) atIndex:0];[e setVertexBytes:&vp length:sizeof(vp) atIndex:1];[e setFragmentTexture:source atIndex:0];[e setFragmentTexture:source atIndex:1];[e setFragmentBytes:&params length:sizeof(params) atIndex:0];[e setFragmentBuffer:hist offset:0 atIndex:1];[e drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[e endEncoding];[cb commit];[cb waitUntilCompleted];
if(cb.status==MTLCommandBufferStatusCompleted){std::vector<float>pixels(width*height*4);[dest getBytes:pixels.data() bytesPerRow:width*16 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0];result.resize(premult.size());for(NSUInteger i=0;i<width*height;i++){float a=premult[i*4+3];for(int c=0;c<3;c++){float v=pixels[i*4+c];float linear=v<=.04045f?v/12.92f:powf((v+.055f)/1.055f,2.4f);result[i*4+c]=a>0?(__fp16)((float)(__fp16)linear*a):0;}result[i*4+3]=a;}}
[hist release];[q release];
}
[pipeline release];[source release];[dest release];return result;
}
static float *field(DYUniforms *u,NSDictionary *row){return (float *)((uint8_t *)u+[row[@"offset"]unsignedIntegerValue]);}
}
@@ -128,8 +150,8 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
for(int c=0;c<3;c++)finite&=std::isfinite(defaults.primariesM0[c])&&std::isfinite(defaults.primariesM1[c])&&std::isfinite(defaults.primariesM2[c]);
run.need(@"finite-real-model-defaults",finite&&matches);
bool initialGroups=true;
for(NSDictionary *section in sections){BOOL base=[@[@"base",@"color"]containsObject:section[@"key"]];for(NSDictionary *row in descriptors)if([row[@"pid"]isEqual:section[@"enabled"]])initialGroups&=([row[@"default"]doubleValue]>=.5)==base;}
run.record(@"only-basic-adjustments-enabled-by-default",initialGroups);
for(NSDictionary *section in sections){BOOL base=YES;for(NSDictionary *row in descriptors)if([row[@"pid"]isEqual:section[@"enabled"]])initialGroups&=([row[@"default"]doubleValue]>=.5)==base;}
run.record(@"all-module-eyes-enabled-by-default",initialGroups);
DYDiagnosticManager *manager=[[[DYDiagnosticManager alloc]init]autorelease];error=nil;
run.need(@"native-parameter-creation",DYCreateParameters(manager,&error)&&!manager->_duplicate&&manager->_values.count==descriptors.count&&manager->_custom.count==2,@{@"error":reason(error)});
id<FxParameterSettingAPI_v6> setter=[manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];id<FxParameterRetrievalAPI_v6> getter=[manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
@@ -142,6 +164,30 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
run.record(@"secure-asset-archive-roundtrip",decoded&&[assets isEqual:decoded],@{@"archiveBytes":@(archive.length),@"error":reason(error)});
BOOL wrote=DYWriteAssets(manager,assets,kCMTimeZero);DYAssetState *readBack=DYReadAssets(manager,kCMTimeZero);run.record(@"native-custom-asset-get-set",wrote&&[readBack isEqual:assets]);
DYAssetState *copy=[[assets copy]autorelease];copy.paths=@{};run.record(@"asset-copy-is-independent",assets.paths.count==2&&copy.paths.count==0);
// Exercise the real AppKit actions against a separate, in-memory host.
[NSApplication sharedApplication];
DYDiagnosticManager *uiHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(uiHost,nil);
DYInspector *inspector=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[inspector refresh];
NSArray *cards=[inspector valueForKey:@"cards"];BOOL initialUI=YES;
for(NSDictionary *card in cards)initialUI&=([card[@"collapsed"]boolValue]!=[@[@"primary",@"base"]containsObject:card[@"section"][@"key"]])&&[(NSButton*)card[@"enabled"]state]==NSControlStateValueOn;
run.record(@"default-primary-base-expanded-all-eyes-on",initialUI,@{@"modules":@(cards.count)});
DYUniforms uiBefore,uiAfter;DYReadUniforms(uiHost,kCMTimeZero,&uiBefore);BOOL foldingIndependent=YES;
for(NSDictionary *card in cards){NSButton *header=card[@"header"];BOOL was=[card[@"collapsed"]boolValue];[header performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);foldingIndependent&=[card[@"collapsed"]boolValue]!=was&&memcmp(&uiBefore,&uiAfter,sizeof(uiBefore))==0;[header performClick:nil];[inspector refresh];}
run.record(@"all-disclosure-actions-preserve-every-render-parameter",foldingIndependent);
NSDictionary *first=cards[0];BOOL wasFolded=[first[@"collapsed"]boolValue];[(NSButton*)first[@"enabled"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"eye-only-toggles-enable-retains-disclosure",[first[@"collapsed"]boolValue]==wasFolded&&uiAfter.inputSectionEnabled==0);
[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"expanding-disabled-module-keeps-it-disabled",uiAfter.inputSectionEnabled==0&&![first[@"collapsed"]boolValue]);
DYInspector *reopened=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[reopened refresh];NSArray *reopenedCards=[reopened valueForKey:@"cards"];
run.record(@"inspector-recreation-restores-independent-disclosure",![reopenedCards[0][@"collapsed"]boolValue]&&[(NSButton*)reopenedCards[0][@"enabled"]state]==NSControlStateValueOff);
DYInspectorToken *uiToken=uiHost->_custom[@(DYInspectorParameterID)];error=nil;NSData *foldArchive=[NSKeyedArchiver archivedDataWithRootObject:uiToken requiringSecureCoding:YES error:&error];DYInspectorToken *foldDecoded=[NSKeyedUnarchiver unarchivedObjectOfClass:DYInspectorToken.class fromData:foldArchive error:&error];
run.record(@"secure-disclosure-archive-roundtrip",[foldDecoded isEqual:uiToken],@{@"error":reason(error)});
DYInspectorToken *old=[[[DYInspectorToken alloc]init]autorelease];old.schema=1;uiHost->_custom[@(DYInspectorParameterID)]=old;DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
run.record(@"legacy-inspector-retains-input-and-blackwhite-behavior",uiAfter.cm.configured==-1&&uiAfter.cm.blackWhiteMix==1);
DayuRenderParams cp=DYCMRender(defaults.cm);run.record(@"working-space-shared-by-primary-and-output",cp.input.outputTransfer==cp.output.inputTransfer&&cp.input.outputGamut==cp.output.inputGamut&&cp.basis.colorspace==10);
DYCMSettings converted=defaults.cm;converted.exposure=1.25;converted.contrast=.4;converted.balanceStrength=.3;converted.midtones=.6;converted.shadows=-.4;converted.black=.2;converted.shadowContrast=.3;converted.hiContrast=-.2;DayuRenderParams mapped=DYCMRender(converted);
run.record(@"basis-raw-controls-use-reference-conversion",fabs(mapped.basis.exposure-exp2f(1.25))<1e-6&&fabs(mapped.basis.contrast-exp2f(.4))<1e-6&&fabs(mapped.basis.balanceStrength-.36)<1e-6&&fabs(mapped.basis.midtones-.1998)<1e-5&&fabs(mapped.basis.shadows+.6)<1e-6&&fabs(mapped.basis.trimLow-.9)<1e-6&&fabs(mapped.basis.shadowContrast+.39)<1e-6&&fabs(mapped.basis.hiContrast+.4)<1e-6);
converted.workingTransfer=30;mapped=DYCMRender(converted);run.record(@"unsupported-basis-curve-adapts-through-intermediate",(mapped.reserved&8)&&mapped.basis.colorspace==10&&mapped.basisInput.inputTransfer==30&&mapped.basisOutput.outputTransfer==30);
id<MTLDevice> gpu=MTLCreateSystemDefaultDevice();run.need(@"metal-device",gpu!=nil);gpuName=gpu.name;
const NSUInteger width=64,height=48;DYDiagnosticTile *source=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease],*destination=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease];
run.need(@"real-iosurface-image-tiles",source&&destination&&source.ioSurface&&destination.ioSurface);
@@ -149,6 +195,22 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYRenderer *renderer=[[[DYRenderer alloc]init]autorelease];Pixels neutral=render(run,renderer,source,destination,gpu,defaults,@{},@"renderer-default-pass");Difference neutralDifference=difference(input,neutral);
run.record(@"transparent-premultiplied-neutral",neutralDifference.nonfinite==0&&neutralDifference.maximum<=.001,measure(neutralDifference));
NSString *cstReference=NSProcessInfo.processInfo.environment[@"DY_DIAGNOSTIC_CST_REFERENCE"];
if(cstReference.length){
error=nil;id<MTLLibrary>oracle=[gpu newLibraryWithURL:[NSURL fileURLWithPath:cstReference] error:&error];run.need(@"independent-installed-cst-reference-loaded",oracle!=nil,@{@"path":cstReference,@"error":reason(error)});
const int cases[][3]={{28,27,10},{2,23,10},{4,4,10},{5,5,10},{6,6,10},{8,7,10},{9,7,10},{11,10,10},{12,28,10},{15,23,10},{16,17,10},{21,23,10},{22,21,10},{25,24,10},{27,25,10},{30,23,10},{29,23,10},{28,27,1},{28,27,20},{28,27,30},{28,27,1002}};
for(unsigned index=0;index<sizeof(cases)/sizeof(cases[0]);index++){@autoreleasepool{
DYUniforms candidate=defaults;candidate.cm.configured=1;candidate.cm.inputTransfer=cases[index][0];candidate.cm.inputGamut=cases[index][1];candidate.cm.workingTransfer=cases[index][2];candidate.cm.toneMapping=1;candidate.cm.exposure=.35;candidate.cm.contrast=.15;candidate.cm.saturation=1.1;candidate.cm.balanceAngle=.12;candidate.cm.balanceStrength=.03;
DayuRenderParams p=DYCMRender(candidate.cm);Pixels expected=referenceFrame(gpu,oracle,input,width,height,p,&error);Pixels actual=render(run,renderer,source,destination,gpu,candidate,@{},[NSString stringWithFormat:@"cst-case-%02u-render",index]);
BOOL same=expected.size()==actual.size();double worst=0;float refValue=0,gotValue=0;NSUInteger nonfinite=0;for(NSUInteger i=0;i<expected.size()&&same;i++){float a=expected[i],b=actual[i];if(!std::isfinite(a)||!std::isfinite(b)){nonfinite++;same=NO;break;}double delta=fabs(a-b);worst=fmax(worst,delta);same&=delta<=.004+.003*fabs(a);if(!same){refValue=a;gotValue=b;}}
run.record([NSString stringWithFormat:@"cst-case-%02u-independent-pixels",index],same,@{@"inputCurve":@(p.input.inputTransfer),@"inputGamut":@(p.input.inputGamut),@"workingCurve":@(p.input.outputTransfer),@"maximumError":@(worst),@"referenceValue":@(refValue),@"actualValue":@(gotValue),@"nonfinite":@(nonfinite),@"components":@(actual.size())});
}}[oracle release];
}
DYUniforms monochrome=defaults;monochrome.cm.blackWhiteMix=1;Pixels mono=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-full-render");
Difference monoDiff=difference(neutral,mono);run.record(@"blackwhite-mix-100-affects-frame",monoDiff.different>100&&monoDiff.nonfinite==0,measure(monoDiff));
monochrome.cm.blackWhiteMix=.5;Pixels halfMono=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-half-render");BOOL smooth=YES;for(NSUInteger i=0;i<mono.size();i++)smooth&=fabs((float)halfMono[i]-.5f*((float)mono[i]+(float)neutral[i]))<.001;
run.record(@"blackwhite-half-mix-is-continuous",smooth);
monochrome.blackWhiteSectionEnabled=0;Pixels monoOff=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-eye-off-render");run.record(@"blackwhite-eye-bypasses-retained-mix",difference(neutral,monoOff).maximum==0);
auto checkFoldedGroup=[&](DYUniforms active,NSUInteger offset,NSDictionary *paths,NSString *name){
*(float *)((uint8_t *)&active+offset)=0;
Pixels folded=render(run,renderer,source,destination,gpu,active,paths,[name stringByAppendingString:@"-render"]);
@@ -188,16 +250,25 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[orientationRenderer invalidatePreview];run.record(@"preview-invalidation-clears-analysis-and-browser",![orientationRenderer preview]&&![orientationRenderer lookLUTPreview]);
[source setDiagnosticImageOrigin:kFxImageOrigin_TOP_LEFT];
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYUniforms cstExport=defaults;cstExport.cm.configured=1;cstExport.cm.exposure=.7f;
NSURL *cstCube=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"cst-export.cube"]];error=nil;BOOL cstExported=[renderer exportLUT:cstCube uniforms:cstExport paths:@{} error:&error];
NSString *cubeText=cstExported?[NSString stringWithContentsOfURL:cstCube encoding:NSUTF8StringEncoding error:&error]:nil;std::vector<float>cubeValues;
for(NSString *line in [cubeText componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){cubeValues.push_back(r);cubeValues.push_back(g);cubeValues.push_back(b);}}
Pixels gray(input.size());float grayLinear=powf((.5f+.055f)/1.055f,2.4f);for(NSUInteger i=0;i<width*height;i++){for(int c=0;c<3;c++)gray[i*4+c]=grayLinear;gray[i*4+3]=1;}
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:gray.data() bytesPerRow:width*8];Pixels grayRendered=render(run,renderer,source,destination,gpu,cstExport,@{},@"cst-export-production-sample");
BOOL cstCubeMatches=cstExported&&cubeValues.size()==33*33*33*3;for(int c=0;c<3&&cstCubeMatches;c++){float code=cubeValues[((16*33+16)*33+16)*3+c];float linear=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);cstCubeMatches&=fabs(linear-(float)grayRendered[c])<.002&&fabs(code-.5f)>.01;}
run.record(@"cube-export-includes-cst-primary-and-matches-production",cstCubeMatches,@{@"error":reason(error),@"triples":@(cubeValues.size()/3)});
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
DYUniforms u=defaults;u.exposure=.8f;Pixels exposed=render(run,renderer,source,destination,gpu,u,@{},@"renderer-exposure-pass");Difference exposureDifference=difference(neutral,exposed);run.record(@"exposure-affects-actual-frame",exposureDifference.nonfinite==0&&exposureDifference.different>100,measure(exposureDifference));
u.baseSectionEnabled=0;Pixels bypass=render(run,renderer,source,destination,gpu,u,@{},@"renderer-base-bypass-pass");Difference bypassDifference=difference(neutral,bypass);run.record(@"base-group-bypass",bypassDifference.nonfinite==0&&bypassDifference.maximum==0,measure(bypassDifference));
u=defaults;u.temperature=35;u.tint=-20;Pixels wb=render(run,renderer,source,destination,gpu,u,@{},@"renderer-white-balance-pass");Difference wbDifference=difference(neutral,wb);run.record(@"white-balance-real-table-frame",wbDifference.nonfinite==0&&wbDifference.different>100,measure(wbDifference));
u.colorSectionEnabled=0;bypass=render(run,renderer,source,destination,gpu,u,@{},@"renderer-color-bypass-pass");bypassDifference=difference(neutral,bypass);run.record(@"color-group-bypass",bypassDifference.nonfinite==0&&bypassDifference.maximum==0,measure(bypassDifference));
u=defaults;u.hslSectionEnabled=1;u.hslHueA.x=28;u.hslSatA.y=45;u.hslLumB.z=-18;Pixels hsl=render(run,renderer,source,destination,gpu,u,@{},@"renderer-hsl-pass");Difference hslDifference=difference(neutral,hsl);run.record(@"hsl-real-table-frame",hslDifference.nonfinite==0&&hslDifference.different>100,measure(hslDifference));
checkFoldedGroup(u,offsetof(DYUniforms,hslSectionEnabled),@{},@"folded-hsl-bypasses-retained-adjustments");
checkFoldedGroup(u,offsetof(DYUniforms,hslSectionEnabled),@{},@"disabled-hsl-bypasses-retained-adjustments");
u=defaults;u.colorGradingSectionEnabled=1;u.colorGradingHueSatA.x=210;u.colorGradingHueSatA.y=42;u.colorGradingLuma.x=18;Pixels grading=render(run,renderer,source,destination,gpu,u,@{},@"renderer-grading-pass");Difference gradingDifference=difference(neutral,grading);run.record(@"grading-real-table-frame",gradingDifference.nonfinite==0&&gradingDifference.different>100,measure(gradingDifference));
checkFoldedGroup(u,offsetof(DYUniforms,colorGradingSectionEnabled),@{},@"folded-grading-bypasses-retained-adjustments");
checkFoldedGroup(u,offsetof(DYUniforms,colorGradingSectionEnabled),@{},@"disabled-grading-bypasses-retained-adjustments");
for(int profile=1;profile<=17;profile++){@autoreleasepool{u=defaults;u.inputSectionEnabled=1;u.inputProfile=profile;Pixels transformed=render(run,renderer,source,destination,gpu,u,@{},[NSString stringWithFormat:@"input-profile-%02d-load-render",profile]);Difference delta=difference(neutral,transformed);run.record([NSString stringWithFormat:@"input-profile-%02d-finite-nonzero",profile],delta.nonfinite==0&&delta.nonzero>100,measure(delta));}}
checkFoldedGroup(u,offsetof(DYUniforms,inputSectionEnabled),@{},@"folded-input-bypasses-retained-profile");
checkFoldedGroup(u,offsetof(DYUniforms,inputSectionEnabled),@{},@"disabled-input-bypasses-retained-profile");
DYRenderer *analysisRenderer=[[[DYRenderer alloc]init]autorelease];u=defaults;u.inputSectionEnabled=1;u.inputProfile=1;render(run,analysisRenderer,source,destination,gpu,u,@{},@"renderer-input-analysis-pass");
NSData *inputPreview=[analysisRenderer preview];bool analysisDifferent=inputPreview.length==preview.length&&preview.length==320*180*16;double analysisMaximum=0;size_t analysisChanges=0;
if(analysisDifferent){const float *a=(const float *)preview.bytes,*b=(const float *)inputPreview.bytes;for(NSUInteger i=0;i<preview.length/4;i++){if(!std::isfinite(a[i])||!std::isfinite(b[i])){analysisDifferent=false;break;}if(i%4!=3){double delta=std::fabs(double(a[i])-b[i]);analysisMaximum=std::max(analysisMaximum,delta);if(delta>1e-5)analysisChanges++;}}}
@@ -205,7 +276,7 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
NSString *lookFile=[runtime stringByAppendingPathComponent:@"diagnostic-look.cube"];NSMutableString *cube=[NSMutableString stringWithString:@"TITLE \"Self test look\"\nLUT_3D_SIZE 2\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
for(int b=0;b<2;b++)for(int g=0;g<2;g++)for(int r=0;r<2;r++)[cube appendFormat:@"%.8f %.8f %.8f\n",.7f*r+.1f,.8f*g+.05f,.85f*b+.02f];error=nil;run.need(@"temporary-look-file",[cube writeToFile:lookFile atomically:YES encoding:NSUTF8StringEncoding error:&error],@{@"error":reason(error)});
NSDictionary *paths=@{@"look0":lookFile,@"look1":lookFile,@"look2":lookFile,@"look3":lookFile,@"look4":lookFile};u=defaults;u.lookSectionEnabled=1;u.postLUTStrength=.35f;u.extraPostLUTStrengths=(DYFloat4){.4f,.5f,.6f,.7f};Pixels looks=render(run,renderer,source,destination,gpu,u,paths,@"renderer-five-look-pass");Difference looksDifference=difference(neutral,looks);run.record(@"five-look-mixes-affect-frame",looksDifference.nonfinite==0&&looksDifference.different>100,measure(looksDifference));
checkFoldedGroup(u,offsetof(DYUniforms,lookSectionEnabled),paths,@"folded-look-bypasses-retained-LUTs");
checkFoldedGroup(u,offsetof(DYUniforms,lookSectionEnabled),paths,@"disabled-look-bypasses-retained-LUTs");
NSURL *exportURL=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"diagnostic-export.cube"]];error=nil;run.need(@"renderer-export-33cube",[renderer exportLUT:exportURL uniforms:u paths:paths error:&error],@{@"error":reason(error),@"path":exportURL.path});
NSString *exported=[NSString stringWithContentsOfURL:exportURL encoding:NSUTF8StringEncoding error:&error];NSUInteger triples=0,nonzero=0;bool exportFinite=true;for(NSString *line in [exported componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){triples++;exportFinite&=std::isfinite(r)&&std::isfinite(g)&&std::isfinite(b);if(r!=0||g!=0||b!=0)nonzero++;}}
run.record(@"export-33cube-data-contract",[exported containsString:@"LUT_3D_SIZE 33"]&&triples==33*33*33&&exportFinite&&nonzero>0,@{@"rows":@(triples),@"nonzeroRows":@(nonzero),@"bytes":@([[[NSFileManager defaultManager]attributesOfItemAtPath:exportURL.path error:nil][NSFileSize]unsignedLongLongValue])});
+28 -1
查看文件
@@ -38,12 +38,17 @@ fragment half4 dyFragment(DYRaster in [[stage_in]],
texture3d<float> colorGrading [[texture(9)]],
constant DYUniforms& uniforms [[buffer(0)]],
constant float& sceneLevel [[buffer(1)]],
constant DYRenderOptions& options [[buffer(2)]]) {
constant DYRenderOptions& options [[buffer(2)]],
constant DYUniforms& colorUniforms [[buffer(3)]]) {
constexpr sampler sampleFilter(coord::normalized, address::clamp_to_edge, filter::linear);
half4 sample = source.sample(sampleFilter, in.uv);
if (!(sample.a > half(0.0))) return half4(0.0h);
half4 result = dy_grade(sample, in.uv, source, preLUT, look1, look2, look3,
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel);
if(options.blackWhiteMix>0.0f && options.blackWhiteMix<1.0f) {
half4 color=dy_grade(sample,in.uv,source,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel);
result.rgb=mix(color.rgb,result.rgb,half(options.blackWhiteMix));
}
result.a = sample.a;
if (options.outputPremultiplied) result.rgb *= result.a;
return result;
@@ -110,3 +115,25 @@ kernel void dyInputAnalysis(texture2d<half> source [[texture(0)]],
encoded=round(clamp(encoded,0.0f,1.0f)*255.0f)/255.0f;
outRGBA[pixel.y*320+pixel.x]=float4(encoded,float(sample.a));
}
// CST/BASIS arithmetic is reused verbatim from the versioned dayu-cst source.
float4 cst_air(half4 sample, constant CSTParams& params);
float4 basis_air(half4 sample, constant BasisParams& params);
inline float3 dyEncode(float3 linear) {
return select(1.055f*pow(max(linear,float3(0)),float3(1.0f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);
}
inline float3 dyDecode(float3 encoded) {
return select(pow(max((encoded+.055f)/1.055f,float3(0)),float3(2.4f)),encoded/12.92f,encoded<=.04045f);
}
kernel void dyColorManagement(texture2d<float,access::read> source [[texture(0)]],
texture2d<half,access::write> destination [[texture(1)]],
constant DayuRenderParams& p [[buffer(0)]],constant float& amount [[buffer(1)]],uint2 pos [[thread_position_in_grid]]) {
if(pos.x>=source.get_width()||pos.y>=source.get_height())return;
float4 sample=source.read(pos);if(!(sample.a>0)){destination.write(half4(0),pos);return;}
float4 raw=float4(dyEncode(sample.rgb),sample.a),c=raw;
if(p.stages&1)c=cst_air(half4(c),p.input);
if(p.stages&2){if(p.reserved&8)c=cst_air(half4(c),p.basisInput);c=basis_air(half4(c),p.basis);if(p.reserved&8)c=cst_air(half4(c),p.basisOutput);}
if(p.stages&4)c=cst_air(half4(c),p.output);
c.rgb=mix(raw.rgb,c.rgb,amount);
destination.write(half4(half3(dyDecode(c.rgb)),half(sample.a)),pos);
}
+55 -26
查看文件
@@ -167,11 +167,12 @@ static NSArray *DYPresentationSections(void) {
NSMutableDictionary *bySection=[NSMutableDictionary dictionary],*byKey=[NSMutableDictionary dictionary];
for(NSDictionary *s in DYSections())bySection[s[@"key"]]=s;
for(NSDictionary *d in DYDescriptors())byKey[d[@"key"]]=d;
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];input[@"rows"]=@[byKey[@"preLUTStrength"]];
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];
NSMutableDictionary *base=[[bySection[@"base"] mutableCopy]autorelease];NSMutableArray *rows=[NSMutableArray array];
for(NSString *key in @[@"temperature",@"tint",@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"texture",@"clarity",@"dehaze",@"vibrance",@"saturation",@"skinEnabled",@"copyAutoGrade"]){NSDictionary*d=byKey[key];if(d)[rows addObject:d];}
base[@"rows"]=rows;base[@"extraEnabled"]=bySection[@"color"][@"enabled"];
return @[input,base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
base[@"title"]=@"基础调整";
return @[input,bySection[@"primary"],bySection[@"output"],base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
}
@@ -495,7 +496,7 @@ static NSImage *DYWheelImage(void) {
[header setButtonType:NSButtonTypePushOnPushOff];
header.bordered=NO; header.alignment=NSTextAlignmentLeft; header.font=[NSFont boldSystemFontOfSize:12];
header.contentTintColor=DYInk(); header.target=self; header.action=@selector(toggleSection:); header.tag=index;
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开启用,折叠停用;双击还原本组";
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开或折叠界面;双击还原本组";
[card addSubview:header];
NSButton *enabled=DYButton(@"",self,@selector(groupEnabled:));enabled.bordered=NO;[enabled setButtonType:NSButtonTypePushOnPushOff];enabled.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用本组"];
enabled.tag=index; enabled.contentTintColor=DYAccent(); enabled.toolTip=@"启用或旁路本组";
@@ -507,8 +508,8 @@ static NSImage *DYWheelImage(void) {
[card addSubview:reset];
NSMutableArray *body=[NSMutableArray array];
NSString *key=section[@"key"]?:@"";
if([key localizedCaseInsensitiveContainsString:@"input"]) {
[body addObject:[self assetRowForKey:@"input" title:@"输入色彩" inCard:card]];
if([key isEqual:@"input"]) {
NSButton *migrate=DYButton(@"旧版输入 → 改用 CST",self,@selector(useCST:));migrate.identifier=@"legacyInput";migrate.toolTip=@"保留旧工程输入效果;点击后改用上方 CST 设置,可撤销";[card addSubview:migrate];[body addObject:migrate];
}
if([key localizedCaseInsensitiveContainsString:@"look"]) {
for(NSInteger i=0;i<5;i++) {
@@ -552,7 +553,7 @@ static NSImage *DYWheelImage(void) {
NSButton *eye=DYButton(@"",self,@selector(itemEnabled:));eye.bordered=NO;[eye setButtonType:NSButtonTypePushOnPushOff];eye.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用"];eye.tag=[pid integerValue];eye.contentTintColor=DYAccent();eye.accessibilityLabel=[d[@"title"] stringByAppendingString:@"启用"];eye.toolTip=@"启用或旁路此项";[row addSubview:eye];record[@"itemEnabled"]=eye;
}
NSString *kind=d[@"kind"]?:@"float";
if([kind isEqualToString:@"bool"]) {
if([kind isEqualToString:@"bool"]||[d[@"key"]hasPrefix:@"cmbypass"]) {
NSButton *toggle=[NSButton checkboxWithTitle:@"" target:self action:@selector(scalarChanged:)];
toggle.tag=[pid integerValue]; toggle.contentTintColor=DYAccent(); toggle.accessibilityLabel=d[@"title"];
[row addSubview:toggle]; record[@"toggle"]=toggle;
@@ -589,7 +590,7 @@ static NSImage *DYWheelImage(void) {
}
for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered;
}
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![section[@"defaultEnabled"]boolValue])}];
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![@[@"primary",@"base"]containsObject:key])}];
if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;}
[_cards addObject:record];
index++;
@@ -611,6 +612,7 @@ static NSImage *DYWheelImage(void) {
}
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
if([key isEqual:@"legacyInput"])return [_tabs[@"legacyInput"]boolValue];
if([section isEqual:@"curve"] && ![key isEqual:@"curveGraph"])return NO;
if([section isEqual:@"hsl"]) {
int axis=0,color=0;if(sscanf(key.UTF8String,"hsl%d_%d",&axis,&color)==2)return color==tab;
@@ -689,7 +691,7 @@ static NSImage *DYWheelImage(void) {
if(d[@"enabled"]) {double enabled=1;[get getFloatValue:&enabled fromParameter:[d[@"enabled"] unsignedIntValue] atTime:t];[r[@"itemEnabled"] setState:enabled>=.5?NSControlStateValueOn:NSControlStateValueOff];[r[@"itemEnabled"] setImage:[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"]];for(NSString *control in @[@"slider",@"field",@"popup"]) [r[control] setAlphaValue:enabled>=.5?1:.45];}
[r[@"slider"] setDoubleValue:v]; [r[@"field"] setStringValue:DYNumber(v,d)];
[r[@"toggle"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))];
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0){NSArray *values=d[@"values"];NSInteger index=values?[values indexOfObject:@((int)llround(v))]:(NSInteger)llround(v);[popup selectItemAtIndex:index==NSNotFound?0:MAX(0,MIN(index,popup.numberOfItems-1))];}
}
for(id graphic in _graphics)[graphic setValues:graphicValues];
for(NSMutableDictionary *c in _cards) {
@@ -698,19 +700,21 @@ static NSImage *DYWheelImage(void) {
NSNumber *extra=c[@"section"][@"extraEnabled"];double extraValue=0;
if(extra)[get getFloatValue:&extraValue fromParameter:extra.unsignedIntValue atTime:t];
BOOL enabled=v>=.5||extraValue>=.5;
BOOL collapsed=!enabled;groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
[c[@"header"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
[c[@"header"]setToolTip:enabled?@"折叠并停用本组,保留参数值;双击还原本组":@"展开并启用本组,恢复之前的参数值;双击还原本组"];
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];
[c[@"header"]setNeedsDisplay:YES];
[c[@"enabled"] setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"折叠并停用本组":@"展开并启用本组"]];
[c[@"enabled"]setToolTip:enabled?@"折叠并停用本组,保留参数值":@"展开并启用本组,恢复之前的参数值"];
[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
// Visibility and rendering share the host's section enable value.
for(NSView *row in c[@"body"])row.alphaValue=1;
DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
NSNumber *saved=[token isKindOfClass:DYInspectorToken.class]?token.folds[c[@"section"][@"key"]]:nil;
BOOL collapsed=saved?saved.boolValue:[c[@"collapsed"]boolValue];groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
[c[@"header"]setState:collapsed?NSControlStateValueOff:NSControlStateValueOn];
[c[@"header"]setToolTip:collapsed?@"展开界面,不改变启用状态;双击还原本组":@"折叠界面,保持当前效果;双击还原本组"];
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];[c[@"header"]setNeedsDisplay:YES];
[c[@"enabled"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"停用本组":@"启用本组"]];
[c[@"enabled"]setToolTip:enabled?@"停用本组,保留参数和展开状态":@"启用本组,保留展开状态"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
for(NSView *row in c[@"body"])row.alphaValue=enabled?1:.45;
}
DYAssetState *assets=DYReadAssets(_manager,t);
double profile=0,configured=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];[get getFloatValue:&configured fromParameter:2236 atTime:t];
DYInspectorToken *oldToken=nil;[get getCustomParameterValue:&oldToken fromParameter:DYInspectorParameterID atTime:t];
_tabs[@"legacyInput"]=@(configured<.5&&(configured<0||profile>.5||[assets.paths[@"input"]length]||oldToken.schema<2));
for(NSString *key in _assetButtons) {
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
@@ -731,7 +735,7 @@ static NSImage *DYWheelImage(void) {
if(_refreshing)return;
NSNumber *pid=@(sender.tag); NSDictionary *r=_controls[pid],*d=r[@"descriptor"]; if(!d)return;
double v;
if([sender isKindOfClass:[NSPopUpButton class]])v=[(NSPopUpButton *)sender indexOfSelectedItem];
if([sender isKindOfClass:[NSPopUpButton class]]){NSInteger i=[(NSPopUpButton *)sender indexOfSelectedItem];v=d[@"values"]?[d[@"values"][i]doubleValue]:i;}
else if([sender isKindOfClass:[NSButton class]])v=[(NSButton *)sender state]==NSControlStateValueOn?1:0;
else {
if([sender isKindOfClass:[NSTextField class]]) {
@@ -745,7 +749,12 @@ static NSImage *DYWheelImage(void) {
v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v));
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime]; }
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"]||[d[@"key"]isEqual:@"blackWhiteMix"]){
id<FxParameterRetrievalAPI_v6>get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];DYInspectorToken *old=nil;[get getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:action.currentTime];
if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];
else if(old.schema<2){double cfg=0;[get getFloatValue:&cfg fromParameter:2236 atTime:action.currentTime];if(cfg<.5)[set setFloatValue:-1 toParameter:2236 atTime:action.currentTime];}
if(old.schema<2){DYInspectorToken *token=[[old copy]autorelease];token.schema=2;[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];}
} }
@finally { [action endAction:self]; }
[self postChanged];
}
@@ -753,7 +762,7 @@ static NSImage *DYWheelImage(void) {
NSDictionary *r=_controls[@(sender.tag)],*d=r[@"descriptor"];if(!d)return;
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];}
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];}
@finally {[action endAction:self];}
[self postChanged];
}
@@ -785,6 +794,7 @@ static NSImage *DYWheelImage(void) {
id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
[set setFloatValue:enabled?1:0 toParameter:pid.unsignedIntValue atTime:action.currentTime];
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:enabled?1:0 toParameter:extra.unsignedIntValue atTime:action.currentTime];
}
@finally {[action endAction:self];}
[self postChanged];
@@ -792,7 +802,19 @@ static NSImage *DYWheelImage(void) {
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
- (void)toggleSection:(NSButton *)sender {
if(sender.tag<0||sender.tag>=_cards.count)return;
[self setSectionEnabled:[_cards[sender.tag][@"collapsed"]boolValue] atIndex:sender.tag];
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;[action startAction:self];
@try {
id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
DYInspectorToken *old=nil;[get getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:action.currentTime];DYInspectorToken *token=[old isKindOfClass:DYInspectorToken.class]?[[old copy]autorelease]:[[[DYInspectorToken alloc]init]autorelease];
NSMutableDictionary *folds=[[token.folds mutableCopy]autorelease];
for(NSDictionary *card in _cards)folds[card[@"section"][@"key"]]=card[@"collapsed"];
NSString *key=_cards[sender.tag][@"section"][@"key"];folds[key]=@(![_cards[sender.tag][@"collapsed"]boolValue]);token.folds=folds;
[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];
}@finally{[action endAction:self];}[self postChanged];
}
- (void)useCST:(id)sender {
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];
@try{id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:1 toParameter:2236 atTime:a.currentTime];} @finally{[a endAction:self];}[self postChanged];
}
- (void)resetSection:(NSButton *)sender {
[self cancelAssetLoads];
@@ -805,6 +827,9 @@ static NSImage *DYWheelImage(void) {
for(NSDictionary *d in section[@"rows"]) {[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];if(d[@"enabled"])[set setFloatValue:1 toParameter:[d[@"enabled"] unsignedIntValue] atTime:t];}
double defaultEnabled=[section[@"defaultEnabled"]doubleValue];
NSNumber *enabled=section[@"enabled"];if(enabled)[set setFloatValue:defaultEnabled toParameter:enabled.unsignedIntValue atTime:t];
if([@[@"input",@"primary",@"output"]containsObject:section[@"key"]])[set setFloatValue:1 toParameter:2236 atTime:t];
if([section[@"key"]isEqual:@"blackwhite"]){DYInspectorToken *old=nil;[[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:t];if(old.schema<2){DYInspectorToken *current=[[old copy]autorelease];current.schema=2;[set setCustomParameterValue:current toParameter:DYInspectorParameterID atTime:t];[set setFloatValue:-1 toParameter:2236 atTime:t];}}
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:defaultEnabled toParameter:extra.unsignedIntValue atTime:t];
NSString *key=section[@"key"]?:@"";
if([key localizedCaseInsensitiveContainsString:@"input"]||[key localizedCaseInsensitiveContainsString:@"look"]) {
@@ -827,6 +852,8 @@ static NSImage *DYWheelImage(void) {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
for(NSDictionary *d in DYDescriptors())[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=@{};DYWriteAssets(_manager,assets,t);
[set setCustomParameterValue:[[[DYInspectorToken alloc]init]autorelease] toParameter:DYInspectorParameterID atTime:t];
for(NSMutableDictionary *card in _cards)card[@"collapsed"]=@(![@[@"primary",@"base"]containsObject:card[@"section"][@"key"]]);
} @finally {[action endAction:self];}
[self postChanged];
}
@@ -936,9 +963,10 @@ static NSImage *DYWheelImage(void) {
@try {
CMTime t=action.currentTime;id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];
for(NSDictionary *d in DYDescriptors()) {double v=[d[@"default"] doubleValue];[get getFloatValue:&v fromParameter:[d[@"pid"] unsignedIntValue] atTime:t];if(std::isfinite(v))values[d[@"key"]]=@(v);}
DYUniforms effective;DYReadUniforms(_manager,t,&effective);values[@"cmConfigured"]=@(effective.cm.configured);values[@"blackWhiteMix"]=@(effective.cm.blackWhiteMix);
paths=[[DYReadAssets(_manager,t).paths copy] autorelease]?:@{};
} @finally {[action endAction:self];}
return @{@"format":@"com.dayu.color.preset",@"version":@1,@"values":values,@"paths":paths};
return @{@"format":@"com.dayu.color.preset",@"version":@2,@"values":values,@"paths":paths};
}
- (void)savePreset:(id)sender {
NSDictionary *snapshot=[self presetSnapshot];if(!snapshot)return;
@@ -953,11 +981,11 @@ static NSImage *DYWheelImage(void) {
NSError *error=nil;NSData *data=[NSData dataWithContentsOfURL:panel.URL options:0 error:&error];
if(!data||data.length>2*1024*1024){[self showError:error.localizedDescription?:@"预设文件过大"];return;}
id json=[NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
if(![json isKindOfClass:NSDictionary.class]||![json[@"format"] isEqual:@"com.dayu.color.preset"]||![json[@"version"] isEqual:@1]||![json[@"values"] isKindOfClass:NSDictionary.class]||![json[@"paths"] isKindOfClass:NSDictionary.class]){[self showError:@"这不是有效的大鱼调色预设。"];return;}
if(![json isKindOfClass:NSDictionary.class]||![json[@"format"] isEqual:@"com.dayu.color.preset"]||![@[@1,@2]containsObject:json[@"version"]]||![json[@"values"] isKindOfClass:NSDictionary.class]||![json[@"paths"] isKindOfClass:NSDictionary.class]){[self showError:@"这不是有效的大鱼调色预设。"];return;}
NSDictionary *values=json[@"values"],*paths=json[@"paths"];
for(NSDictionary *d in DYDescriptors()) {
id v=values[d[@"key"]];if(!v)continue;
if(![v isKindOfClass:NSNumber.class]||!std::isfinite([v doubleValue])||[v doubleValue]<[d[@"min"] doubleValue]||[v doubleValue]>[d[@"max"] doubleValue]){[self showError:@"预设包含无效参数,尚未修改当前调色。"];return;}
if(![v isKindOfClass:NSNumber.class]||!std::isfinite([v doubleValue])||[v doubleValue]<[d[@"min"] doubleValue]||[v doubleValue]>[d[@"max"] doubleValue]||(d[@"values"]&&![d[@"values"]containsObject:v])){[self showError:@"预设包含无效参数,尚未修改当前调色。"];return;}
}
NSMutableDictionary *validPaths=[NSMutableDictionary dictionary];NSMutableArray *missing=[NSMutableArray array];
for(NSString *key in @[@"input",@"look0",@"look1",@"look2",@"look3",@"look4"]) {
@@ -971,6 +999,7 @@ static NSImage *DYWheelImage(void) {
@try {
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
for(NSDictionary *d in DYDescriptors())if(values[d[@"key"]])[set setFloatValue:[values[d[@"key"]] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];
if([json[@"version"]isEqual:@1]&&!values[@"cmConfigured"]){[set setFloatValue:-1 toParameter:2236 atTime:t];[set setFloatValue:1 toParameter:2270 atTime:t];}
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=validPaths;DYWriteAssets(_manager,assets,t);
} @finally {[action endAction:self];}
[self postChanged];
+2
查看文件
@@ -14,6 +14,8 @@ FOUNDATION_EXPORT void DYReadUniforms(id<PROAPIAccessing> manager,CMTime time,DY
@property(copy) NSDictionary *paths;
@end
@interface DYInspectorToken : NSObject<NSSecureCoding,NSCopying,FxCustomParameterInterpolation_v2>
@property(copy) NSDictionary *folds;
@property NSInteger schema;
@end
FOUNDATION_EXPORT DYAssetState *DYReadAssets(id<PROAPIAccessing> manager,CMTime time);
FOUNDATION_EXPORT BOOL DYWriteAssets(id<PROAPIAccessing> manager,DYAssetState *assets,CMTime time);
+114 -10
查看文件
@@ -7,16 +7,116 @@ static NSDictionary *row(NSString*k,NSString*t,NSUInteger o,double lo,double hi,
NSMutableDictionary*r=[@{@"key":k,@"title":t,@"pid":@(PID(o)),@"offset":@(o),@"min":@(lo),@"max":@(hi),@"default":@(d),@"step":@(hi-lo>10?1:.01),@"kind":kind?:@"float"}mutableCopy];
[descriptors addObject:r];return [r autorelease];
}
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=0){
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=1){
NSDictionary*e=row([k stringByAppendingString:@"Enabled"],t,offset,0,1,def,@"bool");
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"defaultEnabled":@(def),@"rows":rows}];
}
static NSDictionary *scalar(NSString*k,NSString*t,NSUInteger o,double lo=-100,double hi=100,double def=0){return row(k,t,o,lo,hi,def,@"float");}
NSArray<NSDictionary *> *DYCMSceneSpaces(void) { return @[
@{ @"id":@99, @"name":@"KOLOR Default" },
@{ @"id":@1, @"name":@"ACEScct" },
@{ @"id":@2, @"name":@"Apple Log" },
@{ @"id":@3, @"name":@"Apple Log 2" },
@{ @"id":@4, @"name":@"ARRI LogC3" },
@{ @"id":@5, @"name":@"ARRI LogC4" },
@{ @"id":@6, @"name":@"Blackmagic Film Gen 5" },
@{ @"id":@7, @"name":@"Canon C-Log" },
@{ @"id":@8, @"name":@"Canon C-Log 2" },
@{ @"id":@9, @"name":@"Canon C-Log 3" },
@{ @"id":@10, @"name":@"DaVinci Intermediate" },
@{ @"id":@11, @"name":@"DJI D-Log" },
@{ @"id":@12, @"name":@"DJI D-Log 2" },
@{ @"id":@13, @"name":@"DJI D-Log M" },
@{ @"id":@14, @"name":@"Fujifilm F-Log" },
@{ @"id":@15, @"name":@"Fujifilm F-Log2" },
@{ @"id":@16, @"name":@"Fujifilm F-Log2 C" },
@{ @"id":@17, @"name":@"GoPro GP-Log" },
@{ @"id":@18, @"name":@"GoPro GP-Log2" },
@{ @"id":@30, @"name":@"GoPro GP-Log2 (Official, 0 EV)" },
@{ @"id":@29, @"name":@"Insta I-Log" },
@{ @"id":@19, @"name":@"Leica L-Log" },
@{ @"id":@20, @"name":@"Linear" },
@{ @"id":@21, @"name":@"Nikon N-Log" },
@{ @"id":@22, @"name":@"Panasonic V-Log" },
@{ @"id":@23, @"name":@"Phantom Log 1" },
@{ @"id":@24, @"name":@"Phantom Log 2" },
@{ @"id":@25, @"name":@"REDLog3G10" },
@{ @"id":@26, @"name":@"Samsung Log" },
@{ @"id":@27, @"name":@"Sony S-Log2" },
@{ @"id":@28, @"name":@"Sony S-Log3" }
]; }
NSArray<NSDictionary *> *DYCMDisplaySpaces(void) { return @[
@{ @"id":@1001, @"name":@"Gamma 2.2" },
@{ @"id":@1002, @"name":@"Gamma 2.4" },
@{ @"id":@1003, @"name":@"Gamma 2.6" }
]; }
NSArray<NSDictionary *> *DYCMGamuts(void) { return @[
@{ @"id":@99, @"name":@"KOLOR Default" },
@{ @"id":@1, @"name":@"ACES AP0" },
@{ @"id":@2, @"name":@"ACES AP1" },
@{ @"id":@3, @"name":@"Apple Log 2" },
@{ @"id":@4, @"name":@"ARRI WG3" },
@{ @"id":@5, @"name":@"ARRI WG4" },
@{ @"id":@6, @"name":@"Blackmagic Wide Gamut" },
@{ @"id":@7, @"name":@"Canon Cinema Gamut" },
@{ @"id":@16, @"name":@"DaVinci Wide Gamut" },
@{ @"id":@8, @"name":@"DJI Action 5" },
@{ @"id":@9, @"name":@"DJI Air 2S" },
@{ @"id":@10, @"name":@"DJI D-Gamut" },
@{ @"id":@28, @"name":@"DJI D-Gamut 2" },
@{ @"id":@11, @"name":@"DJI Mavic2 Pro" },
@{ @"id":@12, @"name":@"DJI Mavic 3 Pro" },
@{ @"id":@13, @"name":@"DJI Mini 4 Pro" },
@{ @"id":@14, @"name":@"DJI Mini 5 Pro" },
@{ @"id":@15, @"name":@"DJI Pocket 3" },
@{ @"id":@17, @"name":@"Fujifilm F-GamutC" },
@{ @"id":@18, @"name":@"GoPro GP-Log" },
@{ @"id":@19, @"name":@"P3-DCI" },
@{ @"id":@20, @"name":@"P3 D65" },
@{ @"id":@21, @"name":@"Panasonic V-Gamut" },
@{ @"id":@22, @"name":@"Rec.709 / BT.709" },
@{ @"id":@23, @"name":@"Rec.2020 / BT.2020" },
@{ @"id":@24, @"name":@"RED Wide Gamut RGB" },
@{ @"id":@25, @"name":@"Sony S-Gamut" },
@{ @"id":@26, @"name":@"Sony S-Gamut3" },
@{ @"id":@27, @"name":@"Sony S-Gamut3.Cine" }
]; }
static NSDictionary *cmRow(NSString*k,NSString*t,NSUInteger o,double lo,double hi,double def,int tab,NSArray *choices=nil){
NSMutableDictionary *d=[[row(k,t,offsetof(DYUniforms,cm)+o,lo,hi,def,choices?@"popup":@"float")mutableCopy]autorelease];d[@"cmTab"]=@(tab);
if(choices){d[@"notAnimatable"]=@YES;d[@"options"]=[choices valueForKey:@"name"];d[@"values"]=[choices valueForKey:@"id"];}
[descriptors replaceObjectAtIndex:descriptors.count-1 withObject:d];return d;
}
static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
sections=[[NSMutableArray alloc]init];descriptors=[[NSMutableArray alloc]init];
NSMutableDictionary*profile=[[scalar(@"inputProfile",@"相机输入",52,0,17)mutableCopy]autorelease];profile[@"kind"]=@"popup";profile[@"options"]=@[@"无",@"Apple Log",@"ARRI LogC3",@"ARRI LogC4",@"Blackmagic Film Gen5",@"Canon C-Log",@"Canon C-Log2",@"Canon C-Log3",@"DJI D-Log",@"DJI D-Log M",@"Fujifilm F-Log",@"Fujifilm F-Log2",@"Nikon N-Log",@"Panasonic V-Log",@"RED Log3G10",@"Sony S-Log2",@"Sony S-Log3",@"Sony HLG"];
[descriptors replaceObjectAtIndex:0 withObject:profile];
section(@"input",@"输入 / LUT",132,@[profile,scalar(@"preLUTStrength",@"输入强度",56,0,1,1)]);
// Legacy IDs remain registered for existing FCP documents and presets.
scalar(@"preLUTStrength",@"旧版输入强度",56,0,1,1);
row(@"cmConfigured",@"CST 配置版本",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,configured),-1,1,0,@"bool");
NSArray *transfers=[DYCMSceneSpaces() arrayByAddingObjectsFromArray:DYCMDisplaySpaces()];
NSMutableArray *cm=[NSMutableArray array];
#define CM(f,t,lo,hi,def,tab) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),lo,hi,def,tab)]
#define CH(f,t,def,tab,list) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),0,1003,def,tab,list)]
CM(inputEnabled,@"输入转换启用",0,1,1,0);
CH(inputTransfer,@"输入曲线",1002,0,transfers);CH(inputGamut,@"输入色域",22,0,DYCMGamuts());
CH(workingTransfer,@"工作曲线",10,0,transfers);CH(workingGamut,@"工作色域",16,0,DYCMGamuts());
CM(mix,@"CST 混合",0,1,1,0);
CM(basisEnabled,@"一级调色启用",0,1,1,1);
CM(exposure,@"一级曝光",-5,5,0,1);CM(balanceAngle,@"色彩平衡方向",0,1,0,1);CM(balanceStrength,@"色彩平衡强度",0,1,0,1);CM(saturation,@"一级饱和度",0,2,1,1);
CM(contrast,@"一级对比度",-1,1,0,1);CM(pivot,@"对比度轴心",-3,3,0,1);CM(hiContrast,@"高光对比度",-1,1,0,1);CM(hiPivot,@"高光轴心",-1,1,0,1);CM(shadowContrast,@"阴影对比度",-1,1,0,1);CM(shadowPivot,@"阴影轴心",-1,1,0,1);
CM(white,@"白点",.5,1.5,1,1);CM(shoulder,@"肩部压缩",0,1,.5,1);CM(highlights,@"一级高光",-1,1,0,1);CM(midtones,@"一级中间调",-1,1,0,1);CM(shadows,@"一级阴影",-1,1,0,1);CM(black,@"黑点",-1,1,0,1);CM(toe,@"趾部压缩",0,1,.5,1);CM(chromaMix,@"色度混合",0,1,.5,1);
CM(bypassExposure,@"旁路一级曝光",0,1,0,1);CM(bypassBalance,@"旁路一级色彩",0,1,0,1);CM(bypassContrast,@"旁路一级对比",0,1,0,1);CM(bypassTone,@"旁路一级影调",0,1,0,1);
CM(outputEnabled,@"输出转换启用",0,1,1,2);CH(outputTransfer,@"输出曲线",1002,2,transfers);CH(outputGamut,@"输出色域",22,2,DYCMGamuts());
[cm addObject:cmRow(@"cmtoneMapping",@"自动色调映射",offsetof(DYCMSettings,toneMapping),0,1,0,2,@[@{@"id":@0,@"name":@"关闭"},@{@"id":@1,@"name":@"开启"}])];
#undef CM
#undef CH
NSMutableArray *input=[NSMutableArray array],*primary=[NSMutableArray array],*output=[NSMutableArray array];
for(NSDictionary *d in cm){NSString *key=d[@"key"];if([@[@"cminputEnabled",@"cmbasisEnabled",@"cmoutputEnabled"]containsObject:key])continue;[([d[@"cmTab"]intValue]==0?input:[d[@"cmTab"]intValue]==1?primary:output) addObject:d];}
section(@"input",@"输入转换 / CST",132,input);
// Enable descriptors already exist; do not register the same offset twice.
[sections addObject:@{@"key":@"primary",@"title":@"一级调色",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,basisEnabled))),@"defaultEnabled":@1,@"rows":primary}];
[sections addObject:@{@"key":@"output",@"title":@"输出转换 / CST",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,outputEnabled))),@"defaultEnabled":@1,@"rows":output}];
NSMutableArray*base=[NSMutableArray array];
NSArray*names=@[@"曝光",@"对比度",@"高光",@"阴影",@"白色色阶",@"黑色色阶",@"色温",@"色调",@"饱和度",@"鲜艳度",@"纹理",@"清晰度",@"去朦胧"];
NSArray*keys=@[@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"temperature",@"tint",@"saturation",@"vibrance",@"texture",@"clarity",@"dehaze"];
@@ -28,7 +128,7 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
NSDictionary*copyAuto=@{@"key":@"copyAutoGrade",@"title":@"复制时自动调色",@"pid":@8800,@"offset":@(-1),@"min":@0,@"max":@1,@"default":@0,@"step":@1,@"kind":@"bool",@"notAnimatable":@YES};[descriptors addObject:copyAuto];
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto],1);
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]],1);
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],0);
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],1);
NSMutableArray*look=[NSMutableArray arrayWithObject:scalar(@"postLUTStrength",@"风格 1 强度",60,0,1,1)];
for(int i=0;i<4;i++){[look addObject:row([NSString stringWithFormat:@"look%dEnabled",i+2],[NSString stringWithFormat:@"风格 %d 启用",i+2],160+i*4,0,1,1,@"bool")];[look addObject:scalar([NSString stringWithFormat:@"look%dStrength",i+2],[NSString stringWithFormat:@"风格 %d 强度",i+2],64+i*4,0,1,1)];}
section(@"look",@"风格 LUT",144,look);
@@ -49,12 +149,14 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
[grade addObject:scalar(@"gradingBlending",@"混合",404,0,100,50)];[grade addObject:scalar(@"gradingBalance",@"平衡",408)];section(@"grading",@"颜色分级",400,grade);
NSMutableArray*prim=[NSMutableArray array];for(int c=0;c<3;c++)for(int a=0;a<2;a++)[prim addObject:scalar([NSString stringWithFormat:@"primary%d_%d",c,a],[NSString stringWithFormat:@"%@原色 %@",@[@"红",@"绿",@"蓝"][c],a?@"饱和度":@"色相"],484+c*8+a*4)];section(@"primaries",@"三原色",480,prim);
NSMutableArray*levels=[NSMutableArray array];for(int c=0;c<4;c++)for(int a=0;a<5;a++)[levels addObject:scalar([NSString stringWithFormat:@"level%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"RGB",@"红",@"绿",@"蓝"][c],@[@"输入黑",@"伽马",@"输入白",@"输出黑",@"输出白"][a]],624+a*16+c*4,a==1?.1:0,a==1?10:255,a==1?1:(a==2||a==4)?255:0)];section(@"levels",@"色阶",608,levels);
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];section(@"blackwhite",@"黑白混色",704,bw,0);
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];[bw insertObject:scalar(@"blackWhiteMix",@"黑白混合",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,blackWhiteMix),0,1,0) atIndex:0];section(@"blackwhite",@"黑白混色",704,bw,1);
NSMutableArray*balance=[NSMutableArray arrayWithObject:row(@"preserveLuma",@"保持明度",756,0,1,1,@"bool")];for(int c=0;c<3;c++)for(int a=0;a<3;a++)[balance addObject:scalar([NSString stringWithFormat:@"balance%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"阴影",@"中间调",@"高光"][c],@[@"青 ↔ 红",@"洋红 ↔ 绿",@"黄 ↔ 蓝"][a]],768+c*16+a*4)];section(@"balance",@"色彩平衡",752,balance);
});}
NSArray<NSDictionary*> *DYSections(void){initialize();return sections;} NSArray<NSDictionary*> *DYDescriptors(void){initialize();return descriptors;}
void DYDefaultUniforms(DYUniforms*u){memset(u,0,sizeof(*u));for(NSDictionary*r in DYDescriptors())if([r[@"offset"]integerValue]>=0)*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=[r[@"default"]floatValue];u->primariesM0=(DYFloat3){1,0,0};u->primariesM1=(DYFloat3){0,1,0};u->primariesM2=(DYFloat3){0,0,1};}
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v))*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}}
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v)){if(r[@"values"]&&![r[@"values"]containsObject:@((int)llround(v))])v=[r[@"default"]doubleValue];*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}}NSObject<NSSecureCoding,NSCopying> *token=nil;[g getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
if([token isKindOfClass:DYInspectorToken.class]&&[(DYInspectorToken*)token schema]<2){if(u->cm.configured<.5)u->cm.configured=-1;u->cm.blackWhiteMix=1;}
}
BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreationAPI_v5>a=[m apiForProtocol:@protocol(FxParameterCreationAPI_v5)];BOOL ok=a!=nil;
ok=[a addCustomParameterWithName:@"大鱼调色" parameterID:DYInspectorParameterID defaultValue:[[[DYInspectorToken alloc]init]autorelease] parameterFlags:kFxParameterFlag_CUSTOM_UI|kFxParameterFlag_USE_FULL_VIEW_WIDTH|kFxParameterFlag_DONT_DISPLAY_IN_DASHBOARD|kFxParameterFlag_NOT_ANIMATABLE]&&ok;
for(NSDictionary*r in DYDescriptors())ok=[a addFloatSliderWithName:r[@"title"] parameterID:[r[@"pid"]unsignedIntValue] defaultValue:[r[@"default"]doubleValue] parameterMin:[r[@"min"]doubleValue] parameterMax:[r[@"max"]doubleValue] sliderMin:[r[@"min"]doubleValue] sliderMax:[r[@"max"]doubleValue] delta:[r[@"step"]doubleValue] parameterFlags:kFxParameterFlag_HIDDEN|([r[@"notAnimatable"]boolValue]?kFxParameterFlag_NOT_ANIMATABLE:0)]&&ok;
@@ -73,12 +175,14 @@ BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreat
@end
@implementation DYInspectorToken
+ (BOOL)supportsSecureCoding{return YES;}
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInt:1 forKey:@"schema"];}
- (instancetype)initWithCoder:(NSCoder*)c{return [self init];}
- (id)copyWithZone:(NSZone*)z{return [[[self class]allocWithZone:z]init];}
- (instancetype)init{if((self=[super init])){_folds=[@{} copy];_schema=2;}return self;}
- (void)dealloc{[_folds release];[super dealloc];}
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInteger:_schema forKey:@"schema"];[c encodeObject:_folds forKey:@"folds"];}
- (instancetype)initWithCoder:(NSCoder*)c{if((self=[self init])){NSDictionary *v=[c containsValueForKey:@"folds"]?[c decodeObjectOfClasses:[NSSet setWithObjects:NSDictionary.class,NSString.class,NSNumber.class,nil] forKey:@"folds"]:nil;if(v)self.folds=v;_schema=[c decodeIntegerForKey:@"schema"];}return self;}
- (id)copyWithZone:(NSZone*)z{DYInspectorToken *v=[[[self class]allocWithZone:z]init];v.folds=_folds;v.schema=_schema;return v;}
- (id)interpolateBetween:(id)r withWeight:(float)w{return [[self copy]autorelease];}
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class];}
- (NSUInteger)hash{return 1;}
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class]&&_schema==[o schema]&&[_folds isEqual:[o folds]];}
- (NSUInteger)hash{return _folds.hash;}
@end
DYAssetState*DYReadAssets(id<PROAPIAccessing>m,CMTime t){DYAssetState*v=nil;id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];[g getCustomParameterValue:&v fromParameter:DYAssetsParameterID atTime:t];return [v isKindOfClass:DYAssetState.class]?v:[[[DYAssetState alloc]init]autorelease];}
BOOL DYWriteAssets(id<PROAPIAccessing>m,DYAssetState*v,CMTime t){id<FxParameterSettingAPI_v6>s=[m apiForProtocol:@protocol(FxParameterSettingAPI_v6)];return [s setCustomParameterValue:v toParameter:DYAssetsParameterID atTime:t];}
+2 -2
查看文件
@@ -12,9 +12,9 @@
- (void)dealloc{[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[super dealloc];}
- (BOOL)properties:(NSDictionary**)p error:(NSError**)e{*p=@{kFxPropertyKey_MayRemapTime:@NO,kFxPropertyKey_PixelTransformSupport:@(kFxPixelTransform_ScaleTranslate),kFxPropertyKey_VariesWhenParamsAreStatic:@NO,kFxPropertyKey_DesiredProcessingColorInfo:@(kFxImageColorInfo_RGB_LINEAR),kFxPropertyKey_NeedsFullBuffer:@YES};return YES;}
- (BOOL)addParametersWithError:(NSError**)e{return DYCreateParameters(_apiManager,e);}
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObject:DYInspectorToken.class];}
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObjects:DYInspectorToken.class,NSDictionary.class,NSString.class,NSNumber.class,nil];}
- (NSView*)createViewForParameterID:(UInt32)pid{return pid==DYInspectorParameterID?[[DYInspector alloc]initWithAPIManager:_apiManager renderer:_renderer]:[[NSView alloc]initWithFrame:NSZeroRect];}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
- (BOOL)pluginState:(NSData**)state atTime:(CMTime)t quality:(FxQuality)q error:(NSError**)e{
DYUniforms u;DYReadUniforms(_apiManager,t,&u);DYAssetState*a=DYReadAssets(_apiManager,t);double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:&copyAuto fromParameter:8800 atTime:t];NSDictionary*s=@{@"schema":@1,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{}};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
}
+64 -9
查看文件
@@ -1,4 +1,5 @@
#import "DYRenderer.h"
#import "DYModel.h"
#import "DYColorTables.h"
#import "DYLUTLibrary.h"
#import <QuartzCore/QuartzCore.h>
@@ -8,6 +9,42 @@
static BOOL fail(NSError**e,NSString*m){if(e)*e=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:m?:@"Metal 调色失败"}];return NO;}
static NSArray *inputFiles(){return @[@"",@"apple_log_to_rec709",@"arri_logc3_to_rec709",@"arri_logc4_to_rec709",@"blackmagic_film_gen5_to_rec709",@"canon_clog_bt709_to_rec709",@"canon_clog2_cinema_gamut_to_rec709",@"canon_clog3_cinema_gamut_to_rec709",@"dji_dlog_to_rec709",@"dji_dlog_m_to_rec709",@"fujifilm_flog_to_rec709",@"fujifilm_flog2_to_rec709",@"nikon_nlog_to_rec709",@"panasonic_vlog_vgamut_to_rec709",@"red_log3g10_rwg_to_rec709",@"sony_slog2_sgamut_to_rec709",@"sony_slog3_sgamut3cine_to_rec709",@"sony_hlg_bt2020_to_rec709"];}
static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){MTLTextureDescriptor*t=[MTLTextureDescriptor new];t.textureType=MTLTextureType3D;t.pixelFormat=MTLPixelFormatRGBA32Float;t.width=n;t.height=n;t.depth=n;t.storageMode=MTLStorageModeShared;t.usage=MTLTextureUsageShaderRead;id<MTLTexture>x=[d newTextureWithDescriptor:t];[t release];if(x)[x replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:values bytesPerRow:n*16 bytesPerImage:n*n*16];return [x autorelease];}
// A synthetic texture lattice uses exactly the production render path for Cube export.
@interface DYExportTile : FxImageTile { id<MTLTexture> _tex; uint64_t _registry; }
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry;
@end
@implementation DYExportTile
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry{if((self=[super init])){_tex=[texture retain];_registry=registry;}return self;}
- (void)dealloc{[_tex release];[super dealloc];}
- (id<MTLTexture>)metalTextureForDevice:(id<MTLDevice>)d{return d.registryID==_registry?_tex:nil;}
- (FxRect)tilePixelBounds{return (FxRect){0,0,(SInt32)_tex.width,(SInt32)_tex.height};}
- (FxRect)imagePixelBounds{return self.tilePixelBounds;}
- (uint64_t)deviceRegistryID{return _registry;}
- (FxImageOrigin)imageOrigin{return kFxImageOrigin_TOP_LEFT;}
@end
static BOOL managed(DYUniforms u,NSDictionary *paths){return u.cm.configured>=0&&(u.cm.configured>.5||(![paths[@"input"]length]&&u.inputProfile<.5));}
static BOOL identityCM(DYUniforms u){
DYCMSettings s=u.cm;
BOOL neutral=s.basisEnabled<.5||(s.exposure==0&&s.balanceStrength==0&&s.saturation==1&&s.contrast==0&&s.hiContrast==0&&s.shadowContrast==0&&s.white==1&&s.highlights==0&&s.midtones==0&&s.shadows==0&&s.black==0&&s.toe==.5f&&s.shoulder==.5f&&s.chromaMix==.5f);
BOOL transforms=(u.inputSectionEnabled>.5)==(s.outputEnabled>.5)&&((u.inputSectionEnabled<.5)||(s.inputTransfer==s.outputTransfer&&s.inputGamut==s.outputGamut&&s.toneMapping<.5));
return neutral&&transforms;
}
// An enabled but untouched display tool is mathematically neutral. Bypass its
// finite-domain lookup so that the default "all eyes on" does not clip CST HDR.
static void bypassNeutralTools(DYUniforms *u){
for(NSDictionary *section in DYSections()){
if(![@[@"curve",@"hsl",@"grading",@"primaries",@"levels",@"balance"]containsObject:section[@"key"]])continue;
BOOL neutral=YES;for(NSDictionary *row in section[@"rows"]){NSInteger offset=[row[@"offset"]integerValue];if(offset<0)continue;if(*(float*)((uint8_t*)u+offset)!=[row[@"default"]floatValue]){neutral=NO;break;}}
if(neutral)for(NSDictionary *row in DYDescriptors())if([row[@"pid"]isEqual:section[@"enabled"]])*(float*)((uint8_t*)u+[row[@"offset"]unsignedIntegerValue])=0;
}
}
static void bypassIdleSkin(DYUniforms *u){
if(u->curveSectionEnabled>.5||u->hslSectionEnabled>.5||u->colorGradingSectionEnabled>.5||u->primariesSectionEnabled>.5||u->levelsSectionEnabled>.5||u->blackWhiteSectionEnabled>.5||u->colorBalanceSectionEnabled>.5)return;
if(u->preLUTStrength!=0||u->postLUTStrength!=0||simd_any(u->extraPostLUTStrengths!=0))return;
const float *values=&u->exposure,*enabled=&u->exposureEnabled;
for(int i=0;i<13;i++){BOOL group=(i>=6&&i<=9)?u->colorSectionEnabled>.5:u->baseSectionEnabled>.5;if(group&&enabled[i]>.5&&values[i]!=0)return;}
u->skinProtection.x=0;
}
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
NSSet *_activeLUTPaths;
@@ -16,6 +53,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
NSObject *_previewLock;
NSData *_preview,*_lookLUTPreview;
CFTimeInterval _lastPreview;
BOOL _exporting;
}
@end
@implementation DYRenderer
@@ -52,7 +90,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyColorManagement"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
// Preparing before the first frame may use registry 0. Reuse those pipelines
// when the host subsequently supplies that device's actual registry ID.
@@ -67,9 +105,9 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
return [self textureForTable:table entry:e error:err];
}
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
// Normalize only this render copy. Folded groups retain their host parameters
// Normalize only this render copy. Disabled groups retain their host parameters
// and paths, while inactive LUTs neither load files nor affect any layer.
BOOL inputEnabled=u->inputSectionEnabled>.5;
BOOL inputEnabled=u->inputSectionEnabled>.5&&!managed(*u,paths);
NSString*input=inputEnabled?paths[@"input"]:nil;int profile=inputEnabled?(int)roundf(u->inputProfile):0;
if(!inputEnabled){u->inputProfile=0;u->preLUTStrength=0;}
if(!input.length&&profile>0&&profile<(int)inputFiles().count)input=[[NSBundle bundleForClass:self.class]pathForResource:inputFiles()[profile] ofType:@"dylut" inDirectory:@"InputLUTs"];
@@ -84,19 +122,26 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){@autoreleasepool{
[_activeLUTPaths release];_activeLUTPaths=[[NSSet alloc]initWithArray:paths.allValues?:@[]];
NSMutableDictionary*e=[self device:dst.deviceRegistryID error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d],output=[dst metalTextureForDevice:d];if(!input||!output)return fail(err,@"宿主图像纹理不可用");
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;
BOOL useCM=managed(u,paths);bypassNeutralTools(&u);float bwMix=fmaxf(0,fminf(1,u.cm.blackWhiteMix));if(bwMix<=0)u.blackWhiteSectionEnabled=0;
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;bypassIdleSkin(&u);
NSMutableDictionary*ps=e[@"pipelines"];NSNumber*format=@(output.pixelFormat);id<MTLRenderPipelineState>pipeline=ps[format];if(!pipeline){MTLRenderPipelineDescriptor*p=[MTLRenderPipelineDescriptor new];p.vertexFunction=[e[@"library"]newFunctionWithName:@"dyVertex"];p.fragmentFunction=[e[@"library"]newFunctionWithName:@"dyFragment"];p.colorAttachments[0].pixelFormat=output.pixelFormat;pipeline=[d newRenderPipelineStateWithDescriptor:p error:err];[p.vertexFunction release];[p.fragmentFunction release];[p release];if(!pipeline)return NO;ps[format]=pipeline;[pipeline release];}
MTLTextureDescriptor*td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;id<MTLTexture>straight=[d newTextureWithDescriptor:td];if(!straight)return fail(err,@"无法分配调色缓冲区");
id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyUnpremultiply"]];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
if(useCM&&!identityCM(u)&&u.cm.mix>0){
DayuRenderParams cm=DYCMRender(u.cm);cm.stages=(cm.stages&~1)|(u.inputSectionEnabled>.5?1:0);
if(cm.stages){id<MTLTexture>converted=[d newTextureWithDescriptor:td];if(!converted){[straight release];return fail(err,@"无法分配 CST 缓冲区");}
ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyColorManagement"]];[ce setTexture:straight atIndex:0];[ce setTexture:converted atIndex:1];[ce setBytes:&cm length:sizeof(cm) atIndex:0];[ce setBytes:&u.cm.mix length:4 atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[straight release];straight=converted;
}
}
float level=.5;id<MTLBuffer>scene=[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared];
if(u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
BOOL preview=NO;@synchronized(_previewLock){preview=CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
if(!_exporting&&u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
BOOL preview=NO;@synchronized(_previewLock){preview=!_exporting&&CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
MTLRenderPassDescriptor*rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=output;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>re=[cb renderCommandEncoderWithDescriptor:rp];[re setRenderPipelineState:pipeline];
float w=output.width,h=output.height;FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){top=1-top;bottom=1-bottom;}
DYVertex2D vs[]={{{w/2,-h/2},{r,bottom}},{{-w/2,-h/2},{l,bottom}},{{w/2,h/2},{r,top}},{{-w/2,h/2},{l,top}}};
if(dst.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)for(int i=0;i<4;i++)vs[i].position.y=-vs[i].position.y;
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,0,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
if(ok&&pb){@synchronized(_previewLock){
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
// The analysis kernel reads physical texture rows. Its result remains intact
@@ -112,7 +157,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
if(!ok)fail(err,cb.error.localizedDescription);[pb release];[straight release];[scene release];return ok;
}}}
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){
NSMutableDictionary*e=[self device:0 error:err];if(!e)return NO;NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;id<MTLDevice>d=e[@"device"];uint32_t n=33;NSUInteger count=n*n*n;id<MTLBuffer>out=[d newBufferWithLength:count*3*4 options:MTLResourceStorageModeShared];if(!out)return fail(err,@"无法分配 LUT 输出");id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyLUTExportKernel"]];for(NSUInteger i=0;i<ts.count;i++)[ce setTexture:ts[i] atIndex:i];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:out offset:0 atIndex:1];[ce setBytes:&n length:4 atIndex:2];[ce dispatchThreads:MTLSizeMake(count,1,1) threadsPerThreadgroup:MTLSizeMake(64,1,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted){[out release];return fail(err,cb.error.localizedDescription);}
NSMutableString*s=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 仅包含逐像素颜色;纹理、清晰度和画面分析不写入 LUT。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];float*v=(float*)out.contents;for(NSUInteger i=0;i<count;i++){if(!std::isfinite(v[i*3])||!std::isfinite(v[i*3+1])||!std::isfinite(v[i*3+2])){[out release];return fail(err,@"LUT GPU 输出含无效值");}[s appendFormat:@"%.8f %.8f %.8f\n",v[i*3],v[i*3+1],v[i*3+2]];}[out release];return [s writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
NSMutableDictionary *e=[self device:0 error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];const NSUInteger n=33,count=n*n*n,width=n*n,height=n;
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
id<MTLTexture>input=[d newTextureWithDescriptor:desc],output=[d newTextureWithDescriptor:desc];if(!input||!output){[input release];[output release];return fail(err,@"无法分配 LUT 色格");}
std::vector<__fp16>values(count*4);for(NSUInteger i=0;i<count;i++){float v[3]={(float)(i%n)/(n-1),(float)((i/n)%n)/(n-1),(float)(i/(n*n))/(n-1)};for(int c=0;c<3;c++)values[i*4+c]=v[c]<=.04045f?v[c]/12.92f:powf((v[c]+.055f)/1.055f,2.4f);values[i*4+3]=1;}
[input replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:values.data() bytesPerRow:width*8];
DYExportTile *source=[[[DYExportTile alloc]initWithTexture:input registry:d.registryID]autorelease],*dest=[[[DYExportTile alloc]initWithTexture:output registry:d.registryID]autorelease];
u.textureEnabled=0;u.clarityEnabled=0;u.dehazeEnabled=0;BOOL ok=NO;_exporting=YES;
@try{ok=[self renderSource:source destination:dest uniforms:u paths:paths error:err];}@finally{_exporting=NO;}
if(ok)[output getBytes:values.data() bytesPerRow:width*8 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0];[input release];[output release];if(!ok)return NO;
NSMutableString *text=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 包含 CST 与逐像素颜色;不包含纹理、清晰度和逐画面分析。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
for(NSUInteger i=0;i<count;i++){float rgb[3];for(int c=0;c<3;c++){float v=values[i*4+c];rgb[c]=v<=.0031308f?v*12.92f:1.055f*powf(v,1/2.4f)-.055f;if(!std::isfinite(rgb[c]))return fail(err,@"LUT 输出含无效值");}[text appendFormat:@"%.8f %.8f %.8f\n",rgb[0],rgb[1],rgb[2]];}
return [text writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
}}
@end
+6 -2
查看文件
@@ -16,6 +16,8 @@ typedef vector_float4 DYFloat4;
typedef uint32_t DYUInt;
#endif
#include "DYColorManagement.h"
typedef struct DYUniforms {
float exposure; // offset 0
float contrast; // offset 4
@@ -119,12 +121,14 @@ typedef struct DYUniforms {
DYFloat4 greenCurveExtraX; // offset 896
DYFloat4 blueCurveExtra; // offset 912
DYFloat4 blueCurveExtraX; // offset 928
DYCMSettings cm; // appended; recovered color arithmetic reads only the stable prefix
} DYUniforms;
typedef struct DYVertex2D { DYFloat2 position; DYFloat2 textureCoordinate; } DYVertex2D;
typedef struct DYRenderOptions {
DYUInt outputPremultiplied;
DYUInt reserved[3];
float blackWhiteMix;
DYUInt reserved[2];
} DYRenderOptions;
#ifndef __METAL_VERSION__
@@ -133,7 +137,7 @@ typedef struct DYRenderOptions {
#else
#define DY_ABI_ASSERT _Static_assert
#endif
DY_ABI_ASSERT(sizeof(DYUniforms) == 944, "DYUniforms must match recovered GPU ABI");
DY_ABI_ASSERT(offsetof(DYUniforms, cm) == 944, "DYUniforms must match recovered GPU ABI");
DY_ABI_ASSERT(offsetof(DYUniforms, exposure) == 0, "exposure offset");
DY_ABI_ASSERT(offsetof(DYUniforms, contrast) == 4, "contrast offset");
DY_ABI_ASSERT(offsetof(DYUniforms, highlights) == 8, "highlights offset");
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>16</string>
<string>17</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>16</string>
<string>17</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
+56
查看文件
@@ -0,0 +1,56 @@
# 大鱼调色 FxPlug4:CST 与独立折叠交接
更新时间:2026-11-01,Asia/Shanghai。
当前正式 APP 为 **1.2.0(17)**,已通过公证、唯一安装及 FCP 宿主验收。实际编译源码 `48b00c85799b0226ba32aba3f2e5397aa0e509ed`,公证 `f25ae46e-92da-4470-842e-128bdb232aa8`。后续文档、打包和 Release 记录不改变 APP 编译来源。
## 项目身份
- 当前源码:`/Volumes/备份/大鱼调色/大鱼调色`
- 远程:`https://dayu.media/git/dayu/dayu-color.git`,main
- 主 Bundle ID:`com.dayu.color`;插件:`com.dayu.color.XPC`
- 唯一正式 APP:`/Library/Plug-Ins/FxPlug/大鱼调色.app`
- 固定缓存:`/Users/mac/Library/Caches/CodexBuilds/com.dayu.color`
- Xcode 方案:`Wrapper Application`,AppKit 检查器与独立 XPC
父目录中的大鱼调色盘、CST、一级调色还原均为独立仓库;本轮仅只读参考 CST,没有改动其他产品。
## 最新用户要求与已实现行为
1. 输入相机 LUT 改为大鱼 CST 的输入转换 → 工作空间一级 → 输出转换。曲线和色域独立,工作选择由一级和输出共享。新默认输入/输出 Gamma 2.4 / Rec.709,工作 DaVinci Intermediate / Wide Gamut,自动色调映射关闭。
2. **一级调色与基础调整默认展开,其他模块折叠,所有小眼睛默认开启。** 标题只折叠/展开,小眼睛只启用/旁路;按实例保存,正常退出重开保持独立状态。全部还原恢复上述默认。
3. 全眼睛开启时保持默认画面中性:黑白混合默认 0%;未调整的显示域工具在渲染副本中旁路其有限域查表;无实际调色时不运行肤色保护,避免裁切 CST 的 HDR 输出。UI 参数和眼睛不被改写。
4. 旧 schema 1 工程和旧输入 LUT/档位保留原解释;输入组提供“旧版输入 → 改用 CST”,显式编辑 CST 参数也会迁移。旧预设可读,新预设记录有效兼容模式。
5. 原基础、HSL、色轮、曲线及五层风格 LUT 继续在 CST 输出之后工作。后台 LUT 加载、编码兼容与预览机制保留。Cube 导出复用生产路径,包含 CST/一级,不包含空间细节和逐画面统计。
## 关键实现
`DYColorManagement.h` 保存原始控制与 CST/BASIS 参数换算;`DYCSTTypes.h` 是参考布局;`tools/kernels/CSTKernel.ll`、`BasisKernel.ll` 来自固定 CST 源码节点,摘要见 `research/CSTIntegration.json`。生产构建使用仓库内文件。
`DYUniforms` 保留前 944 字节,末尾追加控制。旧参数 ID 不变,新增从 2236 开始。`DYRenderer.mm` 在直通 RGB 缓冲上运行 CST,再进入原有调色链;未加载的旧输入 LUT 不参与新 CST。`DYGrade.metal` 包含新边界,CPU/Metal 都保留透明度与预乘处理。
`DYInspectorToken` schema 2 新增 folds 字典;`toggleSection:` 只写字典,`groupEnabled:` 只写启用参数。`DYModel.mm` 定义 3 个 CST 阶段和所有新默认。输入与工作/输出的曲线、色域按稳定数学 ID 保存,不使用菜单位置代替 ID,选择参数不插值。
## 本轮验证
- `verification/CSTIntegration.json`:正式安装路径 153 项检查,含真实 AppKit 折叠动作、模型/归档、IOSurface/Metal、黑白混合、Cube 与 21 组独立 CST 像素对照。
- `verification/HostCSTAndDisclosure.json`:FCP 12.4,独立合成验收项目;默认、折叠/眼睛、曝光 0.70、Sony 输入、ACES 工作空间及正常保存重开通过。旧验收工程仅打开观察,没有改值。
- `verification/InstalledSelfTest.json`:正式安装常规自检 110 项。
- `verification/CSTRecovery.json`:远端独立恢复编译提交,151 文件和 strict/full fsck;重建 Metal 与正式库摘要一致。
- `verification/Delivery.json`:APP 签名、公证、票据、Gatekeeper、唯一登记与宿主路径。
像素对照是指定 GPU/样本的原生运算检查,宿主记录是实际界面与保存检查;没有宣称所有宿主逐像素等同。未验收 Motion、Intel 和旧系统。
## 后续交付与数据保护
本版本标签 `v1.2.0-cst-fold-20261101`;正式包位置为上级“发行包/大鱼调色-1.2.0.pkg”。最终 PKG 公证/验包与 Release 下载结果以 `verification/Package.json`、`verification/Release.json` 的本版本记录为准;生成或更新时不得引用旧版结果冒充新版本。
源码检查点:`python3 tools/checkpoint.py '<说明>' <已审查路径...>`,入口自带 Git 锁。APP:`python3 tools/deliver.py`,持有产品交付锁至宿主验收。PKG:`python3 Packaging/build_pkg.py --pkg-forge-repo /Users/mac/Documents/dayu-git/repositories/pkg-forge`。Release:`python3 Packaging/publish_release.py --tag v1.2.0-cst-fold-20261101 --notes Packaging/Release-1.2.0.md`。各脚本已管理适用锁,外层不要重复获取。
用户 LUT 在 `~/Movies/大鱼调色LUT/look LUTs`;本轮读取 N12 的 26 项测试选择,无新导入、无删除,验收实例最后全部还原。用户媒体、原有项目、收藏和偏好不进入 Git/包。`tools/create_cst_host_fixture.py` 只生成产品缓存中的合成验收资源;FCPXML 技能校验使用精确 1.12 DTD,通过无警告。
恢复完整步骤及历史节点见 `RECOVERY.md`。当前 AppKit 项目无需引入 SwiftUI 或改变产品固定身份。
## 1.2.0 正式 PKG
正式包 `../发行包/大鱼调色-1.2.0.pkg`,13,818,397 字节,SHA-256 `9fba4f0c1a313a6da8374b683f7e6b41af70388d7a7a180e26b9e236a9ba64a1`。PKG 公证 `c7b97b0f-57c8-45d3-a4d7-7db8e8694487`,Accepted;Installer 团队 B3W25FX5H5、票据、Gatekeeper 及 20 项展开验包通过。包内 APP 与已验收正式安装一致,未重复运行安装器。